Client/Server muzzleVector/Point mismatch.

Expanding and utilizing the engine via C++.
  • 1
  • 2
17 posts Page 1 of 2
LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm
 
by LoLJester » Tue Mar 06, 2018 12:12 am
The values returned from the muzzle of a gun are different between Server and Client - see picture: Image
Anybody know why that is?
Duion
Posts: 1003
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Mar 06, 2018 1:35 am
What exactly are we seeing here and how are you testing the muzzle vector?
Needs more information on this.
LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm
 
by LoLJester » Tue Mar 06, 2018 2:52 am
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.
Duion
Posts: 1003
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Mar 06, 2018 10:54 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.
LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm
 
by LoLJester » Tue Mar 06, 2018 4:54 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?
Duion
Posts: 1003
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Mar 06, 2018 5:30 pm
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.
LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm
 
by LoLJester » Tue Mar 06, 2018 7:33 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?
LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm
 
by LoLJester » Mon Mar 12, 2018 9:46 pm
Despite all the views... nobody else?
Jason Campbell
Posts: 268
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Tue Mar 13, 2018 3:19 pm
Sorry Jester, I don't have any way of testing anything for you. Could it be the implementation of the weapons pack?
LoLJester
Posts: 65
Joined: Thu Aug 13, 2015 5:58 pm
 
by LoLJester » Tue Mar 13, 2018 9:14 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
17 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 2 guests