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 > Heroes 5 - Modders Workshop > Thread: Creating a more challenging AI
Thread: Creating a more challenging AI
ZombieLord
ZombieLord


Promising
Famous Hero
that wants your brainz...
posted February 23, 2007 05:46 PM

Creating a more challenging AI

This thread explains how to make the AI stronger by making it cheat even more giving more starting money and extra growth for the AI.

Perhaps you think: "why did I not create a MOD for this?". Well, there are many versions of Heroes V and this MOD requires to modify a base stat file, which differs from version to version. If you follow me step by step, you'll create this mod yourself!

Let's start:
- Go to the directory where you installed Heroes V.

- Open 'data' folder.

- Use WinRar or WinZip to open your latest patch .pak file. There should be a pak called pX-data.pak (X is a number here). Open the one with the greatest number. If you do not find any of these pX-data.pak files, then open data.pak.

- Enter the GameMechanics folder and then RPGStats.

- You should find a file called DefaultStats.xdb here. If it doesn't exist (or one of the folders above), then it means this latest patch does not include this file so check the previous patch pak (the pX-data.pak with the greatest X, excluding the paks you already tried), and repeat the step above; also, if there doesn't exist any other pX-data.pak, open data.pak.

- Extract the DefaultStats.xdb file to Heroes V directory/data/GameMechanics/RPGStats (create these folders if they don't exist).

- Open the extracted file with a Text Editor like NotePad.

- This file contains information about various Game Mechanics. First we want to give the AI more starting resources. Find the <StartComputerResources> section. The first Item section is for Easy, the second for Normal, the third for Hard and the last one for Heroic. I think you can figure out yourself how to modify the AI's starting resources now. Here is the section of my MOD: (you can use other values, of course )
Quote:

<Item>
 <Wood>15</Wood>
 <Ore>15</Ore>
 <Mercury>8</Mercury>
 <Crystal>8</Crystal>
 <Sulfur>8</Sulfur>
 <Gem>8</Gem>
 <Gold>30000</Gold>
</Item>
<Item>
 <Wood>25</Wood>
 <Ore>25</Ore>
 <Mercury>12</Mercury>
 <Crystal>12</Crystal>
 <Sulfur>12</Sulfur>
 <Gem>12</Gem>
 <Gold>50000</Gold>
</Item>
<Item>
 <Wood>30</Wood>
 <Ore>30</Ore>
 <Mercury>15</Mercury>
 <Crystal>15</Crystal>
 <Sulfur>15</Sulfur>
 <Gem>15</Gem>
 <Gold>60000</Gold>
</Item>
<Item>
 <Wood>50</Wood>
 <Ore>50</Ore>
 <Mercury>25</Mercury>
 <Crystal>25</Crystal>
 <Sulfur>25</Sulfur>
 <Gem>25</Gem>
 <Gold>75000</Gold>
</Item>



- Now find the <AI> section, then the <Adventure> sub-section. Now, go to the <DifficultyHard> sub-sub-section and find <TownCreatureGrowthCoef>. Set the value to 1.5 to have the Hard AI have 50% more growth (you can set it to other values if you like). Now, for <DifficultyHeroic>, set the <TownCreatureGrowthCoef> to 2 to give the Heroic AI double growth.

With these modifications, the Hard AI is challenging (sometimes it's still easy), but the Heroic AI sure becomes difficult. Of course, only fanatic Heroes V gamers like me would play this changed Heroic and enjoy it

Hope you'll enjoy a more challenging AI now. You can tweak the values if it's too weak/hard for you.


Now, to create a MOD from this:
- Use WinRar or WinZip to create a new .zip file. Add a new folder to this Zip called GameMechanics. Now, open this folder and create another one named RPGStats. Open this one too and add the modified DefaultStats.xdb here. Save this Zip file in your Heroes V directory/data folder (the name doesn't matter, just make sure the extension is .pak and not .zip!).

- And you're done. You can even delete the modified DefaultStats.xdb file along with the created folders (those that are OUTSIDE the pak file, of course) as the game engine will read from the pak file you just created.

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

Tavern Dweller
posted January 16, 2022 09:43 PM
Edited by Loran at 21:45, 16 Jan 2022.

ZombieLord said:
This thread explains how to make the AI stronger by making it cheat even more giving more starting money and extra growth for the AI.

Perhaps you think: "why did I not create a MOD for this?". Well, there are many versions of Heroes V and this MOD requires to modify a base stat file, which differs from version to version. If you follow me step by step, you'll create this mod yourself!

Let's start:
- Go to the directory where you installed Heroes V.

- Open 'data' folder.

- Use WinRar or WinZip to open your latest patch .pak file. There should be a pak called pX-data.pak (X is a number here). Open the one with the greatest number. If you do not find any of these pX-data.pak files, then open data.pak.

- Enter the GameMechanics folder and then RPGStats.

- You should find a file called DefaultStats.xdb here. If it doesn't exist (or one of the folders above), then it means this latest patch does not include this file so check the previous patch pak (the pX-data.pak with the greatest X, excluding the paks you already tried), and repeat the step above; also, if there doesn't exist any other pX-data.pak, open data.pak.

- Extract the DefaultStats.xdb file to Heroes V directory/data/GameMechanics/RPGStats (create these folders if they don't exist).

- Open the extracted file with a Text Editor like NotePad.

- This file contains information about various Game Mechanics. First we want to give the AI more starting resources. Find the <StartComputerResources> section. The first Item section is for Easy, the second for Normal, the third for Hard and the last one for Heroic. I think you can figure out yourself how to modify the AI's starting resources now. Here is the section of my MOD: (you can use other values, of course )
Quote:

<Item>
 <Wood>15</Wood>
 <Ore>15</Ore>
 <Mercury>8</Mercury>
 <Crystal>8</Crystal>
 <Sulfur>8</Sulfur>
 <Gem>8</Gem>
 <Gold>30000</Gold>
</Item>
<Item>
 <Wood>25</Wood>
 <Ore>25</Ore>
 <Mercury>12</Mercury>
 <Crystal>12</Crystal>
 <Sulfur>12</Sulfur>
 <Gem>12</Gem>
 <Gold>50000</Gold>
</Item>
<Item>
 <Wood>30</Wood>
 <Ore>30</Ore>
 <Mercury>15</Mercury>
 <Crystal>15</Crystal>
 <Sulfur>15</Sulfur>
 <Gem>15</Gem>
 <Gold>60000</Gold>
</Item>
<Item>
 <Wood>50</Wood>
 <Ore>50</Ore>
 <Mercury>25</Mercury>
 <Crystal>25</Crystal>
 <Sulfur>25</Sulfur>
 <Gem>25</Gem>
 <Gold>75000</Gold>
</Item>



- Now find the <AI> section, then the <Adventure> sub-section. Now, go to the <DifficultyHard> sub-sub-section and find <TownCreatureGrowthCoef>. Set the value to 1.5 to have the Hard AI have 50% more growth (you can set it to other values if you like). Now, for <DifficultyHeroic>, set the <TownCreatureGrowthCoef> to 2 to give the Heroic AI double growth.

With these modifications, the Hard AI is challenging (sometimes it's still easy), but the Heroic AI sure becomes difficult. Of course, only fanatic Heroes V gamers like me would play this changed Heroic and enjoy it

Hope you'll enjoy a more challenging AI now. You can tweak the values if it's too weak/hard for you.


Now, to create a MOD from this:
- Use WinRar or WinZip to create a new .zip file. Add a new folder to this Zip called GameMechanics. Now, open this folder and create another one named RPGStats. Open this one too and add the modified DefaultStats.xdb here. Save this Zip file in your Heroes V directory/data folder (the name doesn't matter, just make sure the extension is .pak and not .zip!).

- And you're done. You can even delete the modified DefaultStats.xdb file along with the created folders (those that are OUTSIDE the pak file, of course) as the game engine will read from the pak file you just created.


I know this is an old post but I came by this post and was very interested in it since I love H5 but the ai is way to easy for me.

I did everthing you said and it worked without any bugs. I played a map (rise to power I think it is called, its a vanilla h5 map) and I noticed the increase in the AI creature growth (I choose the double one) but the problem is that the AI flees, even if I am only just 1% stronger than the ai, we are almost the same and it flees! the game became easy again for me and sadly it was still was not a challange.

The problem now that I see with h5 AI is not the creature growth (though that was a problem too) its that the AI flees to much, when he could do a ton of damage to you or even defeat you!

is there any way to change that? make the AI not flee when he clearly can do a bunch of damage to you or as I said, even defeat you.

is there also any way to make the AI less aggressive to other AI and more aggressive towards the human player since I noticed that is a problem too. In the first two weeks the AI can start fighting each other and like 4 AI have been defeated within two weaks of the month while they completely ignore the human player. It would be more fun if the ai was more aggressive and kept attacking the human player rather than fight each other until you then defeat them all since they drained their creatures fighting eachother, the human player just comes along and kills off the remaining now weaker AI.

I see there is an option called <AttackHumanAggressivityCoef>, is this the option to make the ai attack you more and the other AIs less? and if thats true, what valure should it be to make it very difficult. Right now it has value 1

The other one is called <CowardiceVersusHuman>, is this the option to make the ai flee less from humans in battle? if that is true, what value should it be to make the ai more aggressive towards you and be less aggressive against other computer players. The current value of this option is 0.3

Anyway, I hope I explained the issue of the ai well and what I am hoping to achieve through modding the ai.

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


Admirable
Legendary Hero
modding wizard
posted January 17, 2022 02:48 PM

There is not much you will achieve in this section, its not about combat AI, if you want all AI to team up against you in H5 vanilla you can ally them in the map editor, but use the map properties list instead of the regular settings since that pane is bugged.

In h55 I added a variable in the setting-pak that does it automated for advanced players. I'm currently trying to have the option more easily available in the custom game menu, maybe in next version, maybe not.
____________
MMH5.5 Downloads | MMH5.5 Translations | MMH5.5 FAQ

 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.0553 seconds