desocupado
Magister
- Joined
- Nov 17, 2008
- Messages
- 1,802
So, what system would you guys suggest? (I'm using C++)
I have a couple of arrays of raw pointers (only discovered smart pointers after I had started the project) and some other stuff. I researched a bit, and saw that serialization is usually used, to binary and json. But I might go xml for my maps, so I was wondering if I could use xml for both maps and the saving system.
As for the maps, I'm wondering if I try to modify the custom xml thing that tiled uses, or just keep using text.
Thing is, I'm having a bit of trouble on reading the data from file. I have a solution right now using a text file and it's working, but I want to add some customization to the map files (victory conditions, events and stuff).
For example, if I always have 3 numbers in a line after "Rocky terrain", like this:
Rocky_Terrain
10,23,18,
Then it's trivial to read the data. But if I have a variable number of numbers under "Rocky_Terrain", then I'm not sure how to deal with that when reading. Maybe checking the failbit? I'm trying to figure the way of least effort here.
XML data seems more robust, but there's a learning curve...
What's easier/simpler for a small project?
I have a couple of arrays of raw pointers (only discovered smart pointers after I had started the project) and some other stuff. I researched a bit, and saw that serialization is usually used, to binary and json. But I might go xml for my maps, so I was wondering if I could use xml for both maps and the saving system.
As for the maps, I'm wondering if I try to modify the custom xml thing that tiled uses, or just keep using text.
Thing is, I'm having a bit of trouble on reading the data from file. I have a solution right now using a text file and it's working, but I want to add some customization to the map files (victory conditions, events and stuff).
For example, if I always have 3 numbers in a line after "Rocky terrain", like this:
Rocky_Terrain
10,23,18,
Then it's trivial to read the data. But if I have a variable number of numbers under "Rocky_Terrain", then I'm not sure how to deal with that when reading. Maybe checking the failbit? I'm trying to figure the way of least effort here.
XML data seems more robust, but there's a learning curve...
What's easier/simpler for a small project?
Last edited: