For me, writing a game is itself a game, or at least an equivalent pass-time. But who has time to actually play games these days? After reading about Squidi's Tiny Crawl World and Tiny World Cities, I thought it would be neat to make a game that plays itself! Sure, it probably wouldn't be that great to watch or play with, but it sounds like a lot of fun to make!


Each AI has a stack of goals. Goals might be simple like “Move to (x,y)”, “Pickup this object”, or complex like “Kill every monster.” A goal might have certain conditions. For example, to pick up an object, you must be standing near it. This will add the “Move” goal to the goal stack. Once the “Move” goal has completed, (by moving onto the point specified) the goal is pushed off of the stack, and the “Pickup” goal will be resumed. When the “Pickup” goal has completed, (by picking up the object) the goal is pushed off the stack, and the next goal will be resumed.

There are generic goals too, like “Find”. This will find the closest something, and apply the specified goal to it, like “Kill” or “Pickup”.

Goals can be arbitrarily complex. This makes it easy to give out quests. For instance, a quest could be:

  1. If you don't have a sword, create one.
  2. Kill 10 monsters.
  3. Collect 5 flowers.
  4. High-five someone.
  5. Bring the flowers back to the quest giver.

Each part of the quest may involve adding more intermediate goals.


I've made some videos of my AI in action so far. I'm not an artist, so people are blue squares, and monsters/objects are red squares.

Gathering AI

The goal of these AI is the pick up all of the objects (red squares) and bring them back to the corner.

Dumb Agents

A* Agents

A* Agents, Sharing Work

Fighting AI

In this case, the red squares are monsters, which the people have to fight. The people gain levels as they kill monsters, which eventually makes them much more powerful.

rpg_aquarium.txt · Last modified: 2010/02/26 02:30 by Ryan Fox
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki