Sonic 3 & Knuckles - Super Sonic Palette

Discussion in 'Discussion and Q&A Archive' started by PotterAndMatrixFan, Sep 6, 2014.

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

    PotterAndMatrixFan Newcomer Trialist

    Joined:
    Sep 5, 2014
    Messages:
    16
    Location:
    Uh, Earth maybe :]?
    Hi, just letting you know that I'm new here and if this question is already is answered I have simply missed it. And if my grammar isn't perfect, forgive me.

    I started hacking/modding for around little over a year ago by simply changing sprites, changing levels and other basic stuff, and now I have moved on to mapping my own sprites.

    I know nothing about ASM, but I know very little about hex (I have done it for Sonic Generations) if that's important for this matter.

    Enough about me, time for the question.

    So in Sonic 3 & Knuckles, I have multiple times tried to change Super Sonic's, Hyper Sonic's and Hyper Knuckles' palette by both looking in the s3k.asm (I know there's some kind of code for the palette, but where it is I have no idea) and also in the folders of the disassembly but with no avail.

    Either it's very well hidden or it's too complicated to do.

    Also another question, is it possible for Tails and Knuckles to have their own Super/Hyper sprites and mappings? Not necessary to tell me how, just if it's possible.

    Thanks for your time.
     
  2. DumbLemon

    DumbLemon am back Member

    Joined:
    Aug 19, 2014
    Messages:
    115
    Not to sound like a complete douche or something but... You know that you could of put this in the the basic Q&A forum instead of making a new topic?

    Edit: I am the trained ninja from sensei Ninjaeru.

    Edit 2: Its true!
     
    Last edited by a moderator: Sep 7, 2014
  3. Devon

    Devon A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Member

    Joined:
    Aug 26, 2013
    Messages:
    1,377
    Location:
    your mom
    Are you trying to change the colors or the actual cycle itself?

    EDIT: Ninja'd

    EDIT 2: Whatever, DumbLemon.

    EDIT 3: Yeah right.
     
    Last edited by a moderator: Sep 20, 2014
  4. PotterAndMatrixFan

    PotterAndMatrixFan Newcomer Trialist

    Joined:
    Sep 5, 2014
    Messages:
    16
    Location:
    Uh, Earth maybe :]?
    I'm trying to change the colors.

    DumbLemon: Nope, I guess I didn't see it.
     
    Last edited by a moderator: Sep 6, 2014
  5. Devon

    Devon A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Member

    Joined:
    Aug 26, 2013
    Messages:
    1,377
    Location:
    your mom
    Ok, here's the locations of the palettes:
     
    Super Sonic: PalCycle_SuperSonic
    Super Sonic Underwater in AIZ and ICZ: PalCycle_SuperSonicUnderwaterAIZICZ
    Super Sonic Underwater in HCZ, CNZ and LBZ: PalCycle_SuperSonicUnderwaterHCZCNZLBZ
    Hyper Sonic: PalCycle_HyperSonic
    Super Tails: PalCycle_SuperTails
    Super/Hyper Knuckles: PalCycle_SuperHyperKnuckles
    Super/Hyper Knuckles Revert: PalCycle_SuperHyperKnucklesRevert
     
    For each value listed, there are 3 hexadecimal numbers. The only numbers that can be used are numbers that are divisible by 2 (correct me if I'm wrong). The numbers can be converted to RGB. Like so:
     
    0 - 0
    2 - 32
    4 - 64
    6 - 96
    8 - 128
    $A - 160
    $C - 192
    $E - 224
     
    For example, we have value $EA4, and we want to convert that to RGB. So according the the chart I listed above, it would be like this:
     
    R - 224
    G - 160
    B - 64
     
    Now for the editing of the value. First we'll take any color like this: [​IMG]
     
    The RGB values for the color is:
     
    R - 127
    G - 254
    B - 210
     
    But you're probably like "Hey! Those values can't be converted!" But, no worries, I have a solution so the color is compatible for the MegaDrive. It won't be the EXACT color, but close enough.
     
    What we do is check each value, and round it to the nearest value compatible for the MD. Let's take 127. OK, it's between 96 and 128. 128 is obviously closer to 127, so we change the 127 to 128. Next is 254. If the value goes above 224, it gets rounded to 224. Now 210. It's between 224 and 192. 210 is closer to 224, so we change the 210 to 224.

    An easy way to determine which is the closer value is:

    Let's take 210.

    First we determine which 2 numbers the value is between (192 and 224). We take the first number (192) and subtract it from 210. We get 18. Then we subtract 210 from the second number (224). We get 14. So, we know 210 is closer to 224, because 14 is obviously smaller than 18.

     
    So now the values are:
     
    R - 128
    G - 224
    B - 224
     
    Now we convert those values. The ending result should be $8EE.
     
    That's how you convert RGB colors to MegaDrive color values. Hope it helps!

    EDIT: Fixed a mistake and added how to determine which value is closer to a MegaDrive compatible value.

    EDIT 2: Fixed a silly mistake. I originally said that 14 was larger than 18.
     
    Last edited by a moderator: Sep 20, 2014
  6. PotterAndMatrixFan

    PotterAndMatrixFan Newcomer Trialist

    Joined:
    Sep 5, 2014
    Messages:
    16
    Location:
    Uh, Earth maybe :]?
    Hm. Maybe I'm stupid but I can't find PalCycle_SuperSonic or any of the others. It is in sonic3k.asm, right :/?
     
    Last edited by a moderator: Sep 6, 2014
  7. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    They should be seperate files in the disassembly go into the art folder, find them, and crack 'em open with a hex editor.
     
  8. Devon

    Devon A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Member

    Joined:
    Aug 26, 2013
    Messages:
    1,377
    Location:
    your mom
    No, the palettes for Super forms are not binary files. Yes, they are in sonic3k.asm. Line 4028. Maybe you should try searching AnPal_SuperSonic_1. Maybe it could be the bolding...removed it just in case.

    I have made binary files for the palettes if you want and you can open them in SonMapEd or something and binclude them.
     
    Last edited by a moderator: Sep 6, 2014
  9. PotterAndMatrixFan

    PotterAndMatrixFan Newcomer Trialist

    Joined:
    Sep 5, 2014
    Messages:
    16
    Location:
    Uh, Earth maybe :]?
    Thanks a lot, found it. Going to mess around with it for a while and see if I get what I want. (I'm still a newbie in this hacking stuff).

    If I'm thinking what I think you mean, I use SonMapEd and Notepad++ at the moment.

    Edit: Ah, thanks. That's going to be really helpful.

    Edit 2: I change them in SonMapEd but they won't change in game :/. Maybe I'm just doing it wrong.
     
    Last edited by a moderator: Sep 7, 2014
  10. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    You need to replace the asm equicalent of the palettes with a binclude to the new ones. I'm not good at givimg step by step instructions though, so I'll have to leave you at that.
     
  11. Devon

    Devon A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Member

    Joined:
    Aug 26, 2013
    Messages:
    1,377
    Location:
    your mom
    Create a folder called "Super Palettes" in the General folder. Extract the files into the new folder.

    Now replace this:




    PalCycle_SuperSonic:
            dc.w $E66,$C42,$822
            dc.w $E88,$C66,$844
            dc.w $EAA,$C88,$A66
            dc.w $ECC,$EAA,$C88
            dc.w $EEE,$ECC,$EAA
            dc.w $EEE,$EEE,$EEE
            dc.w $CEE,$CEE,$AEE
            dc.w $AEE,$8EE,$6CC
            dc.w $8EE,$0EE,$0AA
            dc.w $AEE,$8EE,$6CC
    ; AnPal_SuperSonic_2:
    PalCycle_SuperSonicUnderwaterAIZICZ:
            dc.w $A82,$860,$640
            dc.w $E88,$C66,$844
            dc.w $EAA,$C88,$A66
            dc.w $ECC,$EAA,$C88
            dc.w $EEE,$ECC,$EAA
            dc.w $EEE,$EEE,$EEE
            dc.w $CEE,$CEC,$AEC
            dc.w $AEC,$8EC,$6CA
            dc.w $8EC,$4EA,$4A8
            dc.w $CEE,$CEC,$AEC
    ; AnPal_SuperSonic_3:
    PalCycle_SuperSonicUnderwaterHCZCNZLBZ:
            dc.w $C66,$A44,$624
            dc.w $E88,$C66,$844
            dc.w $EAA,$C88,$A66
            dc.w $ECC,$EAA,$C88
            dc.w $EEE,$ECC,$EAA
            dc.w $EEE,$EEE,$EEE
            dc.w $CEE,$CEC,$AEC
            dc.w $AEC,$8EC,$6CA
            dc.w $8EC,$4EA,$4A8
            dc.w $CEE,$CEC,$AEC
    ; AnPal_SuperSonic_4:
    PalCycle_HyperSonic:
            dc.w $EEC,$ECA,$EA8
            dc.w $EEE,$EEE,$EEE
            dc.w $CEC,$AEA,$2E0
            dc.w $EEE,$EEE,$EEE
            dc.w $AEC,$4EC,$0CC
            dc.w $EEE,$EEE,$EEE
            dc.w $CEE,$8EE,$4CE
            dc.w $EEE,$EEE,$EEE
            dc.w $EEE,$CCE,$AAE
            dc.w $EEE,$EEE,$EEE
            dc.w $EEE,$ECE,$CAC
            dc.w $EEE,$EEE,$EEE
    ; AnPal_SuperSonic_5:
    PalCycle_SuperTails:
            dc.w $0AE,$08E,$46A
            dc.w $4CE,$2AE,$46A
            dc.w $8CE,$4CE,$46C
            dc.w $AEE,$8CE,$48E
            dc.w $8CE,$4CE,$46C
            dc.w $4CE,$2AE,$46A
    ; AnPal_SuperSonic_6:
    PalCycle_SuperHyperKnuckles:
            dc.w $A6E,$64E,$428
            dc.w $C8E,$86E,$64A
            dc.w $EAE,$A8E,$86C
            dc.w $ECE,$CAE,$A8E
            dc.w $EEE,$ECE,$CAE
            dc.w $ECE,$CAE,$A8E
            dc.w $EAE,$A8E,$86C
            dc.w $C8E,$86E,$64A
            dc.w $A6E,$64E,$428
            dc.w $84E,$40C,$206
    ; AnPal_SuperSonic_7:
    PalCycle_SuperHyperKnucklesRevert:
            dc.w $64E,$20C,$206



    With:




    PalCycle_SuperSonic:
            binclude "General/Super Palettes/Super Sonic.bin"
            even
    ; AnPal_SuperSonic_2:
    PalCycle_SuperSonicUnderwaterAIZICZ:
            binclude "General/Super Palettes/Super Sonic Underwater in AIZ and ICZ.bin"
            even
    ; AnPal_SuperSonic_3:
    PalCycle_SuperSonicUnderwaterHCZCNZLBZ:
            binclude "General/Super Palettes/Super Sonic Underwater in HCZ and CNZ and LBZ.bin"
            even
    ; AnPal_SuperSonic_4:
    PalCycle_HyperSonic:
            binclude "General/Super Palettes/Hyper Sonic.bin"
            even
    ; AnPal_SuperSonic_5:
    PalCycle_SuperTails:
            binclude "General/Super Palettes/Super Tails.bin"
            even
    ; AnPal_SuperSonic_6:
    PalCycle_SuperHyperKnuckles:
            binclude "General/Super Palettes/Super Knuckles.bin"
            even
    ; AnPal_SuperSonic_7:
    PalCycle_SuperHyperKnucklesRevert:
            binclude "General/Super Palettes/Super Knuckles Reversion.bin"
            even



    Now you may edit the palettes as you please in SonMapEd and it will apply to the game once you've built the rom.
     
    Last edited by a moderator: Sep 7, 2014
  12. PotterAndMatrixFan

    PotterAndMatrixFan Newcomer Trialist

    Joined:
    Sep 5, 2014
    Messages:
    16
    Location:
    Uh, Earth maybe :]?
    Oh. I thought it was just to add the palettes in binclude at the end of the asm, but thanks.

    Edit: You don't happen to know why Tails get cut off when I give him custom mappings and replace with a character in Sonic's size?
     
    Last edited by a moderator: Sep 7, 2014
  13. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    So glad my contribution (overhaul) to that area of code (SuperHyper_PalCycle) is seeing use. Good luck identifying whose palette cycle is whose when they're all labelled 'AnPal_SuperSonic_1/2/3/4/5'.

    Oh yeah, it's more than possible. Tails and Knuckles are just missing a little code... and separate Super/Hyper sprites and mappings.
     
Thread Status:
Not open for further replies.