Space Engineers

Space Engineers

Not enough ratings
[Obsolete] Bumblebee Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
11.037 KB
10 Oct, 2015 @ 11:14am
17 Dec, 2015 @ 3:24am
12 Change Notes ( view )

Subscribe to download
[Obsolete] Bumblebee Script

Description
Script to control your disposable drone swarm. Currently is experimental and does not have collision detection built-in. This script is meant to control cheap and disposable fast moving drones for disruption and sensor detection purposes.

This is a vanilla script. No mods are required.

Note: Script is highly experimental with no collision detection yet. Many navigation and coverage issues are yet to be resolved. One script controls one drone and one drone only.


Key Uses

This script is designed purely to do 2 things:

1) Control a swarm of fast moving cheap drones to distupt and confusing enemy AI turrets by flying erratically around them and turning decoys on and off.
2) Transport the Sensor to be used by Ansible Dispatcher Script, for detecting a large group of enemy ships.


Dispatch Mode

Dispatch mode is used for multiple bumblebee configuration. Bumblebee will listen on a Dispatch Text Panel (default CMD) for the name of the actual Text Panel containing the orbit coordinates. This allows selection of different orbit points (coordinates in different Text Panel).

Typically the same bumblebee will be duplicated using projector blueprints or copy and paste. This results in the same script and same set of names which confuses the script. Dispatch mode solves this by separating the bumblebee from ship grid using the closest merge block or rotor detach with respect to the programmable block, before initializing the reference blocks.


Notes

- If Drift Function is used and your vectorPointMid is far off from center of mass, use "midToCenterOfMassDist" to compensate. See below or screenshot for more information.


Required Setup

- A reference block named V_MID in the middle.
- A reference block named V_FRONT in front of V_MID.
- A reference block named V_TOP on top of V_MID. Latest update: If left blank, it will randomly select a top point.
- At least one gyroscope on the ship. You can save it under group named GYROS if you want script to use specific set of gyroscopes, otherwise group its optional.
- At least one thruster facing backward relative to the ship. If no such thrusters are found, script will not activate any thrusters. Manual activation will be required in this case.
- A Text Panel named CMD for inputing targeting command.
- (Optional) A sensor named LSENSOR. This sensor is used to detect ships to orbit. Initially a fixed point is chosen to orbit. When the sensor detects a ship, it switches to that ship instead.
- (Optional) A remote control named LREMOTE. This remote control is used for additional target finding via the built-in GetFreeDestination function.
- (Optional) A decoy named DECOYS or a set of decoys with group named DECOYS. This decoy will be turned on and off randomly.


Additional Setup For Dispatch Mode

- A set of Targeting Text Panels with unique names of your choice, for input targeting command. The original CMD Text Panel's Public Title will instead be used to select the required target by inputting one of the Targeting Text Panel's name.
- A group of Merge Blocks, Rotors or Advanced Rotors named DISPATCH. This group can be a mix and match of Merge Blocks, Rotors or Advanced Rotors. When the bumblebee received targeting command from the specified Targeting Text Panel, it will separate itself from the ship grid using the Merge Block, Rotor or Advanced Rotor within the DISPATCH group that is the closest to the programmable block running this script.

Dispatch Mode Bumblebee Scattering On Launch

As multiple bumblebee can be launched using this mode, there is a high chance of collision within the bumblebees. You can use random launch delays to stagger the launch. There are 2 types of random stagger:

[RSL:<Min>:<Max>]

The bumblebee will launch and travel straight ahead for a time period before turning towards target. A random amount of time is selected from "Min" to "Max". The values are specified in seconds.

[RSD:<Min>:<Max>]

The bumblebee will stay attached and not move for a time period before launching. A random amount of time is selected from "Min" to "Max". The values are specified in seconds.


Orbiting Procedures

Enter target point to orbit into the CMD Text Panel's Public Title field (If Dispatch Mode is used, this should be the Targeting Text Panel). The format is:

[T:<X>:<Y>:<Z>]

Where X, Y and Z is the coordinate to orbit. You can set the script to randomly choose a distance to orbit between a specified minimum and maximum distance in metres using:

[T:<X>:<Y>:<Z>:<Min Dist>:<Max Dist>]

Note that the distance is not guaranteed.

If a sensor is specified using strGridSensor, the bumblebee will orbit the sensor detected ship as soon as the sensor detects it (provided the ship fulfils the minimum size requirement and distance away from origin). The bumblebee will randomly decides to switch to a newly detected ship.


Sensor Detection For Orbiting Ship

You can specify a sensor using strGridSensor to use for detecting ships to orbit. Script will initially start by orbiting a fixed location, then switch to orbit the ship when sensor detects them. Script will constantly evaluate new ships to orbit to maximise randomness.


Unique Command Locking

If you specify a number in front of the command:

100[T:10:10:10]

The script will only read the command once until the number "100" is changed to a different number.
To allow the script to read the next command again, you will specify 101[T:10:10:10] and so on.


Demo Worlds And Other Links

The following demonstration world and blueprint uses the Bumblebee Script:
http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=533481166
http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=533479304

See video attached for the script in action.


Special Settings

boolDrift - Can be set to true to force over-steering. This is used to compensate for the lack of side thrusters, if your bumblebee design is as such. (def: true)
boolDispatchMode - Can be set to true to enable dispatch mode. (def: true)
driftVectorReduction - For Drift mode only. Larger value results in smaller drift, smaller value results in more aggressive drifting. Do not reduce to less than 1. (def: 1.5)
approachSpeedLimit - Speed limit when bumblebee approaches a target point. Zero means no limit. Note: speed limit is not guaranteed. (def: 0)
defaultLaunchSeconds - The default launch time in seconds if not specified when entering command. (def: 1)
defaultMinSensorGridSize - When sensor detects a ship, the ship's diagonal size must be larger than this value in metres. (def: 25)
defaultMaxSensorDistFromOrigin - When sensor detects a ship, the ship must not be more than this distance in metres away from the last set orbit point using [T:<X>:<Y>:<Z>] command. (def: 1000)
orbitSensorGridMinDist - When sensor detects a ship to orbit, it selects a random point on the bounding cylinder of the ship. This value adds an additional distance in metres away from the ship. (def: 50)
useDampenerBraking - Use dampener for faster braking when ship is facing a reverse direction. (def: true)
oneTimeCommand - Dispatch Mode only. The one time command to be injected during dispatch mode initialization. Must start and end with square brackets "[" and "]".

-------------------- Text Limit Reached. See Discussion For Full Description --------------------
Popular Discussions View All (1)
0
10 Oct, 2015 @ 12:23pm
Bumblebee Script Documentation
Alysius
4 Comments
Cheetah 22 Dec, 2015 @ 1:45pm 
Woo, awesome. May I try to adapt it for radar mod and remote command system, so it could be used in my developing battle drone swarm system? Or we can work together for this.
Alysius  [author] 18 Dec, 2015 @ 8:04am 
@Woodzykiler Currently detection of antenna is not possible via Vanilla, mods must be used. You can mount AI turrets on the small drones to let it fire when orbiting an enemy ship.
MrFox 18 Dec, 2015 @ 6:12am 
Question, i wonder if this can be used in MP in many drone ships that have weapons on them?
Have the fighter drones orbit the enamy ship and let the turrets have a good time?
if not, would u make something that could launch from a moon base go to the enamy ship then return? and have it use an Ant. to deact the enamy ship then self launch? then maybe return or just stay in fligt? sorry for bad english
Alysius  [author] 25 Oct, 2015 @ 10:13pm 
No thoughts of it at the moment. It is quite hard to have collision avoidance in script, unless it is using the built in autopilot features.

Edit: Sorry, accidentally clicked delete!