Free and Open Source real time strategy game with a new take on micro-management

Difference between revisions of "Gradients"

From Globulation2

Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Glob2 directs globs around by means of gradients. For example, to find the nearest wheat field a glob moves to the adjacent square with the highest wheat gradient repeatedly until it hits a wheat square. This is referred to as a "hill-climbing" algorithm.
This developers article has been moved to http://globulation2.devjavu.com/


Each cell on the map has a "gradient" defined for each player, for swimming and non-swimming globs, for each of the following actions:
Please go there to find in. Thank you.
* Forbidden area
* Guard area
* Every type of resource
* Every building


In other words, there are (width * height * TotalPlayers * 2 * (2 + TotalResources + TotalBuildings) cell gradient values defined.
[[Category:NewWiki]]

Gradients are first defined for individual squares in various functions, then those values are propagated around using the Map::propagateGradient() function. Gradients are reduced by one for every square away from a target item (e.g. a wheat square for the wheat gradient).

At least for the Guard Area this approach has a serious [[solution to the guard area distribution problem|problem]] as warriors will always only find the closest guarding area patch and ignore all others.

[[Category:en]]
[[Category:Developer Resources]]

Latest revision as of 22:31, 6 June 2010

Glob2 directs globs around by means of gradients. For example, to find the nearest wheat field a glob moves to the adjacent square with the highest wheat gradient repeatedly until it hits a wheat square. This is referred to as a "hill-climbing" algorithm.

Each cell on the map has a "gradient" defined for each player, for swimming and non-swimming globs, for each of the following actions:

  • Forbidden area
  • Guard area
  • Every type of resource
  • Every building

In other words, there are (width * height * TotalPlayers * 2 * (2 + TotalResources + TotalBuildings) cell gradient values defined.

Gradients are first defined for individual squares in various functions, then those values are propagated around using the Map::propagateGradient() function. Gradients are reduced by one for every square away from a target item (e.g. a wheat square for the wheat gradient).

At least for the Guard Area this approach has a serious problem as warriors will always only find the closest guarding area patch and ignore all others.

Misc