Space Engineers

Space Engineers

Not enough ratings
Inertial space flight
By Survival Ready
Manual for installing and configuring the inertial flight scenario for the EasyPlay script
   
Award
Favorite
Favorited
Unfavorite
Installations and setup
This is a scenario for the EasyPlay automation script, which allows you to move through space in inertial mode without turning off the dampers. The destination point is determined by the lidar, and the scenario calculates the desired acceleration speed and the starting point for braking by the reverse thrust engines. The scenario can be used for asteroid exploration of ores and approaching other ships and bases in space. This method of movement significantly saves time and hydrogen compared to flying on an autopilot, especially at the stage of approaching the target. Scenario demo on Reddit

The scenario can be used on any ship with any thrusters, including modified ones. You will need:
  • program block with installed EasyPlay script
  • forward/backward thrusters of any type that work in space
  • lidar camera facing forward
  • any LCD panel or cockpit screen (optional)
  • scripts must be allowed in world settings

Update: if your ship has a remote control unit installed, then you can significantly increase the accuracy of approaching the target. Use the scenario code from "Custom Data" of this ship
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2948868560
Installing the script
  1. Download the latest version of EasyPlay from the Steam Workshop to the programm block
  2. Copy the scenario code into the "Custom data" field of the program block from this manual

Scenario setup
  1. create two groups in the game control panel named "Thruster Fwd" & "Thruster Bwd"
  2. using the "Toolbar Config" panel, drag the EasyPlay block icon to a free digital panel of the ship's control block (cockpit, station, etc.) and select "Run", in the options window that appears, enter "fly4(go)"
  3. disconnect from the ship all grids docked through connectors and mergers, which can be dynamic, for example, drones or custom missiles
  4. turn the ship into outer space
  5. press the button from step 2 on the digital panel
  6. wait until kr & kb coefficients are calculated*

Custom Data @var block
  1. set the value kr & kb of the coefficients obtained during the calculation the resulting values
  2. specify block name of the LCD, which will be used for telemetry output, or an empty value ("") if you do not plan to output data
  3. specify the exact block name of the camera, which will be used as a lidar
  4. change, if necessary, the values of other variables
@var { * name of the LCD panel or cockpit block (in [] screen number) lcd = "Cockpit[0]" * lidar camera block name camera = "Camera R_LIDAR" * raycast range in meters range = 15000 * minimum distance to the target after stopping mind = 30 * %% acceleration of thrusters forward when racing over = 100 * acceleration and deceleration thrust coefficients kr = 0.0227 kb = 0.0601 }
* If you do not output telemetry, then open the terminal, select the EasyPlay program block in the Control Panel and look at the coefficient value in the echo area.
In case you are already using EasyPlay on your ship, add the @var block variables to your global variable block, and place everything else below your code in the "My data" field. Check that the new variables do not conflict with those already set. To reduce the load, set the debug variable of the EasyPlay script to false. After setting up the script, you can remove the @setup block from the "Custom data" field of the EasyPlay program block.

Script execution
Turn the ship with the camera on the target and press the button selected in step 2 "Scenario setup" on the digital panel. First run after calculation of parameters will be with a delay that the camera needs to initiate raycast. Then the script will work without delay. For 15 km, the delay will be 7.5 seconds. The distance to the target is calculated from the camera, keep this in mind when setting the minimum distance.

The flight is in a straight line. The script scans the target once at the start of the flight and no longer uses lidar. For too ships that are not balanced in terms of forward / backward thrust, the accuracy of approaching the target may be unattainable.

You can interfere with the control of the ship at any time and interrupt the scenario by pressing one of the WASD control keys.

Hint: The script can be used to fly anywhere in space. To do this, the value of the GPS coordinates in "Custom data" cameras must be installed manually or other EasyPlay scenario.
Secnario code
@var { lcd = "Cockpit[0]" camera = "Camera Lidar" range = 15000 mind = 30 over = 100 kr = 0 kb = 0 lidar = Data of \camera dist = Distance \lidar of MyShip cont = Operate of MyShip s = 0 b = 0 x = 0 y = 0 z = 0 w = 0 } @fly4 { \s = 0 \b = 0 @check if Damp of MyShip = False { Damp of MyShip = True } if \kr ? "." { if \1 ? "go" { @scan } if \dist > 0 { \x = math((\mind/\dist)*100) if \x > 70 { @info(Stop,Reach) } } } else { @setup(50) } if \lidar ? GPS { @speed(0) if \s = 0 { @info(Stop,Reach) } OnOff_On (Thruster Fwd) OnOff_Off (Thruster Bwd) Override of (Thruster Fwd) = \over% @race Override of (Thruster Fwd) = 0 OnOff_On (Thruster Bwd) @brake \x = math((\mind/\dist)*100) if \x < 70 { @fly4 } @info(Stop,Reach) } else { @info(Fly,No GPS) } } @race { if \b < \dist { \y = math(Speed of MyShip + 1) if \s < \y { Override of (Thruster Fwd) = 0 \y = "Free fly" } else { \y = "Racing" } \x = OperAxis of \cont if \x = True { @info(Stop,Break) } else { @info(\y/\s,\dist/\b m) } Delay 100 @race } } @brake { if Speed of MyShip > 1 { \x = OperAxis of \cont if \x = True { @info(Stop,Break) } else { @info(Braking,\dist m) } Delay 100 @brake } } @speed { \z = math(\1+10) if \z < 101 { \x = math((Mass of MyShip/10000) * \kr * \z * \z) \y = math((Mass of MyShip/10000) * \kb * \z * \z) \w = math(\x + \y + \mind) if \w < \dist { \b = math(Int(\y+\mind)) \s = \z @speed(\z) } } } @check { \x = OnOff of \camera if \x != True { @info(Stop,Camera turn off or not found) } else if Number of (Thruster Fwd) = 0 { @info(Stop,Group (Thruster Fwd) not found) } else if Number of (Thruster Bwd) = 0 { @info(Stop,Group (Thruster Bwd) not found) } else if \mind < 1 { @info(Stop,"mind" must be > 0) } else if \over < 1 { @info(Stop,"over" must be > 0) } } @scan { Scanr of \camera at \range if \dist > 0 { @info(Scan,\dist m) } else { @info(Scan,No Target) } } @info { \w = math(int(Speed of MyShip)) if \lcd = "" { Echo = "Mode: \1\NTarget: \2\NSpeed: \w m/s" } else { Write to \lcd = "Mode: \1\NTarget: \2\NSpeed: \w m/s" } if \1 = Stop { Over of (Thruster Fwd) = 0 OnOff_On (Thruster Bwd) Data of \camera = "" Stop } } @setup { \s = Speed of MyShip if \s < 1 { \s = cond(\1 > 99 : 99 : \1) OnOff_On (Thruster Fwd) OnOff_On (Thruster Bwd) @sout(Calculate...) \y = Grid Pos of MyShip Data of \camera = \y OnOff_Off (Thruster Bwd) Override of (Thruster Fwd) = \over% When Speed of MyShip > \s \z = Distance \lidar of MyShip \y = math(\z / (Base Mass of MyShip/10000) / (\1*\1)) \w = "Racing: \z m\Nkr = \y" \z = Grid Pos of MyShip Data of \camera = \z Override of (Thruster Fwd) = 0 OnOff_On (Thruster Bwd) When Speed of MyShip < 1 \z = Distance \lidar of MyShip \y = math(\z / (Base Mass of MyShip/10000) / (\1*\1)) @sout(\w\NBrake = \z m\Nkb = \y) } else { @sout(Stop the ship) } Stop } @sout { if \lcd = "" { Echo = \1 } else { Write to \lcd = \1 } }
Example ships
Longitudinally balanced miner on a small grid. Hydrogen thrusters. Telemetry output to the main cockpit screen.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2857349245

Courier ship with five times the forward thrust over brake thrusters on a large grid. Hydrogen-ion thrusters. Telemetry output on two LCD screens.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2797281330