Wow, there's a topic for SMT, huh?
I'm working on a proof of concept test TAS for the
glitched route and have stumbled across a really lovely problem: The fastest route involves manipulating a 1/256 encounter, then a 1/3 chance of getting the correct encounter, then another 1/256 chance of getting the item drop after the fight. This wouldn't be so bad if the game's RNG didn't only advance when it's called, and "when it's called" is shockingly limited. As far as I can tell, it's overworld movement (specifically movement, turning/bumping walls in the 1st person sections doesn't call it but moving from space to space does) and in-battle actions. In theory, that means getting the encounter in the first place and getting the item drop after can be manipulated separately, so it isn't one single one in 200000 or whatever, but given the limited opportunities to change the RNG and the limited number of ways of doing so, I can't imagine bruteforcing it. I've figured out a few things to the best of my ability (which isn't much, because I am an idiot):
1. The room that the encounter appears in is set, and the encounter is fixed to happen. There's no need to manipulate a random encounter into happening, just what gets encountered.
Here's a userfile that reaches that room.
2. 0x050A is the address that determines what gets encountered, 0x050B is the address that determines whether or not a battle is a boss battle. 050A can give different results for the same values depending on whether or not 050B is 0 (regular battle) or 1 (boss battle). Specifically, we need 050A to be 23 and 050B to be 1, giving the David boss encounter. I haven't determined what controls whether or not an item will be dropped.
3. 0x0ED5, 0x0ED7, 0x0ED8, and 0x0ED9 all relate to the RNG in some way, though my limited knowledge (i.e, me being an idiot) can't quite figure out how. Interestingly, when triggering a random encounter, if you instead wait a frame before moving into the encounter tile, the encounter won't happen but the RNG addresses will still change to the same value. Moving any other time will make the values different.
4.
The RTA record performs a specific set of steps to manipulate the outcome I want, but it's a fairly lengthy sequence that involves saving and resetting first. I'm assuming this means the RNG gets reset to a fixed state on resets, though I haven't tested this yet.
I'll be looking further into this, but I am an idiot and I think I'm going to need some help here. Good thing this is an incredibly popular game with a worldwide release that everyone knows about and posts about constantly!