TheTrackerCouncil / SMZ3Randomizer

Tracker presents: a casual standalone version of the Super Metroid & A Link to the Past Crossover Randomizer with built-in automatic item tracking and Twitch integration
https://vivelin.net/projects/smz3
MIT License
25 stars 8 forks source link

See if Tracker can automatically track Pegworld #505

Closed CPColin closed 1 week ago

CPColin commented 1 month ago

I was thinking about other stuff we could do with custom ASM and Matt suggested that Tracker could auto-track Pegworld. I found some RAM values via this project and some experimentation: https://github.com/walkingeyerobot/alttp-disassembly

The count of flattened pegs is stored as four bytes, starting at address $04C8. Tracker could watch this address and say "pop" for every value it increases by. We might have to find a way for Tracker to speak faster, so she could react to hammer-dashes.

We could also watch the "Map16" data, which is two kilobytes of 16-bit values, starting at address $7E2000. The pegs all start with value 0x021B and end up as 0x0DC5 when they're flattened. The specific RAM addresses for the tiles we care about are here:

          $7E2822   $7E2826   $7E282A   $7E282E   $7E2832
          $7E2922   $7E2926   $7E292A   $7E292E   $7E2932
$7E2A1E   $7E2A22   $7E2A26   $7E2A2A   $7E292E   $7E2A32
$7E2B1E   $7E2B22   $7E2B26         
$7E2C1E   $7E2C22   $7E2C26         

Tracker could watch these and update the display to accurately reflect the current state.

MattEqualsCoder commented 1 month ago

I don't recall exactly what the limit is (I think 0x200/512), but QUSB2SNES has a limit in the amount of memory that can be requested, so trying to get the memory locations of each individual peg might be a bit difficult. It might be best to go with the first option.

I think the main thing is we'd probably only want this check to run while on that screen to avoid making other auto tracking checks run less frequently.

CPColin commented 1 month ago

Yeah, it's probably not worth adding the ASM we'd need in order to pack the peg states into three or five bytes or whatever. We could definitely enable the check on that screen only. Or maybe when the player says "we're going to Pegworld"? Or were you picturing that the player would no longer have to enable Pegworld first?

MattEqualsCoder commented 1 month ago

Honestly, while I hadn't thought about it, I do wonder if we could automatically enable pegworld similar to the shaktool mode due to the issues betus has with enabling pegworld mode.

CPColin commented 1 month ago

I bet we could start checking that RAM location when the player enters that screen and automatically enable Pegworld as soon as the value is non-zero. That'd be pretty close to what happens now when Tracker hears "Hey Tracker, peg."

CPColin commented 3 weeks ago

It also just occurred to me that, since this RAM value also changes when opening the TR portal, we could have Tracker rarely say something like, "Pop. Oops, wrong screen." when hammering those three pegs.

CPColin commented 3 weeks ago

Good news: Tracker pronounces "pop", "popop", "popopop", etc., all the way up to "popopopopopopop", at least, how you'd expect, so we won't need to tinger with <prosody> stuff!

CPColin commented 3 weeks ago

Okay, initial implementation is in the two branches. I'm gonna sleep on it and see if I hate it later.