aliens

Author Topic: savegames and options.cfg  (Read 3869 times)

Offline tyran_nick

  • Captain
  • ***
  • Posts: 59
    • View Profile
savegames and options.cfg
« on: September 14, 2013, 12:16:03 pm »
I have noticed that after the introduction of the new yaml both options.cfg and savegames get rather messy. By messy I mean that they no longer have the nice order they used to have. For instance if you go in a savegame the order of the fields is everytime different, sometimes making it rather difficult to understand whats going on in there.
Has anybody else some experience with the same issue?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2160
    • View Profile
Re: savegames and options.cfg
« Reply #1 on: September 14, 2013, 06:17:35 pm »
It's an implementation thing. YAML doesn't guarantee any order. yaml-cpp 0.3 used ordered maps, which happened to be consistently ordered (alphabetically). yaml-cpp 0.5 uses unordered maps, which are more efficient but don't have any particular order so seem to come out at random.

Neither of these is sorted "sensibly" really, yaml-cpp 0.3 just happened to be consistent, but there's not much we can do unless you wanna write some utilities to ignore the issue altogether.

Offline tyran_nick

  • Captain
  • ***
  • Posts: 59
    • View Profile
Re: savegames and options.cfg
« Reply #2 on: September 14, 2013, 10:56:44 pm »
Thanks, that's helpful.
Now I understand what is going on with those files