Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

#1
July 22nd, 2015 (10:08 PM). Edited August 2nd, 2015 by Diegoisawesome.
 Diegoisawesome Oh god the bees Silver Tier Join Date: Dec 2007 Location: :noitacoL Age: 20 Gender: Male Nature: Naive Posts: 1,039

# 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:

The problem at hand.

But what if you need to stack three things on top of each other? What do you do then besides squeezing two layers into one palette and make new tiles? Well, this is where triple-layer tiles come in handy!

## Installation guide

### FireRed/Emerald

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

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:

Setthe block immediately after it to be the top layer (this is your burner block):

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

Looks great in-game!

## How do overworld sprites interact with these blocks? How would they look?

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!

#2
July 23rd, 2015 (2:28 AM).
 hackstar Check it out!! Join Date: Jan 2013 Location: Dhaka Gender: Male Nature: Gentle Posts: 243
Really its looking good in game!! I like it!
__________________
Always FEEL CONFIDENT!!!
#3
July 23rd, 2015 (6:53 AM).
 BlackStorm20x idek Join Date: Apr 2014 Gender: Male Nature: Quiet Posts: 476
OMG FINALLY. I been trying to find a thread on triple-layer blocks, and when I found Shinyquagsire's, I guess I needed ASM. :/ LOL. But thank you Deigo, thank you. :D
__________________
#4
July 27th, 2015 (12:13 PM).
 esperance Platinum Tier Join Date: Mar 2010 Location: Ohio Age: 20 Gender: Male Nature: Relaxed Posts: 3,830
This is very nice. And you do a great job of explaining it! It seems easier to use than Shiny Quagsire's version too.
Quick question, though. Do the tiles work on both the primary and secondary tilesets?
__________________
What are you so afraid of?
#5
July 27th, 2015 (10:17 PM).
 Diegoisawesome Oh god the bees Silver Tier Join Date: Dec 2007 Location: :noitacoL Age: 20 Gender: Male Nature: Naive Posts: 1,039
Quote:
 Originally Posted by hackstar Really its looking good in game!! I like it!
Thank you!
Quote:
 Originally Posted by BlackStorm20x OMG FINALLY. I been trying to find a thread on triple-layer blocks, and when I found Shinyquagsire's, I guess I needed ASM. :/ LOL. But thank you Deigo, thank you. :D
No problem!
Quote:
 Originally Posted by Lost Heart This is very nice. And you do a great job of explaining it! It seems easier to use than Shiny Quagsire's version too. Quick question, though. Do the tiles work on both the primary and secondary tilesets?
Thanks!
These triple-layer blocks work on both primary and secondary tilesets.
#6
July 30th, 2015 (4:00 AM).
 Jaizu Spanish Rom Hacker Join Date: Jan 2010 Location: Spain Gender: Male Posts: 77
First of all thanks, I'm happy that you finally got it, and for all the Rom Bases (:
Just one question, on wich layer will the PLAYER be? I mean, in vanilla rom is
LAYER 1 PLAYER LAYER 2 or
LAYER 1 LAYER 2 PLAYER if we have block-type 10/20 depending on the ROM Base.
__________________
#7
July 30th, 2015 (5:26 AM).
 Spherical Ice Crystal Tier Join Date: Nov 2007 Location: Bristol, UK Age: 19 Posts: 5,231
Quote:
 Originally Posted by Jaizu First of all thanks, I'm happy that you finally got it, and for all the Rom Bases (: Just one question, on wich layer will the PLAYER be? I mean, in vanilla rom is LAYER 1 PLAYER LAYER 2 or LAYER 1 LAYER 2 PLAYER if we have block-type 10/20 depending on the ROM Base.
From my testing, it's:

LAYER 1 LAYER 2 PLAYER LAYER 3

This happens regardless of whether the tile for the third layer (the "burner block") has background byte 10/20 or not.
__________________

A Pokemon that is discriminated!
Support squirtle and make it everyone's favourite.
#8
July 31st, 2015 (7:59 AM).
 Lance32497 LanceKoijer of Pokemon_Addicts Join Date: Aug 2014 Location: Criscanto town-Ginoa Region xD Gender: Male Nature: Adamant Posts: 793
I have a question, would it be possible to make "Triple-layered block"block over hero? Like byte 20 in adv. map?
__________________
This signature has been disabled.
Scrollbar appears

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
#9
August 2nd, 2015 (3:55 PM). Edited August 2nd, 2015 by Le pug.
 Le pug Creator of Pokémon: Discovery / Fat Kid Crystal Tier Join Date: Aug 2013 Location: Le bed Age: 24 Gender: Male Nature: Bold Posts: 784
Great resource and good tutorial, thanks for this.

I recommend in your tutorial section (even though you said it in parathesis) that you state for each of them that you no longer add the +1 to each offset for this text:

"In the ROM, navigate to the rounded free space address (don't add 1 this time!). 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:"

What I personally interpreted it as was navigate to the free space address and don't add 1 that time but for the rest of them to add +1 like the first time. Reiteration will prevent others from breaking their game and wondering why it doesn't work lol. Thanks again for this resource though, I have way too many three-layered blocks in my game lol.

Also for a support question: Is there any way to have the hero over both blocks? Currently the player covers the first block but the block used to be above it will show above the player's OW in-game. I tried setting the second block to background byte 10 so the player is above it while having the first block as 30 but it's still showing the hero below the block. Any idea how to fix?
#10
August 2nd, 2015 (11:30 PM).
 Diegoisawesome Oh god the bees Silver Tier Join Date: Dec 2007 Location: :noitacoL Age: 20 Gender: Male Nature: Naive Posts: 1,039
Quote:
 Originally Posted by Jaizu First of all thanks, I'm happy that you finally got it, and for all the Rom Bases (: Just one question, on wich layer will the PLAYER be? I mean, in vanilla rom is LAYER 1 PLAYER LAYER 2 or LAYER 1 LAYER 2 PLAYER if we have block-type 10/20 depending on the ROM Base.
Quote:
 Originally Posted by Spherical Ice From my testing, it's: LAYER 1 LAYER 2 PLAYER LAYER 3 This happens regardless of whether the tile for the third layer (the "burner block") has background byte 10/20 or not.
Yeah, that's correct. I'll add that into the tutorial.
Quote:
 Originally Posted by Lance32497 I have a question, would it be possible to make "Triple-layered block"block over hero? Like byte 20 in adv. map?
Kind of, but it's a little hacky (no pun intended). You have to set the "height" of the block (using movement permissions) to be higher than C, but this could mess with other blocks you have, so it's not the easiest thing to use.
I'll add this into the tutorial too.
Quote:
 Originally Posted by Le pug Great resource and good tutorial, thanks for this. I recommend in your tutorial section (even though you said it in parathesis) that you state for each of them that you no longer add the +1 to each offset for this text: "In the ROM, navigate to the rounded free space address (don't add 1 this time!). 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:" What I personally interpreted it as was navigate to the free space address and don't add 1 that time but for the rest of them to add +1 like the first time. Reiteration will prevent others from breaking their game and wondering why it doesn't work lol. Thanks again for this resource though, I have way too many three-layered blocks in my game lol. Also for a support question: Is there any way to have the hero over both blocks? Currently the player covers the first block but the block used to be above it will show above the player's OW in-game. I tried setting the second block to background byte 10 so the player is above it while having the first block as 30 but it's still showing the hero below the block. Any idea how to fix?
Fixed it, is it less ambiguous now? Thanks!
#11
September 4th, 2015 (12:18 PM).
 Deokishisu Mr. Magius Join Date: Feb 2006 Location: If I'm online, it's a safe bet I'm at a computer. Gender: Male Nature: Relaxed Posts: 886
Just used it, and it works and looks great! It really gives some of my maps a lot more freedom.

However, after using it, that burner block usually ends up as such a waste as only the top layer. Wouldn't it be better if the bottommost layer was the burner block? Then, at least, it could be easily used elsewhere on its own.
#12
September 8th, 2015 (7:26 PM).
 Diegoisawesome Oh god the bees Silver Tier Join Date: Dec 2007 Location: :noitacoL Age: 20 Gender: Male Nature: Naive Posts: 1,039
Quote:
 Originally Posted by Deokishisu Just used it, and it works and looks great! It really gives some of my maps a lot more freedom. However, after using it, that burner block usually ends up as such a waste as only the top layer. Wouldn't it be better if the bottommost layer was the burner block? Then, at least, it could be easily used elsewhere on its own.
Do you mean, the triple-tile's top section should be the top of the next block instead of the bottom?
#13
September 8th, 2015 (8:40 PM). Edited September 8th, 2015 by Deokishisu.
 Deokishisu Mr. Magius Join Date: Feb 2006 Location: If I'm online, it's a safe bet I'm at a computer. Gender: Male Nature: Relaxed Posts: 886
Quote:
 Originally Posted by diegoisawesome Do you mean, the triple-tile's top section should be the top of the next block instead of the bottom?
Behold my MSPaint skills! (The blank portion of the top layer of a tile has been omitted, because lazy.)

In this case, you probably couldn't save yourself the tile regardless, but in other cases, the bottommost layer of this triple-layer tile could be used on its own and possibly save an otherwise wasted tile. Like, if I had a floor tile as the bottom layer (on its own tile), a table on the middle layer, and something overlapping on the third (with the table and the something overlapping it on one tile), I could use that floor tile as a normal tile elsewhere, while still having a triple layer tile. You'd have to make it so you choose the tile that is "up and more up" and it uses the tile before it as the bottommost layer instead of using the current system of choosing the "down and up" tile and burning the "more up" tile (which almost always becomes useless). Basically, instead of almost always wasting two tiles to make up a triple-layer tile in the tileset, you would only have to waste one some of the time, with the bottom layer being reusable.

I don't know if I explained this well. Sorry if I'm unclear.

EDIT: In fact, even with the current system, doing it so you choose the "more up" layer tile and the routine pulls the "down" and "up" layers from the tile before it is a better implementation than what we have now, because it potentially saves the bottom and middle layer (which is one tile in the current system and is also the most usable as-is out of the two tiles involved).

EDIT2: Either way, the right tile should activate the routine and pull from the tile before it, but maybe behavior byte 30 could continue to use the "what it is" method, where the bottom and middle layer are on one tile, and the top on another, while behavior byte 31 uses the "what it should be" method, where the bottom layer is on one tile, and the middle and top are on another. This would give the hacker the maximum possible chance of not wasting their tile space, as they can decide what configuration yields an easy-to-reuse tile. Depending on what behavior byte I choose, and using the above image as an example, I could choose to reuse the water with land border tile elsewhere, OR I could choose to reuse the only water tile elsewhere.
#14
November 25th, 2015 (11:55 AM). Edited November 27th, 2015 by dysbber162.
 dysbber162 Join Date: Jun 2015 Location: Norway Gender: Male Nature: Jolly Posts: 28
I did everything in the tutorial (fire red), everything looks fine until i play the rom and the tile is completely buggy, except for the bottommost tile. I tried with both a-map 1.9.5 and 1.9.2, so i'm kind of dumbfounded. Does anyone have an idea of what could be wrong?

Nevermind, the problem was the tile, not triple layer. Great tutorial!
#15
January 1st, 2017 (6:21 PM).
 tkim Join Date: May 2011 Posts: 179
Initially didn't understand what you've meant by 'immediately set the block after it' . Didn't realize all I had to do was click on it after saving the previous tile. Very grateful for this, thank you!
#16
April 21st, 2017 (4:43 PM).
 noirhaya Join Date: Mar 2015 Location: Near from here Nature: Sassy Posts: 11
Well, I followed all the steps but the game shows black screen after introduction, I tried with a clean rom and expanded rom with same results. Anyone can provide a video tutorial o something?, cause I don't know what I did wrong during the process.
#17
October 3rd, 2017 (4:40 AM).
 NicolasLukas Join Date: Aug 2015 Location: Germany Gender: Male Nature: Relaxed Posts: 146
I cant get it to work. I have done all the byte changes and routine insertions and if I put the third layer over the first and second than it is covering them completely. Can someone help me with this?
#18
October 3rd, 2017 (7:54 PM).
 Diegoisawesome Oh god the bees Silver Tier Join Date: Dec 2007 Location: :noitacoL Age: 20 Gender: Male Nature: Naive Posts: 1,039
Quote:
 Originally Posted by NicolasLukas I cant get it to work. I have done all the byte changes and routine insertions and if I put the third layer over the first and second than it is covering them completely. Can someone help me with this?
Not sure what you mean by this, could you elaborate?
#19
October 8th, 2017 (4:32 AM).
 Hotice03 Join Date: Apr 2017 Posts: 2
i do everything it says and i get to this part 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. and i cant find any of this stuff wether its an edited rom or a fresh rom could someone perhaps try doing it on their own with my rom to see if its my rom messing up or me. thanks in advanced i really hope itll work triple layers will look great with some of my maps
#20
October 8th, 2017 (3:43 PM).
 Diegoisawesome Oh god the bees Silver Tier Join Date: Dec 2007 Location: :noitacoL Age: 20 Gender: Male Nature: Naive Posts: 1,039
Quote:
 Originally Posted by Hotice03 i do everything it says and i get to this part 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. and i cant find any of this stuff wether its an edited rom or a fresh rom could someone perhaps try doing it on their own with my rom to see if its my rom messing up or me. thanks in advanced i really hope itll work triple layers will look great with some of my maps
What's your problem here exactly? If you go to that address, do you not find the values I wrote?

# Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!