23 users online: Counterfeit, Dark Mario Bros, Ice Man, ImCos, JP 14, kamekku14,  KevinM, Lotica,  MarioFanGamer, MarioPanic, MegaSonic1999, OEO6, PMH, qantuum, SF - The Dark Warrior, Slash Chen,  Tahixham,  Telinc1, TheBiob,  Tob, WhiteYoshiEgg, yoshiatom, Zerio - Guests: 46 - Bots: 254 Users: 45,659 (3,289 active)
Latest user: Alanpl1318
Not logged in.
Doors and Sub-screen boundaries
Forum Index - SMW Hacking - SMW Hacking Discussion - Doors and Sub-screen boundaries
Pages: « 1 »
So, I've never really thought of this as a possibility before, but I'm sure a lot of you have and something tells me there may also be a 'Tip' that I've managed to miss all this time that addresses this, but it seems as if doors don't interact properly with sub-screen boundaries in Lunar Magic.

I only discovered this because I received a piece of feedback in my hack stating that a door in one of my levels would sometimes act as a reset door (as it was supposed to), but other times it would send the player to the endless bonus room (and you could test this with savestates even, not just reloading the level by dying).

I wanted to investigate why this was and found that the door in question was directly next to a sub-screen boundary (touching it). None of the other doors in the area were touching, and none of them had problems. And sure enough, once I moved the door a mere one tile away from the boundary, the problem stopped.

Has anyone else encountered this? Is this well documented? If not it might be worth mentioning in tutorials because it's a major bug that can be tough to catch because it only sent me to the endless bonus once every 10 or 15 savestate loads.
This has to do with the fact that a screen exit checks for Mario's position i.e. Mario's top left corner. That means, if the player isn't entering the door from the right side, Mario's position is actually outside of the block (it happens because the block hitbox is made out of interaction points and the doors uses the one in Mario's center) and therefore might end up on a different subscreen if the door in question is on a boundary. That being said, because Mario's position is on the top left corner, this only happens if the subscreen boundary is to the left of the door. If the boundary is to the right of a door, it always works fine.

Okay, my layout looks ugly.
There's one more solution to this problem. Set the same level number where the door leads to on the sub-screen boundary the door is placed right next to.
I have a Discord server as well!
Regardless of which solution you choose to do, I definitely think this should be added to the 'Tip' bar if it isn't already. Because as I said it's sort of a tricky thing to catch if you aren't aware of its existence already.
You can do the same with horizontal pipes. They trigger the exit of whereever Mario is after the walk; if that crosses a screen boundary, you'll end up on wrong exit.

Either way, yes, that belongs in the tips. Here's the complete list.

<blm> zsnes users are the flatearthers of emulation
Awesome! Thanks guys! #tb{^V^}
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Discussion - Doors and Sub-screen boundaries