DC Forums

We have moved our forums:
http://www.dcforums.co.cc/forum/

Please re-register there, thank you.
GKS


Join the forum, it's quick and easy

DC Forums

We have moved our forums:
http://www.dcforums.co.cc/forum/

Please re-register there, thank you.
GKS

DC Forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
There are many new features available. Some of them include: the advanced profile, reputation system, and the point system. Thank you for waiting patiently, enjoy the update. Plus we are still working on fixing a lot of bugs and stuff that are wrong with the theme.

    Advanced Over World Sprite Editing

    G.K.S.
    G.K.S.
    Founder
    Founder


    Male Number of posts : 1718
    Age : 30
    Location : Calfornia, United States
    Status : Updating the forum.
    Warning :
    Advanced Over World Sprite Editing Left_bar_bleue90 / 10090 / 100Advanced Over World Sprite Editing Right_bar_bleue

    Reputation : 0
    Points : 25
    Registration date : 2008-09-20

    Advanced Over World Sprite Editing Empty Advanced Over World Sprite Editing

    Post by G.K.S. Sat Sep 20, 2008 10:15 pm

    By: Darthatron
    Everything after this message was written by Darthatron.


    Okay, in this tutorial I will teach you how to repoint, resize and increase the amount of OWS (Over World Sprites) in Pokemon FireRed. Sounds fun, right?

    I haven't tested this in the other Advance Gen Games, but I'm sure it will work just the same.

    For this Tutorial you will need...
    An English FireRed ROM
    A Hex Editor
    The latest version of VBA
    A Free Space Finder
    A Brain

    Lesson 01: Understanding the Data.

    Ok, let's take a quick look at the Layout of the Sprite Data, before we go any further. Here is what the first Sprites Data will look like in FireRed:

    Code:
    FFFF001102110002100020001001000010373A089C373A0870343A08A0003A08FC1C2308Now, let's break it down, so you can all understand:

    Code:
    FFFF = Starter Byte
    00 = Palette Number
    11 02 11 = Unknown Data 1
    0002 = Unknown Data Size
    10 = Width
    00 = Unknown Byte 1
    20 = Height
    00 = Unknown Byte 1
    10 01 0000 = Unknown Data 2
    10373A08 = Unknown Pointer 1
    9C373A08 = Unknown Pointer 2
    70343A08 = Unknown Pointer 3
    A0003A08 = Sprite Pointer
    FC1C2308 = Unknown Pointer 4Following the "Sprite Pointer" will lead you to this Data:

    Code:
    68BB350800010000This is another pointer to where the actual Sprite Hex Art is, don't worry about looking at it, it's pointless unless you look at it in an OWE. Here's the broken up version of the Sprite Data:

    Code:
    68BB3508 = Hex Art Pointer
    0001 = Data Size
    0000 = Unknown DataThe Data Size is always equal to this algorithm:

    Code:
    Data Size = (Width x Height) / 2That's about it for this lesson, next we will learn how to resize the OW Sprite! YAY! *Cheers*

    Lesson 02: Resizing an Over World Sprite.

    Right, so if you remember correctly, before we looked at the Sprite Data, and it had the "Height" and "Width" Bytes stored there, so... Let's just change them, and see what happens. Why don't we make it a 32 x 32 Sprite now?

    Code:
    FFFF = Starter Byte
    00 = Palette Number
    11 02 11 = Unknown Data 1
    0002 = Unknown Data Size
    20 = Width
    00 = Unknown Byte 1
    20 = Height
    00 = Unknown Byte 1
    10 01 0000 = Unknown Data 2
    10373A08 = Unknown Pointer 1
    9C373A08 = Unknown Pointer 2
    70343A08 = Unknown Pointer 3
    A0003A08 = Sprite Pointer
    FC1C2308 = Unknown Pointer 4Now, let's put it back together.

    Code:
    FFFF001102110002100020001001000010373A089C373A0870343A08A0003A08FC1C2308...And put it back into our Hex Editor. Next we will open up the OWS in our OWE.
    Advanced Over World Sprite Editing 0
    Oh dear! Frame 0 and 1 seemed to have melded together! This means we have to repoint the Frames, YAY!
    Ok, so all you have to do is follow the "Sprite Pointer", which is "A0003A08", or "0x003A00A0" when it's flipped. SO now, goto the offset "0x003A00A0" in your Hex Editor and look at the data. It should look something like this:

    Code:
    68BB350800010000Now, we need to work out how many frames the OWS has. The Hero Sprite has 20 Frames, so open up your Free Space Finder and search for the Value of this Sum:

    Code:
    Value = (Height x Width) / 2 x FramesSo, in this case it would be:

    Code:
    Value = (16 x 16) / 2 x 20
    Value = 256 / 2 x 20
    Value = 128 x 20
    Value = 2560So, we will be searching for 2560 Bytes! YAY! Searching sure is fun.
    *Searches*
    Ok, I found the Space I need at the offset: "0x00720A00" Lucky me. Now, I'm going to start Repointing all the Pointers.
    Back to the Offset "0x003A00A0" in your Hex Editor and it's time to start the fun!
    Alright, so replace the First Pointer with "000A7208", which now lead to the Free Space we found earlier. Now, view that Frame and Sprite in your OWE. And see how it turns out.
    Advanced Over World Sprite Editing 1
    Great! We now have a clear Sprite! Next we are going to want to do the same for every frame, so back at the Offset "0x003A00A0" we are going to move 8 more Bytes into the File and Repoint this Frame aswell!

    So with the Free Space we found earlier, which was "0x00720A00", we want to add 128 Bytes, because that is the Value of the Sum we did before:

    Code:
    Value = (Height x Width) / 2So, the new Offset will be: "0x00720A80"
    And the new Pointer will be: "800A7208"

    So, what we want to do it replace the Pointer at the Offset "0x003A00A0" with our new pointer, in my case: "800A7208".

    Great! The second Frame is now clear as well! Do that for the other 18 Frames, and then you can start painting your new OWS! YAY!

    Lesson 03: Adding for OWS to the game.

    Finally, we can learn how to repoint the OWS and add more into out game! YAY! *Cheers*

    Ok, what we are going to do it open our ROM in our Hex Editor...

    *Opens ROM*

    Right, now Goto the offset: "0x0039FDB0" And you will see a whole bunch of Pointers, right? They should look something... like... this:


    Code:
    B03B3A08D43B3A08F83B3A081C3C3A0858483A08A0483A08C4483A0864453A08
    88453A08AC453A08D0453A087C483A08E8483A080C493A08643C3A08883C3A08
    AC3C3A08D03C3A083C3D3A08A83D3A08F03D3A08F43C3A08183D3A08603D3A08
    CC3D3A0890433A08B4433A08143E3A085C3E3A08EC3E3A08383E3A08843D3A08
    803E3A08343F3A0820443A08583F3A084C423A0828423A0870423A087C3F3A08
    A03F3A08C43F3A08E83F3A0878403A089C403A08C0403A08E4403A08A43E3A08
    C83E3A0818463A0854403A0878493A080C403A08B8423A0808413A082C413A08
    94423A08BC413A0830403A08103F3A08403C3A0850413A0874413A0898413A08
    00433A08D4443A08F8443A0824433A0868443A088C443A08B0443A086C433A08
    34483A08A4473A0810483A0860463A08C8473A08EC473A08D8433A08FC433A08
    84463A08A8463A08CC463A08F0463A0814473A0880473A085C473A0838473A08
    EC503A083C463A08E0413A08DC423A0848433A0830493A0854493A0844443A08
    1C453A0840453A08C0493A08E4493A08084A3A082C4A3A08504A3A08744A3A08
    984A3A08BC4A3A08E04A3A08044B3A0810513A089C493A08284B3A08844F3A08
    F04F3A08C8503A0814503A0880503A08A4503A0838503A084C4B3A08704B3A08
    5C503A08944B3A08B84B3A08DC4B3A08004C3A08244C3A08484C3A086C4C3A08
    904C3A08B44C3A08D84C3A08FC4C3A08204D3A08444D3A08A84F3A08684D3A08
    8C4D3A08B04D3A08D44D3A08644E3A08884E3A08AC4E3A08F44E3A08D04E3A08
    184F3A083C4F3A08604F3A08CC4F3A08F84D3A081C4E3A08404E3A08They look fun... NOT! Ok, so I'll show you what each pointer means...


    Code:
    B03B3A08 = Pointer to OWS 0
    D43B3A08 = Pointer to OWS 1
    F83B3A08 = Pointer to OWS 2
    1C3C3A08 = Pointer to OWS 3
    58483A08 = Pointer to OWS 4
    A0483A08 = Pointer to OWS 5
    C4483A08 = Pointer to OWS 6
    64453A08 = Pointer to OWS 7
    88453A08 = Pointer to OWS 8
    AC453A08 = Pointer to OWS 9
    D0453A08 = Pointer to OWS 10
    7C483A08 = Pointer to OWS 11
    E8483A08 = Pointer to OWS 12
    0C493A08 = Pointer to OWS 13
    643C3A08 = Pointer to OWS 14
    883C3A08 = Pointer to OWS 15
    AC3C3A08 = Pointer to OWS 16
    D03C3A08 = Pointer to OWS 17
    3C3D3A08 = Pointer to OWS 18
    ...
    404E3A08 = Pointer to OWS 150Yes, that's right. Following one of those points will take you to the "Sprite Data", we looked at that data before (Lesson 01 & 02), cool huh? This is the location where AMap reads from, however, this isn't as far back as we can go...

    Now, in your Hex Editor we are going to goto the location that points to this Table, and change it. So, goto this location: "0x0005F2F4", this should have a pointer to the table we just looked at, correct?

    Ok, now open up your ROM in your FSF and search for this number of bytes:

    Code:
    Value = Number x 4"Number" is how many Sprites you want to have in your game. For this example we will use 151, Which is 1 extra Sprite to the average 151 FireRed has.

    So.... In my FSF I will search for....

    Code:
    Value = Number x 4
    Value = 152 x 4
    Value = 608...608 Bytes. However, due to my vast amount of laziness, and my really slow computer, I will just use the offset "0x00801000", write that offset down somewhere, alright so... Asuming we are still at the offset "0x0005F2F4", I will set the Pointer there to... "00108008".

    Now, we have copy/paste the Table at the Location "0x0039FDB0", ONLY THE FIRST 151 POINTERS (604 Bytes), to the Location we just found, in my case "0x00801000". Now, if you did everything correctly, there should be at least 4 Free Bytes after the table has been pasted. With this free space we are going to add a new pointer to some free space where we will put our new Sprite Data...

    Once again, open up FSF and search for some free space, this time search for 36 Bytes. Once again, due my huge amount of laziness, I will be using the offset "0x00802000". Back at the 4 Bytes that we have free after pasting the Pointer Table, we are going to add out new pointer. In my case: "00208008".

    Now, in your Hex Editor we are going to look at the Hero's Sprite Data, located at "0x003A3BB0", and we are going to copy it all (36 Bytes). Then we will go back to our new free space, in my case "0x00802000", and we are going to paste the data we just stole from the Hero's Sprite Data.

    Open your ROM up in a Map Editor and make a Sprite with the Picture Number of "151" and you will notice that the Map Editor doesn't appear to show any Sprite. However, opening the ROM in your emulator and looking at the Sprite it will look like the Hero.

    Alright, now you just have to follow Lesson 02, using this Sprite Data instead of the First, and all should be fine. I think... I kind of lost track of where I was up to. If for whatever reason it doesn't work, post and I'll see if I missed anything... xD

      Current date/time is Thu Mar 28, 2024 8:38 pm