Game Development Reference
In-Depth Information
Appendix A. Answers to Review Questions
This appendix presents you with the answers to the review questions at
the end of Chapters 1 - 12 .
Chapter 1: Game Programming Overview
1 . The early consoles were programmed in assembly language because they
had an extraordinarily small amount of memory and processing power. A
high-level language would have added too much overhead, especially be-
cause compilers at the time were not nearly as optimized as they are
today. Furthermore, the early consoles typically did not have development
tools that would have been able to facilitate high-level language usage,
even if it were feasible.
2 . Middleware is a code library written by a third party to solve a specific
problem in games. For example, Havok is a physics library that many
game companies use in lieu of implementing their own physics systems.
3 . There are many possible answers to this question. Here is one:
For Galaga , there are two inputs to process: the joystick, which allows the
player's ship to move left or right, and the fire button. The majority of the
work in the “update world” phase of the game loop would be to spawn
and then simulate the AI for the enemy ship squads that come in. Further-
more, the game needs to detect collisions between the enemy projectiles
and the player, as well as detect the player projectiles against the enemy.
The game needs to keep track of how many waves have gone by and in-
crement levels as appropriate. The only outputs for this game are video
and audio.
4 . Other outputs in a traditional game loop might include sound, force feed-
back, and networking data.
5 . If the rendering portion takes roughly 30ms, and updating the world takes
20ms, a traditional game loop would take 50ms per frame. However, if the
rendering is split into its own separate thread, it can then be completed in
parallel with the world updates. In this case, the overall time per frame
should be reduced to 30ms.
Search WWH ::




Custom Search