Posts: 394
Threads: 38
Joined: Oct 2006
Reputation:
9
11-23-2006, 03:59 PM
(This post was last modified: 11-23-2006, 04:01 PM by Tjerk.)
This was taken directly from the GPLEA website:
Each LP-file contains X number of records [one for each "tick"] and each record has 5 fields of data. These are [in correct order]:
1) Longitudinal speed
2) Lateral Speed
3) Lateral Position
4) Yaw Velocity
5) Waypoints (or "flags")
If you convert an LP-file to text and open it in Notepad, the records will look like this:
1.9253, 0.0571, 0.1838, 0.0002, 16
This record shows that:
the car's speed is 154.024 mph. (80*1.9253 (value = meters per tick)
lateral speed is 0.0571 meters per tick (could be 4.568mph (i.e 80*0.0571)
the car's [center] position is 0.1838m to the left of the track center-line (positive value is always on the left-side)
yaw-velocity = 0.0002 radians per 1/36th of a second or tick.
the waypoint or flag to tell the AI that a long straight is ahead.
Wherever they say "tick" it translate to an ICR2 record. They seem to think that every record is for a length of time instead of length of track. But that seems odd to me considering you would need more records for slower .lp files which I don't think is the case in GPL. So we won't let that confuse us for the moment
Anyway, there is a formula in there for calculating the speed record, lateral speed record and position record.
But the values in their example DO look a bit different then the ones you posted in your Mosport problem post above. Is it possible that there is another way of converting the hex values to .txt ? Because when I open the Mosport race.lp file in the GPL AI Editor by Francois Dubuc the values for Mosport in the first record look like this :
speed: 1,2303 [98,4 mph]
corioles: 0,0065
lateral: 2,8488
You can find the GPL .lp edit tool on this page:
http://home.online.no/~bi-knu/editing/default.htm
Posts: 489
Threads: 13
Joined: Oct 2006
Reputation:
6
just a thought from someone who's never dealt with this stuff.........
if dividing by 65500 gives almost the correct number of records, has anyone tried dividing by 65536? 65536 = 64k (64 * 1024)....... maybe that's the divisor papy used?
Posts: 394
Threads: 38
Joined: Oct 2006
Reputation:
9
That is very much a possibility, however you also have to take into account the fact that you can not have 1283,5 records in a .lp file, you always need a whole number.
Posts: 75
Threads: 6
Joined: Oct 2006
Reputation:
0
Thanks Tjerk,
I now have all info I need to create the converter formulas!
However, if we do it to strictly we will endup with a icr2 ai driving as 1967 f1 car.
In the first record of mosport gpl we have a speed of 98.4 mph whislt in the icr2 ai version we have 107.65 mph.
Do you wish that I apply a increase factor to make icr2 ai faster?
it can be another set in the ini file.
Posts: 394
Threads: 38
Joined: Oct 2006
Reputation:
9
That sounds like a great idea ! I think only the race.lp, pass1.lp and pass2.lp would need that increase in speed. In fact, for most of the redone GPL tracks [the ones that came with the GPL2N3 converter] those were the only ones in need of some speed boost if I remember correctly.
Posts: 75
Threads: 6
Joined: Oct 2006
Reputation:
0
After open mosport gpl race.lp into LPedit I realize that the convertion from the Hex value fo longitudinal speed into mph is strange:
1st record = 98,4 mph
2nd record = 98,8 mph
3rd record = 100 mph
thefore to achive this result it seems that the formula uses not only the longitudinal speed value but one or more of the othe parameters (except the flag)
Does anyone has any idea?
thanks
fastwalker
1) Longitudinal speed
2) Lateral Speed
3) Lateral Position
4) Yaw Velocity
5) Waypoints
1) 2) 3) 4) 5)
1067285112 1003814388 1077301949 3100751639 0 0
1,2303 0,0065 2,8488 -0,0001 0
98.4 mph
1067325378 999089924 1077343473 0 0
1,2351 0,0043 2,8587 0,0000 0
98.8 mph
1067447013 988540410 1077371155 966609234 0 0
1,2496 0,0018 2,8653 0,0003 0
100 mph
Posts: 394
Threads: 38
Joined: Oct 2006
Reputation:
9
Errrm it all looks alright to me. At least when I understand the issue at hand correctly. If I open up Mosport's GPL Race.lp file in the GPL Lp Editor it tells me that the first three records have a speed of respectively 98,4/98,8/100 mph. So if you get those values in the ICR2 .lp file that is OK. Or do you mean that you can not get to those values by calculation ?
Posts: 75
Threads: 6
Joined: Oct 2006
Reputation:
0
11-28-2006, 07:22 AM
(This post was last modified: 06-08-2020, 05:24 PM by Tjerk.)
Yes Tjerk,
that's the problem. I cannot calculate the values solely from the first parameter. there is not a exact proportion. If I simply divide the papy value by the spped in mph I cannot get a exact factor as I get in icr2.
Thefore the other parameters in the gpl.lp must be used in the formula and I still cannot figure out how. If I simply could figure out how the LPedit turns the 1067285112 into a 1,2303 I could multiply that by 80 to obtain the value in mph...
1067285112 /98.4 mph = 10846393,41
1067325378/98.8 mph = 10802888,44
1067447013/100 mph = 10674470,13
Posts: 394
Threads: 38
Joined: Oct 2006
Reputation:
9
I have thought about this problem for a while and I don't think I can think of a real answer to your question. The first value of the GPL .lp file also looks a bit weird to me. The differences between them are so little and yet their ICR2 counterparts have considerable speed change from record to record. I think we should ask Francois Dubuc how the calculation is made if we can't figure it out ourselves [providing he is still around].
Posts: 27
Threads: 2
Joined: Oct 2006
Reputation:
2
yeah... the last part of this conversation went a little over my head. I should point out that your method for the panic files will work, but not all that well. when a car wrecks, it stops reading the lp and reads the trk. if the car wants to go again and finds itself outside the panic lines, it... well... panics, and causes big problems. Also, the better way to determine the pace lap line is to average the pass1 and pass2 lines in most cases. You might be able to just set a parameter in the ini for the pace speed.
Now, a good method for the panic files would be to read the wall dlat's in the trk file and use that. Which brings me to another idea which sounds a whole lot simpler to me, but probably not.
A simple program that makes a whole new lp from scratch using ini parameters similar to the tsd lines ope reads. Set the overall length of the trk in papy 500th's and let the program calculate the appropriate number of records and such on it's own. Anyway, you have the total length, you then set the dlong starting and ending values for a section of track. Set the dlat value for the lp for the start and end points. There's going to need to be an option to set the dlat transition as linear or sinusoidal. Several of these lines would take care of the position numbers for the lp. Another set of parameters set up the same way would do the speeds. I think the two would have to be done seperately. The yaw value can be calculated in lpedit 4.5 or if you know the function it uses, throw it in.
|