View Issue Details

IDProjectCategoryView StatusLast Update
0004161The Dark ModCodingpublic15.08.2015 10:05
ReporterSpringheel Assigned ToSteveL  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionTDM 2.04 
Target VersionTDM 2.04Fixed in VersionTDM 2.04 
Summary0004161: Alternate Quicksave feature
DescriptionSince quicksaves can become useless due to corruption or bad timing, create a new system that alternates quicksaving between two different files. That way if the most recent one becomes corrupted, players can manually load the older of the two, and probably won't have to start the mission over.

http://forums.thedarkmod.com/topic/17172-backup-saves/#entry372402
TagsNo tags attached.

Activities

SteveL

SteveL

03.08.2015 21:37

reporter   ~0007703

TODO: I spotted a bug in the new 2.03 facility for letting mappers control saving while working on the above. Session.cpp line 1826: always uses hardcoded quicksave file name (English) instead of the correct l18n string.
SteveL

SteveL

03.08.2015 22:40

reporter   ~0007704

From the forum thread http://forums.thedarkmod.com/topic/17303-quicksaving/#entry375244 :
//
I've implemented the cvar. The save game code is in the engine framework, so the cvar is a com_ one, com_numSaveGames. It defaults to 2.

I didn't have to write any date-handling code :) The engine already has the facility to give you a list of save games sorted by date descending: that's what's use by the load game menu. It also has a facility to find an unused file name, so all this tweak does when saving is: look through the sorted list of saves and count the number of quicksaves, and if there are too many already, the last (oldest) one that it saw gets overwritten. If there aren't too many, it generates an unused filename beginning Quicksave, e.g. Quicksave_0 or Quicksave_1 (adjusted for language/l18n). When loading, it just finds the first (most recent) matching save, or if there aren't any quicksaves it gives you the same console error that you get now.

This method will never *reduce* the number of quick saves that you have for a mission. If you create 5, then reduce the cvar to 3, it'll just overwrite the oldest each time, so you'll keep 5.

File timestamps don't include fractional seconds, so the game can choose the "wrong" file if you tap F5 several times in one second. But that won't be a problem in practice. The overwritten file will always be one that you created that second.
//

Also fixed the l18n problem.


At rev 6526

/trunk/framework/Session.cpp
/trunk/framework/Session_local.h
SteveL

SteveL

04.08.2015 17:54

reporter   ~0007705

And at rev 6527. Tweak to handle the player setting the cvar to 0 or less. They'll still get at least 1 quicksave.
SteveL

SteveL

15.08.2015 10:05

reporter   ~0007720

And at rev 6531. Restrict range of cvar instead of handling the bad value as in 6527

Issue History

Date Modified Username Field Change
01.06.2015 14:39 Springheel New Issue
15.07.2015 20:19 SteveL Assigned To => SteveL
15.07.2015 20:19 SteveL Status new => assigned
03.08.2015 21:37 SteveL Note Added: 0007703
03.08.2015 22:40 SteveL Note Added: 0007704
03.08.2015 22:41 SteveL Status assigned => resolved
03.08.2015 22:41 SteveL Resolution open => fixed
03.08.2015 22:41 SteveL Fixed in Version => TDM 2.04
03.08.2015 22:41 SteveL Target Version => TDM 2.04
04.08.2015 17:54 SteveL Note Added: 0007705
15.08.2015 10:05 SteveL Note Added: 0007720