News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: In need of an experienced NDS modifier to work with game files  (Read 1289 times)

YeboiAdamTM

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
I've recently gotten into the community and have read up for the last couple days endlessly to figure out how I can change sprites within a DS game called Monster Tale. I've watched many videos, read the getting started page, and have asked in the rom-hacking discord to no avail as there's no known tutorial to break into the files of this game. Often times, the files in tutorials are .narc, but this time every single file except for audio is a .bin file. I've tried to extract the files and pair it with a .cue file, but none of my attempts have lead to an extracted file. I've tried to use UltraISO to mount it to a virtual drive, but once I made the virtual drive, it simply wouldn't open on my computer. I don't even know if I'm going the right direction in just changing the sprites within the 2d Metroidvania type game, but I'm doing the best I can. If someone can help me, feel free to reach out and reply to this. Thanks.

FAST6191

  • Hero Member
  • *****
  • Posts: 2966
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #1 on: May 03, 2020, 01:06:43 pm »
.bin is probably the main go to boring and basic "I just need an extension" choice for programmers (it tending to be short for binary). As such it is used in thousands of formats probably on the DS alone, and millions within computing. Even more fun is known formats (like the NARC format you mentioned) can be left with .bin extensions just for fun -- extensions on the DS are more or less arbitrary as far the DS is concerned.
I would be stunned it they were the same .bin as anything ultraiso knows how to handle.

You then need to figure out what goes. While you presumably don't have extensions you do have sizes, possibly file names (hopefully it is not all numbers), directory names, can peek at the first few bytes of files to see what is inside and more besides.

If it is just sprites you can also try manually looking at files with a tile viewer. Crystaltile2 is probably where I would start with this one (load the whole DS ROM, set the tile viewer to GBA 4BPP and scan through the files you want to look at*, repeat for GBA 8bpp. Things might be compressed but hey.

*after opening the ROM then in the little DS icon on the right of the menu. Click that and it will load up the contents of the ROM, double click to set the tile viewer/hex viewer/whatever to the location of that file.

YeboiAdamTM

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #2 on: May 03, 2020, 02:34:14 pm »
Thank you for the response, I was worried no one may have the next step to cracking open the game.
It's very convenient that you recommended Crystaltile2 for progression in figuring this out, as I downloaded it last night and have been playing around with what it has to offer.

I would be stunned it they were the same .bin as anything ultraiso knows how to handle.
Is there different types of .bin files that may not be compatible with different software? I'm curious.

I'm going to link what I've come across in delving into the files of the Monster Tale NDS below.

https://imgur.com/fJK8lGu - This is the directory. It seems very nicely laid out, so I can find what I'm looking for. All the contents inside are .bin, but at least everything's in their own respective areas.

https://imgur.com/76vYJZ4 This is the organization of the files within the Sprites folder in the directory. Also fairly nicely sorted to look into once I learn to look into the files.

https://imgur.com/yqgVfs7 This is the Tile Viewer of one of the files I chose in the directory. I'll be completely honest, I don't know what's going on here.
Both 4bpp and 8bpp show random colours such as what's shown in the image.

FAST6191

  • Hero Member
  • *****
  • Posts: 2966
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #3 on: May 03, 2020, 08:24:11 pm »
Yeah as I mentioned .bin is usually the first choice a programmer will make when they have made a new file format and need an extension for it, something that happens a lot in programming and even more in games. To that end there are thousands and thousands of completely unrelated formats with .bin as the extension.

In that case it looks like you have a folder called sprites. Seems like a good place to look at the files for it, though don't expect to find everything there (sometimes a dev might just put something somewhere else quickly to get it working and it stays there).

Looks like you made a good start with crystaltile2. Random colours are to be expected at first -- a tile editor is a very dumb program that only converts binary into pixels matching the same value. What happens when you scrolled down in the tile viewer? All those tiles probably only represented a small portion of the file in question and if the file starts out as stuff detailing what is to come it will appear as nothing interesting on the tile viewer. Alternatively if it is compressed (compression is very common on the DS, though crystaltile2 will often tell you if it thinks it found it on that file which that second image does not appear to tell you it found any) it will not show much.

Once you find the sprites the colours will likely still be wrong. This is because you also need to get the palette. Most console games don't use images that detail the exact colour but instead a lookup table (I usually use the analogy of paint by numbers picture as it is that, except the shapes are just boring pixels). For editing purposes you can rip this from an emulator if you want (will be limited to the colours it has already for you), or you can find the palette in the game and edit that to give you the colours you want. Be aware changing sprites and palettes can have effects elsewhere -- they are called palette swapped enemies for a reason.

I cover some more of that in my hacking documentation on the GBA and DS
http://www.romhacking.net/forum/index.php/topic,14708.0.html

YeboiAdamTM

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #4 on: May 03, 2020, 09:03:04 pm »
Ah, I understand now. .bin is simply an extension put over a file format, not a file format itself. Thousands of different formats are thrown under .bin. Gotcha.

Alright, I've found a file to see if I can hone in on. I'm currently looking through the Sprites Folder and have decided to check out 'chomp_idle_kid_form01'.
(I should explain that Chomp is your companion in the game, and depending on which form you've chosen, is a kid, teen or adult.)
There is an object under the name 'obj_chomp_idle_kid_form01', and a palette under 'palette_chomp_idle_kid_form01'. I've loaded up the object and loaded the palette on top of it as well, but hmm, let's just say it doesn't exactly look like Chomp.

I've also changed the Tile Viewer to 32x32 so I can see the whole object instead of an 8x8 area, but the product is this:
https://imgur.com/4pQjGvy https://imgur.com/dZWXr3z (Note that one of these images is 4BPP and the other is 8BPP).

For reference, this is what Ellie and Chomp look like. Ellie on left, Chomp on right. https://imgur.com/mwuLFLL

Even the palette doesn't match, and that's what I'm awfully thrown off by.
« Last Edit: May 04, 2020, 12:59:32 am by YeboiAdamTM »

FAST6191

  • Hero Member
  • *****
  • Posts: 2966
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #5 on: May 04, 2020, 10:19:26 am »
You might end up changing tile size eventually (stuff on the DS runs from about 8x8 to 16x16 to 256xwhatever or completely custom in the case of some fonts) but don't do it on a whim or until you think you might need to. If you want more of the file on the screen at once then if memory serves shift and the arrow keys will do that and you can use that to line up things.

That does look quite random, and probably not compressed (too much repetition), but it also says palette in the file name so it is more likely a palette file (the colours part). Above I see another saying obj (short for object, which is one of the names some tech types use for sprites -- the thing that controls the sprite on screen is the OAM aka object area memory) so I would be looking at that.
If you want to try loading it as colours in the tile editor you need to go to the hex editor window and down the bottom left somewhere will be hex to pal and pal to hex or something like that. They do much as they say so make you click the right one. Whether the palette will start right at the start of the file or have a header I don't know right now as I have not got the file in front of me.

YeboiAdamTM

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #6 on: May 04, 2020, 07:28:08 pm »
I've changed the Tile Viewer back to 8x8 tiles and have messed around with shift arrow keys. Using shift + down arrow makes another 8x8 tile drop underneath on the y axis, and shift + right arrow makes it grow along the x axis. It squares up as well, so if you hit down and right, it won't be 3 8x8 tiles, it will be a 2x2 block of 8x8 tiles.

Through usage of BatchLZ77, a decompressing tool, I have learned that the .bin files within Monster Tale are indeed not compressed.

I have messaged you to talk more in depth about this challenge, so feel free to check that and give a response.
Edit: I don't know if your messages are turned off or a technical issue happened, but it says I have no sent messages. I'll attempt to resend one.
« Last Edit: May 04, 2020, 07:50:33 pm by YeboiAdamTM »

FAST6191

  • Hero Member
  • *****
  • Posts: 2966
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #7 on: May 05, 2020, 12:26:44 pm »
Sorry, it only flashes up at the top of the screen where I don't normally look.

Afraid playing hacker by remote is not my favourite game, though I am content enough to continue playing along here when I have time.

YeboiAdamTM

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #8 on: May 05, 2020, 03:24:15 pm »
Alright, that's totally fine. I appreciate the interest regardless.

If the first message didn't send, I'll recap something I forgot to say in the second message.
Through the Hex Editor, once I load up the palette_chomp_idle_kid_form01 and change the colour to active, it shows a palette strikingly similar to Chomp's actual colours.
Shown here: https://imgur.com/CQetKyZ
Once I checked the palette, I decided to load up the object_chomp_idle_kid_form01 and for some reason, it has the same colours.
Shown here: https://imgur.com/o60xhSY

I've looked through many of the different form objects, and they're all extremely similar.. I felt I hit a wall because of that, but I just decided to look through the palettes instead, and thankfully I am to believe that the palettes match up with the according forms. Some forms are red, some are green, some are blue. different palettes show different amounts of those colours, meaning they are representing each form's legitimate palette.

I believe the objects are all the same base colours to basically map out where the palette colours go. It's like a re-skin over the basic colours the base object has.

Now I feel I've figured out the gateway into palette swapping, and that's ****ing exciting honestly. It's further than I thought I would've gotten in like 3-4 days. I'm ecstatic with these developments without a doubt, but my main goal has yet to be conquered yet..

I wish to actually change the pixels in models. This may sound very stupid, but this all branched off the idea of wanting to be able to put sunglasses on Ellie and Chomp. Is there any way to actually add another layer onto objects or palettes like that, and effectively adding pixels onto what didn't have them before?

FAST6191

  • Hero Member
  • *****
  • Posts: 2966
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #9 on: May 06, 2020, 12:11:51 pm »
Models is usually a 3d term. Objects/sprites for 2d. The DS features both (New Super Mario Brothers for instance is all 3d save for the UI) but here it looked like classic pixel art from a video I saw, and if you can spot it in obj viewers or whatever then it will confirm that..

Adding another layer would mean adding more sprites and logic for them. Doable enough (video memory can be an issue but can usually be worked around) but probably not what you want to do for a first hack.

Changing pixels on the other hand is quite doable and often the first thing people do as a hack (the others being making cheats and text editing). If you know the location, tile size and format then most tile viewers have editors (indeed the main exception is tiledggd, and even then if you find the format in that you can guide in another tile editor for the editing) then editing is doable. There are ways to export and import to big boy image editors but if it is just for cartoon sunglasses I would consider sticking with the tile editors themselves, mainly as trying to config big boy image editors for game pixel art is not the easiest.
For crystaltile2 it should be another of the windows. For tiled2002 it is usually a separate section within the main window (double click the tile in question to shuffle it over to the editor window, and the editor window will have one to send it back). Most will be some variation on that.

And yeah objects/sprites are. That was the paint by numbers thing mentioned earlier. It does mean you have to be careful and see what colours do what between things though if there are going to be palette swaps for powerups, new levels... lest you end up with some odd colour combos.

YeboiAdamTM

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #10 on: May 06, 2020, 05:21:20 pm »
Ahh, my mistake. I meant objects/sprites but I'm not fully accustomed to the terminology.

Yeah, I imagine adding sprites and corresponding logic/coding for them will be something to learn later on once I start understanding the idea of hacking roms, but I would agree that it's most likely one of the worst ideas for a starting hack.

There's no doubt I wouldn't have to export to Photoshop or Asperite or something like it to simply add some black and maybe dark grey pixels to a sprite. I did see the tile editor, but I'm curious. Do I change things on the palette, the object or a mix of both to get the desired outcome? If I change palette, that'll just change the predisposed locations of colours, but I also have to add the black for the sunglasses through the palette. My best guess is a LOT of messing around and working with both the object and the palette.

I think it's time to just mess around with tile editor for the object and palette and see what breakthroughs I can find.

When you bring up learning/knowing the format, are you meaning just what hex bits correlate to each part of the tile? Once I figure out on one palette, should it follow suit for the rest?

FAST6191

  • Hero Member
  • *****
  • Posts: 2966
    • View Profile
Re: In need of an experienced NDS modifier to work with game files
« Reply #11 on: May 06, 2020, 09:14:51 pm »
All those options on the left hand side of the crystaltile2 window about flipping things, ordering, byte skipping and whatever else are all things that have existed in the past. For the most part though it is just going to be location, whether it is 4bpp or 8bpp gba format, and maybe tile size.

I was avoiding little tricks but tile size you can also usually see once you get the rest somewhat close -- if the sprite looks doubled up but upon inspection every other line is chopped out then probably want to the multiply or divide the tile by a suitable multiple or 2 accordingly, if it is smeared diagonally (more for fonts but have seen images as well) then increase or decrease the size to get it to line up, I like to throw a 128 or 256 wide image just to see on the DS as it can be harder to tell, I sort of can tell if something is in 4bpp but the editor is 8bpp and vice versa but that is much the same as you start to see repeating patterns rather than completely random noise, and changing the palette to a grey based one also helps reveal things from time to time, compression can be hard to spot but might well look like something starting off fairly normal but then going more and more towards noise as the file goes on.

Changing palette won't change the colour location. Just whatever pixels reference that location in the palette with adjust accordingly.

But yeah you can effect the end result by either changing the pixels in the image or the colours in the palette, or both at the same time. Assuming you found the palette in the ROM and did not rip it from a savestate or an emulator (or use a makeshift one) then you can edit either reasonably easily.
It should be noted most palettes I see in games are not full (depending upon the option you might have some 256 to 4096 http://problemkaputt.de/gbatek.htm#dsvideoextendedpalettes , though it might be 16 colours) so you can usually fill out the rest of the palette with any new colours you need.

The trouble with editing things in gimp, photoshop and whatever else is you get to do an indexed image, and no fun brushes, gradients, blurs and whatever else unless you are willing to do a lot of work. You can set things up to work like that, or be sure to work with the right brush every time and only pull from the palette you also brought along (many tile editors will allow you to export things in common formats).