Claimed Salvage Contract Grids Despawn

Arstraea shared this bug 11 hours ago
Submitted

Issue summary

I reproduced both cases on a vanilla Space Engineers dedicated server set up with the official Dedicated Server tool and no mods.

A Salvage contract can normally despawn its target grid if all participants move far enough from the original spawn site while the grid is unclaimed and the NPC grid claim timer has not started.

But the grid can still despawn even after a player successfully uses Claim NPC Grid.

  • A. The server saves and restarts before the target grid first spawns. The grid first spawns when the player visits the site after the restart. The restored contract can then miss the NPC grid claim timer’s start event.
  • B. The player successfully claims the target grid before the NPC grid claim timer starts. This can happen without a server restart.


What I originally observed

  • I accepted a Salvage contract and logged out without visiting the site.
  • The server went through several scheduled restarts before I logged in again.
  • Two days later, I visited the Salvage site for the first time. The target grid was a ship I wanted to reuse.
  • I hacked a few blocks to access the terminal, successfully used Claim NPC Grid, and piloted the ship toward another contract site.
  • The item required by the Salvage contract was still aboard, and the contract was still active. The ship disappeared while I was piloting it toward the other site.

The same distance check can also affect a player who claims a Salvage grid and tows it to an NPC trade station to sell it.


Expected behavior

If the NPC grid claim timer has started or the player has successfully used Claim NPC Grid, moving away from the original spawn site should no longer trigger the Salvage contract’s distance-based cleanup.


Likely cause

I decompiled the stock Sandbox.Game.dll to trace the cleanup path. When a player accepts the contract, MyContractWithSpawnableGrid.Activate_Internal() subscribes to ClaimTimerStarted. After a server restart, BeforeStart() restores that subscription only if the target grid has already spawned and its ID is recorded.

A player may accept a Salvage contract and then do something else or log out without visiting the site, leaving the target grid unspawned. If the server saves and restarts in that state, and the grid first spawns when the player approaches the site after the restart, the spawn logic does not restore the ClaimTimerStarted subscription. The NPC grid claim timer can then start without the restored contract recording it.

A successful Claim NPC Grid action unregisters the grid from the NPC timer system. The contract’s distance check uses its own timer-start flag, which a successful claim does not update. If the player claims the grid before the timer starts, that flag can remain unset even in a session with no restart.


Reproduction on a vanilla dedicated server

Enable Economy and choose a Salvage contract whose target spawns in open space. Use one contract participant and a fresh contract for each test.

A. Restart before the target grid spawns

  1. Accept the contract and stay far enough from the waypoint that the target grid does not spawn.
  2. Save and restart the server while the contract is still active and the target grid has not yet spawned.
  3. Reconnect and approach the waypoint for the first time to spawn the target grid.
  4. Hack one block and confirm that the NPC grid claim countdown appears. To match the incident I originally observed, also use Claim NPC Grid after the countdown appears.
  5. Follow the movement and deletion check below.

B. Claim the target grid before the timer starts

  1. Accept a fresh contract and approach the waypoint to spawn the target grid. Keep the server running throughout this test.
  2. Use an accessible seat or bed already installed on the target grid. Press K while sitting or lying down to open the grid terminal. This gives you access to Claim NPC Grid without hacking, grinding, welding, or adding blocks.
  3. If you cannot open the terminal this way, use a server administrator account. Press Alt+F10, enable Can Use All Terminals under Admin Tools, and open the grid terminal from an existing control panel.
  4. Leave the grid’s inventory untouched and keep the tug disconnected until the claim is complete. Confirm that the countdown has not started, then select Claim NPC Grid and verify that the claim succeeds.
  5. Follow the movement and deletion check below.

Move the grid and check for deletion

  • If the target is a static large grid, open its terminal using the administrator option from test B if needed. For test B, confirm that the claim succeeded before the countdown started. Then select Info → Convert to ship so you can tow the grid without adding or removing blocks.
  • With the contract still active, fly the target grid or tow it with a separate ship. Move well beyond 1.1 times the server’s view distance from the original spawn site, allowing extra distance for the size of the ship you are controlling. Check whether the contract-spawned grid disappears while you are still flying or towing it.


Suggested fix

Restore the ClaimTimerStarted subscription when a restored Salvage contract first spawns its target grid. Also make a successful Claim NPC Grid action independently exclude the grid from the contract’s distance-based cleanup, including when the claim succeeds before the timer starts.


Related report

Report #54010 describes a similar disappearance while towing a Salvage grid. Its trigger is unclear.

If decompiling the assembly to investigate this was inappropriate, I’m sorry. I’ve summarized the behavior so your team can verify it internally.


I recorded a video showing how to reproduce the issue. Please see the video below.

The recording starts after I accepted a Salvage contract, saved the world, and restarted the server without visiting the contract site.

https://youtu.be/OOvwI_108YU

Replies (1)

photo
1

Had the same thing happen with a claimed, hacked and excavated Salvage Contract Objective on official servers (pre-wipe). Towed it and it just went poof after some distance. Not sure if the timer was active before I claimed it, though

Leave a Comment
 
Attach a file
You can't vote. Please authorize!