Game Development Reference
In-Depth Information
Options
Most games have some user-configurable options like sound effects volume, whether
your controls are Y-inverted or not, and whether you like to run your game in 4:3 or
in 16:9 widescreen. These options are useful to stick in something simple like an
XML file so that anyone can easily tweak them, especially during development.
Multiplayer Games
One thing you might not have considered this event-based, logic/view architecture
makes it simple to have a multiplayer game. All you need to do is attach more
human views to the same game logic. Okay, I
s a little more trouble
than that because each view needs to share what is likely a single display from the
application layer, figure out how to iterate the additional controls, and so on. That
stuff is fairly easy compared to getting the overall architecture built to support multi-
ple players, especially if it wasn
'
ll come clean. It
'
'
t designed to do so from the very beginning.
Game Views for AI Agents
A great argument for the harsh breakdown between game logic and game views is
that humans and AI processes can interact with the game logic through exactly the
same event-based interface. An AI agent
'
s view of a game generally has the compo-
nents shown in Figure 2.6.
The stimulus interpreter receives the same events that all other game views receive:
object movement, collisions, and so on. It
s up to the AI programmer to determine
how the AI will react to each event the AI agent receives. It would be easy enough for
an AI process to ignore certain events or react to events that are filtered by the
human view, and this would certainly affect what the AI process would do.
For example, AI agents might react to sound effects, which are the result of game
events such as objects colliding, footsteps, or noisy objects like radios being activated.
If an AI is supposed to be deaf,
'
it merely filters the sound events. If an AI is
Figure 2.6
An AI agent
'
s view of the game.
 
 
 
 
Search WWH ::




Custom Search