pacov pacov

The Updated Enhanced AI Mod Thread

The Updated Enhanced AI Mod Thread


Updates:

Public version 1.03 live 1/18/2012 at 6:07 PM EST


 


Download links:

Link to the latest version PUBLIC version of the mod:  http://www.box.net/shared/g8lbbhpojik4tbkjn6su


I created a post that tracks the history of the AI in Demigod and it covers a good chunk of the development that has already been handled by the modding community.  If you are interested, see over here for more details:  http://forums.demigodthegame.com/409712

The Project

Using the last version of peppe’s AI mod (0.26.35), I’ve started development on updated versions of the AI mod.  I’ll be releasing those versions here, tracking bugs, enhancement requests, rebalancing, etc.  I won’t be adding a new version to my combined DG installer until we make a decent amount of progress or come up with some sort of significant enhancement to justify a new release to the community at large.  It took us a long time to get reasonable adoption rate on the existing ai mod – I’d rather not force folks to redownload the bundle over and over.

The Project Team

  • Project lead:  pacov
  • Lead design/coder:  pacov
  • Lead support:  miriyaka – without miri, the majority of the changes we are looking at would not happen
  • Testers:  sledge, plaguewraith, and darkliath 
  • Contributors:  Lord_Orion

If you’d like to help in any way, we are happy to have you on the team.


Current status (what’s being worked on)

  • Build updates (removing inefficient builds and replacing them with new ones) - complete
  • Reprioritization of citadel upgrades, items, trips to the shop - largely complete - some late game tweaking still possible, but its improved quite a bit
  • Implementing a fix for AI’s with summonable minions so that they do not waste mana summoning more after the have created the max number of minions (miri created some code and I’m looking to make it work)  Resolved in 0.26.41
  • Recoding the ShouldSave functionality to improve the coding efficiency and gives us additional flexibility.  If we get this working, it will be a very solid improvement and provide more options.  - this has been implemented

Bug list (unless otherwise noted, these are all bugs from the original 0.26.35 version)

  • Stuck AI – the AI can get stuck on occasion for > 30 seconds
  • Poor scaling based on AI difficulty - this has been improved but there is still room for improvement
  • Not enough shopping trips for the AI unless it is killed or sent back the base with low HP (eg an AI could have 10k gold and still not attempt to shop and get better items) - 1 forced shopping trip at wr 4 has been added... might be good to do more, but much better now.
  • AI is not always getting fs1 in a timely manner (resolved in 0.26.39)
  • Some abilities are not being used as often as they should (a sedna, for instance, with pounce as her only ability would use it once in a blue moon) - continuing to make improvements (pent/pounce/grasp/deep freeze have all been fixed)
  • Some abilities are being used at inappropriate items and wasting mana as a result
  • Customized settings often throw the AI off.  For instance, if you set a game to being at WR10, the AI don’t shop (not sure if we want to try to code this to cover all possible settings) - improved some.
  • AI standing around at the shop at the beginning of the game (introduced in 0.26.38 – happens randomly and seems to only impact 1 ai on a team) - resolved in 0.26.40
  • Not truly a bug, but something I want to change - need to make it so the high gold dg can still buy things for themselves (resolved in 0.26.49 "siesta")
  • AI considers minions as part of a DG's army... this is good and bad - its good to target healers from time to time, but if I can make an enemy target a shambler while I'm wailing on him...

Enhancement requests (these are changes that folks would like to see happen with the AI)

  • Better healer distribution.  The over all goal would be to ensure that monks/clerics/etc are sent to appropriate players.  The basic code works fine, so this is a lower priority change imo.
  • Improve da’s shadow swap usage – plaguewraith suggests removing it completely from his build (might be a good temporary solution until we can tackle this) (removed 0.26.55)
  • Better creep farming with skills.  Plaguewraith indicated that he never saw a tb use circle of fire to farm.  This is something we could tweak, but we’d need to think it through
  • Lord-Orion suggests we remove all ub builds except for Spit/Ooze life - REMOVED 1 OF THE BUILDS 0.26.40 - still 2 left
  • Lord-Orion suggests we optimize all builds for skill dmg output as the AI cannot currently rationalize like a human can. 
  • Lord-Orion suggests we go with a basic item prioritization of 4 life/1 helm builds – I agree to some extent… (pretty much done as of 0.26.52)
  • Come up with a way for the ai’s to intelligently chain stuns or interrupts to go for kills.  In theory, the AI could be even better than a human at this if it was tied to precise timing
  • Teach the AI to teleport for ganks (this could be tricky – would probably result in a lot of pointless tp’s)
  • Find a way to help the AI manage mana better.  Early game the ai’s are almost always out of mana
  • Teach the AI when to shop!  (big improvement with 0.26.49 "siesta")
  • Have the AI always engage a simple enemy opponent if on a flag if hp is good, etc
  • Have the AI choose to engage towers on a regular basis (improved a lot since 0.26.54)
  • Have the AI refuse to run past towers in most circumstances and instead TARGET THE TOWER if no dgs around
  • Improve cataract map logic – the ai often goes into the middle of the map instead of staying in a lane.  This is probably due to the proximity of the creeps when the ai is working on capturing the middle flag (or if all flags are controlled by their team).  Ideal behavior would be to try to capture the middle flag and if its already controlled, then get into a lane on HP or Mana.
  • Override the flee functionality if there is an enemy dg and its likely possible to get a kill
  • Better decision making for flags – Ai heading over from mana side all the way to Hp without capturing mana.  this is likely due to flag weights… just not sure why it didn’t evaluate hp as the priority initially – could be some conflicting code?
  • Send the AI back to base if its low mana (sledge) – We might do something for this, but it would have to be a conditional statement – perhaps add a check to see if they are at low mana around X Ws have > X money, then run back and prioritze getting a helm as an override
  • Plaguewraith suggests removing mist from erb’s build – I’m not sure about this yet.  He says remove it or build a routine to cause erb to use it just to get rid of negative buffs – I agree that we could use a routine like that.  - mist removed in 0.26.40
  • Encourage the AI to react quickly if they are losing a flag that is near 2 or more towers (eg gold flag)
  • Increase the frequency that the AI picks up sigils – not sure about this one – I agree a good player should generally have one, but the AI might just blow a lot of money casting when it doesn’t need to and fall behind as a result.  Perhaps this becomes a conditional statement to raise the priority after ws X (0.26.47 - implemented)
  • Add an override so the ai will only go for flags like gold if the tower is down.  Add another override so the ai doesn’t go for portals early (probably WS related)
  • plaguewraith – delete the tb builds and just stick with 1 fire tb build - REMOVED 1 BUILD - only pure fire and pure ice remain 0.26.40

Change log

version 1.03
-Created new UID
-Adjusted hero/squad targeting values to increase AI skill use aggression
-Adjusted range cutoff multiliers to mitigate the chance of the AI from running past towers to cap flags
-Adjusted/fixed errors in Oak, Queen of Thorns, Unclean Beast, Regulus and Demon Assassin AI builds
-Re-enabled Sedna Pounce build and Queen of Thorns Shield_Spike build
-Homogenized AI build names so it is obvious what skills the AI is using.

version 0.28.00 BETA
- removed unclean beasts AA build as the Spit ooze build is generally a little better

version 1.02
- created new UID and incorporated all changes since version 1.01

version 0.27.09 BETA
- Disabled a substantial amount of logging (will result in a substantial performance boost for many)
- added miri's scenario name capture function to CommonUtils.lua (doesn't work now, but isn't being called)
- began to tweak ub's usage of ooze.  Reduced health activation from >= 40% hp to >= 30%.  Also reduced the deactivation health value from < 40% to < 30%
- reenabled the attack override in herogoap
- updated the flee mastergoal to set at 50% HP instead of the current 75% hp
- Added an action time to health pot usage to hopefully keep the AI from using a pot at lower HP, having the pot bring them up to full strength and then having the ai immediately sigil

version 0.27.08 BETA
- Added new action and instant status function in useitemactions to keep the AI from "double locking" flags (eg wasting locks on a flag that is locked)

version 0.27.07 BETA
- increased sigil activation health % from 45% to 50%
- added new hammerslam calculate rates function - should increase the odds that rook will slam if the unit is stunned (should work for any type of stun)
- rebalanced weights of rook's actions to bring them more into logical numbers
- rebalanced weights of erb's  actions to bring them more into logical numbers

version 0.27.06 BETA
- reduced sigil activation health % from 50% to 45%
- changed orb of defiance usage check so that it will consider using it before sigils
- removed grunt check on orb of defiance (previous the AI would refuse to use use the orb if the threat level was < 15)
- added nearby enemy hero check to orb of defiances - if no enemies nearby, then orb will not be used
- reduced the value of narmoth's ring on the AA ub build so that it is not choosen as the only item at the start of a game on nightmare difficulty
- reduced the captureflag override at the start of the game from 60 seconds to 40 seconds
- disabled the attack override to allow the ai to make its own decisions based on weight
- Reduced the reteat values if there are nearby enemy heroes and towers from 85% to 75%
- modified rules for dg vs dg fights.  AI will run if there are more enemies than allies present

 version 0.27.05 BETA
- removed the nonworking per map flag settings
- revised the generic flag settings
- disabled all existing rook builds
- added new "more balanced" hammer slam tower build

version 0.27.04 BETA
- continued to enhance the documentation in heroGOAP
- added new logic to provide a count of heroes/enemies in heroGOAP for decision making
- added rule so that the AI's goal will flee if 3 or more enemies are present vs 1 ai
- changed default value of gold and portal flags to 0.5
- increased unit.movecutoffrange from 1.2 to 2.5 in attackactions
- fixed a problem with da's new swap logic
- continuing to test out flagassets.lua - I don't think values are being loaded for each map

version 0.27.03 BETA
- removed erb's desire to cast stun as an interrupt as its not possible
- increased erb's desire to bite
- increased oak's desire to use surge to kill units
- removed sedna's desire to use silence as an interrupt as its not possible
- added comments to heroGOAP to try to track where the AI is getting stuck (NOTE - this could slow down some lower end pcs)
- added new logic to count the number of grunts near a hero for decision making purposes - previous check was based on threatlevel
- changed the balancing capture flag logic so that the AI will re-prioritize capturing flags if there is a difference of 50 in warscore
- changed AI's desire to buy capture locks from WR 4 to WR 6 - AI will not purchase them prior to WR 6

version 0.27.02 BETA
- major revamp to DA's swap ability - da will now only swap if the number of allies is > enemies near da
- disabled existing DA build
- enabled STANDARD_ASSASSIN da build (eg what most players use when playing da) now that swap is working as desired
- disabled pounce sedna build

 version 0.27.01 BETA
- updated TB's frost nova so that it is used more often

version 0.27.00 BETA
- created new UID - this is done so folks can still keep the release version 1.0 installed and try out new "beta" versions and help with testing, etc
- added additional documentation to AIGlobals.lua
- adjusted the saving routine so that angels are not saved for until ws 7
- changed the way the AI evaluates additional shopping trips.  Now based on warscore
- fixed a minor bug with reg's mark of the betrayer squad target
- added additional shopping trips (see details below)
    # SHOP PERIODS
    # Warscore >= 300, AI with most money, possible to buy fs1, at least 600 gold
    # Warrank >= 3, AI with most money, possible to buy cur1, at least 1800 gold
    # Warscore between 2450-2575, NOT AI with most money, at least 1500 gold
    # Warscore between 3100-3225, AI with most money, at least 1500 gold
    # Warscore between 3800-3925, AI with most money, at least 1500 gold
    # Warscore between 4150-4275, NOT AI with most money, at least 1500 gold
    # Warrank 8 OR AI already bought the upgrade, priest/angel/cats available, AI can afford the upgrade
    # Warrank 10, possible to buy giants, AI can afford the upgrade

version 1.00
- created new UID
- removed any "pacov" labeling
- changed name to Enhanced AI (peppe's original version was Enhanced_AI
- updated version name to 1.00 (numbering convention will be 1.00/1.01/etc going forward)

 version 0.26.56 (misc fixes + pounce sedna build is live)
- removed CaptureFlag goal weight from oak's pent functions
- removed CaptureFlag goal weight from rook's hammerslam functions
- removed Captureflag goal weight from tb's deep freeze functions
- removed CaptureFlag goal weight from ub's grasp functions
- removed ub's mygraspstatusfunction and replaced with DefaultStatusFunction
- removed oak's myPenitenceStatusFunction and replaced with DefaultStatusFunction
- removed sedna's myPounceStatusFunction and replaced with DefaultStatusFunction
- substantially increased sedna's desire to pounce
- re-enabled sedna's pounce_tank build

version 0.26.55
- fixed a bug that still allowed demon assassin to pick up swap
- fixed a bug with unclean beast's grasp code
- enabled new hammerslam/tower rook code and tweaked desire to hammerslam
- increased sedna's desire to pounce (did not re-enable the pounce build yet)

version 0.26.54
- removed the remaining demon assassin build and added a new build without swap per request
- reworked the valor flags weight.  Should be less desirable for AI prior to ws 8
- tweaked deep freeze to be cast much more often
- re-enabled ai priority to attack structures.  Tweaked the formula so the AI will immediately back off if any enemy dgs come into range.  This should reduce the odds of death and also keep the AI from wandering past towers for the gold flag, etc

version 0.26.53
- increased artifact weight so they will be kept if the AI purchases
- added mageslayer to the generic equipment purchase list with a priority of 110, moved godplate to 120
- enabled oak to cast surge when trying to flee

version 0.26.52
- substantially increased the odds that oak will attempt to interrupt
- removed demon assassin speed_spine build
- re-enabled the graveyard level 1 upgrade
- minor misc changes
- changed ai's desire to pick up locks from level 3 to level 4

version 0.26.51
- rebalanced the general equipment builds
- rebalanced the specific demigod equipment builds
- removed AI's desire to purchase any graveyard upgrades
- removed "cloak of invisibility" from artifact prioritization as the item does not exist

version 0.26.50
- Reduced priority from 35 to 20 for boots of speed on UB HP/ooze build to keep the AI from purchasing boots of speed as the first item if the AI is set to normal
- increased priority of grofflings plate in the general build
- substantially increased ub's desire to grasp in game
- updated flag goal for cataract to reduce the AI's desire to grab the valor flag early (eg the AI running to the middle of the map)
- increased ice tb's goal to make it use deep freeze more often (tb's abilities all need a bit of an overhaul)
- various item selection tweaks

version 0.26.49
- changed desire for flag locks to increase at wr3 instead of wr4
- adjusted AA ub build so that it will never choose mana items (unbreakable is still acceptable, though)
- implemented the "siesta."  At warrank 4, any ai (not the high gold AI), will return to base to shop as long as they have 1500 gold.  Then, towards the end of wr4, the AI that is the highgold AI will shop alone. 

version 0.26.48
- added miri's check to force the tb to stay in whatever mode its build is designed for.  This should improve the AI's usage of abilities tied to the pure ice or fire builds.  Confirmed that fire tb will stay in fire form and ice in ice form based on build.
- continued to balance item selections
- Changed Rook's favor item to blood of the fallen
- TEMPORARILY turned off the attack structure code

version 0.26.47
- made MANY balance changes - all changes are noted in the files, but too many to detail here (so I'll cover highlights)
- changed ideologies for the mod.  Before the goal was to force the AI to do everything I wanted it to do (simply buy cit upgrades) - now I'm planning on having it scale that back and focus on becoming an arse kicker
- odds your ai will have a sigil is MUCH higher - this improves survival odds ALOT
- ai will always purchase fs1/cur1/priest/angel/cats/giants - that's it.  AI will no longer get any levels of experience.
- ai will VERY OFTEN have locks - I still need to teach the AI how to use locks better though... so at least for now, it will have them...
- MANY item prioritization changes - If you understand the modding side of things a wee bit, there are 2 ways a dg chooses equipment/items:  1 - a general list that contains all recommendations.  2 - a list that is specific to demigod build.  I spent quite a bit of time improving the general list today and started working on the 2nd method that includes build specific items.  I've only started on QoT, but I will likely get her to mimic my standard QoT build for items.
- removed some additional checks to help reduce overhead of the AI

* note - I have not begun to force shopping trips on the AI outside of fs1/cur1/priest/angel/cats/giants.  I'll be looking to start phasing in shopping trips to encourage the ai to get even better items as appropriate.  AI will still shop if it gets its arse kicked, but I want to schedule some trips so the AI will get stronger at different intervals even if its doing fine.

version 0.26.46 (the getting back on track version)
- added miriyaka's changes to the save function so that we can evaluate based on warscore as well
- added saving for fs1 as a priority after ws 200
- updated value for fs1 to increase its priority to 200 after ws 300
- removed log writes from miri's savefor, etc to see if that helps the lag issue that's been mentioned
- confirmed - the generals will now choose monks if they are a normal ai with default settings (instead of saving for fs1)

version 0.26.45 (the lesser of two evils/back to basics version)
- the title gives you an idea - if you play on normal settings with 1 general ai, they will NOT purchase monks at the start.  This is not desired behavior.  But in allowing this, the AI does not freeze between ws2 and 3 for any extended duration.  Sadly, the other option right now is you get monks, but the ai stands around like an idiot at ws2.  
- Added additional documentation for the herogoap file
- disabled the trip to the shop for ws 5 to get cur2
- developed basic test code to send the ai to the base if its not the high gold ai
- backed out the changes that increased rate of fire for bite/pounce/pent.  We'll visit this again, but I'm concerned that the ai is overriding their flee function due to the high priority I put on these abilities resulting in more pointless deaths.  My goal is to simply make them use their abilities more often... not die like goofs.
- tweaked the rules for purchasing sigils.  AI will not buy them until ws 2 and only if the AI has a max health > 2750
- removed assassin sedna build again until I get back to sorting pounce

 version 0.26.44
- hopefully corrected a bug that would cause the ai wait around to purchase an upgrade if it did not have enough money of the ws for it.  This should give us new opportunies for balancing upgraded in the future.  The short version is I updated HeroGoap perform a check if the ai can afford the upgrade they are saving for before heading off to the shop.  Not enough money = no shop.  I'll be looking into explicitly sending specific ai's to shop on some sort of interval in the future
- (not a real change... but started deep dive into integrating miri's savefor function)
- removed cur2 shopping trip for now - it still gets a high priority, though

version 0.26.43
- added miriyaka's save for gold functionality
- disabled ai goal chat function from herogoap 1198

version 0.26.42
- substantially increased the rate that erebus uses bite
- substantially increased the rate that sedna uses pounce
- re-enabled assassin sedna build now that pounce is used more often
- substantially increased the rate of oak's penitence
- added another shop period at ws 4 - the ai with the most goal should head for base a 4.  This might result in a different dg being choosen for highgold after

version 0.26.41
- added miriyaka's summon shambler fix.  The code would work for QoT, Sedna, and Oculus.  I'm only implementing it for QoT as this would be a disadvantage for the Oculus build and sedna does not use yetis in the AI mod
- Removed anklet of speed from all TB builds and replaced with Blood of the Fallen.  The ai is not smart enough to use a speed fire tb build
- Removed the file mod_units. This contains fixes already in uberfix and is not needed here
- Enabled master goal chat - this is a debug function that broadcasts what the AI's goals are - you might find this annoying...
- Re-enabled code that adds a destroy structure goal for the AI.  Peppe turned this off at some point... probably for a good reason, but I did see the AI being more aggressive attacking towers, so I'm leaving this on for now.
- Made some adjustments to the flag weights on cataract.  This SHOULD end dgs running over the the mana flag at the start and then rushing to HP before they capture the mana flag.  Reduced the weight of the gold flag to encourage the ai to attack structures first.  Reduced the value of portals prior to ws8.
- Removed all oak builds and added a new shield/pent focused build
- Minor change for reg's build - added impedance bolt at level 16 instead of stats 1

version 0.26.40
- removed the code that placed a limitation on what items could be purchased at the start of the game (AIShopUtilities 736-741)
- Changed the priority level trigger from WarScore to WarRank for fs1 (AIGlobals 1433) - this appears to have resolved the ai's standing at mid issue.  The Ai will purchase fs1 at ws2 now correctly
- Changed AI's priority to get xp2-xp4 to 0.  AI will no longer purchase these upgrades
- removed mist and added coven 1 as erb's level 2 skill until we get a chance to write a routine for him to use mist to remove negative buffs
- Updated ai priority values for minotaurs to 0/5/10/15 (eg an ai will never buy the 1st level minotaurs now) - I was seeing the ai pick this up as a cheap filler if they have the money - not worth it
- Updated ai priority values for level 1 archers - dropped from 15 to 0 so the ai will never buy
- updated ai priority values for hauberk of life - dropped from 40 to 35 so that unbreakable would be chosen over this if money was available
- updated ai priority values for unbreakable - removed conditional formula and set to a static 39
- removed ub skill build spit_ooze_mana (essentially bots ub)
- removed hybrid_fire_ice build from tb (bots tb)

 version 0.26.39
pacov is learning things… :O
- reprioritized AI to purchase fs1 at ws2.  Previously, it only purchased it if made it back to base with enough money; this forces it back to base to get it if no one else has
- raised priority for currency 2.  Logic mirrors currency 1 as I want this purchased every time.  Also sending ai with the most gold to purchase at ws 5.
- removed assassin sedna build until I have a chance to look at the pounce training – assassin sed should be pouncing left and right… right now its like once in a blue moon – heal_tank sedna is solid though

version 0.26.38
removed unitstatussensors code – concerned it might be causing an issue
- tweaked erebus build so that he gets mass charm later – he’s not using it well as is

version 0.26.37
bugfix – just resolving a sytax issue

version 0.26.36
copy of peppe’s version 0.26.35
- removed 3 old sedna ability builds
- added 2 new sedna ability builds
- removed old qot ability builds
- added new qot ability build
- removed 2 old erebus ability builds
- added 2 new erebus ability builds
- uncommented some code peppe developed in UnitStatusSensors that might help resolve the frozen dgs
*note – all builds that have been added by me will be announced in team chat at the start of the game and will say “pacov” folowed by the build name.

1,458,473 views 458 replies | Pinned
Reply #426 Top

Quoting TcoNL, reply 426
The game is also suddenly abit laggy/shocky. Only since the last week. Might try a game in the future without this mod.

As it stands, you should experience some additional lag using the beta version of this mod.  That's because I'm writing quite a bit of additional information out to the log file, which can cause a bit of slowdown on some pcs.  I'll probably remove a huge chunk of that logging for my next release, so you'll more than likely see a pretty big improvement in performance. 

ps. Lock = capture (attempt)?

Nope.  Capture = capturing a flag so that your team controls it.  Lock means to use an item called a capture lock that makes it so no one else can capture the flag for 45 seconds.  You can find those in the item shop for 250 gold.

Reply #428 Top

ok miri

Started to work on adding the new grab scenario name logic.  I'm hitting some issues.

First, I have the CommonUtils.lua file setup correct and in the right folder, etc.

The log message that I added to flagassets is throwing an error, though.  Here's the message:

warning: 00:00:17: Error running lua script: ...dgdata.zip\lua\sim\ai\strategic\assets\flagasset.lua(547): attempt to concatenate a boolean value
         stack traceback:
             ...dgdata.zip\lua\sim\ai\strategic\assets\flagasset.lua(547): in function `FindCaptureReward'
             ...dgdata.zip\lua\sim\ai\strategic\assets\flagasset.lua(378): in function `initfn'
             ...ardock games\demigod\dgdata.zip\lua\system\class.lua(258): in function <...ardock games\demigod\dgdata.zip\lua\system\class.lua:246>
             ...ames\demigod\dgdata.zip\lua\sim\ai\strategicgoap.lua(295): in function `AddFlag'
             ...ames\demigod\dgdata.zip\lua\sim\ai\strategicgoap.lua(332): in function <...ames\demigod\dgdata.zip\lua\sim\ai\strategicgoap.lua:329>

Here's where I added your code to flagassets:

Code: c++
  1.     # Capture reward - this is how important the brain thinks it is to hold this point
  2.     FindCaptureReward = function(self, flag)
  3.         LOG("FindCaptureReward:"..self.FlagName..": Scenario Name: "..import(&#39;/lua/common/CommonUtils.lua&#39;).GetScenarioName() or &#39;none&#39;)
  4.       local brainName = self.Brain.Name

Any ideas?

 

With regards to the ub using ooze like a goof issue, I reviewed the code.  I actually think the problem is related to the stuck ai crap.  The rules for turning ooze on and off are pretty simple.  I'm updating them a smidge, but I don't think that will solve any problems.  The bottom line for turning off ooze is if the ub has < 30% HP or if the threat level in the area is <= 5.  That means if there are no creeps around, etc.  I did notice that even if the threat level was <=5, if the ai was "stuck" it probably won't turn off ooze.  Anyway, that's what I'm thinking atm.

Reply #429 Top

I've some games with the mods since 0.27.06 and it seems that the AI stuck increased. There are more stuck since 0.27.26 with I guess has something to do with:

- disabled the attack override to allow the ai to make its own decisions based on weight

Sometimes I saw the AI stuck for up to 2 min at the shop, something it did not do before 0.27.06.

Concerning 0.27.08

- Added new action and instant status function in useitemactions to keep the AI from "double locking" flags (eg wasting locks on a flag that is locked)

This seems to work, as far as I can tell.

Still it's strange that the AI don't use a lock after capturing the enemy portal flag but AI immediatly uses locks when recaptured it's own portal flag and nobody is near. It should be the other way around.

 

Concerning 0.27.07 and higher

- added new hammerslam calculate rates function - should increase the odds that rook will slam if the unit is stunned (should work for any type of stun)

The Ai don't use that ability as often as it could but AI Rook does it quite often I think. But I can't tell if it's really doing it at higher priority to stun targets. I could imagine this is due to the frequence the AI is making decisions and a 2 sec stun is just too short.

The best combo I saw was boulderroll --> AA --> hammerslam.

Another thing is that AI Rook seem to use boulderroll and hammerslam somewhat randomly. For example, it hammerslams and then boulderolls an opponent.

- rebalanced weights of erb's  actions to bring them more into logical numbers

It's somewhat strange that AI Erebus starts using that ability quite often at the beginning but I can't remember it used MC lategame. It often just AAs exept Batswarm was used from time to time it seems.

 

Concerning 0.27.06 and higher

- changed orb of defiance usage check so that it will consider using it before sigils

This is working I think. Saw AI Rook use this ingame several times (was the first time ever I guess ^^)

 

Concerning 0.27.04 and higher

- fixed a problem with da's new swap logic

DA still uses swap with no great effect and it's difficult to jugde if it has improved. It still seems to be almost senseless.

I'd suggest that DA should only use this ability at maximum range? Maybe it gets nice effects just by luck?

 

 

You (and Miriyaka I think) talked about a way to increase the speed the AI calculates actions. But it was not considered to be handy because it could slow the game down. But have you ever tried to do that? Maybe the AI could improve by that. I've seen the AI stuck while getting attacked at that is not the way it should be.

Also it may be a way to get the AI use boulderroll and hammerslam in a combo or DAs swap and then immediatly warp toward the target.

 

I experience lags too, when I increase the game speed (which I often do if I just watch the AI playing) due to the new logfile work.

Can you tell us where to disable that? I had a quick look but I don't know where to search and gave it up. ;-)

Reply #430 Top

Thanks for another test, plague.  I'll make some time to give some feedback.  Next version (released tonight or tomorrow) will have all of the logging disabled, so there shouldn't be any slow down for you folks.

Reply #431 Top

re: orb - yeah, I think I sorted that pretty well.  I don't remember if peppe had an override or not, but it was not prioritized above sigil.  So, that is fixed and orb should be useful going forward for any ai that picks it up. 

Re: erb mass charm - play some more games and let me know.  Mass charm isn't designed to just trigger asap or anything.  Set criteria is still required... he just doesn't try to use stun every time its available.  All I did was force him NOT to try to interrupt, which miri and I confirmed was impossible.  I could pretty easily refine the code further.

 

Reply #432 Top

Quoting Plaguewraith, reply 430
You (and Miriyaka I think) talked about a way to increase the speed the AI calculates actions. But it was not considered to be handy because it could slow the game down. But have you ever tried to do that? Maybe the AI could improve by that. I've seen the AI stuck while getting attacked at that is not the way it should be.

There is no way to do this without re-writing huge swaths of code, so it's not a simple matter of 'trying' it.  The decisionmaking speed has nothing to do with why the AI gets stuck anyway - that's almost certainly caused by something forcing it to continue a faulty goal or course of action when it should not.

 

Re: Hammerslam/Boulder Roll, make sure Boulder Roll has something like 1.5x the base GoalWeights of Hammerslam, and make sure they both use exactly the same GoalSets.  Consider bumping the Hammerslam CalculateWeights' stunned weight multiplier from 2 to 3 (or even higher - so it uses HS instead of an auto-attack action).  It is likely that some significant portion of stuns may go un-caught (much like with the previous interrupt code), but the more it's using Boulder Roll, the more likely it is to successfully hit with Hammer Slam anyway.

 

Re: code errors, something's obviously not working in the mapname mining code, so I'll have to add some log messages to that to see what's up.

Reply #433 Top

Quoting miriyaka, reply 433
Pacov - something's obviously not working in the mapname mining code, so I'll have to add some log messages to that to see what's up.

ok - as you find time, thx!

Reply #434 Top

Quoting miriyaka, reply 433
Re: Hammerslam/Boulder Roll, make sure Boulder Roll has something like 1.5x the base GoalWeights of Hammerslam, and make sure they both use exactly the same GoalSets. Consider bumping the Hammerslam CalculateWeights' stunned weight multiplier from 2 to 3. It is likely that some significant portion of stuns may go un-caught (much like with the previous interrupt code), but the more it's using Boulder Roll, the more likely it is to successfully hit with Hammer Slam anyway.

I can try to re-tweak based on your recommendations. 

Reply #435 Top

Another match done.

In the beginning they entered "our" area and died because they chased our hero's all the way to the regen point and later they just wouldn't die. Though bastards. :p

What I noticed a lot was that the enemie often took one of the spawn portals at the very bottom and my a.i's did nothing to get it back. And at warrank 10 (noticed it at one point but didn't think of it again) we still haven't bought priests. Also had to buy currency and pretty much most stuff myself.

Reply #436 Top

Quoting TcoNL, reply 436
And at warrank 10 (noticed it at one point but didn't think of it again) we still haven't bought priests. Also had to buy currency and pretty much most stuff myself.

hmm... this doesn't make sense.... something must be broken.  I'm really not sure why I didn't have that issue when testing as I always give it 1 play through before posting a new release.  hmmm....

I'm going to go out on a limb here... are you sure you actually have the mod enabled?  I'm betting you do not... just saying.

Reply #437 Top

version 0.27.09 BETA
- Disabled a substantial amount of logging (will result in a substantial performance boost for many)
- added miri's scenario name capture function to CommonUtils.lua (doesn't work now, but isn't being called)
- began to tweak ub's usage of ooze.  Reduced health activation from >= 40% hp to >= 30%.  Also reduced the deactivation health value from < 40% to < 30%
- reenabled the attack override in herogoap
- updated the flee mastergoal to set at 50% HP instead of the current 75% hp
- Added an action time to health pot usage to hopefully keep the AI from using a pot at lower HP, having the pot bring them up to full strength and then having the ai immediately sigil

live now. 

Reply #438 Top

some quick thoughts (many random, but perhaps of interest to miri)... I've been trying more than a few things to try to alleviate the stuck dg crap.  No real success atm.  A few findings.

That first capture goal override in herogoap ONLY WORKS if you have the captureaction 'capture anything' enabled.  I mention this as I've been thinking about overrides, etc. 

The flag weights... I still don't think these work super well.  Perhaps a bunch more testing is needed.  I can inflate the hp flags value to 1000 or whatever and the ais will still split up between flags... I think this might have to do with how the initial load takes place.  I'm not sure though.

Anyway, something is up with how they are loaded.  I even set a log message in flagassets and it appears as if they are loaded (eg my log message is spammed several times - load my mod and check the out message (something like flag weights loaded).

The timeout on any of the capture actions is 30 sec... think that might contribute to some the standing around like idiots problem.  The attack and ass functions are like 3 sec.  I get why having a higher number might be good at start...

I tried a few experiments - I disabled all of the overrides except flee.  I increased the master goal value for assassinate to see if the ai would attack on its own.  It did strange things.  It would  run up to attack, then run back immediately... didn't test with the goal info debug going, but it probably got a new goal.

I post more here if I think of it and have time.  I've tried QUITE a bit more than this over the past 3 days or so. 

Reply #439 Top

I've been lazy to write something here, sorry for that.

I've played several games with the AI or just watching it, but I haven't made any notes so I try to recall the things I experience.

- I experienced no more lags, regardless of game speed

- I won't say that UBs usage of ooze has really improved, still it use ooze sometimes when there is no necessarity for it and it's sometimes not used if it would make sense.

- Stucks are still happening. I remember a version were it was less, unfortunately I can't tell which version it was- :-(

I've made some games on prison too, just of being curios. UB got stuck at the citadel for at least 5 (approximately more) minutes against Rook until the game was over. It was behind in warscore, so it could be a conflict of waiting for income to get a citadel upgrade.

Just a quick thought: Maybe stucks appear more often because some goals have the same weight? (I don't mean the citadel stuck here)

- The fleeing routine does not work sometimes. DGs just fight until defeated or even just stand idle near towers and get killed. I had a look at that routine in the files and it seems fine to me. Something overrides it from time to time.

- capturing flags should be the main goal (exept for fleeing) but sometimes the AI overdoes it when going for flag where a lot of towers are near. Maybe it is possible to override that if towers are still up? Another way would be to tell the AI to just go for certain flags until a certain WR is hit? The AI tries to rush the portal at 8 so there has to be a mechanism that may be improved? For example, the valor flag on cataract seems to lure the AI from time to time.

- Whenever a DG shows up, the AI engages it regardless of towers around or health of the enemy DG. It is easy to exploit that if the AI just stand outside tower range. I'm not sure if possible but it shouldn't stand there at all. The flag would be the better option then.

- Sometimes a DG gets idol just near a flag but without capturing it, because it is just out of range. Rook does it better then, because he idles shortly sometimes but then goes to the flag to plant a tower.

- UB sometimes runs around with 4 items. Last time I saw it, it purchased Godplate later. I'm not sure if other DGs do that as well, but I haven't seen it there.

- Skill usage seems to be fine. But sometimes there are game, where the AIs don't use any skill. A game on prison (UB vs Rook) both didn't used any skill like boulder roll, hammer slam, spit or grasp. Next game all went fine.

 

 

Reply #440 Top

version 1.02
- created new UID and incorporated all changes since version 1.01

 

Reply #441 Top

Suggestions for AI mod now that I spent the weekend playing with it

1) Hard difficulty isn't hard enough, and the gap between hard and nightmare is too much.
I'd say that Hard as it is now should be normal difficulty, because I am able to at least match the AI's gold production and soundly trounce it regardless of demigods on each side.

The new hard should be 1/2 way in AI cheating between the current hard and nightmare?

2) Please for the love of god remove the UB build that does not use spit, it is terribad in the hands of the AI.

Reply #442 Top

Quoting LORD-ORION, reply 441
The new hard should be 1/2 way in AI cheating between the current hard and nightmare?

Hard is +50% cheating, Nightmare is +100% cheating.  The only exception is in starting gold, where Hard gets +100%, and Nightmare gets +300%. +75% everything would make it almost as good as nightmare, and leave little difference between the two.  If you don't find Hard challenging, then you should always be playing on Nightmare, rather than try to bring Hard nearly up to Nightmare level, because other people might find that Hard provides an appropriate challenge for them.

It'd be nice to be able to add another difficulty level between them, but doing so would require a dgdata.zip-replacement lobby mod.

 

Sorry I haven't been doing much contributing to this lately - I'm a bit burned out again.  For when I get back into it, refresh my memory of what needs to be worked on other than the map-specific flag rewards (and/or figuring out whether flag rewards even factor correctly)?

Reply #443 Top

Quoting LORD-ORION, reply 441
2) Please for the love of god remove the UB build that does not use spit, it is terribad in the hands of the AI.

I'm still not sold.  Heh.  I know what you mean.  I just happen to find AA ub to be much more challenging after he's acquired a better kit.  He's the only dg that we have that currently goes for an AA kit - and it does add some guess work every game re: what type of ub you are up against (at least for a little bit anyway).  I find ooze ub to more effective mid/late and spit ub more effective early/mid.  Keep requesting it be removed and I probably will before too long, anyway. 

If you don't find Hard challenging, then you should always be playing on Nightmare, rather than try to bring Hard nearly up to Nightmare level,

That's my opinion as well.

Sorry I haven't been doing much contributing to this lately - I'm a bit burned out again.

I haven't exactly been inspired lately either.  Seems to me that the remaining issues would likely take hours and hours to sort. 

Reply #444 Top

Quoting OMG_pacov, reply 443

Quoting LORD-ORION, reply 4412)
If you don't find Hard challenging, then you should always be playing on Nightmare, rather than try to bring Hard nearly up to Nightmare level,

That's my opinion as well.

Playing on nightmare is mostly pointless, the AI has such a high starting kit and regen that you cannot overpower it fairly or do auto-attack builds, you have to exploit its stupidity. I understand that is the point, but that gets tiresome.

Playing on hard is the opposite, the AI generally gets kit at the same rate as me so I can usually overpower it every single engagement, so that should be "normal".

So make it 65%-70% cheating but keep the 100% gold, that would probably be fine.

There is a tipping point where you are so out geared that you have limited options on how to fight the AI, so Nightmare is not really "fun". Hard is just a tad too weak to be "fun".

 

Reply #446 Top

Public version is what you want.  1.02 - should be linked in the OP. 

Reply #447 Top

Had a few more minutes than I expected, so I created a new beta version.  Nothing special here - just removed the ooze UB build.

version 0.28.00 BETA
- removed unclean beasts AA build as the Spit ooze build is generally a little better

Reply #448 Top

FYI - I believe that the last version I'll release is 0.28.00 BETA.  It may or may not be promoted at some point to the official non beta version, but I don't have any intentions to continue development.  I welcome anyone that is willing to put the time in to take the project over.   Otherwise, I think this may be as good as the AI will ever get.  Thanks for following along and for everyone that took the time to test and provide feedback!  Hope you enjoy the AI mod!

Reply #449 Top

Quoting LORD-ORION, reply 378

Quoting miriyaka, reply 373By failing I just mean it will skip that action.  If the AI has multiple actions in its current goal plan, it will process the next one.  In the case of DestroyStructure, there probably won't be any other viable actions in its plan, so it will attempt to re-choose a goal and/or re-formulate the action plan.  Nothing bad will happen, unless the AI is being forced into a given goal and therefore limited selection of actions by external forces that don't take into account a similar target range.

Sorry, I meant bad from the perspective that it is not engaging towers when it should. eg: Fail to engage tower when it 1st comes in range, run past to cap flag.

I switched all the long range cutoff multipliers from 1.2 to 1.4 in AttackActions.Lua

As I thought, this prevents the AI from running past towers to cap flags, because they'll trigger a tower attack before coming in range of a flag to try and cap that.

They'll still do it once in a blue moon, but only when they wipe out a creep wave while just outside of a tower, because then the next flag is in range to trigger this behavior instead of attacking the tower.

DA also needs a higher chance to attack a tower with his Spine Attack, he rarely does it.

 

Reply #450 Top

Interim 1.03 Build

Solved a problem with AI skill use aggression
Re-enabled Sedna's Pounce Build (since she will pounce aggressively now)
Solved a problem with the AI running past towers to cap flags (it's not perfect of course)

Please give it a go and provide feedback for any problems.

If it looks good, this will be making its into the package.

Thanks