The online racing simulator
Improve start position of vehicles
Currently, it is not entirely clear to me what logic is used to place vehicles on the grid; it looks like a vehicle's reference point is used, but making mods with ridiculous dimensions can also affect the position somewhat, so I'll keep it mostly to official cars here, with the same logic applying for all vehicles anyway.

Even within official cars, with the variety of vehicles, there are large discrepancies on the grid boxes: some cars have their front wheels close to the markings, some are further back, some are way beyond the line... and even with cars from the same class, like GTR, we have differences.



My suggestion to solve this is to use the front wheels of a vehicle to determine its position, which I believe should only be an offset along the forward vector of the vehicle, based on data available in the car_info.bin file (on the public side, I assume that data is readily available internally).

I'm not asking for a consistent match within 1cm for all cars, but if the front wheels could be somewhere on the yellow line of the F1-style grid boxes, that would be great Smile
On that note, layout start positions do not have that yellow line (and, as an aside, they're also not as wide), but more importantly, they have a completely different offset to their visual markings, compared to Blackwood's markings.


In the second image, I even placed the grid box further back, aiming for the yellow line, and it still appears way forward of the official grid box - I think both the official and the layout grid boxes should use the white line as their reference point, or the yellow line (and equivalent distance for the layout grid box), instead of a generic size which clearly cannot fit all vehicles.
Attached images
BL_1.jpg
BL_2.jpg
comparison.jpg
You are right that this is a bit of a mess at the moment, something we've never considered properly. To fix it, we need to:
1) align the visual objects correctly with the invisible start positions
2) set the cars such that part of the car is aligned with one of the lines

Eric found the dimensions of the grid box and has provided me with an accurate start grid box object.

It's not clear to me what the actual rules are, regarding the positioning in the box. Is it the front of the car needs to be within the white lines, and the yellow line is just a sighting line for drivers (e.g. F1) as they can't see the white lines? Or is there something about aligning the wheels with one of the lines?

I'd be interested to see some evidence about what part of the car should line up exactly with which line, if anyone can find that.
From the FIA F1 sporting regulations, article 48.1.c (incorrect starting location): "Any part of the contact patch of its front tyres outside of the lines (front and sides) at the time of the Start signal."

The yellow line is only used as a reference (typically for F1 and other open wheelers), which is why it sits behind the white line, to allow some margin for error.
I would suggest placing the front tyres on top of the yellow line (and giving the layout start positions the same offset to the white line for consistency).

For what it's worth, I've been experimenting with an InSim GUI to guide drivers into their boxes after a formation lap, using IS_MCI packets for the spawn position as the target (which I have to adjust a bit to account for heading deviation and the fact the the CompCar position is not at the front tyres), and the principle works well enough to be useful, but I do have to adjust the forward offset depending on the track and layout (placing layout start positions hidden below the ground when there are proper grid boxes, which is often not the case, but I noticed in the screenshots of the updated tracks that more configurations will have 40 proper boxes).

Since I like to add new ideas to most of my suggestions (sorry about that Big grin), having the option to change the start position's look to the F1-style grid box would be great.
Thanks for the FIA regulations reference. So at least in F1, it's the wheels that need to be inside the box.

I'd be interested to know if any other classes require bodywork to be behind the line. For practical reasons I could imagine that being the case in karting, but really have no idea. I wonder about classes that are not open wheel.

At the moment in LFS, the timing (at splits and finish line) is done when some arbitrary point of the vehicle crosses the line. Probably the model's origin. This is what I don't like at the moment.

Bear with me as I'd like to get this right if possible. I believe the coding to be relatively simple but I want to get this right by thinking it through.

What we have so far is that starting point, at least in some classes, should be based on front wheels behind the white line. Probably just aim for the yellow line. It would be interesting to know if some classes put the bodywork behind the line. And that leads me to a related issue I am wondering about:

Photo finishes.

I guess that photo finishes must be based on the front part of the bodywork, rather than the wheels? But the front overhang can vary a lot between different cars, up to a value of a few milliseconds depending on the speed. So this leads to the point that some cars might need to drive further to complete the race. Of course this is really of no concern with an ordinary grid, every car drives a different distance anyway, so who cares about a few inches. But what about a drag race? The start and end must depend on the same thing (wheels or bodywork). What method is used for the timing? At first I could imagine them using laser timing, but I guess that doesn't work if you have two cars overlapping. Uhmm

So then we have the possibility that for a drag race, the bodywork should be behind a line, but on a grid start, the front wheels must be behind the line. Ya right

Should splits and finish line use the front of the bodywork rather than the front wheels? In real life racing what methods are used for the millisecond-accurate timing?

Hope I've explained this confusion enough, would be interested if anyone has knowledge or evidence to resolve the questions. Smile
Good point about drag races and photos finishes in general, which may be complicated further with possible damage to the cars Big grin (but otherwise, I do believe that bodywork is used as reference for photo finishes).

I found the more generic FIA International Sporting Code, which states in article 8.6.1.a that "for a standing start, [an automobile] must be stationary at its allocated grid box with no part of the contact patch of its front tyres outside of the lines (front and sides) at the time of the Start signal", so this part is consistent across all series.

Going back to drag races, maybe specifically for Autocross drag races (and I believe there is a drag strip in the Fairfield Test Centre as well?), you could use the forward-most vertex position of the vehicle's LOD1? I don't know if you ever compute a bounding box for vehicles in the game, in any of the LODs, but I would assume you do for culling purposes?

In real life, I believe accurate timing is generally done with transponders, and only if you get identical times to the millisecond would you need to use a camera fast enough to determine who crossed the line first. The transponders, however, are not necessarily in the exact same location for all cars (there are multiple regulated locations for F1, the Clio Cup has its transponder next to the key on the steering column, but different cars in a same category may have various locations - the important part here is that the timing itself is consistent for a single car, whether you measure at the front, middle or back of the car, and only the finish gets impacted by the different locations).
Quote from Bokujishin :the important part here is that the timing itself is consistent for a single car, whether you measure at the front, middle or back of the car, and only the finish gets impacted by the different locations).

Well "only" the finish is quite important for close finishes. It would be unfair if a car would lose a race just because its virtual transponder was placed further back than for the others Uhmm
#7 - Racon
F1 uses wheels for the grid position and bodywork for the splits/finish? If anyone was gonna do it, it would be F1 I guess - I've seen their idea of what constitutes overtaking Wink

I think we need to have the grid spots and the splits/finish measured with a consistent method, and that bodywork would be better than wheels for general use. BTCC regs are by front-most bodywork (3.6.1).

I've seen a fair few ties-to-the-hundredth broken with screenshots, they were all by bodywork as far as I can remember - it seems well-ingrained. Also, F1 gets to cut the discrepancy between the two measurements by regulating nose length, but we have massive variation of mod geometry to contend with.

I guess there'd be quite a bit of extra calculation going on to find the front-most part of the body in the direction of travel. I don't know enough to know if that's too much processing to be doing every frame, but if so maybe it could be generated at pit-out (with later damage ignored) or limited to LOD3.

(I'll stop waffling now, I'm getting into premature optimisation of code I don't have to optimise Taped Shut Big grin )
Quote from Flame CZE :Well "only" the finish is quite important for close finishes. It would be unfair if a car would lose a race just because its virtual transponder was placed further back than for the others Uhmm

Of course, but I think what I said is still technically correct: the transponders give you a single car's timing, but not its position (position is only accurate if all cars have their transponder at the same distance from the front-most point). So for close finishes, you need to check photo-finish style instead of transponder style. I guess you could define a close finish as any sub-0.5s finish or when there is any kind of overlap between 2 cars.

FIA regulations vary from series to series, but they always include some tolerance (for LMGT3, which has one of the most varied car shapes in its category, the front transponder must be located 1800mm +/-500m from the front of the car, so you can have up to a full meter between 2 cars).

Quote from Racon :F1 uses wheels for the grid position and bodywork for the splits/finish? If anyone was gonna do it, it would be F1 I guess - I've seen their idea of what constitutes overtaking Wink

Interesting to see BTCC uses the entire bodywork for starting position; F1 in general is not the best series to represent motorsport, with all their specific rules that basically nobody else uses, however FIA does use the contact patch for the starting position for all series, and it seems common sense to use bodywork for photo finishes. I had a quick look at IMSA regulations, which also state that a car crosses the finish line when its timing device triggers, "and more precisely, at the instant the leading-most edge of its bodywork passes over that line (photo finish)".

Those transponders also seem to be what dictates when a car enters or leaves the pit lane.

Computation wise, it's quite common to have mesh dimensions for all objects in the world, because of culling optimizations; you only need to get those dimensions once, and maybe update them after getting damage to the car, so it's not something you need to do every frame at all. Using LOD3 would not be recommended as it can be offset from LOD1 (plus some mods don't have proper LODs).
I remembered that dragstrips used laser beams at the start. However it appears it's more complicated than i though.
https://www.youtube.com/watch?v=7i_RnAiQzP4
And an even shorter explanation by the NHRA channel.
https://www.youtube.com/watch?v=b_iHKeOsDWM

So it's inverted. It detects when the wheel blocks the beam and activates the tree, as the car moves and the beam closes circuit it's when the tree determines your launch.

Mid track there are these boxes called speedtraps, couldn't find videos explaining those. Guessing it's a regular tripwire like circuit.

Edit and offtopic: I realised something, this could allow a server to work automatically using for example a 7 second delay when there are 2 cars staging (and reseting the tree when they cross the finish line). This also allows for the drivers to do a burnout and heat their tyres. I though it should be mentioned.
Thanks for the feedback! Thumbs up

FGED GREDG RDFGDR GSFDG