FAQ  •  Login

How to build Custom Tracks

<<

Der Bayer

User avatar

15-Star Beta Tester
15-Star Beta Tester

Posts: 1344

Joined: Tue Sep 20, 2011 1:34 am

Location: Karlsruhe, Germany

Cars: Seat Ibiza 6L 1.4

Post Wed Apr 02, 2014 3:13 am

How to build Custom Tracks

Custom Tracks

Hey guys,
today I want to explain to you how to make custom tracks for the Automation Test Track Simulation. Basically you don't need a lot of programming skills, it's just fiddling around with numbers. First I want to give a quick overview over the format of the track files and then talk about the different parts more in-depth. So let's get started!

Track File Format

Custom Track folders are placed in Documents\Automation\Tracks (Standalone version) or Documents\My Games\Automation\Tracks (Steam version). The folder contains two files: a .lua-file with the definition of the track and a shiny background image (.png). You can name the folder how you want, but the files in the folder have to be named "track.lua" and "track.png". The .lua-file can be openend with Notepad or with for example Notepad++ (recommended, Freeware). .png-files can be created with almost every common picture editing software.

This is how the definition of the example custom track (attached at the bottom of this post) looks like:
  Code:
--Example Track

--You Can use 0, 1, -1 instead.
local STRAIGHT = 0
local LEFT = 1
local RIGHT = -1


Track =
{
   Name = "Example Track",
   --Track Image Info
   --Track Image must be 1280 x 720
   --Start Position on the Image x,y from Top Left
   Start = { 530, 530 },
   
   --How many pixels per meter ( Pixels / Length )
   --Measure a long straight and then manipulate from there
   Scale = 20 / 10,


   Layout = {         STRAIGHT,   STRAIGHT,  LEFT,   STRAIGHT,  LEFT,   STRAIGHT,  STRAIGHT,  STRAIGHT,  LEFT,  STRAIGHT,  LEFT,  STRAIGHT},   -- Straight 0 , Corner Left 1, Corner Right -1
   LayoutInfo = {      100,       100,       90,     100,       90.5,   100,       100,       100,       90,    140,       90.5,  100},      -- Straight Length [m] or Corner Angle [°]
   CornerRadius = {    0,         0,         40,     0,         40,     0,         0,         0,         20,    0,         20,    0},         -- Corner Radius [m], 0 for Straight
   Slope = {          -3,         -1.5,      0,      0,         0,      3,         1.5,       0,         5,     0,         -5,    0},         -- [%] (-: descending, +: climbing)
   Sportiness = {      1,         1,         2,      1,         2,      2,         3,         3,         4,     3,         5,     2},         -- 0: no problems, 5: problems with untame car
   Camber = {          0,         0,         5,      0,         10,     0,         0,         0,         0,     0,         0,     0},         -- [°] (positive values: banking to left /, negative: banking to right \)
   Split1 = 312.8,
   Split2 = 725.6,
}


Don't change anything up to line 10 (except for comments, after "--"), that's the header of the file. In line 11, you can set the in-game name of the track (how it will appear in the custom tracks list). Lines 15 and 19 are important for how the animated car will move around the track. Lines 22 to 29 contain the track definition.

Animation Settings

These settings have to be adjusted to make the car move around exactly on the background image (1280x720 pixels) of your track. You can set the scale (in pixels/meter) and where the car starts (in pixels). Both values can be measured and calculated from the background image (and maybe have to be tweaked slightly afterwards). So the most important thing for this is an accurate background image. If you start with the background image and build your track on top of that or if you first build the track and draw it afterwards is up to you. The second way might be the easier one for generic tracks, the first one the way to go for recreating real world tracks.

Track Definition

Here you can build the driving line of the car around the track and some other track characteristics. The track definition doesn't have to result in a closed loop, so you can build rallye stages if you want.
  • You make the driving line out of segments which can be left or right corners and straights. Put them in words or in numbers (1=LEFT, -1=RIGHT, 0=STRAIGHT) one after another into the first line of the track definition. Make sure you start and end with a straight. More than one straight or more corners may be put after one another.
  • In the second line you define the length of the straights (in meters) and the angles of the corners (in degrees). This defines only the 2D-projection of the track, so you don't have to bother with how long a sloped track segment really is when driving over it. Just define the track out of the bird-view.
  • The third line contains the corner radii (in meters). Put in a 0 for straights (although the corner radius of a straight is ∞ in reality). After that, the 2D-projection of the track is complete.
  • In the fourth line you define the slopes of the segments (in percent). The simulation automatically will calculate the actual, 3D length of the track segments. Don't make slopes too steep or low-powered cars won't be able to make it around the track resulting in errors.
  • The fifth line is for defining how difficult to drive the segments are. Put in values from 0 to 5 (0: easy, 5: hard). You can imagine that this is the bumpiness of the track. The simulation looks at these values and punishes cars with a high sportiness/tameness ratio. So on some tracks, insane cars with 2 MW might be slower than actually controllable cars.
  • The sixth line defines the camber or banking of the track (in degrees). This is for the oval lovers. Negative numbers make it banked to the left (/) and positive numbers banked to the right (\) when you are facing in driving direction. Values up to 45 degrees should be fine, use everything above at your own risk.
  • The last two lines contain the location of the sector time measurement. Put in the distance from the start line (in meters) for the two locations. Note that you need the distance in 3D (not the 2D-projection) here. But these values can be tweaked easily after you have the complete driving line definition running in the game. Just make sure that the values are smaller than the overall track length.
The driving line is calculated in steps of 0.2 meters. This means that there can be some minor deviations in the driving line compared to your design on paper. For example, if you want to build a 90 degrees corner the simulation can step out of the corner at 90.1 degrees. You might have to tweak some values (especially after adding slopes) to reduce those small differences.


That's basically it! If something remains unclear feel free to ask! I just have one last note for programmers in the community:

It is extremely helpful if you can build the tracks in an external program before you import them into Automation. This saves a lot of time you would spend on watching if the car does what you want. If anyone wants to program a tool for that, you can contact me via PM for some help. I already have a working track plotting MATLAB script which could be converted pretty easily into C++ (but not by me). I also have a (pretty bad) random track generator in MATLAB code. If anyone wants to do something similar and wants to take a look at my approach, ask me! :)
Attachments
example_track.zip
(123.04 KiB) Downloaded 982 times
Image
<<

nialloftara

User avatar

Supercharged
Supercharged

Posts: 1983

Joined: Wed Feb 05, 2014 2:07 pm

Location: Northeast USA

Cars: 2006 Scion Xb

Post Wed Apr 02, 2014 4:26 am

Re: How to build Custom Tracks

Will yaw, body roll and weight transfer play a part in cornering and bump handeling? Or just max G?
Chief designer and CEO, Centauri motor works, Centauri Performance Vehicles (CPV)
"Centauri: The Stars Are Within Your Reach."
Centauri engines Centauri cars
CPV engines CPV cars
Company ID: 1943047
<<

Der Bayer

User avatar

15-Star Beta Tester
15-Star Beta Tester

Posts: 1344

Joined: Tue Sep 20, 2011 1:34 am

Location: Karlsruhe, Germany

Cars: Seat Ibiza 6L 1.4

Post Wed Apr 02, 2014 4:31 am

Re: How to build Custom Tracks

Body roll and weight transfer are considered in the max. G calculations and in acceleration and braking. I don't know what exactly you mean with yaw, the car does steer, yes. Still, it is not a 100% correct simulation because the transition between the track segments is not totally correct. But eliminating that error would take a lot more time. I'd say the simulation times are within 5% of the real world if car and track are recreated properly.
Image
<<

nialloftara

User avatar

Supercharged
Supercharged

Posts: 1983

Joined: Wed Feb 05, 2014 2:07 pm

Location: Northeast USA

Cars: 2006 Scion Xb

Post Wed Apr 02, 2014 4:52 am

Re: How to build Custom Tracks

Well like with high speed chicanes, will a rolly car with a high center of gravity or soft springs have a harder time with quick transitions , and will a stiffly sprung car have more trouble on bumpy sections if its trying to slow down or steer.
Chief designer and CEO, Centauri motor works, Centauri Performance Vehicles (CPV)
"Centauri: The Stars Are Within Your Reach."
Centauri engines Centauri cars
CPV engines CPV cars
Company ID: 1943047
<<

Der Bayer

User avatar

15-Star Beta Tester
15-Star Beta Tester

Posts: 1344

Joined: Tue Sep 20, 2011 1:34 am

Location: Karlsruhe, Germany

Cars: Seat Ibiza 6L 1.4

Post Wed Apr 02, 2014 4:55 am

Re: How to build Custom Tracks

That cannot be calculated directly, but this is basically part of the sportiness/tameness ratio. A car with hard springs will be not very tame but sporty and will be penalised on bumpy track sections. I hope you get the idea. :)
Image
<<

SamSheepDoq

User avatar

Turbocharged
Turbocharged

Posts: 279

Joined: Sat Jun 08, 2013 5:19 pm

Location: California, United States

Cars: 2001 Chevrolet Silverado

Post Wed Apr 02, 2014 4:57 am

Re: How to build Custom Tracks

I will more than likely work on a track over the weekend. It won't be a real track, but I think it'll be pretty good on its own. I will say this is a lot simpler than Rigs of Rods was.
Founder and Lead Engineer at Garza Automotive Company.
See our cars here: Garza Automotive Company.
<<

nialloftara

User avatar

Supercharged
Supercharged

Posts: 1983

Joined: Wed Feb 05, 2014 2:07 pm

Location: Northeast USA

Cars: 2006 Scion Xb

Post Wed Apr 02, 2014 5:08 am

Re: How to build Custom Tracks

Okay cool I wasn't sure if it was going to be factored in at all. Thanks for the help :) I look foward to editing dome torture test tracks.
Chief designer and CEO, Centauri motor works, Centauri Performance Vehicles (CPV)
"Centauri: The Stars Are Within Your Reach."
Centauri engines Centauri cars
CPV engines CPV cars
Company ID: 1943047
<<

LoucurasdoPortal

User avatar

Supercharged
Supercharged

Posts: 159

Joined: Wed Mar 05, 2014 7:20 am

Location: In Limbo

Cars: Toyota Corolla and Chevrolet Captiva

Post Wed Apr 02, 2014 7:08 am

Re: How to build Custom Tracks

SamSheepDoq wrote:I will more than likely work on a track over the weekend. It won't be a real track, but I think it'll be pretty good on its own. I will say this is a lot simpler than Rigs of Rods was.


Rigs of Rods was a nice game, i still have it installed on my PC. But we gotta admit it was very difficult to create things for it...
Designing Cars... since i bought the game!

Image

Car Company: Agillio Cars
Website or Forum thread: viewtopic.php?f=35&t=3726
Established in: 1978
Company ID: 1978247
<<

OCAdam

Naturally Aspirated

Posts: 181

Joined: Wed Mar 26, 2014 11:52 am

Cars: 2007 Honda Fit Sport

Post Fri Apr 04, 2014 2:18 pm

Re: How to build Custom Tracks

Is there a way to set an initial direction of the track? Simply put, does the track have to always start going to the right, or is there some way of setting the track to a certain angle that the car should be headed? Otherwise, guess that's just a limitation of the test track... and I'll have to adjust with that over my creation of Road Atlanta.
Platinum Automotive Company
Company ID: 1975027
<<

Alexander97

Supercharged
Supercharged

Posts: 4

Joined: Thu Jan 16, 2014 5:51 am

Cars: Ford Ranger

Post Fri Apr 04, 2014 4:05 pm

Re: How to build Custom Tracks

Would some one be willing to help me mod a drag strip, somewhat similar to bandimere speedway in Colorado?
<<

Der Bayer

User avatar

15-Star Beta Tester
15-Star Beta Tester

Posts: 1344

Joined: Tue Sep 20, 2011 1:34 am

Location: Karlsruhe, Germany

Cars: Seat Ibiza 6L 1.4

Post Fri Apr 04, 2014 6:20 pm

Re: How to build Custom Tracks

Yeah, it always starts to the right. It wouldn't be a big problem to include a starting direction in the track definition though, we'll see if the devs decide to do so in the future.
Image
<<

Passwrd

Posts: 4

Joined: Fri May 11, 2012 2:01 pm

Cars: Mazda 626

Post Mon Apr 07, 2014 4:26 pm

Re: How to build Custom Tracks

Not sure if his is a rare problem or just the way my windows is configured or whatnot, but I found a little bug. When editing or creating a .lua file with default windows notepad sometimes it wont work. I think it's because the way notepad saves the file through UTF-8 with BOM. I think theres some invisible characters/data that screws with the way automation views files, i'm not sure but I just wanted to throw that out there.

Image


Works perfectly fine with notepad++ though!
<<

OCAdam

Naturally Aspirated

Posts: 181

Joined: Wed Mar 26, 2014 11:52 am

Cars: 2007 Honda Fit Sport

Post Mon Apr 07, 2014 4:38 pm

Re: How to build Custom Tracks

I'd be willing to bet somewhere you accidentally didn't type something correctly, but since Notepad won't show code error (while Notepad++ obviously will), you'll have some issues. Even with N++, I had errors due to silly mistakes.
Platinum Automotive Company
Company ID: 1975027
<<

Passwrd

Posts: 4

Joined: Fri May 11, 2012 2:01 pm

Cars: Mazda 626

Post Mon Apr 07, 2014 4:44 pm

Re: How to build Custom Tracks

OCAdam wrote:I'd be willing to bet somewhere you accidentally didn't type something correctly, but since Notepad won't show code error (while Notepad++ obviously will), you'll have some issues. Even with N++, I had errors due to silly mistakes.


That's actually more likely... I take it back it probably has nothing to do with encoding with BOM, you just have to be very precise and actually end your lines with brackets :lol:
<<

07CobaltGirl

User avatar

Queen of Track Building

Posts: 1613

Joined: Sun Dec 08, 2013 11:47 am

Location: Atlanta, GA, USA

Cars: Chevy Cobalt

Post Thu Apr 10, 2014 5:49 am

Re: How to build Custom Tracks

There's a problem when using distance in the lua. I made a 1/4 mile track using 60' (18.2m), 660' (201.2m), and 1320' (402.3m). While these are not as precise as they could be, the time my car does on this track is 12.75s. The game lists the 1/4 mile time as 12.30s.

Even shortening the lengths of the segments and overall altered the time to 12.71s. Am I doing something wrong?
  Code:
Track =
{
   Name = "Quarter Mile",
   --Track Image Info
   --Track Image must be 1280 x 720
   --Start Position on the Image x,y from Top Left
   Start = { 486, 411 },
   
   --How many pixels per meter ( Pixels / Length )
   --Measure a long straight and then manipulate from there
   Scale = 15 / 10,


   Layout = {         STRAIGHT},   -- Straight 0 , Corner Left 1, Corner Right -1
   LayoutInfo = {       400},      -- Straight Length [m] or Corner Angle [°]
   CornerRadius = {    0},         -- Corner Radius [m], 0 for Straight
   Slope = {          0},         -- [%] (-: descending, +: climbing)
   Sportiness = {       2},         -- 0: no problems, 5: problems with untame car
   Camber = {         0},         -- [°] (positive values: banking to left /, negative: banking to right \)
   Split1 = 15,               --60' trap
   Split2 = 195,            --1/8 mile trap
}
Next

Return to Test Track Sharing Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron