|
Thread: Spell probabilities by town type | This thread is pages long: 1 2 3 4 5 6 · «PREV / NEXT» |
|
culgil
Adventuring Hero
|
posted July 23, 2016 12:18 AM |
|
|
AlexSpl said: As it turned out, Heroes 3 has a pretty straightforward spell distribution algorithm. For each level of a mage guild, "must have" spells are placed in slots first (in ascending order of their IDs), then all the other spells go, those with higher weights having more chances to appear (see sptraits.txt for weights).
Could you explain in a more detailed matter which "much have" spells are determined before the random allocation begins?
Is it similiar to Heroes 2 where at least one counterspell (Dispel, Cure, Anti-Magic) and one damagespell are guaranteed?
It would be very nice to have a step-by-step description because this plays a role for understanding how important the raw (or net) spell chances really are!
|
|
AlexSpl
Responsible
Supreme Hero
|
posted July 23, 2016 01:46 AM |
|
|
"Must have" spells are just those you ticked in the map editor. The algorithm is simpler than in Heroes II, and Ecoris' calculations stay valid.
|
|
Maurice
Hero of Order
Part of the furniture
|
posted July 23, 2016 01:44 PM |
|
|
I just extracted the SpTraits file from the H3bitmap.lod file from my Heroes3 installation and it's a file that can easily be opened in Excel. Despite being called a .txt file, it's actually nicely organised in columns.
When I check a given spell Tier for any of the 9 factions, the spell chances add up to 100.
The algorithm they use to distribute the spells determines how they populate it though. I see mention of determining them one by one, disregarding the ones that have already been chosen. Is that algorithm indeed derived from the executable? If so, does anyone have the details of that algorithm?
The way I would do it, is as follows (this for Tier 1):
First spell: random(100)
Second spell: random (100-weight_spells(1))
Third spell: random (100-weight_spells(1,2))
Fourth spell: random (100-weight_spells(1,2,3))
Fifth spell: random (100-weight_spells(1,2,3,4))
Sixth spell: random (100-weight_spells(1,2,3,4,5))
For each spell chosen, it's taken off the list of viable spells, so the selection list gets reduced.
Since spells can be forbidden, the 100 in the randoms above is likely simply the sum of the weights of all allowed spells - where you can simply include the already selected spells by disallowing them in further selections. As soon as the (sum(allowed_spells)-weight_spells(X)) drops to zero, all viable spells have been determined and subsequent slots can be put to empty.
But I am not sure if that's how they did it.
|
|
AlexSpl
Responsible
Supreme Hero
|
posted July 23, 2016 05:35 PM |
|
Edited by AlexSpl at 20:03, 23 Jul 2016.
|
Quote: The way I would do it, is as follows (this for Tier 1):
First spell: random(100)
Second spell: random (100-weight_spells(1))
Third spell: random (100-weight_spells(1,2))
Fourth spell: random (100-weight_spells(1,2,3))
Fifth spell: random (100-weight_spells(1,2,3,4))
Sixth spell: random (100-weight_spells(1,2,3,4,5))
For each spell chosen, it's taken off the list of viable spells, so the selection list gets reduced.
That's exactly how they did it.
For example, Castle's default 1-st level spell weights:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
-------------------------------------------
3 3 3 30 10 3 3 10 10 10 0 0 5 5 5
SUM_W = 100
The corresponding weight sums:
0 3 6 9 39 49 52 55 65 75 85 - - 90 95 100
Let SUM_W-sided dice roll, say, five (5). Then the 2-nd spell (#2) from the table above goes to the 1-st empty slot, as 5 is in the 2-nd interval (3, 6]. And so on.
|
|
culgil
Adventuring Hero
|
posted July 23, 2016 09:17 PM |
|
|
AlexSpl said: "Must have" spells are just those you ticked in the map editor. The algorithm is simpler than in Heroes II, and Ecoris' calculations stay valid.
Thx. Then it is really simple and straightforward.
And thx to both of you for the further explanations.
|
|
Maurice
Hero of Order
Part of the furniture
|
posted July 24, 2016 01:06 PM |
|
Edited by Maurice at 13:06, 24 Jul 2016.
|
Below is an overview of all the spells that exist within the Heroes3 Complete edition that I own. It lists the distribution of all spells across all Towns and their individual weights.
Note that the "Fear" spell isn't among them. Note furthermore that the Titan's Bolt is listed, which is granted through a combination Artifact. It doesn't normally occur in a Mage Guild.
|
|
phoenix4ever
Legendary Hero
Heroes is love, Heroes is life
|
posted July 24, 2016 01:55 PM |
|
|
Fear spell?
Btw that's Tower without Library, this one shows Tower with Library:
http://mightandmagic.wikia.com/wiki/Mage_Guild_(H3)
|
|
natalka
Supreme Hero
Bad-mannered
|
posted July 24, 2016 01:57 PM |
|
|
As far as I understand 30% for magic arrow is the probability for each slot. Can someone post a table showing chances to get each spell in any slot?
After all this is what players need. We dont care for certain slot but would like to see the total chance.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted July 24, 2016 03:20 PM |
|
|
phoenix4ever said: Fear spell?
Btw that's Tower without Library, this one shows Tower with Library:
http://mightandmagic.wikia.com/wiki/Mage_Guild_(H3)
I think above table shows probability for each slot so it doesn't matter if u have library.
Library, influences spells in the overall probability table I requested above.
|
|
phoenix4ever
Legendary Hero
Heroes is love, Heroes is life
|
posted July 24, 2016 03:37 PM |
|
|
Okay, guess I missunderstood then, sorry.
Now what is that Fear spell?, Azure Dragons cause fear, but it's not a spell afaik.
|
|
AlexSpl
Responsible
Supreme Hero
|
posted July 24, 2016 03:41 PM |
|
|
Quote: Fear spell?
You can find it in pyramids if playing the Restoration of Erathia with the patch 1.2.
By the way, you couldn't get Air Elemental and Earth Elemental spells from pyramids until the patch 1.2. Maybe the developers freed the "Fear" spell while fixing that issue.
|
|
AlexSpl
Responsible
Supreme Hero
|
posted July 24, 2016 04:00 PM |
|
|
Quote: I think above table shows probability for each slot so it doesn't matter if u have library.
Library, influences spells in the overall probability table I requested above.
No, it shows overall probabilities. You can find the table, originally posted by Ecoris, in the Tribute to Strategists by Rainalcar on the page 2 (if I have the latest version of the doc).
|
|
phoenix4ever
Legendary Hero
Heroes is love, Heroes is life
|
posted July 24, 2016 04:02 PM |
|
|
Hmm interesting, I don't think I ever played RoE with patch 1.2 so I've never seen this.
What did it do and was it completely overpowered, since it could'nt appear in towns? What magic school did it belong to?
Maybe if the spell was reasonable it could be added back in HotA, maybe only for pyramids as it was with the 1.2 patch, the selection of level 5 spells is pretty scarse...
|
|
AlexSpl
Responsible
Supreme Hero
|
posted July 24, 2016 04:07 PM |
|
|
Quote: From SPTRAITS.TXT
COMBAT_SPELL|CREATURE_TARGET|MIND_SPELL
Fear ( disabled ) 4 (Level)
16 8 8 8 0 75 75
50 25 0 0 0 0 0
0 0 0 50 50 50 50
Strikes an enemy unit with such fear that it becomes unable to attack and nearly unable to move.
{Basic Fear}
Strikes an enemy unit with such fear that it becomes unable to attack and nearly unable to move.
Spell Point cost is half that of Normal Fear.
{Advanced Fear}
Strikes an enemy unit with such fear that it becomes unable to attack and nearly unable to move.
Penalty to movement is twice that of Basic Fear.
{Expert Fear}
Strikes an enemy unit with such fear that it becomes unable to attack and nearly unable to move.
Penalty to movement is three times that of Basic Fear.
Alas, while it can be enabled it has no effect.
|
|
phoenix4ever
Legendary Hero
Heroes is love, Heroes is life
|
posted July 24, 2016 04:19 PM |
|
|
Yeah I found this old thread, which you contributed a lot to:
http://heroescommunity.com/viewthread.php3?TID=18325&pagenumber=1
So it does'nt do anything and is a level 4 earth spell?
Pyramids gives level 5 spells, but I guess it was different once...
|
|
AlexSpl
Responsible
Supreme Hero
|
posted July 24, 2016 04:40 PM |
|
Edited by AlexSpl at 17:03, 24 Jul 2016.
|
Quote: Pyramids gives level 5 spells, but I guess it was different once...
Why level 5 only? It's always been 4 & 5.
UPD Made some tests on 4.0. Indeed, only level 5 spells in pyramids now. But I remember it clearly how I got Frenzy from a pyramid. Maybe that was fixed with a patch?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted July 24, 2016 05:09 PM |
|
|
Hopefully they disabled fear, it is such a pain.
|
|
Maurice
Hero of Order
Part of the furniture
|
posted July 24, 2016 08:48 PM |
|
|
natalka said:
phoenix4ever said: Fear spell?
Btw that's Tower without Library, this one shows Tower with Library:
http://mightandmagic.wikia.com/wiki/Mage_Guild_(H3)
I think above table shows probability for each slot so it doesn't matter if u have library.
Library, influences spells in the overall probability table I requested above.
It's the chance for spells to appear in the first slot of a given tier. The second slot has a slightly altered chance distribution. Let's look at Magic Arrow and Shield. The first has a weight of 30, the second 10. If the game randomly selects Magic Arrow in the first slot (30/100 = 30% chance), the chance for the Shield spell to appear in the second slot changes to 10/70 = 14.3%. If the game instead chooses the Shield spell in the first slot (10/100 = 10%), the chance for the Magic Arrow spell to appear in the second slot is 30/90 = 33.3%.
What you essentially do is that the spell selected for the first slot is taken off the list for the second slot, for the weight it carried. So if the first spell is the Magic Arrow (weight 30), the remaining total weight for the second slot is only 70 (100 - 30). If Shield is selected, the remaining total weight for the second slot is 90 (100 - 10).The chance for a given spell to be selected for the second slot is the spells' weight divided by the remaining total weight.
I am guessing the table listed by AxelSPs link is accurate for the overall chances. The determination is simply an aggregation of all the possible permutations, relative to the chance such a permutation can occur.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted July 24, 2016 09:55 PM |
|
|
So u are saying that magic arrow has only 30% chance to appear in any magic guild?
|
|
Maurice
Hero of Order
Part of the furniture
|
posted July 24, 2016 11:49 PM |
|
Edited by Maurice at 00:02, 25 Jul 2016.
|
natalka said: So u are saying that magic arrow has only 30% chance to appear in any magic guild?
Nope, that's not what I said. It has 30% chance to appear in the first slot.
I'm going to try to wrap my head around the math here, so bear with me . Taking Castle as an example, we can see that it has ...
... 5 spells with a weight of 3 at Tier 1
... 3 spells with a weight of 5 at Tier 1
... 4 spells with a weight of 10 at Tier 1
... 1 spell with a weight of 30 at Tier 1 (obviously, the Magic Arrow spell).
Therefore, it has 30% chance to appear in slot 1 of the Castle Mage Guild. Now suppose it doesn't, but that the game has selected another spell. We have three different situations to consider then:
1) It selected a weight 3 spell for that slot. Since there are 5 of those, the odds of that happening is actually 15%. Scratching the weight 3 spell from the list, we're left with a weight of 100 - 3 = 97 total. For Magic Arrow to appear in slot 2, the chance is then 30/97 = 30.9% (slightly less, but I will forgo rounding issues for this explanation). So, 15% chance for a different spell in slot 1 means that it can occupy the second slot with a 30.9% chance;
2) It selected a weight 5 spell for that slot. Similar to above, we see that there's 15% chance on that, with a chance for Magic Arrow to be selected next equal to 30 / (100 - 5) = 31.6% chance.
3) Lastly, the game selected a weight 10 spell at slot 1. Like above, the resulting chance for Magic Arrow at slot 2 is then 30/90 = 33.3% chance, which happens in 40% of the cases.
For the first two slots we can then combine it:
- 30% chance in slot one
- 15% x 30.9% + 15% x 31.6% + 40% x 33.3% = 22.7%
Combined, the chance that Magic Arrow is in slot 1 or slot 2 for a Castle Mage Guild is 52.7%.
Now we can try and figure out the other permutations possible when we consider slot 3, if the game didn't put it in slot 1 or 2. Possible permutations in weight values for spells in slot 1 and slot 2 are as follows:
1) 3 3 (and 5 * 4 = 20 spell permutations for this one)
2) 3 5 (and 5 * 3 = 15 spell permutations for this one)
3) 3 10 (and 5 * 4 = 20 spell permutations for this one)
4) 5 3 (and 3 * 5 = 15 spell permutations for this one)
5) 5 5 (and 3 * 2 = 6 spell permutations for this one)
6) 5 10 (and 3 * 4 = 12 spell permutations for this one)
7) 10 3 (and 4 * 5 = 20 spell permutations for this one)
8) 10 5 (and 4 * 3 = 12 spell permutations for this one)
9) 10 10 (and 4 * 3 = 12 spell permutations for this one)
We can calculate the odds for each of these 9 permutations:
1) (3/100)*(3/97)*20 = 1.86%, for (30/94) = 31.9% chance on Magic Arrow in slot 3
2) (3/100)*(5/97)*15 = 2.32%, for (30/92) = 32.6% chance
3) (3/100)*(10/97)*20 = 6.19% for 33.3% chance
4) (5/100)*(3/95)*15 = 0.95% for 32.6% chance
5) (5/100)*(5/95)*6 = 3.16% for 33.3% chance
6) (5/100)*(10/95)*12 = 10.53% for 35.3% chance
7) (10/100)*(3/90)*20 = 6.67% for 34.5% chance
8) (10/100)*(5/90)*12 = 6.67% for 35.3% chance
9) (10/100)*(10/90)*12 = 13.33% for 37.5% chance
Multiply these for each permutation to get the total for this slot, if it didn't appear in slot 1 or 2, and add it to the already derived 52.7% for it to appear in slot 1 or 2. The above for slot 3 won't be that much (as you can see, each of the 9 permutations has a small chance to occur), so it's going to gravitate towards the 89% as listed in the google document linked to by AxelSP. That's the total chance for Magic Arrow to appear in any slot of the Castle Mage Guild at tier 1.
You can see how fast the permutations branch out. At slot 1, we just had 1 chance to consider. For slot 2, we needed to consider three times as many. For slot 3, the number multiplied by three again, for a total of nine. If Magic Arrow isn't in the first 3 slots and we have to consider slot 4, you can already see we're going to have to consider 27 permutations. Finally, for slot 5, we get 80 permutations to consider (and not 81, which is 27*3, because we only have 3 spells with a weight of 5 at Tier 1 - hence, the permutation "5 5 5 5" can't occur, which is the only one that falls out).
|
|
|
|