(S2)How to make HTZ and DEZ load alternative art

Discussion in 'Tutorials Archive' started by M3k, Jul 11, 2011.

Thread Status:
Not open for further replies.
  1. M3k

    M3k h4x Member

    Joined:
    Jul 28, 2008
    Messages:
    37
    (yeah, I need to think of a better title :V)


    90% of the times I play a Sonic 2 hack, the art from HTZ isn't split from EHZ. Same thing with CPZ and DEZ. Although the same thing happens with SCZ and WFZ, these zones normally aren't edited that much, so I won't cover this, but it shouldn't be too different. Anyways, we are going to fix that today!


    Open your disassembly (I'm using Xenowhirls 2007, but the procedures should be similar between the 2007 and the SVN disassemblies). Look for LevelArtPointers:




    LevelArtPointers:


    levartptrs 4, 5, 4, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 0 ; EHZ ; EMERALD HILL ZONE


    levartptrs 6, 7, 5, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 1 ; LEV1 ; LEVEL 1 (UNUSED)


    levartptrs 8, 9, 6, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 2 ; LEV2 ; LEVEL 2 (UNUSED)


    levartptrs $A, $B, 7, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 3 ; LEV3 ; LEVEL 3 (UNUSED)


    levartptrs $C, $D, 8, ArtKos_MTZ, BM16_MTZ, BM128_MTZ ; 4 ; MTZ ; METROPOLIS ZONE ACTS 1 & 2


    levartptrs $C, $D, 8, ArtKos_MTZ, BM16_MTZ, BM128_MTZ ; 5 ; MTZ3 ; METROPOLIS ZONE ACT 3


    levartptrs $10,$11, $A, ArtKos_SCZ, BM16_WFZ, BM128_WFZ ; 6 ; WFZ ; WING FORTRESS ZONE


    levartptrs $12,$13, $B, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 7 ; HTZ ; HILL TOP ZONE


    levartptrs $14,$15, $C, BM16_OOZ, BM16_OOZ, BM16_OOZ ; 8 ; HPZ ; HIDDEN PALACE ZONE (UNUSED)


    levartptrs $16,$17, $D, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 9 ; LEV9 ; LEVEL 9 (UNUSED)


    levartptrs $18,$19, $E, ArtKos_OOZ, BM16_OOZ, BM128_OOZ ; $A ; OOZ ; OIL OCEAN ZONE


    levartptrs $1A,$1B, $F, ArtKos_MCZ, BM16_MCZ, BM128_MCZ ; $B ; MCZ ; MYSTIC CAVE ZONE


    levartptrs $1C,$1D,$10, ArtKos_CNZ, BM16_CNZ, BM128_CNZ ; $C ; CNZ ; CASINO NIGHT ZONE


    levartptrs $1E,$1F,$11, ArtKos_CPZ, BM16_CPZ, BM128_CPZ ; $D ; CPZ ; CHEMICAL PLANT ZONE


    levartptrs $20,$21,$12, ArtKos_CPZ, BM16_CPZ, BM128_CPZ ; $E ; DEZ ; DEATH EGG ZONE


    levartptrs $22,$23,$13, ArtKos_ARZ, BM16_ARZ, BM128_ARZ ; $F ; ARZ ; AQUATIC RUIN ZONE


    levartptrs $24,$25,$14, ArtKos_SCZ, BM16_WFZ, BM128_WFZ ; $10 ; SCZ ; SKY CHASE ZONE



    You see, this table tells the game which 16x16, 8x8 and 128x128 it should load. The 3 bytes (4, 5, 4 on EHZ, $C, $D, 8 in MTZ etc) are pointing to the PLC (first 2 bytes) and palette (last byte). EHZ and HTZ, and DEZ and CPZ already have different palettes and PLC, so we're just going to change this to:




    LevelArtPointers:


    levartptrs 4, 5, 4, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 0 ; EHZ ; EMERALD HILL ZONE


    levartptrs 6, 7, 5, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 1 ; LEV1 ; LEVEL 1 (UNUSED)


    levartptrs 8, 9, 6, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 2 ; LEV2 ; LEVEL 2 (UNUSED)


    levartptrs $A, $B, 7, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 3 ; LEV3 ; LEVEL 3 (UNUSED)


    levartptrs $C, $D, 8, ArtKos_MTZ, BM16_MTZ, BM128_MTZ ; 4 ; MTZ ; METROPOLIS ZONE ACTS 1 & 2


    levartptrs $C, $D, 8, ArtKos_MTZ, BM16_MTZ, BM128_MTZ ; 5 ; MTZ3 ; METROPOLIS ZONE ACT 3


    levartptrs $10,$11, $A, ArtKos_SCZ, BM16_WFZ, BM128_WFZ ; 6 ; WFZ ; WING FORTRESS ZONE


    levartptrs $12,$13, $B, ArtKos_HTZ2, BM16_HTZ2, BM128_HtZ ;+++7 ; HTZ ; HILL TOP ZONE


    levartptrs $14,$15, $C, BM16_OOZ, BM16_OOZ, BM16_OOZ ; 8 ; HPZ ; HIDDEN PALACE ZONE (UNUSED)


    levartptrs $16,$17, $D, ArtKos_EHZ, BM16_EHZ, BM128_EHZ ; 9 ; LEV9 ; LEVEL 9 (UNUSED)


    levartptrs $18,$19, $E, ArtKos_OOZ, BM16_OOZ, BM128_OOZ ; $A ; OOZ ; OIL OCEAN ZONE


    levartptrs $1A,$1B, $F, ArtKos_MCZ, BM16_MCZ, BM128_MCZ ; $B ; MCZ ; MYSTIC CAVE ZONE


    levartptrs $1C,$1D,$10, ArtKos_CNZ, BM16_CNZ, BM128_CNZ ; $C ; CNZ ; CASINO NIGHT ZONE


    levartptrs $1E,$1F,$11, ArtKos_CPZ, BM16_CPZ, BM128_CPZ ; $D ; CPZ ; CHEMICAL PLANT ZONE


    levartptrs $20,$21,$12, ArtKos_DEZ, BM16_DEZ, BM128_DEZ ;+++ $E ; DEZ ; DEATH EGG ZONE


    levartptrs $22,$23,$13, ArtKos_ARZ, BM16_ARZ, BM128_ARZ ; $F ; ARZ ; AQUATIC RUIN ZONE


    levartptrs $24,$25,$14, ArtKos_SCZ, BM16_WFZ, BM128_WFZ ; $10 ; SCZ ; SKY CHASE ZONE



    You may have noticed that I put Artkos_HTZ2 instead of just ArtKos_HTZ. That's because ArtKos_HTZ already exists (look for it if you don't believe me).


    Look for ArtKos_EHZ. Above it, paste this:




    ; +++ 16x16 HTZ


    BM16_HTZ2: BINCLUDE "mappings/16x16/HTZ_16x16.bin"


    ;-----------------------------------------------------------------------------------


    ; +++ HTZ art


    ArtKos_HTZ2: BINCLUDE "art/kosinski/HTZ.bin"


    ; +++ HTZ 128X128


    BM128_HTZ: BINCLUDE "mappings/128x128/HTZ.bin"


    ;-----------------------------------------------------------------------------------


    ; +++ 16x16 DEZ


    BM16_DEZ: BINCLUDE "mappings/16x16/DEZ.bin"


    ;-----------------------------------------------------------------------------------


    ; +++ DEZ art


    ArtKos_DEz: BINCLUDE "art/kosinski/DEZ.bin"


    ;-----------------------------------------------------------------------------------


    ; +++ DEZ 128x128


    BM128_DEZ: BINCLUDE "mappings/128x128/DEZ.bin"



    Now, if you build your ROM now (considering you've already placed the files), HTZ will be properly working (you won't see a difference if you have not edited the art), just like DEZ. But we're not quite done yet.


    Look for Off_ColP, replace it with




    Off_ColP:


    dc.l ColP_EHZHTZ


    dc.l Off_Level ; 1


    dc.l ColP_MTZ ; 2


    dc.l Off_Level ; 3


    dc.l ColP_MTZ ; 4


    dc.l ColP_MTZ ; 5


    dc.l ColP_WFZSCZ ; 6


    dc.l ColP_HTZ ;+++7


    dc.l ColP_OOZ ; 8


    dc.l Off_Level ; 9


    dc.l ColP_OOZ ; $A 10


    dc.l ColP_MCZ ; $B 11


    dc.l ColP_CNZ ; $C 12


    dc.l ColP_CPZDEZ ; $D 13


    dc.l ColP_DEZ ;+++ $e 14


    dc.l ColP_ARZ ; 15


    dc.l ColP_WFZSCZ ; 16



    Look for Off_ColS, replace it with:




    Off_ColS:


    dc.l ColS_EHZHTZ


    dc.l Off_Level ; 1


    dc.l ColP_MTZ ; 2


    dc.l Off_Level ; 3


    dc.l ColP_MTZ ; 4


    dc.l ColP_MTZ ; 5


    dc.l ColS_WFZSCZ ; 6


    dc.l ColS_HTZ ; 7


    dc.l ColP_OOZ ; 8


    dc.l Off_Level ; 9


    dc.l ColP_OOZ ; 10


    dc.l ColP_MCZ ; 11


    dc.l ColS_CNZ ; 12


    dc.l ColS_CPZDEZ ; 13


    dc.l ColS_DEZ ; 14


    dc.l ColS_ARZ ; 15


    dc.l ColS_WFZSCZ ; 16



    Then, just under the last binclude on ColArray (above ; EHZ and HTZ primary 16x16 collision index (Kosinski compression) paste:




    ;---------------------------------------------------------------------------------------


    ; +++ HTZ primary coll


    ColP_HTZ: BINCLUDE "collision/HTZ primary 16x16 collision index.bin"


    ;---------------------------------------------------------------------------------------


    ; +++ HTZ secondary collision


    ColS_HTZ: BINCLUDE "collision/HTZ secondary 16x16 collision index.bin"


    ; +++ DEZ primary collision


    ColP_DEZ: BINCLUDE "collision/DEZ primary 16x16 collision index.bin"


    ;---------------------------------------------------------------------------------------


    ; +++ DEZ secondary collision


    ColS_DEZ: BINCLUDE "collision/DEZ secondary 16x16 collision index.bin"



    What did we do here? We have changed the pointers for the collision. Meaning that whatever you do with EHZ and CPZ, it won't affect HTZ and DEZ.


    Youy may notice that I left CPZ_DEZ.bin, EHZ_HTZ.bin and all that kind of stuff with their original names. That's because I'm lazy.


    Now comes the boring part.





    -Go to the Collision folder on a CLEAN S2 DISASSEMBLY.


    -- Make a copy of EHZ and HTZ primary 16x16 collision index.bin, put it (the copy) in the same folder on your hacks disassembly, rename it to HTZ primary 16x16 collision index.bin


    -- Make a copy of EHZ and HTZ secondary 16x16 collision index.bin, put it in the same folder on your disassembly, rename it to HTZ secondary 16x16 collision index.bin


    -- Make a copy of CPZ and DEZ primary 16x16 collision index.bin, put it in the same folder on your disassembly, rename it DEZ primary 16x16 collision index.bin


    -- Make a copy of CPz and DEZ secondary 16x16 collision index.bin. Put it in the same folder on your disassembly, rename it to DEZ secondary 16x16 collision index.bin


    -Go to the Art\Kosinski folder on a CLEAN S2 DISASSEMBLY.


    -- Make a copy of EHZ_HTZ.bin, put it in the same folder on your disassembly, and rename it HTZ.bin


    -- Make a copy of CPZ_DEZ.bin, put it in the same folder on your disassembly, and rename it DEZ.bin


    -Go to the mappings\128x128 folder on a CLEAN S2 DISASSEMBLY folder.


    -- Make a copy of EHZ_HTZ.bin, put it in the same folder on your disassembly, rename it to HTZ.bin


    -- Make a copy of CPZ_DEZ.bin, put it in the same folder on your disassembly, rename it to DEZ.bin


    -Go to the mappings\16x16 folder on a CLEAN S2 DISASSEMBLY folder.


    -- Make a copy of EHZ_HTZ.bin, put it in the same folder on your disassembly, rename it to HTZ_16x16.bin


    -- Make a copy of CPZ_DEZ.bin, put it in the same folder on your disassembly, rename it to DEZ.bin



    ||||***NOTE***||||: If you use SonED2, you will also have to edit the Project Files to point to your new files. That's pretty straightforward; open the HTZ and the DEZ project files on a text editor and it should be pretty obvious.


    I think that covers it all. I've tested this a lot, but if you come across any glitches, please tell me.
     
    Last edited by a moderator: Jul 12, 2011
  2. DeoxysKyogre

    DeoxysKyogre No idea what to put here .-. Member

    Joined:
    Jan 31, 2009
    Messages:
    298
    Definitely a great guide for those who are hacking Sonic 2. Keep up the good work, man.
     
  3. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    I've done this laready with EHZ/HTZ and CPZ/DEZ, bu completely forgot SCZ/WFZ, thanks for the reminder =P
     
  4. M3k

    M3k h4x Member

    Joined:
    Jul 28, 2008
    Messages:
    37
    Deoxys: Thanks!


    RHS: Yeah, I actually only remembered (sp) that when I saw a file named WFZ_SCZ.bin. So you should be thankful to Xenowhirl, actually. :V


    (Fuck the quotes)


    EDIT:I acidentally a leter
     
    Last edited by a moderator: Jul 13, 2011
  5. KCEXE

    KCEXE Active Member Member

    Joined:
    Jun 18, 2011
    Messages:
    26
    Location:
    9th Circle of Hell, Florida
    This is helpful!
     
Thread Status:
Not open for further replies.