• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Raid Schedule - ELI5?

pink_panther

Excellent OT User
Joined
Sep 10, 2016
Messages
1,171
Solutions
13
Reaction score
613
Location
Kazordoon
I just want someone to explain raid schedule and how often it runs...

My understanding is as follows.

Do Raids are scheduled via the raids.xml, like so:

XML:
<raid name="Orc SamBP" file="Special/OrcSamBP.xml" interval2="500" margin="180" />

Interval2 is how often it runs? every 500 minutes, every 8 hours or so with a 180 minute margin, this is supposed to stop it running within 180 minutes of another raid? Is this how it goes?

If so, My question is:
If there are many raids listed at 500, more than can run in a day, which one will get to run?

If a raids listed for anything over 1440 (1 day), say every 7 days, will it EVER run, assuming server save is every 24 hours?
 
Solution
In the XML input, margin should be a number representing minutes - how much time has to pass since any other raid was ran in order for this raid to run. Use this to offset the time between raids so that you don't get raids which happen too close one to another.

interval2 should be a number representing minutes.

Every 60 seconds, a function which iterates over all registered raids runs.
When it does, for each raid, it checks if:

1. Check that no other raid is currently running.
2. Time equal to <last time any raid ran> + margin has passed.​
3. Generate a random number from 0 to MAX_RAND_RANGE, which is 10.000.000.​
If that number is higher or equal to MAX_RAND_RANGE / interval2...​
Have you tried to test it?

Run this on your server:
XML:
<raid name="Orc Test1" file="Special/OrcSamBP.xml" interval2="10" margin="5" />
<raid name="Orc Test2" file="Special/OrcSamBP.xml" interval2="11" margin="5" />

Does the first raid execute after 10 minutes, does the second raid execute after 11 minutes, 15 minutes or 16 minutes?
Or perhaps it is hours instead of minutes?
 
In the XML input, margin should be a number representing minutes - how much time has to pass since any other raid was ran in order for this raid to run. Use this to offset the time between raids so that you don't get raids which happen too close one to another.

interval2 should be a number representing minutes.

Every 60 seconds, a function which iterates over all registered raids runs.
When it does, for each raid, it checks if:

1. Check that no other raid is currently running.
2. Time equal to <last time any raid ran> + margin has passed.​
3. Generate a random number from 0 to MAX_RAND_RANGE, which is 10.000.000.​
If that number is higher or equal to MAX_RAND_RANGE / interval2, the raid will run.​
So for example, if you have a raid that is set to an interval of 45 minutes, when that time comes, it will check if a random number up to MAX_RAND_RANGE is higher or equal than 222.222; (97.78% chance).
If all of these checks are passed, it will run the raid.​
Source: raids.cpp / In function loadFromXml() to see how it reads the variables from the xml and checkRaids() to see how it uses them when checking which raid should be ran.​
 
Solution
In the XML input, margin should be a number representing minutes - how much time has to pass since any other raid was ran in order for this raid to run. Use this to offset the time between raids so that you don't get raids which happen too close one to another.

interval2 should be a number representing minutes.

Every 60 seconds, a function which iterates over all registered raids runs.
When it does, for each raid, it checks if:

1. Check that no other raid is currently running.​
2. Time equal to <last time any raid ran> + margin has passed.​
3. Generate a random number from 0 to MAX_RAND_RANGE, which is 10.000.000.​
If that number is higher or equal to MAX_RAND_RANGE / interval2, the raid will run.​
So for example, if you have a raid that is set to an interval of 45 minutes, when that time comes, it will check if a random number up to MAX_RAND_RANGE is higher or equal than 222.222; (97.78% chance).
If all of these checks are passed, it will run the raid.​
Source: raids.cpp / In function loadFromXml() to see how it reads the variables from the xml and checkRaids() to see how it uses them when checking which raid should be ran.​

Perfect

That would mean raids with a schedule higher than 1440 would still be able to run, because it the way it "schedules" raids is not by a schedule at all, but by a RNG changed checked often for the likely hood of a raid rainning, with a longer time being less likely, not necessary every x minutes.
 
Perfect

That would mean raids with a schedule higher than 1440 would still be able to run, because it the way it "schedules" raids is not by a schedule at all, but by a RNG changed checked often for the likely hood of a raid rainning, with a longer time being less likely, not necessary every x minutes.

Yes, but the chance of this RNG returning a failing outcome is incredibly small, so it is almost always guaranteed that a raid will run on its intended interval2 schedule. To be honest, I'm a bit confused why things were made this way, since all of this kind of renders ˙interval2` almost useless in this whole story. I could also be misinterpreting something, pretty tired but I had a run through it and I couldn't see this variable being used for anything else.

By all means, open up your raids.cpp and check out how it works in your distro. Not only could it be different from version to version, but also some people could've made edits deviating from the original implementation. You could also make and compile your own changes there if you want to alter some part of this mechanism.
 
well it would make more sense to have it like that, instead of a set timer, so that it is ABLE to avoid conflicts and run raids not intended to run within 24 hours, taking ss reset into consideration. Otherwise you'd have to remove ss and maybe to timed saves instead.

ill take a look at my sources and try do some math.

I think i've also been using seconds not minutes, which is part of my problem 😅

I've made a little calculator to help me.
1604750510957.png
 
Last edited:
Back
Top