The online racing simulator
Improving lag situations
(5 posts, started )
#1 - FL!P
Improving lag situations
When some car lags, LFS waits a few seconds for the connection to be restored without changing anything. That is if it happens while exiting a corner, for example, the lagging car (as seen from other cars) might keep turning (I just got taken out in a league race that way, because I was on the wrong side of the lagging car). Similarly, if the lag happens just before a braking point, the car will not brake and might collide with the car ahead (happened to me a couple of times too).

I think it would help a lot if LFS triggered an AI to take the wheel of the lagging car on the fly, until it gets the connection back or gives up and times it out. I believe that would prevent many accidents that are due to lag.

I realize that the car might still have to "jump" from the AI's position on track to the real driver's position, when the connection is restored, but I think that jump would usually be smaller than it is now, and at least in the meantime the lagging car's behavior would be predicable.
Seems like a good idea, although I don't know how quickly LFS can detect that someone is lagging. By the time the AI knows to take control it might already be too late.
Quote from FL!P :When some car lags, LFS waits a few seconds for the connection to be restored without changing anything. That is if it happens while exiting a corner, for example, the lagging car (as seen from other cars) might keep turning (I just got taken out in a league race that way, because I was on the wrong side of the lagging car). Similarly, if the lag happens just before a braking point, the car will not brake and might collide with the car ahead (happened to me a couple of times too).

I think it would help a lot if LFS triggered an AI to take the wheel of the lagging car on the fly, until it gets the connection back or gives up and times it out. I believe that would prevent many accidents that are due to lag.

I realize that the car might still have to "jump" from the AI's position on track to the real driver's position, when the connection is restored, but I think that jump would usually be smaller than it is now, and at least in the meantime the lagging car's behavior would be predicable.

Writing net-code is hard! But I agree, something needs to be done - collision physics for Online play are comic! Cars end up flying hundreds even thousands of feet on a regular basis. I don't know nearly enough about it but there are a lot of games that are very resilient to network latency and it stands to reason it could be implemented better for LFS. I'd love to see all other development on hiatus until one can rub paint without a solid chance of flying 50 feet into the air.

I believe collision detection is handled server side. This is probably the most easily secured method but if you mix that with the current scheme of cars warping from projected positions to where they were as of last reply from client - you get lagtastic super collisions that send you flying through the air.

I say I believe they are handled server side because even collisions with track elements can send you into the stratosphere. If they were handled by the client, hitting a wall on a remote server would be no different than hitting a wall in single player.

One would think that remote player car updates could be, for lack of a better word, buffered such that representations on the server follow a likely trajectory (Possibly augmented by AI) while the server is waiting on another update from client. If a collision is detected the server should, at the very least, do some interpolation to decide on a correct response rather than assuming your car really did just warp into the wall laterally at 40MPH Which, I take it, is how it appears to the server after your car moves 6 feet to the right of where it was going, based on the last update to the controls, to where it is now on your screen (Since your client had the benefit of receiving updates to the controls 60-100 times, depending on frame rate) in the intervening 100ms!
Quote from FL!P :I think it would help a lot if LFS triggered an AI to take the wheel of the lagging car on the fly, until it gets the connection back or gives up and times it out. I believe that would prevent many accidents that are due to lag.

That could cause more accidents as if your following someone you know you are familiar with their braking points etc and if the AI were to take over it would behave differently catching you out

The netcode for LFS is extremly good even now imo and that's coming from someone who is in Australia and often joins european servers with little or no problems at all (just have to pick servers with sensible ping and max guests).

There is a couple of things that will improve door to door racing in the future and that is improved internet backbones and on the LFS front improved damage and collission impacts (i.e. more energy is lost in collissions)

There is also something that can be done immediately by server admins and league organisers and that is make the server available only to people local to the server with pps set to 4 or 5. If you have a server that is attracting an international audience try setting the pps to 3 and see if that reduces lag issues (I've found it helps in the past) even consider having a reduced max guest setting. All these things can make a difference, but people like to have the max on everything not realising that it's rarely the optimum way of setting anything up.
Quote from Glenn67 :That could cause more accidents as if your following someone you know you are familiar with their braking points etc and if the AI were to take over it would behave differently catching you out

The netcode for LFS is extremly good even now imo and that's coming from someone who is in Australia and often joins european servers with little or no problems at all (just have to pick servers with sensible ping and max guests).

There is a couple of things that will improve door to door racing in the future and that is improved internet backbones and on the LFS front improved damage and collission impacts (i.e. more energy is lost in collissions)

Car behavior would be very very close to what the other driver see's on their screen - the next update (probably something like 120ms away) will set the car back on course just like it does now - the key is to improve what happens in between as this is critical.

If you think the netcode is good you should shop around and see what the industry has to offer. LFS is fantastic, The physics are excellent, the community is serious about realistic racing, but, online play is state of the art 1998 - This brings back memories of Mechwarrior2. That's not fair and I'm kidding... Nothing could be as bad as Mechwarrior2 Mercenaries Online play. But there's room for improvement.

Collisions are spot on physics wise - don't believe it? Play offline. Hit some walls, cars, produce a massive high speed pile-up; It's all going to look pretty convincing. You won't see any high-flying antics. It falls apart online, I'm fairly certain, for the reasons I went into detail describing. Even with 40ms latencies (which aren't going to happen anytime soon for international users) you will still see some questionable collisions with the current arrangement.

With the accelerations involved in a racing sim; sub 150ms pings can mean, more or less, silky smooth gameplay. Changing the way the server handles velocity interpolation for just collisions would be a great stop-gap - cars would still jerk and stutter around the track but at least a multi-car contact would not result in wildly inaccurate accelerations. I sincerely hope it's looked into sooner than later.

Improving lag situations
(5 posts, started )
FGED GREDG RDFGDR GSFDG