Road Tool

Houdini Prerequisites

Or road tool uses Houdini to generate the street meshes, markings and the minimap reduced street mesh. You will need to install Houdini and get a free Houdini Engine Indie license to be able to generate street meshes in unreal.

  1. To download Houdini you will need to create an account on the https://sidefx.com website.

  2. After you activated your account navigate to this page https://www.sidefx.com/download/daily-builds/#category-gold

  3. You unfortunately need two houdini version to be able to use the road tool.

    1. houdini-17.5.460-win64-vc141.exe is used to generate the roads.  

    2. download the latest available Houdini version, it needs to be used to activate your free indie license, the license administrator bundled with houdini 17.5 is unfortunately no longer compatible with sidefx licensing backend

  4. Install Houdini via the 17.5.460 installer (pic. 1)and make sure to install Houdini Engine for Unreal 4.22.3/4.23.1(pic. 2). You don’t need to install the license server of this houdini version

  5. Start the install process of the latest Houdini version and only install the license server (pic. 3).

  6. Get a free Houdini Engine Indie License from their website https://www.sidefx.com/buy/#houdini-indie

  7. Open the License Administrator of the latest Houdini installation (pic. 4).

  8. Go to File->Login and login with your account (pic. 5)

  9. After you logged in you will get another activation email from Houdini.

  10. Once you activated again, go to File->Install Licenses

  11. Select your Houdini Engine Indie License and install it

  12. After the installation you should see the license as available in your license administrator window (pic. 6)

1. 17.5.460 install settings

 

2. Install Houdini engine for Unreal from the 17.5.460 installer

 

 

 

 

Houdini GameDev Tools

Download the houdini game dev tools from their git hub page and unpack them to a folder where the can remain.

Open the houdini.env file that can be found in Documents\houdini17.5\ and add the following lines

HOUDINI_PATH = REPLACEWITHPATHTOUNPACKLOCATION\GameDevelopmentToolset;& PATH = REPLACEWITHPATHTOUNPACKLOCATION\GameDevelopmentToolset\bin;$PATH

make sure to replace the place holder

Add SAS Tools

Add the following lines to the houdini.env file

HOUDINI_OTLSCAN_PATH=REPLACEWITHPATHTOMODKIT\Games\ModKit\Content\_game_\Environment\RoadNetwork\HDA;& HOUDINI_OTLSCAN_PATH=REPLACEWITHPATHTOMODKIT\Games\ModKit\Content\_game_\Environment\RoadNetwork\HDA\Library;&

make sure to replace the place holder

In Engine

Once you start the engine check if the houdini engine plugin is started correctly. If some of the houdini options in File are greyed out press the “restart houdini engine session button”.

 

 

 

 

 

 

 

 

 

Generation Of Road Meshes

Make sure you did the full Houdini setup at the top.

There are two Houdini assets that generate the road meshes:

  • RoadToolAsset: this one is responsible for generating the street mesh

  • Roadmarks: this one is responsible for generating the road marks

To create the road meshes select one of those assets and go to

Houdini Asset → Cooking Actions → Rebuild Asset

This will trigger the mesh creation. The first time you start a rebuild you will see a data submission popup by Houdini.

Road Tool

A simple road network has been setup in the ModMap in the AP_ModMap plugin. Check it out to get an overview of it.

Road Tool Usage

To manipulate the roads you need to switch to the Road Editor Editor Mode. You will only be able to interact with road assets while in this mode.

 

 

 

 

Road Network Editor actor

The editor actor gives access to a couple useful functions while you create your road network.

  • Lane Attribute Transitions: This defines limits on which lanes can connect with which lanes when creating junctions or when you connect two roads. E.g. it can limit side walk lanes to only connect to side walk lanes, keeping false connections to a minimum and makes cleanup on the connection easier.

  • Default Road Template: the road type setup here will be used when you add a new road. You can change road types after the road is created, but this setting can speed up your road creation workflow

  • Default Traffic Light: Which traffic light blueprint should be used

  • Show Debug Visualization: Enable the visualization of debug information, like showing a debug representation of the roads, or how steep a road is.

  • available visualizations: Show Lanes, Show Lane Ids, Show Lane Attributes, Show Disjointed Lane Connections, Show Steepness

 

 

 

Creating Roads

To create a new road press ALT+left mouse button while no other route segment is selected. This will create a short 2 segment road. Click on one of the green squares to get the standard movement gizmo. Dragging and rotating this gizmo will change the shape of your road. Creating a road like this will use the default road template setup in the RoadNetworkeditorActor.

To extend a road select the lane connector of an open road, and then press ALT+left mouse button to extend the road from the previous position to your click position.

Manipulating Lane Connector

  • Move: moves the road node arround

  • Rotation: rotates the enpoint of the selected road segment

  • Scale: changes how steep of a curve a road has

Combine/Connect roads

To combine/connect two roads select the two road endpoints by CTRL clicking them. After two road connectors are marked blue press CRTL+SHIFT+Q. This will create a connecting section between the two roads with all possible lane connections. If we would now rebuild the mesh, we would see a mess of intersecting street meshes. To prevent that we need to delete unnecessary lanes.

 

 

 

 

 

 

 

Creating Intersections

Select 3 or more Lane Connectors and press CRTL+SHIFT+Q. Like in the connect/combine road section it will create all possible lanes on the intersection. Go to the newly created JunctionEditor and delete all superfluous lanes.

Change road type

To change the road type of a road:

  • first locate the RoadLaneCollectionEditorActor for the road you want to change.

  • The lane collection has a Road Template section, from the drop down select a new road type.

  • Click the Sync checkbox, this will update the road visualization to the new road

  • if this road was already connected to other roads you will need to delete the connecting road segments and reconnect them or recreate the intersections

Defining who can drive on a road

The road template already defines base parameters on who can drive on a lane of a route, this works in most cases, but there might be special roads in your network, where you want to prevent NPC cars from driving through. To change the behavior of the cars we need to change the lane attributes. Locate the RoadLaneCollectionEditorActor which contains the lane you want to change. Select the lane you want to change and go to Lane Editor Component → Lane → Attributes.

There you will see a list of the current lane attributes. The attributes of interset for us are CarDriveable and BusDriveable.

If you delete the CarDrivable attribute NPC cars won’t drive on this lane.

If you delete the BusDrivable attribute NPC drivers wont drive their buses on these lanes and the route creation will ignore those lanes.

Make sure to recreate any attribute changes for all connecting lanes including intersection lanes leading to the changed lane. This prevents NPC cars from trying to turn into blocked roads in the first place.

Traffic Lights

To add traffic lights to an intersection we will need to do some additional setup.

  1. Select the junction you want to add traffic lights to.

  2. Select one of the lanes in the junction and scroll down to t he lane editor component. Search for the Traffic Light Group variable. Each traffic light group represents one green phase on the intersection. Set all lanes that would wait for the same traffic light cycle to the same group id, starting at 0. E.g. all lanes coming from the bottom right and from top left could be in group 0 and all lanes coming from bottom left or top right could be in group 1.

  3. repeat 2. for all lanes on the junction. Lanes that don’t factor into the traffic lights should be set to group id -1

  4. once you setup all lanes reselect the junction base object. search for the traffic lights section and check “Enable Traffic Lights“. This will add the traffic light groups you created to the traffic light lane group array

  5. go to he traffic light placement section and check the “Spawn Traffic Light Placement”. This will spawn the traffic lights setup in the RoadNetworkEditorActor as default traffic lights.

  6. select the newly spawned traffic lights and check it they are set to the correct traffic light group

 

 

Zebra Crossings/Crosswalks

Crosswalks can be placed throughout the map and enables pedestrians to cross across streets. It can happen, that pedestrians j-walk if there a not enough crossing points. For pedestrians to walk over the crosswalk we need to update the navmesh, check the navmesh section for reference.

Standard Crosswalks

To place crosswalks search for the “D_JunctionCrosswalk” blueprint. Simply place it in the scene and scale it to the size of your road. Make sure to touch both sides of the walkway with the crosswalk, otherwise pedestrians might not be able to cross.

Crosswalks on intersections

For pedestrians to cross a street at a junction only in their green phase we need to let the intersection know which crosswalks are at the intersection and what green phase they are observing.

  1. Place your crossing sin the scene

  2. Select your junction and search for the Junction Editor section

  3. Add as many elements as there are crosswalks on the junction to the “Connected Crosswalk“ array

  4. Set all crosswalks as connected crosswalks

  5. Select one of the crosswalks on the junction and search for the Junction Pedestrian Crosswalk section

  6. Set the Traffic Light Group to the same values you setup in the lanes before.

Interaction with the road generation

Crosswalks can influence the road generation on some road types. E.g. if a crosswalk is placed on a road with green island in the middle it will cut a path through the island. To enable this functionality we need to tell the houdini asset that the crosswalks are there.

Select the Roadtool Houdini asset and search for the CrossWalkAsset -outliner- section in the Houdini Inputs.

Click the Start Selection button, this locks the details panel and lets you select all crosswalk blueprints. Once they are all selected click the Use Current Selection button. This will popuplate the list, and automatically regenerate the street mesh.

 

 

 

 

 

Bridges

By default we generate all roads with the expectation, that they are stuck to the floor and that the road underside is never visible, thus we don’t generate any geometry for the underside. Bridges naturally need some geometry for the underside, as they can be visible from below.

To create a bridge mesh, first create the road how you would like it to be positioned in your world. Then select the road lane collection editor actor of your road and check the “Is Bridge” Flag.

If you now rebuild the road with houdini it will automatically generate a base for your street.

 

Baking Of Roads

Baking road assets gives you more control over the actually generated meshes. It lets you accurately set collision setting and deactivate shadow casting for the generated road marks. We recommend doing this before you export your mod to the game. This brakes the connection between the asset and a the Houdini tool, which makes iteration a bit harder.

Select one of the two Houdini assets and go to

Houdini Asset → Baking → Bake to Actors

Drive-able area Tags

After baking your roads make sure to add the “Road“ Tag to all road meshes. This prevents the game from erroneously trigger collision penalties when driving on the road.

For areas beside the road that should not trigger any penalties you can add the “NoPenalty“ tag. This is useful for areas like the forecourt of a dealership or a depot.

 

Common Issues

  • It can happen that after a mesh rebuild you will see some big areas marked with “Invalid Lightmap Setting“:

    • Most of the time this is just a small build error, retry the asset rebuild and the error should be gone.

 

  • Cars driving on my roads suddenly disappear:

    • this can happen when the lanes don’t know how they should connect to their neighbors. While in the road tool mode don’t select any LaneConnector and press CRTL+SHIFT+Q. This will regenerate the predecessor and successor relation of all roads and solve dissapearing cars.

 

  • Mesh generation issues on the inside of steep curves:

    • select the lane connector and scale up the node, this smooths out the curve and should solve this issue.

 

 

 

 

  • the intersection mesh has holes:

    • check if the if the lane connection nodes are on a similar Z-height. If they are on wildly different heights it might cause issues in the mehs generation

    • check if the tangents of the merging lanes are to small or if the angle between the merging lanes is to steep

    • try recreating the junction asset. Some times the data is