I think weekly plans have blown up in my face, despite being useful. Over the next few weeks Iâll be more concise in my reviews and objectives.
The system as it stands consists of six main scripts, all of which have major parts waiting to be coded.
The GameControl script has two purposes. First, it carries data between âscenesâ. For example, when the tool is initiated, a main menu will appear, from which a save file may be selected. Doing so will open the interactive interface, which in Unity terms consists of a separate scene; GameControl carries the information from the main menu into this new scene. Second, GameControl contains the saving and loading functionality for the tool, in particular reading and writing persistent files to the disk.
The CmpntLoad script will be attached to an empty game object in the interactive interface. Its main purpose is to be the parent of all of the visible objects in the scene, and to initiate the loading of these objects into the scene.
The nodes are controlled by the NodeSelectable script.
Similarly, edges are controlled by the EdgeSelectable script. I coded some parts of these much earlier in the project.
The Cmpnt script encodes all of the processes required for basic manipulation of the network. The network will be manipulated componentwise. That is, nodes and edges are children of a parent âcomponentâ object, to which the Cmpnt script is attached. I have designed the functions for adding and removing edges and nodes so that if a component becomes disconnected, a new Cmpnt object is created for the detached nodes and edges. CmpntLoad contains an array of the components and their relative transforms. This will allow greater flexibility for moving things around later!
The basic data for each component is stored in an instance of the CmpntData class stored in a script of the same name. This is the data which is serialized by GameControl in order to save the network to a file. All of the data is store numerically to save file space (via large, but hopefully sparse, matrices/arrays).
Similarly, most of the routines aim to use the numerical information about the parts of the network in order to save processing more complex game objects. To this end, it will be important that the code I apply to the visible network is carefully reflected in the changes made to numerical data and vice versa.
The next stage in the coding is to work out how these codes can generate visible objects in the scene with the correct components to make the tool function!