The Forums Are Now Closed!

The content will remain as a historical reference, thank you.

Enhanced AI Mod v0.26.35 Release 2/16/2011

By on November 27, 2010 11:12:28 PM from Demigod Forums Demigod Forums

Peppe

Join Date 03/2006
+49

Enhanced_AI_v0.26.35:

http://peppe-dg-mods.googlecode.com/files/Enhanced_AI_v0.26.35.zip

http://peppe-dg-mods.googlecode.com/files/Enhanced_AI_v0.26.35.exe

 

 

AI will work hard to get map control.

AI will actively work to keep portal counts even or in its favor. 

AI will save for critical upgrades like currency, so it can purchase it at or near warrank 3.

AI generals will consider what healer idols the rest of the team owns when making purchases.

AI generals will send one of their healing idols to an AI teammate on summoning (when 2 are summoned) and on teleport.

Locked Post 398 Replies +3
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:04:34 AM from Demigod Forums Demigod Forums

NT

Tracking for later.  Thanks!

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:09:54 AM from Demigod Forums Demigod Forums

 

Some quirks still to saving money money later in the game.  We'll see how your test games go, but i think saving for troops caused the losing team to hang around their stronghold.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:13:02 AM from Demigod Forums Demigod Forums

Should have some time to test tomorrow.  Thanks again for all your hard work and enhancing this mod.  We are getting closer and closer to something rock solid (and then we can turn this into something awesome/challenging). 

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 9:28:57 AM from Demigod Forums Demigod Forums

Quick test results.

Standard Pacov (tm) settings.

UB (human)/Sedna/QoT v UB (AI)/Sedna/QoT

The findings:

(1) I think the upgrade priorities+timing are now correct. FS1 at warscore 700+, XP1 at warscore 1400+, Cur1 at warscore 1700+. So far, so good.

(2) Monk management is much better than in v25n, but still faulty. I ended up with no monks (neither was I sent any afterwards) after I died once, while enemy Sedna was observed running around with 4 (!!!) monks. That said, the AI indeed shares monks after resummoning/porting. The sharing mechanics are very hit-and-miss, though.

(3) AI is still unresponsive to portal capping. Moreover, it seems to affect the AI in a weird way. When I captured the whole lane, the AI just got stuck in the middle, going nowhere (capping priorities conflict?).

(4) AI is fantastically uncoordinated and totally egocentrical It won't help teammates, it won't even pursue a wounded enemy down to 100 hp that just killed another AI, if there is a flag (already captured!) it can stand on. Also, it has pathfinding issues. Probably doesn't take enemy towers and allies into account. Let's say I attack the enemy UB at mana tower. Instead of running to allied Sedna that is standing on mana flag, it will usually run in the opposite direction, getting damaged by towers en route.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 10:21:41 AM from Demigod Forums Demigod Forums

 

Found an issue with the portal recapture this morning.  I had switched it from searching for a nearby flag to calling a flagunit variable that should be stored with the portal itself.   Going back to searching for the flag nearest the portal

 

Monk management may be difficult to coordinate more intelligently than random ally for now.  I could see maybe looping over every minion and find all the healer's follow targets, if they store them, and re-assigning orders some how.  It all gets a little hairy.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 11:14:53 AM from Demigod Forums Demigod Forums

Peppe: Just set a class var on any unit that has a monk attached, with a handle to that monk.  Then check for that when assigning healers, and make sure you check whether or not the healer is dead.  That'll insure nobody gets more than one.  If the unit receiving the healer dies, the class var will be cleared upon his respawn, allowing him to receive another healer when a general summons one.

If you want to get all fancy, you can even add an OnKilled callback to the unit receiving the monk that informs the AI when his healer will be returning to him, allowing him to immediately assign it to another unit.

 

Also, what's the issue with the flagunit handle?

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 11:26:22 AM from Demigod Forums Demigod Forums

 

FlagUnit returns nil in that context. 

 

On the monks, I'm not very familiar with LUA.  Would you just add something to the target unit's table to indicate i have assigned priest to it don't assign another?

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 11:26:36 AM from Demigod Forums Demigod Forums

I also just noticed that your Rook blueprint override is clearing out two of the UberFix changes to Rook.

Remove the HRook_unit.bp, and add this into a mod_units.bp in the mod's root folder: http://pastebin.com/LxzCGk4u

Also, you'll want his Poisoned Arrows ability to compensate for the reduced ROF - right now it's not worth taking, as it will not activate often enough.  Doubled activation chance should be ample - put this in an empty HRook_Abilities.lua in hook\units\heroes\HRook:

Code: c++
  1. Ability.HRookPoison.TriggerChance = 30 --from 15
Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 11:26:52 AM from Demigod Forums Demigod Forums

 

26a:

http://www.filefront.com/17575954/Skirmish_AI_v26a.zip

http://www.filefront.com/17575955/Skirmish_AI_v26a.exe

 

Only the high gold AI per team should save for the critical upgrades (currency, cats, giants).  Updates dynamically so an AI that gets a kill could become the 'saver'.

Portal re-capture on imbalance fixed.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 11:29:55 AM from Demigod Forums Demigod Forums

Quoting Peppe,
 

FlagUnit returns nil in that context.

Huh.. it.. shouldn't.  I'll take a look at the .26 code, and see what's going on.

Quoting Peppe,
On the monks, I'm not very familiar with LUA.  Would you just add something to the target unit's table to indicate i have assigned priest to it don't assign another?

Yeah, just something like 'unit.HasHealer = healer', where healer is a handle to the priest being assigned.  Then check for 'unit.HasHealer and not unit.HasHealer:IsDead()' when trying to assign new healers.

If the unit dies, it gets cleared automatically, although like I said, you might want an OnKilled callback (I can look up how to do that if you want, it's not difficult) on the unit as well, so your general is immediately informed that his priest assignee is dead.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 11:34:39 AM from Demigod Forums Demigod Forums

Welp.  It's FlagOwner, not FlagUnit.  FlagUnit is the class that flags belong to.  My bad.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:04:34 PM from Demigod Forums Demigod Forums

 

Trying to move my rook changes to a mod_units file as you indicated, but getting a syntax error.  Used the code you posted and getting:

warning: 00:00:09: SCR_LuaDoFileConcat: Loading "d:\stardock\demigod\bindata\mods\skirmish_ai_v26a\mod_units.bp" failed: d:\stardock\demigod\bindata\mods\skirmish_ai_v26a\mod_units.bp(4): `}' expected (to close `{' at line 1) near `='

The brackets all match up as far as i can tell.  Not sure why its complaining

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:13:27 PM from Demigod Forums Demigod Forums

Huh, that syntax worked in FA.  Try this: http://pastebin.com/SGK6iYZ2

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:33:33 PM from Demigod Forums Demigod Forums

That is working.  Thanks.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:40:04 PM from Demigod Forums Demigod Forums

26b:

http://www.filefront.com/17576521/Skirmish_AI_v26b.zip

http://www.filefront.com/17576522/Skirmish_AI_v26b.exe

 

Compatibility with uberfix rook fixes.

Tried to dial in suicide rate.

Tweaked range to abort capture flag.

Added assassinate as a goal override when enemy demigods are around.    Should make demigods the primary target in a skirmish.

The AI saving for cats or giants can buy priests and angels.  Helps late game when the other AI's can't afford priests/angels and the saver has done its job and is ready to buy cats.  Once the original saver buys priests/angels it may result in a new AI being the high gold on the team and starting to save for cats.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 1:46:52 PM from Demigod Forums Demigod Forums

Quoting miriyaka,
Welp.  It's FlagOwner, not FlagUnit.  FlagUnit is the class that flags belong to.  My bad.

 

Flag owner still came up nill.  The warning message is commented if you want to continue to search for the equivalent value to the findflag table.  If the search for the flag bugs you

Line 56 #WARN('Flag unit' .. tostring(captureFlags[1].FlagOwner))

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 2:40:13 PM from Demigod Forums Demigod Forums

Just getting through my first couple full games. Very hard for me to not see something i want to tweak and go edit some files and restart the game, so i don't get to see a lot of end game action.

 

With current settings a single normal AI is a little too poor to get cats and giants right when they come available.  

A couple things that may help: let priests and angels be purchased earlier?  warrank 7?  Then a random AI may buy these upgrades for the saving AI.

Gimp the single saving AI even more and have it save 10200 needed for priests, angels, cats.  Currently it saves for Cats (4800)  This AI would probably need to start saving a war rank earlier.

Split the upgrades across all AI's on a team and have them save individually for their upgrade?

There is not a forced shopping trip at warrank 8 and 10 like there is at 3 for currency.   If the timing of these is super critical i can add a forced trip.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 4:28:00 PM from Demigod Forums Demigod Forums

 

.26c

http://www.filefront.com/17577318/Skirmish_AI_v26c.zip

http://www.filefront.com/17577323/Skirmish_AI_v26c.exe

 

Troop upgrade shared responsibility between AI's.  If there is one AI it will save the full amount for priests, angels, cats starting at warrank 7. 

  • A single Normal may not get money fast enough for this.  Will need to test.

If there are two one will save for cats and the other will save for the other two.

Forced shopping trip for the savers at warrank 3, 8, and 10.   The AI(s) that can afford currency or troop upgrades should return to base promptly (run or teleport).

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 6:03:35 PM from Demigod Forums Demigod Forums

Wow

 

+1 to both of you again! Great work

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 7:36:22 PM from Demigod Forums Demigod Forums

update the op when you get a chance to reflect current versions - show's b

 

AI skirmish (mod version) .26c/uberfix 1.03RC4

Settings:  Cataract/High Towers - all other settings on default
AI settings:  normal

rook (human)/ub/da/ v rook/ub/da

Observed results:

First shop for both AI's on my team looked good (got banded/scalemail)

after geting sent back to back once pretty quickly, my ub went to crytal and left... then turned back around and actually shopped

Watched the ub on left side of map then for a bit... we already owned the mana flag, but he then ignored the tower closest to him and walked towards a tower closer to the gold flag and attacked that (taking damage from the closer tower and the one he ran up to spit on).

Sidenote - the ai bought FS1 BUT did not announce it.

AI did announce buying xp1.

one ai saved and bought currency (as you designed) - worked perfectly.

other sidenote-  wish there was a way to get the AI da to use swap intelligently.

AI tp'd in once to try to save its portal (good).  And attempted to retake the portal somewhat aggressively (good).

I noticed the ai had priests at 6 while we had them at ws 8.  I'm wondering if you have things coded that the 2nd any team hits level 8, then the ai should prioritize buying creeps (instead of going on a team by team basis).

Overall - it was a pretty good experience this time around. 

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 8:20:16 PM from Demigod Forums Demigod Forums

The AI attempts to match the enemy team's creep upgrades.  If your team had priests first, the enemy team is gonna buy them ASAP.  Same with angels.  This is just to keep the creep situation from being utterly and completely one-sided.  In addition, if one team has higher WS and has cats+, and the enemy team doesn't have high enough WS for cats of their own, they will attempt one or two levels of creep armor or damage upgrades.   This should work just fine now that one of them will be saving for cats and giants.

The exact priority numbers of the creep armor/damage upgrade code could stand a second or third set of eyes.  Same for the Treb priority when the enemy team has cats.  Treb function also needs to be checking fort quantity; e.g. they should never buy trebs on Cataract, because it only has one fort per team.  This is really simple, I just didn't get around to doing it yet.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 8:47:04 PM from Demigod Forums Demigod Forums

other sidenote- wish there was a way to get the AI da to use swap intelligently.

I knew the AI probably wouldn't use this skill well when i put it in.   Hope to get around to skill and item usage once we have a good core. 

I can edit the conditions to use abilities.   I haven't looked at DA's yet, but pretty much all skill actions could use some attention.  Most of the default conditions are: is the skill available Yes/No -> Do we have the mana for it Yes/No -> Is there a target Yes/No -> Use skill.  

For swap I was thinking of making it check for nearby ally demigods.  If there is one maybe move to it and then use swap? 

I've edited a couple way back in the .22 and earlier releases, so some AI's stop firing skills to save them for a situation.  I think i set oak to save enough mana to shoot one penitence if a specific setup occurs.  UB will save his grasp for a low health target or target trying to use a TP/pot if i recall correctly.

 

From what i saw today.  defaults, AI vs AI, 3 on 3 cataract.   Normal AI's can stalemate eachother for a long time.  I left the game running and went to the store and came back to find them still fighting with roughly equal map control an hour + later.   We may need a warrank 8+ portal capture action that ignores everything along the way and just runs for an enemy portal to try to get a portal advantage.

Took a look at the retreat pathfinding.  Couldn't find anything too useful or moddable.  The move functions don't seem to be in LUA?  Its idea of a safe path isn't always great.

I didn't mention it but i relaxed the conditions on the teleport to tower with an enemy demigod near it.   This could be considered a gank action, but the AI's need to be carrying TP's and not be occupied for it to come up.  Occasionally 2 or all 3 will get it at the same time and if there is only one enemy by the tower I have seen them get a nice kill.

 

I discovered a bug I am fairly sure is in the base game.  Going to make a mod to test it shortly.  The AI shop validation function is broken for all idols.  When the AI buys an idol of the category it already has it just replaces the IDOL.  So the AI loses out on money from selling back old idols.   On my local copy I fixed the check, so the AI can't do that, but it doesn't have any logic to sell existing idol and replace with the new one.  It also doesn't check the idol its looking to buy's priority against the idol it already has.   So I am going to have to do all that.  

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 8:53:00 PM from Demigod Forums Demigod Forums

New attempt at treb priority function (CUpgradeStructure01): http://pastebin.com/rvQbUwTx (new link, posted the wrong one)

Takes into account your forts in all decisions; less than 2 friendly forts and it will always be zero.  In the case of Trebs vs Catapults, it starts at 15 priority and multiplies by number of forts.  4 forts, and this should end up above most item priorities.

In the case of trebs vs enemy trebs, it takes into account the number of enemy forts, starting from a base priority of 2.  So 2 friendly 2 enemy would be 8 priority, still below most items.  4/4 will put it at 32, which might be more than some items.

Note that it also has a gold threshold modifying its priority, which means an AI that just barely has enough gold will have its priority multiplied by ~0.1 or less, and the AI has to have twice as much gold as it costs before it gets the full priority.

 

Also, it looks like the proper troop upgrade matching conditions got removed at some point.  That's why the enemy team might end up pre-buying Priests and Angels, which ain't so good.  Here's what I've got on file - it's pretty much the same, except it only considers enemy upgrades, rather than enemy war score, which keeps the lower WR team from pre-buying: http://pastebin.com/eaxMTZW7

 

Also, in case you haven't figured it out (it took me a while), pastebin screwed up the ability to copy code from the rendered portion of the page a few months ago, and it now adds random newlines with #s in them.  You have to copy it out of the text box now.  Argh.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 8:55:15 PM from Demigod Forums Demigod Forums

AI skirmish (mod version) .26c/uberfix 1.03 (last version published by miriyaka)

Settings:  Levi/High Towers - all other settings on default
AI settings:  normal
4v4

rook (human)/ub/da/sedna v rook/ub/da/sedna

Observed results:

intial builds solid again.  saw sedna micro a monk to a random dg.

fs1 was bought in a timely manner AND message appeared this time.

Cur1 was bought in a timely manner.

Another thought - maybe have the AI say exactly who bought the upgrade (UB - Currency 1 bought). 

Or perhaps a message that says - UB - Saving for currency.

annoying thing I noticed - me and another dg killed 1 on the other team.  That dg drops a health pot.  The dg on my team WITH FULL HP took the health pot while i was at 50% hp.  Maybe a function could be built so that if a nearby ally has less hp, then the ai won't pick up the pot?  I don't want the ai to just leave the pot alone if no one is there and he doesn't need it, though.

big flaw observed on levi - though - the ai didn't care enough about its valor flag and didn't care enough about defending its citadel.

Reason for Karma (Optional)
Successfully updated karma reason!
November 28, 2010 8:57:06 PM from Demigod Forums Demigod Forums

The 'saving' happens every time a demigod shops.  It isn't a specific thing, really, it just does the one with the most gold currently.  So that would be pretty spammy.

 

Doesn't the AI say who bought the upgrade now?  Pretty sure it has some identifier attached to it.  If it's not their nickname, just change it to that (brain.Nickname).

 

Edit: I'm kind of confused as to how ShouldSave works right now.  What's the intended path for a 2-demigod team after Currency; highest saves for the next big upgrades (cats or giants) and the other saves for priests+angels combined?  And then a 3+ team has one non-highest saving for just angels?

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108432  walnut2   Server Load Time: 00:00:00.0001312   Page Render Time: