stormsword/stormsword — pull request #68 by bdickason (2014-08-21 04:44:38+00:00)
Title: Implement a Command Stack - A slightly more complex but much more flexible AI

A Command Stack allows you to 'push' a command onto the stack when a certain event happens.

e.g. "When a player gets near me, charge at him."

When the condition is no longer met, the command is 'popped' off of the stack and the character resumes doing whatever it was doing beforehand.

When you have multiple mobs linked together with some info, you can create decent AI patterns that make you feel like the computer actually knows wtf it's doing.

This approach was recommended here: http://www.reddit.com/r/gamedev/comments/2dvb1s/behavior_trees/cjtozp9