Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Library of Enlightenment > Thread: Spell probabilities by town type
Thread: Spell probabilities by town type This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
Maurice
Maurice

Hero of Order
Part of the furniture
posted July 13, 2016 08:29 PM
Edited by Maurice at 20:32, 13 Jul 2016.

With garbage I mean that the slot in the savegame data contains random bytes. If the entry is void, it contains the hex value FF FF FF FF.

Let me give you an example to clarify. Below is a typical byte string (in HEX format) describing a Mage Guild and all of the spells contained within:

0F 00 00 00 1B 00 00 00 2B 00 00 00 00 00 00 00 2A 00 00 00 36 00 00 00 18 00 00 00 11 00 00 00 04 00 00 00 3E 00 00 00 2C 00 00 00 00 00 00 00 15 00 00 00 22 00 00 00 27 00 00 00 14 00 00 00 03 FB 0B 03 00 00 00 00 16 00 00 00 26 00 00 00 07 00 00 00 0F 00 00 00 8A 09 25 0A 00 00 00 00 45 00 00 00 43 00 00 00

The 00 entries are simply padding bytes, they have no meaning; they stem from the fact that they chose to store spell numbers as 4-byte numbers. The non-00 entries are spell ID's, in HEX format. The first one, 0F, is simply ID 15. Spell ID 15 is the Magic Arrow spell. Each 4 of these entries therefore tells the game which spell to place in that slot in the Mage Guild.

But before I differentiate, I return to the spell slot distribution I described in my previous post: 6 for Tiers 1 through 4 and 2 more for Tier 5, or 26 in total. That means the byte string has to be 26 * 4 = 104 bytes long. If you count the bytes in the string above, you will come to 104 couples . As such, we can cut the above string up across the Tiers. We then get:

Tier 1 = 0F 00 00 00 1B 00 00 00 2B 00 00 00 00 00 00 00 2A 00 00 00 36 00 00 00
Tier 2 = 18 00 00 00 11 00 00 00 04 00 00 00 3E 00 00 00 2C 00 00 00 00 00 00 00
Tier 3 = 15 00 00 00 22 00 00 00 27 00 00 00 14 00 00 00 03 FB 0B 03 00 00 00 00
Tier 4 = 16 00 00 00 26 00 00 00 07 00 00 00 0F 00 00 00 8A 09 25 0A 00 00 00 00
Tier 5 = 45 00 00 00 43 00 00 00

All spells in Tier 1 are valid. Translating the HEX values to spell ID's and then to spells, we have the following spells (shown in that order in the Mage Guild, too):
Tier 1 = Magic Arrow, Shield, Blood Lust, Summon Boat, Curse, Slow.
Note that if this town is not a Tower with a Library, the Slow spell will never show in the Mage Guild, as Tier 1 for those towns only contains 5 spells, not 6. For a Tower with a Library, the Slow spell will show as the final of the 6 spells at Tier 1.

We can do the same for Tier 2:
Tier 2 = Death Ripple, Lightning Bolt, Disguise, Blind, Precision and ... Summon Boat??
Note that the presence of Death Ripple means this is a Mage Guild from a Necropolis. Precision, while selected as a valid Tier 2 spell, would only show up if the town was a Tower with a Library; it won't show up for a Necropolis, since Tier 2 for Necropolis only contains 4 spells, not 5. The 6th slot, the weird Summon Boat entry, doesn't show up for any town and is therefore, by definition, just a garbage entry. In this case, the garbage is apparently 00 00 00 00.

For Tier 3 we get more garbage:
Tier 3 = Fireball, Anti-Magic, Animate Dead, Frost Ring and ... 03 FB 0B 03 00 00 00 00. We just identified the 00 00 00 00 entry as pointing to Summon Boat, but the entry preceding it is not a spell at all. It's real garbage, 03 FB 0B 03 doesn't mean anything for a spell. Since Tier 3 guilds only contain 3 spells, Frost Ring doesn't show up for any town other than a Tower with a Library. The two slots after it are unused and therefore it doesn't matter what's there. In other words, garbage.

Tier 4 = Inferno, Resurrection, Water Walk and ... Magic Arrow (which isn't Tier 4), 8A 09 25 0A (not a spell reference to begin with) and Summon Boat (also not a Tier 4 spell). Like before, the final three entries here will not show up in any town, simply because no Mage Guild contains more than 3 spells at this tier. The final 3 entries here are therefore all garbage entries.

Tier 5 = Air Elemental, Earth Elemental. For Necropolis, only the Air Elemental shows up. Only for a Tower with a Library does the Earth Elemental also show up.

Now had this been a Castle, which only reaches Tier 4 as maximum, the Tier 5 entry would have looked liked this:
Tier 5 = FF FF FF FF FF FF FF FF, instead of the 45 00 00 00 43 00 00 00 shown in the example above. These entries are therefore void, empty, unused.

As a side note, I have no clue why they chose to do it like this. They could have just counted the maximum number of spells for a given Tier, instead of keeping 6 entries up to Tier 4. Furthermore, since the garbage slots aren't used anyway, they could have been filled up with FF FF FF FF for each of those unused slots as well, instead of keeping the garbage bytes. I guess the reasons why are lost to time, though; we'll likely never know.

What I am trying to say, though, is that the game (randomly) selects spells for each Mage Guild Tier in a given town as if it were a Tower with a Library. The extra spell provided by the Library simply isn't shown for towns that can't build a Library. But it's still there, selected and all.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
phoenix4ever
phoenix4ever


Legendary Hero
Heroes is love, Heroes is life
posted July 13, 2016 09:09 PM

Wow that was some explanation Maurice, if I could award you a little red star I would.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Ebonheart
Ebonheart


Famous Hero
Rush the rush
posted July 13, 2016 09:11 PM

orc said:
wait, what do you mean by garbage slot and void? you mean that slots which we cants see? or that it is actually nothing there?

He means that spells are added as if EVERY town had the Tower's Library building active. This means spells are added but since no other town than Tower got the Library building, those spells cannot be gained/seen and are thus lost (which is what he means by void or garbage slot).

This means that you might have a high % chance to get say Berserking, but thanks to this concept, berserking is 1 of the 3 spells, but only 2/3 spells are actually shown and can be used/learned.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted July 14, 2016 01:24 AM
Edited by Maurice at 01:26, 14 Jul 2016.

Ebonheart said:
He means that spells are added as if EVERY town had the Tower's Library building active. This means spells are added but since no other town than Tower got the Library building, those spells cannot be gained/seen and are thus lost (which is what he means by void or garbage slot).

This means that you might have a high % chance to get say Berserking, but thanks to this concept, berserking is 1 of the 3 spells, but only 2/3 spells are actually shown and can be used/learned.


It's a slight bit worse than that . Take a look at my previous post. I detailed a Mage Guild as it appeared in one of my games.

Tier 1 = 0F 00 00 00 1B 00 00 00 2B 00 00 00 00 00 00 00 2A 00 00 00 36 00 00 00
Tier 2 = 18 00 00 00 11 00 00 00 04 00 00 00 3E 00 00 00 2C 00 00 00 00 00 00 00
Tier 3 = 15 00 00 00 22 00 00 00 27 00 00 00 14 00 00 00 03 FB 0B 03 00 00 00 00
Tier 4 = 16 00 00 00 26 00 00 00 07 00 00 00 0F 00 00 00 8A 09 25 0A 00 00 00 00
Tier 5 = 45 00 00 00 43 00 00 00

Here, the bold ones are only available to a Tower with a Library built. The underlined ones are out of reach for any Town - and hence, it doesn't matter whatsoever is put there. It's garbage. It was for a Necropolis Mage Guild, however, so defining the spells that can only be reached through a Library seems ... redundant. Still, they're there, so the game did actually determine which spells to put in those slots, even if they will never be shown in the Mage Guild until you build a Library.

Now, taking the above but then assuming it's a Castle Mage Guild. Then it would look as such (yeah, ignore the fact that it has Animate Dead and Death Ripple in the spell list, it's just to illustrate what the byte string would look like):

Tier 1 = 0F 00 00 00 1B 00 00 00 2B 00 00 00 00 00 00 00 2A 00 00 00 36 00 00 00
Tier 2 = 18 00 00 00 11 00 00 00 04 00 00 00 3E 00 00 00 2C 00 00 00 00 00 00 00
Tier 3 = 15 00 00 00 22 00 00 00 27 00 00 00 14 00 00 00 03 FB 0B 03 00 00 00 00
Tier 4 = 16 00 00 00 26 00 00 00 07 00 00 00 0F 00 00 00 8A 09 25 0A 00 00 00 00
Tier 5 = FF FF FF FF FF FF FF FF

And for Stronghold and Fortress, it's even worse:

Tier 1 = 0F 00 00 00 1B 00 00 00 2B 00 00 00 00 00 00 00 2A 00 00 00 36 00 00 00
Tier 2 = 18 00 00 00 11 00 00 00 04 00 00 00 3E 00 00 00 2C 00 00 00 00 00 00 00
Tier 3 = 15 00 00 00 22 00 00 00 27 00 00 00 14 00 00 00 03 FB 0B 03 00 00 00 00
Tier 4 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
Tier 5 = FF FF FF FF FF FF FF FF

The FF represents 255, which is usually the value used to indicate it's an unused field.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted July 14, 2016 08:30 AM
Edited by AlexSpl at 08:35, 14 Jul 2016.

Quote:
This means that you might have a high % chance to get say Berserking, but thanks to this concept, berserking is 1 of the 3 spells, but only 2/3 spells are actually shown and can be used/learned.

The probability of having a spell in a town's mage guild is the sum of probabilities of having the spell in every visible slot of the guild. So those "garbage slots" don't actually affect chances in any way.

See how spells make their hard and long way to a guild in Heroes II (Google Translate recommended)

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Ebonheart
Ebonheart


Famous Hero
Rush the rush
posted July 14, 2016 08:43 AM
Edited by Ebonheart at 08:44, 14 Jul 2016.

Yes you are right Alex, but this becomes a matter of the mathematical "Should I change the door?" probability question. It comes down to if you believe in mathematical numbers or mathematical reality.

This ofc, only applies as long as we do not include ingame choices to have effect on things.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
forgottenpw
forgottenpw


Hired Hero
posted July 17, 2016 06:33 PM
Edited by forgottenpw at 18:34, 17 Jul 2016.

its pretty easy to determine if ingamechoices have any effect

just build the mageguild with save/reload a few times

(but maybe retarst game altogether)

i bet the spells are set if you create the game

there would then be a possibility to guess which lvl 5 spell will appear, if you have info about the first levels, like the skills of a hero which are very deterministic
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted July 17, 2016 11:04 PM

They are set from the beginning, ForgottenPW. The savegame data holds all the information on which spells are at which tier regardless of how far the respective Mage Guilds have been built up, so they're set in stone once the game starts. In return, that means that you can learn which spells the game selected for all Towns on the map by inspecting the save game you make right after the start of the game .

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
forgottenpw
forgottenpw


Hired Hero
posted July 18, 2016 01:48 AM

yes, but can you calculate the possible spells like you can if you know the first level ups of a hero? (without looking directly into the data of the save or plain building the gild)
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
natalka
natalka


Supreme Hero
Bad-mannered
posted July 18, 2016 08:20 AM

can you explain about levelups more thoroughly?

If Hack gets basic artillery / exp offence you know what will be the next two offered?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
forgottenpw
forgottenpw


Hired Hero
posted July 18, 2016 11:09 AM

it has something to do with the first offered skills and statboosts

i read that lvl 5 is sufficient (maybe lower) to know the exact offers of skills with all branches
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted July 18, 2016 11:44 AM

You mean to predict the outcome of the Random Number Generator, based on the spells at Tier 1? I don't know if that can be done, I don't know how their RNG works or how they populate the Mage Guilds.
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
natalka
natalka


Supreme Hero
Bad-mannered
posted July 18, 2016 02:29 PM

forgottenpw said:
it has something to do with the first offered skills and statboosts

i read that lvl 5 is sufficient (maybe lower) to know the exact offers of skills with all branches


where did you read that?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
forgottenpw
forgottenpw


Hired Hero
posted July 18, 2016 07:05 PM

a thread here dealing with "how to get guaranteed air/earth/log/ect"
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted July 19, 2016 04:26 AM
Edited by AlexSpl at 04:27, 19 Jul 2016.

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).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted July 19, 2016 01:41 PM

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).


I don't think that's what ForgottenPW meant. If I get him right, he wants to know if it's possible to predict for instance which Tier 5 spells are present in the Mage Guild, if you know the spells at Tier 1.
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted July 19, 2016 01:55 PM
Edited by AlexSpl at 14:13, 19 Jul 2016.

It's possible to reveal all spells in all towns, provided you know the initial seed.

Without knowing the initial seed you can only narrow down possible sets of spells in other towns.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Orc
Orc


Famous Hero
posted July 22, 2016 12:49 AM

What about the probabilty of certaian spell for certain slot? Everybody ignored that part of my post XD
____________
New Comer!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted July 22, 2016 01:03 AM

Ecoris said:
Basically: Try every ordered combination of spells at the current level  for each town type and calculate its probability. Then for each spell add the probabilities of all combinations that include the given spell.

E.g at level 1: (View Air, Magic Arrow, Slow, Dispel, Cure) is not the same as (Magic Arrow, View Air, Slow, Cure, Dispel). The probabilities are not the same but both of them contribute to the total probabilty of each of the 5 mentioned spells.
Example: Magic Arrow has a 30% chance to show up as the first spell. Then we have to select the second one. But since we can't pick Magic Arrow the other spells probabilities increase. The probbility of View Air is now  3% / (1 - 0.30) = 4.29 %. Suppose View Air is selected. The probability that Slow is selected next is then (depending on town type) 10% / (1 - 0.30 - 0.03) = 14.92% or 5% / (1 - 0.30 - 0.03) = 7,46% since neither Magic Arrow nor View Air can be chosen now. And so on.

Notice that Magic Arrow is less probable to show up in dungeon towns even though the basic probability is the same for all town types (30%). This is because Dungoen is the only town type that may receive any first level spell.
But let me known if you want the code.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Orc
Orc


Famous Hero
posted July 22, 2016 03:19 AM

I know about the combination probability. The information i need is the basic probabilty for each slot which we use to find the combination.

These basic prob. Differs between towns (but all have same for magic arrow = 30)

It is like prob.of secondary skill learning

Im talking about the same thing explained in first page.
____________
New Comer!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0687 seconds