Author Topic: Sort saved game list by game date and time  (Read 9382 times)

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Sort saved game list by game date and time
« on: May 27, 2013, 01:59:13 am »
Patch is attached.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Sort saved game list by game date and time
« Reply #1 on: May 27, 2013, 04:44:39 am »
nice, nice, how about sorting by the (potential) turn counter as well?

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: Sort saved game list by game date and time
« Reply #2 on: May 29, 2013, 12:03:49 am »
Would need some means of saying a) this save is a battle save and b) it has N turns elapsed. Don't see a trivial bit of code to do that, on a quick look round in the code. Pointers?

Volutar

  • Guest
Re: Sort saved game list by game date and time
« Reply #3 on: May 29, 2013, 07:48:51 am »
in order to gather that info from saves, for instance, 100 of them (which can be in user folder) program will need to load each save file, and extract particular values. i don't see how it can be feasible without huge delay and lots of harddrive work.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Sort saved game list by game date and time
« Reply #4 on: May 29, 2013, 10:37:22 am »
maybe a small "info string" could be added to the savefile name, and ignored for in-game display purposes? I'd guess it only needs to be a few characters to convey the information we need for sorting.

Volutar

  • Guest
Re: Sort saved game list by game date and time
« Reply #5 on: May 29, 2013, 11:16:32 am »
savefile name? No. Names could be any. And easily could renamed. And what will it do in this case?

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: Sort saved game list by game date and time
« Reply #6 on: May 29, 2013, 10:11:48 pm »
The existing system opens each save game file in any case, to get the game time - the UI then translates the game time into a localised date / time for display to the user. Sorting by time adds no noticeable overhead. It seems to be sufficiently fast at present, I have 56 save game files present in the same folder.

So, I doubt checking a) if battlescape and b) what turn in the battle it is, would add any more overhead. Its more how to determine the values for a and b.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Sort saved game list by game date and time
« Reply #7 on: May 29, 2013, 11:57:19 pm »
The existing system opens each save game file in any case, to get the game time - the UI then translates the game time into a localised date / time for display to the user. Sorting by time adds no noticeable overhead. It seems to be sufficiently fast at present, I have 56 save game files present in the same folder.

So, I doubt checking a) if battlescape and b) what turn in the battle it is, would add any more overhead. Its more how to determine the values for a and b.

The reason the current system works is because the date is stored in a YAML subdocument separate from the rest of the data (you have to parse the whole document to access any field in it), so it only has to parse that to list the saves. Parsing all the savegame data for the listing would be extremely cumbersome.

So checking a) and b) is actually trivial (it's just one var with the turn), but to use them in the listing you would have to save that data in the subdocument. And you'd get the inevitable "but I wanna see both the date and the turn" and run out of space.
« Last Edit: May 29, 2013, 11:59:30 pm by SupSuper »

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
Re: Sort saved game list by game date and time
« Reply #8 on: May 30, 2013, 12:06:48 am »
Cool. Well, if looking deeper into save games would make the process too slow, then I guess the patch can applied as is ;-)

Offline Ishmaeel

  • Captain
  • ***
  • Posts: 55
    • View Profile
Re: Sort saved game list by game date and time
« Reply #9 on: November 15, 2013, 12:13:55 am »
Newb necromancer reporting for duty.  ;D :-[

Will this (save files sorted by date) make it into 1.0?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Sort saved game list by game date and time
« Reply #10 on: November 15, 2013, 12:32:42 am »
Yes.

Offline Ishmaeel

  • Captain
  • ***
  • Posts: 55
    • View Profile
Re: Sort saved game list by game date and time
« Reply #11 on: November 15, 2013, 12:49:11 am »
Awsum.