• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Code: [FR] Sideways Stairs

5,256
Posts
16
Years

[FR] - Sideways Stairs

A common issue when it comes to mapping is the inability to properly use sideways stairs, a situation which usually leads to one of two outcomes. The first is that the map is changed, usually at the expense of its playable design and aesthetics, to instead use a vertical set of stairs. The second, which often looks very unprofessional, is to use sideways stair tiles anyway, and to just make them act like regular, passable tiles. This looks so bad because there is no sense of elevation when the player walks up, and can break immersion and make movement awkward. The following implementation can create a far easier, pseudo-3D effect which alleviates all of these issues. Here is a small sample .gif of the implementation:

8B2jW2w.gif

This tutorial applies strictly for the US FireRed ROM. As always, it is strongly recommended that, before modifying a ROM (and, indeed, as progress is made), back ups are created to minimise the risk of data loss or corruption.

Step 1 - Modifying the routine

  • Download the sideways_stairs.asm routine attached to this post.
  • Load the downloaded file in a text editor of your choice.
  • Locate a word-aligned address in your ROM with xC38 bytes of free space.
  • Update the expression for the start_address symbol in the routine's file from 0xXXXXXX to the address you have located.
  • Identify a contiguous set of six, unused behaviour bytes. By default, the implementation uses bytes 0xB0 through to 0xB5.
  • Update the expression for the behaviour_0 symbol in the routine's file from 0xB0 to the first of the six behaviour bytes you have identified.
  • Save the sideways_stairs.asm file.

Note that you do not need to change the behaviour_0 symbol if the behaviour bytes 0xB0, 0xB1, 0xB2, 0xB3, 0xB4 and 0xB5 are unused in your ROM.

Step 2 - Assemble and insert the routine

  • Assemble the sideways_stairs.asm routine.
  • Load the produced sideways_stairs.bin file in your hex editor.
  • Navigate to x5BB5C in both the ROM and the .bin file.
  • Copy the (non-xFF) bytes from this address in the .bin file.
  • Paste the copied bytes at the same address in the ROM.
  • Repeat the above three steps at the following addresses: x5C104, x5C14C, x5C17C, x64540, x64584, x645B4 and xBD3C8.
  • Navigate to the address of free space used for the start_address symbol in both the ROM and the .bin file.
  • Copy bytes from this address in the .bin file to the end of the .bin file.
  • Paste the copied bytes at the same address in the ROM.
  • Save the ROM.

After this step, sideways stairs are fully implemented in your ROM.

Step 3 - Using the sideways stairs in a map

The sideways stairs have now been fully implemented in the ROM, programatically. This step is in diagram form and simply demonstrates how a map should use the new behaviour bytes to achieve the sideways stairs effect. This thereby assumes the reader is knowledgeable of how to manipulate tile sets and on how to assign tiles behaviour bytes.

rv63epQ.png

The image above should adequately demonstrate the pattern required to properly use the sideways stairs implementation. The bytes atop the tiles indicate which behaviour byte they require to function properly. This image fails to demonstrate stairs of larger vertical lengths, but trial and error is recommended to truly grasp how the behaviour bytes function. With regards to the movement permissions, the only pertinent information is that the "bottom" of every column of stair tiles should be impassable, and the rest passable; this should, incidentally, form a stair shape, such as below:

1xJh6QV.png

The background bytes for the special tiles do not need to be anything special, but ideally would be x00 x20.

Drawbacks

This implementation currently has a number of drawbacks.

  • Non-playable person events will not interact properly with this implementation by default: you would need to create a unique movement type that could interact with sideways stairs.
If you encounter a drawback, bug, or oddity not listed above, please quote this post with as much detail as possible.
 

Attachments

  • sideways_stairs.asm
    26.4 KB · Views: 940
Last edited:

Dionen

deprived of sleep
295
Posts
12
Years
Since you repointed the animation table and added new entries to it, does this enable me to use the diagonal movements via applymovement?
 
5,256
Posts
16
Years
Thank you everyone for the kind words!

Since you repointed the animation table and added new entries to it, does this enable me to use the diagonal movements via applymovement?

As far as I'm aware, the animation table which is repointed is not the same one as the one used by applymovement: ultimately I haven't done enough research of the applymovement command itself to answer this, sorry.


On that note, though, I should mention that NPCs walking around the stair tiles currently don't function properly.
 
5,256
Posts
16
Years
Is this possible to be implemented to Emerald?

I personally don't have much experience with this area of hacking for Emerald but I imagine it would just be a matter of porting the hooks and whatnot as Gen 3 appears to use the same overworld system. The complications, I imagine, would arise when it comes to things like the Acro Bike and whatnot, but I genuinely don't know (nor plan to), sorry.
 

Derlo

Tired....
135
Posts
16
Years

[FR] - Sideways Stairs


Hello, You can take me a question?
I use a very old ROM, which is the [sql-pkfr.gba]... "where my hack is almost done!"
When I apply Pach, there are some problems related to the movements of the player:
-When Is running, minisprite not switch to the right animation, only accelerates the speed.
-and when on the bike, it switches to the right Overworld, but there is no walking animation, it just moves in the correct directions. But when bumps into a wall, the animation flows properly.

The stairs work perfectly... the problem is only in the animation of the player.
I think it is something related to: new animation_table and routines.asm
but could not identify where every movement, specifically ... hehe

You know how to solve this?
 
5,256
Posts
16
Years
Hello, You can take me a question?
I use a very old ROM, which is the [sql-pkfr.gba]... "where my hack is almost done!"
When I apply Pach, there are some problems related to the movements of the player:
-When Is running, minisprite not switch to the right animation, only accelerates the speed.
-and when on the bike, it switches to the right Overworld, but there is no walking animation, it just moves in the correct directions. But when bumps into a wall, the animation flows properly.

The stairs work perfectly... the problem is only in the animation of the player.
I think it is something related to: new animation_table and routines.asm
but could not identify where every movement, specifically ... hehe

You know how to solve this?
If this happens, I think switching the pointers at x5C14C and x5C17C should fix it. Try that and see!
 
Back
Top