turret heading/pitch rate

Scripting questions, discussions, etc
2 posts Page 1 of 1
Posts: 182
Joined: Wed Nov 15, 2017 8:19 am
  by fLUnKnhaXYU » Wed Jul 15, 2020 1:25 am
hello ,
Now I have an issue with the turretShapeData heading and pitch rate while the turretShape is the control object . Any setting other than instantaneous (-1) produces an un-smooth interpolation . It will start slowly then snap to the next position . It does the same whether with an aiturret shape or a turret shape as control object . I've messed around with keyboardTurnSpeed but i don't imagine that that would be correct solution it didnt help anyway . Any idea or suggestion ? thank you
Atomic Walrus
Posts: 7
Joined: Mon Feb 23, 2015 10:41 pm
by Atomic Walrus » Thu Feb 04, 2021 8:18 pm
This reply is only life half a year old, which is like 3 days under modern time rules. Or is that 3 decades? Well either way, if it helps someone...

I'm going to presume you're seeing correction packets (writepacketdata/readpacketdata) which are what's actually causing the stutter. The default turret implementation doesn't properly account for the client-predictive/server-authoritative model control objects work under. In my experience, it's the deeply integrated client-server system of Torque that most people bounce off of, but that's also one of its biggest strengths if you're actually making a multiplayer game.

I was certain I'd posted about this at some point, and indeed if you journey back to the old GarageGames forums here is my fix:

http://www.garagegames.com/community/fo ... ead/130721

What this does is create a "render" version of the rotation variable and uses that to determine render orientation. This version can be safely modified by client-only code for interpolating between ticks, without altering the actual simulation variable for turret rotation (interpolation doesn't occur on the server, so interpolating the simulation rotation would put client and server out of sync). Follows the same model as every scene object having a separate simulation and render transform to store pos/rot.
2 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests