Game Development Reference
In-Depth Information
Initializing team influences
Initializing a team influence layer consists of setting the desired falloff and inertia of the in-
fluence layer. A 20 percent falloff as well as a 50 percent inertia works well based on a cell
width of 2 meters for the default sandbox layout.
Finding useful ranges for falloff and inertia requires experimentation and is very
application-specific. A 20 percent falloff and 50 percent inertia works well with the default
sandbox layout, but different sandbox layouts and influence map configurations will re-
quire other values.
Note
If your cell widths are smaller or larger, you will need to change these values to create sim-
ilar results.
We'll create a helper function, I nitializeTeamAreas , to use on each of our team-
based influence layers.
SoldierTactics.lua :
local function InitializeTeamAreas(sandbox, layer)
Sandbox.SetFalloff(sandbox, layer, 0.2);
Sandbox.SetInertia(sandbox, layer, 0.5);
end
Search WWH ::




Custom Search