Track authoring question: s/f line location and distance around track

Hello,

I am trying to figure out how could I solve a pretty widespread problem with tracks where s/f line does not match distance around track beginning. So I wanted to ask a few concrete questions:

1. How does the game know where is s/f line located? That is the spot, where game counts lap as completed.

2. How does the game know where to begin counting distance around new lap? (In rF1 API it's called VehicleScoring::mLapDist). It starts with 0.0 and goes up to the track length, then rolls over to 0.0.
The problem is if roll over spot is not at the same spot where lap count is increased, it messes up many things in the game.

3. If I adjust any of the above, would I need to adjust AIWs?

My next step will be to google for AIW tutorials, but I thought it wouldn't hurt to ask for someone with experience to chime in :)

Thanks!
 
Last edited:
You've got start/finish line as a simple polygon that you place...on start line :D
You've got the same kind of polygon to set the 3 sectors.
Just open any TRK file with 3dsimed and you will see by yourself : it is a simple gmt which set start/finish position so no need to edit AIW :)
 
You've got start/finish line as a simple polygon that you place...on start line :D
You've got the same kind of polygon to set the 3 sectors.
Just open any TRK file with 3dsimed and you will see by yourself : it is a simple gmt which set start/finish position so no need to edit AIW :)
Thanks :)
Do you happen to know if positioning of those polygons affects SC logic/rolliing start? I read somewhere that SC has to be strictly before s/f line, and if it isn't, I'll have to adjust where it is, and that AFAIK is in the AIW, right?

Also, it looks like those polygons are separate .gmt materials. If I put modified .gmt in the track folder, will game pick it up, or do I need to put it into Teams? Or maybe, it only reads that from .trk?

Lastly, I suspect that where new lap begins (not for timing, timing is by polygon) is probably coming from AIW. Is it difficult to shift the whole AIW 150meters forward? The core problem I am trying to fix is that lap begins 150meters before xfinish.gmt. I will try moving xfinish.gmt, but I suspect this might cause issues with rolling start/SC phase.
 
Last edited:
No you don't need to bother with aiw at all.
Tracks work like cars in 3dsimed so you put gmt in track XXXX.GTR file.
Easy way for you is to duplicate start/finish gmt, rename it drs1.gmt, open it in 3dsimed to change material name as TIW_DRS1_IN then export it to save new name, open your track in 3dsimed, add your drs1.gmt and place it where you want on track, then you can add other gmt to define your drs zones IN/OUT, in the end export all your track gmt : now keep only your drsxxx.gmt and drop them in the corresponding track folder, nearly the end, open track .TRK file with notepad and add instance lines with your drsxxxx.gmt, save, and finished :)

Yes safety car position is set in AIW at grid 103 and team 51 but you don't need to worry about SC to add your DRS zones.
 
Last edited:
No you don't need to bother with aiw at all.
Tracks work like cars in 3dsimed so you put gmt in track XXXX.GTR file.
Easy way for you is to duplicate start/finish gmt, rename it drs1.gmt, open it in 3dsimed to change material name as TIW_DRS1_IN then export it to save new name, open your track in 3dsimed, add your drs1.gmt and place it where you want on track, then you can add other gmt to define your drs zones IN/OUT, in the end export all your track gmt : now keep only your drsxxx.gmt and drop them in the corresponding track folder, nearly the end, open track .TRK file with notepad and add instance lines with your drsxxxx.gmt, save, and finished :)

Yes safety car position is set in AIW at grid 103 and team 51 but you don't need to worry about SC to add your DRS zones.
I have a very basic question: I have a .gmt with a polygon. How can I move it in space? I normally do translate, that seems to adjust the pivot point. But I wonder if I can adjust all vertices in the polygon somehow at once? Thanks again! :thumbsup:

EDIT: translate works.
 
Last edited:
No you don't need to bother with aiw at all.
Tracks work like cars in 3dsimed so you put gmt in track XXXX.GTR file.
Easy way for you is to duplicate start/finish gmt, rename it drs1.gmt, open it in 3dsimed to change material name as TIW_DRS1_IN then export it to save new name, open your track in 3dsimed, add your drs1.gmt and place it where you want on track, then you can add other gmt to define your drs zones IN/OUT, in the end export all your track gmt : now keep only your drsxxx.gmt and drop them in the corresponding track folder, nearly the end, open track .TRK file with notepad and add instance lines with your drsxxxx.gmt, save, and finished :)

Yes safety car position is set in AIW at grid 103 and team 51 but you don't need to worry about SC to add your DRS zones.
To be precise, this is not for DRS. DRS zones will not go into track (good idea if ISI/SimBin were to do that, not my tiny guesswork plugin) - there will be a satellite file (similar to .cchdc/.ccrs files). DTM DRS will not need track modifications (because rules allow engaging DRS everywhere), but F1 DRS will need visual boxes on track and that will be up to the community to do such modifications.

What I am doing here is a bit different. I was investigating a SC bug where game told me "you are ahead of SC" even though I was behind. I figured out that that was caused by the mismatch of xfinish and the lap start. This is track issue, and quite a few tracks are affected, so I wanted to learn how to fix it for my own use (it causes many problems, not just SC problem above).
 
Last edited:
I would say that the Start/ Finishing line are an instance like pretty much most or all GMt's
It is called Xfinish.gmt
When the car passes that instances the lap counts up or if last lap in a race finish the race.

The distance counter are coming from the AIW file and a lot of tracks do no have 0.0 at Start/ finishing line as you have found out . As that is not needed for the aiw to work.

Changing aiw files to start at S/F will be a major undertaking.
You can get the coordinates from 3DSimed of the S/F gmt then go in the aiw file and find the closest waypoint calculate the offset and change all waypoints numbers for the track and also for pitlane WP connections to the Track WP.
Recalculate lapdistace in the wp_Score
And then move the gridindex's and teleport indexes coordinates accordingly. so they are behind the the new S/F line.


Not sure what it messes up but you could make a new internal lap distance counter by recording when the lap counter changes it's value and use the lap distance at that moment as the Lap distance offset like -150 meters .
Would not be 100% due to the update rates in the telemetry and I think the scorings info are even slower?
But you should be able to find when the car passes XFinish.gmt in the address space.
 
I would say that the Start/ Finishing line are an instance like pretty much most or all GMt's
It is called Xfinish.gmt
When the car passes that instances the lap counts up or if last lap in a race finish the race.

The distance counter are coming from the AIW file and a lot of tracks do no have 0.0 at Start/ finishing line as you have found out . As that is not needed for the aiw to work.

Changing aiw files to start at S/F will be a major undertaking.
You can get the coordinates from 3DSimed of the S/F gmt then go in the aiw file and find the closest waypoint calculate the offset and change all waypoints numbers for the track and also for pitlane WP connections to the Track WP.
Recalculate lapdistace in the wp_Score
And then move the gridindex's and teleport indexes coordinates accordingly. so they are behind the the new S/F line.


Not sure what it messes up but you could make a new internal lap distance counter by recording when the lap counter changes it's value and use the lap distance at that moment as the Lap distance offset like -150 meters .
Would not be 100% due to the update rates in the telemetry and I think the scorings info are even slower?
But you should be able to find when the car passes XFinish.gmt in the address space.
thanks - it does not mess my plugin (well, it complicates some things, yes), it messes up the game logic pretty badly - just think about it - for 150 meters game thinks you are ahead of someone ahead of you. Same for AI. But it also affects other things. I was thinking about the new lap counter, but it is going to be invasive, and it is best to avoid changes to workaround content bugs. But maybe one day, we'll see.

One potential solution is to shift AIWs in memory by the set value in a workaround parameter (plugin could print a warning if distance between lap start and xfinish is significant, and print the exact offset needed) but I don't understand AIWs enough yet.

If I keep AIW as is, and move xfinish back ~150 meters, what do you anticipate will break? What would be the effect of some gridindexes/teleport indexes now being in front of S/F? Just thinking aloud - maybe cheapest change is to move xfinish in space and move grid/teleport stuff back.

In any case, a lot to think about - thanks for sharing the knowledge.
 
Last edited:
Spent a bit of time tonight trying to solve this problem but without much progress.

* I was able to move xfinish in space, but for some reason it did not affect at which lap distance lap got counted, almost like it had no effect.

* I think AIW can be fixed up by script, and I wrote a script that shifts wp_score lap distances by a set value, and fixes sector numbers, but game crashes and I can't see anything wrong with the generated file. I think there's probably much more needs adjusting, but I am not familiar enough with AIWs.

It feels like solution is close, but. For fun, I checked out a verified method for fixing the problems - just downloaded another (older) version of the same track. And, that one while does not look as good as the is not affected by origin mismatch problem :)

EDIT: Actually, script worked on Anderstorp South, I was able to shift waypoints 150 meters in both directions. Not sure if there are regressions, but will test more tomorrow and will try running on the actual track I was not happy with. Thanks for pointing me wp_score way Bjarne, this might actually work!
 
Last edited:
So I was able to write a script that reliably adjusts any AIWs wp_scoring by the desired distance. However, it is more complicated than that. When I applied that to the track I tried to fix it broke the Rolling Start (probably the whole offset thing is done to somehow fix SC). So I am stuck for now, but I learned a lot, which is good.

One thing I'd really like to understand why moving xfinish in space seemingly has no effect. @GTR233, can you spot any bug in my workflow?

* Open .trk in 3DSimed
* Find object by name "xfinish"
* Open "xfinish"
* Translate "xfinish" in space by the desired offset
* Export "xfinish" as xfinish.gmt to Track folder
* Close and reload .trk (Is there a way to make it reload updated .gmts?)
* See that "xfinish" polygon is indeed in the new location in 3DSimED visually

Moving xfinish does not seem to change where the new lap is counted by the game. But I suspect maybe I am not doing it right. One thing that is suspicious to me, 3DSimED shows xfinish Pivot adjusted by offset, not the pos itself.... I wonder if that's wrong. Thanks in a advance.

EDIT: Actually, I figured out how to fix this purely via AIW, it is what Bjarne was saying but took a while to sink in. In addition to wp_scoring shift, Grid/Teleport has to be re-done, but is kinda tricky to it in a scripted way because of elevation change on s/f line. But once I manually moved p1 and SC all works as it should. Still would be curious to learn how to properly move xfinish.
 
Last edited:
In 3dsimed :
- open trk
- hide skyboxi
- right click on xfinish polygon then left click objects>xfinish
- panel on right is opened : edit coord x,y values as you wish then click on green "checked" button
- on top bar click export gmts : create a temp folder
- pick your new xfinish.gmt from temp folder and drop it in your original track folder
- close 3dsimed and re-open it with your trk and the xfinish must be updated

Note that some tracks have several layouts with different xfinish position, in this case you must either drop gmt in corresponding subfolder or use geditor to add your updated gmt in corresponding
GTR file.

By the way I had to fix both AIW and xfinish.gmt in Magione/Mugello/Vallelunga for hq 2005 mod because of safety car bug in original tracks :)
 
Last edited:
By the way I had to fix both AIW and xfinish.gmt in Magione/Mugello/Vallelunga for hq 2005 mod because of safety car bug in original tracks :)
Thanks for the instructions :) I will try moving xfinish, but I suspect it won't be enough (will break other things), and for that track I am messing with real fix is to shift wp_score which I did, and redo the grid, which I am not sure how to do quickly.

Out of curiosity, do you remember what was the issue with those tracks?

Lastly, could you tell me what is the difference between grid and teleport positions. Thanks a lot man, GTR233 to the rescue as always :)

EDIT: moving xfinish Your way seemed to have worked and fixed the track!
 
Last edited:
Back
Top