Lanes in Massive are used for giving precise control over an agent’s navigation within a scene.
They can be created as flat 2d splines which can conform to terrain, or in a 3d form, where the lane is able to be manipulated in 3d space, independent of the ground terrain.
Lanes are perfect for creating traffic simulations where agents such as cars or pedestrians can follow a specific path.
2D lanes are created as 3 parallel splines which can be placed either on a ground plane or terrain geometry. If using uneven terrain then the lane will conform to the geometry if the terrain node is set to active.
The direction of the lane is displayed with the centre spline, although it can be difficult to tell quickly in which direction a lane is oriented, but the thicker/brighter end of each indicator is the direction of travel
3D lanes are also created as 3 splines, but unlike 2D splines they are represented as tubes rather than flat paths.
3D lanes do not conform to underlying geometry and can be manipulated to create a three dimensional shape for agents to follow.
This type of lane is suitable for agents who need to navigate in height (Y) as well as in X & Z axis, for example birds or aeroplanes etc.
Editing 3D lanes
You can edit 3D lanes by using the 3 modes used for 2D lanes, but to make transforming the edit points easier, you can use the Manipulator tool. This gives you control over translating the points in 3D space, as well as rotating the normals of the point to allow your agents to bank, pitch or roll as it travels along the lane.
The manipulator tool can be accessed from the Options menu
Spline edit mode
Point edit mode
Point adjustment mode
Navigation along lanes is similar to flowfields. Agents can detect the lane’s direction and where the agent is on the lane.
Brain logic for lanes requires a specific combination of nodes. In order for lanes to be computed, you must create an INPUT node, a FUZZ node and finally an AND node.
The following are all the input channels available for reading lane data:
You can use this channel to find out where your agent is, laterally, across the current lane.
lane.x has a range of -1 (fully left) to +1 (fully right) with a value of 0 in the centre.
Left in lane
Centre in lane
Right in lane
You can use this channel to find out where your agent is, vertically, across the current lane.
lane.y has a range of -1 (bottom of lane) to +1 (top of lane) with a value of 0 in the centre.
Bottom of lane
Centre in lane
Top of lane
You can use this channel to find out where your agent is, along the current lane.
lane.z has a range of 0 (start of lane) to 1 (far end of lane) with a value of 0.5 in the centre.
Start of lane
Centre of lane
End of lane
lane.ax vs lane.ox
lane.ax and lane.ox look very similar at first glance. They both calculate the angle of the lane which an agent is on. With 0 to -180 being a left turn and 0 to 180 being a right turn.
Both can be used to help an agent make turns. However, they calculate the turn differently if you are using look-ahead (see below for look-ahead details)
The main difference is:
lane.ox calculates the angle of turn based on the agent’s predicted orientation.
lane.ax calculates the angle of turn relative to the agent’s current orientation
lane.ax can generally give better turn results than lane.ox.
Below is an example of a right turn, lane.ax and lane.ox are used and setup identically. You can see from the final frame, that lane.ax better anticipates the turn amount needed and as such keeps the agent more centred in the lane, whereas lane.ox results in a wider turn and can even cause the agent to walk off the side of the lane completely
Start of turn
End of turn
lane.h is very useful for when you have overlapping lanes and dont want to confuse your agent. You can assign a colour to your agent to follow the corresponding lane of that colour.
In the following example, a condition of 0.3 is fed into the lane.h fuzz node, and notice how the agent has ignored the red and blue lanes and kept walking along only the green lane.