So the final tweak that made my projectile prediction feel right was to actually *delay* the client side prediction slightly. WTF right, delay is exactly what we’re trying to prevent with prediction. But the trouble is, if you pure predict, everyone else sees a projectile that always spawns quite far in front of you, because by the time the server knows you’ve done it, and has fast-forwarded for lag, that projectile has moved quite far ahead before it’s seen. So we split the difference a bit
Also, because our spell casting is never instant, there’s always some wind-up, I can make it feel better on the client by moving the “fire” event slightly earlier in the animation, and send the server request then, and delay the client spawn by a predicted lag amount. The server fast-forwards less. That makes it far more likely that they mostly sync up and neither end has to adjust very much.
The only downside is that in between this event and the local client fire, you could technically cancel your input and it would still fire (server call has happened). But it’s a very small window and probably not noticeable.
I never intended to have instant-fire or hit-scan spells, this isn’t supposed to be a twitch shooter, but this reinforces that (I’d need server side rewind). Having at least some wind up and travel time limits my lag compensation problems, and it’s tricky enough already
I’m very much NOT an expert in this but I wonder if it would be helpful to write up in a blog post. Other people are far more experienced, but it was pretty tough to find any written resources on this
@sinbad Please do, if you find the time! If others then are inspired to further refine, so much the better. But finding anything at all on many topics is such a struggle these days.