Language…
11 users online: Anas, cletus_deletus,  Donut, GRIMMKIN, Gutawer, Isikoro, JezJitzu, masl,  Ringo,  RussianMan, Skewer - Guests: 238 - Bots: 354
Users: 64,795 (2,375 active)
Latest user: mathew

Super Mario Bros puzzle/repeating level - how is it stored?

I don't remember exactly which level, but it is one of the fortress levels, maybe 4-4, there is a 'puzzle' where you have to take the right path, or else you have to repeat the section until you get it right.

I've always wondered how this level is layed out, datawise, because in one section, if you take the correct path, the platforms are 'walled off' at the end, but if you take the wrong one, they're open.


Is the 'walled off' version of this section stored somewhere off of the normal player accessable part of the map, and replaces the non walled off section in real time when the player goes on the right path, or does the game simply spawn solid blocks that are otherwise invisible/passible?

I know that SMB (as well as all of the other 2d SMB games) have their levels divided up into sections so this is why I am wondering if there is an extra section for this stored beyond the normal map boundries.


A side note: I used the free movement Gameshark code with the SM-AS version of SMB1 in this level, and I moved Mario exactly midway between the two points where the game decides whether Mario took the correct path or not. When I tried to move forward, the game froze. I'm thinking that because Mario did not pass through one of these two points, the game did not have a valid value in whatever variable is used to decide which action to take, and it caused the lockup.
You might want to try asking here. The person in charge of that Discord server has disasembled the entirety of the Super Mario All-Stars + Super Mario World version of Super Mario Bros. He'll probably be able to tell you all you want to know.

Click the character on the right side of my layout to visit my Discord server and discuss and play and look at and get updates and sneak peeks of the games and other things I'm making.

The authors of these 2 My Little Pony fan games have removed their games from the Internet.
Rise of the Clockwork Stallions has been updated! Download My Little Pony: Rise of the Clockwork Stallions DX: Director's Cut and My Little Pony: Magic Shards now! Spread this link!

I don't remember the exact details, but the gist is that the level data renders as your screen moves forward. In those specific levels, there's a check for the player's Y coordinate at the X coordinates where the repeat puzzle happens. If the Y coordinate is not correct, the level renderer is silently moved back four screens, as if the area is repeating.
----------

Interested in MushROMs? View its progress, source code, and make contributions here.

Originally posted by spel werdz rite
I don't remember the exact details, but the gist is that the level data renders as your screen moves forward. In those specific levels, there's a check for the player's Y coordinate at the X coordinates where the repeat puzzle happens. If the Y coordinate is not correct, the level renderer is silently moved back four screens, as if the area is repeating.


It's very obvious that the game is being told "instead of loading x as the next section, load y instead" scince would be a very simple way of dealing with this.

But there appears to be two verions of the section I was talking about, one closed and one open, depending on which path the player took. This leads me to believe that there is an extra secion off the level somewhere.

Think of it this way: The normal level sections are numbered, while this extra section will be labled "E"


Player takes wrong path: 1 2 3 4 5 3 4 ~ 3 is where the repeat starts
Player takes right path: 1 2 3 4 E 6 7 ~ E is the alt. version of section 5, section progression continues normally

It's also possible that the closed off part is stored in a 'normal' level section, and when it repeats, this 'normal' section isn't loaded. Example: (this 'wall' is in section 6)

Player takes wrong path: 1 2 3 4 5 3 4 ~
Player takes right path : 1 2 3 4 5 6 7 ~

This would make a lot more sense than taking up limited rom space with an extra section, and the code that handles this would be much simpler.

It's been a long time scince I have played that level, that's why I have had a hard time remembering which one it actually was, and I can't remember the exact layout, but if the platforms extends over/under the blocks used as the wall, and in the 'repeat' version the platform appears to be 'cut off', it would prove the second theory.
There is no extra secret sections. This paths are always walled off. If the right condition is met the object(two barriers) doesn't load.