Space Engineers

Space Engineers

评价数不足
GDMS - User Manual
由 StarWarsFTW 制作
This guide serves as the user manual for my Gravity Drive Management System (GDMS) in-game script for Space Engineers. You can find an explanation for everything the script has to offer here.


If you wish to reconfigure the script's settings, make sure to do so according to this guide. DO NOT experiment with settings on dedicated servers! A faulty configuraion may negatively impact server performance for everyone, not just you - please be considerate of other players' experience.


Should you have any questions that this guide does not answer, you can find me on the Alehouse Gaming community's Discord server[discord.gg]!

I may add an FAQ section in the future.


Updated for version 1.3.1P of GDMS.
   
奖励
收藏
已收藏
取消收藏
Getting Started
Gravity Drive Management System (GDMS) is an in-game script for Space Engineers used to achieve WASD/C/Space control of a gravity drive-equipped ship.

https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3608785948

Unsure how to construct such a ship, or perhaps why you would want to? Consult the "Building a Gravity Drive" section below.

Powering up
How does one use GDMS to control their gravity drive you ask? Well it is simple! The whole process takes just two steps:
  1. Load GDMS into a Programmable Block on your ship
  2. Profit!
NOTE: The Programmable Block needs to be placed on the same grid - not on a rotor, piston, hinge, connector or any sort of connective block aside from a Merge Block - for the script to work. Find out how to get around this constraint in the "Settings - Basic" section below.

Flight
GDMS will read Your controls from any cockpit you sit down in, or Remote Control block you take control of. You can fly your ship with WASD/C/Space controls just like you would with thrusters.

Inertial Dampeners are also used in GDMS, operated by the same switch you would use for thrusters.


Continue reading to find out about further script features, configuration options & more!
Building a Gravity Drive
GDMS controls gravity drives. But what exactly are those? And how do we build them? Or why even should we?

A gravity drive is an alternative method of propulsion using Artificial Mass blocks and Gravity Generators instead of thrusters.

NOTE: Many servers ban the use of gravity drives because they are an unintended side effect of the game's features - however the developers themselves do not consider them an exploit. Alehouse servers, for which GDMS is originally designed, allow gravity drives.

Benefits & Shortcomings
Gravity-driven ships dominate Player-versus-Player engagements on multiplayer servers for a good few reasons. Their benefits include:
  • Power - Ships using gravity drives reach accelerations far higher than anything possible with thrusters.
  • Resilience - A gravity drive needs no external components. It can be armoured up and hidden away inside the ship, and also consists of rather durable blocks.
  • Fuel - While hydrogen thrusters need hydrogen and ion thrusters eat lots of power, a gravity drive doesn't take any fuel and its power demand is also rather small.
  • Top Speed - Since a ship under gravity power is technically "falling", the maximum speed it can reach is actually a bit over 4 m/s higher than under thruster power!

However, there are areas in which gravity drives are slightly quirky, or unusable altogether:
  • Planets - A Gravity Generator's effect falls off as planetary gravity increases. At 0.5 G planetary gravity, these drives stop working completely. Even on moons, they are only 50% as powerful!
  • Balance - Unlike a thruster, an Artificial Mass block applies force where it is placed. This means putting all your masses on one side of the ship will result in turning, and your drives need to be properly balanced.

Construction
To be competitive, you should use every Artificial Mass block and Gravity Generator your server's limits allow. More speed = more better!

If building a physically tiny ship, or if not constrained by block limits, the best "bang for your buck" is achieved with roughly equal numbers of Artificial Mass blocks and Gravity Generators for each direction.

A Gravity Generator can invert the direction it applies gravity in, as can be seen on the associated slider. This means generators placed on the roof and on the floor can both contribute to vertical movement!

Each Artificial Mass block acts as a 50 t mass in generated gravity. Space Balls are an alternative to Artificial Mass blocks with a configurable mass setting. Make sure to always set them to their maximum of 20 t.

DO NOT move the Space Balls' sliders on servers! Dynamically changing their mass creates SEVERE lag!

Build your Artificial Mass blocks roughly centered on your ship's Center of Mass (shown through K -> Info -> "Show Center of Mass") to avoid aforementioned rotational effects. You will likely have to balance your drive later.

Make sure all your Gravity Generators' fields reach all Artificial Mass blocks!

For a video guide on gravity drives, check out Endar949's video:





Balancing a Drive
After building a ship, it is important to make sure its gravity drive does not rotate it excessively. In the worst case, this will negatively impact your accuracy with fixed guns!

When everything is placed down and all cargos are filled, your ship's mass is distributed exactly as it will be in its final form. You can now balance your drive.
  1. Look through a Camera - Zooming in on a fixed point, like a planet or a star in the distance (not the Sun, it moves) gives you a reference for how your ship rotates.
  2. Move in a single direction - Use GDMS to move in one direction and remember how the ship rotates with respect to your fixed point.
  3. Adjust the drive - Once you've tested all 3 movement directions, see what the observed effect means about your Artificial Mass placement. Ship pitched up going forward? This means your bottom was affected disproportionately and you have too many masses there - move a few to the top.
  4. Repeat - Doing this over and over will eventually yield a nearly perfectly balanced drive indistinguishable from thrust controls. Or you can quit when the process gets too annoying.

Spherical Gravity Generators
While a regular Gravity Generator applies gravity in the vertical direction relative to its placement, a Spherical Gravity Generator applies gravity towards or away from itself. This results in the resulting movement direction not being perfectly aligned with your ship's 6 axes.

GDMS automatically determines which movement direction is best to use a Spherical Gravity Generator with, however its placement is still important.

These generators should be placed symmetrically to cancel out any unwanted sideways movement, and should be placed as far away from your Artificial Mass blocks as possible to maximize effect.

Use the sphere_switch argument to toggle the use of Spherical Gravity Generators with GDMS.

NOTE: Spherical Gravity Generators are a crucial component of the Spherical Idle Shield. Visit the relevant section of the guide to learn more.
Setting up
So, you have constructed a gravity drive and are ready to start using it. This is where GDMS comes in! From the "Getting Started" section of this guide, you already know it is enough to just pop it in a Programmable Block and fly - but a true engineer wants to get the most out of their ship, so let's see what more we can do.

1. Specifying groups
While it is not necessary for the script to work, you may want to select which drive components to use or perhaps where to look for screens to display readouts on, as described in the "Other Features" section of this guide. Well, there are two groups you can specify:
  • The Main Group - Or just "group," should generally contain everything the script otherwise looks for on the whole grid automatically. This includes all drive components (Gravity Generators and Artificial Masses) and LCD surfaces (including multi-screen blocks) you want to use - notably you can exclude ship controllers (cockpits, remotes) as these are detected on the whole grid anyway.

    For the script to actually use this group, you need to set the UseGroup option to true as described in the "Settings - Basic" section of this guide.

  • The Priority Cockpit Group - The group of ship controllers (cockpits, remotes) GDMS will prioritize over others. If this group exists and contains controllers that somebody is currently controlling, it will ignore all other controllers on the ship in their favour. This does not require the UseGroup option to be set.

2. Toolbar arguments
GDMS can be controlled using arguments - text commands issued to the Programmable Block. These affect how the drive operates, and can be put on toolbars by selecting the "Run" action for the Programmable Block.

The main argument you may want to use is drive_switch - triggering this argument enables/disables the entire gravity drive along with its components. It is recommended to disable the gravity drive when not in use in order to prevent unnecessary activation, costing performance.

For a complete list of available arguments, consult the "Settings - Basic" or "Other Features" sections of this guide.
Settings - Basic
While GDMS works out of the box, you may want to use some of its setup options to configure it according to your liking. You can find these in the Programmable Block's Edit field (where you loaded the script).

Note that changing settings inappropriately may result in the script misbehaving!

Each setting is briefly described with commentary in the script itself, together with their default values.

These settings are intended to be configured by users. This does not mean changing them without knowing what they do carries no risk! Always consult this guide before changing something you aren't quite sure about the function of.

Timings
The script can run its code up to 60 times per second, as there are 60 so-called "ticks" per second in Space Engineers. It however does not need to, and doing so may cause unnecessary performance load. Different parts of the script therefore run at different timings.

Setting
Default value
Description
TickDelay
4
Number of "ticks" GDMS waits between controlling the gravity drive. This is the main functionality of the script. High numbers will lead to noticeable input lag but decreased performance impact.
MassDelay
10
Number of "ticks" the drive needs to be inactive (dampeners off or no movement) before GDMS turns off Artificial Mass blocks. Prevents frequent switching, which increases performance impact. Higher delays increase risk posed by ramming attacks (see the "Spherical Idle Shield" section of the guide).
SearchDelay
900
Number of "ticks" GDMS waits between scanning your ship for blocks it can use, including Artificial Mass blocks and Gravity Generators. The check for docking to a static grid is also performed according to this setting (see the "Performance Optimization" section of the guide).
ScreenDelay
9
Number of main runs (defined by TickDelay) GDMS waits between updating readouts on screens and in the Programmable Block's terminal's bottom right corner.

Groups
GDMS can use block groups to further specify blocks it should work with and control. This provides greater control than the default "out of the box" mode of operation at the cost of slight setup complexity.

Setting
Default value
Description
UseGroup
false
Setting this to true makes GDMS require the group defined below to function, and disables the default "out of the box" behaviour.
GroupName
GDMS
Name (text) of the group GDMS should use blocks from, if UseGroup is set to true. This includes gravity drive blocks, screens and, if not using the following option, cockpits. GDMS will only use gravity drive blocks on a single grid from this group, which does not have to be the same grid the Programmable Block is on, unlike when using it "out of the box".
PriorityCockpitGroup
GDMS Priority Cockpits
Name (text) of an optional group GDMS will use first when selecting cockpits / Remote Control blocks as control points for the gravity drive. If any cockpit of this group is populated, all other cockpits on-board are ignored. See the "Cockpits" section of this guide for more information. This option does not require UseGroups to be set to true in order to be used.

Gravity Settings
The script supports two modes of operation of your drive. Visit the "Other features" section of this guide to learn more about their function. Neither of these settings is dangerous to script function or server performance - they only affect your ship's acceleration.

Setting
Default value
Description
GravityMax
9.81
The full power setting of your Gravity Generators, intended for regular operation. It is recommended to keep at this value as it is the maximum vanilla generators support.
GravityPrecise
2.0
The precision mode power setting of your Gravity Generators, intended for precise, slow manoeuvreing such as while docking. Use whatever value is suitable for your taste.

Arguments
In this section, you can customize the text inputs GDMS will respond to, although it changes absolutely nothing about the script's behaviour. Find out how you can use arguments in the "Setting up" section of this guide.

Setting
Default value
Description
Toggle_Arg
drive_switch
Enables/Disables the gravity drive. When disabled, all blocks forming the drive are turned off and it will not respond to movement commands or inertial dampeners. The Spherical Idle Shield is disabled as well.
Precision_Arg
precision_switch
Enables/Disables Precision mode.
SphereSwitch_Arg
sphere_switch
Enables/Disables the use of Spherical Gravity Generators by the gravity drive. You may wish to disable them in situations where precision is needed if their placement induces unwanted lateral motion. The Spherical Idle Shield is disabled whenever Spherical Gravity Generators are disabled.
ShieldSwitch_Arg
shield_switch
Enables/Disables the Spherical Idle Shield.
ShieldInvert_Arg
shield_invert
Flips the polarity (effect direction) of the Spherical Idle Shield.

NOTE: All features controllable by these arguments are further described in the "Other features" section of this guide.

NOTE: This guide lists the default arguments whenever discussing the use of arguments with a feature.
Settings - Advanced
Advanced
These settings should only be changed if you are sure what you are doing. Improper setup could have unfavourable implications to performance. Although the script is written in a way that prevents laggy behaviour automatically, it is best to use settings that do not induce it at all. The defaults are set up properly for the vast majority of ships.

If you do wish to change these settings, please test any changes extensively in a local world in order to not affect performance on servers first.

Inertial Dampeners
Controls for the behaviour of Inertial Dampeners. Improper setup may cause oscillation whenever a ship is nearly stopped and its drive is applying excessive force, which creates considerable lag!

Setting
Default value
Description
DampConstant
0.10
Scaling of the ship's velocity used when calculating the stopping force to apply. Higher values will see your ship use more force for longer to stop, also creating a risk of oscillation.
DampLimit
0.002
Velocity below which GDMS considers your ship stopped, no longer applying Inertial Dampeners. Higher values reduce risk of oscillation, but may make your ship require conventional thrusters to stop completely - feel free to increase this value for safety if you do have them.

Oscillation Mitigation
GDMS is designed to detect whenever oscillation occurs while stopping with Inertial Dampeners and forcibly shut the drive down, as described in the "Other features" section of this guide. These settings control its sensitivity, and have hardcoded bounds to prevent the system's disabling.

Setting
Default value
Description
OscillationSpeed
15.0
Velocity below which GDMS guards against oscillation. Once your ship goes below this velocity, it is given the number of seconds defined below to stop before a forceful shutoff of the drive. You cannot set this lower than 8 m/s.
OscillationTime
15.0
Number of seconds the ship is allowed to take to stop once it slows down below the velocity defined above. If it fails to do so, the drive is forcibly shut down and shows an appropriate status message. You cannot set this higher than 90 s.
Other features
Aside from allowing you to control your gravity drive-equipped ship, GDMS has a handful of other features you may find useful. These include quality of life features, but also ones critical for performance-friendly script behaviour on multiplayer servers!

LCD Displays
GDMS can display information about your gravity drive using a simple text-based readout on screens. This includes:
  • Drive State - The current status of your drive's activity, explained below
  • Loaded Planar Generators - The number of loaded regular Gravity Generators
  • Loaded Spherical Generators - The number of loaded Spherical Gravity Generators, with an OFF indicator when disabled using the sphere_switch argument
  • Loaded Virtual Masses - The number of loaded Artificial Mass blocks and Space Balls
  • Spherical Idle Shield - The current state of the Spherical Idle Shield (explained below) with "Disabled", "Repell" or "Attract" readouts
  • Used Controller - The name of the ship control point (cockpit / remote) currently used by the script as a reference point, with an additional number of secondary control points contributing to movement control (explained below)
Your Drive State readout is the primary source of information about what's going on in your drive. It can display one of several states:
  • DISABLED - Your drive is manually disabled through the use of the drive_switch argument, and will not respond to movement inputs
  • DOCKED - GDMS has detected your ship being connected to a static grid and disabled your drive to save performance (explained below) - it will not respond to movement inputs
  • IDLE - Your drive is enabled and not currently executing any movement commands - its components are turned off to save performance and it will respond to movement inputs
  • ACTIVE - Your drive is active and working on moving your ship
  • OSCILLATION - GDMS has triggered Oscillation Mitigation (explained below) and your drive is disabled until user input - it will not respond to inertial dampeners, but movement inputs will clear this state
An additional "(Precision)" indicator is added to the end of the Drive State readout whenever the drive is in Precision mode, explained below

GDMS supports multi-screen blocks. When using the script without groups, all cockpits on the Programmable Block's grid are considered potential screen blocks. To configure a multi-screen block, visit its Custom Data. There, you will find a numbered list of screens present on this block, in the same order as in its Control Panel. To enable GDMS output on any of them, set the value next to the corresponding number from False to True.

The same readout as on LCD screens can be found in the Programmable Block's readout section in the bottom right corner of its control panel, with additionally coloured text.


Multi-cockpit operation
For ease of use in cooperative scenarios, GDMS supports combined movement inputs from multiple cockpits. By default, all cockpits on the Programmable Block's grid are subject to this function automatically.

If you wish to restrict which cockpits are used as sources for movement inputs, set up a Priority Cockpit Group according to the setup option described in the "Settings - Basic" section of this guide. If any occupied priority cockpits are found, only those are used for this feature.

When multiple occupied cockpits are detected and used, a corresponding readout is shown on the "Used Controller" line.


Precision mode
To make precise manoeuvreing easier, GDMS supports a second setting for gravity generator field strength, intended to be lower than full operating power. This mode is activated or deactivated using the precision_switch argument and shows the corresponding readout on the "Drive State" line. Consult the "Settings - Basic" section of this guide to configure a custom power setting for Precision mode.


Spherical Idle Shield
Whenever the drive is idle, its Artificial Mass blocks are turned off and as such are not affected by gravity fields. GDMS leverages this by optionally enabling Spherical Gravity Generators when idle to repell (or attract) nearby gravity-driven ships (and other affected objects), decreasing the success rate of ramming attacks whenever you don't expect them.

You may want to set your Spherical Gravity Generators' field range to the maximum of 400 meters to utilize this feature fully, however keep in mind that during regular flight, the same range applies when these generators apply force in either direction.

Use the shield_switch argument to enable/disable the Spherical Idle Shield, and the shield_invert argument to change its direction of effect. The current state of the Spherical Idle Shield is displayed on the "

NOTE: The Spherical Idle Shield is only active when the drive is Idle. To achieve its effect during regular flight, make sure to build and pilot your ship in a way that makes Spherical Gravity Generators apply force in the desired direction, e.g. repell when evading a ramming attack, or attract when performing one.


Docking Detection
GDMS periodically scans connector connections to your ship for static grids. If your ship is connected to a station, it cannot move - and so the drive enters the "docked" state, where it effectively acts as if it was manually disabled. This includes situations where you are connected to another "intermediary" ship which is then connected to a station.

When detaching from a station the drive reactivates instantly for a seamless experience.

Upon docking, it may take a few seconds before recognizing the change - such scans of surrounding grids are performance unfriendly when performed too often.


Oscillation Mitigation
A crucial feature for performance friendliness. When stopping using Inertial Dampeners, GDMS simply sets the drive to counter your ship's velocity at a variable power level depending on how fast you are going. A very light ship, or one with a very strong gravity drive, may inherently apply excessive force when using the default settings, creating oscillation - repeated overcorrections at near-zero speeds. This is very bad for server performance!

Whenever GDMS detects oscillation is happening, it shuts down the drive until manual user input regardless of current speed and displays the corresponding readout on the "Drive State" line. Beyond this point, the duty of stopping the ship is left to any conventional thrusters on board.

!! Oscillation is a bad thing even with this feature - Your ship should ideally be able to stop gracefully on gravity drive power and switch to the Idle state normally. The two main culprits for oscillation happening are:
  • A high TickDelay - Configurable according to the "Settings - Basic" section of this guide, this is the delay between executions of control logic. The longer this delay, the less frequently GDMS has the opportunity to adjust drive power according to the current speed, at times creating oscillation.
  • A high DampConstant - Configurable according to the "Settings - Advanced" section of this guide, this controls the "power" of the drive while slowing the ship down at a given speed. Lighter ships (or more powerful drives) may benefit from lowering this value.

Once the ship slows down below a certain speed, GDMS gives itself a set time to stop fully. If the ship is not stopped after this time passes, the ship is considered oscillating. These parameters can be changed according to the "Settings - Advanced" section of this guide, however this should only be attempted if Oscillation Mitigation detects "false positives" (triggers for normal, non-oscillating behaviour).