Resolved DailyTick() (aka update of recruitment, prisoners etc.) depends on time of game load (fires 24h since each game load)

Users who are viewing this thread

Carabus

Sergeant at Arms
DailyTick() event (which is for example used to update toops available to recruit in settlements, update recruitable prisoners, possibly troop wages too etc.) is configured in such a way that it fires in periods of 24 hours ingame time since last game load. Which means it can never fire if you save/load game in periods of less than 24h ingame time! And even in more typical scenario where you sometimes save/load more frequently (less than 24h since last saveload), and sometimes less frequently, the event will fire in much less occasions than expected from the flow of game time. Which may skew game balance (because some game logic expected to execute daily will execute more rarily) in player sessions (where players save/load frequently) vs what is expected from test sessions (where I quess developers run the game uninterrupted for longer periods).

The problem also applies with HourlyTick (which will fire 1h after game load) but it is not as visible because player is unlikely to save/load with less than 1h gametime in between.
But more importanly it also applies to WeeklyTick which is dependent on DailyTick, so if DailyTick doesn't fire, WeeklyTick won't either.

The problem appears to be caused by this method in MBCampaignEvent.cs :
C#:
    public MBCampaignEvent(float triggerPeriod, float initialWait, float curGameTime)
    {
      this.TriggerPeriod = triggerPeriod;
      this.InitialWait = initialWait;
      this.NextTriggerTime = curGameTime + this.InitialWait;
      this.isEventDeleted = false;
    }

(every variable is in hours, and curGameTime means elapsed hours since start of campaign)

This line:

this.NextTriggerTime = curGameTime + this.InitialWait;

causes the delay to always be 24h from game time at the moment of game load.
Instead the initialWait was probably meant to be delay from the start of the campaign, in which case the code probably should be:

var fullPeriodsSinceInitialWait = Math.Floor((curGameTime - initialWait) / triggerPeriod); // can be negative if still in initialWait
var nextFullPeriodNumber = Math.Max(0, periodsSinceInitialWait + 1);

this.NextTriggerTime = initialWait + nextFullPeriodNumber * triggerPeriod;


Game version for which I tested and examined the code: e1.2.1.


How to Reproduce: Load game, wait 24h -> event fires. Load game, wait 12h, save, load, wait 12h etc. -> event never fires.
Version: e1.2.1.
Installed community-made modifications: None
Computer Specs
:
OS: Windows 7 64-bit
GPU: Nvidia GTX1060 6GB
CPU: Intel i7-7700K
RAM: 16GB
Motherboard: Asus Z270E
Storage Device (HDD/SSD): HDD
 
Last edited:
It explains why i'm paying wages/receiving income in different parts of day each time i play.

This means that You can have free army as long as You save/load within 24 in game hours.
 
It explains why i'm paying wages/receiving income in different parts of day each time i play.

This means that You can have free army as long as You save/load within 24 in game hours.


Yeah but there are also many negative effects, you (and other parties) will never get new troops to recruit in towns/villages, your prisoners would never appear as recruitable etc.
 
Yeah but there are also many negative effects, you (and other parties) will never get new troops to recruit in towns/villages, your prisoners would never appear as recruitable etc.


I know. But it's still an exploit. If for example i.ll built 250 man army composed of T6 troops I can mop down most of the armies and sell the loot. All of this for free and building a T6 army isn't much of a problem at certain point. I know it's not something easy and nice to use but it' still there.

When more economy balancing will come and earning money will be harder that could be a life saver at the point were You have almost no money and need to pay wages.
 
I've also noticed that the DailyTick happens at different times of day for different settlements. For instance one might tick in the middle of the afternoon while another might tick a dawn. This might be by design to reduce the load on the CPU at any given time, but it might have implications on how caravans update their pricing information.
 
I've also noticed that the DailyTick happens at different times of day for different settlements. For instance one might tick in the middle of the afternoon while another might tick a dawn. This might be by design to reduce the load on the CPU at any given time, but it might have implications on how caravans update their pricing information.


Well as long as it happens once per game-day it is quite ok I guess.
But having it depend to save/load allows it to be skipped completely, and ruins many game mechanics that depend on DailyTick logic.
 
Last edited:
Hello, sorry for the late reply. We have fixed a considerable amount of the problems we have encountered so far and improved the game performance with the multiple patches we have released. Please make sure that your game, your drivers, and OS are up to date and the game has necessary permissions over your security software. Please let us know if the problem persists after completing these steps and verifying the integrity of the game files through Steam.
 
As the asked information was not provided within 2 weeks, this thread is marked as solved. If the issue still continues, please update this thread.
 
Back
Top Bottom