Skip to content

Latest commit

 

History

History
65 lines (62 loc) · 3.8 KB

NOTES.md

File metadata and controls

65 lines (62 loc) · 3.8 KB

Adding a new Generation

  1. Research the data structures and code flow
  2. Add a data.zig file with basic data types (Battle, Side, Pokemon, ...) and fields
    • un-optimized - exact layout tweaked in step 11
  3. Generate data files
    • reorder enums for performance
    • update Lookup if necessary
  4. Generate test files
    • reorganize logically and to match previous generations
    • add in cases for known Pokémon Showdown bugs and cartridge glitches
  5. Copy over shared code/files
    • copy over README.md for new generation
    • copy over imports and public function skeletons in mechanics.zig
    • copy Test infrastructure and rolls into test.zig
    • copy over helpers.zig
  6. Implement unit tests against Pokémon Showdown behavior
    • update Bugs section of generation documentation as bugs are discovered
  7. Implement mechanics in mechanics.zig based on cartridge research
  8. Adjust mechanics for Pokémon Showdown compatibility
    • track RNG differences and update generation documentation (group all RNG is in Rolls)
    • ensure all bugs are tracked in documentation
    • add logic to tests to block any unimplementable effects
  9. Unit test the engine in both cartridge and Pokémon Showdown compatibility mode
  10. Implement a MAX_LOGS unit test
  11. Optimize data structures
  12. Implement driver serialization/deserialization and writes tests
  13. Expose API for new generation
  14. Write helper.zig and implement choices method
    • matching Choices code required in showdown
  15. Ensure fuzz tests pass
  16. Ensure integration tests pass
  17. Add chance.zig and calc.zig files with data types
  18. Instrument code with Chance and Calc calls
  19. Update unit tests with expectProbability and ensure chance/calc overrides roundtrip
  20. Implement transitions function
  • add Rolls helpers for new generation
  • include transitions function call in fuzz tests
  • determine MAX_FRONTIER_SIZE and add constants to API
  1. Add support to the JS driver for calc and chance
  1. Benchmark new generation
  2. Finalize documentation for generation

Updating @pkmn/sim dependency

  1. Bump pinned @pkmn/sim version in package.json and run npm install
  2. Run npm run test:integration, update rolls and behavior of Pokémon Showdown tests in src/test/showdown
  3. Update Zig mechanics tests to match the updates applied to the integration tests
  4. Update Zig engine code to cause the updated mechanics tests to pass
  5. Update documentation to match new behavior/bugs
  6. Remove effects from blocklists and helpers if necessary