Skip to content

andrew-gresyk/HFSM2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

156af7c · Feb 1, 2025
Jan 10, 2025
Mar 24, 2019
Oct 14, 2020
Feb 1, 2025
May 25, 2024
Aug 13, 2022
Feb 1, 2025
Feb 1, 2025
Feb 1, 2025
Dec 20, 2023
Feb 6, 2021
Dec 26, 2023
May 25, 2024
Mar 13, 2019
Feb 6, 2023
Feb 6, 2023
Jan 10, 2025
Aug 13, 2022
Feb 6, 2023
Dec 20, 2023
May 25, 2024

Repository files navigation

License: MIT GitHub Release Date
CII Best Practices
GCC, Clang ARM GCC MS VS
Gitter Discord Twitter Follow


HFSM2

High-Performance Hierarchical Finite State Machine

Header-only heriarchical FSM framework in C++11, with fully statically-defined structure (no dynamic allocations), built with variadic templates.


Compiler Support

  • Visual Studio: 2015, 2017, 2019, 2022
  • GCC: 8, 9, 10, 11, 12, 13
  • GCC (ARM): 9
  • Clang: 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  • AppleClang: 15, 16

Quick Start


See Also


Documentation


Feature Highlights

  • Permissive MIT License
  • Written in widely-supported modern(ish) C++11
  • Header-only
  • Convenient, minimal boilerplate
  • Fully static, no dynamic allocations
  • Uses inline-friendly compile-time polymorphism, no virtual methods are used
  • Type-safe transitions: FSM.changeTo<TargetState>() with optional payloads
  • Flexible configuration using HFSM2_ENABLE_* macros
  • Scalable, supports robust state re-use via state injections
  • Hierarchical, with a selection of composite (sub-machine) and orthogonal regions
  • Gamedev-friendly, supports explicit State::update()
  • Also supports traditional event-based workflow with State::react()
  • Inspect anything: previous and current transitions, state activation status, and more!
  • Game AI-friendly with dynamic planning support
  • Utility theory support (max score and ranked weighted random)
  • Serializable, with activity and transition history support
  • Debug-assisted, includes automatic structure and activity visualization API with #define HFSM_ENABLE_STRUCTURE_REPORT
  • Built-in logging support

3rd Party Libraries

  • doctest unit testing framework
  • XoShiRo pseuto-random number generators

Get In Touch


Special Thanks