Space Engineers

Space Engineers

Not enough ratings
Soft Landing Manager
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
98.056 KB
21 Dec, 2024 @ 6:54am
29 May @ 12:03pm
3 Change Notes ( view )

Subscribe to download
Soft Landing Manager

Description
Automatically manage your thrusters to land safely on planets while optimizing your fuel and energy use. Also, it autolevels your ship, scans the ground below, and guides your ship during the descent to avoid slopes and (hopefully) land on flat terrain !

What, yet another suicide burn/hoverslam script ?
Yes... but specifically designed for use with :
- inverse square law gravity mods such as Real Orbits
- high speed limit mods such as 1000m/s speed mod


If you're not using both of these, then the script is not really needed. However if you do, then you know it's much harder to manually manage landing on planets having gravity fields extending more than 100km above the surface, and ships capable of descending at dangerously high speeds, without depleting your tanks or slamming on the ground at high speed because of a deceleration burn started a few seconds too late.

In addition, it's even more useful for :
- ships with realistic vertical thrust (ex : capable of only 1.5g upwards)
- planets with diameters larger than 120km (Console Spawn Planet)

Version 2 - 2025-05-29 - Large update adding terrain avoidance, ship leveling, and more !

Functions
- computes and follows an optimal vertical speed profile for the descent
- prioritizes electric thrusters (atmospheric and ion) before using hydrogen ones, to save on H2
- uses a radar (raycasts from a downward facing camera) to measure your altitude way above what the game normally provides (useful for planets with gravity extending more than 100km from them!)
- (new in v2) keeps your ship level (copy of Flight Assist "Hover Smart" mode)
- (new in v2) scans the terrain below the ship and guides it down the slopes to find flat terrain for a safe landing
- (updated in v2) computes and show the maximum gravity that your ship can handle for all atmosphere densities
- provides an estimate of the surface gravity for the planet
- warns if the ship is not capable of landing on the planet
- automatically deploy parachutes if about to crash
- supports all Vanilla thrusters and Aryx-Lynxon Drive Systems

Installation
- (recommanded) configure the names of the ship controller (cockpit, helm etc.)
- (needed for terrain avoidance) install one or two downwards facing camera on your ship, with the proper tag in their names
- (optional) configure LCDs, timers, sound blocks etc. as needed, see below for the functions they provide
- install the script in a programmable block
- recompile the script to let it autoconfigure itself

Usage
- Set your ship in the gravity field of a planet
- Activate mode1 or mode2 to have the script manage your descent
- (optionnally) Set vacuum or atmosphere mode, or select a planet to optimize the descent profile
- Steer your ship to land on flat ground or let it manage it automatically (you can provide inputs at any time that will override automatic horizontal guidance)
- Once landed, check if the script automatically switched to mode0 (off), if not turn it off yourself

See a detailed user manual on Github :
https://github.com/silverbluemx/SE_SoftLandingManager

Command line arguments
Basic commands
- off : turns the script off (the LCDs still give you information about your ship capabilities)
- mode1 : activate a descent mode that prioritizes electric thrusters (atmospheric and ions) It fires the ion thrusters early to bleed the gravitational potential energy and reduce the work left for the hydrogen thrusters. However this uses more total electrical energy than mode2
- mode2 : activate a faster descent mode that fires thrusters only when needed. It is possible to switch between mode1 and mode2 during the descent, for example use mode2 to let the ship pick up speed, and then switch to mode1 to try and maintain that speed using ion thrusters
- mode3 : the script only manages autoleveling (copy of Flight Assist "Hover Smart" mode)
Advanced commands : planet surface conditions
- vacuum : tell the script to expect vacuum at the planet surface (atmo thrusters won't work, max ion efficiency)
- atmo : tell it to expect atmosphere at the planet surface (atmo thrusters will work, low ion efficiency)
- unknown : tell it that the surface atmosphere conditions are unknown (default setting), the script will consider the worst-case scenario considering the thruster mix of your ship, to be on the safe side
- earth, mars, pertam etc. : optimize the script for the selected planet from the catalog
Advanced commands : guidance during descent for terrain avoidance
- angleoff, angleon and angleswitch configure whether terrain avoidance will tilt the ship to guide it during descent
- thrustersoff, thrusterson and thrustersswitch same for the forward/back/left/right thrusters
Advanced commands : other
- leveloff, levelon and levelswitch : switch on/off the autoleveling
- Arguments can be combined together (ex : mode1mars, mode1angleoffthrusterson)

Ship configuration
Add the following tags to your ship functional blocks, as needed. The tags can be changed in configuration, if needed.

SLMref RECOMMANDED : Reference controller (seat, cockpit, etc.) to use for the ship orientation. This is optional, if the script doesnt find a controller with this name then it tries to find another suitable controller on the grid.

SLMradar RECOMMANDED : Name of downward-facing camera used as a ground radar (to measure altitude from very long distance and also account for landing pads above or below a planet surface). It is recommanded to have two of them and they need to have unobstructed view below the ship with a wide angle of view.

SLMignore OPTIONAL : Include this tag in any block that you want this script to ignore. For example, thrusters on an auxiliary drone.

SLMdisplay OPTIONAL : Name of the main display for the script (there can be any number of them, or none at all)

SLMdebug OPTIONAL : Additional debug display for the script (there can be any number of them, or none at all)

SLMlanding OPTIONAL : Name of timer blocks that will be triggered a little before landing (ex : extend landing gear)

SLMliftoffOPTIONAL : Name of timer blocks that will be triggered a little after liftoff landing (ex : retract landing gear)

SLMon OPTIONAL : Name of timer blocks that will be triggered when the SLM activates (ex : by the command "mode1")

SLMoff OPTIONAL : Name of timer blocks that will be triggered when the SLM disactivates (ex : by the command "off", or at landing)

SLMsound OPTIONAL : Name of a sound block used to warn if expected surface gravity is higher than what the ship can handle or the ship is in panic mode (incapable of slowing down enough)

Tips & others

More info (with FAQ and troubleshooting tips) on Github :
https://github.com/silverbluemx/SE_SoftLandingManager

If the script doesn't turn off when landed, check what altitude reading you get when stable on the ground, and put that value in altitude_offset in the configuration.

Use adjustable landing legs combined with my other script to land on uneven terrain.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3388676061

Planets in the images :
Tohil by Major Jon : https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2296726670
Pyke by Elindis : https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3028738424

Ships in the images : my own

Some features and code are copied from Flight Assist by Naosynth.

Comments/questions/bugs
Feel free to use the comment section.
14 Comments
Leconite 9 Jun @ 10:49am 
Yeah, the breaking burn would accomplish a good deal of the automated asteroid landing.

Obviously, in gravity, "down" is set by the environment, a pilot could start landing upside down, and the script would fix it.
In space, we don't have that luxury. The simplest way of initializing terrain avoidance might be to set "down" to the ship's downwards direction on landing activation..
It's up to the pilot to orient the ship correctly before initiating an automatic landing.

It may be a good idea to make space landing activation dependent on having a radar lock "altitude" to the landing target; and auto abort the landing if lock is lost.
silverbluemx  [author] 9 Jun @ 5:57am 
1. Is easy, will do.
2. Maybe. The notion of "landing" could be adapted reasonably easily (manage a breaking burn to reach a very small speed when contacting the asteroid). But terrain avoidance is built around the notion of "down" and "horizontal". It would be complex to adapt, and won't fit in what little I have left before hitting the 100 000 characters limits (I don't want to have to minify, this is what I learn C# with so I want to produce somewhat readable code 😉). Other scripts such as Sam's Autopilot Manager may be a good option for you if that's what you want.
3. Multi display as in cockpits and such ? Sounds reasonable.
Leconite 6 Jun @ 7:15pm 
Some feature ideas,
1. Commands to turn the radar on/off in mode 0. Use case, to get/display the "altitude" when manually landing on an asteroid in space.
2. A mode for landing with terrain avoidance in zero gravity. Use case, automatically landing on an asteroid in space.

Useful when the ship is ~ 100m square and masses 14K tons empty & ~ 85K tons loaded.
Even at 0.1 m/s that thing is going to land / impact with a lot of force.

3. Support multi display blocks.
Leconite 5 Jun @ 1:48pm 
OK, cool, I thought it would not work unless Real Orbits was used.
silverbluemx  [author] 5 Jun @ 12:59pm 
@Leconite : well to test it out you can always subscribe to Real Orbit and not add it to your world 😉. I just did a test with a new world in pure vanilla, and it freaks out here and there but because world speed limit is 100m/s, it's not so bad, and close to the surface it gets better. So, to get a taste for what it does and see the terrain avoidance function in action, go for it !
For the next version, I'll try to make it work somehow in vanilla, and take your advice on naming.
Leconite 4 Jun @ 3:44pm 
Is it possible to not require the Real Orbits mod.
I would love to test this out in vanilla. :-)

Also, setting the ship's directional reference via the WMI convention of choosing a controller with "Reference" in it's name might be a good idea.
silverbluemx  [author] 30 May @ 4:27am 
New version released with Aryx-Lynxon Drive Systems support built-in !
Check it out with the new terrain avoidance function ! (don't expect perfection from it just yet...)
silverbluemx  [author] 19 May @ 10:01am 
@xxxZohanxxx : could you tell me more (ship type, grid size, what's on it etc.) Share screenshots if you can. One quick troubleshooting advice is to look at what the script says (in the programmable block window) when you compile it. Does it say "Found a ship controller:" or "Using configured controller:" and if so, is the controller name the one you expect ? The script only detects and uses thrusters that thrust upward from the point of view of the ship controller. You can add "SLMref" in the name of the block to make sure the script uses the one you want.

@Schmoobledeedoo : I've seen it featured, I'll definitely check it out ! (Space Engineers definitely benefits from more engineering and I'm a big KSP fan !)
xxxZohanxxx 17 May @ 2:36pm 
Hi. I have a problem: the script doesn't see any vanilla thrusters (Found 0 h2/ion/aero lifters). There are no modified thrusters in the grid.
Schmoobledeedoo 19 Apr @ 11:00am 
@silverbluemx, I've made a really good KSP simulacrum in SE, dm me to check it out!