Space Engineers

Space Engineers

Whornet ASF (Area superiority drone)
cheerkin  [developer] Mar 29, 2019 @ 5:22pm
Advanced features - knowledge base and your questions
Q: Any other targeting options other than turret AI?
A: Yeah, it has two other options - pirate GetNearestPlayer and Camera Raycast. Those will go to separate target vector "channel" though, and to attack drone has to have specific waypoint activated.

Q: Pirate GNP?
A: Change the grid to SPRT faction. The drone will target the nearest player (including you) within 20km (I believe) range.

Q: How to use TGP's raycast for locking?
1. Place camera named "coaxial-cam" for target designation.
2. Place cameras named "scan-array-cam-xx", the more the marrier.
3. Use argument "command:scan" on TGP.
*. For actual attack use argument "command:force-wp:gatle his♥♥♥♥♥off" on Autopillock
("command:scan" while pointing coaxial-cam to actual target). After successful locking you should see increasing ParseVectorsCount on Autopillock PB output, that indicates it's getting data from TGP. At this point you can force APck to activate engagement waypoint.

Q: What is the [clock=12] tag for?
A: It sets frequency of PB run. 12 means every 12th tick, it averages to 5 runs per second. I recommend setting 1 for host, 12 for drones.
Lower the number the faster refresh, but the higher the simpseed impact.

Q: Can I set my main ship as the host without the script controlling it, so I can still fly it and have the drones escort me?
A: Sure, just keep it in default state of Disabled cruise control. Check the CustomData and remove "command:set-mode:WP" which forces them to start acting. With empty CustomData they should not iterate through waypoints.

Q: I'm not sure I follow how to script swarm formations.
1. Replace [drone] tag with [host] tag in PB name, this will be the master ship.
2. Enable wingman broadcast on it by making PB CustomData look like this (all commands new line):
toggle:turret-response
toggle:broadcast-wingman
instead of
[command:wp-next]
3. After you spawn [drone] grids they should hook up to host and go to formation.
- "toggle:turret-response" switches drone react to enemy grids on/off,
- removing the "command:pillock-mode:WP" from Custom Data init sequence leaves autopilot an Disabled state so you can fly it yourself.
- "toggle:broadcast-wingman" will switch on formation vectors transmit for all registered peers (drones).
4. Optional. If you want your drones to attack a distant target, you have to toggle:broadcast-vectors on host. Vectors should be provided to host by its' TGP script, or by GPS coordinates command.

* after changing init sequence in Custom Data you want to either recompile the script or ctrl-x ctrl-v the whole grid.
** and you can do this for pirate faction ships - set up a host ship, change its faction to SPRT, then change a drone to pirate faction, then copy them in any numbers. This way drones won't spread out and will always return to their master ship.
Basically this is the way I set everything up in that arena battle video, the concept is pretty simple.

===============Hints for own drone basic design.===============

Remote control named "autopillock-remcon".
Gyro named "forward-gyro".
Easy orientation note: place gyro on top of Remote block, gyro control panel same orientation as front of remote block.

Fixed-mount weapons: group them into "coaxial-weapons".

For Grav Gen exclusions on large grid gravity drive based ships(eg. Defiant Mk2):
Find in the source:
b => Fw.CubeGrid == b.CubeGrid
Replace with:
b => Fw.CubeGrid == b.CubeGrid && !b.CustomName.Contains("tag")
That will exclude GGen with "tag" in it's name from grid's propulsion system.

===============Arguments/Custom Data===============

command:pillock-mode:WP
Enables APck and starts the first waypoint.

command:force-wp:{wp name}
Forces the drone into specific waypoint. Waypoint is more like behavior rather than specific coordinates in space.

Currently available waypoints:
find host - the first waypoint by default, drone searches for host by sending handshake sequence
init - sequence for repeated merge block slug strikes
gatle his♥♥♥♥♥off - close combat, basically as when AI turret detects an enemy, but uses TargetVectors data "channel" (guided from host ship or by onboard TGP)
request docking - asks host for free docking connector
Missile strike - for host to use drones as guided missiles. All drones will receive commands: command:recycle, command:pillock-mode:WP, command:force-wp:ram.
ram - use drone as guided missile (going to current TargetVectors in adaptive spiral pattern, then arm warheads, turnoff artificial mass, fuse warheads, etc)

command:set-value:{key}:{value}
Sets various parameters at runtime (best used in Custom Data of PB).
cqb-distance - Sets Close Quarters Battle distance (for turret intercept / gatle his♥♥♥♥♥off).
avoid-dz - true/false - sets enemy sphere avoidance at CQB, defaults true.
salvo-distance - sets the range that a Draugr or other similar drone will stay at to deliver repeated merge block slug strikes before entering CQB.
salvo-wave-count - sets the amount of merge block slug strikes.
cq-jab - if set to zero switches the CQB Jab parameter off. A Jab is a solid merge block slug strike at very close range.
inertia-gyro-divisor - default is 7. Regulates the amount of signal the gyros receive. Larger is recommended for heavy ships with lots of gyro power like Draugr. Set this to 1 and then increase if you see that your drone oscillates around aimpoint.
follow-formation-on-start - default is true. Drone goes to formation position (data "channel" WingmanVectors).

toggle:{key}
Switches stuff on/off.

broadcast-wingman - for host, gives all peers their position vectors (data "channel" WingmanVectors).
broadcast-vectors - for host, gives all peers current target vectors (data "channel" TargetVectors).
stealth-antenna - for drone, sets antenna radius to 1000m after successful handshake with host.
turret-response - sets if drone would interrupt its' current activity to engage targets dictated by AI turret (data "channel" TurretVectors).
wingman-circle-rotation - for host, sets cool looking circling formation On/Off for its' connected drones.
damp-when-idle - sets if the APck should use dampening when idle (switched to WP mode but with no actual data for waypoints).

===============Customization via named timers===============

There is a "hook" that tries to run a specifically named timer block whenever the drone starts or ends a waypoint. This way you can add some actions that can run PB with arguments, changing the control flow of the Autopillock.

Notation for timer naming:
{waypoint name}.OnStart
{waypoint name}.OnComplete

For example, timer block named "small threat response.OnStart" would be triggered when a small grid drone engages small grid detected by designator turret.

If you want the drone to dock to the host grid after the very first engagement, you can make a timer named "small threat response.OnComplete" and the action for timer would be to run Autopillock PB with argument "command:force-wp:request docking".
Last edited by cheerkin; Jun 7, 2020 @ 2:09pm
< >
Showing 1-15 of 84 comments
cheerkin  [developer] Mar 29, 2019 @ 5:23pm 
gatle his♥♥♥♥♥off = gatle his аss off
Pas2704 Mar 30, 2019 @ 6:53am 
Thanks for making this. It helps a lot.
Pas2704 Apr 2, 2019 @ 3:42pm 
The antenna on my ship after running the command says > u: 3546.9 (0) Approaching ACCELERATING"
cheerkin  [developer] Apr 2, 2019 @ 4:32pm 
Hard to say without knowing the setup.
u: 3546.9 means that your ship is doing ram sequence, we know that already. Maybe antenna on the other ship somehow echoes message back, or some other weird stuff. I've never experienced anything like that under normal circumstances.
It all depends on grid setup at the moment of initialization. I'm currently experimenting with mass-launch weldable missiles, it's actually quite tricky to auto-startup them without APck being greedy on other grids' references and such.
cheerkin  [developer] Apr 2, 2019 @ 4:43pm 
Just tested that and haven't been able to reproduce.
1. Pasted Draugr with TGP and stock Beluga.
2. Executed command:connect-all on host, toggle:broadcast-vectors.
3. Executed command:bc:command:force-wp:ram on host. Beluga switched to ram waypoint.
4. Raycasted the target, Beluga went off normally. Host remained idle.
Last edited by cheerkin; Apr 2, 2019 @ 4:44pm
Radar Apr 6, 2019 @ 3:37pm 
Just have few questions. Raycasting with cameras don't seem be working properly. It wont detect an enemy ship 1km away. Also, isn't Autopillock a remote control block.. not sure how you run the attack argument on it. BTW I'm using Blake's refit of your drone.

What im trying to do is make carrier where I can hit a button and all the drones deploy and attack. But, I want to stay out of the enemy turret range. I only need it to be able to target at about 1.5km. If you give some tips on how to do so. It would help out alot

I cant seem to find where this script is posted ether. So i can setup my own drone easier.

Thanks
cheerkin  [developer] Apr 6, 2019 @ 5:35pm 
This build has the latest Autopillock and TGP scripts in it.

What happens when you do raycast command on TGP block? You can hit alt-F11 and enable Debug Draw to see how all that goes.
Reasons I can think of:
1. coaxial-cam isn't warmed up (you have to wait a bit untill it can scan longer away).
2. The cockpit is misaligned with coaxial-cam and you actually miss your cast (the cross is displaced). I recommend to always try placing camera and your flight seat aligned at one line.

Autopillock is a programmable block, named a-autopillock in this build.
cheerkin  [developer] Apr 6, 2019 @ 5:40pm 
For getting wingmen to attack distant target, see this in the FAQ above (just added)

4. Optional. If you want your drones to attack a distant target, you have to toggle:broadcast-vectors on host. Vectors should be provided to host by its' TGP script, or by GPS coordinates command.
Last edited by cheerkin; Apr 6, 2019 @ 5:40pm
Radar Apr 6, 2019 @ 8:53pm 
Ok, I figured out how to make them follow the carrier but, how do you tell all the drones to dock to the host. Then, undock and follow the host again. Also, I dont really understand how the Tgp script gets vectors or how to send the drones to attack once it has the vector of the enemy ship.
Last edited by Radar; Apr 6, 2019 @ 8:53pm
Radar Apr 6, 2019 @ 9:23pm 
I kind of wish you could just guild the drones by where the host ship is pointing and direct them to the target. kind of like the Whips optical missile script but, without the missile part.
cheerkin  [developer] Apr 7, 2019 @ 4:02am 
For docking check the main comment thread, it can be tricky. I use docking mostly for returning, there is no behavior "undock and attack" implemented yet. After docking I "recycle" drone to reset its' state, then disable connector and it goes to wingman formation again, to repeat attack cycle if needed.

That's a really nice idea, and I have such implemented in my old missile builds (it's like real-world SACLOS guidance type). Would be cool to guide drone squad towards enemy area. I'm going to add this to my TODO list.
Radar Apr 7, 2019 @ 9:13am 
Also, I did some tests with a host ship and 5 drones following. Had them attack some large ship. I actually crashed my gpu drivers and as expect the game also. My plan was to use your script on a server call Embrace The Lag 1. I'm bit afraid it will cause a sim problem on the server.

I love the complexity and flexibility of the script. It would be nice to have maybe have a more performance friendly version or different scripts that are specifically focused for certain tasks. kind of like how in Rdav's Fleet Command MKII, he has different modules for each class of ship.

I did mange to get the raycasting to kind of work.. seems like raycasting is bit hit or miss. Maybe Keen borked raycasting in someway last patch?
cheerkin  [developer] Apr 7, 2019 @ 12:14pm 
Yeah I know what you are talking about, sometimes I'm getting progressive performance loss out of nowhere, like memory leak or something, but haven't figured the source of the problem. A while ago that was not the case, I used dozens of drones doing combat, even two factories printed drones non-stop for arena kind of battle. Also a few people use APck drones on live PVP servers without noticeable simspeed impact (for far longer uptimes that I do in my tests).

Some performance problems are in the nature of SE, for example, gravity drives cause bigger impact. So it depends on grid and the amount of time it actively moves around.

Had some raycast stability issues too recently, so who knows... I've just switched to PGNP locking for drone testing purposes to focus on other features atm.
cheerkin  [developer] Apr 7, 2019 @ 12:19pm 
GPU crash had nothing to do with scripts I suppose. Today I did tests of two big drones (100s of gravity gens and amasses on each) versus really huge battlecruiser. It was OK until they engaged in turret range, at that point simspeed dropped because of shots, explosions, collisions, turret scans for targets and so on.
cheerkin  [developer] Apr 22, 2019 @ 6:04am 
Originally posted by Warhawk402:
I'm bit afraid it will cause a sim problem on the server.

I did some experiments and I can confirm with sadness that there is a memory leak issue on TGP side when checking for AI Turret targets. Trying to figure out the exact problem spot.
Last edited by cheerkin; Apr 22, 2019 @ 9:47am
< >
Showing 1-15 of 84 comments
Per page: 1530 50