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 #201 Top

 

.21  up.   making change log now.   Big changes to flag capturing (search and defense).

 

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

 

Some rarer events have the AI action/event chat still enabled.  This helps with testing and is not too distracting in game, but let me know if the event is solid enough to drop the chat.

 

 

Reply #202 Top

Awesome! Thx :thumbsup:

Please keep the AI action/event chat enabled, its so useful when testing your mod. Also the citadel upgrade info from AI is extremely useful.

Reply #203 Top

Awesome! Thx

Please keep the AI action/event chat enabled, its so useful when testing your mod. Also the citadel upgrade info from AI is extremely useful.

I completely agree.  Its cool to see what the ai buys on my team and very helpful.  I'm really looking forward to seeing how the ai handles portal control now.

Reply #204 Top

tried a 3v3 in cata. I was on light side, and captured the celerity flag and portal flag around level 6. The enemy AI just completely ignored them until I was level 11.

2nd test: 3v3 in cata, light side.

I didn't cap the portal flag until late game, after level 10-11. The AI (at least 2) ported to defend their portal immediately but they didn't lock it. same thing concerning the valor flag. AI teleports soon enough to defend their flags but fail to lock them.

1 more thing I see the AI keeps doing, going past my towers to cap either the gold/celerity/sometimes even  the valor flag. This equals gank equals death. Is there a way to COMPLETELY prevent the AI from capping the gold/celerity flags UNTIL the side towers are down ? same thing for valor flag, prevent the AI from attempting to cap that flag until the 4 front towers ALL OF THEM are down?

Reply #205 Top

Offline version, Tower check added to flag search for the 3 capture actions.   Should ignore flags protected by towers (other actions should push the lane and kill the towers).

 

Portals are a little special on cataract cuase they don't have towers close to them.  And increasing the range of the tower check makes the AI ignore center flags.  I will try some more values, but for sure it will respect the towers at the gold flag.

 

Reply #206 Top

You know what else would be great in this mod? 

Autofill slot "Hard"
AutoFill slot "Nightmare"

The autofill fills up the slots with the random selection, so you can't see what the DGs will be.

The autofill also fills the appropriate amount of AIs for the map.

eg: For cataract it will fill it to 3vs3.

:D

Reply #207 Top

Quoting LORD-ORION, reply 206
You know what else would be great in this mod? 

Autofill slot "Hard"
AutoFill slot "Nightmare"

The autofill fills up the slots with the random selection, so you can't see what the DGs will be.

The autofill also fills the appropriate amount of AIs for the map.

eg: For cataract it will fill it to 3vs3.

Cant change the menu system, sorry.

Reply #208 Top

.22.   Some tweaks from Izuz input.  AI is a little more conservative.   Still does some bonehead tower charges, but the flag capture actions are no longer the source.

Lord Orion as morpheas said lobby cannot be modded.   That was actually the first thing i tried to mod.

 

 

.22 Changes: 2/08/2010

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

 

Found it tough to balance flag capping priorities as if it is too high the AI will ignore the tower threat to get to a portal flag, but if it is too low it won't go through the effort to recapture its own portals.   It still prefers to capture based on what is near it it as i think the action functions have some hidden metric to weight by distance.   It should defend portals and towers aggressivly.   If you capture an enemy portal expect your own team to TP in if the enemy gets near it.

Reply #209 Top

Some real nice improvements, is there any way to get this working in tournament?

Reply #210 Top

Tournament does not hook in gameplay mods.   I think the settings for a tournament are hard coded into its lobby/scoreboard area, which can't be modded as those files are never checked for a modded version to hook.

 

I believe it will still hook UI only mods though, and i seem to recall trying to flag my mod as UI only to trick it to load in tournaments, but fairly sure I got no where on that.

 

Was hoping GPG would provide a way to mod the lobby/tournaments etc, but for now that doesn't seem possible.

Reply #211 Top

Does this AI work in multiplayer, and do all players need the mod installed and enabled for it to function? 

EDIT: ^ Read OP again ;)

 

I'm guessing currently the mod overrides the standard AI for the various difficulties, but are the difficulties rebalanced at all?

Obviously for the purpose of Nightmare AI, there's not much need to rebalance as Nightmare needs a bit of a buff.

Is it, or will it ever, be possible to pit standard AI versus Peppe AI?

I'd just like to watch and see how things pan out.

EDIT:

Ok just finished my first game with, as far as I know, Peppe AI, just a 1v1 Nightmare on cataract.

At the end of the game, I owned most of the map so the enemy cit was being overrun by creeps.

I was up against a TB, which was heavily invested in fire AOE, however in it's attempts to stop my creeps from destroying the citadel, it never once used any AOE skills, just it's basic attack. Had it used just 1 or 2 AOE attacks against creeps it could have held off my attacks pretty well. If it was a case of no mana then it would be nice if the AI had the mindset to go to the regen crystal which it was already very close to.

Reply #212 Top

Quoting carn1x, reply 211

Is it, or will it ever, be possible to pit standard AI versus Peppe AI?

I'd just like to watch and see how things pan out.

Probably not worthwhile.  The standard AI would lose every time due to poor item selection, uncompetitve builds, failure to upgrade citadel properly, and a high death toll due to tower suicides.  Peppe's mod is a vast improvement over the standard AI.  Of course, even the modded AI will still occasionally do something dumb, like wander into the enemy base or fail to see a gank coming.  But still, Peppe has made the single-player skirmish much more enjoyable and viable.

Reply #213 Top

Probably not worthwhile. The standard AI would lose every time due to poor item selection, uncompetitve builds, failure to upgrade citadel properly, and a high death toll due to tower suicides.

don't forget that on some maps, the standard ai doesn't even buy any items depending on the slot they are in.  The original ai coding is MEH at best.

Reply #214 Top

Quoting pacov, reply 213

don't forget that on some maps, the standard ai doesn't even buy any items depending on the slot they are in.  The original ai coding is MEH at best.

Yeah, I've seen this in replays.  Quite a shame really.  I've also seen the standard AI make some truly baffling purchases, like the Plate Visor or the Theurgist's Cap.  When it does buy items, it appears to do so randomly. 

Reply #215 Top

Quoting carn1x, reply 211
Does this AI work in multiplayer, and do all players need the mod installed and enabled for it to function? 

EDIT: ^ Read OP again

 

I'm guessing currently the mod overrides the standard AI for the various difficulties, but are the difficulties rebalanced at all?

Obviously for the purpose of Nightmare AI, there's not much need to rebalance as Nightmare needs a bit of a buff.

Is it, or will it ever, be possible to pit standard AI versus Peppe AI?

I'd just like to watch and see how things pan out.

EDIT:

Ok just finished my first game with, as far as I know, Peppe AI, just a 1v1 Nightmare on cataract.

At the end of the game, I owned most of the map so the enemy cit was being overrun by creeps.

I was up against a TB, which was heavily invested in fire AOE, however in it's attempts to stop my creeps from destroying the citadel, it never once used any AOE skills, just it's basic attack. Had it used just 1 or 2 AOE attacks against creeps it could have held off my attacks pretty well. If it was a case of no mana then it would be nice if the AI had the mindset to go to the regen crystal which it was already very close to.

 

You can verify my AI is active by adding an AI to your team for a game.   When the game starts the AI will chat to allies what build it selected.

 

MOD replaces or enhances the default AI.  Most of the code is still the default AI.  Major changes are Skill Builds have all been replaced, items to shop for set by build, and favor item to use for that build.   This alone has a major impact as the AI uses the good items players use and pairs items that will work with the build.    Some skill usage have been modified to use it better.  For example interupt skills are saved for a good time or to stop a fleeing enemy (basically stop the default action of firing a skill whenever it is available and save some for an interupt opportunity).    Some item usage have been enhanced for better timing or situational use.   Tweaks to when to retreat and always trying to get it to fear towers enough to retreat when its damaged.   A lot of what the AI does is set by goals, so the weight of these goals has been heavily modified to get it more interested in flag capping/map control as the default AI doesn't care and in an even match the first to giants usaully wins.   Even with all the changes it usually takes 2-3 AI's for one to care about flag capping.

 

Difficulty bonuses are not modified.   Default is like 1.5 Exp for hard, 2x exp on nightmare.  Starting money 2k and 4k hard/nm.

 

I havn't modified TB's skill usage, so it should the default, which for most skills is basically fire whenever the Demigod has mana and a target.  AOE spells can get creeps as targets and will be used to kill waves.   There isn't a mana retreat, but usually its not an issue as they manage to take damage and retreat for health often enough.

 

I would recommend giving the AI at least one teamate.  You can give yourself normal teamates and fight nightmare 1-3v3 for a good game.   I don't think the AI will ever out play a human on map control 1v1.    One AI alone might think whatever he is doing is more important than protecting the portal, but get 3 on the team and 1-2 will see the portal as high enough to go defend even if they are busy.   They also seem to have a good chance of making flag capture thier primary objective when they return to the health stone and shop.  If more AI's are on the team there are more chances for it to return to base and reset its objectives and do something useful.

Reply #216 Top

been playing your mod for a while now, (i use it to test my mod with, its fantastic! :) ).

I have had a couple of interesting ideas and was wondering what you thought of them.

1. Is it possible for the AI to follow a human players orders.

ie Pinging. Curently the AI only sometimes responds to a ping. however i am not sure if this is due to luck or it is code. However, when you have an ai on your team, it would be really nice if i was able to ping somewhere on the map and have them rapidly move to this location. Uses of this would be: i would be able to set up ganks, i would be able to retreat and know the tower/myself is covered. This would make for much better multiplayer experience as well, as i would be able to retreat my AI to my/ a teammates location so they cant get pressured all the time and would prevent the silly portal flag ninja that occurs by low level ai (although you have really fixed alot of this problem already, the computer will still sometimes try this. Myself or teammates seeing this occuring would then be able to call the demigod back before it got too damaged. The ping information is already shared, (because it occurs on everyone minimap) so i think that this might be possible. (i will look into this myself but i think it might require a new ai script and i am not familiar with the code for this).

 

2. AI will often go for multiple targets when in groups. Is it possible to get the ai to all focus fire on an individual target (as is done in high ranked play). Ie detect which demigod has the least health, or has taken the most recently (or by a player) and all focus damage on that target.

3. Set AI to follow mode.

This is probably quite difficult and would need a UI mod as well, but i was wondering if it was possible to set the ai to follow a player.

Bmans godlike team panel can select a demigod and move the camera to the target. Is it possible to use this to select ai demigod and set them onto a follow behaviour?

4. Is it possible for AI to recognise commands through chat? even something simple like -R tells all AI demigods to retreat to the nearest tower.

Also does the AI have behaviours (ie agressive, passive, defensive) that could be selected throught chat or a UI mod?

5. Is it possible to assign hotkeys to ai commands: ie = brings up a target console to assign a target for all nearby AI demigods (or even creeps as well).

6. I know this isnt in the AI but you have done it for them, is it possible to send chat information about allied human demigods. Ie when humans begin using a capture lock (this will prevent miscommunitcation about who is locking the flag, and prevent the wasting of a caplock). Also could be applied to other events such as pots (prevent sedna healing an ally which is about to heal at the same time).

Kinda related to above, I am not sure if you have done much with the minimap ping, but is it possible that when someone teleports it sets off a ping to the intended location? This would be useful as it would indicate to players their teammates actions and would require less manual communication.

Sorry for the big list of questions just was curious :)

Exx

Reply #217 Top

I just wanted to say Thank You Peppe. I don't play against AI, but I have a lot of friends that don't like going online and they use this all the time.

They don't come on the forums, so I'm thanking you in their place :D <3

Reply #218 Top

Quoting Exxcentric, reply 216
been playing your mod for a while now, (i use it to test my mod with, its fantastic! ).

I have had a couple of interesting ideas and was wondering what you thought of them.

1. Is it possible for the AI to follow a human players orders.

ie Pinging. Curently the AI only sometimes responds to a ping. however i am not sure if this is due to luck or it is code. However, when you have an ai on your team, it would be really nice if i was able to ping somewhere on the map and have them rapidly move to this location. Uses of this would be: i would be able to set up ganks, i would be able to retreat and know the tower/myself is covered. This would make for much better multiplayer experience as well, as i would be able to retreat my AI to my/ a teammates location so they cant get pressured all the time and would prevent the silly portal flag ninja that occurs by low level ai (although you have really fixed alot of this problem already, the computer will still sometimes try this. Myself or teammates seeing this occuring would then be able to call the demigod back before it got too damaged. The ping information is already shared, (because it occurs on everyone minimap) so i think that this might be possible. (i will look into this myself but i think it might require a new ai script and i am not familiar with the code for this).

 

I havn't seen anything in the code related to map ping.  The AI has a few actions on sticking together (move to ally, attack with help) and i upped the related goal's priority to increase thier likelihood of doing those actions and working together.

If the Ping is detectable in code it could be a condition of initiating an action (move to X,Y or teleport to building near x, y).   I added simple teleport actions to defend portal flags whenever enemy demigod's get within a certain range, also similiar teleport action when enemies get in a certain range of a damaged ally tower.

 

Quoting Exxcentric, reply 216

2. AI will often go for multiple targets when in groups. Is it possible to get the ai to all focus fire on an individual target (as is done in high ranked play). Ie detect which demigod has the least health, or has taken the most recently (or by a player) and all focus damage on that target.
 

This is already in the attack actions, so they should select the same target, but positioning range to target may give them different targets.   Might be interesting to play with the range it looks for targets to see if they will more often find the same weakest target.  

The attackactions.lua contains the Hero attacks.  They call a target function: FilterRunningAwayUnits, that finds all the heroes not running away and returns the weakest one.

 

 

Quoting Exxcentric, reply 216

3. Set AI to follow mode.

This is probably quite difficult and would need a UI mod as well, but i was wondering if it was possible to set the ai to follow a player.

Bmans godlike team panel can select a demigod and move the camera to the target. Is it possible to use this to select ai demigod and set them onto a follow behaviour?
 

It is probably possible by killing most/all the other movement actions and creating a custom one or expanding the move to ally one to have the AI stick to the player.

 

Quoting Exxcentric, reply 216

4. Is it possible for AI to recognise commands through chat? even something simple like -R tells all AI demigods to retreat to the nearest tower.

Also does the AI have behaviours (ie agressive, passive, defensive) that could be selected throught chat or a UI mod?
 

AI has no behaviours.  Only high level goals that can be achieved through its list of simple actions.   Goals are weighted and the weights can be modified on the fly/continously based many inputs.   Goals near the top of the list tend to have available actions performed.  Goals can have many actions with varrying effect on the goal weight and actions can apply to several/many goals.   Whenever the AI performs an action the goal(s) are reduced by the weights specified in the action.  The AI is constantly trying to reduce the positive weight of the highest goals.

So an example:  There is a high level survival goal.  This goal constantly updates its positive weight by the amount of health the demigod has and damage it is taking at the moment.  There are many actions that the AI will select from to reduce its survival goal (move away from combat, move to ally tower, move to health statue).  Those actions reduced the survival goal.  I forget the exacts, but the first two are small -10 -20, while moving to the health statue is large like -100.

 

Quoting Exxcentric, reply 216

5. Is it possible to assign hotkeys to ai commands: ie = brings up a target console to assign a target for all nearby AI demigods (or even creeps as well).
 

Unless the way the AI functions is changed from Goals + Action picker to more scripted command driven i don't think this would be possible.

Quoting Exxcentric, reply 216

6. I know this isnt in the AI but you have done it for them, is it possible to send chat information about allied human demigods. Ie when humans begin using a capture lock (this will prevent miscommunitcation about who is locking the flag, and prevent the wasting of a caplock). Also could be applied to other events such as pots (prevent sedna healing an ally which is about to heal at the same time).

The AI capping action could have chat added to say it is capping to let the player know and the AI can detect what actions are being done in the area and not CAP a flag that is already being capped.  The code for that is already in for the interupt skills it would just involve filter it down to the capping action and making that a condition of using the capture actions.

Quoting Exxcentric, reply 216

Kinda related to above, I am not sure if you have done much with the minimap ping, but is it possible that when someone teleports it sets off a ping to the intended location? This would be useful as it would indicate to players their teammates actions and would require less manual communication.

Sorry for the big list of questions just was curious

Exx

The Teleport commands can indicate thier target, but most targets on the map don't have useful names outside of the flags.  When i had the chat on it would say teleporting to tower of light 2542 or something odd like that.

Not sure if the AI can initiate a ping, but if it can that would be pretty easy if there is a function to say ping X,Y as the teleport and move functions all have position coordinates.    I don't think you could have this ping and the first ping you asked for (to have them teleport or move to pings) as there probably isn't a way to categorize a ping as one to move to vs one for the player to see where AI's are teleporting.

Reply #221 Top

Not working on any updates at this time.

 

If there are any errors or major weaknesses I will fix them, but don't think there is much left I can change that will have a major impact.

Reply #222 Top

Quoting Peppe, reply 221
Not working on any updates at this time.
 
If there are any errors or major weaknesses I will fix them, but don't think there is much left I can change that will have a major impact.

Yeah - it plays reasonably well at this point.  I agree - please post any big weaknesses you are seeing.

Reply #223 Top

Just had a game with my brother against 8 AIs for a 5v5.

 

Problem is, we went all the way to War-rank 8 and nobody on either side upgraded the reinforcements at the Citadel.

 

Is this normal?

Reply #224 Top

Normally, the AI is supposed to purchase catapults at rank 8, if it has money for it. But not before rank 8 though.

Reply #225 Top

What I meant was that they won't buy priests or angels even though we were at War-rank 8.

 

Unless I'm totally overestimating the usefullness of additional creeps, shouldn't the AI buy the extra help as soon as they are able?