Heem Patel

Game programmer

AI Project Blog

Round 2: Finite State Machines and Messaging System

Posted by Heem on February 24, 2014 at 11:55 PM

Hey oh!

So I finished this chapter about a week and half ago, and I implemented the first part of the world and the messaging system. It looks sort of boring mainly because its all in console and is not really interactive. BUT! What is it about?

Its about how agents have states associated with them. Agents? States? What ? So , Agent is basically an entity in a game that can move on its own and has the AI behavior. Now, a state can be loosely defined as the behavior that entity is exhbiting at a particular snapshot in time. So think of it like your day to day life, in the mornign when you go towards work , you are in "Travelling" state, then once you reach work, your state changes to "Working". That is essentially what state means for Agents as well. 

In the chapter the author took the example of a miner, and talked about it while building a state machine for the miner to follow. The miner had "Mine for Gold" , "Quench Thirst" , "Deposit Gold" and "return home" states. 

In the second part the author talks about implementing a messaging system, and introduces the miners wife as a new entity. The miners wife has states such as "work", "cook food" and the Miner basically sends a message to his wife when he returns back home.

This was an essential chapter basically because the state machine is a fundamental thing to AI. Think about it this way, if theres a a Cop and a Robber game, the Cop could have states such as Patrol, pursue Robber etc, where as Robber could have states such as "Hide" , "Shoot an arrow" , "Run" etc.  

Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

0 Comments