Game Development Reference
of AI code devoted to carrying out the decisions of the AI. Once the decisions are
made, implementation of the actions is deemed to be something the game world
provides. For now, we will also minimize the amount of AI code devoted to
sensing the world. Reasoning about the world is the purview of the AI, but the
raw state data about the world is something the world should provide to the AI.
Professional AI programmers have to be vigilant to ensure that the world will
indeed provide the AI with critical data it needs. ''Vigilant'' in this usage often
means that professional game AI programmers wind up writing a large portion of
the sensing and action code needed by their reasoning code.
The rich world for the thermostat AI begins with the room temperature. The
room temperature will provide the changing conditions that prompt the AI to
react intelligently. The AI also needs a furnace to control in order for it to react.
The AI itself will do the intelligent part, but that code will be separated out and
not part of the simulation.
Note that our AI keeps no memory of the past. Our AI deals only in the current
temperature. If the AI needed knowledge about prior temperatures to help it
reason, it would have to remember them itself. The world simulation should not
keep this data because it exists solely to help the AI. More sophisticated AI will
retain memories of the past or suppositions about the future.
Small amounts of data are well served by ad hoc organization, but larger amounts
need formal organization. This is known as knowledge representation (KR).
Our thermostat AI cannot directly change the world temperature; it can only
turn on the furnace. If our AI needed to reason about a world that was warmer, it
would need to simulate or partly simulate that world and reason using the
simulation. As the programmer, we would need to design the simulation, and
that design would be the KR for it. (We will cover KR more explicitly in future
1. Drag a Label control to the top-left part of the form and change the Text
property to Ambient.
2. Drag another Label control to the right of the first label and change its Text
property to Set Point.
3. Drag a third Label control to the right of the others and change its Text
property to Status.
4. Drag a NumericUpDown control below the Ambient label.