More Awesome Than You!
Welcome, Guest. Please login or register.
2024 November 21, 22:57:12

Login with username, password and session length
Search:     Advanced search
540287 Posts in 18067 Topics by 6545 Members
Latest Member: cincinancy
* Home Help Search Login Register
+  More Awesome Than You!
|-+  The Bowels of Trogdor
| |-+  The Small Intestines of Trogdor
| | |-+  How Thumbnails are Linked to Custom Content
0 Members and 1 Chinese Bot are viewing this topic. « previous next »
Pages: [1] THANKS THIS IS GREAT Print
Author Topic: How Thumbnails are Linked to Custom Content  (Read 8416 times)
jfade
Obtuse Oaf
***
Posts: 904


Esteemed Senator Emeritus


View Profile WWW
How Thumbnails are Linked to Custom Content
« on: 2006 December 02, 03:37:07 »
THANKS THIS IS GREAT

Hello everyone, was wondering if any of you knew anything about this or perhaps could help me figure this out. I'm looking into how objects, walls, floors, terrain paints, skins, recolors, etc are linked to the thumbnail packages. The basic stuff that I have figured out so far is probably widely known already, but I haven't been able to find any specific information on this written down anywhere, so bear with me. Tongue

The thumbnails seem to be organized this way:

--- BuildModeThumbnails.package ---
Instance2 (if there is one): is a CRC24 hash of some sort
Instance: CRC32 hash. I'm not sure how either of these hashes are determined yet.

--- CASThumbnails.package ---
Instance2: it seems to follow in this way for custom content only:
0x00000000 - Cats and Dogs
0x00000001 - Clothing, tops and bottoms, male and female, all ages. Also appears to have toddler hair, and I've seen one set of adult hair thumbnails, but this seems inconsistant with other observations.
0x00000002 - Child Hair
0x00000003 - Teen Hair
0x00000004 - Adult Hair
0x00000005 - Elder Hair

After this, in instances 6, A, B, F, 10, 14 and 15 I have some other hair thumbnails, but they're all of various colors of the two hidden Maxis hairs, and so I'm thinking that they're unreliable and can be thrown out.

Now, after that, there's what looks like a CRC24 hash of some sort that stores thumbnails of whole sims. It also seems to store the thumbnails that show in Create a Pet mode that highlight where coat changes will be placed. (IE there's one that shows the cat's right back leg highlighted in red, and so on.) It also apparently shows parts such as facial hair, face paint, makeup, etc.

After this, all the instance2's seem to be full CRC32 hashes, but of what, I don't know. All in this range appear to be Maxis content.

Instance: This appears be be a CRC32 hash of something, and source of content (Maxis or otherwise) seems to be irrelevant.

--- DesignModeThumbnails.package ---
Instance2: CRC24 preceded by 7F.
Instance: CRC32. Again, I don't know what's being hashed in either of these two to get the result. I'm still experimenting.

--- ObjectThumbnails.package ---
Instance2: CRC24 preceded by 7F.
Instance: CRC32. Same as recolors, no idea what's being hashed.

Well, anyhow, that's what I've got so far. It's not much, I know, but I'm hoping some of you can help me figure out the rest of the puzzle. What's the hashing algorithm being used? Normal CRC24 and CRC32 or is it some bizarre maxian type thing?

What the heck is being hashed anyhow? I'm continuing to experiment with various things but not getting very far. I'd appreciate any help I can get. Smiley Thanks in advance! Smiley
Logged


Nifty Sims hacks and programs at: DJS Sims
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: How Thumbnails are Linked to Custom Content
« Reply #1 on: 2006 December 02, 06:27:48 »
THANKS THIS IS GREAT

SimPE already handles this kind of thing. The details are as follows:

- CRC-32(group-hash-value+model name)

Model names come from STR# 0x85. So, for example, if you wanted to find the thumbnail for the Biotech Station career reward, you would perform CRC-32 on this string:

"2134374667careerbiotechstation"

In Python, code for that might look like this:

Code:
def calc_crc(s, bits, init, poly):
    c = init
    b2 = bits - 8
    mask = 1 << bits

    for i in range(len(s)):
        c2 = ord(s[i])
        c ^= (c2 << b2)
        for j in range(8):
            c <<= 1
            if (c & mask) != 0: c ^= poly
    return c & (mask - 1)

x = calc_crc("2134374667careerbiotechstation", 32, 0xFFFFFFFF, 0x04C11DB7)
print "%x" % x

Hope that clears it up. Smiley
Logged

jfade
Obtuse Oaf
***
Posts: 904


Esteemed Senator Emeritus


View Profile WWW
Re: How Thumbnails are Linked to Custom Content
« Reply #2 on: 2006 December 02, 16:13:54 »
THANKS THIS IS GREAT

Hi dizzy! Thanks for the info, it works great for Maxis content, but doesn't seem to be working so well for custom content. For example, I have the Arizona Sofa from Holy Simoly. It's model name is sofaumcutout__79050f5b-ce53-4226-a7bc-704dc38b20f6 and it has the 0x1C050000 group as well as the 0xFFFFFFFF group.

I've located it's thumbnail, and it's Instance is 0x18F7ECE0, Instance2 is 0x7FEE22A5. So I tried hashing these two strings (since I didn't know for sure what group to use) and the results don't seem to work out.

470089728sofaumcutout__79050f5b-ce53-4226-a7bc-704dc38b20f6 = CRC32 (Instance): 0x7F3660B1 CRC24 (Instance2): 0x7F3E14C4
4294967295sofaumcutout__79050f5b-ce53-4226-a7bc-704dc38b20f6 = CRC32 (Instance): 0xFCA4CF40 CRC24 (Instance2): 0x7FD73CFD

I'm not sure why it's not working yet, but it isn't for whatever reason. Huh

I've located some other custom content thumbnails and they all get the same result, the hashes don't match up.

I'm still trying to figure out what gets hashed with what in walls, floors, skins, etc. I'm assuming it's group with something else, but still not sure what. Hopefully we can get something figured out. Smiley
Logged


Nifty Sims hacks and programs at: DJS Sims
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: How Thumbnails are Linked to Custom Content
« Reply #3 on: 2006 December 02, 22:45:28 »
THANKS THIS IS GREAT

I don't know off the top of my head. I guess I'll have to see if I can find some info on that.  Tongue
Logged

Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.073 seconds with 20 queries.