Tuesday, April 10, 2007

Are you ready? Let's code game boy

Let’s get started.

Steps to code our first game boy Project.

First, open Visual HAM

Second create new Project

Third write code

Fourth Select – Project – Execute – Build, then Run in VBA

That’s it , your first console game…

Saturday, April 7, 2007

The history

When I was young I began to program GW-Basic, then come to light Turbo Basic, Great!! .bas code made .EXE. Then I found pascal and I discovered some hidden books about programming graphics with it. I tried to read a BMP from file with PASCAL, when I did it, I began to write some code to emulate something like “Galaxian” (Do you remember?, some spaceships falling and shooting). Then I needed a kind of tool to draw my own bitmaps, and I wrote it. My firs BMP tool!. (I’ll upload to my site soon). Then I began to program PAC-MAN, and some of my students at a small computing school learned how to make their first game. Only one student finished the game. (And me, J). Then, I discovered the fabulous and fantastic C, and C++ programming language when I was a student at “Instituto Tecnológico de Aguascalientes” and I began to probe it, it was really fantastic, memory, arrays, pointer, wow!. even serial and parallel port control. Then I wrote some game code with C++. Actually I’m still writing C, C++ and now C# to program games, with VC++ 6.0, VC++.NET and HAM, but the funniest and real challenge is assembly language. Have you ever seen the DOOM game source code? Go and get it, I got it when John Carmack made it free for download, and I downloaded it!! It has some assembly!! Then, I discovered Visual HAM for Game Boy (C++ yeah!!)
Now I’m working too with the new tools: Maya, 3D Studio, Truespace (My firs 3D tool), and Blender, but unfortunately I’m busy with the MCAD, MCTS, and MCPD certifications but I try at night to work a little bit with these 3D tools to refresh my memory.

I bough this books from Amazon and others, I encourage you to get them, (and read them, J)

1. Tricks of the Windows Game Programming Gurus

2. Tricks of the 3D Game Programming Gurus

3. Programming the Nintendo Game Boy Advance, The Unofficial Guide

4. 3D Math Primer for graphics and game development

5. Learning Maya 5 Foundation

6. Gráficos en 3D

7. Programación de gráficos en Pascal.

8. Programación gráfica con DGE y Clipper

Programming GameBoy Advance

Game boy released in 1989 is a fun device to program, you’ll using C++ of course. We’ll use the Advace SP version to test our code.

List of components:

  1. A computer with Windows 2000, XP, or Vista
  2. Visual HAM http://www.console-dev.de/visualham.html  and HAM SDK http://www.ngine.de  (Better if you can get a Nintendo GameBoy SDK) or you can use Visual Studio 2005 instead (with HAM of course)
  3. If you want to see your code running in a real GameBoy get a Flash Advanced Linker or a writable GameBoy cartridge. I got my own in http://www.lik-sang.com (Now the page is down but you can search with “GBA Flash Cartridge “ and buy one.)
  4. Of course, a Game Boy,  I have a beauty blue Game Boy Advance SP. (For those who know I bought it at “La líneaJ)


Remember, it is pure C & C++.

More on nest blog…



Thursday, April 5, 2007

Components of a game

Components of a game


Basically a game has the following components


  • Initialization
    • Standar operations, variable creation
    • x=0;
    • game_status = INIT;
    • (Notice you will use C++)
  • Enter game loop
    • The process enters the loop
    • while(game_status != game_over)…
  • Retrieve player input
    • Catch keystrokes and input devices signaling
  • Perform AI and game logic
    • AI = Artificial intelligence (It’s serious, even pacman has AI)
    • Physics = Do you remember parabolic shoot formula?
    • Math = 2D & 3D matrix
    • Calculate images = More, and more math,
    • Create 3D objects = Load 3D templates created on 3Dstudio, Truespace, Maya, blender(free!)
  • Render next frame
    • Is the new image read?, Render..
    • Copy from memory to screen
  • Synchronize display
    • How many frames will you render in a minute? Usually 30fps
    • Put a delay between rendering scenes
  • Loop
    • Back to the beginning
    • Let’s start again
  • Shutdown
    • Release resources
    • That’s all folks


Some advice:

Are you a pre-OOP developer? Great! Then you know how things works without objects, but don’t leave far away, this is a game, not a business application.

Don’t use tiers, properties, helper classes, etc. you really need the minimal amount of code. Just code C++.

(Actually it is possible to use C#, but I really prefer C++ and fight the memory, pointers and others)

Please, get a good DirectX tutorial and reference and use the last development tools.

You don’t need VStudio, just a C++ compiler, but if your games are Windows based then use a Microsoft tool like VStudio.NET 2005

If you work for the ‘empire’ use tool for the ‘empire’ y if you work for the rebellion use a X-Wing





Monday, April 2, 2007

Think about it: FUN

If you can imagine your self playing your own game, it's done. If you are starting to write code without a clear idea about you are going to see in the screen, you are lost. Just think about it: FUN. This game should make have a lot of fun. It doesn't need the latest AI and 3D engine to be fun. What is your choice? Pac-man or a boried 3D game? Do you understand?