• Welcome to SC4 Devotion Forum Archives.

(Solved) Problems with modified FSH files

Started by bap, January 07, 2011, 12:12:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bap

I am trying to modify the FSH files of some props. These FSH are 'color only' (i.e, no alpha map, all regions outside of the proper model are black at the FSH viewer in the Reader).

I use Ilive Reader to save the FSH (save decoded file option) and I converted the files to either BMP or PNGs using FiSHMan or FSHConverter. I am able to read the converted files without problem with all image edition programs I have. I am preferring to edit them with Microsoft Office Picture Manager because it allows me to modify/save the whole group of PNG (or bitmap) files at once. I tried using either FiSHMan or FSHConverter to convert these modified images back to FSH without problems, and I am able to read the modified set of FSH files back into Reader, and to replace the original files by the modified ones.

Everything looks great up to this point. The problem starts here. Somewhere along the modification process the FSH files loose their transparency. When ploped in LotEditor or viewed in game, their bounding cube appears filled with back color in the region outside the proper model, as can be seen in the attached figure.

The prop in this example is the mjb_bamboo1 prop. The original is at the left side and the modified one is to the right. Notice that the bounding box of the modified prop became opaque, obscuring everything on its back and producing a squared shadow.

If I use the simple FSH<>PNG converter, the prop ends up like this.  &sly
If I use FiSHMan to extract only the bitmap, edit it outside, load the edited bitmap as a replacement to the original bitmap, save the FSH and replace it in the .dat file, the prop still ends up like this.  :bomb:
If I try to fill the dark region of all bitmaps with black color using Paint, the prop persistently ends up like this.  :angrymore:

I ran out of (simple) ideas.
( As a desperate measurement, I may create one alpha map for each bitmap and rebuild each FSH with bitmap+alpha. But it will be very time consuming.) Anyone has a better, alternative & faster way of doing this?  %confuso

Thanks in advance.

Lowkee33

Perhaps Null45's BatchPngtoFsh tool will work.  I believe it would be imported as a DXT3 with transparency (or something like that).

geoffhaw

I have struggled with this as well.  The only solution I have found is to create alpha maps too.  However, this was all a few years ago now, so maybe Null45's stuff will help.


Lowkee33

I had similar problems.  Just made my first house looking model today and thought I would gussy up the FSH in GIMP.

I got the black border issue, even when using Null45's tool.  I then did "color to alpha" with black being the color, and that solved the problem.  Of course, half the building was gone too.  Certainly doesn't find you a "better" way.

Have you tried exporting the image and importing without editing it at all?

bap

Thank you both Lowkee33 and Geoffhaw.

Quote from: Lowkee33 on January 08, 2011, 07:21:00 PM
Have you tried exporting the image and importing without editing it at all?

Yes, and in doing just this I already loose the transparency. So, I figured out it was nothing to do with the image editing process.

I was not able to preserve the transparency using Null45' tool, but it was very useful to help me put back a set of FSH with alpha maps included. The solution was, indeed, to create one alpha map for each image, and assemble back the FSHs with color+alpha maps with PNGtoFSHBatch. It works (see attached figures).  :thumbsup:

I may post an illustrated tutorial on how to modify the FHSs of a given model (including what to do with a color-only model) after I finish the MayorMode brush I am working right now. It seems a quite straightforward process if you have FSHConverter, PNGtoFSHBatch, and an image editing tool with batch capability.

Regards,

Lowkee33

Cool.  If we had some automation I guess all we need is some generic LODs...

Putting flowers on those plants (which look better now btw) wouldn't be too hard either.  I went back to my "house", edited a bunch of irregularities and I am pretty happy with the results (as happy as I can be with my batting skills).  Makes me wonder about re-texturing other models that get the moire effect in certain zooms, or re-defining models that have been stretched.

Lowkee33

#6
Bap, you opened a can of worms for me.  :P

It appears that GIMP is better at compressing the PNGs than BAT is at making zooms.  The other zooms have a different aspect ratios, so one has to deal with that.  One can also correct the fact that some models are 1 pixel short of being W2W.
  



In one of these attempts I forgot to change the image size from 128x128 to 64x64 (going from zoom 3 to 2), and the image in-game used the whole FSH.  Perhaps this is a way to make SD into HD with just GIMP?

I feel like I am in SimCity2000.   

bap

Quote from: Lowkee33 on January 11, 2011, 09:40:57 AM
Bap, you opened a can of worms for me.  :P

I am glad that my original problem became a source of inspiration for someone else.  :thumbsup:

Quote from: Lowkee33
In one of these attempts I forgot to change the image size from 128x128 to 64x64 (going from zoom 3 to 2), and the image in-game used the whole FSH.  Perhaps this is a way to make SD into HD with just GIMP?

It seems so. But I believe the effects of HD become visible only at zooms 4 and 5. For this latter one, you would really need an original imagem of higher resolution. Using an image editing program to do that would simply increase the number of pixels in the FSH, not its real resolution. I mean, we cannot really increase the resolution of an image of a given size.

Quote from: Lowkee33
I feel like I am in SimCity2000.   

I know what you mean. There was not a BAT program there, and those willing to modify objects had to do pretty much what we are doing here, modifying all views of the object on an image editing program. I used to 'build' several different buildings by cut-pasting parts of different buildings of the original game and 'painting' other parts. I felt like going back to arts classes in high school.  ;D