The online racing simulator
Speed & angle measuring (basically driftbox)

There's already a long time one thing in my mind. Speed and angle measuring would be very useful in drift events and judging would become a little more fair. I'd like to use it too in an event, but this could make it more original etc. as I said...

Speed and angle measuring in apex (middle of a corner). Imagine car driving qualification run. Going sideways through the 1st corner and in the moment the car is in apex, the InSim program measures speed, angle and would be interesting also to measure distance from a clipping point which will be placed in the apex. I'd like to apply this for all the corners. There's usually about 3-5 corners in drift events so it won't be that many.

After this follows output of the gained information. Most probably it will .txt file saved on ftp server. But also would be comfortable to make some overview table which you can hide using some command or SHIFT+I or something. Judges and competitors could see the results immediately.

I don't give it many chances, because not many people do something like this for free, but thanks anyway.
Hmm, perhapse make a request that it get added to LFS lapper. It might get done since it would only need to be a small addon rather than an complete driftbox from scratch. There just needs a command to add apex points. The you just drive the course, save the points with lapper commands and then later, let the lapper count drifts in those special points areas in a different score variable. Hope you see what I mean.

You could write an algorithm to figure out apexes from the LFS path files, but that would be pushing it a bit. I just suggested above something a little simpler to implement.
Count drifts? Since when are drift events judged by the drift points? Actually, I hate the drift points counter in LFS Lapper, because it only helps to make people blind. It's not about to get some points, it's about line, speed, angle and style. Or did you mean like the insim will convert speed+angle to some points? Better to get clean data for judging, no points.
better to use Speed*angle = points : yes, but only count those points when in the correct areas of the track (racing line) I meant.

At the moment LFS lapper counts any drift (angle*speed)=points , no matter where you're doing it, grass tarmac no difference the racing line is ignored. It's a big job yes, to register the cars position on the racing line. I was saying it might be easier to add it onto the lapper mod because you only would need to add the code to "record" where the racing line is and the test the cars position in accordance to that special zoning when it is drifting.

Record mode:
Drive the car around while lapper keeps track of your position making a list of points around the racing line until the admin does one complete lap.

When drifting, compare the car's position against the pre-recorded list of points, the distance from those points in the list determine how far your car is from the racing line. Angle of the car compared to expected drift angle could also be tracked and scored.

Any autoX layout could be used because you only have to make your own path by doing a complete lap.

(edit) other:
Or if you prefer, have a command so you can turn redord mode on and off while you drive. That way you can assign special corners where drifts should be scored, and by scored I mean take data from what the drift is doing at those corners.

Do you know what I mean? I actually wanted to do this a while ago, but never had the time. Pretty much made a recipe to allow for automatic judging. You just have to tell the program how you want to judge it.

Using zone event.

A zone event is a zone who trigger an action in LFSLapper when car enter in it. it's a square zone with 1 meter resolution ( 0 to n meter ). This zone is user determinated. is it sufficient for your purpose? Maybe you can make a test with this feature and if it's what you want, i can make avaiable angle and perhaps the distance for the car to the center of this zone.
Make a test!

But i don't know how many zone won't slow LFSLapper. To be tested.

See this is what I meant, it's almost done in Lapper already.

Hi Gai-Luron, well sounds like it's almost done eh. So you can make it count drift points when only inside the squares and ignor drifts around the rest of the track? Sounds ace, and a bit more simplified than a user defined path. Maybe a circle would be quicker to calculate than square mathematics I would think.

I've tested about 200 circles simultaneously with full server. Things start getting dicey around 250-300 circles. This was location event test every 10th of a second. <3 MONK

However with only one player at a time, you can have a few thousand circles thoretically. Depends on the server capabilty of course.

edit: Ahhhhhhhhhh you have resolution to 1 meter for the squares to... I thought it was just me being a n00b. No matter what I did the floating point calculations could not handle less than 1 metre resolution x,y co-ords for squares maths. I'd always get cracks between the polygons.
I can have less than 1 meter, but i write zone for this resolution. LFS have resolution of

1/65536 meter

For a circle, you need need calculation ( a2 + b2 = c2 ). Not for square, no need floating point calculation.

Tu use a path it's possible using a mix of node and a segment ( theorical path segment in the specified node, y = ax + b, each node have and a and b value ).

In this case, you locate the node where you car is and then calculate the minimal distance to the segement associated in this node.

But the big work is to determine all this segment for all tracks, i think zone is more easier

oh, your talking squares parallel to x & y axis. I see hahah.

I was talking about rotated squares/polygons on any point. Nevermind, just over complicating things on my end.
Exact, it's more quick and the error is not big enough.

LFSRelax use trigonetrical approach for the distance between 2 car.

if you have simple mathematical func to know the minimal distance between a point( your car ) and a segment in a node, you can make a great drift programm. But create the full segment for each track will be a big big work.

Perhaps Scawen can add a insim packet to know the distance between theorical path ( F4 display ) and the car. This simplify the drift scoring

Yes true in every way. I was just ranting about ways to do it if he was desparate.

I didn't realise you already have a zone event in LFSlapper now. That would be easiest solution for what he wants and quite accurate to judge drift angle & speed on certain apexes. Just put sqaures over the corners he wants to monitor. So, can lapper specifically trigger drift data in those zones?

If so, I think that would be good for what he wants, since I can't see someone investing loads of time in this for free, he might get what he needs easily with the current incarnation of lapper.
Well, the distance is not necessary, it's very easy to find out manually. Jason, as you said, LFS Lapper already counts angle*speed, so that would be possible, but only if the counts would be.. lower, smaller. To better understand - there's already existing a system called Pro1, which is used in D1GP. 75% is judged by automatic machines and the rest by humans. But the machines usually give points in a range like 0-60 or similar... The LFS lapper gives too high number. If the driver will earn something like 23719, then the humans judges are useless. For example there can be a driver who will do a run with perfect line, average angles and average speed, but then there will be another one who will do great angles, high speed, but his line and style will be totally lame. 1st driver should get higher score, but it will get the 2nd one, because judges have no chance to change it and it wouldn't be too good, if the judges should have points range like 0-5000 or some mega numbers like this. Hope you understood what was my point. Maybe if you could lower the numbers, then it would be nice. Range 0-60. The rest 40 is for style and line, which are judged by the human judges.

Hmm, with the distance it would be probably even better. speed*angle*distance_in_reversed(the more closer to the clone, the more is this number higher) = 0-60 range
Well that's an easy problem to fix, even with the current lapper drift point system. Use a constant multiplier as the scores are all relative and not to any scale really.

Say for example the lapper scores for each corner's drifts...


Then all you have to do is multiply each score when generated by a constant number that lowers the scores proportionally. IN this example I will choose 0.001

So then each score becomes..
(lapper multiplies each score by 0.001 before it outputs the score)


So the problem you are worried about is easily just solved with a multplier added to the drift score addon. I am pretty sure you can get Lapper to round down each final score so it removes the decimals before it prints them out.

Eh, yes, I'm really dumb . And format 27.00 is fine to me.

Can you tell me the formula how the LFS lapper exactly counts? Is it simply speed * angle? I'm driving 120 km/h in 30° angle so I should receive 3600 points per each second? Or how long is the update time?

There are 2 options. It can count only in the specified zone as somebody of you said, or it can count all the time, but if there's a possibility to include distance into the formula too, then it could count all the time and when going near the clippoint it can also count with the distance. I mean all the track will count like speed*angle and in the specified zone the formula will be speed*angle*distance(the more closer to the clone, the more is this number higher) and then back to normal formula...

And also you would have to remove the points reset when driver's speed is too low. Simply remove it and human judges will firm up if it was spin or not. If it was -> automatically 0 points. Hmm, but maybe LFS Lapper will solve it out itself, because when the speed is low, it influences the score, so it could be still ok, hmm. It needs to be tested practically.
Drift count code . Original Code by Monk. I have never change it.
One tick = 1/10 second

driftScore= absangle * speed * speed / 10000

on tolow speed, drift score reset to 0

double driftscoreinthistick = this.absangle * speed * speed / 10000d;

if (speed < minspeed)
this.driftticks = 0;
this.totaldriftscore = 0;
this.lastdriftscore = 0;
if (this.absangle > minangle && this.absangle < maxangle)
this.lastdriftscore += driftscoreinthistick;
this.totaldriftscore += driftscoreinthistick;
//System.Console.WriteLine(string.Format("DRIFT: {0} {1} {2} {3} score: {4}", this.UserName, this.NickName, this.UniqueID, this.ConnectionNumber, this.driftscore));
this.driftticks = 0;

Why is there twice speed and why is it divided by 10000?
Twice speed to award the high speed (proper speed) drifting with a better score. If not then you can cheat too easy and get big scores with boring slow fish tailing.

It's divided by 1000 in the Lapper source to lower the score so that you don't get scores like 3450000.

I'm not sure about Lapper scripting, but I think you can script in another /100 (divide by 100) to make the scores somewhere around the 0-60 mark you desire. Depends how large you make these square zones to register the drift as well, because that will reduce your drift scores as you wont be scoring as much.

Have you ever used or configured lapper before? You might have some reading up to do so you can work out how to configure the lapper to do what you want, like defining the apex areas, setting the minimum speed for a drift etc etc. Maybe someone will help you with this part.
Used, configured, but didn't look at the code, because I wasn't really interested in insim scripting, didn't understand it well when I tried it.

BTW the range 0-60 is no more needed, because you would have to do some specific options for every course, track, wouldn't you?
If your talking about the computer/auto scorer analysing each corner, then you still want a score between about 0-60 right for each corner?

Or is the 0-60 score total for the whole course? I dunno how they judge it sorry.

But what I suggest you do is this, trya nd do some tests and look at event zones for lapper, it's probably in the readme help file, never used it myself
Then try and make a zone on a corner, (a rectangle apparently according tho the Lapper developer) try something like a 20 meter across rectangle on a corner apex.
Then get the lapper to only score a drift when in that zone. - this is event zones at work, the event is the drift scorer counting points while you are in the pre defined zone. Something happens when you are inside the zone, and that something is scoring drift points.
Gai-Luron: can you confirm that enabling drift scoring only whilst in that rect. zone is indeed possible?

Then look what type of score you can rack up in that zone, you will probably find you can only get about 300 points if the zone is about 20 meters across.

Then get lapper to divide that score by 100 or whatever might be required before it prints out the final score for that drift. It's all configurable in lapper I think.
Zone event trigger only one action when entering in zone. Not along the zone. Maybe doing zone more restricted relative to apex and test speed and angle when entering in this zone. Maybe 2 or more contigus zone. To be tested! For now you haven't angle but try if zone correspond to your wish first. There is an example in the script for registering zone

By the way:
And no, I don't want any range anymore. I would have to change it on every course and it would be never exact.

EDIT: Well, I changed my mind, the US judge system quite sucks. I hope there's a different one in Japan.