Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Savegame list fix and filename changes #375

Merged
merged 9 commits into from
Jun 1, 2018

Conversation

AquariusPower
Copy link
Contributor

@AquariusPower AquariusPower commented May 30, 2018

I emptied my Save path.
Created a new char and played thru some dungeons w/o saving to main menu.
As I was also testing things, it crashed, and I ended up only with .bkp and .AutoSave.sav files, but the main PlayerName.sav was missing.
The list would not be populated.

To test it, do the same but crash it manually by killing the game process.

I also hardened the filenaming to only allow a-zA-Z0-9 preventing some derivative problems if not (like if user typed dots in the player's name that would mess the savegame listing).

This one will be ready after we make many tests and find no troubles in:

  • the savegame filenames
  • the player name

TODO: To properly show the player's name on the savegame list, we need to create a new file during the savegame, it can be a simple text file like PlayerName.info may be, and there can be put many things, including the player name with all fancy characters and also current game/dungeon progress, etc. Not need to be on this PR, that is more a bug fix and code hardening.

@ryfactor
Copy link
Member

ryfactor commented Jun 1, 2018

Sorry for another possible bug. If I load an autosave file, the character's name is missing.

@AquariusPower
Copy link
Contributor Author

@fejoa actually if as many bugs as possible are found before release is a great thing :)
As I remember, I had solved it from a normal .sav file, but didnt check from .AutoSave.sav file.
So I thx for finding it! :)

@ryfactor
Copy link
Member

ryfactor commented Jun 1, 2018

Shall I merge this and .AutoSave.sav can be a new job?

@ryfactor ryfactor merged commit 017b6fb into Attnam:master Jun 1, 2018
@AquariusPower
Copy link
Contributor Author

sure! :>

@AquariusPower
Copy link
Contributor Author

AquariusPower commented Jun 1, 2018

mmm... I am not being able to recreate the problem.
I let it autosave (25 turns here), and killed the application.
One of the times there was only autosaves, the other it had also .bkp files.
but in both the player's name was ok.
even in wizard mode that doesnt delete autosave files.
so, if you still have that savegame and could upload here it would help!
otherwise we wait it happen again.

btw, wizard mode has a problem about that.
wizard autosave files are prefered just because they exist, even if the .sav main file was saved later,
this means that when we make tests in wiz mode and save, when we continue it will be in the past (in the last autosave turn), I didnt fix that yet...
the savegame list just blindly prefers the autosave.sav as that is the normal for non-wizard mode.
and I dont know how to address that yet... only the datetime of the .sav files could suffice, but best would be to read the current turn value from each and the higher one wins, not sure tho yet.

@red-kangaroo
Copy link
Contributor

@AquariusPower I had a similar problem. Game crashed and I tried to recoved from savefile. There was an autosave, but for whatever reason the game instead tried to use normal savefile. I didn't save before, though, so it threw me back to the story at the very beginning. When the game started, I had no name.

null

Is there a way to tell the game to recover from an autosave and not the normal save? I would rather not loose a lot of progress if the game crashes and instead of going back to the nearest autosave, it throws me all the way back to the last regular save.

@AquariusPower
Copy link
Contributor Author

AquariusPower commented Jun 1, 2018

@red-kangaroo

I didn't save before, though, so it threw me back to the story at the very beginning. When the game started, I had no name.

as I remember, I had this issue and fixed it, so I guess this was from a previous commit than the latest I did on that branch.
A good way is to check the savegame (or better the ivan built executable) file date-time, so we can compare with the commit date-time and be sure it was previous to the latest ones.

so in case you still have such savegames, it would be interesting to paste here the file list,
as I think that "1 0 " could be actually a dungeon level ID, therefore your savegame may be something like "playerName.10", but I need to be sure because there is spaces between 1 and 0 and it would be a lot of guess work w/o having a proper stacktrace/backtrace when the crash happened.

speaking of that... we seriously need to find a way to generate stacktraces for the windows build.
Even if you enable the debug log, it only shows things where debug entries were added and will not help on random crashes.

I am trying to find a post I did about windows stacktraces on stackexchange, brb
I think the best option there is this: https://stackoverflow.com/a/49050274 but I have to environment to test it... and it is not integrated in the application, so will only be usable by devs, let me find another.

EDIT: #386 :)

@AquariusPower AquariusPower deleted the SavegameListFix branch June 13, 2018 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants