It is currently Wed Sep 18, 2019 11:55 pm


[Tool] F1(4K) Track Generator (WIP)

Maybe you're a programmer and you've made some cool tool for TS. Share it here with all the other players.

Moderator: Forum Moderators

  • Author
  • Message
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

[Tool] F1(4K) Track Generator (WIP)

PostFri May 26, 2017 10:13 pm

We haven't heard from Mike and his replayer tool in a while so I guess I give you some news of my project. It is heavily work in progress so don't expect much.

I don't know how much time I have for development but you guys could give me some feedback whether this is something you could have use for or if it is waste of my time.

Notes:
Track creation has some problems mostly at connecting start and end points gracefully. Best to create many tracks so you get some that work ok.

Kerbs are also a bit buggy and placement is not always optimal. Just remember that all this is done by algorithms so quality is not the best.

No control points except start line and one random point in middle of the track so that you can drive laps. But you have to load and save track in editor first to get hash+pat file.

No pit yet as pit entry and exit roads need some work before they are in release condition.

Options are disabled but you can see what features I have planned to implement once track creation itself is decent.

Only plain grass background. Obstacles/enviroment objects and control points in plans for some day in (far?) future.

F1TGen.zip
Offline
User avatar

Will

Community User Level: 1

Community User Level: 1

  • Posts: 71
  • Joined: Sun May 17, 2015 11:25 pm
  • Location: Portugal

Re: [Tool] F1(4K) Track Generator (WIP)

PostSat May 27, 2017 10:06 am

That's... pretty cool! It also creates some interesting corners that we usually don't see. This has great potential not only for F1 but also all other categories!
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostSat May 27, 2017 12:00 pm

Oh, I didn't know such a crazy shit is possible! :shock: Sure, kerbs are a bit out of place sometimes, but if you manage to fix that, it will be very useful thing already.
I wonder if you could let us define each kerb position manually, because that's probably the only way to have them placed perfectly.

If not impossible, you could add parameters: kerb ID (ordinal number), kerb position (number of pixels starting from start line) kerb side (left/right), kerb length...

Another (much easier but less intuitive) trick would be that you generate separate png image of kerbs only, where they are fully loaded across the whole track and from both sides. Then we would combine two images as layers (track and kerbs) by PS and delete kerbs at places where they're not needed.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostSat May 27, 2017 2:35 pm

Whiplash wrote:Oh, I didn't know such a crazy shit is possible! :shock: Sure, kerbs are a bit out of place sometimes, but if you manage to fix that, it will be very useful thing already.
I wonder if you could let us define each kerb position manually, because that's probably the only way to have them placed perfectly.

If not impossible, you could add parameters: kerb ID (ordinal number), kerb position (number of pixels starting from start line) kerb side (left/right), kerb length...

Another (much easier but less intuitive) trick would be that you generate separate png image of kerbs only, where they are fully loaded across the whole track and from both sides. Then we would combine two images as layers (track and kerbs) by PS and delete kerbs at places where they're not needed.

I think I do the text editing version because with separate png image you also need pattern file and editing both would be tough?
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostSat May 27, 2017 3:28 pm

power79 wrote:I think I do the text editing version because with separate png image you also need pattern file and editing both would be tough?

Yeah, it would be a lot more of manual work.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon May 29, 2017 6:36 pm

New version is up:
-Improved track and kerb algorithms
-You can now choose if you want kerbs/pit (pit road is over simplified but at least its there)
-Other options are also implemented (if you choose multiple from one category then option is randomly selected):
-Background can now be grass/sand/snow
-Starting Grid can be up/bottom/left/right
-Driving direction clockwise/counter-clockwise
-You can choose kerb colors (with RGB values)

There is still all kind of small issues and I didn't test every combination but mostly I am happy at least to track shapes now. Sometimes it fails by having a loop but not very often.

Kerb placement is what it is. I start working that kerb editor next. But I would have liked more feedback from you guys. I could use some opinions what would be important options/features to have.
F1TGen.zip
Offline
User avatar

Mike Nike

Community User Level: 5

Community User Level: 5

  • Posts: 1131
  • Joined: Sat Oct 30, 2004 3:11 pm
  • Location: Germany

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon May 29, 2017 8:04 pm

First test: 5 tracks, MN_Power -> MN_Power_01 to _05 (as i hoped it would be called!)
-> result with kerbs and pits: not just 1 step better than the track generator work in progress i designed a longer while ago.

If there is anything i programmed that your tool does not have in a similar form yet, i am confident, you will manage to code it anyways. What that could be...min straight length, max length, min max curve angle, min/max amount of straights, min/max/avg tracklength (in seconds with car xy). So: overall: toughness of track and length in seconds could be an input as scrollbar 0-100% and +-20 to +-180 seconds or whatever (scrollbar or editfield/textfield).
Selfgenerated tiles/track objects or just using already existing ones - both is fine. Your stuff already looks cool and good enough, so we could theoreticly easily have endless fun - my fingers already hurt from thinking about it^^
It's summer though, 35 degrees...
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon May 29, 2017 9:11 pm

Hah, I already had great fun driving some tracks and I can tell this is already a very promising project. Kerbs are now placed much better.
Btw, these are problems I recognized and suggestions I can give:

Problems:
- That sand terrain isn't basically made to be base for any track. It doesn't have that big image like the other terrains have and that's why it looks bad (repetitive). That's why you should replace it by that orange sand, which has that big terrain tile. Maybe it would look better with some more random order though.
- I noticed that every curve where kerbs aren't placed aren't smooth enough. I wish you could somehow make them smooth too, even they're gentle and without kerbs.
- Kerbs look bad sometimes on start or end. That's cause they're cut just before one of their parts (those squares). Maybe there is a way to merge last two-three squares to be in one color, on both sides. I guess that way the kerbs would look better. Or you could find some other trick.
- Pit layout looks kinda buggy (those white lines are fucked up a bit)

Suggestions:
- I wish you could make more variety of curves. I miss some longer smooth curves, for example.
- You could include more tarmac patterns. For example, you can add 2 more just by making the current one a bit darker and a bit lighter. But you could also include some of those similar to what you can find on T's tracks. I guess you can find those on many different websites.
- You could make option for those tarmac layouts with parts which suggest repaired road (like on Sandopolis).
- And, yeah, having more options for kerbs layouts would be cool too.
- I wish you could include crossing tracks (with some bridges or tunnels) in the future.
- It would be nice to have option to chose what level of curviness we want tracks to have.
- Starting grid could also be placed in the center.
- It would be good to have 2-3 combined terrains for background (grass and sand, for example) - split by those smooth small round tiles.
- Every harder curve should have a sand bunker around itself.
- I'd like the tool to remember all my selected options, and to have a "reset" button.
- I wish you could make some algorithm for different types of obstacles. Also, I'd like to see some grandstands all around the track, forests, lakes, sea etc.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon May 29, 2017 10:57 pm

Ok, now that was a lot of suggestions, thanks Mike and Whip. I start working those in some random order. Progress will probably be slower from now on, though. Many of those suggestions might seem simple on paper but solving them require quite a lot of thinking. And oh yeah, I have to do that kerb editor too.
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostTue May 30, 2017 4:54 pm

Problems to deal with:
- You can see that track shape isn't smooth enough on edges. It's the most noticeable with snow background. I hope you could fix that somehow.
- Starting positions distance between 1-2 isn't the same as between 2-3 etc.

Suggetions:
- Option to chose whether to generate all tracks inside of one folder or inside of separated folders would be useful.
- Option to define the track shape/white line/extra tarmac width.
- Option to use custom colors for white line.
- Option to define number of starting positions (up to 40) and option to define starting positions shape (layout). I mean, apart of current shape, it could be useful also to have option for setting up all positions in one center line.
- The tool should also automatically set up those Tijny's distance signs for next curve (those 300,200,100 shits) on the proper side of the track direction and proper angle. They should be placed only after longer straights. Current F1 tracks are in proportion 1m = 3.5 pixels, so you can base it on that. It would be good to have custom distance option though - same goes for start positions distance.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostWed May 31, 2017 6:54 pm

Next patch is up.

Kerb editing:
1. "track_trackname.tda" and "kerbs_trackname.txt" files are now created with the track.
2. You can edit kerbs from "kerbs_trackname.txt" (format: kerb id|side|starting point|length|).
3. After editing use "Load Track" button to load "track_trackname.tda" file.
4. After loading, next track you create will have the same shape and use kerbdata from "kerbs_trackname.txt".
5. You can change other options for the track but don't change direction (clockwise/counter-clockwise) because then kerbs will get fucked up. If you want to have same shape with different direction, delete kerb file before loading so new kerbs are created with the track.
6. If you keep same name the old files/track gets overwritten (except kerb file).
7. You can only edit tracks with same version that they are created with. Otherwise shape might not be identical.

Other changes:
- Sand terrain changed

- Option to create all tracks in one folder (meaning only one folder created everytime "Create" button is pressed).

- If only one track is created there is no number attached to track name anymore

- Track shape option (Simple,Normal,Complex). Not much difference, just using different amount of data points to create track. On average Simple seems to give ~10sec faster/shorter tracks than normal and Complex gives ~10sec slower/longer ones than normal. Complex tracks probably fail more often.

- Increased curve variety. Now many curves are not as symmetric as I would like to so I keep working on this. But at least there's variety. Let me know if you like this model better than the old one.

- Some small fixes.


Again, I didn't do much testing (that's your job :lol: ) so errors might occur.

F1TGen.zip
Offline
User avatar

Will

Community User Level: 1

Community User Level: 1

  • Posts: 71
  • Joined: Sun May 17, 2015 11:25 pm
  • Location: Portugal

Re: [Tool] F1(4K) Track Generator (WIP)

PostThu Jun 01, 2017 12:49 pm

Great job Power!
Also, how hard it will be to generate the so called ' fun tracks', those short and wacky tracks we usually see on FC?
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostThu Jun 01, 2017 2:00 pm

Will wrote:Great job Power!
Also, how hard it will be to generate the so called ' fun tracks', those short and wacky tracks we usually see on FC?

My algorithm doesn't make intersections so that already limits FC track making a lot. Other than that I am not sure, but I have enough work with this F1 one for now. And I think making FC tracks manually is not as difficult as F1 tracks so there's not as much value to create them with a program. Plus FC tracks are made from default tiles, not drawing track image like F1.
------
I also made another small update to track shape algorithm. I think curves are now slightly better.
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostThu Jun 01, 2017 4:04 pm

I had a lot of fun testing this. You fixed the track shape edges really nicely - they're smooth like a baby's ass now. The main problems I'm noticing now are:
- Track shape smoothness. Very often track looks like somebody badly constructed it in some parts. Some small unnecessary turns look more like a design fails than a planned curves. I made two images for you with examples HERE. I wish you could somehow make those disappear.
- Starting grid is very often out of position (but I guess you didn't work on that seriously yet). I'm just saying that it would be good if every single position could be placed separately according to track edge and according to the position in front. That could allow you to have starting grid even going trough a curve (it should be optional though).

Btw, one sick idea... It would be really great if the tool could somehow read a custom-made track path (created by PhotoShop or some other way).
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostThu Jun 01, 2017 4:35 pm

Whiplash wrote:- Track shape smoothness. Very often track looks like somebody badly constructed it in some parts. Some small unnecessary turns look more like a design fails than a planned curves. I made two images for you with examples HERE. I wish you could somehow make those disappear.

Yes, I am investigating this. In theory my algorithm should only turn road in one direction between points but something obviously goes wrong in those situations.

- Starting grid is very often out of position (but I guess you didn't work on that seriously yet). I'm just saying that it would be good if every single position could be placed separately according to track edge and according to the position in front. That could allow you to have starting grid even going trough a curve (it should be optional though).

I just create starting grid to default place and then rotate it with the road as necessary. I guess the rotation doesn't work pixel perfect. But that's still low priority fix for me at this point.

Btw, one sick idea... It would be really great if the tool could somehow read a custom-made track path (created by PhotoShop or some other way).

Maybe from pat-file (palette colored png) where road is all one color I could read the shape from pixel data. But that's another feature that's have to wait until more important stuff is ready.

I think I focus now to get track shape in a good shape (hehe). So probably no updates for a while. After that next big thing would probably be obstacles and other enviroment shit.
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostThu Jun 01, 2017 4:57 pm

power79 wrote:Maybe from pat-file (palette colored png) where road is all one color I could read the shape from pixel data.

Ah, yeah, that would be a nice solution too.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostFri Jun 02, 2017 8:05 pm

Ok, I improved track creation again a little bit. It's not great but it started to get too complicated and whenever I solved one problem new one popped up. So it is what it is for now. I rather do polishing stuff later when I have implemented all main features for the tool. And it's never going to look as good as those hand(photoshop) crafted tracks so if you just lower your expectations these are ok for something that can be created in 5 seconds.

So I'll move to control points,obstacles and enviroment stuff, which I expect to be very difficult but hopefully not impossible. You guys should keep giving feedback/tips but no need to draw thousand arrows in one image to make a point. :lol:

F1TGen.zip
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostFri Jun 02, 2017 9:27 pm

Oh yeah, this is much better now. I can still notice some super-discreet curviness on long straights sometimes (mostly those where start is), but overall it's a good improvement.

I'm not sure if you planned it that way, but I hope you'll be able also to make pit lanes generated in the future too. I mean, it would be better than having few pre-made versions like the current one is. Seeing what you've already done, I'm sure you could make an algorithm for that too. I guess these are few elements to consider there:
- having a long straight line around 30 pixels wide in a random angle not too far from the main track.
- another 30 pixels line should follow that previous shape and it should have randomly generated extensions (paths) from both sides to the main track.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon Jun 05, 2017 7:30 am

Now tracks have simple corner obstacles and control points are also created.

I am not a real trackmaker so just throw some suggestions. But not anything too complicated, please. I know that Whiplash wants sand bunkers outside of corners instead of inside so I add that variety sometime later.

Next challenging task I focus is probably enviroment stuff so tips for that are also welcome. Then after that I start fixing and polishing all stuff that are unfinished.

F1TGen.zip
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2323
  • Joined: Sun Apr 19, 2009 4:57 pm
  • Location: Bosnia

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon Jun 05, 2017 3:07 pm

- Fix the IsWall terrains to have 0 rotation (trees, those fence circles, houses etc.). They don't match well with cars if they're rotated differently than 0.
- From another side, you can make those sand terrain circles to be rotated randomly each. That will make transition between them more smoother and less repetitive.
- Putting large groups of big trees away from track is a good way to fill up the landscape. Some house here and there is too.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon Jun 05, 2017 3:37 pm

Whiplash wrote:- Fix the IsWall terrains to have 0 rotation (trees, those fence circles, houses etc.). They don't match well with cars if they're rotated differently than 0.
- From another side, you can make those sand terrain circles to be rotated randomly each. That will make transition between them more smoother and less repetitive.

Those should be now fixed.

- Putting large groups of big trees away from track is a good way to fill up the landscape. Some house here and there is too.

Trees it is then. That should be pretty simple thing to do although I have already encountered number of problems with really "simple and easy" tasks.

I try to make things functional in most simple way first and then someday when I have time I can improve the actual quality of tracks.
Offline
User avatar

Tijny

Community User Level: 5

Community User Level: 5

  • Posts: 1514
  • Joined: Sat Nov 06, 2004 7:59 pm
  • Location: Netherlands

Re: [Tool] F1(4K) Track Generator (WIP)

PostMon Jun 05, 2017 5:10 pm

Looking good! A minor point of critique is that it's putting the obstacles way too close to the track in the faster turns. If you copied that style from Whip's tracks, don't, because it was bad there too. :)

edit: Oh, and I found a bug: in the generated pattern files, there are lots of holes between the kerbs and the road, which will cause those pixels to act as offroad terrain in the game.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostTue Jun 06, 2017 6:25 am

Tijny wrote:Looking good! A minor point of critique is that it's putting the obstacles way too close to the track in the faster turns. If you copied that style from Whip's tracks, don't, because it was bad there too. :)

I moved those obstacles a bit further from the road.

edit: Oh, and I found a bug: in the generated pattern files, there are lots of holes between the kerbs and the road, which will cause those pixels to act as offroad terrain in the game.

Good find! I had accidently made pattern road few pixels narrower than actual road. Fixed now.

F1TGen.zip
Offline
User avatar

Tijny

Community User Level: 5

Community User Level: 5

  • Posts: 1514
  • Joined: Sat Nov 06, 2004 7:59 pm
  • Location: Netherlands

Re: [Tool] F1(4K) Track Generator (WIP)

PostTue Jun 06, 2017 3:35 pm

Yep, the obstacles are much better like this. Nice.

I kind of wish there was a bit more variety in the type of turns it spits out. Almost all of the turns are currently based on perfect circles, but circular turns don't really flow that nicely because cars don't have a constant speed throughout. Another thing is that all the straights are completely straight (aside from the wobbliness on the home straight that Whip already mentioned), it would be cool if there was less of a clear distinction between "straight" and "turn", where it could produce slight bends even on the parts that are essentially straight. I understand if your algorithm isn't meant to support these things, but a man can dream. :D

I also had it crash on me a few times, seemingly random, like once every few full 20-track runs, when it tried to access memory location 0x00000000.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 463
  • Joined: Sun Dec 16, 2012 11:10 pm
  • Location: Finland

Re: [Tool] F1(4K) Track Generator (WIP)

PostTue Jun 06, 2017 9:58 pm

New update:

- Now tracks should not have any big failures (loops,overlapping roads,road going outside of screen).
- Using Tijny's distance signs.
- New option: You can have sand bunkers either outside or inside of (tight) corners
- Trees. Lots of trees.

F1TGen.zip

Tijny wrote:I kind of wish there was a bit more variety in the type of turns it spits out. Almost all of the turns are currently based on perfect circles, but circular turns don't really flow that nicely because cars don't have a constant speed throughout.
Another thing is that all the straights are completely straight (aside from the wobbliness on the home straight that Whip already mentioned), it would be cool if there was less of a clear distinction between "straight" and "turn", where it could produce slight bends even on the parts that are essentially straight. I understand if your algorithm isn't meant to support these things, but a man can dream. :D

Could you give me examples of turns and bends you would like to see?

I also had it crash on me a few times, seemingly random, like once every few full 20-track runs, when it tried to access memory location 0x00000000.

I haven't done many 20 track runs so maybe there is a memory leak or missing index checking somewhere. Almost impossible to debug with my messy code unless it's more frequent(reproducible) but I try to look thourgh the code.
Next

Return to Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron