ROM Hack Is it Possible to Import Textures into .bch Files Without Significant Quality Loss? (FE: Fates)

UnassumingVenusaur

In All Her Gay Glory
OP
Member
Joined
Nov 20, 2015
Messages
459
Trophies
0
XP
433
Country
United States
So, I've been attempting to insert custom sprites into Fire Emblem Fates as of late. The character sprites are saved as textures (.png's, it seems?) in .bch files. I've been using Ohana 3DS to do this. However, I've recently learned (and seen in-game) that when the texture is imported into Ohana, it becomes compressed in ways that corrupt the quality of the sprite. For example, I tried to import a custom short-haired sprite for Lucina. It loaded up in-game, but the reduced quality and discoloration from the compression was obvious-- even more so in-game than in these screenshots.

top_0017.png
top_0001.png

Original

top_0000.png
top_0001.png

Custom
Apparently, Ohana 3DS Rebirth doesn't compress the textures, but it saves .bch files at a rather large size that makes it unusable in-game. The people I've talked to and asked don't know of a program besides Ohana for this sort of editing, but I really don't want to settle for these lower quality sprites, so I thought I'd at least ask here to see if on some off chance someone knows a solution. Is there any other program that I could use to replace the textures in a .bch file that would circumvent this corruption of the sprite, but also save properly? Really, is there any way at all? I'm willing to try anything, honestly. Even if there were some way via hex editing.
 

UnassumingVenusaur

In All Her Gay Glory
OP
Member
Joined
Nov 20, 2015
Messages
459
Trophies
0
XP
433
Country
United States
How so exactly? Does it refuse to build?

To be fair, for some reason when I tried to use Ohana 3DS Rebirth I couldn't even get it to open the .bch file, but I think I was just doing something wrong there. The info about how it saves I was told by another person who *has* tried it. They told me:

"Rebirth forgoes [Ohana's] compression bc it was causing the photos to lose quality (the problem the old ohana has). So basically rebirth will save the bch files at a much larger size than the original files bc they're not etc1/etc2 compressed, and they won't work in game."

They were even trying it with Fire Emblem Fates sprites as well, so I'm taking their word for it that it won't be a solution for me.
 

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
They were even trying it with Fire Emblem Fates sprites as well, so I'm taking their word for it that it won't be a solution for me.
No shame in trying that anyway. If there's a post that they made somewhere, I would like to see the context for everything here. I don't know the specifics for the FE:Fates fs or the files.
I could look at the bch, though. It's been a month since Rebirth had any changes and still just support for .bch files, which is kinda shit.

Please do give out any information on this, as I am struggling with the same issue as well.
 
Last edited by Thelostrune,

UnassumingVenusaur

In All Her Gay Glory
OP
Member
Joined
Nov 20, 2015
Messages
459
Trophies
0
XP
433
Country
United States
No shame in trying that anyway. If there's a post that they made somewhere, I would like to see the context for everything here. I don't know the specifics for the FE:Fates fs or the files.
I could look at the bch, though. It's been a month since Rebirth had any changes and still just support for .bch files, which is kinda shit.

Please do give out any information on this, as I am struggling with the same issue as well.

Ha! I tried to use Rebirth and this is what I got:

top_0000.png
Also, that quote was actually part of a message sent to me on another site.
 

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
I actually have no idea. It's a two step compression by bch to lz to arc. You'll have to ask gdkchan about this, because he seems to know a lot on this.
 

UnassumingVenusaur

In All Her Gay Glory
OP
Member
Joined
Nov 20, 2015
Messages
459
Trophies
0
XP
433
Country
United States
I actually have no idea. It's a two step compression by bch to lz to arc. You'll have to ask gdkchan about this, because he seems to know a lot on this.

Well, I know how to compress it as you can see in the screenshots in the OP. I just need to find another way to import the texture into a .bch file, but I didn't expect anyone to have a solution. Thx for your help anyway!
 

UnassumingVenusaur

In All Her Gay Glory
OP
Member
Joined
Nov 20, 2015
Messages
459
Trophies
0
XP
433
Country
United States
If we knew how, it would solve the problem on my end as well.
or just .mm/.at support in rebirth when

Hmm, do are you asking how I compressed the file? I used BatchLZ77 for the bch (after it compresses, open in a hex editor, copy the first four bytes, paste insert them at the beginning, change the first byte to 13). To turn it back into an arc, paste the .bch.lz in the folder it originally came in, and drag the folder into create.bat from FE If Arc Tool (the folder and create.bat must be in the same directory). Then it's good to go.
 

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
No, my problem is that I'm ROM hacking OR/AS and .mm are overworld models and suffer from the same kind of compression issues.
 

HelpTheWretched

Well-Known Member
Member
Joined
Feb 4, 2010
Messages
315
Trophies
1
XP
1,560
Country
Canada
Hi, UV! I know this thread is about a year and a half old, but I just saw it while searching for something. I had the same issue as you, where importing textures via Ohana3DS (Rebirth) caused ugly compression. Eventually I figured out another way, using a texture converter and a hex editor! If you're still interested, I'll set you up with those. :)
 
  • Like
Reactions: Thelostrune

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
Hi, UV! I know this thread is about a year and a half old, but I just saw it while searching for something. I had the same issue as you, where importing textures via Ohana3DS (Rebirth) caused ugly compression. Eventually I figured out another way, using a texture converter and a hex editor! If you're still interested, I'll set you up with those. :)

I think we would all like whatever you have.
 

HelpTheWretched

Well-Known Member
Member
Joined
Feb 4, 2010
Messages
315
Trophies
1
XP
1,560
Country
Canada
I think we would all like whatever you have.

Well, I jumped the gun and posted that last message before seeing UV's post that said:
"Rebirth forgoes [Ohana's] compression bc it was causing the photos to lose quality (the problem the old ohana has). So basically rebirth will save the bch files at a much larger size than the original files bc they're not etc1/etc2 compressed, and they won't work in game."

Strangely, my copy of Rebirth does compress the textures when you import them. It's an uncommon release that adds mipmap support, so maybe that's why.

I've uploaded that version and a couple other programs to this link, since it took a lot of searching to find them and I couldn't tell you where they came from. :P

bch2png is self-explanatory; drop a BCH file into the app's window, get textures in PNG format. The reason I include it is, it doesn't discard the colour data for pixels that are 100% transparent, like Ohana3DS does. To restore the colour to those pixels, I load the PNG file in GIMP, select Colors -> Curves from the menu, set the "Channel" pull-down menu to "Alpha", then drag the vertex at the bottom-left corner of the graph to the top-left corner.

3dstex is a command-line program. First you'll need to know the target format of the texture, which Ohana3DS should tell you; probably etc1 or etc1a4.

Put the edited PNG file in the same folder as 3dstex, open the command prompt to this folder, and type:
3dstex -r -o etc1a4 -c 3 texture.png texture.raw

-r makes the output texture raw (no headers/footers)
-o etc1 / etc1a4 is the output format
-c 3 is compression level for etc1 textures: 1 is fastest, 3 is best quality.
texture.png and texture.raw are the input and output filenames.

Back to the BCH files, make a copy of the BCH you want to edit. In one copy, use that version of Ohana3DS Rebirth to replace the texture that you want to change. It'll get compressed more than you'll like, but that's okay. Now use a file comparison program on the two copies (I used a demo of Beyond Compare 4) to find the hexadecimal adresses of the portion of the file that was changed. These addresses probably end with 00 or 80.

Once you have those addresses, you'll know exactly what portion of the BCH file to replace with your raw texture file, using a hex editor!

[Edit]
Mind you, there will still be some compression in the texture, especially in the reds, especially along edges. But it'll look much better than just replacing the textures with Ohana3DS. I could clearly notice the quality difference in-game between the two methods when I edited some model textures in Tri Force Heroes.
 
Last edited by HelpTheWretched,
  • Like
Reactions: Thelostrune

Thelostrune

Well-Known Member
Member
Joined
Aug 13, 2015
Messages
553
Trophies
0
Age
26
XP
309
Country
Norway
It'll get compressed more than you'll like, but that's okay.

Mind you, there will still be some compression in the texture, especially in the reds, especially along edges. But it'll look much better than just replacing the textures with Ohana3DS. I could clearly notice the quality difference in-game between the two methods when I edited some model textures in Tri Force Heroes.

Oh well, sadly not what I was looking for.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://m.youtube.com/watch?v=lDRjqI-fBVI&pp=ygUPVml0Z2luIG1hZ2ljaWFu