Editor: support loading a game with invalid property values #2563
Labels
context: editor assets
related to input files for editing the game
type: enhancement
a suggestion or necessity to have something improved
what: editor
related to the game editor
There's a certain problem, which is not too likely, but still potentially possible.
Our serialization system in the Editor works by reading xml entries, and assigning their values to game object properties in memory.
Some of the object properties throw exceptions if the value is not valid.
That works well for reporting when user edits these values in the editor; because value reverts to a previous one, user sees the error message, and can fix it or leave previous value.
But that does not work when a game is loaded, because there's no "fallback" operation. This results in game unable to load at all, and the only way to fix it is to open Game.agf by hand and edit it. That is very inconvenient, not to mention that user has to know valid range of values for this property.
We need some kind of backup scenario in case game cannot load like that.
I suppose, that for this scenario:
A. Leave property unchanged (it will likely retain default value), or assign default value explicitly (can use reflection).
B. Find a closest value in valid range (?), but not sure if that's meaningful, and not every property type can have that.
The text was updated successfully, but these errors were encountered: