Space Engineers

Space Engineers

[SCAM] Simple Concurrent Adaptive Min3r
 Denne tråd er blevet fastgjort, så den er sikkert vigtig
cheerkin  [udvikler] 5. maj 2022 kl. 4:21
Set-up guide
Quickstart
Watch the quickstart video guide (first one).
https://www.youtube.com/watch?v=n0Cbl-Pv-Qc

Take a look at this world upload with all three drones and dispatcher ready.

Dispatcher (base)
Prepare the carrier. This can be either mobile rover/carrier or station.
  1. Build PB, antenna, power source
  2. Build connectors that face upwards (drones would descend and dock using their bottom connector). Connectors should contain "docka-min3r" in their names (this tag can be changed on the top of the code).
  3. Get Dispatcher boot command batch from the main page and place it into PBs' Custom Data.
  4. Get the code into the PB editor, recompile.
  5. Optional: build two Wide LCDs and put their names into the add-panel and add-logger CustomData lines. Alternatively, name those screens so they have "scam-log-panel" and "scam-gui-panel" in their names
  6. Optional: build control seat in front of your "scam-gui-panel" and name it to match the "command:add-gui-controller:scam-controller" line.

Agents (drones)
  1. Get the min3r of choice or build your own (guide on how actually to would be added later).
  2. UPDATE the code in the drones' PB, make sure Dispatcher and all Agents run the same version. I re-upload blueprints far less often that the SCAM script itself (this workshop item).
  3. Check the Agent boot command batch from this page. It may be more up-to-date than the one inside.

After you have Dispatcher and Agents up, make sure they are linked together. Agent PB should show DispatcherID in it, and Dispatcher PB should list all active Agents (subordinates).

I recommend starting with a command:create-task from an Agent. Fly it manually to the point of mining, place it above with some spare altitude (not lower than terrain slopes around you). If you are on planet, running command:create-task would start a mining task centered on that point, and shafts would be aligned with gravity (exactly downwards). If you are in space, then the Agent orientation would determine that mining direction, so align it accordingly. Do not use the system for a asteroid mining inside planetary gravity area - it would consider this planetary mining and would mess everything up.

The Dispatcher would accept the task and broadcast mining command to all active drones, respecting the group-constraint (see script arg reference discussion).

If you take a look at the logging panel (or Dispatcher PB screen if you don't have one) you'd see GPS points that describe your mining task. They can be used later using command:create-task-gps (see script arg reference discussion).

Having a camera on an Agent or Dispatcher would allow you to designate a mining task using command:create-task-raycast. Point a camera to the ground, and run that command while still looking through that camera. If you are on planet, avoid using that on terrain slopes - in that case it's better to drive a drone there and do old-fashioned command:create-task.


Drone building guidelines

Before making the drone of your own, take a look at stock models.

Flight control code is based on AutoPillock core and supports all types of thrust, including gravity drive.

Required blocks

  • PB for SCAM code.
  • Connector facing down.
  • Gyroscope named "forward-gyro" (can be changed in the code - ForwardGyroTag). The gyro should look forward the drills and connector, i.e. down to the mining area.
  • Remote control
  • Antenna with enough broadcasting range
  • At least one thruster in every direction.
  • Drills facing downward. They can have connector between them in a chessboard pattern.

Reference gyro orientation

The drone considers it's forward direction based on how you placed forward-gyro. It would align itself with gravity or mining plane based on gyro orientation, and it would mine forward.

When mining or travelling around, the drone considers the forward-gyro position the pivot point of the drone. It is recommended to place the forward-gyro as close as possible to the middle rotation axis of the drone (ideally, when you roll-override the gyro, the gyro should stay in the same world space spot).

Drill placement

The code would attempt to estimate the "circular-pattern-shaft-radius" value automatically based on drill positions. If you want to override it, just place command:set-value:circular-pattern-shaft-radius:{value} below the set-role command in Custom Data boot batch.

Thrusters

The drone needs enough thrusters to support itself on max load in the highest G environment you want it to operate in. That is absolutely required for bottom-facing thrusters that would do the most weight-lifting.

You need some side-facing thrust too. If the drone tilts in G-environment, side thrusters would contribute more to the total lift, while downward thrusters would reduce their contribution. At high angles the drone can find itself being unable to support itself, in this case the code stops, releases control and turns vanilla dampeners on (the drone would probably float to the ground and crash unless you save it with manual rotation adjustments).

You need at least one thruster facing upwards, even if you don't expect the drone to fly tilted so much.

Timer triggers

You can add timer following naming convention
{MinerState}.OnExit
{MinerState}.OnEnter

Where MinerState is
[Disabled, Idle, GoingToEntry, Drilling, GettingOutTheShaft, GoingToUnload, WaitingForDocking, Docking, ReturningToShaft, WaitingForLockInShaft, ChangingShaft, Maintenance, ForceFinish]

The code would try to run appropriate timer when it changes state. For example, you can have Maintenance.OnEnter timer turning a sound block on, then Maintenance.OnExit timer do the opposite.
Sidst redigeret af cheerkin; 16. juni 2024 kl. 13:26
< >
Viser 1-15 af 35 kommentarer
cheerkin  [udvikler] 5. maj 2022 kl. 4:56 
Marredone 5. maj 2022 kl. 14:09 
Thank you!
bosselorentzon 23. maj 2022 kl. 0:16 
Thx and y did a realy good job:)
cheerkin  [udvikler] 23. maj 2022 kl. 1:26 
Another one by Pro100tv. Shows a lot about adaptive mining feature, how it works and how to activate it:
https://www.youtube.com/watch?v=ftAl8DTeXQ4
2yysforu 15. okt. 2022 kl. 10:45 
Unfortunately I'm unable to get them to work, unless it's flat ground where the pickup spot is other than that they just crash continuously.
PlasturdPanda 5. jan. 2024 kl. 15:27 
Mine gets stuck waiting to dock, idk why
nathanaguiar 18. feb. 2024 kl. 9:01 
what is "Dispatcher boot command batch" not very clear instructions as to what or where it is
cheerkin  [udvikler] 18. feb. 2024 kl. 13:28 
"Get Dispatcher boot command batch from this page and place it into PBs' Custom Data."
I think its kinda clear, you know what Custom Data is, right? You go to the main page and get Custom Data text for Distpatcher and copy it there. I'm afraid if you are stuck at this point you will have very hard times with this script.
Jack Schitt 16. juni 2024 kl. 10:14 
Oprindeligt skrevet af cheerkin:
You go to the main page and get Custom Data text for Distpatcher and copy it there.
The code you use in the setup video isn't anywhere on any of the pages related to this script. Was it removed or something? Please repost it.
cheerkin  [udvikler] 16. juni 2024 kl. 13:21 
The video says: "get this stuff from WS page of the script". Is this not clear somehow? There is a script, and it is published to workshop, thus having a workshop page. When you subscribe to a script, you are on that page. And CD contents are there, as said in the guide.
cheerkin  [udvikler] 16. juni 2024 kl. 13:25 
The code you pasted (in the message you deleted later) is correct - I won't re-make video every time there is a new command. I will rephrase that part of this guide to avoid confusion (from this page -> from main page).
Jack Schitt 16. juni 2024 kl. 13:34 
Cheerkin,

The code you use in the video is not anywhere on any of the pages related to this script.
The code you use in the video has 'public int's at the end of it.

Your instructions contradict the video.
Oprindeligt skrevet af Cheerkin:
Get Dispatcher boot command batch from this page and place it into PBs' Custom Data.

- That code is NOT in the description text. LOOK...lol
- The code I'm asking about (in the video) was pasted into the Code Editor of the PB, not the Custom Data, as the instructions say.

Your instructions are not clear.

Looks like an awesome script! Where's the code to get it going?
Sidst redigeret af Jack Schitt; 16. juni 2024 kl. 13:42
cheerkin  [udvikler] 16. juni 2024 kl. 13:42 
Ah, the code itself? Is it your first experience of using WS scripts? You get the code using game interface, click a button to browse your subscribed scripts and get it into editor. The code may look not exactly like it does in the video, it does not matter.
Jack Schitt 16. juni 2024 kl. 13:45 
For all that's holy, Cheerkin. Read your own instructions. The code you use in the video is not on any of these pages.

I may be blind but I'm not an idiot. English is my language and I've been coding since 1982.
I've been using scripts in this game since 2013.

the code you use IN THE VIDEO is not on the page
cheerkin  [udvikler] 16. juni 2024 kl. 13:56 
There are two things you need:
1. The script code. It is distributed via steam, as other scripts do, it goes into PB code editor, and apparently it is not found on any of pages here.
2. The custom data batch. It is found on the main page.
< >
Viser 1-15 af 35 kommentarer
Per side: 1530 50