Space Engineers

Space Engineers

[APck] AutoPillock Core 1.0
cheerkin  [developer] 12 Feb, 2024 @ 12:30pm
Description
AutoPillock is general-purpose control script with focus on grid movement, formation management and combat.
This script sums up most things I've made in areas related to grid flight: combat, autodocking, formations, missile, clangdrives, weapon controls, gravity drives, this kind of stuff.

This is 1.0 release of the previous AutoPillock. It has breaking changes so some blueprints need to be updated, at least their CustomData, because certain commands were changed or removed.

New version puts a high emphasis on Behaviors and Conditions (see command:add-condition). Conditions are checks that you set up to be executed during specific task. The result of the condition is command, which can change the state/behavior/etc of the agent. For example, ram task was removed (it was used for missiles), since you can replicate it using behaviors/conditions (evasion mode, triggering timers based on distance, warhead detonation, etc, everything is fully covered).

Another big thing is more sophisitcated 1-directional thrust controller, which now enables precise flight (before it could only fly at max speed like a missile). Now it can do almost anything, including usage of fixed guns, landing and formation flight. You can have 1t missiles that are accumulated around you in formation and then used all at once to strike multiple targets

New version has targeting interface reworked and put in line with new TGP (which is finally released). It introduces a concept of target queries - a way to select targets suiting criteria. It also handles multi-targeting better, allowing attack many targets at once using sub-unit missiles or drones.

Feature highlights
While it may be not the best in some areas, it can replace a few dozens of scripts on its' own.
One pb for everything
Drone/missile/carrier/torpedo are the same thing. Missile can fly and fight like a drone, and carrier can ram target and detonate its' warheads, and a drone can dock on a missile, because why not.
Move/Follow
Point, formation, docking navigation, landing to surface, planetary circumnavigation, player crosshair follow.
Cruise
Keep altitude, speed control, gravity align, zero-g mode near planet, planetary circumnavigation (orbit), limited collision avoidance.
Fight
Different attack behaviors for point or targeted entity attacks. Advanced vanilla and custom weapons control.
React
Automatic configured threat response - free fire, missile launch, attack, etc.
Surprise
Condition-based commands autorun during combat (chance, target type, target size, etc), changing combat face (weapons can be installed in all 6 directions), sudden ramming, etc.
Brawl or snipe
Jab - inertial torpedo launch using ship acceleration.
SubUnit - drones can launch owned guided missiles.
SubUnits
Ref-hack antenna-less agents that run in the same physical PB and can be dynamically added any time any quantities (missile, drone, etc).
They can have their own sub-units, and this recursive structure is ran by a single PB.
Missile/ram
Missile behavior (arm warheads, evasion mode, trigger timers), space-planet or planet-space pathfinding (circumnavigation).
Single thrust or 3d thrust, gravity or even clang drive missiles.
Organize
Wingman: dynamically configured formations based on subordination tree.
Routing: commands can be mass-issued using global/wingman/sub-unit/index/tag filtering.
Dock
Autodocking to any friendly ship (moving or rotating - it does not matter) with navigation graph support (for closed-type carriers)
Business
Cargo: simple trade behaviors (pull or push certain type of cargo).
Repeat behavior for making shuttles with multiple docking stops, waiting, timer triggers, etc.
Persistence
Task queues can be saved permanently and executed automatically or by trigger. Repeat behavior for cyclic tasks.
Almost every thrust type possible
Built-in thrust control:
  • Gravity drive
  • Normal 6-dir thrust
  • Single direction thrust
External thrust provider script support:
  • Two types of clangdrive (mass shift, MMF)
  • VTOL
  • Rover (very basic at the moment)

Modules

Tactical Graph
Formations based on tree subordination. Tree is formed based on ranks and/or proximity. Commands can be issued to the whole attached wing and propagated down.
WeaponBot module
Handling guns
  • Ripple fire mode with individual gun aiming.
  • Switching based on weapon cooldowns, combat distance accounts for available weapons.
  • Support for weapons in all 6 directions.
  • Default weapon accuracy is 2/5m for ripple/pressure weapon groups.
Weapon support
  • W2 vanilla
  • Custom groups with velocity, range, accuracy settings.
  • Player-made weapons like AK-125/8, piston jolts, etc.
  • torpedoes with timer/proximity fuse
  • internally-controlled missiles (aka Sub-Units)
External combat script integration:
  • RWC (custom turrets and rotor-displacement cannon)
  • GRA/GAPS (gravity active protection system)
Condition-based commands autorun during combat and decisions on special weapon usage (missiles, torpedo jabs).
  • Trigger chance
  • Target type
  • Target size
  • Availability of torpedoes
  • Availability of sub-units
Captain module
Task queue management. Default task, wait for signal, repeat task, etc.
Target environment analysis, listening to global targeting link and designator turrets.
Assigns attack orders to WeapBot and move orders to Pilot.
Desides how to react on nearby threats.
Desides how exactly to fly to task position (flight behaviors, circumnavigation, carrier sphere avoidance, altitude checks, etc).
Raycast point, rangefinder, GPS reader to provide simple targeting alternative to TGP script.
Gateway to Command script that allows RTS-like fleet control.
Pilot module
Flight and rotation.
Controls gyros and thrusters to get the grid in a certain spot and rotation, or delegates this task to ThrustProvider service for VTOL/Clang/Rover.
ApckUnit module
Responsible to collect only blocks that are logically relevant to the agent. For example, one grid can be a bunch of drones dead-merged together, and ApckUnit resolves that.
Recursive initialization of units (one PB can control many "virtual" units like drones or missiles that are dynamically initialized and detached by merge block, they don't need antenna).
DockHost module
Provides docking/departure services for friendly agents.
Two modes:
- simple, when no navigation graph is attached - one approach waypoint above connector, no locking.
- navgrapth - runs a* navigation algorithm to tell an agent the shortest route from entry point to assigned dock or vice versa. Allows building complex routes to internal hangars.
Targeting module
Polls designator turrets for targets, provides simple filtering like minimal size.
Listens to global targeting datalink.

Mods support
Mods are not supported explicitly, but many of them work. Sometimes you just need to tweak some variables like max-speed. See FAQ on how to make it work with WeaponCore.
Last edited by cheerkin; 12 Feb, 2024 @ 12:31pm