|
|
Phoenix4ever

 
     
Legendary Hero
Heroes is love, Heroes is life
|
posted March 07, 2026 04:42 PM |
|
|
I agree, I don't really like must-have skills either.
Currently I feel pretty much forced to pick Offense, Armorer, Wisdom, Earth Magic, Logistics, Pathfinding and Air/Fire/Water Magic for the main hero. (Pathfinding is a must-have in HotA.)
That leaves very few skills up for actual choice, which is a bit sad.
With DD more than 1 cast per day and in Air Magic, Air Magic is also a must-have. That's why I made it only 1 cast per day and in Fire Magic, since Air had both DD and Fly and Fire had no adventure spells.
Yeah I definitely believe AI considers mana cost when casting spells. It will mostly cast Slow, Blind or a damage spell in my experience.
In HotA it will also cast Berserk sometimes, which is scary.
If you look in sptraits.txt you can see how high AI Value AI has for each spell. There are a few spells it will never or almost never cast as well.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 04:58 PM |
|
|
|
Yes, I definitely need to look into those. I have enabled Berserk following BTB's instructions, havent met it in battle yet, but I have also made it a 5th level spell. But isnt there also a bunch of spells the AI wont cast no matter the AI value? I believe this would apply to land mine, quicksand and forgetfulness as well as fire wall and force field but I would not expect the AI to cast these last two with any kind of sense.. I am still looking for a way to enable the first three though.
|
|
Phoenix4ever

 
     
Legendary Hero
Heroes is love, Heroes is life
|
posted March 07, 2026 05:03 PM |
|
|
It can't cast Fire Wall, Quicksand, Remove Obstacle, Force Field, Land Mine. (and Berserk)
It can cast Forgetfulness, but if I remember correctly the AI Value is very low.
I would like it to cast those spells as well. You need to tell me if you find out how. 
It also can't cast View Air, View Earth, Disguise, Scuttle Boat and Visions.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 05:10 PM |
|
Edited by BigPig2 at 17:11, 07 Mar 2026.
|
Phoenix4ever said: I would like it to cast those spells as well. You need to tell me if you find out how. 
I will make sure to report. I am wondering if it could be something with the targetting flags, similar to the issue with Berserk.
Quote: It also can't cast View Air, View Earth, Disguise, Scuttle Boat and Visions.
And it probably dont need to.. although disguise could be funny if it wasnt for the fact that I believe it wears off right before the human player starts their turn?
|
|
Phoenix4ever

 
     
Legendary Hero
Heroes is love, Heroes is life
|
posted March 07, 2026 05:30 PM |
|
|
Yeah it already has some knowledge humans don't, like knowing what is inside Pandoras Boxes or magically charging directly to your Necropolis with Cover of Darkness, when they have never seen it before and are without a town. 
I hate Disguise, it does absolutely nothing VS Expert or Impossible AI. I suppose you could use it versus human players, but that would just be unfair.
Most useless spell in the game.
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 06:45 PM |
|
Edited by AlexSpl at 18:49, 07 Mar 2026.
|
According to the following -
team = this->team;
v2 = gpGame;
v3 = 0;
team *= 45;
v59 = 0;
candidate = 0;
v4 = (playerData *)((char *)gpGame->player + 8 * team);
v51 = v4;
v5 = *(&gpGame->player[0].numHeroes + 8 * team);
if ( v5 >= 8 )
return 0;
if ( v4->resources[6] < gHeroGoldCost )
return 0;
if ( v5 >= hero_limits[gpGame->sSetup.difficulty] )
return 0;
v7 = 0;
v8 = 0;
do
{
if ( !v2->playerDead[v8] )
{
IsHuman = game::IsHuman(v2, v8);
v2 = gpGame;
if ( !IsHuman )
v7 += gpGame->player[v3].numHeroes;
}
++v3;
++v8;
}
while ( v3 < 8 );
if ( v51->numHeroes > 0 && v7 >= global_limits[v2->sSetup.difficulty] )
return 0;
there are two limits - per an AI player (or an AI team?), which are 2, 3, 4, 5, 6, depending on difficulty, and the global one, which are 8, 11, 14, 17, 20. And, as you can see, v7 skips all human players.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 06:49 PM |
|
Edited by BigPig2 at 18:55, 07 Mar 2026.
|
That is very interesting, do you know the location of this code? How come AI players hire so few heroes then? Because they do, theres always a couple with many heroes and a bunch with very few.
Edit:
if ( !IsHuman )
v7 += gpGame->player[v3].numHeroes;
Hold on, so this means "if NOT player is not human then add his number of heroes to v7" is that the C syntax quirk u mentioned before?
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 06:56 PM |
|
Edited by AlexSpl at 18:59, 07 Mar 2026.
|
I don't know. Probably give them more towns? At least, it's how it works for Heroes 1 and 2.
Quote: Hold on, so this means "if NOT player is not human then add his number of heroes to v7" is that the C syntax quirk u mentioned before?
IsHuman means a player is a human, !IsHuman means a player is not a human. So human players are skipped, if the code is correct.
Still, I think it has to be checked, as there is an option Human or AI for a player.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 07:04 PM |
|
|
AlexSpl said: IsHuman means a player is a human, !IsHuman means a player is not a human. So human players are skipped, if the code is correct.
So the instruction runs if the condition is false?
Quote: Still, I think it has to be checked, as there is an option Human or AI for a player.
Oh so players set to "human or AI" could roll as human and then not count towards the limit? But that would potentially result with more heroes than expected, and I have never observed that.
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 07:13 PM |
|
Edited by AlexSpl at 19:15, 07 Mar 2026.
|
I think IsHuman should mean a real human player though. The best way to check is to create a map for two players (with one being human) and give an AI opponent plenty of gold and 47 towns. OK, it's just to be sure.
For the tests against the second limits, you'll need 7 AI opponents with 47 towns (1 is yours).
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 07:41 PM |
|
Edited by BigPig2 at 19:59, 07 Mar 2026.
|
So, wait.
if ( !IsHuman )
v7 += gpGame->player[v3].numHeroes;
Doesnt this mean:
IF player is not human
THEN increase the total hero count by the number of their heroes
Will this not mean it is only AI heroes that get counted towards the hero limit?
Actually, this should be easy to test. I can start a game with 7 opponents on easy (9 heroes total cap) and hire 8 heroes. Now there is 7 AI heroes and 8 human heroes on the map.
If the cap is "own heroes + human heroes" the AI does not hire any more heroes then none of my opponents should hire any extra heroes as mine 8 + their 1 already adds up to 9.
If it is AI heroes that count up to two of them will be allowed to hire 1 extra hero. Does that sound correct?
Edit:
I mean, yeah.
https://ibb.co/Txh9FLcz
https://ibb.co/6ccSMq50
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 07:56 PM |
|
Edited by AlexSpl at 19:59, 07 Mar 2026.
|
|
I tested 1 red town with 8 heroes vs 47 blue towns. At 211 the blue has 3 heroes. I can only suppose that the third was bought when one of the remaining heroes stayed in a castle, as FizMiG suggests. If so, then 2 heroes for the Easy difficulty is a 'soft' limit.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 07:58 PM |
|
|
Or it could have come from a prison etc. But doesnt this (and the code!) appear to mean the cap for total number of heroes is AI heroes not human heroes?
I kept going for some more weeks and a third one got an extra hero and another one but after few more weeks it all tends toward 9 AI heroes again.
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 08:00 PM |
|
Edited by AlexSpl at 20:04, 07 Mar 2026.
|
No, just 1 town vs 47 towns without other obstacles.
Quote: Will this not mean it is only AI heroes that get counted towards the hero limit?
I think yes, and we need an example.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 08:03 PM |
|
|
|
Right, but if it was human player heros that counted your opponent shouldnt even go for a 2nd hero, correct? Cause with your 8 and their starting 1 that is already 9.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 08:09 PM |
|
Edited by BigPig2 at 20:11, 07 Mar 2026.
|
AlexSpl said: I think yes, and we need an example.
In my game I hired 8 heroes and waited for my 7 AI opponents to recruit. 2 of them did so on the first turn. Some weeks into the game one more got 2 then another one, then they started fighting eachother and in time the total number of AI heroes went back down to 9 and only increased occasionally, only to fall back to 9 after awhile.
Edit: But I mean, also.. the code? Doesnt it clearly skip human players when counting the total?
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 08:14 PM |
|
Edited by AlexSpl at 20:15, 07 Mar 2026.
|
|
I bought 8 heroes at the first day. The opponent had 2 heroes very early with one hero marching toward my castle, so it's already 10. And the second one was bought when the first one wasn't in a castle.
|
|
BigPig2

 

Hired Hero
|
posted March 07, 2026 08:18 PM |
|
|
Does this mean.. I found an error in the fizmig? And in the wiki, technically.
Wow. How many people can say that??
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 08:24 PM |
|
|
|
I suppose so. I just checked another time, and the second hero was bought while the first one wasn't in a castle. So, 8 + 2 > 9. And human heroes weren't counted.
|
|
AlexSpl

   
    
Responsible
Supreme Hero
|
posted March 07, 2026 08:33 PM |
|
Edited by AlexSpl at 20:44, 07 Mar 2026.
|
But!
Quote: 2. Most tests indicate that the general limitation only includes heroes owned by human players, as well as the AI player's own heroes. Furthermore, in addition to the starting hero, the AI player always has the option to recruit one hero, ignoring the limitation. Clarification required.
So, we've just clarified 
For me, the code above just reads that human heroes don't count. So, we need a convincing example.
And logically... If we have two human players with 16 heroes, AI players, even if there are 6 of them, cannot have a heroes? 
Probably, it's mistranslation -
Quote: 1. Depending on the difficulty level, there are limits on the total number of heroes on the adventure map.
After reaching these limits, the AI player will not recruit new ones:
total number of heroes (for every single AI player?).
But the code reads that this is true for all AI players together.
|
| |
|
|