Game Development Community

Network/Datablock question regarding complex scoping of gameplay relevant info

by David Stocker · in Torque 3D Professional · 09/27/2010 (3:48 pm) · 2 replies

I’m working on a multiplayer RPG or graphical MUD depending if you prefer that term. I’ve written a python based ruleset processor for handling game logic and now I’m working on integrating it below the Torque server. I’ve got a complex system for scoping sensory data to players within the ruleset engine, but I’m a bit unsure how to reflect that in Torque. A player fooled by an illusion might see a little girl, while another might see a demon. A deaf character should not get any gameplay relevant sounds, etc.

I’m wondering what my general strategy might be.

Let’s use the demon, little girl example. We have an object might have one mesh as seen by Player 1, but another mesh as seen by player 2. If I set the mesh in the object’s datablock, it’s static and there is no way to change it. Is there a way to tell Player1’s client to use datablock1 for the object and Player2’s client to use datablock2? Perhaps using commandToClient?

Is there a better way?

#1
09/30/2010 (5:19 pm)
In your example (I'll refer to it from here on out as a "disguised" enemy), you'd probably want to implement it by first defining what determines whether a given player can penetrate the disguise. Then, you'd need to set up AIPlayer (or whatever you are using for NPCs) to be able to load and use more than one shape. You can then set the shape on the AIPlayer to be the "disguised" shape. After that you'd need to set it up so you can check whether a given player can penetrate the disguise, and use that state to determine what shape is set for their client on the AIPlayer.

Seems a bit tricky.
#2
10/01/2010 (3:59 pm)
Right, that would be the overall approach, although I'd not want to be using it with AIPlayer per se as it could be used in principle by any simObject derived object with a mesh.

I'm mostly wondering about what the best overall strategy is for handling this multimesh scoping of objects and which classes I should be thinking of extending. I'm making the decisions about whether or not the disguise is seen through in the python backend.

From poking around in the T3D c++ code and reading up on the TGEA networking articles on TDN, I think that one place where I might be able to cleanly store alternate meshes is in TSShape, where the vector meshes is defined, by introducing a vector of vectors and a getter method. So when right now I’d go to look up meshes[i] as it is right now, I’d do something along the lines of getMesh(int index, int outerIndex = 0) , so that if I wanted the high poly LOD version of the default mesh, I could just use the index as now (with the new getter) and if I wanted to use an alternate mesh, I could ask for that and at any LOD.

My next questions might be basic networking question, but I can’t find it in the docs.

1-Where is the ghost tracking information stored? I’d like to say that when player one’s control object has player 0’s control object in scope, it only gets ghosted second list meshes from player0’s possible meshes.

2-The netObject packUpdate and unpackUpdate functions as I see them in don’t seem to mention the mesh in any way in Player. How it is sent over the network that a particular player should see a particular mesh associated with an object?