Get the latest tech news
A Pokémon battle simulation engine
A minimal, complete, Pokémon battle simulation engine optimized for performance - pkmn/engine
The C API doesn't export any helpers for creating or accessing the opaque battle objects - it's instead intended to be used as the foundation for more ergonomic bindings in other languages(the lack of namespaces and bit fields having an implementation-defined layout in C are the main contributing factors to the sparseness of what libpkmn chooses to expose). The pkmn Zig package exposes helper methods to simplify state instantiation and any Writer can be used when logging is enabled to allow for easily printing e.g. to standard out or a buffer. Developers who wish to use the engine in other languages should find writing bindings against libpkmn relatively straightforward based on the existing documentation, though to simplify the process even further src/data contains JSON dumps of all of the Pokémon data, structure sizes and offsets, and protocol information used by the reference driver code.
Or read this on Hacker News