View Issue Details

IDProjectCategoryLast Update
0024522AI War 2Bug - GameplayJul 16, 2021 7:00 pm
ReporterSigma7 Assigned ToChris_McElligottPark  
Status resolvedResolutionreopened 
Product VersionBeta 2.753 Interplanetary States of Matter 
Fixed in Version3.312 Hotfix 
Summary0024522: Autosaving when disabled
Description\CodeExternal\AIWarExternalCode\src\SpecialFactions\Human.cs:5778, function UpdateAutosave

           int autosaveInterval = GameSettings.Current.GetIntBySetting( "AutosaveInterval" );
            int autosaveIntervalUnit = 60; //once per minute
            if ( AIWar2GalaxySettingTable.GetIsBoolSettingEnabledByName_DuringGame( "IronmanMode" ) )
            {
                tracking.NumAutosavesToTrack = 1;
                autosaveInterval = 5; //take ironman saves every few minutes. Note that exiting the game will cause it to take an ironman save anyway, so doesn't need to be super often
            }
            int secondsForNextAutosave = tracking.TimeForLastAutosave + autosaveInterval* autosaveIntervalUnit;
            if ( secondsForNextAutosave <= World_AIW2.Instance.GameSecond ||
                 (tracking.TimeForLastAutosave <= 0 && AIWar2GalaxySettingTable.GetIsBoolSettingEnabledByName_DuringGame( "IronmanMode" ) ) ) //save immediately for ironman
            {

Actual result is Non-ironman games not checking if autosaveInterval is equal to zero, and thus attempts an autosave every few seconds.

Expected result is described in GameData/Configuration/Setting/KDL_Settings.xml:12:

   description="Autosaves are done every X minutes. Set this to 0 to disable autosaves."/>

TagsNo tags attached.

Activities

Chris_McElligottPark

Mar 9, 2021 1:37 pm

administrator   ~0060705

Thanks!

* Updated the autosave code so that even if you disable it, in ironman mode it will still work. And if you disable it in ironman mode, it should definitely actually be disabled.

I was actually seeing one more line than what you had:

            tracking.NumAutosavesToTrack = GameSettings.Current.GetIntBySetting( "AutosavesToTrack" );
            if(tracking.NumAutosavesToTrack <= 0)
                return;
            int autosaveInterval = GameSettings.Current.GetIntBySetting( "AutosaveInterval" );
            int autosaveIntervalUnit = 60; //once per minute
            if ( AIWar2GalaxySettingTable.GetIsBoolSettingEnabledByName_DuringGame( "IronmanMode" ) )
            {
                tracking.NumAutosavesToTrack = 1;
                autosaveInterval = 5; //take ironman saves every few minutes. Note that exiting the game will cause it to take an ironman save anyway, so doesn't need to be super often
            }

That code above is what I saw in svn, not the code that you posted in your OP. I'm not sure why the difference. The code above should prevent saves fine, but also should have not properly worked in ironman if you had autosaves off. I've made the adjustment to be this:

            tracking.NumAutosavesToTrack = GameSettings.Current.GetIntBySetting( "AutosavesToTrack" );
            int autosaveInterval = GameSettings.Current.GetIntBySetting( "AutosaveInterval" );
            bool isIronMan = AIWar2GalaxySettingTable.GetIsBoolSettingEnabledByName_DuringGame( "IronmanMode" );
            if ( isIronMan )
            {
                tracking.NumAutosavesToTrack = 1;
                autosaveInterval = 5; //take ironman saves every few minutes. Note that exiting the game will cause it to take an ironman save anyway, so doesn't need to be super often
            }
            if (tracking.NumAutosavesToTrack <= 0)
                return;

That should work for ironman and non-ironman as expected. If you still see issues, please let me know. Thanks!

Sigma7

Mar 12, 2021 5:48 pm

reporter   ~0060748

Setting Autosave every X minutes to 0 still has rapid autosaving. To fix, that last condition should be:

            if (tracking.NumAutosavesToTrack <= 0 || autosaveInterval <= 0)
                return;

Chris_McElligottPark

Jul 16, 2021 7:00 pm

administrator   ~0062466

Thanks!

* If you have the frequency of autosaves set to 0, it now actually properly disables those (as the tooltips say it should) rather than running them constantly.

Issue History

Date Modified Username Field Change
Mar 9, 2021 10:52 am Sigma7 New Issue
Mar 9, 2021 1:37 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Mar 9, 2021 1:37 pm Chris_McElligottPark Status new => resolved
Mar 9, 2021 1:37 pm Chris_McElligottPark Resolution open => fixed
Mar 9, 2021 1:37 pm Chris_McElligottPark Fixed in Version => Beta 2.754 Buffs And Bugfixes
Mar 9, 2021 1:37 pm Chris_McElligottPark Note Added: 0060705
Mar 12, 2021 5:48 pm Sigma7 Status resolved => feedback
Mar 12, 2021 5:48 pm Sigma7 Resolution fixed => reopened
Mar 12, 2021 5:48 pm Sigma7 Note Added: 0060748
Jul 16, 2021 7:00 pm Chris_McElligottPark Status feedback => resolved
Jul 16, 2021 7:00 pm Chris_McElligottPark Fixed in Version Beta 2.754 Buffs And Bugfixes => 3.312 Hotfix
Jul 16, 2021 7:00 pm Chris_McElligottPark Note Added: 0062466