Victoria 3

Victoria 3

Not enough ratings
Vince's load balancer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
69.989 KB
Sep 16, 2024 @ 8:01am
Sep 16, 2024 @ 8:04am
2 Change Notes ( view )

Subscribe to download
Vince's load balancer

Description
Load balancer framework for modders

This mod put all states and countries into daily buckets to do operations on them. This way if you have a heavy event running once per month instead you can run it every day with 1/30 of the load each day.

Global lists
V_elm_random_weekly_state_list #list of states balanced to 7 bucket.
V_elm_random_monthly_state_list #list of states balanced to 30 bucket
V_elm_random_weekly_country_list #list of countries balanced to 7 bucket
V_elm_random_monthly_country_list #list of countries balanced to 30 bucket.

Each bucket contains balanced load. They put in there based on pop count.
The lists swap out every day. Guaranteed that every state/country will be in there ONCE every 7 or 30 days respectively. The time between 2 calls to the same entity guaranteed to stay 7/30 day expect once every year. New states and countries get into the lists every week and every year once every list rebuilt from 0 to account for changes in states computation.


3 Comments
Voo Feb 12 @ 10:49am 
does this still work
Yagami  [author] Sep 25, 2024 @ 1:10am 
@MasterOfGrey It is possible. You can check for the list in question present or not like this "has_global_variable = V_elm_random_weekly_state_list". But depending on the mod implementing this may a lot of extra work for the modder.
MasterOfGrey Sep 24, 2024 @ 5:08pm 
Is it possible to set up events so that IF this is loaded, they use this, and if it's not they operate on default behaviour?

And if so, could you provide a guide?

I'd love to make this mod a recommendation for some mods, but I don't want to make it a hard requirement so things can keep going onwards in case updates break things.