State Machines / FSMs
The Ultimate Guide to FSMs in Games | |
Topics: State Machines; Genres: General
Abstract: The intention of this article is to give a comprehensive overview of FSMs in games. This article examines various FSM architectures and discusses the systems that surround them. The FSM is studied at the game integration level, the update scheme, and efficiency/optimization. Extensions are discussed for extending state functionality (OnEnter, OnExit), extending the structure into hierarchical and fuzzy state machines, and coordinating multiple FSMs. Various FSM schemes are compared and contrasted.
Stack-Based Finite-State Machines
Topics: State Machines; Genres: General
Abstract: Finite-state machines are a very popular technique for developing game AI, but they lack any intrinsic capability for remembering the way a client has traversed the state graph. We discuss a technique for extending the traditional finite-state machine with a state stack in order to allow it to remember previous states, thereby allowing AI agents to resume the execution of behaviors that were previously interrupted. In some cases, such as modeling behaviors with an FSM, this can often allow us to create much simpler and more concise finite-state machines than would be possible with a standard FSM.
Implementing a Data-Driven Finite-State Machine | |
Topics: State Machines; Genres: General
Abstract: This article describes an implementation of a data-driven Finite State Machine (FSM) class. Using a data-driven design allows quick tweaking of state transition logic without having to recompile any source code, as well as the ability to associate different character behavior to different AI characters through external data files. The FSM class presented in this article instantiates FSMs as defined in external data files, automates the evaluation of state transition logic and provides the functionality to define functions to be executed when entering, updating, and exiting states.
Finite-State Machine Scripting Language for Designers | |
Topics: State Machines, Scripting; Genres: General
Abstract: AI is often implemented with finite state machines (FSM's) or layers of finite state machines, which are difficult for game designers to edit. Looking at typical AI FSM's, there are design patterns that occur repeatedly. We can use these patterns to make a custom scripting language that is both powerful and approachable. The technique can be further extended into a "stack machine" (pushdown automata) so that characters have better memory of previous behaviors.
Parallel-State Machines for Believable Characters Thor Alexander (Hard Coded Games)
Massively Multiplayer Game Development, 2003.
Topics: State Machines; Genres: General
Abstract: This article focuses on the use of parallel sets of state machines in order to control an AI character.
The three parallel state machines include a movement layer, a posture layer, and an action layer.
Implementing a State Machine Language | |
Topics: Architecture, FSM, State Machines, Scripting; Genres: General
Abstract: This article presents a robust way to structure your state machines with a simple language. This State Machine Language will not only provide structure, but it will unleash some powerful concepts that will make programming games much easier. While the language itself is simple, it embodies some very important software engineering principles such as simplicity, maintainability, robustness, and ease of debuggine. The following article, "Enhancing a State Machine Language through Messaging," expands on this language with a powerful communication technique using messages. Each article has full soure code on the accompanying CD-ROM.
Enhancing a State Machine Language through Messaging | |
Topics: Architecture, FSM, State Machines, Scripting; Genres: General
Abstract: The previous article, "Implementing a State Machine Language," set the groundwork for a powerful language that can structure state machines in a simple, readable, and very debuggable format. In this article, that language will be expanded to encompass the problem of communication between AI game objects. This communication technique will revolutionize the State Machine Language by allowing complicated control flow and timers. Full source code is included on the accompanying CD-ROM.
Designing a GUI Tool to Aid in the Development of Finite State Machines
Topics: General, FSM, State Machines, Tools; Genres: General
Abstract:
Agent Cooperation in FSMs for Baseball
Topics: FSM, State Machines, Cooperation; Genres: Baseball, Sports
Abstract:
Function Pointer-Based, Embedded Finite-State Machines | |
Topics: State Machines, FSM; Genres: General
Abstract: This article examines the use of function pointers in creating a inheritable base class for adding finite state machine (FSM) functionality to new or existing C++ classes. The function pointer implementation replaces the classic switch statement implementation commonly used to implement FSMs in game objects. The new implementation is designed to work well with C++ inheritance and function overloading and offers better performance and less maintenace than switch implementations.
Finite State Machines (FSM) Jason Brownlee
AI-Depot.com, July 2002.
Topics: FSM, State Machines; Genres: General
Abstract: Provides a practical introduction to FSM, within the context of AI as a control
technique. The emphasis is placed on practicality both in definition and explanation, rather
than heavy theoretical or mathematical concepts.
A Generic Fuzzy State Machine in C++ | |
Topics: Fuzzy Logic, FSM, State Machines; Genres: General
Abstract: Fuzzy Logic provides an attractive alternative to more crisp forms of finite state decision making. This article builds on the presentation of the Finite-State Machine class from the first Game Programming Gems book, by introducing a generic Fuzzy-State Machine class in C++. The concepts of fuzzy logic are presented and an example of applicability for computer game AI is offered. The FSMclass and FSMstate classes from the first GEMS book are converted into fuzzy logic versions, and source code is provided for review.
Designing a General Robust AI Engine | |
Topics: Architecture, FSM, State Machines, Scripting; Genres: General
Abstract:
A Finite-State Machine Class | |
Topics: Architecture, FSM, State Machines; Genres: General
Abstract: Simple Finite-State Machines are powerful tools used in many computer game AI implementations. This article introduces a generic C++ class that implements a Finite-State Machine that is useful to the novice for learning about Finite-State Machines and as a building block for more complex AI implementations in development projects. The processes of a Finite-State Machine are presented, an example game implementation is offered as an example of Finite-State Machine usage, and source code illustrates how finite-state functionality can be implemented in a generic manner.
|