The online racing simulator
InSim MCI jagged data
(7 posts, started )
InSim MCI jagged data
Hi.
I'm having trouble with plotting data received from MCI packets (40ms update). Paths are weirdly jaggy, seemingly tangent to very slowly refreshing real position.


It's even worse when vehicle is slipping:


Is there some special interpolation I should do? It doesn't look anywhere that bad in the game.
#2 - Racon
That looks like a laggy car - LFS will keep it going with the same control input if it doesn't get an update, then correct when it does. Usually you don't notice the very small corrections, but a lot of lag around a corner would look about like that.

Weird that it seemed OK to you in game, that would seem to rule lag out. Is the insim on the same computer as you? If so, maybe the insim got laggy data while you didn't?

Edit: I've just thought - there's a flag for lagging in the CompCar in the MCI you could use to check. You could plot the point in green if the flag's not set and red if it is. If it is lag, your tangents should go red and the bits where it is behaving as you expect should be mostly green.
Car wasn't lagged, it looked normally in game. InSim client was connected locally to dedicated server.

Investigating it further I noticed that when replaying MPR replay and capturing InSim locally, it looks fine. Comparison:

So, it does look like DCon doesn't do physics calculation at all and instead draws just straight line from last known point?
#4 - Racon
You're right, DCON doesn't do physics, it just coordinates sharing the end results between all the clients.

How're you getting 40ms updates? That's 25/sec, MCI is 4/sec default and 6/sec max, IIRC. One of your tangents is around 16 dots long from where it deviates to where it corrects, that's 2/3 second at 40ms, you should have at least 2 MCI packets in that time even at default rate. I'm totally lost now, sorry :/

I made a tracer a while back and haven't run across this problem myself, but it doesn't run at anywhere near as high a resolution as yours, so it might be present but hidden within tolerance (2nd image on https://piranmoto.co.uk/tracks/203). There's a couple of places where it looks like it could have happened, but they were in fact crashes Smile

--

Edit: Ahhhh, maybe your insim is set to 40ms in the ISI, but your DCON is set to something else? (/pps = x in the .cfg)

That would mean the DCON, lacking physics, would have nothing to go on but previous heading and velocity for 6ish of your insim reads, before the next time it had up-to-date info (4 writes per 25 reads). The tangents are longer than 6 dots though, so I'm still not dismissing some hidden lag somewhere Smile
Yes, I meant 40ms interval of MCI packets set in IS_ISI. I have /pps=6, so this is also confusing why these straight line segments are longer than ~4 dots.

I guess if DCon doesn't calculate physics it isn't possible to fix it, except faking it by filtering out excess points and drawing beziers passing through real positions. Slightly annoying that CompCar doesn't have some field like 'time since last real update'.
#6 - Racon
Quote from milek7 :Yes, I meant 40ms interval of MCI packets set in IS_ISI. I have /pps=6, so this is also confusing why these straight line segments are longer than ~4 dots.

Yeah, I make it 4 too, give-or-take the odd threshold/race condition. There's got to be some skipping going on somewhere, but I just can't think of anything other than lag that would cause it.

Can I just double-check? The DCON is on your local machine, the insim is on your local machine and connected to the DCON locally, and you drove the car yourself with a local client?

Quote from milek7 :I guess if DCon doesn't calculate physics it isn't possible to fix it, except faking it by filtering out excess points and drawing beziers passing through real positions. Slightly annoying that CompCar doesn't have some field like 'time since last real update'.

That would be nice, and there's a spare byte in CompCar. It could be an interval count with a low cap to squish just enough information into a few bits. (0 is no lag, a 16-dot tangent from the above settings would be 4, something like that)
Quote :
Can I just double-check? The DCON is on your local machine, the insim is on your local machine and connected to the DCON locally, and you drove the car yourself with a local client?

No, players were remote.

I might have picked one of worse cases previously (so maybe it was flaky connection), but here is my trace:

My connection seems fine:
--- s2.milek7.pl ping statistics ---
10006 packets transmitted, 10005 received, 0.009994% packet loss, time 506551ms
rtt min/avg/max/mdev = 26.913/28.781/50.996/1.384 ms

Blue points denote data indicating this is real position update and not fake straight line interpolation. While smallest interval is indeed 4 dots (so checks out with /pps=6) it varies significantly, especially on straights.
I guess LFS is doing optimization, if control inputs are constant and predicted path doesn't deviate much from actual position it skips some updates (but it assumes prediction with proper physics calculation, and DCon only does straight lines so it deviates much more).

Anyway, currently I'm drawing line segments only through real points (blue dots):

Later maybe I would change it to drawing smooth beziers, but it's good enough for now.

InSim MCI jagged data
(7 posts, started )
FGED GREDG RDFGDR GSFDG