ROM Hack Exporting spritesheets from data files

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
I recently unpacked the code geass DS game and have used glycernMapViewer to export the images that use the nclr/ncer/ncgr format.

Unfortunately, when I got to the spritesheets, they have the ncer and ncgr files, but instead of an nclr they have a pal file (which is the palette I guess). I had to first extract the files from an lz77-compressed narc, but that probably isn't too relevant.

So now the mapViewer won't load the image cause I don't have an nclr file to provide, and all I have is the pal file that contains the color information.

How can I export the image with these files? I assume it is not uncommon to store spritesheets this way since not much detail is necessary.

Here is a sample: http://www.mediafire.com/?tf091tgxccrscgd
 

andibad

Soon™
Member
Joined
Sep 14, 2009
Messages
701
Trophies
0
Location
hospital
XP
247
Country
Indonesia
used combination MKDS (for pallete file - any-, with some trick(i no share it XD is my private)), TINKE, crystalltile, is was enough for sprite editing.
 

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
Can you spend some time to load up the samples I posted so I can verify that there is some way to get the original image?
 

rastsan

8 baller, Death Wizard,
Member
Joined
May 28, 2008
Messages
1,002
Trophies
1
Location
toronto
Website
rastsan.wordpress.com
XP
413
Country
Canada
crystal tile 2 has a data to palette function. you look at the file in hex mode and with trial and error (from clicking on some spot in the palette in hex mode) then clicking data to palette (under edit) to find the just right palette. I have to do this for 4 different games and once you find the right offset for where it is in the palette file your good to go for the rest of them.
this also works for importing palettes from another file as there also is a palette to data function (but you gotta be careful with this as you do no want to overwrite other files' stuff).

now the flip side and more involved way to do this is to use an emulator and screen shot a part in the game that has the image in question and import the palette from that image in crystaltile2.

I've tried tinkes open as palette but it needs an offset function added to that. (not a complaint).

As to the mkds the palette function in it takes a bit of getting used to. (Not a complaint either, far from it).

I prefer ct2's straight forward approach instead of r g b scale you can literally pick the color off of a windows like palette square. Even then if you know where the palette is and you have to have the image a certain way importing the palette directly from the edited image is so much nicer.
It leaves me with that just perfect feeling.


I'll check your image in a minute....
edit:
you just have to go to an offset of 8. ct 2 can view the image just fine (with a little size changing 32by48). load the palette by itself (or whatever) view it in hex mode go to offset 8 and hit edit - data to palette....
then your good to go. (who is that lady? Is she supposed to have green hair?)
 

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
Ya, she has green hair.
This is her sprite in-game that I got during a cut-scene (though I don't know how that palette importing works)

gnLju.png


I'll try the crystal tile.

First I opened the ncgr and set some options randomly and got this (well, you said offset 8 but it looked kind of distorted so I tried different offsets and came out with this:

qScBz.jpg


How the map is laid out is kind of odd but ok, at least it looks like a proper sprite rather than a bunch of pixels splashed randomly on a sheet. Though even if I got it colored correctly I'd probably still have issues trying to arrange it nicely.

And then I opened the pal file in hex mode, couldn't change the offset to 8, hit data --> Palette, and wasn't sure what happened.

Maybe I'm missing a step.
 

rastsan

8 baller, Death Wizard,
Member
Joined
May 28, 2008
Messages
1,002
Trophies
1
Location
toronto
Website
rastsan.wordpress.com
XP
413
Country
Canada
When I do i the pink is lighter.
hmm... no change the offset to 8 in the pal file...
Or simpler in the pal file, the first FD in hex, that is where the palette starts. just click on the F and then go to edit. then down to data to palette.
Remember where the fd is in the pal file, as that is where all the other pal files will have there palettes start also.

oh 32 by 48... just try it... they will all line up.
 

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
Alright this time I moved the offset to the start of the FD byte and converted it to palette.
Then I exported it to a pal file, switched to the window with the image, and then imported the palette.

I looked went through each row but none of them matched. The closest one I got was this one, but that's it.

I changed the offset of the image to 30 and everything was centered with the dimensions you specified (positioning looks fine, so I can work with it)

OhcL9.jpg


Colors are still off though, hmm
Could it be the tile form? Or the image pattern? Or some other option maybe?

As mentioned previously, I do have an image of the sprite in-game and I have seen a palette viewer on desmume, but I don't seem to be able to export it from the emulator.

JatLZ.jpg


Hopefully playing around with the provided pal file would lead to good results, as having to play the game is quite tedious lol
 

pleonex

Well-Known Member
Member
Joined
Jan 16, 2009
Messages
204
Trophies
1
Location
Spain & Switzerland
Website
github.com
XP
523
Country
Switzerland
Using Tinke you can view the NCGR file correctly:
code%2520geass.PNG


You just need to put the value 4 in "Start byte" viewing the pallete and then select the NCGR file with a width of 32.
About the NCER file it'is not displayed correctly but I'm trying to fix it (there are some errors if you try to view the last cells). By the way you can use this fixed version of Tinke:
http://dl.dropbox.com/u/3981393/Tinke/Tinke%20rev90-1.zip
 

jjjewel

Well-Known Member
Member
Joined
Dec 17, 2009
Messages
1,010
Trophies
0
XP
522
Country
United States
You need to shift 4 bytes for the palette. (Open your .pal file in CT2, move your mouse to the first row, under column with label 04 and right-click, data-->palette. Then export that palette and use it.)

The NCGR settings are:
offset 30
width 32
height 48
tile GBA 4 bpp
image ObjH-1234

See pic in the spoiler.
wink.gif


mpcx.png

Whoa, pleonex. We posted at the same time. (You probably beat me by seconds.
biggrin.gif
)
 

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
Oh, that was the issue. It wasn't being highlighted (so the offset probably didn't change as I had previous assumed)

Nice, two different approaches with results.
I wonder which one is easier to work with (and more accurate with large amounts of files)

This doesn't seem too complicated lol
I'll try it with tinke.

EDIT: It was not intuitive that the palette viewer with modified values for tinke had to be open while I am opening the ncgr

Now, crystal tile only shows 4 tiles per row for me. How can I make it so it displays everything?
 

jjjewel

Well-Known Member
Member
Joined
Dec 17, 2009
Messages
1,010
Trophies
0
XP
522
Country
United States
xTsukihime said:
Now, crystal tile only shows 4 tiles per row for me. How can I make it so it displays everything?

View-->Fit Window To Tile.

Or use Shift and arrow buttons to change the window's width/height.

CT2 will probably need more manual operation compared to Tinke. (I think Tinke can automatically export images, when you have to manually export them in CT2. I haven't tried this new Tinke, though.)

Edited: Just checked the whole image. You won't be able to export everything with the above settings of CT2. There's a part at the very end of the image that the tile sizes change. After the part with the legs where the character's lying on the floor (dead?), the tile size will be width 16 and height 32. You'll need NCER and NANR file to output this part of the image correctly. Tinke might work better in this case.
 

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
If the tile is 16x32 I could always just export it as two separate images and then build a spritesheet (which would happen anyways).
That might be easier..unless working with the the ncer and nanr (animations is necessary also?) is easy.

EDIT: actually, it seems that I can fill up a row with unscaled tiles, but it doesn't want to fill up the rest of the rows, so ya with tinke it can display everything just be specifying larger height.

Here's another one I decided to look at.
Looks like the format of the palette is the first 4 bytes are just some ID or maybe type, followed by the data, so the same procedure got the right colors out.

But the the dimensions aren't the same (is this common? o.O)

http://www.mediafire.com/?cbxkk12xh8u2d7c

eWP5N.jpg

Are there any common values that one should be aware of?
 

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
Even with tinke it still comes out odd, unless I'm misinterpreting what you meant by "right way"
For example I double click each of the files, then view the NCER. Sometimes it looks ok, other times it's still a mess.

Although I would assume it's possible to figure out the dimensions and offsets based on the NCER?

Is there a systematic way to go about doing this? Right now I'm just randomly hitting the up button and watching the tile go from bad distortion to even worse distortion. In crystal it's even more amusing cause I can control the height width and offset with nice shortcuts =/

I can't seem to pick up any clues whether I should be changing the dimension or changing the offset
 

rastsan

8 baller, Death Wizard,
Member
Joined
May 28, 2008
Messages
1,002
Trophies
1
Location
toronto
Website
rastsan.wordpress.com
XP
413
Country
Canada
xTsukihime said:
If the tile is 16x32 I could always just export it as two separate images and then build a spritesheet (which would happen anyways).
That might be easier..unless working with the the ncer and nanr (animations is necessary also?) is easy.

EDIT: actually, it seems that I can fill up a row with unscaled tiles, but it doesn't want to fill up the rest of the rows, so ya with tinke it can display everything just be specifying larger height.

Here's another one I decided to look at.
Looks like the format of the palette is the first 4 bytes are just some ID or maybe type, followed by the data, so the same procedure got the right colors out.

But the the dimensions aren't the same (is this common? o.O)

http://www.mediafire.com/?cbxkk12xh8u2d7c

eWP5N.jpg

Are there any common values that one should be aware of?
thought I would replay directly to this one... answering the other one also.
double or half the width.

sometimes working with the animation files is easier. but only if they have the right dimensions. which thankfully (I think you can change them in Tinke).
get used to changing the dimensions... good news is it gets easier.

things to look for... well for the offset...
take the width of the tile 8 you have 4 rows of 8 2 rows is 16 wich is 10, 4 rows is 32 which is 20, so you need to move away to so the offset would have to add 20 in hex (in decimal it doesn't matter...). So you are going to need to start thinking in hex numbers 16 instead of 10.
for the width height, uh, well that is just something you get with experience.

If you want to get used to it quicker take a few font files and fiddle with the dimensions until you get it right. With the fonts you will know for sure when you get it right. from my personal experience I recommend the non nftr fonts, 7th dragon, itadaki street ds. they both have non nftr fonts. 7th for sure as that has some images where the there is 8bpp and 4bpp and the width and offset change (but in a pattern). Now that I think of it so does inazuma eleven 2 4bpp and 8bpp, the width height and offset all change. as the files are packed in files....

Of course you could always ask for help here.
 

xTsukihime

Member
OP
Newcomer
Joined
Sep 8, 2011
Messages
9
Trophies
0
XP
27
Country
United States
I opened up the second sample I posted up in Tinke and viewed the NCER file.
The first cell looks fine, but then the next 4 are wrong, but then the one after looks fine again.

This pattern repeats itself until I hit an exception (no more cells I guess).
What could this mean? And where would I make changes so that they are reflected in the NCER? It doesn't seem like I can do anything much in that view.

I checked the NANR file to see if there was any difference but it was the same pattern.
 

rastsan

8 baller, Death Wizard,
Member
Joined
May 28, 2008
Messages
1,002
Trophies
1
Location
toronto
Website
rastsan.wordpress.com
XP
413
Country
Canada
that is a question for pleonex. it is also a good reason why I use crystal tile2. It has the tile composition tool. drag the tiles over to and puzzle the images together then edit it en masse.
 

jjjewel

Well-Known Member
Member
Joined
Dec 17, 2009
Messages
1,010
Trophies
0
XP
522
Country
United States
xTsukihime said:
I opened up the second sample I posted up in Tinke and viewed the NCER file.
The first cell looks fine, but then the next 4 are wrong, but then the one after looks fine again.

This pattern repeats itself until I hit an exception (no more cells I guess).
What could this mean? And where would I make changes so that they are reflected in the NCER? It doesn't seem like I can do anything much in that view.

I checked the NANR file to see if there was any difference but it was the same pattern.
You can try Console Tool from Romhacking.net forum too. (But in Console Tool, you'll have to right-click the picture to copy it and paste it to some graphic program you have.)

Anyway, Console Tool might not support this game's palette file. You might trick it by creating a fake .NCLR file from your palette. (Find some other game's .NCLR file and copy your palette file to it. You can use CT2's hex editor. You can copy from byte 4 to the end of file for your palette and then paste it to byte 28 (hex 28) in the NCLR file and test it.) Let me know if you have problem with this method. I tried and it worked but I'm on super slow internet now, I can't post picture.
smile.gif


You might try to ask pleonex for some adaptation of the Tinke program too. That'd be more convenient.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Taco Saturday
  • AncientBoi @ AncientBoi:
    Uhh, It's 🌯 Saturday dude. :) js
  • BigOnYa @ BigOnYa:
    Nope that for tomorrow, cinco de mayo, today is bbq chicken on the grill.
  • K3Nv2 @ K3Nv2:
    Juan's new years I forgot
    +2
  • AncientBoi @ AncientBoi:
    :hrth::toot::grog::grog::grog::bow: HAPPY BIRTHDAY to me :bow::grog::grog::toot::hrth:
  • K3Nv2 @ K3Nv2:
    One day away from Juan's birthday
  • K3Nv2 @ K3Nv2:
    Only if you send him feet
    +1
  • BigOnYa @ BigOnYa:
    Happy birthday!
    +1
  • AncientBoi @ AncientBoi:
    Thank You :D
  • realtimesave @ realtimesave:
    heh I got a guy who created an account just yesterday asking me where to find mig switch roms
  • realtimesave @ realtimesave:
    too much FBI watching this website to answer that kind of question lol
  • K3Nv2 @ K3Nv2:
    Has the mig switch found loopholes without requiring game keys?
  • Xdqwerty @ Xdqwerty:
    @AncientBoi, happy birthday
  • Xdqwerty @ Xdqwerty:
    Yawn
  • Xdqwerty @ Xdqwerty:
    Lonely here
  • Xdqwerty @ Xdqwerty:
    Anybody?
  • Psionic Roshambo @ Psionic Roshambo:
    I want my money back... Drug test? No drugs to test but they want me to pee in a cup! Lol
  • K3Nv2 @ K3Nv2:
    Better call Pedro you're up in smoke
    +2
  • C @ Clayton44333:
    hey any1 know if there is a new version of the ps4 homebrew store ?
  • Xdqwerty @ Xdqwerty:
    Finally there are people here
  • K3Nv2 @ K3Nv2:
    We're figments of your imagination
    +1
    K3Nv2 @ K3Nv2: We're figments of your imagination +1