• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Tut]Create complet new Tileset for Pokemon GBA games

Status
Not open for further replies.

LU-HO

Author of AdvanceMap
243
Posts
19
Years
  • Hello all

    Because many people have requested it many times, i now write a tutorial for this.

    What do you need:
    - Hexeditor
    - AdvanceMap
    - Attachement (empty Tileset image [compressed])
    - a bit of your brain

    Introduction:
    In this Tutorial, you will insert a empty Tileset. After inserting it, you have to add/insert the correct data with AdvanceMap.
    As common, first create a Backup of your Hack, before starting this tutorial.

    needed basic knowledge:
    The Tileset Header has these parts:
    [compressed, 1 Byte(00 not compressed or 01 compressed)][SubColorChoose, 1 Byte(00 for part 1 Tileset, 01 for part2 Tileset)][0000]
    [Pointer to Tileset image, 4 Bytes]
    [Pointer to Palettes, 4 Bytes]
    [Pointer to BlockData, 4 Bytes]
    [Pointer to BehaviorData(RSE) respectively Animations(FRLG), 4 Bytes]
    [Pointer to Animations(RSE) respectively BehaviorData(FRLG), 4 Bytes]

    To use the new Tileset in AdvanceMap, you have to attend to the AdvanceMap TilesetNumber calculation.
    It work as follow:
    TilesetNumber = (<TilesetHeader-Offset> - <TilesetHeader-Offset Tileset 0>) / 24.

    To calculate the Offset of the Tileset you have to fit the same conditions:
    <TilesetHeader-Offset> = <TilesetHeader-Offset Tileset 0> + (TilesetNumber * 24)
    WARNING: on Emerald you have to add + 8 to the result!

    Tileset-Header Offset, Tileset 0:
    The Offset to calculate the Tileset Numbers for each Version/Language
    Rubin:
    AXVD=Hex: $2924DC / Dez: 2696412
    AXVE=Hex: $286CF4 / Dez: 2649332
    AXVJ=Hex: $25F15C / Dez: 2486620
    AXVF=Hex: $28D958 / Dez: 2677080
    AXVS=Hex: $28A28C / Dez: 2663052
    AXVI=Hex: $2871E4 / Dez: 2650596

    Saphier:
    AXPD=Hex: $292470 / Dez: 2696304
    AXPE=Hex: $286C84 / Dez: 2649220
    AXPJ=Hex: $25F0EC / Dez: 2486508
    AXPF=Hex: $28D8E8 / Dez: 2676968
    AXPS=Hex: $28A21C / Dez: 2662940
    AXPI=Hex: $287174 / Dez: 2650484

    Emerald:
    BPED=Hex: $3F1434 / Dez: 4133940
    BPEE=Hex: $3DF704 / Dez: 4060932
    BPEJ=Hex: $3B7B24 / Dez: 3898148
    BPEF=Hex: $3E45F0 / Dez: 4081136
    BPES=Hex: $3E2D60 / Dez: 4074848
    BPEI=Hex: $3DC448 / Dez: 4047944

    Leaf Green:
    BPGD=Hex: $2D4998 / Dez: 2967960
    BPGE=Hex: $2D4A74 / Dez: 2968180
    BPGJ=Hex: $298B24 / Dez: 2722596
    BPGF=Hex: $2CEEC4 / Dez: 2944708
    BPGS=Hex: $2D023C / Dez: 2949692
    BPGI=Hex: $2CDB54 / Dez: 2939732

    Fire Red:
    BPRD=Hex: $2D49B8 / Dez: 2967992
    BPRE=Hex: $2D4A94 / Dez: 2968212
    BPRJ=Hex: $298B44 / Dez: 2722628
    BPRF=Hex: $2CEEE4 / Dez: 2944740
    BPRS=Hex: $2D025C / Dez: 2949724
    BPRI=Hex: $2CDB74 / Dez: 2939764

    1. Step: search Offset
    1. Open AdvanceMap.
    2. Open your ROM, where you want to insert the new Tileset.
    3. Use the "Find free space"-Function to find a free space for your Tileset. (660 Bytes)

    4. insert 660 for Needed Bytes and click "OK" to start the search.

    For Example i get the Offset: $718C40 (I use FireRed German)

    2. Step: Calculate the effective offset (AM-Logic)
    As Described above, we have to calculate the correct offset, otherwise AdvanceMap cannot handle the Tileset.
    Wie have to calculate the "Formula" forth ans back:
    TilesetNummer = (<TilesetHeader-Offset> - <TilesetHeader-Offset Tileset 0>) / 24.
    <TilesetHeader-Offset> = <TilesetHeader-Offset Tileset 0> + (TilesetNummer * 24)

    I use FireRes German, it have the Code BPRD, so i have to use $2D49B8 as Offset from Tilesets 0.
    $718C40 - $2D49B8 = $444288 / $18 = $2D81B -> 186395
    or in Decimal:
    7441472 - 2967992 = 4473480 / 24 = 186395
    (PS: I never say it would be an nice TilesetNumber. ^^)

    Hm... now the implausibly case occur, that it result a integer.
    In the normal case you have a decimal place...
    Therefore wie will now cutoff the decimal place and add 1 to the number.
    186395+1 => Tileset Number: 186396

    And now wie calculate our Offset:
    186396 * 24 = 4473504 + 2967992 = 7441496 -> $718C58
    (If it would be an Emerald-ROM we have to add +8)
    Tileset-Header Offset: $718C58

    3. Step: Insert Tileset-Image Data
    1. Open your Hexeditor
    2. Open your ROM and goto the calculated TilesetHeader Offset.
    3. we skip 24 Bytes for TilesetHeader. -> $718C70 (we notice this Offset)
    4. Open the empty Tileset in Attachemend in your Hexeditor.
    5. And insert the content to the actual place in your ROM.
    5.1. Select filecontent ($50 / 80 Bytes)
    5.2. Edit-> copy
    5.3. select the same amount of bytes at teh currend position of your ROM ($50 / 80 Bytes) $718C70 to $718CC0

    5.4. Edit->past


    4. Step: insert Palette Data
    We notice the actual Offset, after inserting TilesetImage. -> $718CC0
    A Palette have 16*16 Colors, each have 2 Bytes.
    16*16*2 = 512
    We "insert" a empty Palette, so we just skip 512 FF-Bytes. -> $718EC0

    5. Step: insert Block-Data
    We notice the actual Offset, after inserting Palettes. -> $718EC0
    Now we insert the Block-Data for 4 empty Blocks.
    1 Block have 16 Bytes. (2 Byte for each Tile on it.)
    16*4=64
    We insert 64 00-Bytes.


    6. Step: Insert Behavior-Data
    We notice the actual Offset, after inserting Block-Data.-> $718F00
    With Behavior-Data i mean the Behavior-Byte and Background-Byte form Block editor.
    We insert Behavior-Data for the 4 Blocks wie inserted before.
    On RSE this are 2 Bytes each Block.
    On FR/LG this are 4 Bytes each Block.
    4*4=16
    We insert 16 00-Bytes.


    7. Step: insert TilesetHeader
    Now we insert the TilesetHeader itself, goto the calculated Offset ($718C58).
    The parts of the TilesetHeader was:
    [compressed, 1 Byte(00 not compressed or 01 compressed)][SubColorChoose, 1 Byte(00 for part 1 Tileset, 01 for part2 Tileset)][0000]
    [Pointer to Tileset image, 4 Bytes]
    [Pointer to Palettes, 4 Bytes]
    [Pointer to BlockData, 4 Bytes]
    [Pointer to BehaviorData(RSE) respectively Animations(FRLG), 4 Bytes]
    [Pointer to Animations(RSE) respectively BehaviorData(FRLG), 4 Bytes]

    For our Example this would be: (we need the noticed Offsets)
    [01(because it was a compressed Tileset image, we inserted.)][01(because part 2)][0000]
    [708C7108] (Offset was: $718C70)
    [C08C7108] (Offset was: $718CC0)
    [C08E7108] (Offset was: $718EC0)
    [00000000] (We have no Animations.)
    [008F7108] (Offset was: $718F00)


    Now we have to save the Changes, and close the Hexeditor.

    8. Step: use new Tileset on an existing map in AdvanceMap
    1. open AdvanceMap and your ROM
    2. open the Map
    3. change to Headerview (the Normal, not professional View)
    4. insert our TilesetNumber -> 186396
    5. press "Change Tileset"-Button.

    6. now change the Map forth and Back, so AdvanceMap load the Tileset correctly.

    9. Step: change Tilesetdata
    So, now you can change the Tileset Data(Image, Palettes, Block-Data, Behavior-Data) with the Blockeditor.

    On the Image you see the 4 new Blocks und the new Tileset image within the red border.

    PS: Do not forget the first Tile on each Tileset have to be plain in the first color of the Tileset.

    create part 1 Tilesets
    Warning on each who want to create part 1 Tilesets!
    If you want to create a Tileset for part 1, you have to do this changes on the Tutorial:
    All versions:
    use 00 for SubColorChoose not 01.

    RSE:
    You have to insert Block- and Behavior-Data for 512 Blocks, not only 4 Bocks.
    that is: 512*16=8192 00-Bytes als Block-Data. 512*2 = 1024 00-Bytes als Behavior-Data.

    FR/LG:
    You have to insert Block- and Behavior-Data for 640 Blocks, not only 4 Bocks.
    that is: 640*16=10240 00-Bytes as Block-Data. 640*4 = 2560 00-Bytes as Behavior-Data.

    PS: or you skip the same amount FF-Bytes, i will not you typing your fingers sore. But, Warning!!!.
    You have to search a bigger free space at the beginning.
    AND WARNING!!! if you skip this Bytes, you will get a really great free space, and AdvanceMap will find this free space on next automaticaly Offset search for inserting some thing. Perhaps on inserting a new Map. And if you change the BlockData afterwards, it would override the Map with your Blockdata, and your map is destroyed!!!

    final remark:
    This Tutorial is Copyright by LU-HO Poké.
    It is not allowed to publish this Tutorial/Images/Attachement on other boards/web pages, expect my explicit permission.
    Linking it is allowed.

    Greetings LU-HO
     
    Last edited:

    LU-HO

    Author of AdvanceMap
    243
    Posts
    19
    Years
  • Ah, cool.... I hope you implement this in Advance Map cause I'll be needing this :)

    It will take much time until AdvanceMap will be released, so i released this tutorial so you don't have to wait until i release it, and you can insert new Tilesets now.
     

    Thrace

    @tion
    1,048
    Posts
    16
    Years
    • Seen Oct 2, 2016
    This is nice, I'm not sure how useful this is though. Surely there are enough tilesets already. I'd really like to see a tutorial on how to add animations to tiles.
     

    cooley

    ///Keepin' it simple
    1,148
    Posts
    17
    Years
  • This is definitely useful to some "graphical" Hackers, Maybe I should make a "Calculator" Tool for it, but it doesn't seem to really spark my interests. I just don't know...
     

    Derlo

    Tired....
    135
    Posts
    16
    Years
  • Hello!
    This is really a great tutorial!!
    Well, I followed all correctly of the steps (I Think so)...
    Everything gave right in AMAP.... but when I will play Rom
    in the emulator the palettes don't work!
    Here below the image:

    What should I make for adjusting that?
     

    Lady Berlitz

    Cinnamon ♪
    1,770
    Posts
    16
    Years
  • Wow, a tutorial by LU-HO? This is unexpected.
    Also, this is quite original, as most tutorials have the same idea; but this is totally different.

    I'm a little lazy when it comes to following step-by-step things, but I'll try this at one point.

    Thanks for writing this! It seems like it can add a lot better hacks to PC over time.
     

    LU-HO

    Author of AdvanceMap
    243
    Posts
    19
    Years
  • Hello!
    This is really a great tutorial!!
    Well, I followed all correctly of the steps (I Think so)...
    Everything gave right in AMAP.... but when I will play Rom
    in the emulator the palettes don't work!
    Here below the image:

    What should I make for adjusting that?

    Can you please post an Image of the palettes from VisualBoyAdvance.
    and some pictures with the palettes from AdvanceMap, so i can see where exactly is the difference.
     

    LU-HO

    Author of AdvanceMap
    243
    Posts
    19
    Years
  • pleas try to replace all 512 Byte of the palette with 00-Bytes instant of let them FF.
    and report what happen if you change the colors afterwards.
    the problem might be that FFFF is not a valid Color code 7FFF is the highest valid color. so if all are 0000 this would fix this.
     

    Derlo

    Tired....
    135
    Posts
    16
    Years
  • I also tried that.
    And the same thing of Meggido happened.
    Now everything that was WHITE, was BLACK!

    The problem for the the one that I saw is the following:
    AMAP recognizes the offset of the palettes, but VBA no.
    If I use the normal palettes of the rom, the tiles are visible,
    but when I use the new palette that problem happens.
     

    LU-HO

    Author of AdvanceMap
    243
    Posts
    19
    Years
  • Hello all

    I found the error for megiddo and Derlo.
    you have to use 01 for SubColorChoose.
    so the header for my example is:
    [01(because it was a compressed Tileset image, we inserted.)][01(because part 2)][0000]
    [708C7108] (Offset was: $718C70)
    [C08C7108] (Offset was: $718CC0)
    [C08E7108] (Offset was: $718EC0)
    [00000000] (We have no Animations.)
    [008F7108] (Offset was: $718F00)

    I fixed this in the tutorial text.

    sorry i forget this Part ^^"

    Greetz LU-HO
     

    Neti

    Inactive
    1,516
    Posts
    16
    Years
  • Really useful, but i think i would die when trying it^^
    i would really appreciate someone making a tool for this
     

    LU-HO

    Author of AdvanceMap
    243
    Posts
    19
    Years
  • Really useful, but i think i would die when trying it^^
    i would really appreciate someone making a tool for this

    Hacking with tools is no spezial skill.
    If you want be a RomHacker you have to know how you use the Hexeditor.
    And this Tutorial is a Simple description how you could add a new Tileset with a HexEditor. No spezial/difficult thing for a real RomHacker.
     

    Zeikku™

    Johto remaker
    1,119
    Posts
    16
    Years
  • Hacking with tools is no spezial skill.
    If you want be a RomHacker you have to know how you use the Hexeditor.
    And this Tutorial is a Simple description how you could add a new Tileset with a HexEditor. No spezial/difficult thing for a real RomHacker.

    I actually agree that this doesn't seem too hard, thanks for the tut anyways,
    I need to try this when I'm free :)
    I agree that real rom hackers should be able to hex edit,
    that is completely true. Not everything is tool based yet xD
     
    Status
    Not open for further replies.
    Back
    Top