Clone wiki

Warfare / Faction_Behavior

Faction Behavior - WIP


Introduction

Warfare, at the moment, operates based on defensive and offensive squads. Patrol squads will be introduced soon, however I want them to exhibit more complex behavior than the previous version of warfare.


Defense Squads

Defensive squads are squads which are idle at a base or resource. Defense squads will only spawn at bases, and will have to travel to resource points in order to defend it (or offensive squads become defensive squads when they reach their target).


Offense Squads

Offensive squads are squads which are sent out to capture targets. They spawn at bases and will target both bases and resources. Offensive squads should have a different spawn rate than defensive squads, though that is not the case at the moment.


Multiple targets per base

Bases can target multiple other bases or resources. This is controlled by a setting in warfare_options.ltx or the warfare options menu. Each faction has their own variable controlling this, so for instance army_max_smart_targets_per_base would control how many bases or resources a base owned by the military would typically focus on.


Multiple squads per target

Each base can send out multiple squads per target. Just like the above setting, this is controlled via warfare_options.ltx or the warfare options menu, by a variable called *faction*_max_active_squads_per_target.


Target prioritization

I will detail the prioritization code here shortly.

Distance Priority

  • To be expanded.

Base Priority

  • To be expanded.

Resource Priority

  • To be expanded.

Faction flag priority

  • To be expanded.

Is being targeted priority

  • To be expanded.

Target weaker priority

  • To be expanded.

Target stronger priority

  • To be expanded.

Updated