Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Reverse Engineering Getting Started

Matt Greer edited this page Nov 22, 2021 · 3 revisions

So you want to help reverse engineer SMA4? Awesome! Here are some tips on how to start

Join Discord

The smaghetti discord has the #sma4-reverse-engineering channel where we chat about things we are figuring out.

browse this wiki

All reverse engineering learnings eventually get documented here. Take a look around, it will help you avoid doing stuff that has already been figured out.

check github discussions

Discussions also have some info in them. Not as much going on here, but sometimes when someone finds something in Discord, it gets copied into a discussion as an easy way to stash it in a permanent spot. Ultimately discussion info ends up in Smaghetti itself and the wiki.

Check out all entities in Smaghetti

If you load the editor with this url: https://smaghetti.com/editor/?hextreecat

Then the item chooser will have an additional "hex tree" category. With this added category, all entities that Smaghetti knows about are shown.

Play with the tools

Smaghetti has several tools here. Most notable is hex-tree. It lets you really play with the binary data of a level and see the results.

warning! these tools are raw

These tools are all very raw. They have bugs and are not always intuitive. Most likely that's just the way these tools will be, making them super polished just isn't a very good use of development resources

Hex-Tree, getting started

Hex-Tree will let you load a level via:

  • localStorage: this pulls in a smaghetti level. To use this, head to the editor and load or create a level. Once the level is where you want it to be, refresh the page, then in the menu that pops up, choose "last session", this will ensure this level is stored in your browser's localStorage. Then head to hex-tree and choose "load from localStorage". You should see your smaghetti level now loaded into hex-tree

  • load an e-reader level: if you have a .level e-reader file, you can load it into hex-tree. I can not help you locate these files, they are copyrighted and belong to Nintendo. asking here on Github or in Discord for these files is a violation of the Smaghetti guidelines

  • use the dropdown to load an in-game level: the big dropdown up in the header lets you choose a level that is built into the game, ie 1-1, 1-2, etc. But this feature is extremely raw, unfinished and just not very good. Recommend avoiding it until it gets more love.

  • start empty: this starts you out with an empty level, but this is also raw and not great. Also recommend avoid this.

Once you have a level loaded, I recommend just start playing with things. For example, find a Goomba

goomba

And try moving it by changing x or y. Once you change the value, click on the up arrow to apply it. Keep in mind these values are in hexadecimal.

Or try changing it to a koopa, which has id 6c

goomba is now a koopa

When you play the level, you will see the goomba is now a koopa.

That's basically how you mess with a level.