Game Development Reference
number for the temperature, each set point also has a start time. One number has
become four numbers. Also, this thermostat has two inputs from the outside
world: the current temperature and the current time.
Real thermostats usually rely on their own clock instead of asking the outside
world what time it is. That said, real thermostats, depending on their imple-
mentation details, often fail to stay synchronized with the correct time. Power
failures, daylight saving time, and even changes in which weekend daylight
savings time changes conspire to make real thermostats make bad decisions. To
avoid this form of artificial stupidity, our thermostat will lack a time-of-day clock
and will ask the outside world what time it is whenever it wants to know.
At first glance, our original thermostat had three things to deal with: one action,
one piece of state data, and one piece of world data. This new thermostat has
more. It has one action, four pieces of state data, and two pieces of world data. If
the different categories do not interact, overall complexity relates to the sum of
the different elements. In that case, our complexity has gone up seven-fold. Life
for an AI programmer is rarely so kind, however. If the different categories do
interact, we multiply to get a gauge of complexity. In that case, our complexity
has gone up eight-fold. Not surprisingly, this new thermostat is hard to find on
the market. While it saves money compared to the first one, it is not intelligent
enough to compete with more complex offerings.
Implementing this thermostat is left as an exercise for the reader. Note that the
core AI function call does not need to be changed, only the wrapper. Readers
taking the slow and steady approach will want to take the time and help cement
their skills with Visual Studio and VB. More advanced readers will hold off until
we get to a more realistic example.
Our first two thermostats deal with only heat. Adding air conditioning means
adding another output and another piece of state data. Our complexity count is
then two actions, five pieces of state data, and two pieces of world data. These
interact at least partially, giving us a potential comparative complexity product of
20. The code can no longer be written without thought or debugged at a glance.
And like the heat-only version of this thermostat, this thermostat is not intelli-
gent enough to compete in the marketplace. Implementation is again left to the
Our fourth thermostat has four set points instead of two. This level of complexity
is suitable for many households, and such thermostats are widely available. The