Vince’s load balancer

If you liked this item, please rate it up on Steam Workshop page.

Author: Yagami

Last revision: 16 Sep, 2024 at 15:04 UTC

File size: 69.99 KB

On Steam Workshop

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.