I'm trying to construct an editor in C# that exposes game components to IronPython, so it may create the game object definitions to be used within the editor:
- C# Exposes the components to the python script (Spatial, Movement, SpriteView, etc.)
- IronPython creates the game object definitions (or templates) by attaching components to a game object.
At the startup of the editor:
- The Python script is loaded with all of the game object definitions.
- Tools are updated with the new objects (availability for painting).
The problem I'm having lies when I'm saving and opening the editor data:
- When saving, I use C# to serialize all of the constructed game objects (including the game object definitions generated from python) to a file.
- When opening, I use C# to deserialize the data. - Since the Python script is not synchronized with the serialized components, I will run into a big problem when I change anything in the script.
One solution I had was to only serialize the definition name of a game object, therefore when I deserialize my data I will have to do a lookup for the target definition (created by the script) and simply clone it. But, it still will not be entirely in sync with the editor data (some data will be changed on each game object like for example the position (note when I say game object I do not mean the definition)).
Another solution might be to use a database and save out all of my editor data to it (perhaps using the entity database in C#). I'm not entirely sure if this will solve my problem.
Any help would be appreciated, thanks!