Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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:

  1. The Python script is loaded with all of the game object definitions.
  2. 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:

  1. When saving, I use C# to serialize all of the constructed game objects (including the game object definitions generated from python) to a file.
  2. 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!

share|improve this question

closed as off-topic by Anko, bummzack, Josh Petrie Feb 27 at 16:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions that aren't specific to game development are off-topic here, but can be asked on Stack Overflow. A good rule of thumb is to ask yourself "would a professional game developer give me a better/different/more specific answer to this question than other programmers?"" – Anko, bummzack, Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
What is your motivation to use Python scripts as opposed to data files - XML or custom format? –  Den Aug 5 '11 at 21:18
    
I agree, I decided to go with a database instead of the script. –  crjenkins Aug 8 '11 at 5:25

1 Answer 1

I decided to go with the database for my objects.

share|improve this answer
2  
If you don't need frequent CRUD access, a text file (XML or JSON for example) would be fine. Also, if this is what you did then please mark this as the accepted answer. –  Martin Foot Sep 7 '11 at 7:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.