### Client/Server muzzleVector/Point mismatch.

Expanding and utilizing the engine via C++.
• 1
• 2

#### Client/Server muzzleVector/Point mismatch.

LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm

The values returned from the muzzle of a gun are different between Server and Client - see picture:
Anybody know why that is?

#### Re: Client/Server muzzleVector/Point mismatch.

Duion
Posts: 1009
Joined: Sun Feb 08, 2015 1:51 am

What exactly are we seeing here and how are you testing the muzzle vector?
Needs more information on this.

#### Re: Client/Server muzzleVector/Point mismatch.

LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm

What you're seeing is a blue line, drawn from the muzzlePoint (getRenderMuzzlePoint ) along a Vector (getRenderMuzzleVector) called on the Client, and a red line - same as the blue line - but called on the Server:

Code: Select all

//--------------------------------------------------------------- void LaserBeam::ProcessTick(const Move *move) { ... _drawDebug(); ... } //-------------------------------------------- void LaserBeam::renderObject(...) { _drawDebug(); } //----------------------------------------------------------------------------------- void LaserBeam::_drawDebug() { ... VectorF _muzzleVec; Point3F _muzzlePoint, _endPosition ; mSourceObject->getRenderMuzzleVector(mSourceObjectSlot, &_muzzleVec); mSourceObject->getRenderMuzzlePoint(mSourceObjectSlot, &_muzzlePoint); _endPosition = _muzzleVec* 50; _endPosition += _muzzlePoint; ColorF clientCol (0, 0, 1); //On Client: Draw line in Blue. if(isServerObject()) clientCol.set(1, 0, 0); //On Server: Draw line in Red. DebugDrawer::get()->drawLine(_muzzlePoint, _endPosition, clientCol); DebugDrawer::get()->setLastTTL(TickMs); .... } 
Last edited by LoLJester on Tue Mar 06, 2018 4:55 pm, edited 1 time in total.

#### Re: Client/Server muzzleVector/Point mismatch.

Duion
Posts: 1009
Joined: Sun Feb 08, 2015 1:51 am

Well there are different kinds of muzzle points and vectors, for example there are

Code: Select all

correctMuzzleVector = true; correctMuzzleVectorTP = true;
In the weapon datablock, so you have a first person and a third person muzzle vector, additionally they can be corrected, depending if you want to use the true muzzle vector of the weapon or not and your debug function may use a different kind of vector.

#### Re: Client/Server muzzleVector/Point mismatch.

LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm

Thanks Duion, but the correctMuzzleVector(s) for first and third person work fine. The problem originates somewhere deeper than that.There seems to be a muzzleNode position packUpdate/unpackUpdate discrepancy somewhere in the Player class or one of the parent classes. I first thought that the nodes don't get animated on the server, but they do. The image I posted shows exactly what I mean. On the Server (the Red line), the muzzleNode position is lower from the Client (the blue line) by somewhere around 0.1f for some reason. Any other ideas why?

#### Re: Client/Server muzzleVector/Point mismatch.

Duion
Posts: 1009
Joined: Sun Feb 08, 2015 1:51 am

How is that relevant now? I mean bullets can only use one or the other, which vector is used by the bullets that are fired? I would assume it uses the blue line for bullets.

#### Re: Client/Server muzzleVector/Point mismatch.

LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm

They are the same vector. Imagine the lines are like raycasts, but only the red line (Server) can detect and call the onCollision function in script: see how the red line is bent downwards and does not collide where the blue line does?
Has anybody else had this problem and may have a fix?

#### Re: Client/Server muzzleVector/Point mismatch.

LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm

Despite all the views... nobody else?

#### Re: Client/Server muzzleVector/Point mismatch.

Jason Campbell
Posts: 269
Joined: Fri Feb 13, 2015 2:51 am

Sorry Jester, I don't have any way of testing anything for you. Could it be the implementation of the weapons pack?

#### Re: Client/Server muzzleVector/Point mismatch.

LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm

How do you mean? The weapon pack seems to work fine. The muzzle node is placed properly as you can see with the blue line.
• 1
• 2

#### Who is online

Users browsing this forum: No registered users and 1 guest