- Research the data structures and code flow
- Add a
data.zig
file with basic data types (Battle
,Side
,Pokemon
, ...) and fields- un-optimized - exact layout tweaked in step 11
- Generate data files
- reorder enums for performance
- update
Lookup
if necessary
- Generate test files
- reorganize logically and to match previous generations
- add in cases for known Pokémon Showdown bugs and cartridge glitches
- 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 intotest.zig
- copy over
helpers.zig
- copy over
- Implement unit tests against Pokémon Showdown behavior
- update Bugs section of generation documentation as bugs are discovered
- Implement mechanics in
mechanics.zig
based on cartridge research- update protocol as necessary, also updating documentation, driver, and tests
- generate updated
protocol.json
- 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
- track RNG differences and update generation documentation (group all RNG is in
- Unit test the engine in both cartridge and Pokémon Showdown compatibility mode
- Implement a
MAX_LOGS
unit test- document in
PROTOCOL.md
- validate with Z3
- document in
- Optimize data structures
- generate updated
layout.json
anddata.json
- generate updated
- Implement driver serialization/deserialization and writes tests
- Expose API for new generation
- Write
helper.zig
and implementchoices
method- matching
Choices
code required in showdown
- matching
- Ensure fuzz tests pass
- Ensure integration tests pass
- Add
chance.zig
andcalc.zig
files with data types - Instrument code with
Chance
andCalc
calls - Update unit tests with
expectProbability
and ensure chance/calc overrides roundtrip - 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
- Add support to the JS driver for
calc
andchance
- update
layout.json
to include offsets required
- Benchmark new generation
- Finalize documentation for generation
- Bump pinned
@pkmn/sim
version inpackage.json
and runnpm install
- Run
npm run test:integration
, update rolls and behavior of Pokémon Showdown tests insrc/test/showdown
- Update Zig mechanics tests to match the updates applied to the integration tests
- Update Zig engine code to cause the updated mechanics tests to pass
- Update documentation to match new behavior/bugs
- Remove effects from blocklists and helpers if necessary