Game Development Community

Difference between SimSet and SimGroup

by Kevin James · in Torque Game Builder · 11/23/2012 (11:01 am) · 6 replies

So, I've been looking for useful, generic data structures in TS. I think about the only generic data structures are SimSet and SimGroup. However, SimGroup is derived from SimSet, and the online documentation indicates that SimGroup doesn't add any fields or methods to what it inherits ...

I do think that SimGroups are much more used by Torque than SimSets, but as far as I can tell, the two classes are exactly the same. I did a dump on both in the console and the dumps were exactly the same. (I did a diff on them).

About the author

Computer security, digital forensics, and platform jumper enthusiast. shells.myw3b.net/~syreal/


#1
11/23/2012 (11:58 am)
While an object can belong to many SimSets, it can only belong to one SimGroup. If you destroy a SimGroup, it will destroy all objects contained within it.
#2
11/23/2012 (7:37 pm)
from "Torque 3D - Script Manual.chm":

SimSet Class Reference

A collection of SimObjects.
It is often necessary to keep track of an arbitrary set of SimObjects. For instance, Torque's networking code needs to not only keep track of the set of objects which need to be ghosted, but also the set of objects which must always be ghosted. It does this by working with two sets. The first of these is the RootGroup (which is actually a SimGroup) and the second is the GhostAlwaysSet, which contains objects which must always be ghosted to the client.

Some general notes on SimSets:
Membership is not exclusive. A SimObject may be a member of multiple SimSets.
A SimSet does not destroy subobjects when it is destroyed.
A SimSet may hold an arbitrary number of objects.


SimGroup Class Reference

A collection of SimObjects that are owned by the group.
A SimGroup is a stricter form of SimSet. SimObjects may only be a member of a single SimGroup at a time. The SimGroup will automatically enforce the single-group-membership rule (ie. adding an object to a SimGroup will cause it to be removed from its current SimGroup, if any).

Deleting a SimGroup will also delete all SimObjects in the SimGroup.

#3
11/25/2012 (3:48 pm)
Thank you for the education - this is great to know!

Where's the Torque 3D Script Manual? It seems to have a lot more detail on the basics of TS than the TGB Documentation does.
#4
11/26/2012 (10:32 am)
Do you mean the T3D documentation? http://www.garagegames.com/documentation/torque-3d
#5
11/26/2012 (12:13 pm)
Thanks Jack - turns out it is: Torque 3D Documentation -> Scripting -> Overview -> TorqueScript Reference Manual (link)
#6
11/26/2012 (12:37 pm)
The .chm (help) file is in your T3D install directory in the /documentation folder....

Wait - it might be there; don't know if they kept it there in MIT version.