A Pokémon battle simulation engine
a year ago
- #Zig
- #Simulation
- #Pokémon
- The project is under heavy development with breaking changes in the main branch; users are advised to wait for the v0.1 release.
- A minimal, performance-optimized Pokémon battle simulation engine designed for tooling, embedded systems, and AI use cases.
- The engine is frame-accurate and bug-for-bug compatible with original game code and Pokémon Showdown simulator.
- Over 1000× faster than Pokémon Showdown in compatibility mode, extensively tested and documented.
- Not a fully featured simulator but a low-level library for advanced use cases.
- Includes engine code in Zig and reference driver code in TypeScript.
- Binaries available on GitHub releases; source code can be built with Zig compiler.
- Zig v0.11.0 recommended; performance issues with versions before 0.12.0-dev.876+aaf46187a.
- Driver code installable via npm; requires compiled Node/WASM addons.
- Supports Pokémon Showdown compatibility mode and protocol message logging.
- Provides battle structure functions for state updates and valid choices per generation.
- C API available for libpkmn; intended as foundation for bindings in other languages.
- Zig package simplifies state instantiation and logging; supports FixedRNG for deterministic outcomes.
- Known bindings available for C++ and Python.
- Includes pkmn-debug tool for decoding binary data structures and protocols.
- Development roadmap includes stages for implementing generations I-IV, with modern generations soft-blocked on decompilations.
- Out of scope features include team validation, mod support, and non-standard battle variants.
- Distributed under MIT License.