Canvas Troubleshooting


The purpose of this devlog is designed for assisting world creators who are attempting to migrate their worlds to newer versions of the mod, document the types of errors players might receive while using the Canvas Editor, and provide solutions to said errors. Please be advise that not every problem is known in the Canvas Editor and not every solution will work in certain cases. This will include versions prior to Gamma 1.0.0 to any upcoming version. 


Backups

Before you decide to migrate your world, please make sure to backup all of your world files. Things tend to break one way or another.

For any world creators who improperly migrated their worlds and can not save it, do not panic. The game will generate a placeholder directory for each type of file in the StreamingAssets. As long as the World Creator does not load another world, the game will retain the first world's content, both new and old. The game will also generates a test world only after the world successfully loads everything. You can use one of these locations and copy and paste the files to your world if necessary.

Locations of Placeholder Directories
The following directories/files are generated after loading a world through the World Creator. These are usually updated if a new world is loaded or removed once a world is overwritten/saved.


Troubleshooting

Whether the mod receives an update that either adds new nodes or upgrades existing nodes, errors in the Canvas Editor are prone to happen. Some are accidental bugs from moding the game's code, but there are cases where files that store the node's information can cause these errors. These include the following:

Loading a Canvas in the Canvas Editor

Loading a Canvas in the Canvas Editor
The game will never show a canvas and its content if ever an error exists. These are usually due to faulty nodes or variable type alterations.


Attempting to Save a World

Attempting to Save a World
Generally, the game will block players from saving a world whenever an error exists. This is because the World Creator does a check for every valid sector, blueprint, entity position, and canvas. Think of this as the last indication of canvases being the cause of the problems. Unless the world was originally free from errors, they are the first indicators for broken canvases.


Testing a to World Outside of the World Creator

Testing a to World Outside of the World Creator
It is never recommended to directly run a world built using older versions of the mod due to its incompatibility. In some cases, the game will severely break and can potentially ruin your save file, while others may impact certain sections of the world. In this example, a mission canvas node was able to cause the world to break.


If you do get these issues, fixing them is pretty straight-forward. But there are a few types I would like to go over. If you are not interested in knowing the type of issues, you can head to the Appendex for further instructions about fixing error specifc nodes in your canvas files.


Types of Canvas Errors

World creators may think canvas errors are complicated due to the error message. In reality, these messages are designed to notify users about a potential error. Based on what errors I've dealt in the World Creator, there are generally around two types of canvas errors with a few variations.


Node Renames and Removals

For every node created in a canvas, an object class is added to the canvas file. But if the class does not exist, then an error message is loaded. This is a short way of explaining how the canvas system works. All of the node's classes are stored in the game's files. The canvas system will grab whatever information it has to create, load, and run the node, its variables and functions. And in order for a canvas to remember these fields, it has to know the canvas class name. This, in fact, is one of the sources that causes canvases to fail. As long as the canvas system fails to load a node in one of the canvases, the game will always break. 


One way of fixing this issue is by renaming the node's class. They are represented as the variable called type in the canvas files. If the game can run the class name in the Canvas Editor (without producing errors), then the problem is solved. Any world creator can use this method only if a new class name is given (refer to the Appendix).

<-Node->
<node name="[name]" id="[nodeID]" type="[class]" pos="[x],[y]"></node>


Removed nodes are more complicated, but have more than one solution. World creators can modify the files and remove the node entirely, remove the node through an older build of the game's Canvas Editor, or rename the node's type (or class) to an existing class name to resolve these issues.


Missing and Unsupported Variables

Nodes will store their variables inside the class object in each canvas. If they cannot find or load the variable, the game will send a warning or an error message through the dev console. These issues are due to recent updates to the node's code where existing variables were either altered or removed. And once they are loaded (and saved) to latest build of the mod, there is no way to access them in the Canvas Editor. 


Missing variables will not majorly impact the game. Canvases can still run the nodes normally, it is only part of it that can cause some nuisances. They can usually seen as a warning message when saving a world or opening the Canvas Editor while the dev console is active. If you do find these messages, overriding the existing canvas via the Canvas Editor should fix half of it. Readjusting the nodes and its variables (based on what was lost) is the second half.

Dev Console Producing Missing Variables


If the game produces an error message, then the node contains unsupported variables. Some of these errors are due to the game trying to load a node with an unsupported variable type (i.e. a node originally uses a bool, but has to load an int). The only option is to modify the canvas file itself. 


For ints, floats, and bools, you can replace the node's broken line with one of the corresponding statements where name represents the node's variable name (this is not the same as the node's class name). 

<-Node->
<int name="[name]">0</int>
<float name="[name]">0</float>
<boolean name="[name]">false</boolean>


For strings, there is more to modify. Under the node, they will use an attribute called object reference ID (refID). These are represented as numbers and are used to store the string values. Depending on the size of the file, they will always be below all of the nodes. Searching the exact refID is the best way to find the string value.

<-Node->
<Variable name="[name]" refID="[id]" />
<-Objects->
<Object refID="[id]" type="System.String">
    <string></string>
</Object>


Out of Bounds Variables

There is one exception to the node's variables, the out of bounds variable. In some cases, these will not produce any error when testing a world. It tends to require a specific condition whether by loading it in the Canvas Editor or entering a sector. The cause is of this problem has to do with the node's variables, specifically the int. Nodes that use a popup list for selecting an option uses an integer to store the element'sposition in an array. If the highest value of that integer is not no longer in use or is undefined, then the game throws an out of bounds error. The best way to fix this issue is to change the number to be within the array's bounds.


Appendex

The following list are nodes that are known to cause issues to the game.


Sector Properties Node - Gamma 1.2.0

This node's class has been renamed.

<-Old->
<node name="Set Sector Properties" id="[nodeID]" type="OverrideSectorPropertiesNode" pos="[x],[y]"></node>
<-New->
<node name="Set Sector Properties" id="[nodeID]" type="SectorPropertiesNode" pos="[x],[y]"></node>


Passive Dialogue Node - Gamma 1.2.0

The soundType variable has been altered from string to int.

<-Old->
<variable name="soundType" refid="[id]"></variable>
<-New->
<int name="soundType">0</int>


Rotate Craft Node - Gamma 1.2.0

The angle variable has been altered from string to float.

<-Old->
<variable name="angle" refid="[id]"></variable>
<-New->
<int name="angle">0</int>


Check Entity Existence Node - Gamma 1.2.0

The distanceFromPlayer variable has been altered from int to float.

<-Old->
<int name="distanceFromPlayer">0</int>
<-New->
<float name="distanceFromPlayer">0</float>


Dialogue Condition Node - Gamma 1.1.2

This node has been removed from the game. There is more than one solution. 

1) Edit the files by manually by replacing the entire class.

<-Old->
<node name="Dialogue Condition Check" id="[nodeID]" type="DialogueConditionCheckNode" pos="[x],[y]">
<port id="[portID1]" name="Input" dynamic="True" type="NodeEditorFramework.ConnectionKnob">
    <string name="styleID">Dialogue</string>
    <direction name="direction">In</direction>
    <connectioncount name="maxConnectionCount">Multi</connectioncount>
    <nodeside name="side">Left</nodeside>
    <float name="sidePosition">0</float>
    <float name="sideOffset">0</float>
</port>
<port id="[portID2]" name="Pass" dynamic="True" type="NodeEditorFramework.ConnectionKnob">
    <string name="styleID">Dialogue</string>
    <direction name="direction">Out</direction>
    <connectioncount name="maxConnectionCount">Single</connectioncount>
    <nodeside name="side">Right</nodeside>
    <float name="sidePosition">20</float>
    <float name="sideOffset">0</float>
</port>
<port id="[portID3]" name="Fail" dynamic="True" type="NodeEditorFramework.ConnectionKnob">
    <string name="styleID">Dialogue</string>
    <direction name="direction">Out</direction>
    <connectioncount name="maxConnectionCount">Single</connectioncount>
    <nodeside name="side">Right</nodeside>
    <float name="sidePosition">60</float>
    <float name="sideOffset">0</float>
</port>
... </node>
<-New->
<node name="Condition Check" id="[nodeID]" type="ConditionCheckNode" pos="[x],[y]">
<port id="[portID1]" name="Input" dynamic="True" type="NodeEditorFramework.ConnectionKnob">
    <string name="styleID">Dialogue</string>
    <direction name="direction">In</direction>
    <connectioncount name="maxConnectionCount">Multi</connectioncount>
    <nodeside name="side">Left</nodeside>
    <float name="sidePosition">52.5</float>
    <float name="sideOffset">0</float>
</port>
<port id="[portID2]" name="True" dynamic="True" type="NodeEditorFramework.ConnectionKnob">
    <string name="styleID">Dialogue</string>
    <direction name="direction">Out</direction>
    <connectioncount name="maxConnectionCount">Single</connectioncount>
    <nodeside name="side">Right</nodeside>
    <float name="sidePosition">52.5</float>
    <float name="sideOffset">0</float>
</port>
<port id="[portID3]" name="False" dynamic="True" type="NodeEditorFramework.ConnectionKnob">
    <string name="styleID">Dialogue</string>
    <direction name="direction">Out</direction>
    <connectioncount name="maxConnectionCount">Single</connectioncount>
    <nodeside name="side">Right</nodeside>
    <float name="sidePosition">77.5</float>
    <float name="sideOffset">0</float>
</port>
<boolean name="dialogue">false</boolean>
... </node>


2) Edit the files by manually by replacing the class name. This will require world creators to delete this node when updating to the latest version of the mod.

<-Old->
<node name="Dialogue Condition Check" id="[nodeID]" type="DialogueConditionCheckNode" pos="[x],[y]"></node>
<-New->
<node name="Condition Check" id="[nodeID]" type="ConditionCheckNode" pos="[x],[y]"></node>


3) Deleting this node using the World Creator from a prior version of the mod and add it back in the latest version.


Start Mission Node - Gamma 1.1.2

The unsatisfied prerequisite dialogue variable was removed. Updating the canvas may not impact the game. It will warn players that this variable, prerequisitesUnsatisifedText, cannot be found.


Set Path Node - Gamma 1.1.0, Gamma 1.2.0

Gamma 1.1.0 - Certain booleans were removed after the update. Updating the canvas will have no effect. It will warn players that this variables cannot be found.

Gamma 1.2.0 - The setPathType int variable has its list changed. The range is now 0 -> 3. Any value that is beyond the range will result in a out of bounds array error.

Get Beyond Our Worlds | ShellCore Command Mod

Comments

Log in with itch.io to leave a comment.

If there are any issues related to this, comment down below.