13th Apr 2017, 12:26 AM
Something about SREL (Sims Relation)
Join Date: Jul 2008
As SREL, I mean the SREL (Internal format: 0xCC364C2A).
As a little rationale, I will tell you that SREL Resource can be found in various package in a neighborhood directory. I've noticed that only the main Hood package (e.g NXX_Neighborhood.package) were useful to understand relations between sims.
In trying to understand how it works, I've dumpded a lot of SRELs. I've first used the description of SREL structure in the Wiki:
Relation between sim
Short name: SREL
Long name: Sim relations
This resource holds sim relationship values.
Number of following dwords (some high values such as 0C are self relationships of some kind)
Daily relationship score
Relationship state bits
001 - Crush
002 - Love
004 - Engaged
008 - Married
016 - Friend
032 - Best Friend
064 - Going Steady
128 - Enemy
064 - Family
128 - Known
Good/Bad relationship (0x0000 = positive score, 0xFFFF = negative score)
Lifetime relationship score
Only if Relationship Type 0x40 bit is set
01 - Parent
02 - Child
03 - Sibling
04 - Grandparent
05 - Grandchild
06 - Uncle/Aunt
07 - Niece/Nephew
08 - Cousin
09 - Spouse
To assign these values to sims you need to look at the instance ID of the file, the first 2 bytes of the instance reference the Sim who has that feelings, the other two bytes are the Sim s/he has the feelings for.
The format above appears to be incorrect. In my investigations of 1188 SREL records, the record appears to contain a Version and a Count in the first two DWORDs of the record, followed by Count additional DWORDs, with no additional 32 bytes of unknown data following, though I have encountered *one* presumably corrupt record that has one more DWORD of data than the Count claims. I have yet to confirm or refute the meanings of those DWORDs, and therefore have no reason to believe that the interpretation above is incorrect. --GeneralOperationsDirector
After loading the file containing that *one* record into SimPE, displaying that particular record, and clicking first on Commit and then on Save, that one record now also conforms to the format that I describe above. --GeneralOperationsDirector
My own investigations, led me to the conclusion that, this description may be wrong. I've found several SREL (48 on a Hood File, against more than 146K), whose second DWORD did not match, but I'have'nt found any SREL that have an unpacked size which is not a multiple of 4 (the size in bytes of a DWORD), so I think, the second DWORD is not a counter.
I've examined severals record with unmatching size and found values (1,2,3,4 and 5) and for matching ones (3,7,9 and 10). All those relations appears to be coherent with the description above.
Other maybe interesting things:
- according to Cyjon's chemistry studies , attration could be a signed 32 bits integer starting at offset 0x28, if you average this value with it found in reverse relation, you will find Something close to Cyjon's formula's for chemistry calculations, and whose match "the chemistry over all" sort order in game: < -50, mild chemistry (red crossed bold icon), -50 to 0 < no chemistry(no bolt), between 0 and 32 small chemistry (1 bolt), between 32 and 80 strong chemistry (2 bolts) and more than 80, very strong chemistry (3 bolts).
- offset 0x2c could be the best friend forever marker(the golden friend icon).
Afak, these abnormal relation may occurs when:
- Sims have family link and one of the sims died before the birth of the other (DWORD value is 1)
- Sims cannot meet on a comunity lot (DWORD value is also 1, because both are NPC's, and at least one of them cannot be selected by game as random character present on lot)
- Sims cannot meet on a comunity lot (DWORD value is 5, because both are NPC's, and one of them is a "Bon Voyage NPC(Tourist Family)", not sure for this one, I've only one SREL record ).
- Both sims were present on a community lot but did'nt interact together (DWORD value is 2)
- Sims ares NPC's but have not the same NPC Family number (DWORD value is 4), not sure, I've only one sample between "NPC - Display Pets - Available" (family 32760) and "NPC - Pets - Orphans" (family 32761).