ROM Hack Livly Garden eng translation - NPAC files?

sissi6

Member
OP
Newcomer
Joined
Dec 20, 2016
Messages
16
Trophies
0
Age
27
XP
111
Country
Poland
Hello! It’s my first time posting here about hacking, because I need help with something that I couldn’t find any info about.
I’m trying to translate Livly Garden, a Japan-only game that I love and played many times before. I’m no professional translator and honestly I’m trying to do it mostly for fun and because hacking/programming fascinates me quite a bit. I have some basic knowledge when it comes to hacking and have already successfully replaced some text, as well as wrote a couple of simple tools in lua for my own convenience.

I could probably do a decent translation just by working with the simple message files, but I also want to translate the graphics with text on them as well. And that’s where the issue is. There are some graphics that I can easily find in crystal tile and it’s mostly some backgrounds and a few other things I don’t really care about. The graphics that I actually want to look at and edit seem to be hidden away in .bnd (bundle?) files. They’re all appropriately named, eg. “item.bnd”, “skill.bnd”, “flower.bnd”. Many of them also have some matching “i_” files (eg. “i_item.bnd”) that I didn’t look much into yet but they’re usually smaller and seem to have the same kind of contents.
Looking inside with a hex editor, I can see many NPAC/CAPN files, palettes, and animation data. I’m focusing on the NPACs, which have compressed NCGR files in them. These files seem to have some important data in them before the NCGR (aside from the header which I know has the file length in it), as when I change any of the values there, the game freezes when it’s supposed to load the sprite. That data seems to be different for every single NPAC and I don’t know what is the importance of it, as well as I don’t know exactly how the graphics are compressed.

So yeah, I’ve been looking at them and fiddling around with them for a few days now, and aside from writing down some random notes I really have no idea how to get those graphics out, even less so recompressing them later to put them back in the rom. Other things like pointers and such I can probably figure out fine if I will need to.
Here's an image of a separated NPAC, it goes on for a little bit more beyond the image but I don't think there's anything special there. I also included my messy breakdown notes, keep in mind I'm guessing a lot there so I don't know how helpful they are but hopefully at least a little. :)
IXdVxUo.png
N32TCsM.png

I am unsure if I am allowed to send any files, but if it's fine and someone would want to look at an NPAC or .bnd file, then I can provide.
Anyway, sorry for a lengthy post, and a thank you in advance for any help, hints or tips! :)
 
Last edited by sissi6,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
Looks like a reasonable start.

For compressed files you will tend to be pointed at cue's stuff
http://www.romhacking.net/utilities/826/

Crystaltile2 does have some options here for compressing and decompressing individual files but they are minimal and a bit buggy so go with Cue's tools.

1000 0000 doubled up there is odd. I would normally wonder if that is amount of files/directories contained within or something. That said you say everything has that so either everything has one file (quite possible -- seen a few games encapsulate things in their own format for no great reason) or it is not that. Might see if any games from the same dev (surprised I have not properly tackled some of them but Magical Starsign, Heroes of Mana, Blue Dragon Plus, A Kappa's Trail and for the 3ds (could be similar) Fantasy Life).

I would usually at this point try to locate the start of the file (presumably in this case the NCGR (RCGN) thing as that is normal graphics format)
That said the amount of almost random noise before that gives me considerable pause. The amount of Fs and high values in that almost makes me wonder if some of the higher bits are used as signifiers, or if the thing needs to be inverted.

Have not got the file to see here but the length of file after decompressing and length of whole npac (presumably you just scrolled to the end to see) is odd to see in that order.

All that said if you have the size/pointer for the sub file within the archive that is all you likely really need.
 
  • Like
Reactions: sissi6

sissi6

Member
OP
Newcomer
Joined
Dec 20, 2016
Messages
16
Trophies
0
Age
27
XP
111
Country
Poland
Looks like a reasonable start.

For compressed files you will tend to be pointed at cue's stuff
http://www.romhacking.net/utilities/826/

Crystaltile2 does have some options here for compressing and decompressing individual files but they are minimal and a bit buggy so go with Cue's tools.

1000 0000 doubled up there is odd. I would normally wonder if that is amount of files/directories contained within or something. That said you say everything has that so either everything has one file (quite possible -- seen a few games encapsulate things in their own format for no great reason) or it is not that. Might see if any games from the same dev (surprised I have not properly tackled some of them but Magical Starsign, Heroes of Mana, Blue Dragon Plus, A Kappa's Trail and for the 3ds (could be similar) Fantasy Life).

I would usually at this point try to locate the start of the file (presumably in this case the NCGR (RCGN) thing as that is normal graphics format)
That said the amount of almost random noise before that gives me considerable pause. The amount of Fs and high values in that almost makes me wonder if some of the higher bits are used as signifiers, or if the thing needs to be inverted.

Have not got the file to see here but the length of file after decompressing and length of whole npac (presumably you just scrolled to the end to see) is odd to see in that order.

All that said if you have the size/pointer for the sub file within the archive that is all you likely really need.
Thanks a lot for the quick response! I will give Cue's tools a try. Definitely gave me some ideas on what to try and where to look next.
 

sissi6

Member
OP
Newcomer
Joined
Dec 20, 2016
Messages
16
Trophies
0
Age
27
XP
111
Country
Poland
Hello, here’s some more notes as a bit of an update for anyone curious enough to take a peek. (And who knows, just maybe this all might be helpful to someone at some point. This is a nice way to collect all my thoughts so far as well.) Please forgive the misuse of any terms, I’m still pretty new to a lot of these things.

In my free time I’ve been poking around more, changing values in the packed files in the rom to see what happens, generally a lot of trial and error. Here’s my findings:

- The “i_” files I’ve mentioned are just icon sprites. Many things in the game have little icon representations used in menus and the in-game encyclopedia. Honestly I don’t know why I didn’t figure it out sooner.

- When I replaced an NPAC with just a regular uncompressed NCGR, it worked just fine, which makes sense I suppose. It also means that if I would want to put an edited sprite back into the game, it wouldn’t be necessary for me to compress it if I can’t find a way to do so. (The other problem would just be to find where the graphics pointers are stored as those seem to be VERY specific - shifting the files by even one byte causes a black screen to occur.)

- The seemingly random data in the beginning of the NPAC is some kind of dictionary for the compressed file. The compression itself is actually pretty straightforward - repeating groups of values get replaced with their assigned index. What’s interesting is that the dictionary itself is also compressed using its own data. I’ve manually found and wrote down a list of indexes and their values for a specific file (by comparing the compressed and uncompressed file), and then “decompressed” that specific NPAC dictionary.
uF27c5x.png
Kz6DPMY.png
MUXINhk.png
I was able to see that all the values I wrote down are there, in order, with some other values here and there (highlighted blue and one pair of suspicious zeroes in pink). In any case, so far these NPACs don’t seem to be using any of the widely used compression formats, unless it’s one I’m not aware of.

The next step for me is to see if I can find out what those mystery values are for. I am currently pretty invested in trying to figure this out, and while I think I’ve been making some nice progress, I will greatly appreciate any input. Thanks for looking!
 

sissi6

Member
OP
Newcomer
Joined
Dec 20, 2016
Messages
16
Trophies
0
Age
27
XP
111
Country
Poland
After trying out many different ideas and approaches, I have to admit that I am thoroughly stuck. I have figured that the sprites that I want to edit are being used as textures for the 3d engine, but I don't know if that changes much or not. In the rom they're still kept as compressed NCGR files.
And here's the thing: I think maybe all this would be easier for me if I could find them in the RAM, but I cannot. In the desmume tile viewer I am perfectly capable of seeing the graphics used in the 3d engine (albeit weirdly scrambled, but that's a separate issue), meanwhile under the same address in the RAM all I see is zeroes.
muIrUqc.png
41QsQxT.png
Does anyone know what's going on here? Am I missing something?
As an additional note, I keep feeling like someone who knows their way around the NDS assembly would probably have this solved in one day - I only have the vaguest idea of how it works and honestly don't know where to start with it. If I feel defeated enough about those graphics, I will just go back to translating the text, but for now I still would like some advice if anyone would be willing to share any. Thanks lots in advance.
 

sissi6

Member
OP
Newcomer
Joined
Dec 20, 2016
Messages
16
Trophies
0
Age
27
XP
111
Country
Poland
I DID IT and I am so happy I don't even know what to say :')
Original and edited:
HfKO6xq.png
RPyVj4H.png

Just something silly because I wanted to do a quick test. I am just so happy to have finally figured out a way to change the sprites!!! And while my method of doing it isn't by any means elegant or efficient I'm just happy I am able to do it. Really gives me a ton of motivation to make progress!!
 
Last edited by sissi6,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=fv6vlP2qSyo