Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Not actually evil.
Original Poster
#26 Old 27th Jun 2010 at 1:52 AM Last edited by CatOfEvilGenius : 28th Jun 2010 at 12:05 AM.
After several days of investigation, I am almost convinced that the game simply will not create correct thumbnails for toddler separates. I suspect this capability may not have been put into the executable. Here's what I tried that had no effect.


Correct Icons In-game? Nope

Made extensive modifications to the mesh and the recolors. Changed the CRES, the GMDC, GMND, and SHPE. Tried to make the mesh as much like a Maxis separate mesh as I could. Got rid of all references to pubodyjumper, everywhere, in both mesh and recolor resources. Told the top recolor it was in the "pf top" bin/collection. Added it to said collection. Made a bin/collection named "pf bottom". Noted that child collections have a 3IDR and BINXs in the same TGIR group. Made appropriate ones for the toddlers, with no apparent effect. Now, SHIFT-N shows the separates are in the toddler separates collections. This has no effect at all on icon generation.


Custom Clothes Icons? Nope

Tried to make these clothes use custom icons. As far as I know, no one has done custom clothing icons. Looked at the methods used for accessory and object custom icons. Tried to adapt them to clothes. Found that, yes, you can put an image resource in your recolor, add it to your 3IDR, and tell the BINX to use your new iconidx, but the game ignores all this. Tried replacing the UI 0000...0000 line in the 3IDR with a reference to the image resource instead, while keeping the BINX iconidx unchanged. Again, the game just ignored this.


Override / Replace CASThumbnail entries? Maybe...

Next, tried overriding the CAS thumbnails from the CASThumbnails file, with very minimal success. I can make clothing that is initially an "outfit", generate a thumbnail for it, then make it a separate, and it retains the thumbnail it had as an outfit (now in the separates catalog section). I can take an existing thumbnail picture and swap it with another existing thumbnail picture. There's stumbling blocks, unfortunately.

I can export thumbnails from CASThumbnails.package, but it seems that putting them (or altered versions of them) in any other package has no effect whatsoever. It appears the game will only use CAS thumbnails it finds in the CASThumbnails.package, and not anywhere else. Not in a new package in /Thumbnails, not in a recolor package.

Most unfortunately, I cannot manually alter the thumbnail images without crashing the game. When I export a JPG thumbnail, alter it with GIMP, and then import it, or do a resource replace, either one, the game crashes when it tries to display that icon. I suspect GIMP is saving in a JPG format the game does not expect or cannot use. Can't find the difference! Same image size, 256x256. Same resolution, 72x72 dpi. Same color space, RGB w/o alpha, same color depth, 24. Same layer count, 1. Tried saving the JPG as progressive and as not progressive, neither works.

Any JPG file format experts here? Haaalp please?

----------------------------------------
edit:
So I'm slogging through the hex view of the JPGs while looking up the JFIF header format online. Good times. GIMP is definitely saving images with a *different* style header than what TS2's thumbnail creator is producing. Knew that already.

TS2's jpg's have "ALFA" in the header. What could this mean? Jpg's don't have an alpha channel, but they can use black pixels to indicate transparency. That's what the thumbnails do. Does this "ALFA" have something to do with that?

edit 2:
JFIF segment format
Allrighty. Sims jpg's have a JFIF segment with density units 0, while GIMP's jpg has density units 1 (pixels). That's easily changed, as is width/height to aspect ratio data. What's troublesome is that Sims jpg's appear to have a 2nd JFIF segment, with an "ALFA" identifier. It's not a JFIF extention, it's not an EXIF, what is it? Maybe an alpha mask block? But why? Hopefully not some EA internal format. Blarg. Can't find an "ALFA" format specification, my google-fu is weak.

edit 3:
Let's assume the ALFA segment *is* an alpha mask. It looks like maybe, maybe, it might be run length encoded. Here's some typical data, in bytes (decimal), from after "ALFA":

206 0 240 255 232 0 182 255 ...

Perhaps this means:

206 transparent pixels
240 opaque pixels
232 transparent pixels
182 opaque pixels
...

However, if this was RLE, you could get lenghts longer than 255, and you can't store that in a byte. So maybe not RLE. Maybe, row markers??? Each row has pixels with indices from 0 to 255. So maybe 206, 240, 232, 182 are indices into a row, telling you where the alpha mask switches from 0 to 255? But if it's row markers, where's the info about which row they're in? And for all markers in a row, shouldn't they be monotonically increasing?

If I could figure out this format, I might, maybe, write a 24bit BMP -> Sims2 JPG converter, and then I could have any image I want in a CAS thumbnail. Something to shoot for.

edit 4: Or maybe it is RLE after all. Have seen n1 0 n2 0. So if there's more than 256 zeros, just have two or more numbers for it.

----------------------------------------

Of course, if I do get CASThumbnail replacement to work, people will have to run the replacement utility every time they nuke their CASThumbnails or accidentally SHIFT-right click toddler separate icons. Meh. Not an ideal solution by any means, but the only option I think I have left.
.

Please spay or neuter your pets. --- Cat Music Video! --- my meshes
Advertisement
Not actually evil.
Original Poster
#27 Old 27th Jun 2010 at 9:51 PM Last edited by CatOfEvilGenius : 28th Jun 2010 at 12:05 AM.
I should be asking about this in the SimPE forums. Clearly, they can convert a Sims2 ALFA alpha mask jpg into a regular jpeg, so can probably help with converting the other way.

edit:
So SimPE, I believe written in C# (?), is using some system library to decode images, it seems. Why don't I do this with Python or VTK and save myself some trouble...

Please spay or neuter your pets. --- Cat Music Video! --- my meshes
Page 2 of 2
Back to top