MCPcopy Create free account
hub / github.com/andrew-gresyk/HFSM2

github.com/andrew-gresyk/HFSM2 @2.12.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.12.1 ↗ · + Follow
2,265 symbols 4,026 edges 111 files 56 documented · 2% updated 18d ago2.12.1 · 2026-06-10★ 6151 open issues

Browse by type

Functions 971 Types & classes 1,294
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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: 10, 11, 12, 13, 14, 15
  • GCC (ARM): 13
  • Clang: 13, 14, 15, 16, 17, 18
  • AppleClang (Intel): 17
  • AppleClang: 15, 17

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 and embedded friendly
  • 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

Core symbols most depended-on inside this repo

Shape

Class 1,280
Method 695
Function 276
Enum 14

Languages

C++100%
Python1%

Modules by API surface

test/reported/stress_size.cpp402 symbols
external/doctest/doctest.h320 symbols
include/hfsm2/machine.hpp101 symbols
examples/calculator/main.cpp85 symbols
test/test_internal_payloads.cpp73 symbols
test/test_internal_transitions.cpp67 symbols
test/test_plans_payloads.cpp55 symbols
test/test_plans.cpp52 symbols
development/hfsm2/detail/structure/forward.hpp43 symbols
test/test_randomize.cpp35 symbols
test/test_plan_external_payloads.cpp33 symbols
examples/snippets/wiki_utility-theory.cpp33 symbols

For agents

$ claude mcp add HFSM2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page