Advertisement
robn

Pioneer: Savefile versioning and compatibility

Jan 10th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. From: John Bartholomew
  2. To: Pioneer development discussion
  3. Subject: Savefile versioning and compatibility
  4. Date: Wednesday, October 10, 2012 1:24 AM
  5.  
  6. I've been thinking about this for a while. It's one of the tricky but
  7. absolutely necessary items on the todo list to eventually get us out
  8. of alpha.
  9.  
  10. Some things I think we should be aiming for:
  11.  
  12. - No more global save version; it's just not compatible with a system
  13. that is continually in development.
  14. - Structure metadata in the save file, with structure remapping to
  15. support loading older (or newer) files. For a good example of a system
  16. like this with files that have remained compatible (both forwards and
  17. backwards) over a long and very active development life, see Blender.
  18. - Coping with loading into a galaxy that doesn't exactly match the one
  19. that the save was made from. This is a tough one, but can be done with
  20. some care and pragmatism (more below).
  21. - Coping with changes to available equipment, missions, etc. I would
  22. suggest this is mostly deferred to Lua, which doesn't solve it, but at
  23. least admits flexible solutions. Missions are already in Lua and there
  24. is a pull request open to add some basic versioning to mission save
  25. data. Equipment will be handled by Lua in the future, and that whole
  26. system should be easier to make robust to version changes.
  27. - Coping with changes to other content (available ships, etc). I don't
  28. think there is much to do here except reset to some default ship if
  29. the one in the save file doesn't exist.
  30.  
  31. Some notes on galaxy changes:
  32. In the past I've thought that we could eventually lock down the galaxy
  33. (when sysgen has been cleaned up), which would make things easier, but
  34. given the chance of custom systems and adjustments to terrain
  35. appearing as mods, and given how long it could take to get sysgen into
  36. a state that we are happy to make permanent, I think we're better off
  37. putting in the effort to cope with loading into a galaxy that is (a
  38. little) different to the one the save was made in.
  39.  
  40. This needs some adjustments to the way some data is serialized to make
  41. it cope better with changes. Eg, if close to a body, store altitude
  42. rather than distance to frame centre (so if terrain height is
  43. different on load then the ship won't be underground); if docked, just
  44. store station path and landing pad number, so if the station is
  45. positioned differently on load the ship will still load in a sensible
  46. place. There is probably a bunch of stuff like this that can be done
  47. to make the system a little more robust to changes, and it's not
  48. hugely difficult, but it needs thought and care in a lot of places.
  49.  
  50. I think SystemPath, or at least the on-disk representation will need
  51. to change. Possibly we can say system names must be unique within a
  52. sector, and serialize SystemPath as <sector, system name, body name>.
  53. Then of names can't be changed, so it's not a perfect solution. I'm
  54. not sure what will be best; I don't think there are any perfect
  55. solutions to this, we just have to pick a trade-off that we're happy
  56. with.
  57.  
  58. Some changes to the galaxy can only be handled by resetting some state
  59. on load, eg if the ship is in a system that doesn't exist at all then
  60. it can be loaded into a nearby system, or loaded into an empty ghost
  61. system at the coordinates of the saved system (think witch-space) to
  62. give the pilot a chance to jump to the system of their choice.
  63.  
  64. There is probably more to say, but that's all I have time for right now.
  65.  
  66. John B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement