AFAIK, all InSim app implementations follow the connection list/player list documentation in insim.txt; when a player leaves, the PLID gets deleted from the list as it is no-longer valid and therefore dangerous to keep around unless marked as removed (which would need keeping track of).
Because of your last paragraph, there's no reason to hang on to the PLID once a player leaves (except maybe for a few seconds as there are a few packets with the PLID that can be slightly delayed).
I initially reported this because we came across it at the end of the race, where it is indeed unlikely for a PLID to be reused. It was a problem at the time, because I had expected an invalid PLID value to be zeroed as per the documentation comment.
However, I've since had situations where I need to request a list of RES packets at the end of quali and have seen PLID collisions a few times - it's quite common on a full qualifying session as some people will often Shift+S rather than Shift+P, thus getting a new PLID every time. On a 40 car session, it's ~1/6 chance a PLID will get reused each time someone spectates and rejoins.
If the PLID in a RES packet has the potential to be invalid, I basically have to ignore it and always use the username/nickname in lookups instead.
IMO, a zero PLID is more useful than an invalid PLID (otherwise the PLID field is useless most of the time). Either way, the documentation could do with updating to match actual behaviour as it's currently a gotcha.
For various reasons, I want to sort a collection of data from RES packets without being able to trust the ResultNum field*.
This is mostly fine, however when I need to tiebreak identical lap times, I thought I could use the TTime value, but it's always zero during quali.
Would it be possible to set TTime to the session time when the lap was completed, or is there a technical reason why it can't be?
If it's too complicated for a quick fix, I'll have a look at changing the way I'm doing this.
*e.g. the cached value is wrong if capturing them live and someone later beats the time
p.s. While testing I remembered this bug https://www.lfs.net/forum/thread/94503 as it's basically guaranteed to happen during quali if manually requesting a batch of RES packets a while into the session.
Would it be an idea for the "refuelling allowed" rule to be shown on the server rules when clicking on a server in the server list? (along with pitstop required etc)
Victor: I'm speaking with someone who's having problems starting up an lfs.net U0.6 host. They can select U19 and U is still in the list, but it gives an error message:
That's to be expected IMO, because the Default config is restricted to those settings. I would expect it to clip the values to valid ones. Not doing so would either involve remembering 2 conflicting settings or potentially leaving the default in a bad state.
CPP Pos being relative to Centre view is working now, thanks
For some reason, I'm only ever seeing Config == 0 in NPL
Also, I've noticed that the driver model stops turning the steering wheel when the GTR cars hit their normal, non-drift, end stop, but the wheel continues spinning through the hand. Minor thing, but looks a bit weird.
That might explain another position packet issue we've been having in several InSim applications/minigames - when using MCI data to try to check whether a car is inside an area or not; I have to do some hackery (involving waiting a couple of seconds and testing again) to make sure that the result I'm getting is actually accurate. Without that extra check, the server-side InSim can sometimes think that the car is the wrong side of a (sometimes quite thick, eg pitlane) wall.
Would this also explain why PLA pit in/out packets are often significantly delayed?
I've just had a quick test of the CPP InSim changes.
FOV works fine, but the custom view still seems to be relative to the user's view file, not the "Centre view" position.
Other than the Pos data etc, I'm using
I only suggested it as an option in case it might break other people's code.
Having said that, I don't know if anything else actively uses it; I'm pretty sure TV Director uses another method.
As far as I'm concerned, all my cameras are already based on the "Centre view", so if it were to always be relative to the centre view with no option, that's fine by me.
IMO that would make the most sense anyway - it took me a while to work out why it wasn't consistent on other peoples' machines.
I hadn't actually realised that you could do an offset using VIEW_DRIVER, I've only used VIEW_CUSTOM for this.
In a lot of games, the processing of controller inputs is tied to the frame rate, so a high FPS will give a lower latency, making the game feel more responsive, even if the same number of frames are rendered on the display.
When inputs (and sometimes physics) are decoupled from the frame rendering, you can still benefit from good latency without having your GPU render loads of frames that will just get thrown out anyway. Some newish GPUs/drivers do some magic to try to improve the latency without having to render so many unneeded frames.
That should make our cameras a lot more versatile, thanks
Small bug:
When using the 4+5 keys to zoom, it hits a minimum of 5.7 and stops zooming.
The slider and InSim packet control work fine and will go right down to the 2 degree limit.
Puncture appears on the replay at ~1:21:10, Jaroslav Dohnalík's car, though I gather that he didn't actually get the left front puncture until a lot later and didn't get the right front at all (see chat).
By the way the rim is jumping around, you can probably tell when it happens on his end.
Edit:
Ah, I was on U14.
Edit 2:
Similar behaviour has happened for a long time with the fuel level - other players can tell when another car is about to run out of fuel because the value gets rounded down and the physics behaves as if there's no power.
Would that more detailed info prevent this kind of thing from happening? The right front tyre was shown as punctured for other players, when it wasn't yet for the original car. After the race once the car had stopped, it kept switching between punctured and not. https://youtu.be/yoD-EtDLVd8
Good to hear, I remember there was a significant division back in the day (Z30?), which caused problems.
I've just tested the CPP roll fix and that works nicely
I've briefly had a look at the pred display using the GT2C replay (server was at 12pps and clients were encouraged to use U13).
At race start turn 1-3, I saw peaks of about 2.0 for /mprlag 50 and 6.0 for 200. A decent relative increase as you suggested, but not that huge overall. 300 went up to ~11 or so.
Related to this, from a realism point of view; when changing tyre compounds, LFS currently forces damage repair. This isn't particularly realistic for minor damage - like slightly worn shocks - and forces longer pitstops than probably should be necessary.
I'm no coder, but we need something that looks at packet data, says ok, diff between first and second packet is 10 degrees left movement of steering wheel, we need to split that movement into 20 frames, with wheel moving 0.5 degree each frame. Because at present we have wheel at 0 degrees, then next frame wheel at 10 degrees left..it basically teleports. Game should try to fill the gap between packets visually.
That's what happens now (or did in U12, see below) when watching a replay. It can do that, because it already knows where the position will be for the second packet (it's in the file).
That's not possible in realtime, because the second packet is in the future, so there's nothing to smooth to. In theory, you could delay the position of the steering wheel by 1 packet, but that means it will always be behind and might look weird. Could be something to try I suppose.
On a related note, I've just had a look at a replay to see what it does currently, and I think something's changed with the smoothing of the wheel when a U13 instance watching a replay.
In U12, the wheel slowly moves into the next position just in time (mostly) for the next update, so that the steering movement looks quite natural.
In U13, it's quickly moving to the next position, then waits there for the next update. It's not moving instantly, so smoothing's still on, it just seems to be either using the wrong target time for the next packet or using a constant speed/interval.
Looking at several replays, it appears that the smoothing is still working properly when watching replays in U13 only if the car you're watching was also on U13, but not if they were on older versions.
Server Player Client Smoothing U13 U13 U13 Good U13 U12 U13 Too fast U13 U12 U12 Good U13 U13 U12 Good U U? U12 Good U U? U13 Too fast
Player is the version the car you're watching was running Client is the version watching the replay.
I'll do more tests and try to record some video later
It's interesting to read about some details of LFS multiplayer implementation, the interaction of network communication and simulation of remote cars, especially.
Does LFS extrapolate the steering inputs of remote cars (for simulation, not visuals)? Or does it only use constant steering inputs from the last network packet for a given car?
Looks constant from what I've generally seen - if someone starts lagging, steering angle & throttle inputs of the car usually stay the same until the car disappears (or another packet finally arrives).