Call to H-IV mapmakers - AI enchancing scripts

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.

Moderator: Moderators

User avatar
Duzeom_
Conscript
Conscript
Posts: 234
Joined: 07 Mar 2011

Postby Duzeom_ » May 18 2015, 14:34

Also give experience equal to normal number of enemies.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Postby Taro » May 18 2015, 16:21

We are talking about neutral armies. But what about towns, tresure banks and dwellings? And next thing - there is no increasing or decreasing function in editor (like multiply army x3). So Dalai, how are you going to do that?

I made a prototype of this script which gives AI 4000 units of current type and take it after victory. The effect is AI atacks neutrals when it feels it can win but has no loses in general. The exceptions are fast units (sprites, white tigers, vampires) because they die even if there are above 4000 of them at time of battle. On champion AI will not atack you with giant army and godly heroes like in my scenario, but it will have fair army and fair heroes pretty soon.

And about artifact rank table - any clue how to do it?

User avatar
Dalai
Equilibris Team
Equilibris Team
Posts: 1073
Joined: 06 Jan 2006
Contact:

Postby Dalai » May 18 2015, 17:03

Karmakeld
Thank you for your comprehensive input. You are very observant about Learning Stone's problems :)

Karmakeld wrote:Now Dalai, can you dig into the Learning Stone's script? For it already remembers if a hero has already visited it (even if original name is changed), if you can do this, then you should be able to use the same script infront of the learning stone to give additional 2000 xp pr. Leaning Stone. :creative: (brilliant - I know)

Now what's the next issue to solve ;)
I am not sure that inside the game code it operates objects with scripts similar to ones in map editor.

Having read your and wimfrits' replies, I tend to choose some more simple option.

wimfrits wrote:E.g. One of the things I did in A Wind of Thorns was adjust the size of every neutral stack based on the player's chosen difficulty. A menu inside the editor to modify general neutral stack size and input boxes or sliders per difficulty would have been a dream come true.

The same for AI gold and resources per day, bonus weekly creature growth, bonus starting creatures, starting town level, AI hero bonus stats, AI hero bonus level, etc.
Screenshot on the first page already allows some tuning of bonuses. What am I missing from your idea? Do you want to tune bonuses differently for each difficulty level? If so - wouldn't interface become overloaded? May be you just set bonus amount for Impossible, and other levels can be calculated as a percentage of it?

wimfrits wrote:I'd let go of the location constraint. If you want a baby to drink his milk, you don't use placed events around the milk bottle. Just put it at his mouth.
I think the tiles in front of a town are the best bet to catch a passing hero, so I'd suggest one general placed event for all AI hero modification scripts and place it before each town.
One of the modules in the script could be an experience increase that can only be triggered x times (1? 2?) per day by an AI hero and gives y experience to the weakest hero in the army, where y would be a value based on the mapmaker's input in that nifty user-interface in the editor :) Possibly a value that increases each week.
Sounds reasonable B-)

Duzeom_ wrote:So maybe taking army from neutral stacks is a better option? The same as adding but taking for example 20% of the neutral armies. Of course only in AI turn,
If such "pulse" (increasing neutral army during Human turns and decreasing during AI's) is possible with scripts - it's truly a great idea.

Duzeom_ wrote:Also give experience equal to normal number of enemies.
That too, of course.

That is why I asked for mapmakers help - only experienced mapmakers know what is possible and how to make it optimal. We all have much better PCs than 10 years ago, but we still don't want too much too heavy scripts to work each turn.

Taro wrote:We are talking about neutral armies. But what about towns, tresure banks and dwellings? And next thing - there is no increasing or decreasing function in editor (like multiply army x3). So Dalai, how are you going to do that?

I made a prototype of this script which gives AI 4000 units of current type and take it after victory. The effect is AI atacks neutrals when it feels it can win but has no loses in general. The exceptions are fast units (sprites, white tigers, vampires) because they die even if there are above 4000 of them at time of battle. On champion AI will not atack you with giant army and godly heroes like in my scenario, but it will have fair army and fair heroes pretty soon.

And about artifact rank table - any clue how to do it?
As I just said, that is why I ask for mapmakers input. If I knew everything - I would not need this topic :)

I imagine you can create a very long script checking how many creatures of each type you have and then adding twice as much to your army. It won't look pretty and will be impossible to check manually, but we are talking about automated tool. ;) This will work not so good for armies with many heroes, and will fail for all-heroes armies.

Or we can check the level of main hero and add same amount of Mantises to army for current battle. Will provide great support, but losses would still be possible. Could work worse for armies without empty slots though.

So far we have only ideas.

Towns have same script options as neutral armies, so this approach holds. Creature banks are a bit trickier. We can leave them be for now, or can try to invent something. That is what this topic is for, after all.
"Not a shred of evidence exists in favour of the idea that life is serious." Brendan Gill

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 1996
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Postby wimfrits » May 18 2015, 17:33

Dalai wrote:Screenshot on the first page already allows some tuning of bonuses. What am I missing from your idea? Do you want to tune bonuses differently for each difficulty level? If so - wouldn't interface become overloaded? May be you just set bonus amount for Impossible, and other levels can be calculated as a percentage of it?


The screenshot is from the perspective of the player that wants a suitable challenge. I'd want a 'balancing' menu in the editor that allows balancing by the mapmaker for different difficulty settings.

Case to illustrate: in every playtest I did so far I've commented "Armies on this map should be increased by an average of +xxx%". But that only goes for champion level. I can't comment on the novice level tester's experience.

So while a set on impossible and calculate from there would be a good step, I think it's better to individually set values for each level. As this would be a mapmaker's tool, graphics are less important.
Are you suggesting coconuts migrate?

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 577
Joined: 21 Jul 2014

Postby iLiVeInAbOx05 » May 18 2015, 18:14

Dalai wrote:As I just said, that is why I ask for mapmakers input. If I knew everything - I would not need this topic :)

I imagine you can create a very long script checking how many creatures of each type you have and then adding twice as much to your army. It won't look pretty and will be impossible to check manually, but we are talking about automated tool. ;) This will work not so good for armies with many heroes, and will fail for all-heroes armies.

Or we can check the level of main hero and add same amount of Mantises to army for current battle. Will provide great support, but losses would still be possible. Could work worse for armies without empty slots though.

So far we have only ideas.

Towns have same script options as neutral armies, so this approach holds. Creature banks are a bit trickier. We can leave them be for now, or can try to invent something. That is what this topic is for, after all.


Just a script to count the number of units.. unfortunately you would need one for each type. I used something similar to the following:

(Note: this works for scripts attached to heroes. I haven't yet looked into creature only armies, but from discussion on this forum it seems like it will be difficult to impossible using the following method)

Code: Select all

numElves = 0;
beforeElves = 0;

countElves
{
    if (numElves < number of elves in army)
    {
        ++numElves;
        countElves;
    }

    beforeElves = numElves; //Save for after the battle
}


Now you have the number of elves in the army. Script to increase:

Code: Select all

numElves = number of elves in the army;
doubleElves
{
    numElves += numElves;
    increaseElves; //Script below
}


or, for more flexibility:

Code: Select all

numTimes = 1; //Tunable variable at start of map
increaseTimes = 0;
numElves = number of elves in the army;
calculateElves
{
    if (increaseTimes < numTimes)
    {
        numElves += numElves;
        calculateElves;
    }

    increaseElves;
}

increaseElves
{
    if (number of elves in army < numElves)
    {
        add one elf;
        increaseElves;
    }
}


Then after the battle, you can decrease the same way:

Code: Select all

decreaseTimes = 0;
decreaseElves
{
    if (beforeElves < number of elves in army)
    {
        take away an elf;
        decreaseElves;
    }
}


The decrease script could be tweaked so that the number of units lots is taken into account so that the AI player does lose actual units, I just wanted to show a simple solution that is easy to replicate.

I haven't really played around with neutral armies, but is it possible to use triggered scripts on them? If so, the above could be reworked a little to decrease the troops of a neutral army on encounter with an AI player. Saving the number of each troop beforehand also enables calculating the correct amount of experience.

A little tedious to have to do this for each type of creature, but it works :D

I just threw the above scripts together, so I may have missed something to make them actually work properly, but you get the gist :D I also haven't tested these scripts on a large number of creatures, so the recursion might be a little slow. The algorithm could probably be tweaked as well. Maybe take 2 away and then add one if less than, or none if equal. Little things like that :D

User avatar
Duzeom_
Conscript
Conscript
Posts: 234
Joined: 07 Mar 2011

Postby Duzeom_ » May 18 2015, 20:32

To save number of Y creatures is simple because there is one command for it:

X = number of Y creatures

But you can give/take a fixed number of creatures.

So I propose to save number of creatures to give/take N as a binary number.

For example:

N = 29 elves.

N = 11101 B

So there are 5 commands to give elves:
1 command to give 16 elves
1 command to give 8 elves
1 command to give 4 elves
0 command to give 2 elves
1 command to give 1 elf.

It is so much better than 29 commands.

I used this in Megom Chronicles Memory Chrystal Campaign to pass numbers between maps using artifacts.

User avatar
jeff
Moderator
Moderator
Posts: 3709
Joined: 06 Jan 2006

Postby jeff » May 18 2015, 20:51

wimfrits wrote:
Duzeom_ wrote:So maybe taking army from neutral stacks is a better option? The same as adding but taking for example 20% of the neutral armies. Of course only in AI turn,


Yes! There's an idea!!
1. Temporary decrease neutral stack size by 20% during the AI's turn
2. In addition, take away 40% of a neutral stack size if it is attacked by an AI player. Return it in the event the AI player loses.

That way, you don't need scripting on AI armies. You boost exploration AND decrease losses by the AI player.


In my campaigns I have neutral stacks that do a random die roll on the first turn; that along with difficulty level chosen by the player determines the size and composition of the neutral stack; I have at least two variations for each faction. I have one set used in the first map and another set used in later maps. This is done to make them more challenging and reward the player with more XP. The problem is the AI heroes tend to be killed or wiped out by many of these stacks. I do have a conditional; if opponent is computer then remove; followed by a series of remove 999 creatures. I am careful to add 1 low level creature after I know a slot will be made available by the removal scripts (usually the 3 or 4 script in the sequence.) That way I know all of the tier 3 or 4 creatures will be removed. It works MOST of the time but not all; I really have not figured out why this fails on occasions.
Mala Ipsa Nova :bugsquash:

User avatar
Dalai
Equilibris Team
Equilibris Team
Posts: 1073
Joined: 06 Jan 2006
Contact:

Postby Dalai » May 19 2015, 10:17

wimfrits wrote:The screenshot is from the perspective of the player that wants a suitable challenge. I'd want a 'balancing' menu in the editor that allows balancing by the mapmaker for different difficulty settings.

Case to illustrate: in every playtest I did so far I've commented "Armies on this map should be increased by an average of +xxx%". But that only goes for champion level. I can't comment on the novice level tester's experience.

So while a set on impossible and calculate from there would be a good step, I think it's better to individually set values for each level. As this would be a mapmaker's tool, graphics are less important.
So, you want a tool to change the neutral armies's size all at once, individually for each difficulty level?

iLiVeInAbOx05 wrote:Just a script to count the number of units.. unfortunately you would need one for each type.
...
A little tedious to have to do this for each type of creature, but it works :D

I just threw the above scripts together, so I may have missed something to make them actually work properly, but you get the gist :D I also haven't tested these scripts on a large number of creatures, so the recursion might be a little slow. The algorithm could probably be tweaked as well. Maybe take 2 away and then add one if less than, or none if equal. Little things like that :D
Thank you, I thought about it in very similar way.

Duzeom_ wrote:To save number of Y creatures is simple because there is one command for it:

X = number of Y creatures

But you can give/take a fixed number of creatures.

So I propose to save number of creatures to give/take N as a binary number.

For example:

N = 29 elves.

N = 11101 B

So there are 5 commands to give elves:
1 command to give 16 elves
1 command to give 8 elves
1 command to give 4 elves
0 command to give 2 elves
1 command to give 1 elf.

It is so much better than 29 commands.

I used this in Megom Chronicles Memory Chrystal Campaign to pass numbers between maps using artifacts.
Now that's a programmer's approach! B-)
"Not a shred of evidence exists in favour of the idea that life is serious." Brendan Gill

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 1996
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Postby wimfrits » May 19 2015, 10:40

Dalai wrote:So, you want a tool to change the neutral armies's size all at once, individually for each difficulty level?


Yes, I think that would boost mapmaker's balancing capabilities tremendously.
(Note that the majority of mapmakers are creative artists that think of balancing as a necessary evil)

In that same 'balancing' tool, I would suggest
AI bonus gold per day
AI bonus weekly creature growth
AI bonus experience per day (linked to the PE we discussed earlier)
AI bonus hero stats (also linked to the PE)

And less important:
AI bonus resources per day
AI bonus starting creatures
AI starting town dwelling level
Are you suggesting coconuts migrate?

User avatar
Dalai
Equilibris Team
Equilibris Team
Posts: 1073
Joined: 06 Jan 2006
Contact:

Postby Dalai » May 19 2015, 12:30

wimfrits wrote:Yes, I think that would boost mapmaker's balancing capabilities tremendously.
(Note that the majority of mapmakers are creative artists that think of balancing as a necessary evil)
Ok, I finally see your point :)

I don't see why this functionality should be "mapmaker only". Mapmakers can use it to balance the map, but if a player wants increased "digital suffering" - why not?

I see that the tool we are talking about can work in 2 main directions - changing AI resistance quality and quantity. Second part - quantity - should cover your needs.
"Not a shred of evidence exists in favour of the idea that life is serious." Brendan Gill

User avatar
PatFX
Peasant
Peasant
Posts: 68
Joined: 05 Mar 2015
Location: Montreal, Canada

Postby PatFX » May 19 2015, 17:53

Hi guys,

Regarding combat for computer VS neutral, I personnaly prefer to give moral and luck to the computer and/or reduce moral and luck of the neutral instead of Give/take creatures from armys.

This way, if the computer want to fight (so he know that he will win), he will lose a lot less creature if his moral and luck are = 10. If you want, you can reduce moral and luck of the neutral too.

The computer will play faster (play first), hit harder and take less damage. In my opinion, it's better and more simple than giving more creature to the computer or remove creauture from neutral. Result is the same, the computer will lose less creatures...

If you really want to give creatures, I did something similar to Duzeom_'s suggestion in one of my map: In a quest hut, you can exchange venom Spawm for vampire because I did remove the tavern in my castle and I can't hire Vampire:

Conditionnal: if total number of "Venom Spawn" > 1000: Take 1000 Venom Spawn and give 1000 Vampire.

Condtionnal: if total number of "Venom Spawn" > 500: Take 500 Venom Spawn and give 500 Vampire.

Condtionnal: if total number of "Venom Spawn" > 250: Take 250 Venom Spawn and give 250 Vampire.

...... (divide Number of Venom/2).... at the end : put few : Conditionnal: if total number of "Venom Spawn" > 1: Take 1 Venom Spawn and give 1 Vampire.

In binary, it's a little bit more easy, because you don't need to put few Give/take 1 creatures at the end.

It works fine. For each venom spawn, I get a vampire. You can use a similar script to give or remove any number of creatures base on the current creature quantity.....but the problem with this is that you need to do it for each creature type...... = a lot of script.....

But I think you bring up a great idea.
Would it be possible to have a generic ranked artifact table. And then clear each AI heroes' inventory periodically and return each item ordered by the ranked table? So that highest ranked artifacts are returned and equipped first?
If it needs modifying the game code - no promises, sorry. But if it can be solved with scripting - good, another problem to train scripting skills. Fame and undying gratitude of generations of H-IV players are waiting for someone who solves it



I did something like this in my one of my map and it works fine:

You need to put this script on each computer`s heroes:

For exemple, let's look at artifact for shoulder:

First, you need predefine priority for those artifact. Let say you want to give this priority:

1- Robe of the Guardian
2- Cap of protection
3- Cloak of Darkness
4- Mage's Robe
......

SCRIPT:
Encounter:
Conditionnal: if hero has mage's Robe: Set variable vMageRobe to 1 and take Mage Robe.

Conditionnal: if hero has Cap of Protection: Set variable vCapeProtection to 1 and take Cap of protection.

Conditionnal: if hero has Robe of the Gardian: Set variable vRobeGuardian to 1 and take Robe of the Guardian.

Conditionnal: if hero has cloak of Darkness: Set variable vCloakDarkness to 1 and take Cloak of Darkness.

...... you need to do this for each artifact (shoulder)

So now, you did remove all the artifact from this hero....

Then, (in the same encounter script, just after in the sequence):

Conditionnal: If vRobeGuardian = 1, give Robe of the Guardian and set vRobeGuardian to 0.

Conditionnal: If vCapProtection = 1, give Cap of protection and set vCapProtection to 0.

Conditionnal: If vCloakDarkness = 1, give Cloak of Darkness and set vCloakDarkness to 0.

Conditionnal: If vMageRobe = 1, give Mage's Robe and set vMageRobe to 0.

It works fine. For each hero, when they encounter, each artifact will be remove and then each artifact will be give back with the predefine priority. So if the hero was wearing a Mage's Robe and had a Robe of the Guardian in the Backpack before the combat, during the combat, he will have the Robe of the Guardian equip and Mage's robe in his backpack.

This Script prevent the computer to wear a bad artifact instead of a good one. With this script execute on encounter, you know that the computer will always be using the good artifact in combat.

You can use the same exact Script for each different hero because on encounter, all the script on each hero are execute in a sequence. So if only one hero has a Robe of the Guardian, the other Heros won't get one even if the same variable (vRobeGuardian) is use.

If you want to give some priority to armor with Ward, you can. You need to put a script like this:

Conditionnal: If opposing Army's Alignement = Death and vArmorLife = 1 (the computer has the Armor of Life with death Ward): Give Armor of life and set vArmorLife to 0.

You do this for each armor with Ward and then, don't forget to put the same kind of script as the ones for shoulder:

Conditionnal: If vArmorLife = 1, Give Armor of life and set vArmorLife to 0.

You need to do this if you don't want the computer to lose his Armor (for exemple if he face a Order alignement and has Armor of Life).

This will give priority for Armor with Ward and then, if no ward is good for the opposing troop, the artifact will be given with respect to the priority you decide.

You can do this script for all the artifact and choose priority. I did it, but not for all artifact (only for shoulder, weapon and armor artifact) because I have control of every artifact on the map has the mapmaker.

One other thing I really like to do in addition to this script is to give a Robe of the Guardian on encounter to each computer's hero (if the hero don't already have one) and remove it if defeat. This add a lot of challenge when I fight a computer's troop and I don't get the Robe of the Guardian when I win the fight. This is probably the most usefull script of all because when the heroes are hard to kill, the fight is a lot more fun (more strategie)!!


sorry for my bad english.....

Have a nice day!

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Postby Karmakeld » May 19 2015, 20:02

Duzeom_ wrote:
So maybe taking army from neutral stacks is a better option? The same as adding but taking for example 20% of the neutral armies. Of course only in AI turn,
Dalai wrote
If such "pulse" (increasing neutral army during Human turns and decreasing during AI's) is possible with scripts - it's truly a great idea.


I think Wimfrit(?) used a script like this to check for human turn and AI turn. Anyway that's not hard. About the amount of scripting, I know Maciek used the H4 Utility to copy/paste the base of scripts and you'll 'only' need to replace creature type.

One might suggest that if neutrals are decreased during AI turns on Champion, they should be somewhat accordingly increased on Novice. I've read several times, that it's a known issue that neutrals have a tendency to kill AI on Champion but is too small a treat on Novice, allowing AI to faster progress. (Now I haven't tested this myself, yet, but it does make sense).
It would be fun to test how the luck/moral solution works out compared to in/decreasing neutrals. (as soon as I get H4 reinstalled, I might run a few tests).

About scripts running on neutrals, encountered scripts should run on neutrals if my memory is correct (sadly I have no way of testing this atm).
Last edited by Anonymous on May 19 2015, 20:45, edited 1 time in total.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
PatFX
Peasant
Peasant
Posts: 68
Joined: 05 Mar 2015
Location: Montreal, Canada

Postby PatFX » May 19 2015, 20:41

The Idea of the Robe of Guarding script is already found in Equilibris


Seriously??

Not potion of immortality..... Robe of the Guardian.....???

About scripts running on neutrals, encountered scripts should run on neutrals if my memory is correct (sadly I have no way of testing this atm).


Encounter script can run on Neutral or on Computer. If on neutral, you need to look if opposing troop is computer. If on computer, you can look if opposing troop is Grey (color).


PatFX

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Postby Karmakeld » May 19 2015, 20:47

I think you're wearing the wrong kind of glasses B-)
Not sure where you found the Robe of the Guardian quote.. ;)
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
PatFX
Peasant
Peasant
Posts: 68
Joined: 05 Mar 2015
Location: Montreal, Canada

Postby PatFX » May 19 2015, 20:59

I think you're wearing the wrong kind of glasses
Not sure where you found the Robe of the Guardian quote..


You did put a script on your reply:

Conditionnal: if someone Quote then remove text.....

Nice!!

;)

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Postby Karmakeld » May 20 2015, 8:49

Yeah, nice to see that my script worked in This forum. :-D
My spindoctor teached me that secret script :devil:
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Postby Taro » May 20 2015, 9:01

PatFX:

1) Script with artifacts works well. That's good solution.

2) Decreasing of luck and morale doesn't affect a quick combat, so I still prefer giving creatures at time of battle.

User avatar
Dalai
Equilibris Team
Equilibris Team
Posts: 1073
Joined: 06 Jan 2006
Contact:

Postby Dalai » May 20 2015, 10:22

PatFX wrote:Regarding combat for computer VS neutral, I personnaly prefer to give moral and luck to the computer and/or reduce moral and luck of the neutral instead of Give/take creatures from armys.
That's a good idea, thank you! It requires some testing though how helpful it is. Is it equivalent to reducing neutral army by 15%? Or 35%?

Your way of helping AI to choose better artifacts is simple and effective.

Karmakeld wrote:About the amount of scripting, I know Maciek used the H4 Utility to copy/paste the base of scripts and you'll 'only' need to replace creature type.
Amount of scripting is not a big concern atm ;)

Karmakeld wrote:It would be fun to test how the luck/moral solution works out compared to in/decreasing neutrals. (as soon as I get H4 reinstalled, I might run a few tests).
Please, do. And share your results, of course.

Taro wrote:2) Decreasing of luck and morale doesn't affect a quick combat, so I still prefer giving creatures at time of battle.
In this case tests should show no real difference with and without morale/luck boosting scripts. Would be a not so good news. It would mean that any luck and morale boosting artifacts are of no use to AI until it meets Human player.
"Not a shred of evidence exists in favour of the idea that life is serious." Brendan Gill

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Postby Taro » May 20 2015, 11:01

I tested decreasing first - no effect after 20 of battles. And then both decreasing on one side and increasing on the other side. Again - nothing.

And with artifacts - it only appears to be simple. Yes, if you make a list from best weapon to worst weapon then it's fine. But what about staves?

How are you going to choose the best staff and make others artifacts not to dissappear? How are you going to make good choice between staff and Crusader's Mace? Because if you make such choices then you will break a sequence and then some artifacts really may dissappear. You will realize that when you will try to do such complicated list. And don't forget some artifacts are two handed. What if a hero has something in the left hand?

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1092
Joined: 12 Nov 2011

Postby Karmakeld » May 20 2015, 12:29

Decreasing both luck and moral?

The trick would be, as I also think PatFx wrote, to take away the lesser Artifacts, replace it with a better one and then give it back. Then it won't dissapear from the map and player will have access to it upon vicotory.

The list should ofcourse consider two handed weapons (Halbert of the Swift Watch, 6x Staffs and Thunder Hammer). This might be an unlike case, but there are also set items (it should however be easy to run a seperate check for all set items and place them on the hero in case a hero carries all set items).

Regarding Staffs, you could run a check of the hero's skills/alignment, in order to know which Staff would be most efficient, in case of several staffs being carried. E.g. Does the hero have Chaos magic? If not the Mayhem Staff would be useless. The same goes for Weapons with army increasing stats like Crusaders Mace. Would it be most useful for a hero with high tactic skills or one without any tactic skills?
But again, should it be sorted out by a string of possibilities, you'd have to compared every possible combination options and through that, list the most valuable combinations also trying to take into consideration wheter the hero is stronger in Magic or Might. Does the hero have certain skills like combat skills or not. Should artifacts focus on the hero or it's army? Is there class bonuses to take into consideration etc..
I don't think we'll ever be able to help the AI make the most favorable decision regarding artifacts, as there are too many factors to take into account, but that doesn't mean we can improve it.
When speaking of Staffs and magic improving artifacts, Maciek and I learned then AI is not like to use even the best lvl 4-5 spells if AI is greatly outnumbered in combat. I have a specific example where a Hero is able to summon a stack of Ice Demons each turn. The hero is a Demonologist carrying the Demonary, so in a matter of turns the hero would be able to summon enough Ice Demons to make it impossible for the player to win. But faced with a strong enemy, AI chose a offensive approach using curses and direct dmg. instead. This I believe talks in favour of lowering the 'value' of magic improving artifacts compared to army/hero stat increasing ones, meaning Staffs would be in the bottom of the list.
Tomes might be a different matter, but again, unless the hero has Master+ Magic skill, I think they should come last.

I think Halbert of the Swiftwatch is a pretty powerful weapon. What you'd miss defensively, you'd gain in offense. But again, is it worth it on a weaker hero if missing out on potential army defenses?

I don't see a point in spending many months, making comparisons, calculations and seriously complex scripts, only to realize it still wouldn't result in the perfect choice of artifacts for a given AI hero and it's army.
Instead let just take a few steps in the right direction.
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 4 guests