Game Development Community

Failure to ghost ScopeAlways objects.

by Gary Preston · in Torque Game Engine · 11/04/2006 (12:30 pm) · 3 replies

We've recently been experiencing a bug where by a client connected to the server will not have other player objects ghosted across. The players do not appear on the radar nor are they visible on screen until they've died and respawned at which point the new player object is correctly ghosted across.

This bug is intermittent in release builds. It only occurs after a newly connected client has played at least one round. Sometimes it occurs straight away on the 2nd round they play, other times it can be several rounds, assuming it occurs at all.

After a great deal of investigation I've managed to isolate the problem to the objects been set as ScopeAlways. We have all players (max 8) set as ScopeAlways to ensure that the client radar can display all players in the game at all times.

If instead of setting mNetFlags.set(Ghostable|ScopeAlways); we do mNetFlags.set(Ghostable); and deal with scoping using:-

void GameConnection::doneScopingScene()
{
   // ensure all player tanks are always in scope
   gServerContainer.findObjects(TankObjectType,scopeCallback,this);
}

Then the problem goes away. However, this feels like a poor way to deal with this, since we want the tanks ScopeAlways, it would make sense to simply set them "ScopeAlways".

Somehow, the mission loading phase that ghosts all scope always objects is failing to do so intermittently. The only way I've been able to consistantly recreate this problem is by running both host and client using debug builds. The slower mission loading sequence _appears_ to cause the problem to occur immediatly after a client has played one round, it then continues to occur every round there after.

I've been unable to track down why the slower load sequence could be causing this to occur though.

Anyone have any ideas what could be causing this?

Also, I'm aware that always scoping players is going to place more strain on networking, however since our radar must always display all players at all times (even when out of radar range; they show as pointers on the edge of the radar) I'm not sure we can avoid this. If anyone has any ideas on this too then I'd appreciate hearing them :)

#1
11/04/2006 (2:41 pm)
Is this a specially implemented class, or a stock class? It's possible that you don't have an InitialUpdateMask portion of your ::pack/unPackUpdate(), so the client doesn't have all the information needed to create the object client side, but that's a guess.
#2
11/04/2006 (4:36 pm)
It's a custom class, however, if InitialUpdateMask was a problem, wouldn't that cause the client to fail all the time including the first round? I'll have a look into this tomorrow though just in case :)

Currently it will work fine for the first round always, then after that it's a lottery, sometimes it will work fine for 20,30,40 rounds, other times it will fail to receive the ghosted objects on round 2.
#3
11/20/2006 (3:06 pm)
It sounds like the lifetimes of the player objects aren't determinate.

Say you have 3 players. Could it be the case that at mission load time during subsequent rounds there is no player object for player C when player A or player B is getting sent the "scope always" objects?

Are you waiting until all the clients are connected and the player objects created before you start loading? If so, how are you doing this?