Traffic Goto

Traffic Goto Behavior (beTrafficGoto) adds a target destination, or a wander behavior, to entities already using the Traffic behavior

Traffic Goto behavior in the behavior editor

For more information on traffic in Golaem Crowd, see Traffic Locator & Traffic tutorial

To use a Traffic Goto Behavior, a Traffic Locator and a Traffic behavior are mandatory. 

If no target is found, the target will wander as if there was no Traffic Goto.

CREATION

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBe Traffic Goto Node
  • MEL command: glmCrowdBeTrafficGotoCmd;

CONFIGURATION

A Traffic Goto Behavior defines the following specific attributes. For common attributes see Behavior Common Attributes.

Traffic Goto Attributes

attributes of a Traffic Goto Behavior

The target position is defined by a bound locator. The target will NOT be updated in real time during simulation (no animated target). Following a specific path can be achieved by chaining several Traffic GoTo.

Target Mode

The Traffic Goto will either wander forever, or try to reach a target and stop, according to the mode :

Random Target In Environment

Iin this mode, the car wanders, choses a new lane each time it reaches a crossing. Thus it keeps wandering forever (if the traffic network has no dead ends)

Use Target Poptool

If this mode is selected, all entities will try to reach slots on the Crowd Target Locator selected in the "In Target Poptool" field.

Target Particle System

In this mode, each Entity will be assigned to its corresponding particle in the target particle (or nParticle) system selected in the "In Particle System" field (i.e. entity of particleId 1 will be assigned to the target of particleId 1…). If the target particle system contains fewer particles than the navigating Entity, the entity particleId will be moduled by the size of the target particle system (i.e. entity of particle 6 will be assigned to the target of particleId 1 if the target particle system has 5 particles...).
Note that Golaem Crowd Population Tool can be used to emit the target particle system.
 

Example of a target particle system
 
It is also possible to specify the assignment of each Entity in the targeted particle system thanks to the field "Target Id PPName". If this field is set, each Entity will be assigned to the target whose id is stored in the float per-particle attribute stored in the "Target Id PPName" attribute of its relative particle. If this field is not set, or its value for one Entity is negative, the particleId will be used. See ppAttributes Handling.

Per Particle Target Attribute

In this mode, each Entity will be assigned to the position stored in the vector Golaem Attribute (or per-particle attribute) stored in the "Target PPName" attribute. The Y value of this per-particle attribute will be projected on the terrain. See Golaem Attributes Handling  (or ppAttributes Handling).

Target Expression

If this mode is selected, the target comes from an expression evaluation. A helper provides the special names to use entity data.

Target Reach Treshold

For all modes having a specific target, this is the limit distance where the goto consider to be arrived, and exit

In Target Poptool See "Use Target Poptool" mode above.
Slot Assign Mode

Available in "Use Target Poptool" mode. This determines the way the population tool slots are assigned as goto targets

  • By Id: the population tool slots are assigned according to the entity id
  • Random: the population tool slots are assigned randomly. A random slot of the poptool will be chosen as target each time the behavior is restarted or if "Target is Dynamic" is checked.
  • MEL Command: the user can control how the slots are assigned through a MEL function specified by the "Slot Assign MEL" attribute. The MEL function uses the index of the entity. Here's a template for this function (equivalent to the "By Id" mode):
global proc int defaultSlotAssign(int $index)
{
    return $index;
}
Slot Assign MEL See "Slot Assign Mode" above
In Particle System See "Target Particle System" mode above.
Target Id PPName See "Target Particle System" mode above.
Target PPName See "Per Particle Target Attribute" mode above.
In Target Expression

An Expression with a vector output.

Traffic Goto Advanced Attributes

advanced attributes of a Traffic Goto Behavior
U Turn Mode
  • Forbidden : cars will never make a U Turn. If a car reaches a dead end road, with or without crossing at its end, it will just stops (the goto stay active)
  • If only possible path : cars will tend to avoid U Turn, but if a car reaches a road ending with a crossing with only a U Turn exit possible, it will use it.
  • Every time it is faster : when a car has a target, if a U Turn is the fastest way to reach the requested road/position, the car will use that U Turn.
Stop On Target Reached

By default, Go To behaviors stop when reaching their target. This has no effect in wander mode