Space Engineers

Space Engineers

View Stats:
AI drone design - a cautionary tale...
Like many of you I've been testing out the new AI blocks and came up with a design for a cargo drone with a forward facing connector.

https://steamcommunity.com/sharedfiles/filedetails/?id=2970618388

This type of design can be problematic due to the nature of the AI behavior. It connects beautifully 100% of the time. However, disconnecting from the connector is a whole different issue. The problem is once it disconnects it will immediately try to turn to face the direction of the first assign way point and in this process, even with collision detection enabled, it will smash into the base connector causing damage to itself scaling from light damage to catastrophic damage...

There is no built in mechanism for it to back away from the connector before making it turn so I will need to add extra AI blocks to ensure that this happens. Otherwise, this particular design is quite capable of traveling long distances and refueling itself without too much hassle and at the correct speeds for cruising and docking.

What I love about the design and AI system is how smoothly it controls the drone as it transitions between "outer space" and the gravity well around the moon. My tests has the drone traveling between a surface mining facility and an orbital platform. It will automatically re-orientate itself with the moon surface immediately upon entering the moon's gravity well, even if it was traveling upside down relative to the moon's surface.

There's no issue with cargo drones with downward facing connectors as it simply lowers and raises itself accordingly from the base connector. With forward facing connectors it requires backing away which is not a function that by default is provided by the AI block and needs to be added to the design spec for it to function correctly.

I've also made a push-pull design (connectors both front and back) like the sample cargo drone Keen has provided. This works without issues as it will have AI components with the correct directional facings for each connector.

Honestly, I do really like the AI blocks despite their limitations; they allow for a lot of creative freedom but does force you to pay attention to fine details.

Hope this helps if you're trying to build something similar.
< >
Showing 1-6 of 6 comments
This PC May 2, 2023 @ 3:51pm 
How to do docking/undocking on this game:

You will need:

1 event controller to detect when cargo has emptied.

8 timers

2 AI flights
One is configured for precise movement on, collision avoidance off, and 5m/s. Docking one.
The other is configured precise movement off, collision avoidance on, 50m/s. Movement one.

2 basic task
This one is to take the ship to a waypoint near the connector, get it close to the beginning of the approach vector. The other is for a following task after undocking, if needed.

2 recorders
One has a full docking approach recorded, as such: https://puu.sh/JFmsy/ac7d53eb29.png, the other is for undocking, and will take the ship from 3 to 2.

Start procedure with timer 1

Timer 1: triggers AI flight movement block, triggers all other AI behaviors off for safety. Then triggers timer 2.

Timer 2: trigger basic task block to take ship to designated waypoint near the vector. Basic task block then triggers timer 3.

Timer 3: Turn on AI flight block for docking, turn off all other AI behavior, start timer 4.

Timer 4: triggers AI behavior and play on recorder with the full approach vector. Ship will proceed to land on the connector. Recorder then triggers Timer 5.

Timer 5: Turns on the event controller that checks if cargo is empty, use conveyor sorter under connector to automatically empty cargo. Obviously, turn on connector too, turn off all ai behavior, but leave the docking AI flight block on. Once cargo is empty, event controller triggers timer 6.

Timer 6: Connector unlocks, play the second recorder, this one should take ship away from connector in a precise path above it, same as the approach vector. This one triggers Timer 7.

Timer 7: Turn off all AI behavior, turn on AI flight movement block.

Timer 8: turn on whatever automation you want to happen after that, like an additional basic task block that will make the ship fly near your home.

Once you have that setup, you can also "branch" with another event controller, make a different sequence for charging batteries with the same concepts in mind. ♥ The gist of it is "You should record a path for docking and undocking, and make sure you have precise movement/collision avoidance off at the moment of docking/undocking".

Am sure there are ways to do it more efficiently, but this works reliably enough for me. :D
Last edited by This PC; May 2, 2023 @ 3:56pm
Dan2D3D  [developer] May 2, 2023 @ 4:17pm 
Hi, I can only say; Well done Engineer, keep trying and testing different setups, because it's how we find better and simpler solutions that uses less blocks as possible.

+
It's new and we will surely get better with kind members sharing working solutions :selike:
Dan2D3D  [developer] May 2, 2023 @ 4:24pm 
I will add :

It's better in space to do perfect lock with connector placed on all sides, not the same on Planets because the Drone always fly with its front pointing forward over there and open for suggestions by creating a Portal vote Feedback.
Last edited by Dan2D3D; May 2, 2023 @ 4:32pm
Trackdancer May 2, 2023 @ 5:55pm 
You don't actually need an event controller to check cargo load status or refueling hydrogen tanks either.

What I do is to configure my bases to have receiving and shipping connectors, respectively. Receiving connectors uses a sorter to pull cargo from the drones (but requires a bypass to allow the ship to refuel hydrogen). Shipping connectors simply uses a sorter to push goods into the drone's cargo space. This takes like 30 seconds for either transactions. Likewise setting the drone's Hydrogen tanks to fill happens in about the same time span.

So all you need is a timer block that is set to trigger in 2 seconds to lock the drone's connector on arrival and set it's tank to fill then pass control to a second timer.

This second timer is set to trigger in 60 seconds and disconnects the ship from the connector, stops the H2 tanks from draining and triggers the relevant AI movement blocks.

What I need to do for my design is to add AI blocks to move the drone to a departure point away from the base by backing it out before allowing it to implement it's trip to the other base.
This PC May 2, 2023 @ 5:59pm 
Aww yis, maybe we'll arrive at a fully optimized method communally. xD
DivineEvil May 3, 2023 @ 1:06am 
What I chose to do is once the drone docks to the station connector, it automatically disables the Task ECB. Once it have emptied out, it disconnects from the connector, enables two overriden thrusters to fire and activates another timer. That timer in turn triggers after 3 seconds, disables the thrusters and enables the Task ECB. This way it smoothly backs off from the connector with just 3 additional blocks.

Technically you can also stack multiple Increase Thruster Override orders on a single timer by attaching it multiple times on different taskbars and then reverting it the same way on undocking timer, so that you won't need extra thrusters, but I just prefer not to use that stacking method.
Last edited by DivineEvil; May 3, 2023 @ 1:11am
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: May 2, 2023 @ 3:14pm
Posts: 6