• Register
Post news RSS COTE Beta, Stability, Performance and the Event Cache

Approaching release of COTE Beta (first playable version released to the public) and what to expect soon

Posted by on

Hello all followers of the mod,

Thank you for your continued interest. I have to give an update here on where we are with the mod and when it will come out.

MOTE is based primarily on the EU3 architecture and game engine. EU3 Divine Wind is the closest relative of MOTE and as such most EU3 features are in the MOTE game engine. One of those features is the event cache. Apart from some small exceptions, events are read ONLY at the beginning of every month, and not after the 6th or the 7th or so. After this time, the "event cache" kicks in and events will not fire until the event cache is refreshed (something that happens on the 1st of every month), even if these event triggers are valid and their Mean Time To Happen is very low.

Since the earliest days of March of the Eagles mod I've used a technique that has been introduced in the HTTT update for Europa Universalis 3. The technique involved artificially refreshing the event cache to allow events to constantly be read. This is something that EU4 supports natively via their "defines.lua" which is basically the game's configuration file. In our case, we have to use two old dusty commands which have only been used ONCE in the old HTTT expansion for EU3 back in 2009. These are:

refresh_events = yes [A command that instantly refreshes the ENTIRE event cache]
possible_country_event = x [A command that refreshes only the selected event ID so it can be fired again]

The earliest version of the solution I had to the event cache was an offscreen offmap event firing constantly every single day (MTTH days = 1) with the effect "refresh_events = yes". When there weren't many events in the mod, this would keep the event cache constantly refreshed so that anything with a mean_time_to_happen of, for example, days = 1, will fire as soon as physically possible. This was great for most mods as my scripts require things to happen quickly.

However, as the amount of events ballooned in COTE, it became apparent that every time refresh_events = yes was called, there would be a half-second freeze as the game code read through the events folder. I tried rewriting all my events and using IF emulation and event "stacking" to keep the same code while reducing the actual amount of events from 10,000 + to only around 6,000. The end result, however, was the same. The game was lagging because of the amount of code and not because of the amount of events.

Furthermore, people have reported stability problems (crashing) from my mods from day 1. MOTE Enhanced, the other large mod I released, had a lot of people reporting crashing, and even some people who reported a crash on the 3rd day of the game. It eventually came to light that deleting the "refresher" event or making the refresh_events = yes command fire only twice a month instead of every day fixed the issue.

This became apparent as I released the COTE pre-alpha to a select group of playtesters. The performance on older hardware was abhorrent, as even only refreshing the event cache every 3 days would still cause random freezes and much to my dismay everyone reported a LOT of crashing.

I tried returning to the drawing board and using "possible_country_event = x" to only selectively refresh the events that actually mattered, maybe half of the total code or less. However, possible_country_event, when used on more than a single event, caused even more crashes and freezing than refresh_events = yes.

Slowly it dawned on me why the PDX devs had only used these effects once in the history of EU3. The event cache is there for a reason, and messing with it fundamentally messes with the stability of the game. If I were to guess, there is a risk of crashing every single time the the event cache is refreshed artificially (not at the beginning of each month). Mods like MEIOU for Divine Wind have tens of thousands of events on top of the existing vanilla events, and they are pretty stable even though the event cache (refreshed only during the 1st of Jan) has to refresh 20,000+ events. The conclusion is that if the game refreshed events naturally, there's no inherent risk of crashing. But even in mods with low total events like MOTE Enhanced (I think MOTE Enhanced only had like 3,000 events total or less), artificially refreshing the event cache will eventually cause crashing.

All this to say that the above has been a major setback for the mod and this is why our playable release is not yet ready. We may have to do with only having events fire at the beginning of the month, the game is still perfectly playable and it's not that much of a gameplay downgrade. However, we are currently looking into using on_actions to trigger events that are valid but are waiting on the event cache. We will then need to test the stability of this and make sure it's not causing crashes before releasing our mod.

We currently are very close to being able to release and I appreciate your patience on the above.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.