Game Development Community

Network Scoping

by Michael Boxleiter · in Torque Game Engine · 10/04/2006 (4:59 pm) · 0 replies

Hey all, I'm trying to make a 3D space strategy game, similar in operation to Sword of the Stars (which is crap), and I need a little advice on the whole network scoping thing. I've read a lot about the ghosting networking stuff and I'm really not finding a lot of information about how to scope objects to individual clients outside of the algorithims required for FPS's. Essentially what I need to do is be able to either look at each object in the scenegraph and be able to scope the object to the individual client which should be able to see it, or send all pertinent game data to each client and have the clients manage the scenegraph data without even maintaining a scenegraph on the server.

Here's what I'm doing. I need to have each client be able to view a galaxy when in galaxy mode, be able to scroll around and look at all the stars, move between stars and all that independently of each other. This I have done. Then I want them to be able to go to a star and 'zoom in' on the system and then just see the planets of the star, the star and not see the stars present in the galaxy view. This I have also, but right now there's no scoping or any kind of organization so when two clients are connected, if one client 'zooms in' to a star I destroy all the objects in the galaxy and then create the planets which the client should see. This is done at the server so obviously the other client gets all jibbered up and his galaxy view goes away and is replaced by a solar system just as the first client sees.

My plan was to create a new object descended from ShapeBase which would be all of my game objects and would include an override of the isScopeable() function which the scenegraph uses to determine if an object is in scope. The class would keep track, with a vector, of which clients should be able to view the object currently and this would be checked when isScopeable() was called. When I tracked down the isScopeable() function to NetObject, I saw it was an inline function and I'm not sure if I should continue.

It seems like there could be a lot of different ways to go with this and I'm not sure which way will screw up the engine the least. Any help or advice from someone who has messed with the networking before would be really great.

Also I heard that the RTS pack totally removes the concept of control object and does scoping totally differently, which is probably more what I'm looking for. Would it be worth it to get the pack just for the scoping?

Cheers
-fucrate