Game Development Community

Best class to base serverside class on

by Colossai Studios · in Torque Game Engine · 10/11/2005 (8:14 am) · 2 replies

I'm looking into the best way to create a class that only is used on the server. At this point the prototyp of the class is based on ShapeBase, but this seem a bit unnecessary if the network capability of that class is not going to be used.

Right now when basing the class on ShapeBase, I must set a datablock when instancing, otherwise I get "register object failed". Since I don't need a datablock for this class, that's not optimal.

The requirement for the class is that the instances of it must be able to be added to a SimSet.

So which base class would be most suitable here... GameBase..SceneObject...NetObject...SimObject....ConsoleObject....?

I'm guessing SimObject, but I'm not sure. Any advice on this?

thanks

#1
10/11/2005 (2:57 pm)
SimObject, definately, if all you need to do is add it to a SimSet.

If you wind up having to turn it into a renderable object, it's very easy to convert a SimObject into a SceneObject just by changing the base class and implementing a few more functions.
#2
10/11/2005 (6:30 pm)
Tony is correct--for anything that has no need to be networked/rendered/have a three-D position in your game world, SimObject is your class.

If you do need parts of those capabilities but not all of them, it's best to find the highest level in the hierarchy that supports your needs, and simply not use the functionality you don't want...for example, if you need 3D position but you don't need networking, then use GameBase but don't set your netFlags to Ghostable.