need help setting number of laps in a race

Here you can present your WIP or new cars and/or stuff you made for GP2
Post Reply
User avatar
samsepi0l
GP2 Racer
Posts: 301
Joined: 01.03.2019, 01:39

need help setting number of laps in a race

Post by samsepi0l »

I am trying to correct the number of laps in the old RIO track i downloaded. In real life, they raced 61 laps here. I have found that this track works best in slot-5 (which is the original spain). I use GP2LAP so normally GP2 sets the number of laps correctly when i place a fan-made track into a slot, but for some reason it keeps coming up as 63 laps when I go into the game. I opened the track in track-editor, and went into the track info (gp2info) and changed the number of laps to 61, but when I raced there it still came up with 63. Is this listed somewhere else in the track file that I should be modifying it? I know I can just run gp2 without gp2lap and change the number of laps with gp2edit, but I shouldn't have to do it that way right?
User avatar
rremedio
GP2 Legend
Posts: 1559
Joined: 14.01.2007, 15:05

Re: need help setting number of laps in a race

Post by rremedio »

There is a common bug in the track editor that makes it save the GP2INFO section twice. Then when it try to change it saves correctly but the "extra" section is not deleted and it creates confusion for GP2Lap.

It is easy to check by opening the .dat file in Notepad. You will see some repeated info.
trackeditorbug.png
To fix it, I open it in a hex editor, replace the duplicated parts with a bunch of "EF"
trackeditorbug2.png
trackeditorbug3.png
Then I save the track. Open it in the Track Editor, save it again to rebuild the GP2INFO section and fix checksums. Opening it again in the hex editor we can see that it fixed the GP2INFO section and now GP2Lap will correctly follow the number of laps set by you.
trackeditorbug4.png
"The Fox provides for himself. but God provides for the Lion"
Image
Early 90s F1 forever!
User avatar
samsepi0l
GP2 Racer
Posts: 301
Joined: 01.03.2019, 01:39

Re: need help setting number of laps in a race

Post by samsepi0l »

rremedio wrote:
04.09.2020, 14:20
There is a common bug in the track editor that makes it save the GP2INFO section twice. Then when it try to change it saves correctly but the "extra" section is not deleted and it creates confusion for GP2Lap.

It is easy to check by opening the .dat file in Notepad. You will see some repeated info.

To fix it, I open it in a hex editor, replace the duplicated parts with a bunch of "EF"

Then I save the track. Open it in the Track Editor, save it again to rebuild the GP2INFO section and fix checksums. Opening it again in the hex editor we can see that it fixed the GP2INFO section and now GP2Lap will correctly follow the number of laps set by you.
trackeditorbug4.png
Awesome solution! I will give it a shot. thank you!
User avatar
samsepi0l
GP2 Racer
Posts: 301
Joined: 01.03.2019, 01:39

Re: need help setting number of laps in a race

Post by samsepi0l »

I'm having some problems.

Here is the track in notepad:
Image

Here is the track in the hex editor.
Image

I'm not sure which addresses to change to EF. It looks like the number of laps is set to 61 (which is what i want), however when search for another instance of 63 (which is incorrect) I can't find it.
User avatar
rremedio
GP2 Legend
Posts: 1559
Joined: 14.01.2007, 15:05

Re: need help setting number of laps in a race

Post by rremedio »

I can't really tell for sure and I couldn't reproduce the problem with that version of the track.

I would replace all the bytes marked in red in the following image with EF for the sake of testing. If it doesn't work, maybe you can attach that .dat file here. I'd like to check it.
trackeditorbug5.png
"The Fox provides for himself. but God provides for the Lion"
Image
Early 90s F1 forever!
User avatar
samsepi0l
GP2 Racer
Posts: 301
Joined: 01.03.2019, 01:39

Re: need help setting number of laps in a race

Post by samsepi0l »

rremedio wrote:
06.09.2020, 03:40
I can't really tell for sure and I couldn't reproduce the problem with that version of the track.
You know what, you won't believe it.... I re-loaded the track, went into gp2 with gp2lap and the problem was gone. 61 laps right like I changed it. Strange. Either I am getting old and foolish or this was just a strange thing. I can't explain it! But thank you for your suggestion, I did learn a little from it. :D
eky78
GP2 Gamer
Posts: 178
Joined: 05.02.2012, 12:15
Contact:

Re: need help setting number of laps in a race

Post by eky78 »

Thanks for this topic I´ve solved the same problem with another track.
Is there any way to use the hex editor to "recover" the tracks we can´t open anymore with the track editor? or at least if it´s possible to change the number of laps with the hex editor (obviously I´ve tried to change the number manually but doesn´t work).
User avatar
rremedio
GP2 Legend
Posts: 1559
Joined: 14.01.2007, 15:05

Re: need help setting number of laps in a race

Post by rremedio »

eky78 wrote:
24.03.2021, 15:01
Thanks for this topic I´ve solved the same problem with another track.
Is there any way to use the hex editor to "recover" the tracks we can´t open anymore with the track editor? or at least if it´s possible to change the number of laps with the hex editor (obviously I´ve tried to change the number manually but doesn´t work).
Most tracks I have problems opening with the latest version of TE work with this older version of the editor.
te_antigo.rar
(603.07 KiB) Downloaded 350 times
If you make any changes with a hex editor, you need to fix the track checksum in order for GP2 to accept it. TE does that just by opening and saving a track, but if it doesn't open, you can try using GP2 Checksummer for DOS (from the Old GP2 Editors page) or another program that saves tracks with the correct checksim. I believe Ale's Pit&Lap Editor will do that, but I'm not sure.
"The Fox provides for himself. but God provides for the Lion"
Image
Early 90s F1 forever!
eky78
GP2 Gamer
Posts: 178
Joined: 05.02.2012, 12:15
Contact:

Re: need help setting number of laps in a race

Post by eky78 »

I had problems to use that program, but with your second suggestion it worked!
So once again, thanks for the help! =D> =D> =D>
User avatar
MaxX
GP2 Star
Posts: 1073
Joined: 28.02.2007, 11:41
Location: Salzburg, Austria

Re: need help setting number of laps in a race

Post by MaxX »

The trick with the old version of track editor was also new to me, thanks for sharing =D>
Post Reply