I hope this is the right place to put this. I am not a newbie developer, and I made several text-based games in my late teens, but this is my first attempt at a more modern (yet retro!) game. I have been doing quite well so far, but now I seem to have hit a wall. I am using MonoGame, and at this point, I have the following:
A nice custom ECS I am very happy with
A very fast custom QuadTree for broad-phase collision and queries
Some tutorial-driven code for narrow phase collision
Basic animation
Basic keyboard, mouse, and gamepad controls
A custom editor for generating metadata about my assets
Where I've hit a wall is moving the data between my editor and the game. I've written a couple half-solutions, but neither of them felt quite right. The first was some manually constructed and read XML. The second was a reflection-based serializer/deserializer that can handle almost any non-recursive data structure.
I really want to like the reflection-based approach, but having to avoid recursion and references is a real pain. For performance reasons, I need references stored in my classes, and yet that would prompt my naive serializer to duplicate data all over the place. Initially, this led me to create a bunch of duplicate "definition" classes that only held ID values and whatnot, until I realized what a terrible idea that was. If I'm going to manually translate my classes to/from a definition class, I might as well manually translate them to/from XML, after all. Anyway, how do I reconcile this? Create something like RefFieldAttribute and incorporate the idea of a reference into my serializer? Did I just answer my own question?
Regardless of that, how would you handle this? There will be a lot of configuration data. The game will be highly procedural requiring a lot of metadata, and I want full support for modding. I'd also like to re-use a good chunk of the code for save games and such. Any ideas and/or advice would be greatly appreciated.