Romhacking => ROM Hacking Discussion => Topic started by: Chipius on May 05, 2016, 07:22:46 am

Title: [SMB3] What did I do wrong??
Post by: Chipius on May 05, 2016, 07:22:46 am
Hey there, I'm trying to make a SMB3 hack with SMB3 workshop, but I'm encountering some issues. The most annoying is that I cant access a bonus area in 2-2, it leads me to an empty room. I guess I did all the header and pointer stuff correctly :( I made a small video to show you whats happening
Title: Re: [SMB3] What did I do wrong??
Post by: Quick Curly on May 05, 2016, 09:07:11 am
Ironically, the one thing you didn't show in your video - the actual downward pipe - is what's the problem. :P

There are two different types of downward pipes that can be entered. One is the regular downward pipe that uses the area you set in the level header as the destination. The other downward pipe uses a special area as the destination, that is determined by the current world number, and limits the player's movement to one (1) screen wide. You might know these areas as those Underground bonus areas that usually contain a big "?" block with a special power-up item or 3 extra lives, and then the player generally returns back to the main area through another pipe.

The downward pipe that you want to use is "Downward Pipe (CAN go down)" (3-byte, bank 1, type 144-159 (hex 90-9F)).
The Underground bonus area pipe that leads to one single area in all the levels of the same world is "Downward Pipe (CAN go down, ignores pointers)" (3-byte, bank 1, type 176-191 (hex B0-BF)).
There is also an "Upward Pipe to End of Level" pipe object that leads to one single Plains area in all the levels of the same world that is only available in certain Object Set based levels, like Giant (3-byte, bank 3, type 80-8F (hex 50-5F)) and Underground (3-byte, bank 4, type 224-239 (hex E0-EF)).

So, in your level and situation, your downward pipe is the one used to lead to the Underground bonus area, and the legendary empty space room of death that countless other SMB3 hackers have encountered in the past is a direct result of this mix-up, as World 1 actually doesn't have a legitimate Underground bonus area, besides just an empty space room of death.

However, should you want to utilize this bonus pipe system and implement an Underground bonus area for your custom World 1, you can definitely do that.

I just made the following post on Board 2 a few days ago to answer a similar question about making use of those other pipe destination areas determined by the current world number. You can check it out at the following link for additional, in-depth information: (

Best of luck! If you have anymore questions, please be sure to check through the General SMB3 Hacking Thread linked above, and feel free to ask about anything that hasn't been covered yet. Hopefully I and/or other helpful hackers will be able to help you out so that you can see your project through!
Title: Re: [SMB3] What did I do wrong??
Post by: Chipius on May 05, 2016, 10:10:31 pm
Fixed, thanks :) I didnt even notice that I used the pipe that ignores pointers. There's also something with which I'm a bit confused. It's the Limit size (in edit), should I check it or not??
Title: Re: [SMB3] What did I do wrong??
Post by: Mari42 on May 06, 2016, 10:17:08 pm
If you need help with the ignore pointers for the pipes, then just let me know. I'll help you out.  :laugh:
Title: Re: [SMB3] What did I do wrong??
Post by: Quick Curly on May 07, 2016, 11:44:50 am
Concerning the "Limit Size" option, you definitely don't want to overwrite other levels. Keep in mind that you don't have unlimited free space to work with for building levels. The original size of each level in the original game is the number of free bytes that you have to work with. This applies to both 3-byte objects and 4-byte objects, as well as enemies. Exceeding the objects and/or enemies by even one byte will cut into the data for another level, and if/when you try to modify a level that you cut into from expanding another level, you'll end up overwriting your previous changes to the other level. As you can tell, that will just lead to one large, messy, irreversible disaster.

So, definitely make sure that you keep track of the original numbers for 3-byte objects, 4-byte objects, and enemies.

For example, in 1-1, there are originally 81 3-byte objects, 5 4-byte objects, and 15 enemies.
In the bottom-right corner of the editor window, you can see "107 (263)".
1-1 is made up of 263 bytes for the objects. 3-byte objects and 4-byte objects both apply to this same total. You can use fewer 3-byte objects to add more 4-byte objects, and vice versa. You just can't exceed the 263 total.
107 is the hex representation of the 263 value. If you highlight the bytes of a single level in a hex editor, this hex representation is what you should see. Note, however, that this value doesn't include or account for the 9-byte level header; only the object data that follows it.

(81 x 3) + (5 x 4) = 263
243 + 20 = 263

For every 4 3-byte objects you use fewer of, you can use 3 more 4-byte objects. For instance, when editing the original 1-1, by using 77 3-byte objects, you can use 8 4-byte objects, and still hit the maximum number of bytes allowed, 263.

(77 x 3) + (8 x 4) = 263
231 + 32 = 263

For enemies, you're limited to a maximum of 15 enemies in the specific case of 1-1.

If you edit the original game's levels, you can use fewer bytes for objects and/or enemies in each case. However, never more, unless you're completely aware and organized enough to keep track of the specific levels that you overwrite for both object data and enemy data sets so that you don't edit the originals ever again to keep your modifications in tact.

The "custom offsets" method that I have covered in the past completely removes any limitations and worries from having to consider and account for the sizes of the original levels in the game. However, you need to work within a hex editor (preferably through FCEUX ( ( and keep track of the starting offsets for your object and enemy data sets for your levels. However, by clearing out all of the original levels first and not using the original game's starting offsets, you can make your levels as small or as large as you want, and connect as few or as many areas in a single level as you want.

The following Board 2 post from January 2011 has a section covering the basics of the "custom offsets" approach. There are also sections for a time/music ASM hack and editing pipe/door pointers. (

I have wanted to make a more involved, detailed post for the method for a while now, but unfortunately, I haven't had the time to finish up what I already have yet. However, as long as one has the time and patience, and isn't afraid of the potential trial and error process, the method is very manageable, and ultimately, rewarding.

Regardless of how you build your new level designs, you should always clear out all of the objects and enemies first. You don't want to only move objects and enemies around so that your new level designs resemble old levels. Believe me. For my first hacking attempt when I was only just beginning, I did the same thing. The best practice is to start from scratch.

Also, just to mention, the pipe that supposedly ignore pointers actually should have been labelled as "ignores next area in level header", because you still have to place and set a pointer for it to work properly. It's just that the next area that it leads to isn't the one set in the level header. You can refer to original, unmodified level designs through SMB3 Workshop that lead to the Underground bonus areas and Plains ending areas to study and learn firsthand.