Thursday, April 12, 2012

Quantum Hierarchical State Machines

Quantum Hierarchical State Machine

I really like Miro Samek's Quantum Hierarchical State Machines.  They solve issues with regular state machines and treat state machines much more like classes.  This helps prevent state machine explosion (and spaghetti code).

For a good C# implementation you can get the source code here: http://code.google.com/p/gqhsm/ 

Also, there is a good GUI tool written in C# for editing the state machine and saving the code into XML format included in that code.  Here's a screen shot of some Zombie A.I. I did in the editor and it worked pretty well inside Unity 3D.

Zombie AI jpeg
Zombie A.I. Hierarchical State Machine
The Zombie A.I. Stateproto file can be retrieved from here: ZombieAI.sm1

No comments:

Post a Comment