Repository navigation
Infantry Behavior Update
View the Behavior Map for a complete overview.
AI Brain
There will be 3 parts to the brain, as modelled after humans.
- Movement States
- Handles whether its moving, being physically active...
- Action States
- Handles whether its able to shoot, or heal, or use an ability
- Behavior States
- Handles whether it should take aggressive actions, defensive actions...
Behavior Types
- [[Aggressive]]
- Will move toward enemy units and actively engage.
- Will break formation to pursue enemies.
- High chance to use special abilities (grenades, suppressive fire, etc.)
- [[Defensive]]
- Will hold position and try to maintain formation.
- Will engage enemies only when they come into range.
- Low chance to use special abilities unless outnumbered or overwhelmed.
- [[Passive]]
- Will not engage enemies unless directly attacked.
- Will maintain position and will not pursue enemies.
- Will not use special abilities unless ordered to do so.
- [[Retreat]]
- Will actively move away from approaching enemies but engage when at a safe distance.
- Will try to lead enemies into traps or toward stronger allied units.
- Moderate chance to use special abilities when retreating.
Combining Behaviors
Another idea would be to allow for combinations of these basic behaviors to create more nuanced unit actions. For instance:
- Aggressive + Hold Fire
- Will move toward enemy but will not engage until attacked or ordered to.
- Defensive + Retreat
- Will hold position until overwhelmed, then fall back to another defensive position.
Adaptive Behavior
An "Adaptive" behavior could dynamically switch between these basic states based on the context. For instance, if outnumbered, the unit might switch to "Retreat" mode, but when allied units arrive, it could switch to "Aggressive" or "Defensive" based on a set of rules or player preferences.
UI/UX Considerations
How you allow players to control these behaviors is another consideration. A radial menu, hotkeys, or a control panel could all be good interfaces for this. Tooltips or short video clips could explain each behavior so that the player understands what each will do.
State Machine
Movement States
- [[Idle]]: The default state when the unit is not performing any tasks.
- [[Move]]: The unit is moving to a specific location on the map.
- [[Haste]]: The unit is moving fast and cant shoot
- [[Engage]]: The unit is moving in attack distance to another unit.
- [[Protect]]: The unit will follow another unit and stand in front of attacking units.
- [[Follow]]: The unit will follow another unit around.
- [[Roam]]: The unit is moving to a random position nearby.
- [[Patrol]]: The unit will follow a set path defined by the user.
- [[Capture]]: The unit is capturing a building or a resource point.
- [[Retreat]]: Quickly leave an area due to incoming artillery, airstrikes, or other hazards.
- [[Scout]]: The unit is exploring unknown areas of the map.
Action States
- [[Idle]]: The default state when the unit is not performing any tasks.
- [[Shoot]]: The unit is shooting at a target.
- [[Heal]]: The unit is actively healing or being healed (if it has such capabilities).
- [[Sabotage]]: Special action like planting explosives or disrupting enemy structures.
- [[Resupply]]: The unit is reloading or acquiring more ammo, possibly going back to a supply point.
- [[Assemble]]: The unit is setting up something on the battlefield, like a mortar or a machine gun nest.
- [[Embark]]: Entering a transport vehicle or aircraft.
- [[Disembark]]: Exiting a transport vehicle or aircraft.
- [[Fortify]]: The unit digs in to gain defensive bonuses but becomes immobile.
- [[Communicate]]: Contacting other units or HQ for special orders or status updates. Could be a part of other activities but could also be its own state, especially for units with special communication equipment.
- [[PerformSkill]]: If the unit has special skills or abilities, this state manages the activation and cooldowns.
Behavior States
- [[Passive]]: The default state when the unit is not performing any tasks.
- [[Aggressive]]: The unit is actively attacking an enemy unit or structure.
- [[Defensive]]: The unit is in a defensive position, possibly behind cover, and prepared to counter any enemy actions.
- [[Dead]]: The unit has been eliminated and is awaiting removal from the game map.
Sub-Behavior States
- [[Hold_Fire]]: Unit will shoot only when shot at.
- [[Hold_Position]]: Unit will not move for any reason.
- [[Hold_Formation]]: Unit will not change formations.
Squad Behavior States
- [[Free_form]]: The squad is free to move adaptably.
- [[Spread_Out]]: The squad is in a free form state but is more spread out.
- [[Wedge]]: The squad is in the form of a wedge pointing to a destination or target.
- [[Line]]: The squad is in the form of a line perpendicular to the destination or target.
- [[Diamond]]: The squad is in the form of a diamond. Optionally while escorting a friendly.
