Project

General

Profile

Bug #3929

Loading a craft with missing parts or otherwise corrupt craft, will lead to unexpected game behaviour

Added by Squelch over 9 years ago. Updated almost 8 years ago.

Status:
Closed
Severity:
Normal
Assignee:
-
Category:
Gameplay
Target version:
-
Start date:
01/03/2015
% Done:

100%

Version:
Platform:
Any
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

Loading a craft into the editor that may have missing parts (missing mod) or otherwise corrupt craft file will lead to unexpected behaviour rendering the game unplayable.

Reproduction Steps:

  1. Start a sandbox game and enter VAB.
  2. Place a Mk1 pod, name and save this as a new craft.
  3. Verify this craft can be loaded into the editor.
  4. Open the .craft file, and edit the part name (eg. mk1pod -> mk1-1pod - example craft attached)
  5. Open the load craft dialog in the editor again and select the previously saved, but modified craft.
  6. Observe the warning about missing parts (mk1-1pod) and dismiss this message.
  7. Attempt to do various tasks in the editor or return to KSC to continue game.

Expected behaviour:

KSP should fail to load any corrupt or invalid .craft file.
Attempting to load such a file should be handled gracefully.

Results:

A message appears informing the player which parts are missing.
Dismissing the message returns the player to an empty editor.
Any number of problems can then be seen while trying to use menus or gui elements.
Returning to KSC (where possible) may leave only some gui elements functioning.

Observations:

While there is a warning of missing parts embedded into the craft loading dialog, this does not prevent the craft from being loaded, and is not prominent enough.
The missing parts message comes after the craft has attempted to be loaded, and after the damage has been done.
The resulting behaviour appears to be random, and can vary from minor issues in the editor, to a complete failure to operate any gui element or menu.
Only a game restart will restore the game to the correct state.

The problems manifested by this issue may be subtle and could go undiscovered or even lead to bug reports in other areas. Quite often the KSC buildings cannot be entered, or parts behave badly in the editor.

Conjecture: It may be possible that a corrupt craft file, that does have correctly named parts and therefore does not spawn the missing parts warning, could also cause other issues. This needs testing and verification.

Broken Arrow.craft (4.6 KB) Broken Arrow.craft Squelch, 01/03/2015 10:01 AM
KSP.log (142 KB) KSP.log Squelch, 01/03/2015 10:16 AM
output_log.txt (318 KB) output_log.txt Squelch, 01/03/2015 10:16 AM

Related issues

Related to Kerbal Space Program - Bug #3944: Clampotron causes accelerometer, pause menu, and others to not appearNot a Bug01/05/2015

Has duplicate Kerbal Space Program - Bug #3987: Loading a craft with missing plugin cancels all missions and returns them to the available queueDuplicate01/24/2015

History

#1 Updated by Squelch over 9 years ago

A simple example corrupt .craft

#2 Updated by Squelch over 9 years ago

Logs added for completeness.

#3 Updated by Squelch over 9 years ago

#4 Updated by Squelch over 9 years ago

There are safeguards in place that prevent corrupt craft from being loaded from within a savegame and the same "Locked or invalid parts" warning is given. The game reverts to a safe state and simply removes the offending craft. This same safeguard appears not to be working when loading a craft in the editor.

Attempting to load the craft directly to the launchpad (from KSC) does not appear to adversely affect the game, but a NullRef is thrown for every attempt.

#5 Updated by PixelClef over 9 years ago

  • Status changed from New to Confirmed
  • % Done changed from 0 to 10
  • Platform OSX added

OS: Mac OS X 10.10.1
KSP: 0.90.0.705

I can recreate this issue exactly as described. There seems to be an attempt to abort, based on this message in the log:

[Error]: Ship file error!

In addition to recreating the error, I can also confirm that attempting to load the craft directly to the pad does not trigger the unstable state, but rather KSP rejects the attempt to load the craft.

Note: the purpose of editing the craft file is not to simulate file corruption, but rather the presence of a mod part that the user doesn't have installed. Possible scenarios for creating this condition are:
  1. downloading a craft from the internet
  2. loading a craft with a mod part after disabling that mod

#6 Updated by unseeingwhale over 9 years ago

  • Platform Linux added

On Linux I got the warning and the blank editor. Then I proceeded to exit the SPH I could press escape but then I didn't have the ability to interact with the GUI.

#7 Updated by Squelch over 9 years ago

  • Platform Any added
  • Platform deleted (Linux, OSX, Windows)

To rule out the root part being the cause, a simple multi-part vessel was created (Mk1pod and solidbooster) with the booster having been the one edited. Exactly the same results were observed.

#8 Updated by Squelch over 9 years ago

  • Category changed from Gameplay to 81

Category changed to editor as the unexpected behaviour is seen after attempting to load from there, but it's worth noting the NRE's thrown when attempting a direct load (from KSC launchpad)

Further observations are:

The warnings and handling of a craft with missing parts is different for the three situations cited so far.

  1. Editor - A missing parts dialog is shown, but does not prevent the subsequent odd behaviour.
  2. A craft embedded in a savegame - The missing parts dialog is shown, but the offending craft is removed and the game reverts to a safe state.
  3. Direct load from KSC - No feedback or dialog is shown, and a single NRE for each attempt is recorded in the log.

#9 Updated by Squelch almost 9 years ago

  • Status changed from Confirmed to Resolved
  • % Done changed from 10 to 100

This behaviour has now been resolved.

#10 Updated by TriggerAu almost 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF