gpl to icr2 AI converter
#1
Hello Tjerk and Mistycreek,

Do you rember the steps that you have suggested for the convertion of lp files?

thanks,
Fastwalker
Reply
#2
I will need to check my notes again Smiley Today I did get rid of my .lp file anxiety somewhat because I was able to make completely working .lp files for my newest track within an hour. I got the right amount of records in the first try by dividing the track length in 500ths by 65500. I suspect you use a slightly different number ?

The new track will be uploaded as soon as I have some camera's and track screens for it because it already races like a charm. It is a track that we will likely be racing in the IIRS Winter Series Roadcourse Series but it is not St. Jovite... Okay, I'll just tell you...It's Brainerd Smiley Then it is on to St Jovite and Watkins Glen 2005 because they both need new .lp files as well.
Reply
#3
1. First the tool should open the ICR2 <track>.trk and read the length of the track in papy units as defined in the header. I myself divide that number by 65500 to get to the desired number of records needed for the ICR2 track.

Well we established that the GPL .lp files contained some 10% more records than their ICR2 counterparts. I came to that conclusion after studying a couple of tracks that are available in both sims. So we need to find a way to get rid of those extra records without harming the lines that the cars take. Taking away every tenth or so will work to a great extent although it will leave us with a couple records short or a few too many.

2. So the second step in the program should be to read the number of GPL .lp records and compare it with the number we got at step 1. As before I still don't know how to calculate but after that are what computers are for Wink2 Some formula should be able to be determined.

3. It deletes all the excess records in such a way that we get to the desired amount and the AI lines do not get harmed a lot and writes the new ICR2 .lp files.

But then we only have the following files:
Race.lp
Pit.lp
Maxrace.lp
Minrace.lp
Pass1.lp
Pass2.lp
I presume they have the same functions as the ICR2 versions.

So then we still need the following files:
Maxpanic.lp
Minpanic.lp
Pace.lp

4. These could probably be made by doing the following:

A. The Maxpanic.lp file could be made by copying the Maxrace.lp and adding a couple of feet to the line to move it outward some more.

B. The same goes for the Minpanic.lp.

C. The Pace.lp could be made by calculatin the middle line between the Maxrace.lp and the Minrace.lp to get a line exactly through the middle of those files and hopefully in the exact middle of the racing surface. I'm not too sure how you could calculate speed for this file but maybe the Race.lp and the Maxpanic.lp files could be compared, a speed in the middle of those speeds will work nice I think. Though that might be a tad on the fast side on some tracks [although I personally have come to appreciate the faster pace laps Wink2

I think that is about it but I am sure Mistycreek will have his own opinions about this.
Reply
#4
Thanks Tjerk,

I have save the above info in the project folder. just in case you mess up the forum again ;-)

the first phase will be to convert the:
Race.lp
Pit.lp
Maxrace.lp
Minrace.lp
Pass1.lp
Pass2.lp

then:
Maxpanic.lp
Minpanic.lp

and finaly the pace.lp.

I will keep you upadeted of my progress.
Reply
#5
Hi folks,

I found that in case of short tracks AI can have a strange behaviour or even crash the game if I use the NumberOfAIrecords = trklength/65500. Therefore I have decided to provide a max and min value for .lp files. But not sure if a formula applies here or whether we should simply add or remove records. Have anyone had to use a different values from the above formula in scratch build tracks. In case of my Rodland track I have added to records to the calculated value.

My idea is to read the number of records in gpl.lp and subtract the number of icr2.lp records which were calculated with the above formula. This will give the number of lines that the tool will have to remove from the gpl.lp files.

I am at beginning of coding and tool can extract the following info so far:

(excerpt of generated log.file)

.lp convertion details:
-----------------------
track length : 38477098 papies
track length : 1.2144 miles
track length : 1.9546 kilometers

Suggested AI min number of records : 587 (recomended)
Suggested AI max number of records : 589
Reply
#6
Maybe the tool could use the calculated number of records by default but an .ini file of some sort where you can override that number. So that if the tool puts out files with 1283 records at first but this does not work you could then tell it to try 1284 or 1282 for example.

To prevent you from using an .ini file from before by accident maybe the tool could announce the values calculated and the values from the .ini [if any] before converting the .lp files.

So with no value in the .ini it could say :
Number of calculated records: 1283
No lp.ini file found [or, lp.ini file found, no records specified]
Press Enter to start making .lp files with 1283 records...

Or if you use an .ini file it could say:
Number of calculated records: 1283
Lp.ini file found, number of specified records: 1282
Press Enter to start making .lp files with 1282 records...
Reply
#7
Tjerk, you got AI working for St Jovite and Mt Tremblant. What did you do to it? I mean, I told you Solitude was working through the converter, but that is for simple reason, it was already included.
IIRS Driver Champion (2005-2007, 2010-2014)
IIRS Team Champion (2004-2014)
Reply
#8
I have written a tutorial about the whole proces I am currently using that is going to be uploaded here soon but in a nutshell it is this:

1. I calculated the number of records for both tracks by my own method of dividing trk length by 65500.

2. Then I started LPedit and made empty .lp files with that number of records, then saved both the .lp and the .txt files.

3. Then I made replays for all the .lp files and converted them to Lpedit .txt files using Trafo.

4. Replaced the empty .txt files in the lpedit folder of the track with my new ones from step 3.

5. Started Lpedit and pressed T for loading the .txt files, pressed Enter to save that data to the .lp files.

6. Tested and it didn't work. Not enough or too many records.

7. So then I used Fastwalker's lp2txt and txt2lp to convert back and forth from .lp to .txt each time adding one or two records. This got me to the correct number of records within a maximum of three tries for each of the tracks.

But for Brainerd I accidentally swapped left and right dependant .lp files and it took a while before I realized that that was the problem and not the number of records. There is a difference though, when the record number is off then the game will crash within a second on my computer, when some of the files are swapped then the cars will just behave very weird, go from left to right and such but generally the game will not crash or it does so after a longer time.

All in all I can now get new well behaved AI within a good hour when it is not too long a track. For both Brainerd and Mont Tremblant that was about the time it took.
Reply
#9
Tjerk Wrote:Maybe the tool could use the calculated number of records by default but an .ini file of some sort where you can override that number. So that if the tool puts out files with 1283 records at first but this does not work you could then tell it to try 1284 or 1282 for example.

To prevent you from using an .ini file from before by accident maybe the tool could announce the values calculated and the values from the .ini [if any] before converting the .lp files.

So with no value in the .ini it could say :
Number of calculated records: 1283
No lp.ini file found [or, lp.ini file found, no records specified]
Press Enter to start making .lp files with 1283 records...

Or if you use an .ini file it could say:
Number of calculated records: 1283
Lp.ini file found, number of specified records: 1282
Press Enter to start making .lp files with 1282 records...

That's great idea Tjerk!
I think it will not take long before I have a beta version.
Reply
#10
Hi Tjerk,

I came across the following issue when testing the converter with mosport:

I realize that gpl race.lp is different from ic2 race.lp.

icr2 .lp record has 3 values: speed, coriolis and position

whilst gpl .lp has 5! : speed coriolis, position, yaw velocity and waypoints
The point is that in gpl the values seem to use different convertion formulas.

in icr2 we have:
1st parameter/588.23 = speed in mph
2nd parameter/1000 = coriolis
3rd parameter/5882.37 = position from center line in ft

in mosport first record of icr2 race.lp we have
(63324) 107.65 mph , 120(0.12), 64235 (10.92 ft)

in gpl race.lp first record we have
1067285112 1003814388 1077301949

therefore I don't which formula to apply to convert the 1st 3 parameters. Do you have any idea?

BRs,
Fastwalker
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)