0
\$\begingroup\$

I'm new to game development and design, I've been looking forward to doing FSM AI design as it seems interesting to me, but I have a question that I see no answer for in the internet.

I've seen FSM diagrams from, for example, Pac-Man, and I noticed that the FSM has no accept states, it makes sense because the enemies are always active and in their different states (Wandering, chasing Pac-Man, running from Pac-Man, recovering in their house) What obviously stops the FSM of the enemies in Pac-Man is either Pac-Man dying or the level ending, but that seems more like brute force than a design decision.

I can imagine some FSM where the enemy just "dies" and that would be an acceptation state as it ended it's process, but again, in many sources I see that some designs just have no accept states. Could someone explain why is this?

Also, what would you do to prevent no-accept states FSM?

\$\endgroup\$
1
\$\begingroup\$

When designing AI, you usually have behaviour for every possible situation while the character is alive. Even when they are just standing around, you usually want them to play some kind of animation, and of course wait for triggers to transition to another state.

In many cases, the final (accepting) state defines the logic of the character dying (or the vehicle exploding, or whatever you have). In more complex setups, you would then play an animation, maybe notify other objects, and then delete the object. In simpler games, like Pac-Man, you might not have an animation, but instead just call the object's destructor.

This means that often you do not have that accepting state as an actual object, and therefore it does not appear in a UML or FSM diagram, because it is merely an imaginary state. The transition to that state is deleting the object, where physically it does not have a state anymore. Theoretically, it is then in a state of non-existance.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.