AI Offensive

From Space Engineers Wiki
Jump to navigation Jump to search
AI Offensive
Icon Block AI Offensive.png

Category: Functional
Function: makes drones attack

Fits small grid
Mass: 156.0 kg
Power: 0.01 MW
PCU: 25
Size: 1x1x1
Time to Build: 10 sec

Fits large grid
Mass: 900.0 kg
Power: 0.01 MW
PCU: 25
Size: 1x1x1
Time to Build: 24 sec

Data Controls: [edit] [purge] (?)

The AI Offensive block is a functional Automaton block in Space Engineers.

Use this block to let a drone perform extremely complex tasks including target identification, targeting priority, and execution of complex attack patterns. You determine what the Offensive AI shall consider a potential threat.

This AI Block is of type "Combat" and provides waypoints to AIs of type "Move". For other Combat blocks, see AI Defensive.

When an AI block of type "Combat" detects an enemy within 2500m (line of sight), it deactivates any AI blocks of type "Task" and activates itself; when no enemies are nearby, it deactivates itself and returns control to the AI Task block.

Usage

Requirements

The AI Offensive block functionality depends on the presence of other AI Blocks: Build an AI Flight block and configure it as well.

If you want a faction to be detected as "Enemy", you need to have very low faction standing or declare war.

How to make drones attack

  1. Select whether you want to Attack either "Enemies" or "Enemies and Neutrals".
  2. To make the drone target players (boarders on foot or with jetpacks) as well, enable Target Characters. To target ships/drones/vehicles/stations, disable this option.
  3. Select a Target Priority:
    • To attack the nearest enemy first, select Closest. But this can prevent from joining the main battle.
    • To team up against the enemy capital ship or fighters, select Largest. But this will let enemy PBWs slip through.
    • To focus on clearing out enemy PBWs, select Smallest. But that also makes them focus on already defeated wrecks.
  4. Decide how often the drone should switch targets by setting the Target Search Interval. Set a value between 5 and 60 seconds. The default is 30.
    • If your drone follows the first enemy (or its drifting wreck...) too long, even after more threatening enemies have arrived, decrease this value.
    • If your drone pauses a lot or switches targets erratically, and never finishes the obvious targets off, increase this value.
  5. Tell the drone which enemy subsystem to consider a threat by setting the Threatening Subsystem:
    • Default - attack any enemy including wrecks
    • Propulsion - attack enemies with thrusters
    • Weapons - attack enemies with block weapons
    • Power systems - attack enemies with functioning batteries etc.
  6. Choose an Attack pattern:
    • Circle/Orbit
      Harrass slow enemies by circling them.
      • Circle Distance -- Pick a distance between 100 and 2000 metres. For example, set the distance to a bit less than your turret's maximum range.
      • Circle in P.Gravity -- Enable this to tell the drone to take planetary gravity into consideration and fly horizontally. Disable this in space to fly in any zero-g orbit.
    • Stay at Range
      Follow an enemy from a distance:
      • Min Distance -- Tells the drone to not get closer than this, for example, stay further away than the enemies turret lock range. Must be between 0-1999 metres and must be less than Max Distance.
      • Max Distance -- Try to not fall behind further than this. Must be between 1 and 2000 metres and must be more than Min Distance.
      • Evasive Maneuvers -- Enable this to have the drone move randomly within the min and max distance, in case the target is shooting back. Disable this to have it just follow steadily like a sniper.
    • Hit and Run
      Attack, break off to retreat, re-engage, repeat.
      • Break-off distance -- When the drone is this close to the enemy, it should retreat. Set a value between 50 to 2000 metres. Make sure this is larger than the braking distance of your drone, or you risk crashing into the enemy.
      • Retreat distance -- When the drone retreats, it should retreat this far from the enemy before starting another attack run. Set a value between 50 to 2000 metres.
      • Retreat timeout -- How long the drone should try to reach the retreat distance. After this time has passed, it will stop retreating and start the next attack run anyway. Set a value between 1 to 30 seconds.
      • Retreat angle -- The angle of the retreat vector relative to the attack run. Set a value between 0 to 180 degrees. 180 means "retreat by returning where you came from", and 0 means "retreat by continuing in a straight line from your attack run".
        Hit and Run, examples of different retreat angles
      • Pass over target -- If the engagement is taking place in planetary gravity, and the retreat angle is larger than 90 degrees, the drone chooses a retreat waypoint above the target.
    • Intercept
      Simply ram the enemy. Use this for PBW with warheads. In this case, you cannot choose a gun.
      • Choose a guidance type:
        • Basic: The drone will attempt to reach the current location of the target.
        • Target Prediction: The drone will attempt to reach the predicted intercept point: It will “lead” the target.
      • Override Collision Avoidance. Leave this enabled to let the PBW/missile hit the target. Disable this if the drone should attempt self preservation.
  7. Choose how you want the drone to use weapons. Weapons choices are not available for "Intercept" AI behavior.
    • The Facing Mode determines what side of the drone turns towards the enemy.
      • Use Static Weapons -- Add static weapons to the drone and it will turn them towards the enemy.
      • Manual Facing Priority -- Select one or more directions among front/backwards/up/down/left/right. For example, if the drone has automatic turrets for strafing, you want it to turn the sides with the best armor or lowest profile towards the enemy! If it has static weapons, make it turn those towards the enemy.
    • If you have selected "Use Static Weapons", select an Available Weapon from the list and click Add Weapon to make the drone use it. Or select a Selected Weapon from the list and click Remove Weapon to make the drone stop using it.
  8. Switch on AI Behavior to make this the active block of its type.

How to command multiple drones

To choose targets before releasing the drones from their docking connectors, create Groups and add relevant actions to your cockpit toolbar or a Button Panel.

For example:

  • Assign the AI Behavior on/off actions for a group containing all docked AI Flight and AI Offensive blocks.
  • Assign the three Set Target Priority: Closest/Smallest/Largest actions
  • Assign the three Target Propulsion/Power/Weapons actions

You can also split up your drones and assign different targets to subgroups. And so on, depending on your strategy.

How to improve aiming

The first selected weapon is used as the aiming reference when leading a moving target. If you mix weapon types, aiming quality will decrease for the other types, so stick to one weapon type per drone. If the drone uses static weapon types, make sure they point in the same forward direction.

Switch the target priority before releasing the drones: To attack an enemy base, do not keep the threat priority set to "propulsion". If you set the attack priority to "weapons", remember that this will exclude unarmed kinetic missiles.

Can a drone switch strategies?

An example for different strategies is, if an Event Controller detects that the ammo cargo is empty, then the drone should retreat to the base to reload. Or it should switch to "intercept" behaviour to turn itself into a kinetic missile. Etc.

To give drones different strategies:

  1. Add Sensors or Event Controllers to detect the condition
  2. Add extra AI Offensive/AI Defensive blocks, each set up for a different strategy.
  3. Depending on your custom conditions, switch the active AI block off and the other on.

Don't try to manage different strategies all in one AI block by fiddling with all its settings in flight. Make each AI block good at doing its one task.

Construction

If Progression is on, build a Basic Assembler and some lighting blocks first to unlock this block. The block is 1x1x1 blocks in size and it exists for small and large grid. It has mount points on all sides. The block is not expensive and can be built in early game, similar in cost to an ore detector. AI Blocks require 10 kW of power to work.

Recipe

Icon Block AI Offensive.png AI Offensive
ComponentLarge Ship/Station
Required
Large Ship/Station
Optional
Small Ship
Required
Small Ship
Optional
Icon Item Interior Plate.png Interior Plate202
Icon Item Computer.png Computer2010
Icon Item Motor.png Motor42
Icon Item Detector Components.png Detector Components204
Icon Item Construction Comp..png Construction Comp.305
Icon Item Steel Plate.png Steel Plate202


Functional Blocks