^ Up



A Behavior-Based Artificial Intelligence System for the Frosh

(And everything else in the game)

The behavior of the Frosh character is governed by some 25 behaviours that encompass over 5,000 lines of code.  Although the specifics of these behaviours have changed over the course of the project, for the most part the Frosh behaviours have held true to the ideas I hashed out back in the winter of 1996.  This directed flow diagram shows how the original behaviors we decided on fit together.  (Click on the image to view it in more detail).

AI Flowchart.gif (296312 bytes)

Each Frosh also keeps track of eight integer-based and six boolean "properties," ranging from their resillience and ability to sustain weight on their shoulders to their thoughtfulness when approaching a decision and their climbing ambition.  In addition, there are a number of "global" properties -- such as morale -- that fluctuate as the game progresses. 

These characteristics tend to improve as the frosh gain experience, and they're also affected by events that the player can trigger during the game.  A frosh that you keep beaming with apples, for example, is going to be injured temporarily, but come back with a vengence.  A frosh that you feed pizza will no longer be hungry.  Frosh enjoy splashing ArtScis, but the thrill grows old fast.  The 114 Exam makes the Frosh scatter, but their intelligence goes up a notch as they learn from it (by osmosis).  And so on.

The "global" properties include eight different "boosters" that affect how the Frosh handle different situations.  For example, what should you do if you're on an upper level of the pyramid with only one person above you and someone else beside you.   Should you climb up?  Hold your ground?  Perhaps jump off and reduce the overall weight of the pyramid? 

It became clear as development progressed that these sorts of decisions were critical to the evolution of a "teamwork" model among the Frosh.  The graph below (with "time" on the x-axis and "value of booster" on the y-axis) shows how the different characteristics periodically improve.  The introduction of Pop Boy into the pit (at the 6th time unit on this graph) triggers a change in behaviour that gives the Frosh a much better sense of how to distribute weight throughout the pyramid structure.  The boosts that follow coincide with Pop Boy's "lessons" for the frosh.

Frosh Characteristics Improving.gif (248905 bytes)

What this doesn't show you, however, is the work that went into making them behave as a team.  There was nothing more difficult to code than convincing teamwork.  After a year of half-baked attempts, I had a chance to take notes while watching Sci '01 climb their pole.  Here's a page from my notes (click on it for more details (like the mud and lanolin)).

Sci 01 Pit Notes.GIF (616277 bytes)

I got a sense of a number of things, including the way the Frosh figured out how to get their act together and work as a team.  While I considered turning my results into a sort of Stephen Covey motivational video, I ended up using them instead to simulate the slow transition from chaoes to order.

Watch the Frosh the next time you play the game.  Their first few attempts will end in dismal failure, regardless of how slack the player is in trying to stop them.  Each time they topple you'll see groups of Frosh thinking and regrouping.   Notice how each attempt gets them a little closer to the tam and a little bit more like cohesive teamwork.  It's pretty cool, but it's not artificial life just yet.   That'll have to wait 'til the next project...

If you're interested in the frosh AI, you might also be interested in a Neural Net extension to the AI I developed called Zambesi.


^ Up

Legend of the Greasepole Website maintained by Rob Burke. Last updated October 2004.