News:

The forum has been updated to SMF (2.1.3)!
Please be patient as we work to polish up the place and update features as we can.

Main Menu

Airs Rock Glitch: Sprites Overwiting RAM?

Started by Plexa, 08, July, 2014, 03:38:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Plexa

Hi all! So a little bit of back story, part of the GS2 speedrun of Airs Rock involves using the Retreat glitch to bypass a lot of the puzzles in the first two rooms. We do this by entering the second room and ending up at a "dead end", set Retreat to a hotkey and have retreat fail, save+reset which loads us back into the first room. Interestingly, the objects from the second room load into the first room which unloads a whirlwindable rock in the top right which allows us to walk right past where it usually is, into the second room and continue on our glitch-happy way. Once weird thing about this is that as we get close to leaving the area there is a noticeable slowdown in Felix's movement. So I was messing around with the area trying to work out (a) why this happens (b) how to prevent it.

So far as (a) is concerned, it's pretty obvious that the RAM is being overloaded with sprites to keep track of. The tornado generating statues from the second room are generating tornadoes in the first room, and those tornadoes aren't being removed, thus you have an excess of sprites. Now I don't *really* care about (b), but it would be nice to know. What I found out in my investigations was something far more interesting.



After spending a reasonably long time in the room, that starts happening to the menu. This is actually pretty interesting but I am in no way experienced enough to know how to make the best use of this. If people can point me towards the memory addresses of the portraits that would be a huge help to get me started investigating the implications of this glitch. If you'd like to play around with this yourself, I've included a battery file which you can load into your emulator of choice -- just hang around in the first room for a reasonably long time and it should start happening (don't get a fight though, it will refresh everything).

FrozenWrath

Interesting event you got there, Plexa.

Say, didn't I meet you back at GSRise?

Luna_blade

Wow, quite the find!

BTW, did you ever make that TLA speedrun? I was really impressed by your 100% djinn run in GS.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Plexa

#3
I have a pretty terrible sub-7 hour any% here http://www.twitch.tv/tl_plexa/c/4298762 I plan to beat this in the next few weeks (current goal; sub-6 hours). Part of the reason I've been looking into these things. The difficult thing is finding 7+ hours to do a run :D

Update: Played around with this a little more, it looks like the game is completely maxed out on sprites. If I try to use Move, pound (or any psynergy that generates sprites) the psynergy just doesn't show up. It still works though, as illustrated by when you use avoid, but interesting nonetheless. Using retreat will crash the game, my guess is that as it removes part of the Felix sprite it frees up some space to generate the dots that retreat makes appear, then possibly the game loads too many of these sprites and crashes/soft locks. I would be very surprised if there wasn't some kind of exploit that arises from this.

Update2: Made a little video of the glitch; http://www.twitch.tv/tl_plexa/b/545777916

Atrius (He/Him)

#4
Hmm... I've found three places so far where they're filling up areas in memory.  They aren't overflowing any of it, once the game reaches capacity it just stops trying to add new ones.

020322EC - 020342EC =  Player, and NPC data area
03001300 - 03002100 = Data for how sprites are displayed
03002100 - 03002700 = Data for how sprites are loaded


Since they're in the NPC memory area, each new one that's created has code associated with it that gets run.  This is probably where the slow-down is really coming from since the game engine doesn't try to draw sprites that are outside of the view (Some towns have too many NPCs to fit all of them in video memory at one time as it is).  True some memory is still allocated for each NPC's sprites so it can keep track of stuff like animations, and scaling.  I wouldn't expect the processing for their sprites while offscreen to be as heavy as handling collision detection, and whatever other code the tornadoes have associated with them though.

As for the graphical glitches in the menu, they're a bit of a mystery to me at the moment.  It would be easy enough to say that it's because the game engine's location for handling how sprites are displayed is already too full, and certainly enough that IS why Jenna is the only character that appears on your screenshot.  However, the face portrait is a different type of graphic, it isn't handled in the same location as other sprites.  I'm not even sure where it is handled, so it's possible that location is being filled to capacity as well, but again it's a different type of graphic so it's curious that it would be.  The fact that face portraits are displayed on the status screen, where no item/psynergy icons (Which are a similar graphic type to the portraits) are displayed seems to support the idea that this glitch fills their area in memory as well though...
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Plexa

Thanks for that Atrius. I'll take a deeper look into this and see if I can see what's going on.