Advertisement
Chrezm

On deliberately manipulating objects in Wing Fortress

Jan 15th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.72 KB | None | 0 0
  1. Here goes a more technical explanation of what is going on (please correct me if I am wrong): the game loads general purpose objects in different consecutive sections of RAM, also called slots. We can label them 10, 11, 12, 13, 14, 15 ... (in RAM, the start address for each slot is B400, B440, B480, B4C0, B500, and so on). When the game deletes an object (either because Sonic is going away from the area or another object/event triggered its deletion), the game frees up that slot by clearing out the entire section (i.e. fills with zeroes). Furthermore, when the game tries to load an object (either because Sonic is approaching the area or because another object/event triggered its apparition), it will load it in the lowest available slot possible, so if at a given time slots 11 and 13 are available, the game will use slot 11 first. Most importantly, if it needs to load two or more objects at the same time, it seems as if it will try and load objects with lower IDs first. Now, in Wing Fortress, unless you do something terribly fancy, most objects are despawned once you make it just before the boss area, so the only active objects by that time are the flame in Robotnik's escape ship (yes, it is an object), which is loaded in slot 10, and the boss controller object in slot 11.
  2.  
  3. (Credit to marzo for this part of the explanation) On the other hand, Sonic may stand on certain objects. When you do that, the game sets a certain flag in the character's state so that gravity no longer applies (so you don't fall through an object) and also stores the location in RAM of such object in such a way that it also goes 10, 11, 12, ..., so that the character knows at all times what object it is standing on. When the player loses contact with the block by walking off any of its edges, the object sends an instruction so that the game clears the standing on an object flag set on the character and to clear its ID from the place it was stored in memory. However, if the object is deleted "carelessly", the standing on an object flag is never reset, nor the variable that stores the location in RAM of such object, thus result in that weird floaty state, affectionally known as slope glitch (or the one glitch that messes up Ice Cap in spuki ways). One such example is a zipper late in Wing Fortress. As it goes really far from where it begins, if you spindash out of it before it properly returns, the game unloads it from memory (by virtue of being far away from the character), thus activating slope glitch and leading to all sorts of funny behavior, such as clipping into walls or ceilings if you have a good angle and sufficient speed. In this case, we can clip into the ceiling of the Wing Fortress boss by abusing a ramp that is located just before the area, and potentially attack the laser that travels along that same ceiling? Unfortunately, we cannot jump onto the laser if you are in that roof, so your only options are either get hit and be knocked either inside or outside the boss area (in which case you are forced to die to continue), jump and get one hit and be knocked inside, or do something fancy instead.
  4.  
  5. (Still marzo's explanation) Slope glitch in most cases will not allow you to stand. That is because the character is constantly checking if they are "on the edge" of the object they are standing on (am I two pixels or less away from the edge), and if so, it goes to the "balancing" animation. However, as the slope glitch initiator object is cleared from memory, you will always be "on the edge" of the object (as the width of the object is zero), so you will be stuck in that state. Most importantly, you will not be able to spindash. But, the character doesn't care about the slope glitch initiator object, it cares about what object it "knows" it is standing on (as it was already stored in that variable I talked about), and that should be the object it last landed on, right? Unfortunately, not quite. As the game reuses these locations in RAM (the slots) when loading new objects, it is possible that, if you look carefully for such an instance, the character believes they are standing on the object that triggered "slope glitch", but in reality they are not. And what's more, the width of object is no longer zero, so Sonic may finally catch a break and rest his two feet on "solid ground" if he positions himself accordingly. We can exploit that in Wing Fortress. If we initiate slope glitch with the zipper, then have the game load the boss in the same memory slot, we could potentially stand on the laser portion of the boss, charge a spindash, and get our eight hits, just like that. As the boss most of the time is loaded in slot 11, we would like it if our zipper also is loaded in slot 11.
  6.  
  7. What I perform in these strats are four ways of manipulating object spawns/despawns around the region where the zipper lies. I will explain the safe strat first. You take one of the "elevator vines" (nice name Sonic Retro, jk thx for help), and scroll the screen far enough to the left by hitting one of the ring monitors nearby. This unloads all off the objects that are to the right (most importantly, it unloads the zipper, some additional vines and a set of rotating platforms), freeing up the low slots in RAM. After you let the ring monitor "screen" fade out (as that iself is another object and you don't want it to be occupying one of the precious slots), walking to the right immediately loads the zipper in slot 10, then a nearby vine, then the other objects in the area. What we do then is go to the right, walk a bit so we unload the zippers and the vines, then return. If done correctly, a nearby vine will be loaded in slot 10, and the important zipper will be ready to go in slot 11. The rest... is history.
  8.  
  9. What happens with the "risky" strat is that you never clear off the objects to the right, so you are relying on the things that spawn in slots 10 and 11 being the zipper and the vines (which you can easily unload by going past that little brown section of the ship), and not any of the four rotating platforms (which cannot). These two good things will happen most frequently in rev0, rev2 with the new strat has a higher chance of failure because not caring about the retracting platforms being inside or outside means that they can potentially mess up the locations in RAM where newer objects are loaded, so in some sense, rev0 may be safer to attempt the risky strat on. And with newer objects I mean the rotating platforms that happen to be in the area, because if they spawn and one of them takes up slots 10 or 11, it is rather difficult to get rid of it (especially knowing that you don't know whether that actually happened or not) due to its lower ID (19) than both the zipper (C0) and the vines (80) having priority if you leave the area and come back hoping to despawn and respawn the objects.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement