View Full Version : Package Resource Graph, Suggestions/info wanted!

21st Jun 2008, 11:07 PM
I've been working on a graph of all possible Sims 2 package resources for a while now, and finally have a (semi) working version. :D

Unfortunately, I'm a bit of an idiot and can't figure out how to add the image inline. xD So it's an attachment.
EDIT: Fortunately, Numenor's not an idiot.

I hope this image helps modders in some way. Pretty much none of this info is originally my findings, but it's spread out, and I'm a very visual person. ;P
I'm open to suggestions, and PLEASE tell me if I missed something. (Very possible) I'll eventually try to get all primitive BHAVs that link into this. Meaning if you have experience with any other primitives, tell me.

Notable problems:
I can't find where the GLOB is referenced. Is it just implicit by group?
I don't know what the NREF purpose is. SimPE fills it with a name that doesn't refer to anything else. (so far as I can see)
I did NOT add the implicit link from the GMND to the TXMTs. I know there's a block for each recolorable group, and (supposedly) a list of possible recolors, but i've never seen it update with extraction, so neglected it.

Thanks! :D

22nd Jun 2008, 1:30 AM
I'm astonished! The chart is definitely complex (because the package structure *is* complex :lol: ) but you managed to put everything in it!
Only a couple of notes:

1) Why "TGIR"? We all (and SimPE) refer to it as "TGI" (Type, GroupID, Instance); what's the "R" for?

2) The MMAT should be linked to the CRES by name, too.

3) As for your intention to include other primitives in the BHAV section, I'm afraid to just create confusion, I'm not sure it's a good idea; however, you have already included almost everything that a modder may be interested in, so I judge the current scheme satisfactory.

As for your questions:
- The GLOB is just referenced by GroupID. In custom objects, it's assigned to common Group 0xFFFFFFFF, and therefore it is assigned (along with all the other resources in the package) to a unique GroupID on-the-fly, while the game loads. Though it's not strictly needed (an object could work without having a GLOB), it is always used, so to allow calling the specified semiglobal BHAVs.

- The NREF is referenced by GroupID (see above, about the GroupID 0xFFFFFFFF), and by Instance: each OBJD is supposed to have an associated NREF with same Group and Instance, and all the NREF in the same package must have the very same label. the purpose of the NREF is actually obscure. For sure, the NREF name appears in the error logs, and therefore it's useful to give it a unique name; but Inge Jones says that removing all the NREF from a package doesn't break it. I was convinced that the game assigned the GroupID to custom objects using the hash calculated on the NREF name, but I'm probably wrong. SimPE, in the beginning, used to create a unique name for the NREF, but now this function seems broken, and it just assigns the CRES name to the NREF (but, on the other hand, the NREF name becomes unique if you do a "Fix Integrity"...).

- The Maxis GMND's contain - as you have noticed - implicit references to all the existing recolours; but MaxoidTom confirmed me (back when he still talked to us :lol: ) that those references are ignored by the game: they were used during the development in order to group an object and its recolours. Therefore, you did well not to draw any connection between the GMND and the TXMT.

Drop me a line when you post the thread with the image, so I can move it in the most proper and visible section. I'm actually thinking that the Modding InfoCenter would be perfect: though so far only JWoods and I have contributed and maintained the Infocenter, I think I can make an exception for you, since your scheme is very beautiful and I want people to know who deserves all the credits for it :)

PS: In order to post an image inline, you have to upload it as an attachment, then click on it within the attachment window, so to view the full size, and then copy the image URL from the properties (right-click on the big image). When you get the URL, just use the standard [ IMG ] and [ /IMG ] tags.

22nd Jun 2008, 2:16 AM
Wow! Spectacular! Couple of minor notes:

- The "Animate" BHAVs actually refence ANIMs via text lists as well, but there are a bunch of different text lists so I'm not sure how you'd show that.

- Change Material uses STR# 0x88 to reference the MMAT, not the TXTR

22nd Jun 2008, 5:51 AM
;D Glad y'all like it. I'd LIKE to eventually make it dynamic, either in a javascript app or a *gasp* actual executable, so that details about the link types (e.g. the actual field, etc) can be pulled up, but...that would require time and programming skills I don't have. xD (I don't think it can be done in Fortran, else I would)

To Numenor:
1) I chose 'TGIR' for a chain of reasons. From the TGI page on the Wiki (http://www.sims2wiki.info/wiki.php?title=TGI), it says the 4th ID 'Instance(hi)' is called (R) Resource ID. And if you look in the Hex format (yes, I did) for the RCOL blocks, the header references can be either 24 bit TGI or 32 bit TGI + R, but all the (admittedly limited) objects I looked at reference by 32 bit. Hence, TGIR.
In short: Completely arbitrary. xD

2) ...So they do. xD Told you I probably missed something stupid. As a sidenote, anyone know what the family (dtString) field is? I recognize it as a GUID hash, but other than that....

3) I somewhat agree. The only thing I really think it's missing is Sound primitives, and maybe LUA. (hey, I added FX! xD)

And thanks for clearing up the GLOB/NREF/GMND questions! =D

To Echo:
*smacks head* I KNEW I forgot something. :/ I left is aside until I could decide how to put it in, and just forgot about it. Thanks for pointing it out.

You're sure the STR# 88 References the MMATs? The name is usually the same, but I thought I'd cloned an object with a different MMAT/TXMT name, and it pointed to the TXMT. Naturally I can't find it now...But I will definitely look into it.

22nd Jun 2008, 6:24 AM
Good graph :)
What you might add, since you are adding back references - under BHAVs, [prim 0x000E] 'Find Best Object for Function' points to OBJf, and [prim 0x000D] 'Push Interaction' points to TTABs.

Change Material uses STR# 0x88 to reference the MMAT, not the TXTR I'm afraid it's not all true, because I've seen working ChangeMaterials in objects with no MMATs at all - foods, for example. Don't know how to explain multi-state material (clean/dirty) usage, though - because those are cases when it changes to a MMAT/TXMT different from the one written in STR#, only with the same suffix :)

22nd Jun 2008, 8:56 AM
Hmm... You're right. My memory must be playing tricks on me! :)

22nd Jun 2008, 11:38 AM
1) I chose 'TGIR' for a chain of reasons. From the TGI page on the Wiki (http://www.sims2wiki.info/wiki.php?title=TGI), it says the 4th ID 'Instance(hi)' is called (R) Resource ID.
As a matter of fact, we wondered for quite a long time about the real essence and function of that fourth value, and in the end (also with the hints by the Maxoids), we understood it's just part of the Instance number. In other words, the Instance is a 16-byte number, though the high part is often ignored by the game (and when it's not ignored, it's useless anyway, because the lower part is more than enough to uniquely identify a resource).

2) ...anyone know what the family (dtString) field is? I recognize it as a GUID hash, but other than that....
It's used by the game to further differentiate the recolours, but again it's useless, because the references to TXMT, CRES and GUID are enough for the purpose. The only real usage of the Family is for multi-state MMATs: the two MMATs for the lit/unlit must have the same Family, as well the two MMATs for the clean/dirty etc.
NOTE: SimPe relies on the Family to differentiate the various recolours, so we all stick to the golden rule: different recolour, different family :)

3) ...hey, I added FX! xD
The Effects can be called via BHAV, or from within the ANIM file; the same apply to sounds. Not sure if this info should be added to the graph, I fear it would become too complex. Maybe you could split it in two parts: general package structure and detail on the connections between BHAVs and other resources...

4th Feb 2009, 2:09 PM
Sorry to bump this thread - it's very interesting. :)

Just to contribute my own notes on the TGIR thing - I call the R Instance2 (aka High Instance) - it's used a lot in post-Uni (or NL I forgot which) resources. So to me this would be TGII but most people just use TGI. :)

4th Feb 2009, 2:26 PM
As far as I know, the High Instance existed since the base game to uniquely identify the scenegraphic resources; in the earlier versions of SimPe, they were mistakenly labelled as "Subtype" (but it was just a visual inaccuracy: the "Fix TGI" function actually fixed both instances at once).
Again, I consider high and low instances as a whole, and therefore the "TGI" acronym should be correct; but of course, the important is understanding each other :)

4th Feb 2009, 5:51 PM
Are you sure they existed in base game? The High Instance doesn't exist in earlier versions of the DBPF format. I definately recall it being introduced somewhere around Uni time.

But yes, I also consider them the same - both instances are used to locate the object in question, so TGI would suffice. :)

Edit: Yup, DBPF 1.0 index 7.0 doesn't have "high" instance IDs. This format was used for SC4 and the original base game as I recall.

4th Feb 2009, 9:04 PM
I'm not sure we are talking about the same thing...
I retrieved from the original base-game CD the packages containing the textures, GMDC's, CRES's etc. and they all have a high and a low instance ID; and the oldest GMND's contained in the CEP (that I never updated) do have High and Low instance.
And if you are into archaeology :lol: here is a screenshot of the oldest SimPe I have archived (v. 0.14, Dec 31st 2004):

The high instance is labelled "Subtype/Class ID" :blink: but it's it.

4th Feb 2009, 11:43 PM
Hrm, maybe it was only some files that it was there on - oh well, it doesn't matter too much. I bow to your more superior knowledge :)

Also, 0.14 doesn't compare with my SimPE 0.12 . :P