1 (edited by William Tee Riker 2010-06-04 17:45:09)

Topic: [SUGGESTION] Lag compensation / prediction for shooting

When you play a game like Battlefield 2 / 2142 / Bad Company, you notice that they all have some kind of "lag compensation" built in. When you click to shoot, the client "predicts" the shot and you see it immediately.

In Teeworlds, when you click to shoot, the client sends a "request" to shoot to the server and waits for the response before actually creating the projectile object. That means that there is a considerable delay between clicking and really shooting, and the delay depends on your ping. During the time between your click and the receipt of the message on the server, the enemy can have moved away.

It would be nice to have it in Teeworlds one day. It would make playing on the internet almost feel like playing in a LAN.

I think that these games implement it by keeping a "history" of the last few update steps. When you click and the message arrives at the server, it has to treat it like you shot [ping] ms ago (in the past) and then simulate what would have happened ("changing the past"). The drawback is that it makes the game logic more complex.

2

Re: [SUGGESTION] Lag compensation / prediction for shooting

I like it this way, actually. It'd be really annoying to have your bullets pass through people when you have a ping of ~150. Teeworlds is too fast paced for this kind of thing, in my opinion.

Ex-King of Teeworlds

3

Re: [SUGGESTION] Lag compensation / prediction for shooting

I know how it's done and it's much much more harder todo in Teeworlds. in FPS games you can cheat much more because of the restricted view and hit-scan weapons. Teeworlds doesn't have any of these advantages. It will make your lag seem less at the expense that others will suffer your lag instead. It's just not a good feature for Teeworlds.

4 (edited by William Tee Riker 2010-06-04 22:59:08)

Re: [SUGGESTION] Lag compensation / prediction for shooting

But the Battlefield games don't "cheat", as they have real projectiles flying with a certain velocity (not infinitely fast "rays" as in Counterstrike).

5

Re: [SUGGESTION] Lag compensation / prediction for shooting

William Tee Riker wrote:

But the Battlefield games don't "cheat"

It's not cheating the way you'd think of it -- but they most certainly aren't running a quadruple-precision relativistic physics simulation for each bullet. Everything is an approximation.

What matricks is saying is that Teeworlds, by its very nature, shows the world very differently than a first-person shooter and therefore any tricks we do to obfuscate network latency will be noticed in more obvious ways.

Until we invent time travel, the compensation for latency cannot be undone -- it has to be taken out somewhere. We currently choose to "split the difference" by having your client wait for confirmation until it fires. That way, you also get a sense of when other players will see the shot.

With a predicted, simulated game world, your own bullets would seem to fire instantly, but your enemies would see bullets spawn out of thin air, or -- even worse -- just insta-die from shots that have already happened. This would be a big detriment to the overall feel of the gameplay.