Clone wiki

Warfare / Dynamic_Patrols

Dynamic Patrols - WIP


Warfare will begin having a new patrol system introduced over time. Initially it may not be fully featured, although there are plans to make it more complex and cover more behaviors.

General behavior

Initially, patrols will be assigned to one base. That base will be the primary driving factor for the squads behavior. Depending on the situation surrounding that base, patrols will react differently.

Smart terrains should have threat level analysis. The value should increase when more enemies are around the base, and decrease when the base is perceived as safe. This will be detailed further in the next section. Bases will also have a frequency and magnitude variable for patrols; this value will also be able to be set via the simulation_objects_props.ltx file.

Initially, bases should have the highest magnitude of patrols, frequency however shouldn't be all that high. Resources should have a higher frequency, but a lower magnitude.

Threat analysis

Current level analysis

The current level should of course be analyzed first by the smart terrain. If an enemy base is found on the current level, then it will be analyzed further. The closer the base is, the more of a threat it poses. The larger a base is, the more of a threat it poses. max_population should be the variable considered when analyzing how large a base is.

If a base sees that there is an enemy base nearby, then it will increase magnitude and frequency of patrols. Each faction should have a global variable which influences this, along with each base having individual variables which influence magnitude and frequency of patrols. This way, maximum control is kept in the hands of the player.

Other level analysis

If there are no enemies on the current level, then bases will begin analyzing nearby levels. Levels should not be analyzed one at a time. Instead, all smart terrains from the nearest n levels should be added to a table. The table should probably be sorted by assigned threat level, as then we can randomly choose from the top 2 or 3 highest threats to avoid the same thing occurring every playthrough.