Sierraffinity
Desperately trying to retire from ROM hacking
- 1,069
- Posts
- 17
- Years
- Age 28
- she/her
- Somewhere the rains of Africa can be blessed
- Seen Jan 21, 2025
Triple-Layer Blocks
What are triple-layer blocks, exactly, and why should I care?
If you've ever used a mapping tool (which almost everyone has), then you've come to notice that you can only "stack" a maximum of two layers on top of each other:![[PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks [PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks](https://i.imgur.com/eMPgFCW.png)
The problem at hand.
But what if you need to stack three things on top of each other? What do you do then
Installation guide
FireRed/Emerald
First, download the pack that corresponds to your game:FireRed (BPRE): https://www.mediafire.com/download/s6295xtbupeof5r/Triple-Layer_Blocks_(FireRed).zip
Emerald (BPEE): https://www.mediafire.com/download/i0efj9dxywl2pqj/Triple-Layer_Blocks_(Emerald).zip
For those interested, the source code is included within each pack.
Open the first binary file and your ROM in a hex editor of your choice (I prefer HxD). Copy the contents of the binary file and paste it at either address 0x5A9BC (FireRed) or 0x89F80 (Emerald). Find a chunk of free space (200 bytes is a good size to search for), round it up to the nearest multiple of 4 (0, 4, 8, or C), then replace the '00 00 00 08' from the end of the pasted chunk with a pointer to the free space you found, plus 1 (this is the only time you're adding 1 to an address in this tutorial, be careful!). Example: You found free space at 0xF45167. Round it up to 0xF45168, add 1, then reverse it to get 69 51 F4 08.
In the ROM, navigate to the rounded free space address (remember, don't add 1!). Open the second binary file, then copy and paste it into the ROM. Replace the '00 00 00 08' from the end of the pasted chunk with a pointer to the free space just after the pasted section. In that space, paste this code:
FireRed: 6C AA 05 08 CE A9 05 08 0C AA 05 08 00 00 00 08
Emerald: 30 A0 08 08 D0 9F 08 08 92 9F 08 08 00 00 00 08
Again, replace the '00 00 00 08' from the end of the pasted chunk with a pointer to the free space just after the pasted section. In that space, paste the contents of the third binary file.
FireRed specific instruction: Change 0x60 to 0x70 at 0x352F0B and 0x1D to 0x1C at 0x352F16. Also, change 0x01 to 0x02 at 0x9B868 and "02 DC" to "2F D0" at 0x9B86E.
Ruby
First, download this pack:https://www.mediafire.com/download/05bnvk9bk1j2oab/Triple-Layer_Blocks_(Ruby).zip
For those interested, the source code is included within each pack.
Open the first binary file and your ROM in a hex editor of your choice (I prefer HxD). Copy the contents of the binary file and paste it at address 0x57E96. Find a chunk of free space (200 bytes is a good size to search for), round it up to the nearest multiple of 4 (0, 4, 8, or C), then replace the '00 00 00 08' from the end of the pasted chunk with a pointer to the free space you found. Example: You found free space at 0xF45167. Round it up to 0xF45168, then reverse it to get 68 51 F4 08.
In the ROM, navigate to the rounded free space address. In that space, paste this code:
A0 7F 05 08 28 7F 05 08 AC 7E 05 08 00 00 00 08
Replace the '00 00 00 08' from the end of the pasted chunk with a pointer to the free space just after the pasted section. In that space, paste the contents of the second binary file.
How to use your new powers
Congratulations! You now have the ability to use three layers at once! But how do you use this, you ask? It's pretty simple.Set your first block to have the bottom two layers and a background byte of 30:
![[PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks [PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks](https://i.imgur.com/UX2YiXX.png)
Setthe block immediately after it to be the top layer (this is your burner block):
![[PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks [PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks](https://i.imgur.com/L4458Kn.png)
What do I mean by a "burner block"? Well, it's a block that you wasted the bottom layer on and can't use it for much else. However, if you're creative, then you can find another use for it (such as a one-layer block).
The result
![[PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks [PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks](https://i.imgur.com/oMJh59Y.png)
Looks ugly in Advance-Map, but...
![[PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks [PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks](https://i.imgur.com/rtgZro6.png)
Looks great in-game!
How do overworld sprites interact with these blocks? How would they look?
![[PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks [PokeCommunity.com] The Secret Sauce: Triple-Layer Blocks](https://i.imgur.com/mulxisz.png)
Another in-game example.
When the player or any other sprite goes on the triple-layer block, they'll always appear above the bottom two layers and below the top layer. This is due to how the block system works: a background byte of 00 uses the top two layers (sandwiching sprites between) and a background byte of 10 or 20 (depending on your game) uses the bottom two layers (putting sprites on top). The triple-layer block hack enables you to use all three of these block layers at once.
But what if I want all three below the player?
There's a way around it, but it's kind of "hacky" (heh). You have to set the "height" of the block (using movement permissions) to be higher than C. The caveat to this is, sprites at that height will appear above ALL blocks, even ones that the player would usually be under, so it's not the most convenient thing to use. If you REALLY need all three underneath the player for some reason, try and see if you can merge two of the layers together and use the normal system instead before attempting this.Questions? Comments? Suggestions? Leave them below!
Last edited: