Once again, we are back to knife-fighting in the pit. This is the traditional game design approach at Gaslamp Games; we fight to defend our ideas, using oversized weapons and our bare hands. Recently, however, somebody has been seen fashioning a rudimentary lathe – a troubling development that will either upset the balance of power or be absolutely useless.

So what have we been fighting about? Well, all sorts of things. Today, let’s talk about the AI. The AI Cabal – Nicholas, Chris Whitman, and myself – have been hashing things out, and what we have is a data-driven, XML-based monstrosity that is sure to please everybody. The whole goal of Clockwork Empires’ AI is to provide characters in the game (currently referred to, in-engine, as Citizens, although this is not something that makes David happy; after all, we are a monarchy) with unique, rational, and relatable behaviours. The plan is to start simply, and add layers of complexity to the game until the goals and aspirations of characters appear to the player naturally and gracefully.

A citizen job consists of three basic parts: a collection of requirements, a utility function, and a finite state machine that consists of a collection of other, smaller, finite state machines. Hooray for complexity.

When a citizen has no job, they poll the job blackboard (an invisible construct, as far as the player is concerned) asking for work. The jobs dispatcher looks at the list of all jobs that a citizen can perform (based on what, we don’t know – right now, it’s basically just a whitelist), and returns one job that it would like the citizen to do. The citizen then looks at all the jobs that it wants to do that aren’t on the blackboard – things like eating, sleeping, and ingesting opium pods – and ranks each of these jobs according to two things:

Do I have enough resources to complete the job? If not, this job is invalid. (i.e. if there is no lumber, I can’t cut trees; if there are no opium pods, I cannot ingest opium pods.) How happy will this job make me?