Awesome Open Source
Awesome Open Source

License: MIT Build status Build Status Language grade: C/C++ Gitter


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 14, 15, 16
  • GCC 5, 6, 7, 8, 9
  • Clang 3.7, 3.8, 3.9, 4, 5, 6, 7, 8, 9, 10

Quick Start


See Also

  • FFSM2: High-Performance Flat Finite State Machine

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 pylymorphism, no virtual methods are used
  • Type-safe transitions: FSM.changeTo<TargetState>() with optional payloads
  • Scaleable, 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

Receive Updates


Get In Touch


Special Thanks


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
c-plus-plus (17,636
cpp (1,247
game-development (453
embedded (259
cpp11 (245
header-only (150
state-machine (103
embedded-systems (69
mit-license (68
modern-cpp (47
game-dev (44
fsm (35
template-metaprogramming (18

Find Open Source By Browsing 7,000 Topics Across 59 Categories