Simplegame was created for a public workshop on FLOSS game design, looking at Python, Blender and issues in game narrative. It was created to demonstrate a simple game engine structure incorporating three basic AI techniques: obstacle avoidance, personality and conversation.
simplegame, the coloured dots represent agents within it (click to enlarge)
The obstacle avoidance system is based on a simple 'whisker' principle originally developed for use in robotics and adapted for gaming by Mike Mika and Chris Charla, and is similar to the system used in the 'demoville' prototype. The system is fully described in an article by Mika and Charla, "Simple, Cheap Pathfinding", in the book AI Game programming Wisdom (Charles River Media).
The personality system is a very simple example of using Fuzzy Logic to link environmental events to agent actions determined by a personality quality. In this case the proximity of other game agents is used to trigger movement either towards or away from them depending on how friendly or unfriendly the agent is.
The conversation aspect of the demo is an adaptation of the classic ELIZA chatbot algorithm, in which different vocabularies are set for the agent depending on the same personality trait used to determine the movement behaviour. The ELIZA algorithm is based on an example originally written by Jez Higgins, http://www.jezuk.co.uk/cgi-bin/view/eliza. A version of this was also used in the 'demoville' prototype.
A handout on basic Python was provided in the workshop. This can also be downloaded and is freely available under the Free Documentation License.
Simplegame source code: simplegame.tgz
Python handout: [PDF] [OpenOffice]