don't click here

No Hex editor? Port tiles the easy way!

Discussion in 'Engineering & Reverse Engineering' started by Heran Bago, Sep 6, 2005.

Thread Status:
Not open for further replies.
  1. Heran Bago

    Heran Bago

    Ah! It's Puyo battle then. Tech Member
    Before you read, I appologize for my horrid spelling and typing. Some things like "pallete" vs "palette" I might spell wrong. This also might be my first tutorial so.. yeah..
    Also, I typed this whole thing up in notepad, so some of the spacing might be bad. Whoops.

    ~~~~~~~~~~~~~~~~~~~

    Are you hexaphobic? Well there's an even easier way to port tiles than a hex editor!

    You can simply use tile layer pro to port level tiles and mappings between Sonic games.

    ~~~~~~~~~~~~~~~~~~~

    What you need:
    - Tile Layer Pro (TLP)
    - knowledge of using TLP
    - debuGens or Genecyst
    - SonED
    - a ROM of Sonic 2
    - a ROM of Sonic Crackers
    - internet

    Extra Credit:
    - HivePal

    ~~~~~~~~~~~~~~~~~~~

    First you might want to know the lingo I'll be using. With any marked with an asterisk(*), you do not need to know how they function, but it's nice to know what they are:

    *Blocks / Chunks / Tiles:
    I will use these words interchangeably, meaning the same thing.

    *Layout:
    A level in a Sonic game is made out of blocks that are 128 pixels wide and 128 pixels

    high. The layout defines which blocks go where.

    *128x128 mappings:
    The 128x128 blocks mentioned are composed of 16x16 pixel blocks. The 128x128 mappings

    dictate which 16x16 blocks make up which 128x128 blocks.

    *16x16 mappings:
    The 16x16 blocks mentioned are further broken up into 8x8 pixel blocks. The 16x16 mappings dictate which 16x16 blocks make up which 128x128 blocks.

    *8x8 art/tiles/patterns/blocks:
    The art that makes up anything in a Sonic game is composed of tiles 8 pixels wide and 8 pixels high. THESE are the only pieces given graphics. All else is built off these.

    ~~~~~~~~~~~~~~~~~~~

    1) Fire up Gens (debuGens). Load Sonic Crackers.

    2) Go to the first level. Get past the splash screen and when you can see Sonic and Tails, select File > Save State As. In this tutorial, I'll assume you named the save state "cracker.gsx".

    2) Load up Sonic the Hedgehog 2 (MD of course) and repeat Step 2. I'll assume you
    named the save state "so2.gsx".

    3) Push ESC to pause Gens (ohnoes your RAM iz beeng eetan!), minimize it.

    4) Fire up TLP. Select File > Open. Choose "all files" as the file type, and open your Crackers save state. Repeat for Sonic 2's.

    5) If the only colors you see are green and black, click the offending window and

    select View > Format > Genesis.

    6) You should have something like this:
    [​IMG]

    7) Now get these two websites open. Firefox users, different tabs. Everyone else,

    different windows:
    A) Saxman's Sonic 2 Guide > savestate > mappings.
    a) hosted on digibase, among other places
    b) http://saxman.digibase.ca/s2hack/genecyst/mapping.htm
    B) Hivebrain's Crackers Guide
    a) hosted on Sonicology
    b) http://sonicology.fateback.com/hacks/crackers/index.html
    c) Scroll down to where it says "Savestate Contents (Techno Tower Zone)"

    8) THINK! To get a level from Crackers to Sonic 2, we need to bring over the layout, the 8x8 art, the 16x16 mappings, and the 128x128 mappings. You don't need to do them in order, but you need to do all for a true port.

    9) PONDER! Do these two completely seperate games use the same format for these
    things? Uh-oh!

    10) PROBLEM! Sonic 2 and Sonic Crackers use different formats for level layout! Oh well, looks like you'll just have to make a custom level given the tiles. Don't worry, it'll be fun.

    11) We'll start with 16x16 mappings. Why? Just because. Hivebrain's guide says they're at $3180 in the Crackers state. Select the cracker.gsx window and push gtrl+g. Type in 3180.

    12) THINK! What is TLP doing with all this fuzz? It's trying to display data as a graphic. That fuzz IS data. While a hex editor displays data as numbers, this is just displaying it as colors. TLP IS a hex editor in a sense.

    13) LOOK! See how each peice is like, a couple parallel lines? The data LOOKS a certain way. It's in a specific format. It's much easier to see with colors than with number. This is an approach to ROM hacking that you won't get with a hex editor. Also see how on the 8th line it stops and is black for a few squares? Lots of black = no data, or where our target ends.
    [​IMG]

    14) Saxman's guide tells us 16x16 mappings in Sonic 2's savestate are at $B478. Go there in yours.

    15) LOOK! It looks the same, roughly. The lines, I mean.

    16) MUSE! What does that tell you about the data. Maybe IT'S THE SAME KIND OF THING!

    17) in your Crackers savestate, right-click and hold on the upper left tile. Drag to the line where our target ends. Copy it.
    [​IMG]

    18) SELECT the Sonic 2 save state window and paste. CLICK THE BLACK PART BELLOW to secure the data in place. TLP kinda sucks so it won't set the data there otherwise.

    19) The data after where our target ends should probably go. Replace those blocks with blackness.

    20) Great! You moved that data from one savestate to another! Now you need to do it with the 128x128 mappings and 8x8 art. You can do this part on your own, but those two pieces of data are bigger, so you'll need to make several trips.

    21) NOTE! In Sonic 2, there are two blanks spaces included in the level's art.
    [​IMG]

    22) Get the 8x8 art and the 128x128 mappings done by yourself now.

    23) Now you can load the savestate into Sonic 2. Afterall, you still have Gens open if you're following the tutorial. The level now sucks, huh? Close Gens. Fire up SonED. Note: SonED 2 does not work for this.

    24) Load a copy of your Sonic 2 ROM with SonED. Then File > Load Save-State. Load your now-altered so2.gsx. Then select File > Read Data > Save-State > All.

    25) SonED won't load the palette because SonED isn't god. Deal with it.

    26) Now you should be looking at something like this:
    [​IMG]

    27) Great! You can now use the level editor to make your own custom level! Just push the P key, and use A and Z keys to toggle between tiles. Click to place a tile. Push O for the object editor.

    28) Push the I key to go to the tile editor. You will need to tweak the collision on slopes for them to work as.. slopes. I'm not good at it personally so don't look at me. Stop looking!

    29) When you're done designing your level and tiles. It's time to save. Select File > Write Data > Rom > ALL > Emerald Hill 1. Then select File > Save Rom. Save the ROM!

    30) Play the ROM! Bask in the glory! BASK DAMN YOU! Yes, the level palette sucks, and slopes suck too probably.

    EX1)If you'd like to fix the palette while still avoiding hex, get HivePal.

    EX2) If you'd like to fix the slopes, get better at it =P.

    ~~~~~~~~~~~~~~~~~~~
    Result:
    [​IMG]
     
  2. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    You know an idea you were thinking of using is stale when someone writes a tutorial to do it.

    Out of morbid curiosity, why does the HUD go oddly-coloured?
     
  3. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Cause he ported the first pallet line from chaotix. The HUD in S2 uses this pallet line.

    He should have only ported the other two pallet lines.
     
  4. Ultima

    Ultima

    Games Publisher Tech Member
    2,398
    1
    18
    London, England
    Publishing mobile games!
    Haha, good stuff =P
     
  5. LocalH

    LocalH

    roxoring your soxors Tech Member
    Tile Layer Pro sucks. Use Tile Molester or YY-CHR, they're much better (Tile Molester is Java but has some nice features, while YY-CHR is more simple but Windows-native).
     
  6. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    This is slightly annoying. I've put the two blank 8x8 tiles in and removed the letters etc which were causing problems, but for some reason it's not working.

    [​IMG]
     
  7. Ambil

    Ambil

    I want that heinous hedgehog hammered! Member
    Indeed it sucks. I can't even import a 8-bit MS bitmap to a Sonic 1 ROM. -_-
     
  8. Heran Bago

    Heran Bago

    Ah! It's Puyo battle then. Tech Member
    Hmm, It looks like the 128 mappings are right. I doubt anyone could mess up the 16s. So the problem must be the 8x8 art.
    In my fourth picture, I alligned both to where the tiles start. Now, The mappings refer to the art/tiles loaded into the VDP. You need to include the letters and the blanks from Crackers' VDP in Sonic 2s.
    As you hinted, this causes problems with the art of other sprites. What you can probably do is replace the art for letters etc that isn't used with the appropriate badnik tiles and edit the mapping for them. Just a guess, I'm not big on mappings.

    TO sum things up, the VDP in Sonic 2 should appear exactly as it does in Crackers, Seriously, identicle. Only one blank, then a !. Then solid blocks of color, etc.

    Indeed. You are free to use the tile editor of your choice. This tutorial uses it because it is what I am most familiar with.
     
  9. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    And the result...

    [​IMG]
     
  10. esreveRPsychology

    esreveRPsychology

    Master of Pies Pending Member
    14
    0
    0
    In my chair in a sleeping bag
    Restoring HPZ like any other new guy project
    One [very n00bish] question, what are the offsets in Sonic 2 Beta? I'm trying to import the level art from there to Sonic 2, but for some reason unbeknownst to me, SonEd won't do it, and ESE II keeps giving me an error message.
     
  11. Shadow MK2

    Shadow MK2

    Member
    120
    0
    0
    I also have a question Heran, will this work to port other Sonic levels into Sonic 2? Like Sonic 3 levels? Speaking of which, what are the offsets for Sonic 3?
     
  12. Heran Bago

    Heran Bago

    Ah! It's Puyo battle then. Tech Member
    Yes, this will work porting from Sonic 3 or Sonic & Knuckles.

    There should be a way to do this to port to Sonic 2 Beta as well.

    I don't know the offsets for either though.

    Quickman: if you're still intersted, post a screen showing the VDP in level.
     
  13. Dragonsbrethren

    Dragonsbrethren

    Member
    99
    0
    0
    To fix your problem with ESE II make a folder named "Temp" in its directory.


    I never thought of trying this, I've done similar things in the past for other games, I find it's actually easier to see certain types of data in a tile editor than a hex editor.
     
  14. Will this work with porting levels into sonic 1?
     
  15. Neo Majin

    Neo Majin

    Member
    261
    0
    0
    New England / Virginia
    Very little thanks to poor computer access
    Most likely not, as SonED, IIRC, can't save graphics data to Sonic 1 (at least it doesn't for me) and also, Sonic 1 uses 256x256 tiles while the other Sonic games (with the notable exception of SCD) use 128x128, which means you'd probably have to draw new tiles.
     
  16. Dragonsbrethren

    Dragonsbrethren

    Member
    99
    0
    0
    You could still port the 8x8 and 16x16 tiles this way, though.
     
  17. Heran Bago

    Heran Bago

    Ah! It's Puyo battle then. Tech Member
    According to Sonic 65, yes. This will work with Sonic 1.
    Even though Sonic 1's largest tiles are 256x256, Sonic 2 automatically breaks them into 128s.
    Esrael had it pretty easy it seems.
     
Thread Status:
Not open for further replies.