User Tools

Site Tools


4rpl:commands:floodfillterrain

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:floodfillterrain [2022/11/05 09:22] – MaxSize definition clarified Karsten754rpl:commands:floodfillterrain [2024/03/16 12:31] (current) – old revision restored (2022/11/07 19:34) Vertu
Line 18: Line 18:
 FloodFillTerrain(GetUnitCell(self) 1 20 999999) ->listOfCells FloodFillTerrain(GetUnitCell(self) 1 20 999999) ->listOfCells
 </code> </code>
 +
 +==== How FloodFill Works ==== 
 +
 +FloodFill starts at the center and looks at the four adjacent cells - above, left, right, below. If the cell matches the criteria, it is added to a list. 
 +
 +Now FloodFill iterates over each of the cells in the list, but not checking cells that has been checked in a previous iteration. So, assuming the cell "above" matched criteria and is in the list, will cause it's left (also diagonal left from start cell), above, right (again, also diagonal right from start cell), but not below, since that has already been checked. 
 +
 +This process iterates for as many iterations as "maxsize" and the total number of cells returned and their locations are dependent on the topology of the terrain. 
 + 
 <=[[4rpl:start| Index]] <=[[4rpl:start| Index]]
  
4rpl/commands/floodfillterrain.1667654546.txt.gz · Last modified: 2022/11/05 09:22 by Karsten75