This post had me thinking so I decided to test a few things. I had some interesting results, to say the least.
I have a setup with a country in the middle of the pacific who knows nothing about the world except for its island and sea zone. I made the following event:
I duplicated the event a thousand times, made a version with years instead of days in MTTH, and another version each where "tag = ALI" was not commented out. Then I ran the game from july 1st 1453 to july 1st 1454 and noted the time it took. Here are the results, with a +/- 2 seconds error margin:Code:country_event = { id = 97990001 trigger = { #tag = ALI has_country_flag = willneverhappen } mean_time_to_happen = { days = 1 } title = "Testing event" desc = "Testing effect of mtth scale." option = { name = "I am done here" prestige = 0.01 clr_country_flag = willneverhappen } }
Then I loaded a game 10 years later with the same country, where I knew almost all countries.Code:No known countries first run: 2:50 vanilla events second run: 3:33 vanilla+900 events with days = 1 third run: 3:31 vanilla+900 events with years = 1 fourth run: 2:46 vanilla+900 events with years = 1 and tag = ALI fifth run: 2:51 vanilla+900 events with days = 1 and tag = ALI
As expected, the game ran slower.Code:knows most countries first run: 3:03 vanilla events second run: 3:50 vanilla+900 events with days = 1 third run: 3:56 vanilla+900 events with years = 1 fourth run: 3:04 vanilla+900 events with years = 1 and tag = ALI fifth run: 3:20 vanilla+900 events with days = 1 and tag = ALI
What's next? Well 900 events doesn't seem to change the speed all that much, how about 5000?
Finally we can see that "tag = XXX" is really the fastest way to do things, when you can afford to use a hardcoded country. But wait, what if the engine can recognize that 2 events have the same triggers and process them as 1? After all, those 4500 events all have the same triggers.Code:no known countries second run: 7:12 vanilla+4500 events with days = 1 third run: 7:16 vanilla+4500 events with years = 1 fourth run: 2:57 vanilla+4500 events with years = 1 and tag = ALI fifth run: 2:55 vanilla+4500 events with days = 1 and tag = ALI
Here is a new version of the event I made:
All the "0000" gets incremented while duplicating the event a thousand times. That gives us 5000 events (yeah, I did not miss a group of 100 this time) with different triggers and even different effects just to be on the safe side.Code:country_event = { id = 97990000 trigger = { tag = ALI has_country_flag = will97990000 } mean_time_to_happen = { days = 1 } title = "Testing event" desc = "Testing effect of mtth scale." option = { name = "I am done here" prestige = 0.01 treasury = 0000 } }
Anyone wants to take a guest at the final timer? I'll post it tomorrow.![]()
As a side note, I tried the first run without any files in the music folder, this is what I got:
What conclusion can we draw from this? Well the most obvious one is that I have way too much time on my hands.Code:No known countries sixth run: 2:33 vanilla no music files seventh run: 2:40 vanilla no music files + winplayer at high priority![]()




Reply With Quote

















