How editing Sonic 3 & Knuckles Level Select Level Order works

Discussion in 'Tutorials Archive' started by Inferno, Aug 1, 2017.

Tags:
  1. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    Version 1.2 of this guide.
    So, you want to edit the level select order? Here's some help.
    Find LS_Level_Order and you should see this.
    Code:
    LS_Level_Order:
            dc.w    0    ; AIZ act 1
            dc.w    1    ; AIZ act 2
            dc.w $100    ; HCZ act 1
            dc.w $101    ; HCZ act 2
            dc.w $200    ; MGZ act 1
            dc.w $201    ; MGZ act 2
            dc.w $300    ; CNZ act 1
            dc.w $301    ; CNZ act 2
            dc.w $500    ; ICZ act 1
            dc.w $501    ; ICZ act 2
            dc.w $600    ; LBZ act 1
            dc.w $601    ; LBZ act 2
            dc.w $700    ; MHZ act 1
            dc.w $701    ; MHZ act 2
            dc.w $400    ; FBZ act 1
            dc.w $401    ; FBZ act 2
            dc.w $800    ; SOZ act 1
            dc.w $801    ; SOZ act 2
            dc.w $900    ; LRZ act 1
            dc.w $901    ; LRZ act 2
            dc.w $1600    ; LRZ act 3
            dc.w $1601    ; LRZ act 4
            dc.w $A00    ; SSZ act 1
            dc.w $A01    ; SSZ act 2
            dc.w $B00    ; DEZ act 1
            dc.w $B01    ; DEZ act 2
            dc.w $C00    ; DDZ act 1
            dc.w $1700    ; DDZ act 2
            dc.w $1400    ; Bonus Stage 1
            dc.w $1500    ; Bonus Stage 2
            dc.w $4000    ; Special Stage 1
            dc.w $4001    ; Special Stage 2
            dc.w $FFFF    ; Sound Test
    But this is a little hard to understand, so I have a index set up to help ease the process.
    Move two indexes to change the level select's order.
    Code:
    $100 = HCZ act 1
    $101 = HCZ act 2
    $200 = MGZ act 1
    $201 = MGZ act 2
    $300 = CNZ act 1
    $301 = CNZ act 2
    $400 = FBZ act 1
    $401 = FBZ act 2
    $500 = ICZ act 1
    $501 = ICZ act 2
    $600 = LBZ act 1
    $601 = LBZ act 2
    $700 = MHZ act 1
    $701 = MHZ act 2
    $800 = SOZ act 1
    $801 = SOZ act 2
    $800 = SOZ act 1
    $801 = SOZ act 2
    $900 = LRZ act 1
    $901 = LRZ act 2
    $A00 = SSZ act 1
    $A01 = SSZ act 2
    $B00 = DEZ act 1
    $B01 = DEZ act 2
    $C00 = DDZ act 1
    $1400 = Bonus Stage 1
    $1500 = Bonus Stage 2
    $1600 = LRZ Act 3 (Sonic's boss fight)
    $1601 = LRZ Act 4 (Hidden Palace)
    $1700 = DDZ Act 2 (Normal final boss?)
    $4000 = Special Stage 1
    $4001 = Special Stage 2
    $FFFF = Sound Test
    0 = AIZ Act 1 (Do not understand, DO NOT EDIT.)
    0 = AIZ Act 2 (Do not understand, DO NOT EDIT.)
    This is the IDs and the zones they stand for. I have put them in numerical order. To change the level select order move two IDs to after a zone and in the level select it will be there. But, the text is the same. Luckily, the level select text is easily editable.
    Find LevelSelectText and you should see this:
    Code:
    LevelSelectText:
            levselstr    "ANGEL ISLAND"
            levselstr    "HYDROCITY"
            levselstr    "MARBLE GARDEN"
            levselstr    "CARNIVAL NIGHT"
            levselstr    "ICECAP"
            levselstr    "LAUNCH BASE"
            levselstr    "MUSHROOM HILL"
            levselstr     "FLYING BATTERY"
            levselstr    "SANDOPOLIS"
            levselstr    "LAVA REEF"
            levselstr    "LAVA REEF"
            levselstr    "SKY SANCTUARY"
            levselstr    "DEATHEGG"
            levselstr    "THE DOOMSDAY"
            levselstr    "BONUS"
            levselstr    "SPECIAL STAGE"
            levselstr    "SOUND TEST  *"
            even
    The text is in normal letters! Just edit the text and the menu is now in easily seeable order!
     
    Last edited: Aug 2, 2017
    Niko likes this.
  2. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    From the looks of it, we've got $ZZAA.

    ZZ = Zone Number
    AA = Act Number

    Time to try and stuff in some act threes?

    Nice findings, by the way.
    This is actually what I was just looking for yesterday.
     
  3. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    Guide updated.
     
    Last edited: Aug 2, 2017
  4. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    Tested it out, and it only seems to affect the level select's order.
    In-game stage order must be elsewhere, then, but at least now we can make those Special stages (or sound test) load up specific test stages.

    Hence the "LS" at the beginning of the label, which then stands for "Level Select."

    EDIT:
    The "0" and "1" at the beginning are just decimal values.
    But, if you want consistency, or if it makes things any easier to read:
    Code:
    LS_Level_Order:
            dc.w $000    ; AIZ act 1
            dc.w $001    ; AIZ act 2
    ... 
     
  5. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    Yea, that's why I edited the post. The level order itself has to be somewhere else.

    EDIT: Thanks for explaining the AIZ ones, that clears it up.
     
    Last edited: Aug 2, 2017
  6. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    Personally i'd have it like this, so you have the full word value typed out which makes it easier to read and edit imo.
    Code:
    LS_Level_Order:
            dc.w    $0000    ; AIZ act 1
            dc.w    $0001    ; AIZ act 2
            dc.w    $0100    ; HCZ act 1
            dc.w    $0101    ; HCZ act 2
            dc.w    $0200    ; MGZ act 1
            dc.w    $0201    ; MGZ act 2
            dc.w    $0300    ; CNZ act 1
            dc.w    $0301    ; CNZ act 2
            dc.w    $0500    ; ICZ act 1
            dc.w    $0501    ; ICZ act 2
            dc.w    $0600    ; LBZ act 1
            dc.w    $0601    ; LBZ act 2
            dc.w    $0700    ; MHZ act 1
            dc.w    $0701    ; MHZ act 2
            dc.w    $0400    ; FBZ act 1
            dc.w    $0401    ; FBZ act 2
            dc.w    $0800    ; SOZ act 1
            dc.w    $0801    ; SOZ act 2
            dc.w    $0900    ; LRZ act 1
            dc.w    $0901    ; LRZ act 2
            dc.w    $1600    ; LRZ act 3
            dc.w    $1601    ; LRZ act 4
            dc.w    $0A00    ; SSZ act 1
            dc.w    $0A01    ; SSZ act 2
            dc.w    $0B00    ; DEZ act 1
            dc.w    $0B01    ; DEZ act 2
            dc.w    $0C00    ; DDZ act 1
            dc.w    $1700    ; DDZ act 2
            dc.w    $1400    ; Bonus Stage 1
            dc.w    $1500    ; Bonus Stage 2
            dc.w    $4000    ; Special Stage 1
            dc.w    $4001    ; Special Stage 2
            dc.w    $FFFF    ; Sound Test
    
    Also why use ASCII for this when you could just use constants?
     
    Niko likes this.
  7. Inferno

    Inferno Rom Hacker Member

    Joined:
    Oct 27, 2015
    Messages:
    132
    Location:
    Sky Base Zone, South Island
    I located the level select text there, that's all.