http://tasvideos.org/userfiles/info/11397947979589904
Running through the game using lsnes. I think I'm beating the published run.
Except I forgot to pack a few extra GEMs. I need to go back and pick up some more.
http://tasvideos.org/userfiles/info/11398015642958275
Such as, say... In this run. Except do something like this in the second world.
Then again, there is a need to do a bunch of this in the first world to speed things up. I need more GEMs. I might also get two extra EXP to level up earlier, as I go out of my way for extra damage at one point.
The RNG is interesting. It uses 16 bytes, starting from address
7E0302.
Whenever the game needs a new RNG,
* Add byte 16 to byte 15. Add byte 15 to byte 14. Add byte 14 to byte 13. And so on. Include the carry of the last addition to the next.
* Add the number 1 to byte 16
* The RNG value used is in byte 1
But that's not the only way the game modifies the RNG. Whenever there is a screen transition, it also copies a two-byte value in address
7E0312 into
7E0302. Address
7E0312 is a frame-based timer that resets to -1 after this transfer. The old value in bytes 1 and 2 are thrown away for this transfer.
Effectively, this means that, when entering a screen, bytes 1 and 2 only care how long it took for you to get there since the last transition, and bytes 3 to 16 are only affected by how many RNG rolls have been made. I can tweak bytes 1 and 2 by throwing away a few frames, and I can tweak the rest by interacting with enemies, either by (not) killing them, or dancing around the ones that use the RNG.
Oh, and stepping on a cleared lair that releases something back at the town takes two screen transitions. Meaning it doesn't matter how long it took you to clear it, as far as the RNG is concerned, just how long it takes for you to clear the texts.
As for GEMs dropping, the game takes the RNG (byte 1) and modulo 100 for a range of 0 to 99. It is looking for low numbers to determine how big your GEM is. With the way modulo works, this does give a slight edge in getting larger GEMs, exactly 1.171875% for every intended 1%.
The thresholds depend on what world you're in. The first world has a pittance for a drop rate, and the last one doesn't drop small ones. Grabbing my GameFAQs post:
Lrge: Mid :Smll - (avg.) Place
1% : 3% : 96% - (1.21) Grass Valley
3% : 5% : 92% - (1.47) GreenWood
5% : 7% : 88% - (1.73) St. Elles
7% : 9% : 84% - (1.99) The Mountain of Souls
9% : 11% : 80% - (2.25) Dr. Leo's Laboratory
11% : 13% : 76% - (2.51) Magridd Castle
51% : 49% : 0% - (7.55) World of Evil
Wielding the Lucky Blade doubles these thresholds, regardless of whether you actually kill them with the sword itself.
By some amusing... Luck... I was able to spot and collect two large GEMs in the first room. I may redo large parts of this TAS in order to optimize the value of this gain, and to see if I can't pull out even more GEMs.
I'll share more thoughts later.