To start off I will explain a little about the core of the game. One important design feature is that it is designed to be completely deterministic. This helps avoid super massive brain damage. Having it otherwise would just be a debugging nightmare. All of the game's logic is updated in fixed time steps while the game's rendering can run as fast as the computer can handle.
Since the game is completely deterministic, what the program does will depend entirely on the user's input. A nice result of this is that for a certain set of inputs the simulation (game) will behave exactly the same each time it is run. This means that if you log all the inputs into the game, you can reply the game again and again. This can be used to create a replay system for a player to watch saved replays but it is also very useful for debugging. If a bug is encountered, the game can be run again using the logged inputs to replay the game exactly the way is was played when the bug was encountered and hopefully determine what caused the bug.
In the main game loop the controls are polled once every time the logic is updated. To create a log of events you simply need to save the time step at which the event was produced and the information relating to the event. Each time the game logic updates (the controls are polled) the number of time steps are incremented.
Saturday, January 6, 2007
Subscribe to:
Posts (Atom)
