LoLJester Posted March 5, 2018 Posted March 5, 2018 The values returned from the muzzle of a gun are different between Server and Client - see picture: Anybody know why that is? Quote
Duion Posted March 6, 2018 Posted March 6, 2018 What exactly are we seeing here and how are you testing the muzzle vector?Needs more information on this. Quote
LoLJester Posted March 6, 2018 Author Posted March 6, 2018 (edited) 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: //--------------------------------------------------------------- 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); .... } Edited March 6, 2018 by LoLJester Quote
Duion Posted March 6, 2018 Posted March 6, 2018 Well there are different kinds of muzzle points and vectors, for example there arecorrectMuzzleVector = 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. Quote
LoLJester Posted March 6, 2018 Author Posted March 6, 2018 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? Quote
Duion Posted March 6, 2018 Posted March 6, 2018 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. Quote
LoLJester Posted March 6, 2018 Author Posted March 6, 2018 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? Quote
LoLJester Posted March 12, 2018 Author Posted March 12, 2018 Despite all the views... nobody else? Quote
Jason Campbell Posted March 13, 2018 Posted March 13, 2018 Sorry Jester, I don't have any way of testing anything for you. Could it be the implementation of the weapons pack? Quote
LoLJester Posted March 13, 2018 Author Posted March 13, 2018 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. Quote
Atomic Walrus Posted March 21, 2018 Posted March 21, 2018 What happens when you fire from 3rd person? My hypothesis is that the server doesn't actually use the 1st person model, and so bases its muzzle vector on the weapon's position in your 3rd person model animation.If that's true then the vectors should line up when you fire in 3rd person. If they still don't then I'm wrong and it's.. something else, and I have no clue. Quote
Bloodknight Posted March 22, 2018 Posted March 22, 2018 Despite all the views... nobody else? Sorry, my best just adds a list of questions to your own, which track does the projectile use, does it follow a different track on *your* local than it does on another player local.My first guess would mesh somewhat with your hypothesis in that client and server is using different perspectives, my 2nd guess would be time lag difference between client and server, tho i do only have the single image as a reference so that could be a wild stab. Quote
LoLJester Posted March 23, 2018 Author Posted March 23, 2018 Exactly the same problem in third person view as well. Quote
Happenstance Posted March 24, 2018 Posted March 24, 2018 What happens if you call getMuzzlePoint/Vector instead of getRenderMuzzlePoint/Vector? Also is animateOnServer set to true in the weapon datablock? Quote
LoLJester Posted March 27, 2018 Author Posted March 27, 2018 Same problem with getMuzzlePoint/Vector; only difference is a smoother rendering with getRenderMuzzlePoint/Vector.firstPerson, useEyeNode, and animateOnServer are all set to true. Quote
NeonTiger Posted March 27, 2018 Posted March 27, 2018 I have had problems in the past with the look animation not begin in sync between two clients on the same server. I had to tweak the number of frames to fix the problem. Tho i'm not sure if its related to this, i thought id bring it up. Quote
LoLJester Posted April 3, 2018 Author Posted April 3, 2018 @NeonTiger: Sounds plausible. I'll check it out. Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.