hohav / peppi

Rust parser for Slippi SSBM replay files
MIT License
37 stars 9 forks source link

Ground IDs #62

Closed Walnut356 closed 2 months ago

Walnut356 commented 1 year ago

I did a quick check of the ground ID's on the tournament legal stages, which I've left in tables below. There's 2 holes in this data: stadium transformations, and the little divots on the walls of yoshi's (though I'm not sure they even have IDs).

Implementation isn't 100% straight forward. Every stage has little areas next to the ledges - sometimes multiple per side - that count as "different ground". We could represent it exactly how it is in the game, or we could just lump them all in under "it's the main stage". If they are lumped, do we lump yoshi's slants in as well? They're the same conceptually, but they affect gameplay way more.

The other option is to just put in both, likely with the generalized one being the default (e.g. ground_id and ground_id_exact).

ID tables

ID 65535 is always the respawn/entry platform FD: | ID | Position | | ------------- | ------------- | | 0 | Left edge | | 1 | Main | | 2 | Right edge | Yoshi's: | ID | Position | | ------------- | ------------- | | 0 | Randall | | 1 | Left plat | | 2 | Left slant | | 3 | Main | | 4 | Top plat | | 5 | Right plat | | 6 | Right Slant | Battlefield: | ID | Position | | ------------- | ------------- | | 0 | Left edge | | 1 | Main | | 2 | Left plat | | 3 | Top plat | | 4 | Right plat | | 5 | Right edge | Stadium: | ID | Position | | ------------- | ------------- | | 34 | Main | | 35 | Left plat | | 36 | Right plat | | 51 | Left edge (outside) | | 52 | Left edge (inside) | | 53 | Right edge (inside) | | 54 | Right edge (outside) | DL: | ID | Position | | ------------- | ------------- | | 0 | Left plat | | 1 | Right plat | | 2 | Top plat | | 3 | Left edge | | 4 | Main | | 5 | Right edge | FoD: | ID | Position | | ------------- | ------------- | | 0 | Left plat | | 1 | Right plat | | 2 | Top plat | | 3 | Left edge (outside) | | 4 | Left edge (inside) | | 5 | Main | | 6 | Right edge (inside) | | 7 | Right edge (outside) |

NickCondron commented 1 year ago

This is really good. Don't see a need to lump anything together. Determining if a given ground id is part of the main stage would be a function. 65535 is just -1 in two's complement reinterpreted as an unsigned integer, so probably the spec (and by extension peppi) have that type incorrectly marked as unsigned.

If you want to add this to peppi, I think you could model the code after what I did to include costumes (#9) which was modelled after how action_state::State works. You could create a function like is_main_stage() like how I did for the costume color functions here https://github.com/hohav/peppi/commit/918b850ae776470b0f18ac1953e83a14ac5f9240 (decided not to add to peppi, but the technique would be the same I think). Macros can be finnicky though so if you decide to work on this and need help lmk.

Ideally, we'd have a more thorough list of all the ground IDs for all stages. I understand this is a lot of work though. Perhaps the data could be automatically extracted from the Gr*.dat files in melee's code. In any case, you'd want to design the code such that expanding the known list of ground IDs would not be a breaking change.

hohav commented 2 months ago

Moved to ssbm-data#3.