arop wrote:Sorry! While I don't know how to make random events work properly approx every 20 year, I have changed earthquakes to happen 4 times during the game on chosen dates.
In answer to Arop's question, the general formula for calculating the probability of an event with frequency p[true] occurring upon x trials is: p[true]=1-(p[false] raised to the x power), where p[false] is the probability of the event NOT triggering. In simple terms, you're calculating the probability that the event will NOT trigger upon x number of tries and subtracting that value from 1 to determine the probability that the event WILL trigger on x number of tries
If you want to write an event that will have an effect occur randomly within a given time frame, you first need to determine the time frame over which you want the event to trigger and the frequency with which you will test for it before you can determine how to set the cutoff for the random number generator. For instance, if you want the 1871 earthquake to happen (with 99% probability) at random within a 6 month window (187107 +/- 3 months) and you tested the condition weekly, you would be testing it from 187104 through 187110 for a total of 7 x 4 or 28 times. Substituting into the above equation gives: 0.99 = 1 - (p[false]^28)) or p[false]^28 = 0.01 (or less). You can plug in some values and riase them to the 28th power until you come up with a value that is less than or equal to 0.01, and that will tell you how to code the Random number generator part of the event. In this example, the value of p[false] comes out close to about 0.86, so if you set Random 1-100 > 85, and tested it 28 times, there is a 99% probability that the event would trigger within the specified time frame. I used this method on my Michigan 1830 map to set the Economic State throughout the scenario to approximate the historical record. To make sure the event triggered if it hadn't in the random window, I added an "OR" condition for one month after the random window condition.
The big downside to hardcoding the times of significant events is that they will always occur at the same time when the scenario is replayed, so the astute player can plan for them in advance. By "randomizing" the occurance of these events, like the Earthquakes and Hurricanes in your scenario, it makes it nearly impossible for the player to anticipate them. Your Earthquake events could be easily randomized to occur sometime during the year, as could the Hurricane (1) events, although your Hurricane (2) events might be a little trickier, since they have to occur 2 months after the corresponding Hurricane (1) event. It looks like you have lots of variables available, so it should be fairly straightforward to use one of them as a 2-month timer to set off the H (2) events after the H (1) event has triggered.
I've attached a spreadsheet that will make the calculation a little less hit-and-miss with regard to setting the Random Number check. To use it, first determine the number of tries, read down the first column to that number, and then go across that row to your desired level of assurance that the event will trigger. Then go up to the top of that column (in the "RND(100)>=" row; Row 5) to see the value for the cutoff, ABOVE which the event will trigger on any one try. It's a little confusing, and if you have any questions, post them, as there may be other scenario writers wishing to add "randomization" to the occurance of events.