enneract / AA-QVM

Multiprotocol Tremulous gamelogic used on Der Bunker.
Other
3 stars 2 forks source link

Projectiles are not latency compensated #14

Open ZdrytchX opened 3 years ago

ZdrytchX commented 3 years ago

Opting in for server-side latency compensation (g_unlagged, cg_unlagged) does not affect projectiles. cg_projectilenudge moves projectiles forward until they hit a boundry box or a map surface and is enabled by default (iirc) on derbunker but there is no latency compensation to support the matter if the projectile comes from the shooter.

Tremfusion supposidly supports it but does not work in KoRx. 1.2 GPP supports it but bugs out and stops working entirely once the user has touched the cg_projectilenudge variable indefinitely. Also, when projectile latency compensation worked, client side projectile nudge forgets to additionally nudge the projectile by other shooter's latency.

L-uu commented 2 years ago

If unlagged was able to predict projectiles then projectilenudge wouldn't be necessary? I actually never knew GPP did this but I'd rather a less b0rked solution than the one we currently have (projectilenudge)

ZdrytchX commented 1 year ago

If unlagged was able to predict projectiles then projectilenudge wouldn't be necessary?

you just need to add shooter's latency to the nudge of projectiles they shot, it's theoretically that simple once you compensate for the latency of projectiles. It's only when you get into territory where the projectile can change direction that can't necessarily be 100% predicted, such as xonotic's homing rocket.

Currently, projectilenudge nudges all projectiles equally, including the shooter's, which is incorrect because there's no latency compensation and results in falsely making the player lead inadequately. It's for this reason why I have a bind set to `toggle cg_projectilenudge;echo cg_projectilenudge" (despite the second half, unfortunately tremfusion doesn't actually echo the value of the variable) so I can see the real projectile when I'm shooting, and seeing the predicted projectile when I'm on the receiving end (aliens)

On the side note, most games get rid of the "sticky projectile" look by making them self destruct on the first thing they hit as they assume the client prediction is good enough - Some AAA title aames with homing projectiles still compensate wrongly though, such as battlefield 3, resulting in noticible desync when aiming past or at the edge of a wall with a tank or TOW missile, which is really strange because unlike games like tremulous, they don't wait for the server confirmation of the shot and shoot a ghost projectile which is correctly compensated for most of the time, it's not like they have to wait for server confirmation before guiding the ghost shell with homing data that the client already has.

Some other games simply extrapolate projectile physics linearly based on last server frame known and forget about predicting what the projectile will do in actuality, such as war thunder which is why their missiles appear to warp around a fair bit, but is otherwise more fair for the player on the receiving end... at least when it doesn't bug out.