|You must be logged in to post messages.
Please login or register
|Topic Subject:||Usage of the Chance condition|
posted 02-19-18 00:54 AM CT (US)
I feel like this is the most obscure condition, partly because its behavior is a bit erratic. I'm here to make it a bit more translucent. I've mapped the varying performances of the chance condition so as to enable you to make better predictions in different setups and design better gameplay mechanics when creating scenarios. Specifically, how does the chance condition behave:
- With different values
- At different speeds
- With different timer conditions
- by stacking chance conditions
- if used as a looping activator/generator/spawn trigger.
At the end of this post, you can also see the data I've gathered and a summation. Let's skip straight to the factoids...
- The chance condition takes integer values
- No negative values. (no shit, sherlock!)
- These integer values stand for percentages (probability, m'kay?).
The performance of the chance condition varies over different values used and not just because smaller values are less reliable than bigger ones in the same number of iterations. Here's an image (x-axis are chance values in percentage, y-axis is the average deviation from expected values, over all test setups):
A rough approximation: There can be 4-10% differences in performance for different values. The average deviation for 2% tests shouldn't be that much lower than for 5%, nor should the average '5% deviations' be that much higher than the 10% ones, nor the 10% ones fo... you get the point. I'm gonna do some more thorough testing later on (let these setups run for a night) to see how
The game speed does not have any bearing on effects produced when using the chance condition. As a modifier on its own, it is
This is an infinite spawn point for Arbalest that spawns an arbalest roughly 19 out of 20 times based on logic. In practice, however, because the Arbalest takes some time to move from area A to whatever the target location is in trigger II, at any game speed the Arbalest fails to respond adequately fast enough (something to do with the command/action stack order in the engine I guess) and the whole mechanic occasionally loses 1s and thus 1 effect was not produced, regardless of the chance (notice performance discrepancy on spreadsheet). With an added 2s timer condition in TRIGGER II, it does considerably better, as we would expect since the unit has more time to move. What we don't expect however, is that this whole mechanic now, with an added 2s timer,
While impossible to test for all cases here, I can make these claims based on my tests:
- In cases where
- In cases where
- As a general rule, maybe remember that the 2s looping timer generally performs sub-optimal (~15% error).
No timer condition used with chance: 0.8%
1s timer condition used with chance: 1.23%
2s timer condition used with chance: 15.25% (!)
No timer condition used with chance: 44.24%
1s timer condition used with chance: 44.31%
2s timer condition used with chance: 11.16% (!)
As you can see, whether you're using one chance-based trigger or chaining triggers in a chance-based mechanic, the difference between using 'no timer' and a 1s timer is statistically irrelevant. The difference between those and a 2s timer are, however, very significant.
- To get non-integer percentages for finely tuned tweaking!
- To get even smaller chances than 1/100. (whait, isn't that the same as my previous point? Oh, well.. just pretend like there's a lot more benefits to having multiple chance conditions)
- I've only tested .5 percentage differences, since gathering data that is statistically relevant for smaller values takes too much time. I'm also pretty sure you can keep stacking chances (for that extremely rare 'divine armor' (+2500hp, +200/+200) you never want anyone to have).
If I wasn't clear enough in the previous paragraph, let me rephrase: When combining multiple chance conditions in one trigger, the different values are multiplied as follows:
cond A = 33 (->
cond B = 1 (->
A*B = 0.33*0.01 (chance of an effect = 0.33%)
I've only tested:
- tribute (to test a non-unit stat)
- attack modifier (for the sake of modifying a unit stat)
- task object (for the sake of having an effect that is not modifying stats and to see how trigger combos relate to predicted effects)
There is no reason to believe different effects affect the chance performance whatsoever. With the exception, of course, of effects that in themselves alter the behavior of your effect-producing triggers (like the spawn mechanic mentioned earlier)
So, I hope this clears things up for people. Let me know if you want more information on something specific concerning the chance condition or have suggestions/comments/requests concerning the source material. If you didn't understand something in here, it's probably because I'm both more than a little crazy and a little lazy. You may have heard this before but
Two last things, because this may not be apparent and/or self-evident:
I. A look at the 'effects over chance%' graph:
I wanted to show this graph, an analysis of produced effects in all the tests I've done @ different speeds and timer conditions, to demonstrate that the chance condition is not a 'one size fits all' kinda condition. Different setups and different goals require tweaking the chance condition. As with any properly balanced trigger-magick, a lot of testing is required if you want to be sure the number of effects accrued over time matches what you want it to be. However, most of the anomalous behavior has already been discussed in this post, so based on what I've researched so far, this post and my source material, I'm sure you're well on your way to use and explore the chance condition with confidence!
II. A Look at the deviation graph (from my spreadsheet):
I wanted to show these graphs to demonstrate that for smaller chance values, you will want to use a larger number of iterations if you want the produced effects to match the intended ones. On the other hand, if you want more chaotic effect production, you can have many smaller chances in separate triggers do the same thing. Using the chance condition in one or fewer iterations for game-deciding effects is not advised, as that would not be a balanced approach. (really, GL252?) Well, yes. Secondly, the white graph displays all tests used (t = tribute, m = modify attack, s = spawn; first "1" or "h" for one-and-a-
I. My calculations (you can view, comment & download):
II. My test environments: (links to 3 example test-case scenarios, compressed files)
[This message has been edited by GL252 (edited 03-04-2018 @ 01:06 AM).]
|Age of Kings Heaven » Forums » The University » Usage of the Chance condition||Top|
|You must be logged in to post messages.|
Please login or register
Age of Kings Heaven | HeavenGames
Copyright © 1997–2018 HeavenGames LLC. All rights reserved.