Advertiser Content

Development [FR] Sideways Stairs

Started by Spherical Ice September 22nd, 2016 10:54 AM
  • 27738 views
  • 36 replies

Spherical Ice

Age 21
Bristol, UK
Seen 9 Hours Ago
Posted September 24th, 2019
5,254 posts
12.1 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:


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.


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:


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.

Logan

Age 24
Male
Salisbury, England
Seen 3 Days Ago
Posted 1 Week Ago
10,411 posts
11.1 Years
It works when the player is running?
Yes and on a bike. :)

Spherical Ice

Age 21
Bristol, UK
Seen 9 Hours Ago
Posted September 24th, 2019
5,254 posts
12.1 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.

Spherical Ice

Age 21
Bristol, UK
Seen 9 Hours Ago
Posted September 24th, 2019
5,254 posts
12.1 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

Working on Essence of light...

Seen 2 Weeks Ago
Posted May 16th, 2018
132 posts
12.3 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?



Pokémon
Essence of Light

Comming Soon...

Spherical Ice

Age 21
Bristol, UK
Seen 9 Hours Ago
Posted September 24th, 2019
5,254 posts
12.1 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!

INDIAN MEW(ARAZI)

THE WORLDS MOST DUMB MAN

Male
Sleeping in clouds.
Seen 5 Days Ago
Posted March 8th, 2018
411 posts
4.7 Years
thank God my mind was gonna blast thinking how to make sideways stairs works.thanks spherical ice
MY DEVIANT ART
http://arazitheman.deviantart.com
RUMOUR RED(FIRE RED BASE)
https://www.pokecommunity.com/showthread.php?t=396639
A2z GUIDE
http://www.pokemonhackersonline.com/showthread.php?t=15772-A2z-PokeRED-a-guide-for-fire-red
START LEARNING C,C++ OR PYTHON FOR FREE
https://www.sololearn.com

Spherical Ice

Age 21
Bristol, UK
Seen 9 Hours Ago
Posted September 24th, 2019
5,254 posts
12.1 Years
sorry disturbing, but i have a problem like derlo

you said "switch the pointers at x5C14C and x5C17C" how to do that?
Copy the x8 bytes at x5C14C, paste it in notepad, copy the x8 bytes at x5C17C, paste it at x5C14C, copy the x8 bytes in notepad, paste it at x5C17C.

mbcn10ww

Male
Brazil
Seen 4 Weeks Ago
Posted October 4th, 2019
367 posts
3.2 Years


What about this? Why this is happening? While on bike the stairs works perfectly, but while walking/running it blocks my way.

mbcn10ww

Male
Brazil
Seen 4 Weeks Ago
Posted October 4th, 2019
367 posts
3.2 Years
Can you show me what each of those tiles have as their behaviour bytes?
I'm not on PC right now but I can tell you:
[XX][XX][B5]
[30][B3][B5]
[B4][B3][B3]
[B4][B5]

I'm using the default ones you used at the tutorial. I think the problem could be the code, cause the bike is working.
Advertiser Content