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

 

 

 

 


No comments: