Space Engineers comes with its own cleanup system: Trash Removal deletes debris and small abandoned grids, limits floating objects and stops grids that move far away from players. This keeps your world tidy and leaves the server fewer objects to simulate – no plugins required.
In this guide you set up three things:
- Trash Removal – what the server deletes automatically
- AFK kick – automatically disconnect inactive players
- Pause the simulation when nobody is online
None of these settings has a field in the dashboard. You change them in your server's files or in the in-game admin screen. The dashboard does not overwrite these values on startup, so your changes are kept.
How to edit the files
-
Stop the server
Stop your server via the dashboard. -
Create a backup
Create a backup or download a copy of the file you want to edit. This lets you restore the previous state if something goes wrong while editing. -
Connect via SFTP
Connect to your server via SFTP, or use the file browser in the dashboard. -
Open the file
Open the matching file:Settings File Trash Removal and AFK kick /config/Saves/World/Sandbox_config.sbcPause when empty /config/SpaceEngineers-Dedicated.cfg -
Change the values
Find the entry and change only the value between the tags. The entries are already in the file, so you do not need to add new lines. -
Start the server
Save the file and start your server.
For how to change world settings in general, see Change world settings.
Trash Removal
Trash Removal is already active on your server. It keeps checking all grids – ships, stations and debris – and deletes those that do not meet any of the protection rules.
What gets deleted with the default values
With the default values, the server only deletes a grid if all of the following apply:
- It has fewer than 20 blocks.
- It is more than 500 m away from every player.
- It is not static, so it is not a station.
- It has no power.
- It is not being controlled.
- It has no production block such as a refinery or an assembler.
- It has no medical room and no survival kit.
Typical examples are debris after a fight, single blocks that broke off, or small unpowered ships left behind. Grids that are firmly connected to a protected grid – for example via a rotor, a piston or a connector – are kept as well.
The settings in Sandbox_config.sbc
The entries are listed one below the other in Sandbox_config.sbc. In the preinstalled world they look like this:
<RemoveOldIdentitiesH>0</RemoveOldIdentitiesH>
<TrashRemovalEnabled>true</TrashRemovalEnabled>
<StopGridsPeriodMin>15</StopGridsPeriodMin>
<TrashFlagsValue>1562</TrashFlagsValue>
<AFKTimeountMin>0</AFKTimeountMin>
<BlockCountThreshold>20</BlockCountThreshold>
<PlayerDistanceThreshold>500</PlayerDistanceThreshold>
<OptimalGridCount>0</OptimalGridCount>
<PlayerInactivityThreshold>0</PlayerInactivityThreshold>
<PlayerCharacterRemovalThreshold>15</PlayerCharacterRemovalThreshold>
AFKTimeountMin belongs to the AFK kick; this table explains the other entries:
| Entry | Default | Meaning |
|---|---|---|
TrashRemovalEnabled |
true |
Turns Trash Removal on (true) or off (false). With false, StopGridsPeriodMin, PlayerCharacterRemovalThreshold and RemoveOldIdentitiesH stop working as well. |
BlockCountThreshold |
20 |
Grids with at least this many blocks are never deleted by Trash Removal. |
PlayerDistanceThreshold |
500 |
Grids closer to a player than this distance in meters are kept. |
TrashFlagsValue |
1562 |
Defines which properties protect a grid from deletion. Change this value in-game, see Change the protection rules in-game. |
StopGridsPeriodMin |
15 |
Grids moving far away from players are stopped by the server after this time in minutes. 0 turns this off. |
PlayerCharacterRemovalThreshold |
15 |
Removes the character of a player who disconnected after this time in minutes. 0 turns this off. |
RemoveOldIdentitiesH |
0 |
Removes inactive player identities that do not own any grids after this time in hours. 0 turns this off. |
PlayerInactivityThreshold |
0 |
Deletes all grids of a player who has not been online for this many hours. 0 turns this off. |
OptimalGridCount |
0 |
Keeps the number of grids in the world at roughly this value. 0 turns this off. |
Limit floating objects
MaxFloatingObjects defines how many objects may float around freely in the world at the same time – for example ore, stone or components. When the limit is exceeded, the server removes the oldest objects first. The entry is also in Sandbox_config.sbc:
<MaxFloatingObjects>56</MaxFloatingObjects>
The game provides for values from 2 to 100. If you enter more than 100, the server automatically turns on Experimental Mode when loading the world – even if it is set to false in the dashboard (see Forced experimental mode).
Revert modified voxels (optional)
Trash Removal can also revert modified voxels, for example dug-up planet surfaces. This feature is off by default:
<VoxelTrashRemovalEnabled>false</VoxelTrashRemovalEnabled>
<VoxelPlayerDistanceThreshold>5000</VoxelPlayerDistanceThreshold>
<VoxelGridDistanceThreshold>5000</VoxelGridDistanceThreshold>
<VoxelAgeThreshold>24</VoxelAgeThreshold>
With true, the server restores voxel areas to their original state if they are more than VoxelPlayerDistanceThreshold meters away from players, more than VoxelGridDistanceThreshold meters away from grids, and have not been changed for at least VoxelAgeThreshold minutes.
Change the protection rules in-game
TrashFlagsValue stores which properties protect a grid as a number. You do not have to calculate this number yourself: in the admin screen you set the protection rules with checkboxes. Your server must be running for this. It applies the values immediately and writes them to Sandbox_config.sbc the next time it saves the world.
-
Join as an admin
Join your server with an account that has admin rights – see Add Admins. -
Open the admin screen
PressAlt+F10. -
Select Trash Removal
Select Trash Removal in the drop-down list at the top of the admin screen and General in the second drop-down list below it. -
Set the protection rules
A checkmark means: grids with this property may be deleted. Without a checkmark, the property protects the grid.Checkbox Default Applies to Fixed (stations) unchecked static grids, i.e. stations Stationary checked grids that are standing still Linearly moving checked grids moving at a steady speed Accelerating checked grids that are speeding up or slowing down Powered unchecked grids with power Controlled unchecked grids that are currently being controlled With production unchecked grids with a refinery, assembler or another production block With respawn point unchecked grids with a medical room or survival kit Below the checkboxes you also set
BlockCountThreshold(With less blocks than),PlayerDistanceThreshold(Distance from player (m)) andPlayerInactivityThreshold(Time since logout of owner (h)). -
Set further values
If you select Other in the second drop-down list, you find Optimal grid count, Delete offline char. after (m) (PlayerCharacterRemovalThreshold), AFK Timeout, Stop Grids Period (m) and Remove Old Identities (h). -
Apply the changes
Click Submit changes. Only stop or restart your server once the server console has shownAutosave– only then are the new values stored inSandbox_config.sbc. How often the server saves is set by Automatic Backup Interval (see Set Up Automatic Backups).
AFK kick
With the AFK kick, the server automatically disconnects players who have not made any input for a certain time. It is off by default.
In Sandbox_config.sbc, set the entry AFKTimeountMin to the desired time in minutes, for example 30:
<AFKTimeountMin>30</AFKTimeountMin>
Setting it to 0 turns the AFK kick off again. Alternatively, set the value in the admin screen under Trash Removal > Other at AFK Timeout.
One minute before the kick, the game shows the player the message Please note: If you remain inactive for 1 minute you will be disconnected. Any keyboard, mouse or controller input resets the timer. The AFK kick also applies to admins. Kicked players can rejoin right away.
Pause the simulation when nobody is online
Normally your world keeps running even without players. With PauseGameWhenEmpty, the server only simulates the world while at least one player is connected. As soon as someone joins, the world continues.
This entry is not stored in the world but in /config/SpaceEngineers-Dedicated.cfg. Set it to true:
<PauseGameWhenEmpty>true</PauseGameWhenEmpty>
Was something deleted by mistake?
Trash Removal deletes permanently. If the server removed a grid that should have stayed, roll your world back with a backup – see Restore an Automatic Backup. Then adjust the protection rules so it does not happen again.
