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.
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 can attach to other blocks 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.
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.
Usage[]
- Select whether you want to Attack either "Enemies" or "Enemies and Neutrals".
- 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.
- 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.
- 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.
- 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.
- 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".
- 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.
- Choose a guidance type:
- Circle/Orbit
- 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.
- The Facing Mode determines what side of the drone turns towards the enemy.
- Switch on AI Behavior to make this the active block of its type.
Best Practices[]
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.
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.
To give drones different strategies, add at least one Event Controller and extra AI Offensive and AI Defensive blocks. For example, if the Event Controller detects that the ammo cargo is empty, either retreat to reload - or switch to "intercept" to turn this drone into a kinetic missile.
Recipe[]
AI Offensive | ||||
---|---|---|---|---|
Component | Large Ship/Station Required | Large Ship/Station Optional | Small Ship Required | Small Ship Optional |
Interior Plate | 20 | — | 2 | — |
Computer | 20 | — | 10 | — |
Motor | 4 | — | 2 | — |
Detector Components | 20 | — | 4 | — |
Construction Comp. | 30 | — | 5 | — |
Steel Plate | — | 20 | — | 2 |