StateMachineKit 2.0.0

dotnet add package StateMachineKit --version 2.0.0
                    
NuGet\Install-Package StateMachineKit -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StateMachineKit" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StateMachineKit" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="StateMachineKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add StateMachineKit --version 2.0.0
                    
#r "nuget: StateMachineKit, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package StateMachineKit@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=StateMachineKit&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=StateMachineKit&version=2.0.0
                    
Install as a Cake Tool

StateMachineKit

StateMachineKit is a flexible, plug-and-play finite state machine (FSM) toolkit for .NET / game development. It provides a lightweight abstraction for defining states, transitioning between them, and integrating with engines (such as Godot via the companion StateMachineKit.Godot package).

Packages

Package Version Description
StateMachineKit 2.0.0 Core abstractions (interfaces, discovery attribute, helpers) supporting .NET 8 and .NET Standard 2.1.
StateMachineKit.Godot 0.0.1 Godot (C#) integration layer depending on the core package.

Key Features

  • Generic, owner-driven state machine: IStateMachine<TContext> / IState<TContext>
  • Attribute-based automatic state discovery ([DiscoverableState])
  • Extension methods for ticking (Update / FixedUpdate)
  • Pluggable design; you keep your concrete state definitions decoupled
  • Godot integration package for engine-specific hooks

Quick Start (Core)

public sealed class IdleState : IState<MyActor> { /* ... */ }
public sealed class MoveState : IState<MyActor> { /* ... */ }

// Assuming you've already defined classes
// that implement IStateMachine and IStateOwner.

var actor = new MyActor("Player");
var fsm = FiniteStateMachine.Create(actor);
fsm.Initialize<IdleState>();

// In your update loop
fsm.Tick(deltaTime);

Godot Integration

Install the StateMachineKit.Godot NuGet package and reference it from your Godot C# project. The Godot layer adds engine-friendly owner definitions and can be extended to tie into lifecycle callbacks (_Process, _PhysicsProcess).

Versioning

  • Core at 2.0.0 introduces improved initialization semantics and packaging metadata
  • Godot integration starts at 0.0.1 (early preview)

Roadmap

  • Source generator for compile-time state registration
  • Transition validation & visualization hooks
  • Async lifecycle (optional)

Contributing

Issues and PRs are welcome. Please include tests for behavioral changes.

License

MIT – see license.md.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on StateMachineKit:

Package Downloads
StateMachineKit.Godot

Godot integration layer for StateMachineKit finite state machine library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 173 8/25/2025
1.0.0 169 8/13/2025