Call to H-IV mapmakers - AI enchancing scripts
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?
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?
Karmakeld
Thank you for your comprehensive input. You are very observant about Learning Stone's problems
Having read your and wimfrits' replies, I tend to choose some more simple option.
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.
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.
Thank you for your comprehensive input. You are very observant about Learning Stone's problems
I am not sure that inside the game code it operates objects with scripts similar to ones in map editor.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. (brilliant - I know)
Now what's the next issue to solve
Having read your and wimfrits' replies, I tend to choose some more simple option.
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: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.
Sounds reasonablewimfrits 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.
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: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,
That too, of course.Duzeom_ wrote:Also give experience equal to normal number of enemies.
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.
As I just said, that is why I ask for mapmakers input. If I knew everything - I would not need this topicTaro 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?
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
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.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?
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?
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Just a script to count the number of units.. unfortunately you would need one for each type. I used something similar to the following: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.
(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
}
Code: Select all
numElves = number of elves in the army;
doubleElves
{
numElves += numElves;
increaseElves; //Script below
}
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;
}
}
Code: Select all
decreaseTimes = 0;
decreaseElves
{
if (beforeElves < number of elves in army)
{
take away an elf;
decreaseElves;
}
}
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
I just threw the above scripts together, so I may have missed something to make them actually work properly, but you get the gist 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
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.
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.
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.wimfrits wrote:Yes! There's an idea!!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,
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.
Mala Ipsa Nova
So, you want a tool to change the neutral armies's size all at once, individually for each difficulty level?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.
Thank you, I thought about it in very similar way.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
I just threw the above scripts together, so I may have missed something to make them actually work properly, but you get the gist 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
Now that's a programmer's approach!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.
"Not a shred of evidence exists in favour of the idea that life is serious." Brendan Gill
Yes, I think that would boost mapmaker's balancing capabilities tremendously.Dalai wrote:So, you want a tool to change the neutral armies's size all at once, individually for each difficulty level?
(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?
Ok, I finally see your pointwimfrits 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)
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
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.....
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!
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!
Duzeom_ wrote:
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).
Dalai wroteSo 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,
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.If such "pulse" (increasing neutral army during Human turns and decreasing during AI's) is possible with scripts - it's truly a great idea.
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 19 May 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
Everytime you throw dirt, you loose a little ground
Seriously??The Idea of the Robe of Guarding script is already found in Equilibris
Not potion of immortality..... Robe of the Guardian.....???
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).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).
PatFX
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%?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.
Your way of helping AI to choose better artifacts is simple and effective.
Amount of scripting is not a big concern atmKarmakeld 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.
Please, do. And share your results, of course.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).
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.Taro wrote:2) Decreasing of luck and morale doesn't affect a quick combat, so I still prefer giving creatures at time of battle.
"Not a shred of evidence exists in favour of the idea that life is serious." Brendan Gill
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?
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?
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.
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
Everytime you throw dirt, you loose a little ground
Who is online
Users browsing this forum: Majestic-12 [Bot] and 2 guests