Jump to content

Proper savegame sorting


Recommended Posts

58 minutes ago, The Aziz said:

By date or actual name, anything

That list is sorted by "actual name", in a specific programming sense.

It's sorted lexicographically, which is a ten dollar word for the way words are sorted in a dictionary. This method starts at the beginning of each word, comparing each pair of letters in turn, and stops as soon as it finds a difference. When comparing "108" and "11", it gets to the second character and notes that 0 is less than 1, so therefore it sorts "10" before "11"; the fact that there's another number after the "10" is ignored, as inconvenient as that might be for you.

This means you can achieve your desired sorting by typing the numbers yourself with zero-padding to make all the numbers the same length: "quicksave #0011" would always sort before "quicksave #0108". You can even do this after the fact by renaming the sfs and loadmeta files in your save folder.

Of course it would be better if the list was simply sorted by file timestamp (as with many other menus in the game).

Link to comment
Share on other sites

6 hours ago, HebaruSan said:

 

It's sorted lexicographically, which is a ten dollar word for the way words are sorted in a dictionary. 

Which is a bad method, especially if it involves lots of digits. (you said it. "in dictionary")

I'm aware of such thing, but as you can see, it has flaws.

Edited by The Aziz
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...