The PokéCommunity Forums Fan Games ROM Hacking Research & Development
Development [FR] Sideways Stairs

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!

Reply
 
Thread Tools
  #1    
Old September 22nd, 2016 (10:54 AM). Edited 5 Days Ago by Spherical Ice.
Spherical Ice's Avatar
Spherical Ice Spherical Ice is offline
  • Moderator
  • Silver Tier
 
Join Date: Nov 2007
Location: Bristol, UK
Age: 19
Posts: 5,104

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


The implementation itself involves a lot of changes throughout the ROM, and so this post will take a tutorial format for ease of installation. This tutorial applies strictly for the US FireRed ROM. A patch file which implements the sideways stairs, using the base ROM named '1635 - Pokemon Fire Red (U)(Squirrels)', has been attached at the bottom of this post. As usual with patches, it is worth noting that the same location will be overwritten irrespective of whether it is free space in the target ROM or not; apply with caution! Patch users may skip steps 1 through 3 but must read Step 4 to fully understand how to utilise the newly implemented sideways stairs in a map. 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 - Repoint the animation table


The animation table is located at x3A65BC, with xAA entries of (x4 byte) pointers to further animation data for specific movements. In order to accommodate the new movements of the player sprite moving up and down the stairs in various directions (up and left; down and right; up and right; down and left) and at various speeds (walking, running and cycling), the table must be expanded, and, therefore, repointed to free space.
  • Load the ROM in a hex editor.
  • Locate x1518 bytes of free space in the ROM and note the address of where the free space begins.
  • Repoint all pointers to the old animation table (x3A65BC) to the location of this free space; there should be three in total.
  • Save the ROM.

Do not worry about copying the animation table before repointing, as the next step will automatically recreate the contents of the old table, as well as expand it with its new entries.

Step 2 - Expand the animation table

  • Download the file labelled new_animation_table_and_routines.asm attached at the bottom of this post.
  • Load the file in a text editor.
  • Update the address which is by default 0xaaaaaa at the top of the file to the (word aligned) address of the repointed animation table, i.e. the x1518 bytes of free space found in the previous step.
  • Save and assemble the file.
  • Load both the ROM and the generated .bin file in a hex editor.
  • Navigate to the new location of the animation table in both the ROM and the .bin file.
  • Copy x1518 bytes from this address in the .bin file.
  • Paste the copied x1518 bytes at the same address in the ROM.
  • Save the ROM.

Step 3 - Implementing the behaviour bytes


Now that the animation table has now been both repointed, expanded and completed, the animations themselves must now be recognised by the ROM to enable the illusion of the player going up, or down, the sideways stairs.
  • Identify a contiguous set of five, unused behaviour bytes. In an unused FireRed ROM, and for the sake of this tutorial, behaviour bytes xB0 through xB5 will be used.
  • Locate x320 bytes of free space in the ROM and note the address of where the free space begins.
  • Download the file labelled behaviour_byte_implementation.asm attached at the bottom of this post.
  • Load the file in a text editor.
  • Update the address which is by default 0xbbbbbb at the top of the file to the (word aligned) address of the x320 bytes of free space previously located.
  • Save and assemble the file.
  • Load both the ROM and the generated .bin file in a hex editor.
  • Navigate to x5BB5C in both the ROM and the .bin file.
  • Copy x8 bytes from this address in the .bin file.
  • Paste the copied x8 bytes at the same address in the ROM.
  • Repeat the above three steps at the following addresses: x5C104, x5C14C, x5C17C, xBD3C8.
  • Navigate to the location of the free space identified at the beginning of this step in both the ROM and the .bin file.
  • Copy x320 bytes from this address in the .bin file.
  • Paste the copied x320 bytes at the same address in the ROM.
  • Save the ROM.

Step 4 - 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: it is best for them to not have movement behaviours which would lead them to walk onto the stair tiles.
  • Similarly, person events, including that of the player, controlled by applymovement do not interact with the sideways stairs properly.
If you encounter a drawback, bug, or oddity not listed above, please quote this post with as much detail as possible.

Downloads

  • Patch file
  • NOTE: This patch assumes the space from ROM location xEBC000 through to xEBD838 is free, xFF bytes in the target ROM; if this is not the case, the patch WILL overwrite whatever data is at this location, potentially irrevocably.
    Similarly, behaviour bytes xB0 through to xB5 are assumed by this patch to be unused; if this is not the case, the implementation may malfunction.
    Read Step 4, found above, for information on how to map properly with the sideways stairs implementation.
Attached Files
File Type: ips sideways-stairs.ips‎ (6.9 KB, 96 views) (Save to Dropbox)
__________________

A Pokemon that is discriminated!
Support squirtle and make it everyone's favourite.
Reply With Quote

Relevant Advertising!

  #2    
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: 84
    Nice work!
    Reply With Quote
      #3    
    Old September 22nd, 2016 (11:29 AM).
    BluRose BluRose is offline
    practicing asmagic
       
      Join Date: Apr 2014
      Location: hyakkoku city
      Age: 16
      Gender: Male
      Nature: Timid
      Posts: 649
      oh my god spherical ice
      this is bootiful <3
      largest problems with hackroms solved right here
      __________________
      ahhhhhhhhh run away
      sometimes i wondered why i had to even wake up in the morning
      then biology class
      Reply With Quote
        #4    
      Old September 22nd, 2016 (12:41 PM).
      Derlo's Avatar
      Derlo Derlo is offline
      Working on Essence of light...
         
        Join Date: Aug 2007
        Posts: 127
        It works when the player is running?
        __________________



        Pokémon
        Essence of Light

        Comming Soon...
        Reply With Quote
          #5    
        Old September 22nd, 2016 (12:43 PM).
        Logan's Avatar
        Logan Logan is offline
        • Discord Moderoid
        • Platinum Tier
         
        Join Date: Nov 2008
        Location: Salisbury, England
        Age: 22
        Gender: Male
        Nature: Sassy
        Posts: 9,833
        Quote:
        Originally Posted by Derlo View Post
        It works when the player is running?
        Yes and on a bike. :)
        __________________
        Wait, I saw bare kicks, saw bare clothes
        Said psyduck that, I can't wear those
        I don't like them, they're not my ting
        They went silent, they're all weirdos
        Reply With Quote
          #6    
        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: 127
          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    
          Old September 23rd, 2016 (8:14 AM).
          Dionen's Avatar
          Dionen Dionen is offline
          powered by enemy's tears
             
            Join Date: Jun 2011
            Location: Brazil
            Gender: Male
            Nature: Quirky
            Posts: 269
            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    
            Old September 23rd, 2016 (8:44 AM).
            Spherical Ice's Avatar
            Spherical Ice Spherical Ice is offline
            • Moderator
            • Silver Tier
             
            Join Date: Nov 2007
            Location: Bristol, UK
            Age: 19
            Posts: 5,104
            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.
            __________________

            A Pokemon that is discriminated!
            Support squirtle and make it everyone's favourite.
            Reply With Quote
              #9    
            Old September 24th, 2016 (4:22 PM).
            You Watanabe's Avatar
            You Watanabe You Watanabe is offline
            Yousoro!
               
              Join Date: Feb 2014
              Location: Shiganshina District, Wall Maria
              Gender: Female
              Nature: Adamant
              Posts: 427
              Is this possible to be implemented to Emerald?
              __________________

              Sky High's Userpage

              Pokémon Dark Jade Version (Coming Soon!)

              Hairo Region (Coming Soon!)

              Reply With Quote
                #10    
              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: 14
                OMG, thank you so much spherical ice XD
                Reply With Quote
                  #11    
                Old September 25th, 2016 (7:45 AM).
                Spherical Ice's Avatar
                Spherical Ice Spherical Ice is offline
                • Moderator
                • Silver Tier
                 
                Join Date: Nov 2007
                Location: Bristol, UK
                Age: 19
                Posts: 5,104
                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.
                __________________

                A Pokemon that is discriminated!
                Support squirtle and make it everyone's favourite.
                Reply With Quote
                  #12    
                Old September 26th, 2016 (4:18 AM).
                Derlo's Avatar
                Derlo Derlo is offline
                Working on Essence of light...
                   
                  Join Date: Aug 2007
                  Posts: 127
                  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    
                  Old September 26th, 2016 (4:27 AM).
                  Spherical Ice's Avatar
                  Spherical Ice Spherical Ice is offline
                  • Moderator
                  • Silver Tier
                   
                  Join Date: Nov 2007
                  Location: Bristol, UK
                  Age: 19
                  Posts: 5,104
                  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!
                  __________________

                  A Pokemon that is discriminated!
                  Support squirtle and make it everyone's favourite.
                  Reply With Quote
                    #14    
                  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    
                    Old September 26th, 2016 (12:19 PM).
                    Derlo's Avatar
                    Derlo Derlo is offline
                    Working on Essence of light...
                       
                      Join Date: Aug 2007
                      Posts: 127
                      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    
                      Old September 27th, 2016 (12:31 AM).
                      The_learner's Avatar
                      The_learner The_learner is offline
                         
                        Join Date: Sep 2014
                        Location: Nepal
                        Age: 19
                        Gender: Male
                        Nature: Brave
                        Posts: 465
                        Its an awesome finding!

                        I even used it in my hack!
                        surely gonna credit you for your such an awesome finding
                        __________________
                        My Progressing Hack



                        Discord Is fun. click here to find me around Discord !!!

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


                        | |
                        Reply With Quote
                          #17    
                        Old September 30th, 2016 (11:10 AM).
                        INDIAN MEW(ARAZI)'s Avatar
                        INDIAN MEW(ARAZI) INDIAN MEW(ARAZI) is offline
                        A girl is not beutiful so help people to make your heart beautiful.
                           
                          Join Date: Mar 2015
                          Location: Sleeping in clouds.
                          Gender: Female
                          Nature: Relaxed
                          Posts: 383
                          thank God my mind was gonna blast thinking how to make sideways stairs works.thanks spherical ice
                          __________________
                          POKEMON ASH ADVENTURES
                          LET THE ADVENTURE BEGIN
                          CLICK IMAGE TO SHOW THREAD
                          Reply With Quote
                            #18    
                          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: 14
                            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    
                            Old October 5th, 2016 (3:42 AM).
                            Spherical Ice's Avatar
                            Spherical Ice Spherical Ice is offline
                            • Moderator
                            • Silver Tier
                             
                            Join Date: Nov 2007
                            Location: Bristol, UK
                            Age: 19
                            Posts: 5,104
                            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.
                            __________________

                            A Pokemon that is discriminated!
                            Support squirtle and make it everyone's favourite.
                            Reply With Quote
                              #20    
                            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: 14
                              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    
                              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    
                                Old 2 Weeks Ago (6:36 PM). Edited 2 Weeks Ago by mbcn10ww.
                                mbcn10ww's Avatar
                                mbcn10ww mbcn10ww is online now
                                   
                                  Join Date: Oct 2016
                                  Location: Brazil
                                  Gender: Male
                                  Nature: Lonely
                                  Posts: 355


                                  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)

                                  To Do List:
                                  Reply With Quote
                                    #23    
                                  Old 2 Weeks Ago (4:00 AM).
                                  Spherical Ice's Avatar
                                  Spherical Ice Spherical Ice is offline
                                  • Moderator
                                  • Silver Tier
                                   
                                  Join Date: Nov 2007
                                  Location: Bristol, UK
                                  Age: 19
                                  Posts: 5,104
                                  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?
                                  __________________

                                  A Pokemon that is discriminated!
                                  Support squirtle and make it everyone's favourite.
                                  Reply With Quote
                                    #24    
                                  Old 2 Weeks Ago (4:11 AM). Edited 2 Weeks Ago by mbcn10ww.
                                  mbcn10ww's Avatar
                                  mbcn10ww mbcn10ww is online now
                                     
                                    Join Date: Oct 2016
                                    Location: Brazil
                                    Gender: Male
                                    Nature: Lonely
                                    Posts: 355
                                    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)

                                    To Do List:
                                    Reply With Quote
                                      #25    
                                    Old 2 Weeks Ago (4:19 AM).
                                    Narwhal's Avatar
                                    Narwhal Narwhal is offline
                                    Meme Lord
                                       
                                      Join Date: May 2016
                                      Location: New Jersey
                                      Gender: Male
                                      Nature: Lax
                                      Posts: 127
                                      Wow! I will definitely test this out on my rom tomorrow!
                                      __________________
                                      Currently working on my Fire Red Rom Hack Pokémon Bismuth

                                      New Youtube channel coming eventually! Gonna make some pretty good content in the future.

                                      Click Here To Check It Out!
                                      Click Here For Twitter!

                                      Click Here For Meme Page!
                                      Reply With Quote
                                      Reply
                                      Quick Reply

                                      Sponsored Links
                                      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 5:19 AM.