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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Library of Enlightenment > Thread: chance of hero appearing on tavern?
Thread: chance of hero appearing on tavern?
orc
orc


Known Hero
posted July 12, 2015 10:24 AM

chance of hero appearing on tavern?

Hello guys,

I think I have read somewhere that chances of each hero appearing in tavern differs. is there somewhere we can find list or something? I want to know how likely those strong heroes appear on tavern (tazar, hack, gunnar, $$ specialists, etc)

I know it should be in some file that I can open with some program, but im too lazy to get that program (want something like the lazy wiki lol)

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


Promising
Legendary Hero
fallen artist
posted July 12, 2015 11:10 AM

Chance for hero spawning in tavern depends on town type and hero class. Exact values are defined in HCTRAITS.txt.
____________
The future of Heroes 3 is here!

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


Known Hero
posted July 12, 2015 12:42 PM

Also, you can't normally have 2 heroes of the same type in tavern. Exception is when you retreat hero or there are no more heroes of other types.

So you have Shakti in slot 1, buy hero from slot 2. You can't get an overlord there, unless there are only overlords left to get on this map.

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


Known Hero
posted October 21, 2016 08:16 AM

Can anyone elaborate on this? I would also very much like to know what are the odds of getting mephala, tazard, grag hack, neela, rayland, gundula etc with specific towns.


Or how do I read it out from HCTRAITS.txt. ?

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


Legendary Hero
posted October 21, 2016 08:57 AM

batoonike said:
Can anyone elaborate on this?
Btw, can someone specify what was made different in Hota? I say this cause in the manual it says you will never find two heroes of the same class (unless...) and I'm pretty sure I already started random maps with two captians in tavern.

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


Promising
Supreme Hero
النور
posted October 21, 2016 11:44 AM

Kicferk said:
Also, you can't normally have 2 heroes of the same type in tavern. Exception is when you retreat hero or there are no more heroes of other types.

So you have Shakti in slot 1, buy hero from slot 2. You can't get an overlord there, unless there are only overlords left to get on this map.


Actually, you can. I happened to start a game with a town, and when I entered the tavern to recruit my second hero on day 1 week 1 month 1, find two of the same town I started with, making hiring both. And without having list my first.

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


Legendary Hero
posted October 21, 2016 02:58 PM

AlHazin said:
Actually, you can. I happened to start a game with a town, and when I entered the tavern to recruit my second hero on day 1 week 1 month 1, find two of the same town I started with, making hiring both. And without having list my first.
Nope, in regular Heroes III you can have two heroes of the same race but not of the same class (i.e. you can have a barbarian and a battle mage but not two barbarians).

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

Hero of Order
Part of the furniture
posted October 21, 2016 08:02 PM
Edited by Maurice at 20:16, 21 Oct 2016.

I've checked the game's code that handles the Hero generation in Taverns and it does the following:

- It checks to see if any Hero may be hired at all by the player;
- If so, it checks to see if any Hero Types are excluded (based on meta-information, from included/excluded Heroes as well as Heroes already in play - note that this includes Heroes presented for hire in other players' taverns!);
- Then it checks to see the map type; for ROE maps, it proceeds to exclude the Conflux Heroes (and any that came with the AB expansion);
- If it is considering the second Tavern slot (the first one already determined), it will proceed to unflag the Hero Type from the first Tavern slot as viable (but only if there's at least another Type still available);
- It then performs a random(1, NumHeroTypes) where NumHeroTypes is the sum of the weights of available Types that may appear in the Tavern for that player (it uses the information stored in the HCTRAITS.TXT file for this);
- Once the Hero Type is determined, it performs a random(1, HeroesAvailable) for that Hero Type, where the HeroesAvailable is the number of Heroes that are available for hiring for that Hero Type;
- If this was the first Tavern slot that was determined, it loops through these steps again, this time for the second slot;

When a Hero is chosen, it calls the Hero build-up routine with respect to its army. If the Hero appears as a result of a retreat/defeat, the Hero gets exactly 1 unit of the first stack type specified in the Hero statistics table within the .exe file.

Indepth details:
The Hero table within the .exe file starts at address 0x279DD0h. Each Hero entry is 92 bytes in size, with the following meaning per 4 bytes (values of FF FF FF FF mean the entry isn't used; you can see it appear for the second Skill entry when the first Skill starts at Advanced, or for the starting Spell when no Spellbook is present):
1-4 = Gender
5-8 = Race
9-12 = Class
13-16 = First Skill
17-20 = Skill level of first Skill
21-24 = Second Skill
25-28 = Skill level of second Skill
29-32 = Whether a Spellbook is present on the Hero
33-36 = Starting Spell
37-40 = Creature ID of the first stack on the Hero
41-44 = Creature ID of the second stack on the Hero
45-48 = Creature ID of the thirds stack on the Hero
49-52 = Address reference to the small Hero portrait
53-56 = Address reference to the large Hero portrait
57 = Recruitable in ROE
58 = Recruitable in AB & SOD
59 = Campaign Hero
60-92 = Filled in dynamically during runtime, no initial values

Part of the values filled in during runtime are the minimum and maximum number of creatures for each creature type, that can appear on the Hero.

If the Hero didn't end up in the Tavern after a retreat/defeat, the game provides it with Creature stacks.
- The Hero gets random(minStack1, maxStack1) of the Creature type of the first stack to get the number of creatures for it;
- It then performs a random(1, 100) to see if a second stack is present, which is the case if this random number is 88 or lower (so, 88% chance on a second stack);
- The game checks to see if it's a Ballista or First Aid Tent and provides that type if so;
- Otherwise, it proceeds to perform a random(minStack1, maxStack1) of the Creature type of the second stack to get the number of creatures for it;
- Finally, it performs a random(1, 100) and checks to see if this is 25 or lower (so 25% chance) on a third stack;
- If so, it proceeds to perform a random(minStack1, maxStack1) of the Creature type of the third stack to get the number of creatures for it;

Then it finishes up and returns the result.

But when determining odds for a Hero to appear, keep in mind that the game excludes any and all Heroes that are:
- Forbidden by the map at large;
- Already controlled by another player;
- Already available as hiring offer in another players' tavern;
- Already under your control;
- Imprisoned in a prison somewhere on the map;
- Whatever I am forgetting that would take a Hero off the "available for hiring" list;
These effects affect the resulting chances for a specific Hero to appear in a Tavern. When assigning Heroes to Tavern slots, it loops through player numbers from 1 to 8 in that order.

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


Known Hero
posted October 21, 2016 08:49 PM
Edited by batoonike at 20:50, 21 Oct 2016.

Thanks!


Overall it seems the differences are neglectable

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


Promising
Supreme Hero
النور
posted October 22, 2016 11:59 AM

bloodsucker said:
AlHazin said:
Actually, you can. I happened to start a game with a town, and when I entered the tavern to recruit my second hero on day 1 week 1 month 1, find two of the same town I started with, making hiring both. And without having list my first.
Nope, in regular Heroes III you can have two heroes of the same race but not of the same class (i.e. you can have a barbarian and a battle mage but not two barbarians).


Yep it is, mate. I began with a knight (Edric), and found two knights to be recruited in the tavern (Sorcha and Lord Haart). It was on the v 1.00 by the way. It happened more than once too.

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

Hero of Order
Part of the furniture
posted October 22, 2016 05:36 PM

AlHazin said:
Yep it is, mate. I began with a knight (Edric), and found two knights to be recruited in the tavern (Sorcha and Lord Haart). It was on the v 1.00 by the way. It happened more than once too.


I suspect they fixed that in later versions, then, because the code as it exists for SoD doesn't support your claim. It explicitely ticks off the Hero Type it has selected in the first slot, unless there aren't any other Hero Types from which it can find a Hero for hiring.

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


Promising
Supreme Hero
النور
posted October 22, 2016 05:57 PM

That must be that yes, cause in my version, the fleeing heroes had a full army when rehired. SoD changed a lot of features in H3.

Thanks for your hard work.

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


Known Hero
posted August 25, 2018 04:13 PM

Every hero groups have aggression numbers in hctraits. What are these?
____________

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


Known Hero
posted May 03, 2019 05:13 PM
Edited by heymlich at 17:22, 03 May 2019.

Maurice said:
If the Hero didn't end up in the Tavern after a retreat/defeat, the game provides it with Creature stacks.


In my version (H3 complete) this is not the case. Any hero comes with 1 lvl1 unit, regardless of retreats, except for the heroes that appear on day1 of each week.

This always annoyed me, I liked running around with these mixed low level armies in week 1, as it was in RoE (without patch). Am I missing a patch or something?

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

Hero of Order
Part of the furniture
posted May 03, 2019 07:08 PM

It's been a while since I checked the subroutine in question, but yes, I can confirm that the only 2 Heroes that come with a full creature complement are the two that start in the Tavern at the first day of the week.
____________
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
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0510 seconds