Skip to content

Instantly share code, notes, and snippets.

Last active January 18, 2024 18:02
Show Gist options
  • Save scheibo/045cd2bdd3ace620f4061de5b07cf2d7 to your computer and use it in GitHub Desktop.
Save scheibo/045cd2bdd3ace620f4061de5b07cf2d7 to your computer and use it in GitHub Desktop.
pkmn/engine v0.1.0 Roadmap

Integration testing all -Dcalc and -Dchance possibilities

  • MIN_CHANCE and MAX_FRONTIER_SIZE test cases and proofs
  • verify checkHit commits are all correct (eg. Leech Seed / Substitute etc)
  • transitions called on every Test update
  • transitions called within fuzz tests
    • empirically prove MIN_CHANCE and MAX_FRONTIER_SIZE

Complete documentation

  • ensure all docs are updated to reflect -Dchance and -Dcalc and new options patterns
  • update
    • explain different engine types and tradeoffs
    • explain what is a damage calc
    • explain -Dchance & -Dcalc design
    • explain transitions + runtime analysis and provide tips on optimizing for use case
  • update gen{1,2}/
    • -Dchance and -Dcalc covered
    • transitions function
    • RNG tables

JS client API

  • support -Dchance and -Dcalc (de)serialization
  • efficient + ergonomic pattern for Options
  • efficient way to wrap library and produce an "uber-binary"
  • unit test coverage for bindings
  • proof of concept for using -Dchance / -Dcalc to power a damage calc (@pkmn/dmg)


  • async API
  • @pkmn/engine bundled into PocketMon running in browser
    • WASM bindings
    • bundling with Vite working
  • Ensure possible to write a wrapper of the JS package for 0 ERROR
    • enable .{ .advance = false, .ebc = false } for engine and have it preserved across updates
    • write 0 ERROR worker manager logic and solve bundling/wire up with Web Workers
    • benchmark running in browser in all workers


  • optimize transitions function
  • ensure no regressions to benchmark from new features
  • profile performance and optimize further


  • Refactor State param out of Generation II implementation after all tests are complete
  • Verify all loads and stores of every varialble in wram.asm for Generation I & II
Copy link

scheibo commented Oct 10, 2023

Copy link

scheibo commented Oct 23, 2023

  • example overhaul
    • move examples top level
    • examples for multiple gens
    • examples for computing probability
    • examples for calc (damage cap handing!)
  • protocol overal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment