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!

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old September 22nd, 2016 (10:54 AM). Edited November 12th, 2017 by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
 
Join Date: Nov 2007
Location: Bristol, UK
Age: 21
Posts: 5,241

[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.
Attached Files
File Type: asm sideways_stairs.asm‎ (26.4 KB, 171 views) (Save to Dropbox)
__________________
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old September 22nd, 2016 (11:04 AM).
WWTEpicFail's Avatar
WWTEpicFail WWTEpicFail is offline
Some Memelord from Canada
     
    Join Date: Feb 2014
    Location: Canada
    Gender: Male
    Nature: Serious
    Posts: 85
    Nice work!
    Reply With Quote
      #3   Link to this post, but load the entire thread.  
    Old September 22nd, 2016 (11:29 AM).
    BluRose BluRose is offline
    blu rass
       
      Join Date: Apr 2014
      Location: hyakkoku city
      Age: 17
      Gender: Male
      Nature: Timid
      Posts: 762
      oh my god spherical ice
      this is bootiful <3
      largest problems with hackroms solved right here
      __________________
      am i cool yet
      Reply With Quote
        #4   Link to this post, but load the entire thread.  
      Old September 22nd, 2016 (12:41 PM).
      Derlo's Avatar
      Derlo Derlo is offline
      Working on Essence of light...
         
        Join Date: Aug 2007
        Posts: 132
        It works when the player is running?
        __________________



        Pokémon
        Essence of Light

        Comming Soon...
        Reply With Quote
          #5   Link to this post, but load the entire thread.  
        Old September 22nd, 2016 (12:43 PM).
        Logan's Avatar
        Logan Logan is offline
         
        Join Date: Nov 2008
        Location: Salisbury, England
        Age: 24
        Gender: Male
        Nature: Sassy
        Posts: 10,408
        Quote:
        Originally Posted by Derlo View Post
        It works when the player is running?
        Yes and on a bike. :)
        __________________
        Reply With Quote
          #6   Link to this post, but load the entire thread.  
        Old September 22nd, 2016 (12:53 PM). Edited September 22nd, 2016 by Derlo.
        Derlo's Avatar
        Derlo Derlo is offline
        Working on Essence of light...
           
          Join Date: Aug 2007
          Posts: 132
          A long time had tried to make them too ....

          however, stopped the problems of: bike and run !!
          Congratulation to have solved one of the largest 3rd generation maps problems !!
          __________________



          Pokémon
          Essence of Light

          Comming Soon...
          Reply With Quote
            #7   Link to this post, but load the entire thread.  
          Old September 23rd, 2016 (8:14 AM).
          Dionen's Avatar
          Dionen Dionen is offline
          deprived of sleep
             
            Join Date: Jun 2011
            Location: Brazil
            Gender: Male
            Nature: Quirky
            Posts: 293
            Since you repointed the animation table and added new entries to it, does this enable me to use the diagonal movements via applymovement?
            __________________
            Reply With Quote
              #8   Link to this post, but load the entire thread.  
            Old September 23rd, 2016 (8:44 AM).
            Spherical Ice's Avatar
            Spherical Ice Spherical Ice is offline
             
            Join Date: Nov 2007
            Location: Bristol, UK
            Age: 21
            Posts: 5,241
            Thank you everyone for the kind words!

            Quote:
            Originally Posted by Dionen View Post
            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.
            __________________
            Reply With Quote
              #9   Link to this post, but load the entire thread.  
            Old September 24th, 2016 (4:22 PM).
            Xencleamas's Avatar
            Xencleamas Xencleamas is offline
            Suddenly lurking in the shadows...
               
              Join Date: Feb 2014
              Location: Asgard
              Gender: Male
              Nature: Adamant
              Posts: 458
              Is this possible to be implemented to Emerald?
              __________________

              Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
              Reply With Quote
                #10   Link to this post, but load the entire thread.  
              Old September 25th, 2016 (12:57 AM).
              XD XD XD XD XD's Avatar
              XD XD XD XD XD XD XD XD XD XD is offline
                 
                Join Date: Nov 2015
                Gender: Male
                Posts: 15
                OMG, thank you so much spherical ice XD
                Reply With Quote
                  #11   Link to this post, but load the entire thread.  
                Old September 25th, 2016 (7:45 AM).
                Spherical Ice's Avatar
                Spherical Ice Spherical Ice is offline
                 
                Join Date: Nov 2007
                Location: Bristol, UK
                Age: 21
                Posts: 5,241
                Quote:
                Originally Posted by Koutetsujou View Post
                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.
                __________________
                Reply With Quote
                  #12   Link to this post, but load the entire thread.  
                Old September 26th, 2016 (4:18 AM).
                Derlo's Avatar
                Derlo Derlo is offline
                Working on Essence of light...
                   
                  Join Date: Aug 2007
                  Posts: 132
                  Quote:
                  Originally Posted by Spherical Ice View Post

                  [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...
                  Reply With Quote
                    #13   Link to this post, but load the entire thread.  
                  Old September 26th, 2016 (4:27 AM).
                  Spherical Ice's Avatar
                  Spherical Ice Spherical Ice is offline
                   
                  Join Date: Nov 2007
                  Location: Bristol, UK
                  Age: 21
                  Posts: 5,241
                  Quote:
                  Originally Posted by Derlo View Post
                  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!
                  __________________
                  Reply With Quote
                    #14   Link to this post, but load the entire thread.  
                  Old September 26th, 2016 (5:29 AM).
                  Compumax's Avatar
                  Compumax Compumax is offline
                     
                    Join Date: Oct 2014
                    Gender: Male
                    Posts: 16
                    Woao!

                    Excellente! Great job!
                    Reply With Quote
                      #15   Link to this post, but load the entire thread.  
                    Old September 26th, 2016 (12:19 PM).
                    Derlo's Avatar
                    Derlo Derlo is offline
                    Working on Essence of light...
                       
                      Join Date: Aug 2007
                      Posts: 132
                      Quote:
                      Originally Posted by Spherical Ice View Post
                      If this happens, I think switching the pointers at x5C14C and x5C17C should fix it. Try that and see!
                      Dude, you're incredible!
                      It's working perfectly !!
                      Thank you very much!
                      __________________



                      Pokémon
                      Essence of Light

                      Comming Soon...
                      Reply With Quote
                        #16   Link to this post, but load the entire thread.  
                      Old September 27th, 2016 (12:31 AM).
                      Froosty's Avatar
                      Froosty Froosty is offline
                      The_Learner
                         
                        Join Date: Sep 2014
                        Location: Somewhere in this world.
                        Age: 21
                        Gender: Male
                        Nature: Brave
                        Posts: 541
                        Its an awesome finding!

                        I even used it in my hack!
                        surely gonna credit you for your such an awesome finding :)
                        __________________
                        Want to talk with me regarding Rom-hacking ??? Want to get access to my works exclusive than anywhere else ???
                        Click here to get in the discord server here where rom-hacking is a everyday talk and task.

                        Want to showcase your hack on discord server ??? Click here to get the dask done.

                        My works:
                        TOOL: TL's Quick Enhancer
                        TUTORIAL: Fire red habitat editing
                        TUTORIAL: Fire red Transparent text-box


                        | |
                        Reply With Quote
                          #17   Link to this post, but load the entire thread.  
                        Old September 30th, 2016 (11:10 AM).
                        INDIAN MEW(ARAZI)'s Avatar
                        INDIAN MEW(ARAZI) INDIAN MEW(ARAZI) is offline
                        THE WORLDS MOST DUMB MAN
                           
                          Join Date: Mar 2015
                          Location: Sleeping in clouds.
                          Gender: Male
                          Nature: Relaxed
                          Posts: 411
                          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

                          Reply With Quote
                            #18   Link to this post, but load the entire thread.  
                          Old October 5th, 2016 (3:27 AM).
                          XD XD XD XD XD's Avatar
                          XD XD XD XD XD XD XD XD XD XD is offline
                             
                            Join Date: Nov 2015
                            Gender: Male
                            Posts: 15
                            Quote:
                            Originally Posted by Spherical Ice View Post
                            If this happens, I think switching the pointers at x5C14C and x5C17C should fix it. Try that and see!
                            sorry disturbing, but i have a problem like derlo

                            you said "switch the pointers at x5C14C and x5C17C" how to do that?
                            Reply With Quote
                              #19   Link to this post, but load the entire thread.  
                            Old October 5th, 2016 (3:42 AM).
                            Spherical Ice's Avatar
                            Spherical Ice Spherical Ice is offline
                             
                            Join Date: Nov 2007
                            Location: Bristol, UK
                            Age: 21
                            Posts: 5,241
                            Quote:
                            Originally Posted by XD XD XD XD XD View Post
                            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.
                            __________________
                            Reply With Quote
                              #20   Link to this post, but load the entire thread.  
                            Old October 5th, 2016 (3:53 AM).
                            XD XD XD XD XD's Avatar
                            XD XD XD XD XD XD XD XD XD XD is offline
                               
                              Join Date: Nov 2015
                              Gender: Male
                              Posts: 15
                              Quote:
                              Originally Posted by Spherical Ice View Post
                              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.
                              OMG, it's working XD

                              again, thank you very much spherical ice XD
                              Reply With Quote
                                #21   Link to this post, but load the entire thread.  
                              Old October 28th, 2016 (5:15 PM).
                              FlyingShell FlyingShell is offline
                                 
                                Join Date: Jan 2015
                                Gender: Male
                                Posts: 14
                                OH MY GAWD!
                                I was waiting for this for like, 3 years! Thank you! :D
                                __________________
                                Currently working on SF2 to GBA..
                                Reply With Quote
                                  #22   Link to this post, but load the entire thread.  
                                Old May 11th, 2017 (6:36 PM). Edited May 12th, 2017 by mbcn10ww.
                                mbcn10ww's Avatar
                                mbcn10ww mbcn10ww is offline
                                   
                                  Join Date: Oct 2016
                                  Location: Brazil
                                  Gender: Male
                                  Nature: Lonely
                                  Posts: 364


                                  What about this? Why this is happening? While on bike the stairs works perfectly, but while walking/running it blocks my way.
                                  __________________
                                  My Works:
                                  [Fire Red] Adding New Trainer Sprites
                                  [Fire Red] My Version of HMs Type Check
                                  [Fire Red] Touched's Mega Evolution System (PATCH)
                                  Reply With Quote
                                    #23   Link to this post, but load the entire thread.  
                                  Old May 12th, 2017 (4:00 AM).
                                  Spherical Ice's Avatar
                                  Spherical Ice Spherical Ice is offline
                                   
                                  Join Date: Nov 2007
                                  Location: Bristol, UK
                                  Age: 21
                                  Posts: 5,241
                                  Quote:
                                  Originally Posted by mbcn10ww View Post


                                  What about this? Why this is happening?
                                  Can you show me what each of those tiles have as their behaviour bytes?
                                  __________________
                                  Reply With Quote
                                    #24   Link to this post, but load the entire thread.  
                                  Old May 12th, 2017 (4:11 AM). Edited May 12th, 2017 by mbcn10ww.
                                  mbcn10ww's Avatar
                                  mbcn10ww mbcn10ww is offline
                                     
                                    Join Date: Oct 2016
                                    Location: Brazil
                                    Gender: Male
                                    Nature: Lonely
                                    Posts: 364
                                    Quote:
                                    Originally Posted by Spherical Ice View Post
                                    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.
                                    __________________
                                    My Works:
                                    [Fire Red] Adding New Trainer Sprites
                                    [Fire Red] My Version of HMs Type Check
                                    [Fire Red] Touched's Mega Evolution System (PATCH)
                                    Reply With Quote
                                      #25   Link to this post, but load the entire thread.  
                                    Old May 12th, 2017 (4:19 AM).
                                    Narwhal's Avatar
                                    Narwhal Narwhal is offline
                                    Meme Lord
                                       
                                      Join Date: May 2016
                                      Location: New Jersey
                                      Gender: Male
                                      Nature: Lax
                                      Posts: 145
                                      Wow! I will definitely test this out on my rom tomorrow!
                                      __________________

                                      Currently working on my Fire Red Rom Hack Pokémon Bismuth
                                      Hit me up on Discord if you have any questions: Matthew™#9890
                                      Reply With Quote
                                      Reply

                                      Quick Reply

                                      Join the conversation!

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

                                      Create a PokéCommunity Account
                                      Ad Content
                                      Thread Tools

                                      Posting Rules
                                      You may not post new threads
                                      You may not post replies
                                      You may not post attachments
                                      You may not edit your posts

                                      BB code is On
                                      Smilies are On
                                      [IMG] code is On
                                      HTML code is Off

                                      Forum Jump


                                      All times are GMT -8. The time now is 2:47 AM.