Peppe

[MOD Project] DG Skirmish AI .22 -- 2/08/2010

[MOD Project] DG Skirmish AI .22 -- 2/08/2010

This mod will seek to make a challenging AI to play against in single player and multiplayer.

Currently mods can only be applied to 'skirmish' games offline, so offline tournaments are out at the moment.  Multiplayer can only use mods in custom games.

I hope to have many contributors and please post ideas here.   I am no expert on this game and can use every input available.  I also welcome other developers if anyone is interested.

 

Current Features:

  • Each demigod has custom build(s) reflecting a focused skill and item plan
    • Each build supports custom favor item and item priorities to taylor item selection to each build.  
    • Where it made sense the AI skill plans hold skill points for use at a later level. 
  • The AI purchases Citadel Upgrades like a human:
    • Priests, Angels, and Cats purchased in warrank 8 (if it has the money)
    • Giants and armor upgrades purchased at a high priority in warrank 10

Under Development:

  • Refine conditions for when to use an item with an 'on use' property.
  • Improve AI macro through goal priority level manipulation.

 

Downloads:  

Installer - http://peppe-dg-mods.googlecode.com/files/Peppe_DG_skirmish_AI_setup.exe

Zip - http://peppe-dg-mods.googlecode.com/files/Skirmish_AI.zip

Newer versions available in this thread: http://forums.demigodthegame.com/400825

To add an installer to your mod follow instructions here: [MODDING-UTIL] Mod Setup Script


.22 Changes: 2/08/2010

Tweaks to new or changed items in 21.  Should avoid flags protected by towers (more often).

 

.21 Changes: 2/07/2010

Custom actions created to teleport to towers and portals under attack by enemy Demigods.

When looking for flags to capture all Demigods consider all flags.   Actions for flags nearest HQ, near to demigod, and portal flags.

Capture lock changed to only lock portals and valor flags under enemy threat.

 

.20 Changes: 2/03/2010

Rook arrow tower firing rate dropped and damage increased in attempt to improve the AI Rook retreating stutter-step issue.

 

.19 Changes: 1/25/2010

Mainly Stun/Interrupt Changes.

UB + Rook will save thier skill for interrupt or a low health target.

Sedna + Oak, will fire thier interrupt skills as long as they have mana and should stop using it once they reach low mana, but will fire if an interrupt opportunity presents itself.

Erebus,  Will use charm mostly for interrupt, but if he can stun multiple demigods will fire it off.

Demon Assassin,  Didn't test this, but should only shadow swap to interrupt may add additional conditions later.

Teleport and Large potions set back to require a safe distance from enemies to use.

 

.18 Changes: 12/15/2009

Sedna Heals earlier, @75%

QoT Casts shield earlier, @75%

Some flag cap changes.

 

.17 Changes: 12/14/2009

Sedna build changed.

Minor changes to survival goals.

Flag capture range extended.

 

.16 Changes: 12/13/2009 Mark II

Minor changes to Teleport distance check and consumable item priorities.

UB build changed to Ooze + Spit maxed by lvl 10.

Sedna Item priorities changed.

 

 

87,592 views 262 replies
Reply #127 Top

 

Thanks all for the feedback/karma ;)

 

I only got to play a game or two in the last week, so not much modding.   I found those games to be way more challenging than the base AI, so I am happy with the progress that was made. 

 

Anyone have some thoughts on where to focus now?

 

I am pretty happy with the demigod builds, upgrades, and item purchases.  I think the AI can always use more builds to add veriety, but the current set is pretty strong.  The upgrades could use more layers of logic, but they arrn't spending a ton on that until the very end of the game.

 

Thier macro is hard to judje.  As the Goals that they act on can be somewhat random, but they seem to be more consistent on flag capping and engaging creep waves.

 

There are little things they screw up like:

when to use a capture lock, which i can look at.  Should be in the same file as the mod to when to use Sigil.  I don't think thier use of that win/loses them the game.

when to push a tower.  They tend to get themselves killed when they wonder past a tower or two.

 

Anyone have any other thoughts/suggestions that would make the AI harder on the player?

Reply #128 Top

Quoting Peppe, reply 127
There are little things they screw up like:

when to use a capture lock, which i can look at.  Should be in the same file as the mod to when to use Sigil.  I don't think thier use of that win/loses them the game.

when to push a tower.  They tend to get themselves killed when they wonder past a tower or two.

I agree that your modded AI is a great improvement over the vanilla one.  I simply will not play single player without it.  The next frontier, I believe, is AI awareness of towers.  Or more accurately, its awareness of the layout of enemy bases.  If there is some code that would keep the AI from suicidally wondering around the inside of an enemy base (it's notorious for doing this on Leviathan) before the towers are down, that would be great. 

I'm not so picky about the capture-lock code.  It would be nice if the AI mostly locked enemy portals or flags that it couldn't otherwise hold.  Still, the AI pathing and enemy-base wandering are more important issues.

Reply #129 Top



Anyone have any other thoughts/suggestions that would make the AI harder on the player?

towers

Reply #130 Top

 

Ok i'll take a look at towers.

 

Right off I see room to increase its fear of towers while attacking other demigods.  Default appears to be not to worry about towers while attacking a demigod unless there are more than 2 towers.   I am going to try to reduce that to 0 and see if that is good/bad/worse.

 

Its real easy to make the AI super chicken, so I will try to play with its survival and health goals in small chunks to increase its desire to survive, which should keep it away from towers more often.

 

While searching for 'tower' in the code i found this interesting section:

    # Capture reward - this is how important the brain thinks it is to hold this point

    FindCaptureReward = function(self, flag)
        local brainName = self.Brain.Name

        local captureReward = 0

        local towerWeight = 0.5
        local fortWeight = 0.5
        local goldWeight = 1.0
        local portalWeight = 1.5
        if ScenarioInfo.Options.SpawnRate == 'Never' then
            portalWeight = 0.5
        end

        local warIdolWeight = 1.5
        local artifactsWeight = 1.25
        local cooldownWeight = 1.5
        local damageAmpWeight = 1.5
        local healthRegenWeight = 0.75
        local manaRegenWeight = 0.75
        local maxHealthWeight = 1.0
        local maxManaWeight = 1.0
        local waveSpeedWeight = 1.25
        local waveSizesWeight = 1.0
        local experienceWeight = 1.25
        local healthStatueWeight = 1.5
        local trebuchetWeight = 0.75

 

Might be able to adjust flags the AI goes after and how actively they defend it

Reply #131 Top

.14 changes:  12/09/2009

Heroes should respect towers more early.

Heroes should value portal flags more at higher warrank.

 

Enemy Towers+heroes nearby in the default AI was only a concern if there were more than two towers (otherwise it was ok to battle near the tower).  Now the AI should hang out just outside the tower range early game, but will still attack a tower with a squad as cover.   Also it will still chase a near dead hero into towers.  Testing I did showed a slight improvement to the ealry game tower respect, but at a certain level the AI loses almost all fear of towers.  This might be when it thinks its time to push or simply rating its own strength as much higher than a tower.

 

Added flagasset which weights flags and increased portal weight when warrank is above 7.

Weight is said to do the following:     # Capture reward - this is how important the brain thinks it is to hold this point. 

I didn't get to test this as much as I normally do, but it sounded interesting.  If it does what it says then it should defend its portals more when the game gets into the cat's - giants stage.

 

 

 

 

Reply #132 Top

Peppe: Btw, they are Demigods you know, not heroes :)

Sounds like good changes, nice job.

Reply #133 Top

Heh sorry.   They are referred to as Heroes in the code, so its hard to switch back to 'Demigods' for the change list cuase i was editing Hero actions and hero goals :P

Reply #134 Top

i might be crazy, but I don't think you updated the .exe file with version .14 peppe.  The zip works though.

Reply #135 Top

You are right i had done a format/reinstall and had to redo the installer script, but missed the destination folder.

 

If anyone used the installer on .14 installer up to this post, delete 'Bman Godlike Team Panel' folder and reinstall that mod if you use it and run the latest skirmish installer to get it in the skirmish_ai folder.

 

Sorry for the mix up.

Reply #136 Top

i did a few games with 0.14 and it seemed that the AI is even more "unaware" of enemy towers...it runs deeper into defenses than before....

Reply #137 Top

Here is another thing that I noticed. The AI uses frequently robust health potions since even early game. I think this is a waste of money because they are easily interrupted and results in the AI immediate death. I would suggest to make the AI more conservative about using this type of consumable, and save money to buy items and upgrades asap. starting midgame, the only consumable the AI should carry is Sigil, besides TP and cap locks. No need to wast money on pots which are easily interrupted.

On more thing about the builds, some of them just need to be tweaked. For example, sedna alyaws buy scaled helm + guanlets of brutality instead of monks, and if ever she reaches 8k gold, she buy the mageslayer. that ALWAYS happens. pure spit UB is worthless imo, the only viable build for UB is spit/ooze with HP stacking. these are just two things that I have noticed about the builds.

Reply #138 Top

 

I'll tweak with the settings available on towes and see what happens.  I thought cataract was improved, what map were you testing on?

 

Lowered mage slayer priority on sedna. I'll test a few times to see if she stops buying it or I might zero out all the  artifacts globally and make that selection in each build.

 

UB has two builds at the moment: OOZE + Speed + Stat buffs and SPIT + Speed + OOZE.  In both cases the third skill isn't trained until after level 10.  Let me know if the SPIT build needs to work in ooze earlier.  Its skill plan is:

            'HEPA01VenomSpit01',        # 1
            'HEPA01SpeedIncrease01',    # 2
            'HEPA01DiseasedClaws01',    # 3
            'HEPA01VenomSpit02',        # 4
            'HEPA01PostMortem01',       # 5
            'HEPA01FoulGrasp01',        # 6
            'HEPA01VenomSpit03',        # 7
            'HEPA01SpeedIncrease02',     # 8
            'HEPA01SpeedIncrease03',    # 9
            'HEPA01VenomSpit04',        # 10
            'HEPA01Ooze01',                # 11
            'HEPA01Ooze02',                # 12
            'HEPA01Ooze03',                # 13
            'HEPA01Ooze04',                # 14
            'HEPA01PutridFlow',          # 15
            'HEPA01Acclimation',        # 16
            'HEPA01Plague01',              # 17
            'HEPA01Plague02',             # 18
            'HEPA01DiseasedClaws02',    # 19
            'HEPA01DiseasedClaws03',    # 20

Reply #139 Top

 

.15 up.

Teleport home for health: removed check for enemies, so will use a TP if it gets overwhelmed in a crowd.

Teleport home to shop: No action for this before, so the AI would walk home to shop even if it had a TP scroll. Created action similiar logic to TP home, but the AI decides when it really wants to shop.  Not triggered often.

Teleport to squad target.  This is the only teleport from home to outside, I have double the minimum range twice to hopefully get it to save the teleport for a longer trip.  

If you notice the AI TP over a short distance let me know and i will adjust the distance checks for the teleport method it used above.  Post where it started and where it ended Anyware to health stone/shop vs anywhere to a structure/flag.

Sigil is now mainly an escape valve.  It will usaully trigger when the AI is fleeing or about to flee and once triggered instead of evaluating its health as good it will ignore the buff and run.   Sedna is about the only one i have seen heal a sigiled ally and stop its retreat.

Capture Lock reduced range check to 10 instead of 20.  20 seemed to be about 2 times the range of most skills.  10 should ensure a threat is at least near enough to warrant a lock

Towers for the early game should have it pretty scared.  Found an on taking damage event/action, so when a tower hits a hero its survival and health goals go way up, which should get it to back off.

Found a 'Health' Sensor that has an interesting affect on survivability and flee timing // priority.

Also adjusted minimum health before fleeing is even considerd, was 80% is now 50%.

If you notice it being too chicken try to describe the circumstance and i'll see which health area to adjust.

Reduced big health potion buy priority.  More likely to cary a teleport scroll and TP to the health statue.

 

Current issue:

AI vs AI most demigods avoid death very well. I havn't had time to play against it, so let me know if there are any issues human's can exploit easily. 

ROOK sometime or a lot of the time seems to get into a stutter trying to retreat, but only going to the edge of his tower range and inching forward letting his towers contiunue to hit things as he continues to die.  I will need to verify this is in the base AI, I would assume so.   Once he starts carrying sigils he is a little better at surviving, but I think he has excape issues due to his speed or his shoulder towers.

 

Reply #140 Top

Peppe -- Just finished a single-player game with the new build.  Here are the details:

3v3 Cataract.  me + 2 Normal AI on my side, 3 Hard AI on other side.

The big thing I noticed with this build is that the AI's are teleporting like crazy.  This is definitely increasingly their survivavility, but to be honest, it plays a bit odd.  It's pretty much guarenteed now that in a fight, once the AI hits 50% of their health, they'll tele out of there - unless they think they have a shot at killing you (which is great).  But the constant telies back to base were disconcerting.  I wasn't playing an interrupt-skill Demigod, but if I was, I would have had a field-day with that.  I almost preferred it when they carried about the health pots more.  Then I sometimes would overextend myself chasing them down, to suddently find their health back to 100%.  Now, they just run away.

A couple of the AI's still committed suicide early game by walking into enemy tower fields.  I saved the replay if you want to see this.  It happened early game, before any of them had hit level 5.

Cap lock behavior definitely seems to be improved.

None of the AI's purchased any reinforcements at the Citadel.  After buying Tower Strength, they purchased 2 levels of Graveyard.  Is this intentional?  I'd much rather have them save their money and buy Currency or Priests.

 

Reply #141 Top

UB has only 1 viable build which all good player use, a spit/ooze hybird.

1. spit I

2. ooze I

3. save

4. spit II + ooze II

5. foul grasp

6. save

7. spit III + ooze III

8. deceased claws I

9. save

10. spit IV + ooze IV

11,12,13. inner beast I, II  III

14. save

15. acclimation + putrid flow

16-->20. stats (doesn't really matter)

favor: Blood of the Fallen (or Blade of the Serpent if the AI can properly use it)

items: All HP (with the exception of maybe a Vlemish if the AI chooses Blood of the Fallen)

For sedna, mageslayer is a VERY POOR choice even if the AI manage to get that money. for 8k, if Im playin a sedna, I would buy the Orb of Veiled Storms, its a much more powerful artifact for sedna that a mageslayer. :D and sedna should never start with guanltes of brutality, monks + blood of the fallen.

Reply #142 Top

Sedna should buy Nature's Wreckoning, it's huge on her, mid game.

Reply #143 Top

.16 update

Shuffled up consumable priorities again.  It should be more likely to Health potion and teleport.  Probably go sigil if it has cash or cap lock if its poor.   This should hopefully make it less predictable that it is going to port out vs use a health potion as it may have one or both.  From my observation it will use the health pot before considering fleeing.

Found a spot where the teleport distance was short for the teleport to a squad location/target at (50) bumped up to 80 like the rest.

UB build switched to the one above.  Made both forms Blood with vlemish and Serpent with no vlemish.  Same skill plan.  Serpent is used by demon assasin and Regulas and they seem effective with it, so i think UB will be good.  The trigger conditions can be tweaked if needed.

Sedna Items tweaked.  She seems about 50/50 to open items or bishops in nightmare.  On lower levels it will probably go monks first most of the time.

Reply #144 Top

Quoting Nucleus, reply 140
Peppe -- Just finished a single-player game with the new build.  Here are the details:

3v3 Cataract.  me + 2 Normal AI on my side, 3 Hard AI on other side.

The big thing I noticed with this build is that the AI's are teleporting like crazy.  This is definitely increasingly their survivavility, but to be honest, it plays a bit odd.  It's pretty much guarenteed now that in a fight, once the AI hits 50% of their health, they'll tele out of there - unless they think they have a shot at killing you (which is great).  But the constant telies back to base were disconcerting.  I wasn't playing an interrupt-skill Demigod, but if I was, I would have had a field-day with that.  I almost preferred it when they carried about the health pots more.  Then I sometimes would overextend myself chasing them down, to suddently find their health back to 100%.  Now, they just run away.

A couple of the AI's still committed suicide early game by walking into enemy tower fields.  I saved the replay if you want to see this.  It happened early game, before any of them had hit level 5.

Cap lock behavior definitely seems to be improved.

None of the AI's purchased any reinforcements at the Citadel.  After buying Tower Strength, they purchased 2 levels of Graveyard.  Is this intentional?  I'd much rather have them save their money and buy Currency or Priests.

 

 

Thanks for the feedback.

 

I'll keep playing with getting it to change goals when getting hit by a tower.  They seem to survice better now, but i test again nightmare AI maybe hard is missing some items early game to keep it alive.

 

I had graveyard on when i was testing their suicide rate when i played when to flee combat.  Its off in .16.

Citadel upgrades should be back to the normal plan building health -> currency -> wait till warrank 8 -> get all reinforcements and 1 damage upgrade -> wait till war rank 10 -> get giants and all other damage/armor upgrades.

 

 

 

Reply #145 Top

atta boy modifying the a ub build a little.  Looks more like kokujin's build, which is appropriate, imo.  Thanks again for the hard work and I, for 1, am glad you were able to find the time.

Reply #146 Top

Ok after playing several games now with versions .15 and .16, I have noticed this. AI purchases Graveyard I and II which are totally worthless citadel upgrades. This money should be invested elsewhere and/or saved for more important purchases. I've never heard someone recommending buying this upgrade, so imo the AI should completely ignore it.

The AI uses teleport scrolls when it is losing a battle, that is great but easily interupted. I was wondering if it would be possible to make the AI retreat behind a tower (or to any safe zone) before using a teleport or potions ?? that should help the AI not gettting killed due to a TP/Pot interupt.

The builds that AI uses, especially erebus, UB, Oak I think (those that I've noticed) use Wyrmskin Handguards. Maybe for human players who know what they r doing this item can work well, but for the AI I think it's a bad idea. My suggestion is switch this item with an HP item (Hauberk of Life for example).

One last thing, the sedna build seems very odd. can you please share with us which build(s) r u using ? Anyway here is a good build for sedna that I and other player use:

Favor item: blood of the fallen

starting item: monks + 1 mana pot

Skill order:

1. heal I

2. healing wind I

3. inner grace I

4. pounce I

5. healing wind II

6. heal II

7. heal III

8-9. counter healing / magnificent presence I (depending if they got priests or not)

10. heal IV

11 - above focus on maxing pouce + magnificent presence

items in the order I usually prefer:

sell monks and get bishops

velmish  + unbreakable boots + NATURE'S RECKONIN + nimoth chest + pleanor

Cheers,

Reply #148 Top

Graveyard should be out in .16.  It was for offline testing since i was playing with thier flee chances they were dieing a lot ;P

 

Sedna i believe was taken from the 'duelist' guide if i recall:

     heal_pounce = {
            'HSednaPounce01',               # 1
            'HSednaInnerGrace01',           # 2
            'HSednaHeal01',                  # 3
            'HSednaPounce02',               # 4
            'HSednaHeal02',                  # 5
            'HSednaInnerGrace02',              # 6
            'HSednaPounce03',               # 7
            'HSednaHeal03',                   # 8
            'HSednaInnerGrace03',           # 9
            'HSednaPounce04',               # 10
            'HSednaHeal04',                  # 11
            'HSednaHealingWind01',          # 12
            'HSednaHealingWind02',          # 13
            'HSednaCounterHealing01',          # 14
            'HSednaInspiringRoar',          # 15
            'HSednaLifesChild',             # 16
            'HSednaMagnificentPresence01',  # 17
            'HSednaMagnificentPresence02',    # 18
            'HSednaMagnificentPresence03',    # 19
            'HSednaSilence01',                 # 20

 

Looks like i just need to drop pounce II and III in the early game for helaing wind. 

As of .16? She should already be on those items:  
                # Scaled Helm
                # +750 Mana
                Item_Helm_010 = {
                    Priority = 20,
                },       

                # Banded Armor
                # +500 Hit Points
                Item_Chest_020 = {
                    Priority = 25,
                },
               
                # Nature's Reckoning
                # 15% chance on hit to strike nearby enemies with lightning for 250 damage
                Item_Ring_030 = {
                    Priority = 30,
                },

                # Unbreakable Boots
                # +360 Hit Points
                # +540 Armor
                Item_Boot_040 = {
                    Priority = 35,
                },   

                # Nimoth Chest Armor
                # +1100 Armor
                # +10% Dodge
                Item_Chest_030 = {
                    Priority = 40,
                },
               
                # Plenor Battlecrown
                # +1000 Mana
                # -25% to ability cooldowns
                Item_Helm_030 = {
                Priority = 45,
                },   
               
                # Vlemish Faceguard
                # Increases the Mana Regeneration of you and nearby allied Demigods by 40 Mana per second.
                Item_Helm_040 = {
                    Priority = 50,
                },

I can't really control the order she buys the item other than the highest priority item that can be bought with her current gold will be selected when she is shopping.  I can make priests/monk, above vlemish and she will always start with them since they are cheap. 

When all the slots are full it will sell the lowest priority item to make room (nature's reckoning).   I'll swap boots with plenor in the priority list, so at 1500 gold it will pick boots, nimoth, plenor, but at 1750 it will always take vlemish.

That should get her to a pretty solid state.

 

Edit:

For potions and teleports.  Yes i can set a distance check for enemies on using the survival items.  Offline i am also testing with a fixed health amount before considering retreat.   2000 seems to be working well and the demigods that arn't health stacked retreat better.   Should it retreat sooner later?

Potions never had an enemy distance check, but teleport does in the default AI, so i can turn that on and copy the check to potions.  I'll tinker with this offline and see what results.

Reply #149 Top

For potions and teleports.  Yes i can set a distance check for enemies on using the survival items.  Offline i am also testing with a fixed health amount before considering retreat.   2000 seems to be working well and the demigods that arn't health stacked retreat better.   Should it retreat sooner later?

I think a percentage based health amount would be better. I mean early game some DGs don't even have 2000 hp. I was also wondering if its possible to make this amount change according to the number of enemy DGs nearby. What I mean is that in 1v1 fight, you can pretty much risk to go as down as 20% of your HP before deciding to use a pot/sigil/TP out, but in larger fights you can't do that (risk of multiple stuns/interupts).

Looks like i just need to drop pounce II and III in the early game for helaing wind. 

 I can make priests/monk, above vlemish and she will always start with them since they are cheap. 

yes, please do so.

edit: You haven't updated the zip file for download, that's why the AI was still buying graveyard and I was think I had .16 . The .exe installer is fine however :D

Reply #150 Top

.17 Up

Wyrmskin gloves removed from a few builds.

Sedna build updated based on the build posted above. 

Swaped UB item order a little as it was sometimes waiting for 500 gold or so to buy slayer wraps at start of a game on nightmare.

Health switch back to a percent.  Should consider flee goal anytime its below 55%.  It shouldn't actually flee until its health and damage sensors increase its survival and health desires.   The health one ramps up rapidly below 50%.  If i am reading it right the damage one slowly increases each time a hero hits it.  Towers have a seperate check and have been modded to a much higher survival desire when it gets hit by a enemy tower.

 

I tried not using pots when an enemy is near the DG, but they died a lot with pots and scrolls on them.

If you want to play test it.  Open this file in notepad: Skirmish_AI\hook\lua\sim\AI\Heroes\Actions\UseItemsActions.lua

Look for this line (appears twice first is for health potions, second teleport scroll).

        #  [MOD] Distance to check for enemies

Remove the comments '# --' on the 3 lines after it.  To play with the distance change the 15 higher or lower.

 

Edit:

Forgot Flag capture range extended.   I have a little better eye for what all the distance types are, so noticed the flag capture one was actually only checking about 3-4 times the range of say penitance or any of the ranged skills.  So you could cap thier portal flag and if they are in the oppisite lane they won't notice it.   I doubled the range and at least on cataract they seemed better at capping back flags.