Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.
David Johns edited this page Aug 30, 2017 · 3 revisions

Quick overview

Road Architect's primary game objects

  • Road Architect System - this script component is treated as the master GameObject for organization purposes. Located at the root level of the hierarchy. (RoadArchitectSystem.cs)
  • Road Object - this script component is attached to each road created. Contains 42+ options including road width, lane count and terrain options. Located as a child of a Road Architect System GameObject. (GSDRoad.cs)
  • Road Node - this script component is attached to each road node on a road. Contains 100+ options and is the primary place in which bridges, edge objects and more are created. Located as a child of a Spline GameObject, which is a child of a Road GameObject. (GSDSplineN.cs)
  • Intersection Object - this script component is attached to each intersection object. Contains dozens of intersection options. Located as a child of the "Intersections" GameObject, which is a child of a Road Architect System GameObject. (GSDRoadIntersection.cs)
  • Splatmap Creator - this script component is attached to each terrain in the scene. Contains 8 options for creating and exporting splat maps. Located on each Terrain GameObject. (GSDTerrain.cs)

Quick start

Tutorial videos

Building a road

  1. Create a Road Architect System GameObject via the Road Architect file menu.
  2. Select the newly created Road Architect System GameObject and click "Add road" to add a road (located in the Road Architect System's inspector window).
  3. While a road object is selected:
    • Ctrl+Left-Click Add road nodes on the terrain while holding ctrl and left-clicking on the terrain location.
    • Shift+Left-Click Insertion mode: Insert road nodes on the terrain while holding shift and left-clicking on the terrain location.

Building an intersection

Drag a node on top of another node. Can be from the same road or different roads.

To create a 3-way intersection, utilize an end node (a road's first or last node) to create the intersection.

Note: You can't create an intersection out of consecutive nodes of the same road.

Using the Wizard

  1. Select the node in which you wish to add an extruded, repeated object or singular object.
  2. Switch back to the node where you want the bridge to start. Click "Open Wizard" (the blue button). This will open the creation wizard.
  3. Select "Extrusion Objects" or "Edge Objects" from the the creation wizard drop-down.
  4. Experiment with the drop-down and its options to explore all of the included assets

Building a bridge

  1. Select the road node where the bridge is to start.
  2. At the top of the node's inspector window, check "Bridge start".
  3. Select the road node where the bridge is to end.
  4. At the top of the node's inspector window, check "Bridge end".
  5. Select the bridge start node.
  6. Click "Open Wizard" (the blue button) in the inspector panel. This will open the creation wizard.
  7. Make sure "Completed Bridges" is selected in the creation wizard drop-down.
  8. Single-click on which bridge type to add. Adjust the bridge start and end nodes' heights for desired effect.

Tips

  • Look at the example scenes to see entire road layouts with bridges and more.
  • Nodes are the only GameObject to add bridges, railings, signs and similar items. In other words: To add any non-road item you must do so from a Node.
  • To add nodes, you must have a road selected. Ctrl-left-click to add a node to the end of the road. Shift-left-click to insert a node anywhere along the spline.
  • Creating a custom extrusion and edge objects is performed by clicking the "Create a custom extrusion object" and "Create a custom edge object" in a Node's inspector window.
  • Confused? Watch the tutorial videos.

Road Architect Objects

Road Architect System GameObject

  • Add road - Adds a road to the system. After clicking this button, the new road will automatically be selected as the active GameObject.
  • Multithreading - Enables or disables multithreading during road generation.
  • Save mesh assets - Enables or disables saving of meshes as unity assets.
  • Update all roads - Updates all roads in the scene. This may take a while depending on the number of roads in the scene.
  • View next intersection - Changes the sceneview to the next valid intersection. Hotkey "K" works while the Road Architect System GameObject is selected.
  • View next bridge - Changes the sceneview to the next valid bridge. Hotkey "L" works while the Road Architect System GameObject is selected.

Road GameObject

Road options

  • Gizmos - Enable or disable most gizmos for this road. Disable mesh collider gizmos via the unity menu if necessary or desired.
  • Lanes - Select the number of lanes for this road.
  • Lane width - Modify the width per lane, in meters.
  • Road width - Displays the road width without considering shoulders, in meters.
  • Shoulders enabled - Enables or disables shoulders.
  • Shoulders width - Modify the width of shoulders, in meters.
  • Road definition - The meter spacing between mesh triangles on the road and shoulder.
  • Use default materials - When enabled will use default materials for the road system, allowing certain aspects of generation to automatically determine the correct materials to utilize.
  • Max grade enforced - When enabled enforces a maximum grade on a per node basis.
  • Max road grade - The maximum road grade allowed on a per node basis.
  • Multithreading - When enabled allows for multi-threaded road generation.
  • Save mesh assets - When enabled saves all generated meshes as .asset files.
  • = Reset to default value.

Terrain options

  • Terrain subtraction - This value, in meters, will be subtracted from the terrain match height to prevent z-fighting.
  • Spline magnitude limit - Limits the magnitude of the spline nodes. Lower limit is better for typical roads with node - **separation of around 100 to 300 meters. Higher limits will allow for less tension when using very spread out nodes.
  • Height Modification - Enables or disables height matching for the terrain.
  • Active detail removal - Enables or disables active detail removal. Memory intensive on large terrains with large amounts of details. Recommended to not use this option and instead remove details and trees via splat maps with other addons.
  • Active tree removal - Enables or disables active tree removal. Memory intensive on large terrains with large amounts of trees. Recommended to not use this option and instead remove details and trees via splat maps with other addons.
  • Heights match width - The distance to the left and right of the road in which terrain heights will be matched to the road.
  • Details clear width - The distance between the road and detail, width wise, in which details will be removed.
  • Details clear height - The distance between the road and detail, height wise, in which details will be removed.
  • Tree clear width - The distance between the road and tree, width wise, in which trees will be removed.
  • Tree clear height - The distance between the road and tree, height wise, in which trees will be removed.
  • Store terrain history separate from scene - If enabled, stores the terrain history immediately on disk after use, saving memory while in editor. Terrain history size** - Shows the size, in kilobytes, of the terrain history in memory or on disk.
  • = Reset to default value.

Road and shoulder splitting

Typically auto-split will be the best choice for performance and other reasons.

Choosing split options will split the road/shoulder up into pieces mirroring the road segments between nodes. Splitting makes mesh collider bound calculations more efficient and fast. Splitting also allows for more detailed and flexible road texturing options such as passing sections, other different road lines per section, road debris and more.

Which splitting option to choose?

Recommended option: auto-split enabled for roads and shoulders.

Choose no splitting if you desire a single material set for this entire road and your game experiences no collision processing slowdowns from one large mesh collider. This option will create less game objects than automatic and manual splitting.

Choose automatic road and shoulder splitting if you desire multiple materials (such as yellow double lines for certain sections and white dotted for others) for this road and or your game experiences collision processing slowdowns from one large mesh collider.

Choose manual road and shoulder splitting if you desire the same as automatic splitting and desire more freedom over the process. This option will result in less GameObjects and larger mesh colliders when compared to automatic splitting.

Manual splitting information

Choosing manual splitting will force the user to select individual nodes to cut instead of the cuts being performed automatically. This option is recommended if bigger mesh colliders do not cause a slowdown in performance, as it lowers the overall GameObject count.

Manual splitting will not split up the mesh colliders like automatic cuts, so the colliders may get large & complex and cost more CPU to process collisions. If this option is chosen, please verify your game's collision processing speed and if you run into long collision processing times split more road sections.

Example usages of manual splitting

Example hill: Goal is to have double yellow no passing lines on a two lane road but only while the road is near or on the hill. Pick nodes on either sides of the hill and mark both as road cut. Everything between these two nodes will be its own section allowing you to apply double yellow no passing lines for just the hill. Example mountains: In the mountains, the road is curvy and the grade is high. There's a flat straight spot that you want to allow passing in, by marking the road with white dotted passing lines. At the beginning of the flat straight section, mark the node as road cut. Now at the end of the flat straight section, mark this node as road cut. This will create a road section between the two nodes, allowing you to apply white dotted passing lines for just the flat straight section.

  • = Reset to default value.

Editor camera

Use this section to travel along the road while in the editor sceneview.

  • Camera meters/sec is the speed at which the camera moves along the road.
  • Auto rotate will automatically rotate the camera to look forward at the current road's tangent. Note: You can still zoom in and out with the camera with this option selected.
  • Note Materials act differently in the editor scene view compared to actual gameplay. Try the game camera if the materials are z fighting and having other issues.
  • = Reset to default value.

Road materials

These default materials will be applied by default to their respective generated meshes. If using split roads and or shoulders, you can specific specific materials to use on them (on the mesh renderers of the cuts) and they will be used instead of the default materials listed above.

  • Road base material is UV mapped on a world vector basis for seamless tiles.
  • Road marker material is UV mapped to fit roads. Use these materials to place road lines and other road texture details. Note: if using road cuts, these are the materials which will be placed by default at the initial generation.
  • Shoulder base material is UV mapped on a world vector basis for seamless tiles.
  • Shoulder marker material is UV mapped on a world vector basis for seamless tiles. For intended use with transparent shadow receiving shaders. Marker materials are applied, optionally, on shoulder cuts.
  • Physical material for road will be used on all road colliders. The physical material for shoulder will be used on all shoulder colliders. If using road and or shoulder cuts, you can specify unique physics materials which will be used instead of the default physics materials.
  • Apply above materials button will clear all saved materials on the roads and all road and shoulder meshes will use the materials listed above.
  • = Reset to default value.

Misc

Reset terrain history Resetting the terrain history will make the road system "forget" all terrain height,detail and tree history.

WARNING Only reset the terrain history if you have changed terrain resolution data such as heightmap or detail resolutions. A rare event may occur when editing and compiling this addon's scripts that a terrain history reset may be necessary. Treat this reset as a last resort.

Node GameObject

Node basic options

  • Gizmos Enable or disable most gizmos for this node. Disable mesh collider gizmos via the unity menu if necessary or desired.
  • Save group allows the saving of a group of items for easy replication.
  • Open wizard opens the creation wizard, allowing the user to easily create prefabricated bridges, systems, railing, signs and more.
  • Add custom extrusion object adds a custom extrusion object to the node.
  • Add custom edge object adds a custom edge object to the node.
  • Statistics displays general statistics about the node.

Extrusion objects

  • Name The name of the extrusion object.

  • Prefab The prefab or FBX file to repeat along the spline.

  • Prefab start cap The start cap of the prefab. Please watch all extrusion object tutorial videos for more comprehensive information.

  • Prefab end cap The end cap of the prefab. Please watch all extrusion object tutorial videos for more comprehensive information.

  • Material override If enabled, instead of using the prefab's material, the extrusion object will use the override materials listed below.

  • Override mat #1 The first override material.

  • Override mat #2 The second override material.

  • Extrusion axis The axis in which the prefab is extruded, either the X-axis or Z-axis. Please watch all extrusion object tutorial videos for more comprehensive information.

  • Start param The start parameter of the extrusion object. Corresponds to the parameter of the spline.

  • End param The end parameter of the extrusion object. Corresponds to the parameter of the spline.

  • Trim start Trims the start of the extrusion object by one length of the extrusion object.

  • Trim end Trims the end of the extrusion object by one length of the extrusion object.

  • Static Marks the created object as static.

  • Match ground If enabled, makes the extrusion object hug the terrain, road or whichever object is directly beneath the extrusion object.

  • Vertex min/max This value is the threshold in which the start and end vertices are detected on the base prefab. For example, a value of 0.002f (or 2mm) will retrieve the outermost values along the extrusion axis and then reflect inward 2mm and mark all detected vertices and start and end vertices. Please watch all extrusion object tutorial videos for more comprehensive information.

  • Vertex matching This value is the allowable error rate when attempting to match mirrored vertices. For example, a value of 0.005f (or 5mm) will allow an error of 5mm in determining matching vertices. Please watch all extrusion object tutorial videos for more comprehensive information.

  • UV repeat axis Determines which axis the UV will repeat. This option is typically used in conjunction with the match road definition option.

  • Match road definition If enabled, attempts to match the length of the object to the road definition value. This option should only be used for objects without any middle vertices.

  • Flip Y rotation Flips the Y rotation of the extrusion object by 180 degrees.

  • = Indicates this is an extrusion object.

  • = Duplicates the extrusion object.

  • = Manually updates the object.

  • = Deletes the extrusion object.

  • = Allows saving of this extrusion object via a save dialog. This saved item can then be loaded onto other nodes via the creation wizard.

  • = Reset to default value.

Vertical and horizontal curve options

  • Vertical raise magnitude The magnitude of vertical rise given to the extrusion object. This magnitude is interpolated along the extrusion length as the value of the Vertical Curve. Please watch all extrusion object tutorial videos for more comprehensive information.
  • Horizontal offset magnitude The magnitude of horizontal offset given to the extrusion object. This magnitude is interpolated along the extrusion length as the value of the Horizontal Curve. Please watch all extrusion object tutorial videos for more comprehensive information.
  • = Reset to default value.

Vertical cutoff options

  • Vertical cutoff Vertical cutoff options allow for suspension bridge cables and arch bridges. The vertical cutoff options are not utilized for any other purpose.
  • Match spline height Attempts to match the spline's height. If the cut direction toggle is enabled, the match spline height is applied to the base. If the cut direction toggle is disabled, the match spline height is applied to the top.
  • Cut direction toggle Toggles the direction of the cut, either top or bottom. For example, a suspension bridge will need to be "cut" at the top and an arch bridge will need to be "cut" in the opposite direction.
  • Height cut offset Offsets the base cut level. For example, this setting will affect a suspension bridge cable's bottom area and will affect an arch bridge's top area.
  • Opposite dir cut If enabled, flips the mesh before cutting.
  • Mesh cut offset The vertical height cut offset which is applied to the cut ends of the mesh. Allows fine tuning of the cuts. For example, sometimes your suspension bridge cables may stick through the top of the main cable and might need fine tuned.

Start & end object options

  • Push endings down If enables, pushes the endings of the extrusion object down into the ground. Creates realistic effects with KRails, WBeams and other types of railing.
    • Override down value If enabled, overrides the down value with the below option.
    • Downward movement The override down value.
  • Match objects to ends If enabled, attempts to place the start/end extra objects with the proper end placement.
  • Force origins to ground If enabled, attempts to force the extra objects to hug the ground.
  • Start object Allows placement of an extra object at the start of the extrusion. Excellent for sand barrels, warning signs or attenuators.
    • Start quick select A drop-down which features quick selection of extra objects.
    • Start prefab The prefab used to generate the start object.
    • Start position offset Adds a positional offset to the start object.
    • Start rotation offset Adds a rotational offset to the start object.
  • End object Allows placement of an extra object at the end of the extrusion. Excellent for sand barrels, warning signs or attenuators.
    • End quick select A drop-down which features quick selection of extra objects.
    • End prefab The prefab used to generate the end object.
    • End position offset Adds a positional offset to the end object.
    • End rotation offset Adds a rotational offset to the end object.

Collision options

  • Collision type drop-down Select the collision type.
    • None Disables all collision on this extrusion object.
    • Simple mesh triangle Uses a dynamically created simple mesh triangle as the collider for the extrusion object.
    • Simple mesh trapezoid Uses a dynamically created simple mesh trapezoid as the collider for the extrusion object.
    • Base Mesh collision Uses the extrusion object's mesh filter as the collider for the extrusion object.
    • Box collision When using the straight line option for bridges, a box collider can be used as the collider.
  • Convex Corresponds to the convex option on mesh colliders.
  • Trigger Corresponds to the trigger option on mesh colliders.
    • Automatic simple
    • Enabled If simple triangle or trapezoid is selected and this option is enabled, the mesh collider dimensions will automatically created.
    • Disabled If disabled and simple triangle or trapezoid is selected, allows the user to customize the dimensions of the dynamically created mesh collider.

Rotation and deprecated

  • Custom rotation Rotates the base prefab before extrusion takes place.
  • Directional extrusion A deprecated option, extrudes the objects by different methods.
  • = Reset to default value.

Edge objects

  • Name The name of the edge object instance.
  • Edge object The prefab or FBX file representing this edge object.
  • Material override If enabled, instead of using the prefab's material, the edge object will use the override materials listed below.
    • Override mat #1 The first override material.
    • Override mat #2 The second override material.
  • Combine meshes If enabled, combines all edge objects into one mesh.
  • Combined mesh collider If enabled, uses a mesh collider for the combined mesh.
  • Single object only If enabled, only creates a single edge object.
  • Single location If a single edge object, then use this value to place the single edge object along the spline.
  • Static Marks the created edge object(s) as static.
  • Match ground height If enabled, the edge object(s) hug the ground.
  • Dist between objects The distance between each edge object.
  • Match road definition Attempts to match the road definition in terms of distance between objects. For example, if the road definition is 5 meters, the distance between objects will be 5 meters while attempting to start at a road definition segment.
  • Position fine tuning Fine tunes the start distance on a scale of 0 meters to the road definition meters.
  • Start param The start location of the edge objects.
  • End param The end location of the edge objects.
  • = Indicates this is an edge object.
  • = Duplicates the edge object.
  • = Manually updates the object.
  • = Deletes the edge object.
  • = Allows saving of this edge object via a save dialog. This saved item can then be loaded onto other nodes via the creation wizard.
  • = Reset to default value.

Vertical, horizontal and rotation options

  • Vertical raise magnitude The magnitude of vertical rise given to the edge object. This magnitude is interpolated along the edge object repeat length as the value of the Vertical Curve. Please watch all edge object tutorial videos for more comprehensive information.
  • Select horizontal preset Offers horizontal offset magnitude presets such as road edges and shoulder edges for easy placement of railing and signs.
  • Horizontal offset magnitude The magnitude of horizontal offset given to the edge object. This magnitude is interpolated along the edge object repeat length as the value of the Horizontal Curve. Please watch all edge object tutorial videos for more comprehensive information.
  • Auto-rotate incoming Automatically rotates the object 180 degrees around the y-axis if placed on the left side of the road (negative horizontal offset magnitude).
  • Custom rotation Rotates the base prefab before edge object repetition takes place.
  • = Reset to default value.

Intersection GameObject

Intersection options

  • Auto-update Enables or disables auto updating of this intersection when changing options.
  • Gizmo Enables or disables most gizmo drawing on all objects related to this intersection.
  • Intersection turn lane options
    • No turn lanes** Creates an intersection with no turn lanes.
    • Left turn lane only** Creates an intersection with a left turn lane.
    • Both turn lanes** Creates an intersection with left turn and right turn lanes.
  • Left yield on green If checked, replaces the standard 3-light left turn light with a five-light yield on green left turn signal structure and sign.
  • Street lights If checked, attaches street lights to each intersection pole. Point lights optional and can be manipulated in the next option segment.
  • Gray color If checked, sets the traffic light pole base materials to gray galvanized steel. If unchecked the material used is black metal paint.
  • Normal pole alignment Recommended to keep this option on unless abnormal twisting of light objects is occurring. Turn this option off if the roads immediately surrounding your intersection are curved at extreme angles and cause irregular twisting of the traffic light objects. Turning this option off will attempt to align the poles perpendicular to the adjacent relevant road without any part existing over the main intersection bounds.
  • Point lights Enabled means that point lights for the traffic lights (and street lights, if enabled) will be turned on. This is accessible via script "bLightsEnabled" If street pole lights enabled: Street light range, intensity and color: These settings directly correlate to the standard point light settings.
  • Traffic light scale sensitivity Increasing this value will increase the scaling sensitivity relative to the size of the intersection. Higher scaling value = bigger traffic lights at further distances. Default value is 170.
  • Grade correction If using extreme road grades immediately surrounding the intersection, terrain height matching errors may occur at the point of road expansion leading to the intersection.
    • Raise this value if you see terrain poking through the road at the road expansion areas.
    • Lower this value if you are not using road mesh colliders and notice dips at the expansion points.
    • Default value is 0.375 meters, which is the maximum value for a linear range of 0% to 20% grade.
    • Recommended to keep grades and angles small leading up to intersections.
  • = Reset to default value.

Intersection materials

  • Center marker materials Center marker materials require transparent shaders. Covers the center area of the intersection. Displayed in order #1 on bottom to #4 on top. Combine with transparent shaders which accept shadows to allow for easy marking. Each material added is rendered on top of the previous. Combine with transparent shaders which accept shadows to allow for easy marking.
  • Exterior fitted marker materials Fitted marker materials require transparent shaders. Covers the exterior area of the intersection with the UV's stretched to match at a 1:1 ratio. Should be use for intersection markings and any visual effects like dirt. Each material added is rendered on top of the previous. Combine with transparent shaders which accept shadows to allow for easy marking.
  • Exterior tiled marker materials Covers the exterior area of the intersection with the UV's tiled matching world coordinates. Tiled and used for road pavement textures. UV coordinates will match up seamlessly with road pavement. Each material added is rendered on top of the previous. Combine with transparent shaders which accept shadows to allow for easy marking.
  • Lanes marker materials Covers individual lane sections in the intersection. Used for high-definition line marking. Each material added is rendered on top of the previous. Combine with transparent shaders which accept shadows to allow for easy marking.
    • Lane section 0 Left side of the intersection where oncoming traffic travels. Use lane texture which matches the number of lanes used on the road system, with a white left line and a yellow right line.
    • Lane section 1 Left turn lane. Use a single lane texture with a yellow left line and a white right line.
    • Lane section 2 Right outgoing traffic lane. Use lane texture which matches the number of lanes used on the road system with a white right line.
    • Lane section 3 Right turn lane. Use a single lane texture with a white right line.
  • = Deletes the object.
  • = Reset to default value.

Splatmap

  • Match resolutions Select from a pre-populated list of resolutions. This resolution corresponds to the image size of the generated splatmap.
  • Splat image width & height Corresponds to the image resolution of the generated splatmap.
  • Splat foreground Changes the foreground color which represents the road(s) in the splatmap.
  • Splat background Changes the background color which represents the non road covered areas in the splatmap.
  • Splat width Changes the width of the road splat. Example: If you wanted a splatmap width of 60 meters surrounding the road, set the value to 60.
  • Skip bridges Disables or enables the splat generation of bridge sections.
  • Skip tunnels Disables or enables the splat generation of tunnel sections.
  • Splat a single road Enables the selection of a single specific road to splat.
  • Generate splatmap Creates the splatmap and prompts where to save the image.
  • = Reset to default value.

Exporting meshes

To export any mesh, utilize the main menu toolbar at "Road Architect" -> "Export".

Utilizes "Exporters by Hrafnkell Freyr Hlooversson" from Unity3D wiki: http://wiki.unity3d.com/index.php?title=ObjExporter.

Frequently asked questions ( FAQ / F.A.Q. )

Why does the information message "Mesh has been leaked X times message" appear in the console occasionally?

All meshes are getting properly marked for garbage collection but due to the way Unity Editor handles mesh creation and nullification, it may not happen in a predictable fashion. This message is not harmful and you can safely ignore it: The message informs of proper cleanup of a leaked mesh during editor mode and it has zero effect on gameplay modes.

Some of my roads turn too sharp or bunch up inexplicably.

Try manipulating the "Spline Magnitude Limit" listed in the terrain options of the "Road Object".

What builds are supported?

Windows and Web. Other builds probably work but we don't know.

Sometimes my 3-way intersection looks wrong, what do I do? Try manually updating the intersection by clicking on the "Update Intersection" button while the intersection gameobject is selected in the hierarchy.

Why did my terrain history get reset or altered?

If the terrain history is saved on the disk, the saving scheme uses the scene name, the road name and then the road system name. Don't name your scenes the same name.

Sometimes when using the road grade enforcement the grade between nodes is higher than the limit, why?

If you adjust the height of nodes along the spline there is a small chance that the limitation will be exceeded from the adjustment node to the next node. To avoid unintentional rolling changes to the entire road it is advised to manually examine the next node and adjust it's height next.

My intersection looks messed up, what can I do to fix it?

Try clicking "Update intersection" in the inspector window while having the intersection selected in the hierarchy.

Clone this wiki locally