Author Topic: EDIT: Attempting GFX hack  (Read 3616 times)

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3296
    • View Profile
Re: EDIT: Attempting GFX hack
« Reply #30 on: May 19, 2007, 11:45:14 am »
It's quite amazing.  I had the same corruption problem with Manoria Cathedral, but then there were 2 things that allowed it to not corrupt.

1) The one that was corrupting the rom, I changed and imported first and it worked.  I really have no clue why it worked but it did.

2) I can't import the image directly into Tile Molester and save.  I open up the one I want to edit and another for a place holder.  I import the image in the place holder one, and copy and paste the stuff bit by bit into the one I want to edit.

For some reason this worked...Kinda awkward o.O

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: EDIT: Attempting GFX hack
« Reply #31 on: August 10, 2008, 06:42:15 pm »
OK,

So I have successfully done this myself, however the recompressed tileset after adding the bed is larger than when i decompressed it (which makes since cause it's harder to copress a bed then it was to compress blank tiles.   Here's what TF put in the status bar when i decompressed the data:

Compression-> 2FC1DF-> Decompress:  1000 compressed 633 offset range 2FC1D3 - 2FC805

I added the bed and then did this:

Compression 2FC1DF -> Recompress:  1000 compressed 74C Offset Range 2FC1D3 - 2FC91E

So i'm pretty sure it doesn't matter how large the file is before you spit it in the recompressor, what matter is what's put in the status bar....This could have led to the corruption from before.


If what i'm wrong let me know and I'll add the bed until then we'll have to wait till were done doing TF related stuff and then add the bed.  I dont want to put it in unused space because I dont want TF to overwrite it.

Anywhos for anyone interested here's a little how to:

1)   First figure out where the graphics are:

Easiest way...ask here and wait for someone who knows how to do it to tell you...
As Jlukas pointed out blackbird used

2C9C7F
2CA8B4
2FC1D3
259597

Note that these are graphics packets.  Don't expect to see what you see in the TF tile palette.  The tile editor will pull tiles from these 4 graphics packets to make the pretty pallete you see.

2)  Get the decompressed packets:

TF makes this easy.  File -> Compression.  Throw the address in and make your file name.  I suggest calling it <address>_<location>_original.gfx

3)   Open it up in Tile Molester for viewing.

Download Tile Molester.  File->Open.  Switch it to all file (*.*).  Double click your file.  Now for the tircky part.  CT uses a non default codec in tile molester (atleast for these graphic packets).
Click View -> Codec -> 4bpp Planar, composite.

Now you will see the graphics being used.  You can use the Zsnes save state trick to get the palette you want.  Open zsnes go to the location using the tiles, save state.  Go to Tile Molester.  Palette->Import From -> Another File-> go to the zsnes save state.  Then in the lower left click the arrows until the tiles are pretty.

4)  Edit the graphics:

I'm not a pixel artist but I can copy paste.  King Guardia's bed is located at address 25D3A8 (i found it by browsing randomly took forever...) Load it up as you did above and use the selection tool to copy over the graphics into the unused space that chrono'99 pointed out.  Save the file, i suggest <address>_<location>_edited.gfx

5)  Actually use it in TF.  Here's the part that was the wavy hands part of this thread until I tried it myself.  Here's a few basics about tile:

a) each tile is composed of 4 subtiles
b)  What you were editing before in Tile Molester was "subtiles"
c)  Each subtile can be turned vertically /horizontally

So if you open a blackbird location you'll see many garbage tiles being unused.  right click one of them and look at the tile section in the location bar.  You'll see that you can edit the 4 "quadrants" of that tile and for each quadrant load a subtile.  There's always a blank subtile...in this case it's 100 but you can look at other tiles to figure it out yourself.  So now...how do we find our bed?  Subtiles are all 3 hexadecimal numbers:

XYZ:

X = graphics packet  (starting at 0)
Y = row (starting at 0, max = F)
Z = column (starting at 0 max = 7)

JLuaks gave us 4 areas I haven't confirmed if they are the correct order but let's pretend:

2C9C7F (0)
2CA8B4 (1)
2FC1D3 (2)
259597 (3)

In this example we are editing 2FC1D3 (it really is graphic packet 2 by the way).  I put my bed in the lower right corner.



Starting from the top and counting from 0 the upper left of the bed (the little sphere thing) is in row 4.  Starting from the left and counting from 0 the upper left of the bed (the little sphere thing) is in column E.  It's in graphics packet 2 so that subtile is 24E.  Similarly the part below it is subtile 25E, below that is 26E. 

Now going back in TF it's time to make the bed.  I looked up how other beds were doing in TF and noticed that they usually use 3 tiles width (not sure why) that's 6 subtiles tiles, with the far left tiles and far right tiles being blank.  You don't HAVE to do it their way but we will.  A bed is 7 subtiles height and the top tile has blank subtiles on top.

Pick a an unused chunk of the blackbird and right click the upper right part of where you want to put your bed.   Go to the tile section and choose NW quadrant...it's blank (remember from above) so make it 100.  Same with NE, and SW quadrants.  However SE quadrant is where we put our little sphere thing.  So make it 24E.

Now choose the tile below, again the west quadrants are blank but make the NE quadrant the part below the sphere thing (25E) and the SE quadrant the part below that (26E).

Continue for the rest of the bed.  One thing to note is that the "East" part of the bed is just the west part mirrored to you'll have to choose flip horizontally.

Phew.....that's all.  Parts of this might just be plain wrong so please critique.  When I know i'm right i'll make a public post in kajar.  Also if someone could check the recompression thing for me that's be awesome.  I'm attaching the new subtiles with the bed added but i'm not adding it to CE because I'm 99% sure it runs over.

--JP






[attachment deleted by admin]

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: EDIT: Attempting GFX hack
« Reply #32 on: August 11, 2008, 02:08:46 am »
Can someone point me to the a graphics packet that contains a table?  Or better yet a list of all the graphics packets?


--JP