Sonic 3 & Knuckles text editing

Discussion in 'Tutorials' started by Nik Pi, Aug 28, 2022.

  1. Nik Pi

    Nik Pi Well-Known Member Member

    Joined:
    Feb 14, 2022
    Messages:
    54
    Location:
    Kazakhstan
    Hello everybody!
    In this tutorial- i'll show you, how to edit most of text in S3K. So, lest's go to something easy. Something, like..
    Data select text
    We gonna talk about "NO SAVE", and etc.
    First: prepare font for it (font placed in General/Sprites/S2Menu/2P Options.bin)
    When you edit (or not edit) font- let's find the text. He is not noted or commented, so he is here in s3k.asm:
    Code:
    byte_DB1C:    dc.b  $2B, $2C, $FF, $30, $1E, $33, $22, $FF, $21, $22, $29, $22, $31, $22, $FF; No save/Delete
    byte_DB2B:    dc.b    0,   0,   0,   0,   0, $FF; idk, lol
    byte_DB31:    dc.b  $37, $2C, $2B, $22, $FF; Zone#
    byte_DB36:    dc.b  $20, $29, $22, $1E, $2F, $FF; Clear
    How you can see- letters presented here as numbers. For editing- we need to know a ID for letter. Here is a table to simplify your life ;)
    A-1E
    B-1F
    C-20
    D-21
    E-22
    F-23
    G-24
    H-25
    I-26
    J-27
    K-28
    L-29
    M-2A
    N-2B
    O-2C
    P-2D
    Q-2E
    R-2F
    S-30
    T-31
    U-32
    V-33
    W-34
    X-35
    Y-36
    Z-37
    A lot, right?)
    Continue:
    Let's make something interesting. Something, like......
    sonic3k_005.png
    Not super-interesting, but, now you see, it's work!
    Try to make something with this.
    (NOTE: insert even after texts. With this- compiler will not give errors. Like it:
    Code:
    byte_DB1C:    dc.b  $2B, $2C, $FF, $30, $1E, $33, $22, $FF, $21, $22, $29, $22, $31, $22, $FF
    even
    byte_DB2B:    dc.b    0,   0,   0,   0,   0, $FF
    even
    byte_DB31:    dc.b  $37, $2C, $2B, $22, $FF
    even
    byte_DB36:    dc.b  $20, $29, $22, $1E, $2F, $FF
    even
    )
    All another text in data select menu- edit like this.

    Ok, after data select we go to..

    Title Cards
    It's a twist, yeah?)
    It's harder, than in another Sonic games.
    We'll make a AIZ card
    First: Theory
    Title cards made from few files: E,N,O,Z from General/Sprites/Title card/Title Card Red ACT.bin (KosM); and another letters for current zone (placed in Levels/Name of level/KosinskiM Art/Title Card.bin)
    Second: Prepare font
    Open SonMapEd, or graphics editor, and prepare letters:
    fuyk.png
    We'll make a "Green Grove"
    A replaced with R, and D with V
    Let's look at mappings:
    Code:
    word_2EEAC:    dc.w 4            ; DATA XREF: ROM:0002EE10o;ZONE
            dc.b    0,   6,    $85, $31, $FF, $DC;Z
            dc.b    0,  $A,    $85, $28, $FF, $EC;O
            dc.b    0,   6,    $85, $22,   0,     4;N
            dc.b    0,   6,    $85, $1C,   0, $14;E
    word_2EEC6:    dc.w $B            ; DATA XREF: ROM:0002EE10o;AIZ
            dc.b    0,   6,    $85, $4D, $FF, $E0;A
            dc.b    0,   6,    $85, $22, $FF, $F0;N
            dc.b    0,   6,    $85, $59,   0,     0;G
            dc.b    0,   6,    $85, $1C,   0, $10;E
            dc.b    0,   2,    $85, $62,   0, $20;L
            dc.b    0,   2,    $85, $5F,   0, $30;I
            dc.b    0,   6,    $85, $65,   0, $38;S
            dc.b    0,   2,    $85, $62,   0, $48;L
            dc.b    0,   6,    $85, $4D,   0, $50;A
            dc.b    0,   6,    $85, $22,   0, $60;N
            dc.b    0,   6,    $85, $53,   0, $70;D
    Notes:
    Code:
    dc.w $B

    Number of letters
    Code:
    dc.b   0,
    Place for letter. If you want to change it- set 30 to make it at bottom right with ZONE, or set -30 to make it upper. (actually, you can set any ID, i think, but 30- optimal and universal, lMO)
    Code:
    6,    $85, $4D, $FF, $E0;A
    2- it's a size of letter; uses for not wide letters like "J", "L", or "I".
    6- uses for other normal letters
    $A- For letters like W,M, or O
    $85- how looks this letter (set 95 for rotate it upside down)
    $4D- id of letter
    $FF- first ID of letter's place ($FF- left, or 0 for place it right)
    $E0- second ID of letter's place

    Get it? Let's go:
    We need to change mappings, to make it say "Green Grove"
    Do you remember, how did we replace the letters?)
    We'll do this:

    Code:
    word_2EEC6:    dc.w $A            ; DATA XREF: ROM:0002EE10o;AIZ
            dc.b    0,   6,    $85, $59, $FF, $E0;G
            dc.b    0,   6,    $85, $4D, $FF, $F0;R
            dc.b    0,   6,    $85, $1C,   0,     0;E
            dc.b    0,   6,    $85, $1C,   0, $10;E
            dc.b    0,   6,    $85, $22,   0, $20;N
            dc.b    0,   6,    $85, $59,   0, $40;G
            dc.b    0,   6,    $85, $4D,   0, $50;R
            dc.b    0,  $A,    $85, $28,   0, $60;O
            dc.b    0,   6,    $85, $53,   0, $75;V
            dc.b    0,   6,    $85, $1C,   0, $85;E
    Result:
    sonic3k_000.png
    It's all, folks!
    Later, i'll tell you how to edit results screens and credits.
    Tell me, if you had a questions.
    I'll be back..
     
    EddyTF likes this.
  2. lunarstudio

    lunarstudio Newcomer Trialist

    Joined:
    May 25, 2022
    Messages:
    2
    Location:
    poland
    you should also show how to move the title card mappings more to the left so they align with the 'zone' text, like all the other title cards
     
  3. Nik Pi

    Nik Pi Well-Known Member Member

    Joined:
    Feb 14, 2022
    Messages:
    54
    Location:
    Kazakhstan
    You need just change the last IDs ($FF, $E0;G) to more left IDs. I mean, if you want make it more left- just change last ID of every letter by ten less. (If it was $FF, $E0- change it to $FF, $D0).
    Few triks:
    • If last ID is start from letter ($A0-$FF)- the ID before him should be $FF. If it will be 0, letter will appear in the end at right side, far beyond the screen.
    • The letters should be located 20 pixels apart. That is, if the first letter is located in $A0, the next one should be located in $B0.
    • If the letter is wide, the next one should be located 25 pixels apart ($A0, the next one will be $B5)
     
  4. Nik Pi

    Nik Pi Well-Known Member Member

    Joined:
    Feb 14, 2022
    Messages:
    54
    Location:
    Kazakhstan
    Ok, here is a little guide for credits edit.
    As you can know, credits- just a text. No super-hard code, or something, but when you are trying to change it- you get a lot of errors. For fixing it- just put even after lines:
    Code:
    byte_5BCD2:    dc.b $F
            dc.b 7
            dc.b "EXECUTIVE PRODUCER",0,0
            even
    byte_5BCE8:    dc.b $11
            dc.b $E
            dc.b "HAYAO NAKAYAMA",0,0
            even
    And edit it:
    sonic3k_001.png
     
    EddyTF and Dark Shamil Khan like this.
  5. Dark Shamil Khan

    Dark Shamil Khan TASer lol Member

    Joined:
    Nov 7, 2021
    Messages:
    50
    Location:
    Pakistan
    Now I might sound a little dumb, because I don't know how Sonic 3 and Knuckles Coding works the text thing. But is there an actual limit on how many characters(letters) can be put in the ending credits screen.
     
  6. Nik Pi

    Nik Pi Well-Known Member Member

    Joined:
    Feb 14, 2022
    Messages:
    54
    Location:
    Kazakhstan
    I think, you can't put all alphabet in one line, man)
    Gimme one minute, i'll check it..
    EDIT:
    I think, yes. When line is out of screen, but letters is not ended- all letters become to an random incomprehensible mess.
     
    Last edited: Aug 28, 2022
    Dark Shamil Khan likes this.
  7. EddyTF

    EddyTF #romhacker Member

    Joined:
    Jan 9, 2022
    Messages:
    46
    Location:
    Russia
    Thank you so much! Now I will know how to change the text in Sonic 3 & Knuckles. You're a holy man, bro :D
     
    Nik Pi likes this.
  8. Nik Pi

    Nik Pi Well-Known Member Member

    Joined:
    Feb 14, 2022
    Messages:
    54
    Location:
    Kazakhstan
    You're welcome ;)
     
  9. lunarstudio

    lunarstudio Newcomer Trialist

    Joined:
    May 25, 2022
    Messages:
    2
    Location:
    poland
    this will come in handy for the s3k multilang project i'm pretty sure