August 2018
Beginner
334 pages
10h 19m
English
The drop-off function should be tuned according to your specific game needs. We can define a smarter function with the following example code, using the locationDistance parameter:
public virtual float GetDropOff(int locationDistance)
{
float d = influence / radius * locationDistance;
return influence - d;
}
It is important to note that the locationDistance parameter is an integer indicating the distance measured in vertices.
Finally, we could avoid using factions and instead use a reference to the unit itself. That way, we could map the influence based on individual units, but we think it makes the most sense when thinking in terms of factions or teams.
Read now
Unlock full access