Data Format
This is not official documentation on the data format used often in Paradox Interactive games. There is no specification. What I document here is what I have seen in the wild. I have seen the source code for an old version of the game and there is manual serialization and deserialization, so there are no guarantees.
Here is an example document of all the crazy things you can see. You'll notice that the format resembles JSON.
The last time I checked, the files are encoded as Windows 1252.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: |
|
I recommend parsing the objects as an array of tuples of strings and objects because the order of the properties may matter (a map or multi-map doesn't necessarily guarantee element order). This also helps with writing the data structure back out.