Page 1 of 1

need help setting number of laps in a race

Posted: 04.09.2020, 05:53
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?

Re: need help setting number of laps in a race

Posted: 04.09.2020, 14:20
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

Re: need help setting number of laps in a race

Posted: 04.09.2020, 22:32
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!

Re: need help setting number of laps in a race

Posted: 06.09.2020, 02:13
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.

Re: need help setting number of laps in a race

Posted: 06.09.2020, 03:40
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

Re: need help setting number of laps in a race

Posted: 06.09.2020, 03:59
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

Re: need help setting number of laps in a race

Posted: 24.03.2021, 15:01
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).

Re: need help setting number of laps in a race

Posted: 24.03.2021, 15:23
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.

Re: need help setting number of laps in a race

Posted: 26.03.2021, 23:13
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>

Re: need help setting number of laps in a race

Posted: 27.03.2021, 11:22
by MaxX
The trick with the old version of track editor was also new to me, thanks for sharing =D>