Spline Road Toolkit

This is a toolkit for Giants Editor 10 to create roads, intersections and road markings from splines without the need for 3D-Moddeling software like blender.
The toolkit is split into 3 separate scripts:

Installation

To install this toolkit, extract the 3 lua files to: %localappdata%/GIANTS Software/Giants Editor 10.0.x/scripts/
Extract the textures folder into your map folder. There will already be a textures folder in your map, but dont worry, extracting this there should not overwrite any files. If you prefer, you can also directly extract the road folder that is inside the textures folder into your maps textures folder.
Remember to add these textures to any map you want to use this tool on.
You can also use your own custom road textures if you prefer. See the Usage section below for more info on that.

Now the scripts are installed and ready to use!

A note on the textures

The included textures are one simple asphalt texture which everyone may freely use with a diffuse, normal and specular. As different maps and different modders may prefer a darker or lighter road, the included asphalt01 - asphalt07 diffuse textures are replacements for the regular asphalt diffuse and they can be used with the same normal and specular as the asphalt diffuse. These alternative textures are lighter then the admittedly very dark default, with the asphalt07 being the lightest.
As stated above, you may use your own textures though.

Usage

Each of the three scripts will be accessible in Giants Editor (GE) via the Scripts -> User Scripts menu.

SplineToRoad

This script is used to create the roads themselves.
The script uses a single spline to create a road.
Place a spline where you want the road to be. The spline will be at the exact center of the road.
When you click on the script in the menu, a small window will open with the settings for the script.
These settings should be self-explanatory for the most part. The textures selected in the Material Settings will be used for the road itself. The lines do not use a texture.
The Line color sliders correspond to Red, Green and Blue from left to right. The buttons "White" and "Yellow" provide an easy way to select pure a pure white or a yellow color, as these are the most commonly used colors for road markings.
The settings "Widen at start of road" and "Widen at end of road" cause the road to become wider with an outward curve at the start or end respectively. This can be used for simple intersections, but does not offer much control over the shape.
For more complex intersections and more control over the exact shape of the intersection, use the SplineToRoadIntersection script.
The setting "Both Splines same direction", when checked, results in both traffic splines going the same direction. This can be used to create highways with 2 lanes per direction.

Should you wish to change the default textures, you can do so with the three file selectors in the Material Settings section. The top file selector sets the diffuse texture, the middle line sets the normal texture and the bottom line sets the specular texture.

Once you have chosen the settings you wish to use, make sure you have selected your spline in the scenegraph and click the "Generate Road" button.
The tool will now automatically generate a road based on your settings.
The resulting road will be placed in a transform group named "roads" at the bottom of the scenegraph.
You can now immediately select another spline in the scenegraph and click the "Generate Road" button again without having to close the tool.

If you are not happy with a road you generated, you can just delete it, by deleting its transform group inside the "roads" transform group. You can then select the same spline that you used before again, change the settings in the tool and click "Generate Road" again to re-create the road with the new settings.

Please Note: When using the "Create Water Puddle Surfaces" option, additional shapes will be created that will create water puddles during rain and wetness. You can see the effect by setting the wetness via the seasons visual control script. Please be aware that these shapes will need to be at terrain height, as this effect unfortunately does not work as a terrain decal. When using this option you may need to re-create the road after making changes to the terrain height.

SplineToRoadMarkings

This tool is used to create road markings on their own.
This is intended to be used in conjunction with the SplineToRoadIntersection tool to create the markings for an intersection, but can be used elsewhere too, if a few lines or a dashed line are needed.
Place a spline where you want the road markings. Then click on the script in the menu.
A small window will open with the settings for the script. These settings should be pretty self-explanatory.
By default, when "Solid Line" is not checked, a dashed line is created.
Like with the SplineToRoad tool the three sliders for line color represent Red, Green and Blue values respectively from left to right and the "White" and "Yellow" buttons provide easy access to predefined white and yellow colors respectively.

Once you have chosen the settings you want to use, make sure you have one or more splines selected in the scenegraph and click the "Generate Markings" button.
When you select multiple splines simultaneously and click the button, road markings with the same settings will be created for each selected spline.

The finished road markings are placed in a transform group named "roadMarkings" at the bottom of the scenegraph.

SplineToRoadIntersection

The SplineToRoadIntersection tool can be used to create complex road intersections.
In contrast to the other two tools, this tool requires multiple splines to create a single intersection.
A minimum of two splines are required, but for most intersections you will need 3 or 4 or even more splines.

The splines for this tool define the outline of the intersection.
Place splines along the outline of the intersection. These splines do not have to form a continuous outline. Gaps are allowed.
The tool will bridge gaps by connecting the end of one spline to the closest starting point of another spline.
The splines have to all run in counter-clockwise direction around the intersection!

After you have placed the splines, click on the script in the menu and a small window will open with the scripts settings.
In the Material Settings section, the top line allows selecting of a custom diffuse texture, the middle line selects the normal texture and the bottom line selects the specular texture.
The UV Scale slider determines the scale of the texture on the intersection. When you use custom textures you may need to adjust this in order for the texture to properly fit the intersection.
Be aware that a wrong setting here may cause a "UVs out of range" error! Should you see this error, delete the previously generated intersection and try again with a different UV Scale setting.
The three sliders for line color represent Red, Green and Blue values respectively from left to right and the "White" and "Yellow" buttons provide easy access to predefined white and yellow colors respectively.

Please Note: This tool cannot generate traffic splines or complex road markings. You will have to create traffic splines manually and for road markings you can use the SplineToRoadMarkings tool.

Please Note: When using the "Create Water Puddle Surfaces" option, a additional shape will be created that will create water puddles during rain and wetness. You can see the effect by setting the wetness via the seasons visual control script. Please be aware that this shape will need to be at terrain height, as this effect unfortunately does not work as a terrain decal. When using this option you may need to re-create the intersection after making changes to the terrain height.

To generate the intersection, make sure you have selected all of the splines for the outline of this intersection in the scenegraph and then click the "Generate intersection" button.
The created intersection will be placed in a transform group named "intersections" at the bottom of the scenegraph.

FAQ and known issues

By XPModder
01/2025