Problems with NCBR and importing back into Crystal Tile

Discussion in 'NDS - ROM Hacking and Translations' started by SlamBamActionman, Nov 6, 2013.

  1. SlamBamActionman
    OP

    SlamBamActionman Newbie

    Newcomer
    6
    0
    Nov 4, 2013
    Heya, first post! First off: I'm really sorry if I am doing something that is obviously wrong, since I'm a bit of a "newbie" at this romhacking stuff. I wouldn't post here if I couldn't find anything on it anywhere else, and most of the time I have been able to figure it out myself. Now I'm completely stuck though, so I have to ask for your help. Thanks in advance.

    So I'm trying to make a graphics hack of Rhythm Heaven, and I've managed to pin down the basics so far. I have no problems with NCGR files or anything like that. However, the real problem started when most of the graphics used while actively playing a stage was in the NCBR format (the one I decided to try my wings on was the Rocker stage). After experimenting and searching a lot, I finally got a version of Tinke that was capable of rendering the file in a somewhat sane manner.

    [​IMG]
    Oh would you look at that, lovely!

    I didn't really find any good documentation on Tinke nor NCBR after that, so I'll describe each step I took.

    After being so delighted at finally finding a propper sprite, I exported a couple of the first ones (more precisely, the jumping motion). Since I did not want to waste any time on something that wouldn't work, I merely decided to recolor his guitar into the same color as his hair, just to try it out. I imported the image files using the "Add Image" option, since when I tried the "Replace Image" option it completely ruined all the other sprites. I looked at the NCBR file and saw that the guitarr had changed color there as well, and life was good.

    Or so I thought, as I noticed that I was fully capable of importing the NCER and NCLR files back into Crystal Tile, while the NCBR brought up a "file is too small" error. Indeed, I noticed that the NCBR I had modified had more lines of hexcode than the original one. Seeing no other option but to relocate the adress as I was asked, I did just that. I started up the game and it worked perfectly... until I started the Rocker stage. There's this small screen transition where the screen turns black inbetween the title card, and it just wouldn't leave that darkness.

    I've tried a couple of ways to troubleshoot this, like changing the hair instead and trying not to remove any original color, but they all gave the same problem as the one I described above. When I viewed the NCBR in Crystal Tile it still had the modifications I put in it, if that's any help.

    TL;DR - I try to edit an NCBR file, and it gives me the "file is too small" error.

    Thanks again, any help is appriciated! (and sorry if it something that is easily googleable, I couldn't find anything)
     
  2. rastsan

    rastsan 8 baller, Death Wizard,

    Member
    996
    228
    May 28, 2008
    Canada
    toronto
    It may be easier to open it in ct2 using the settings seen in tinke. if the only thing you are changing is color and to a color already there, there shouldn't be a problem. Its the adding an image to the animation (where ncer is used) that gets into trouble. you can easily export the pallete to something ct2 can import from tinke (even then it really isn't a problem if you just put the files in a narc and edit them in that).
    Now the problem being at least from my perspective is that sometimes the 8bpp and 4pbb get improperly set by ct2 or tinke. Which isn't a big deal as I just looked up the file structure used my fave hex editor and cut and pasted just the image data onto a clean (copy of the original) version of the ncbr. So the image data would be safely edited and the orig setting still what they need to be.
    You don't need the ncer unless you are drastically changing the image and the subset data of the ncer is changed (the map files for each image in the animation).
    Ct2 has the tile composition tool so editing the ncbr may be time consuming if done that way but sometimes you may have to go that way.

    sorry if this was confusing. But there are different versions of ncbr and ncer that may not work when a newer version is put in an older game or an older version put in a newer game. there is more I could say...
     
  3. SlamBamActionman
    OP

    SlamBamActionman Newbie

    Newcomer
    6
    0
    Nov 4, 2013
    Thanks a ton for the reply, it sure gave me a lot to think about. I guess I got some sort of progress going on, although I am still having trouble getting the files into the nds itself. It is quite annoying since Rhythm Heaven simply dumps the files into the nds, without sorting the different files into narcs first (as most guides I've found utilize the narc feature in some way). Either way, I found one way to edit the image fairly easily without changing the size of the NCBR noticably. By disabling all the OAMs except the one you'd like to edit, exporting, editing and importing only that part does not add any lines of codes as far as I know. I compared the edited NCBR to a clean one and they were the same size.

    [​IMG]

    [​IMG]
    Floating heads! Spooky...

    However, when I compressioned it back to the LZ format the edited NCBR became larger compared to the clean NCBR.LZ file. I think you're right about that it might be CT2 or Tinke improperly setting the 4bpp format, since I can't think of what else I'm doing wrong. If you could give me some more info on how you copied the edited image data to a clean version I'd be grateful. I tried, but then it gave me the same results as if I simply would've copy/pasted the whole NCBR itself (by which I mean it simply produced an exact replica of the edited NCBR). I also tried to copy it as it was compressed but that didn't produce anything useful either.

    I also tried the CT2 composition tool but that failed miserably. The sprites simply varied too much in size and the no matter how much I fiddled with the composition tool I could get them any closer than how it originally showed up. Using ObjH/V was even worse.

    [​IMG]
    The closest I can get without performing satanic rituals

    I guess I could work with the method in Tinke I mentioned above, even though I'd kill for a sprite sheet. As long as I can get the changes in the game, I'm content.

    (For this test, I merely changed the hair to the same color of blue that the character has in his eyes, since it's easier to keep track of.)
     
  4. rastsan

    rastsan 8 baller, Death Wizard,

    Member
    996
    228
    May 28, 2008
    Canada
    toronto
    well then it may be the whole compression thing. What did you use to decompress and to re-compress (if different for either say so). time to try compressing the original back and seeing if you can get the size right that way. if not then find what does then use that on your edited version.

    As to the narc thing... there is this wonderful utility that lets you make a narc (kiwi.ds) - in it under tools - make narc file. From your first post you already knew that though...

    Now you understand what I meant by time consuming with ct2 and the tile composition tool.

    yeah those rituals can be a pain...
     
  5. SlamBamActionman
    OP

    SlamBamActionman Newbie

    Newcomer
    6
    0
    Nov 4, 2013
    Thanks a lot for your help, I've finally gotten it to work. Earlier I had used CTs compress/decompress feature, which is probably what screwed it up. Using BatchLZ77 worked like a charm (though I could've sworn I tried it earlier). I don't think that I'll ever get a hang of the tile composition, at least not with the NCBR graphics, so I'll use Tinke for image editing.

    Now I just need to figure out why my edited palettes makes the game produce colors that aren't on it, but I think I'll manage that myself. Thanks again, you've been a great help!

    [​IMG]
    Rock on, little fella
     
  6. rastsan

    rastsan 8 baller, Death Wizard,

    Member
    996
    228
    May 28, 2008
    Canada
    toronto
    as to that use the pallete editor from ct2 or mkds course editor. I found the mkds editor much more user friendly and less erroneous.

    Edit:
    What is going on with the font?
     
  7. SlamBamActionman
    OP

    SlamBamActionman Newbie

    Newcomer
    6
    0
    Nov 4, 2013
    Once again, thanks for the reply. This time I can sadly not bring you any progress, other than that I've tried your suggestions. This time the size of the edited NCLR appears to be too little compared to the clean version, which is what I think messes up the colors. I've tried CT2, MKDS Course editor and also ConsoleTool, but they all gave me more or less the same results:

    [​IMG]
    Nope, this won't do.

    It always ends on adress A0 with 7F4B5E020000, no matter what kind/amount of colors I edit. Editing the colors in photoshop and following the Ultimate Nintendo DS Hacking Guide didn't help either. For what it was worth I copied in the edited values to the clean version but it gave the same results as if I had just picked the Import function. The palettes have the same amount of colors so I know I'm not being faulty there.

    About the font, my guesses are that it's there as normal but it doesn't show on the black background that happened because of the palette. The white specks are probably the anti-aliasing of the letters.
     
  8. rastsan

    rastsan 8 baller, Death Wizard,

    Member
    996
    228
    May 28, 2008
    Canada
    toronto
    were you using the existing pallete or importing a new one?
    Cause if you are using a color from the old one that was already there, why are you importing a new pallete? I thought you were not adding any new colors. If you aren't, why make a new palette?
    as to why... Some palletes have certain colors shared by other images. So the base of the pallete has to be this (say 12 to thirteen colors) one of which is the background color. next black, then a bunch of others. all of which you shouldn't mess with.
    Or it cold be a pallete with two palletes in tinke there would be a way to check this. the second pallete would then get chopped off and since it isn't there... error.

    the same goes for a color replace, same amount of colours. So the file should be the same size.
     
  9. SlamBamActionman
    OP

    SlamBamActionman Newbie

    Newcomer
    6
    0
    Nov 4, 2013
    Editing the palette was my intention all along; the reason I have not mentioned it above is because I was focused solely on editing the image itself before trying to mess with the palette. Either way, I've been trying to edit the existing palette to change one color to another, which I thought wouldn't cause such a big mess.

    [​IMG]

    That's how the palette looks like; the first two lines are completely useless and I do not touch them. The third is for the male rocker and the fourth is for the female. I've only been trying to edit the third line, yet it has caused problems. There's a total of 64 colors (0-63) yet the edited NCLR file is still too small, as I showed you above.

    I am completely baffled, and while I'm sure there is a sollution I can't find it (frankly, I have no idea what to even google for). You've been a great help this far rastsan, and as soon as I nail this part I will have everything ready to start working on the real project (or in other words; I will be less of a bother.)
     
  10. rastsan

    rastsan 8 baller, Death Wizard,

    Member
    996
    228
    May 28, 2008
    Canada
    toronto
    If you are using tinke to import the palllete from the image then I think I know why you are getting trouble. Save the image in 256 color bmp not 24 color. even then how many colors were you planning to add? As you realize you are limited, right? (no rudeness intended).
    the next thing to try would be to trace where or what loads the file (for file sharing violation error).
    Digimon had that in the multitudes. not just palettes but the ncer's, and other graphic files. find mention of said file in the rom that isn't in the fat. check the before and after files then check those files together in a narc for chained interaction.

    Tinke is wonderful in that it gets the entire pallette. But that pallete is only as reliable as the image quality. so save in the proper quality.
     
  11. SlamBamActionman
    OP

    SlamBamActionman Newbie

    Newcomer
    6
    0
    Nov 4, 2013
    Rastsan, first I have to say, thanks for all the help so far. You've been a great asset and I can't help but to thank you enough.
    I managed to solve the problem, and although it's a bit tedious I think I'll be able to work with it.

    Turns out that all I need to do is to copy/paste in the hex values from the edited palette to a clean one. I tried this method before, but back then I copied the whole file and put it in there; if I skip the first two lines until I get to the actual colors it works!

    [​IMG]
    Red fits him so much better

    Combining that with editing the NCBR file and I get everything set up to start working for real. To be honest I did not get the chance to try out your suggestions but the game seems to run smoothely everywhere else.

    Thanks a ton for all your help!