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
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
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)
Bug list (unless otherwise noted, these are all bugs from the original 0.26.35 version)
Enhancement requests (these are changes that folks would like to see happen with the AI)
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.39pacov is learning things… - 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.38removed 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.37bugfix – just resolving a sytax issue
version 0.26.36copy 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.
Lag is a good point. I just tested 2v2 nightmare and 3v3 hard with the 44 version and in 3v3 I had a bad lag which I have never experienced before in ai games.
If you look at the versions from a top perspective. I still say since version 39 it got easier to beat the ai. With the current enhanced ai mod it is very hard to kill a nightmare ai. I usually have one or two kills when I play 2v2 with 3 nightmare ai. Sedna is like unkillable. Mainly because they retreat a battle early. Settings all on normal btw in all my games.
With version 39 you got more kills but the battles felt more like online play as no one really leaves a 2v2 battle at half hp. In the game last night with Dark (think it was version 43) they hardly left a battle and fought til death. With 44 I just had a game 2v2 nightmare where I got 6 kills. Me playing Erb against Sedna and UB. Had a Reg as partner. In the lag 3v3 with version 44 on all hard ai I got 3 kills but I think thats mainly because I played Erb with DA and Occ against UB/Rook/Oak, which I actually wanted to lose so I took the enemy preset and got my partners random and the DA sucks really bad so it was more or less a 2v3 game.
There are a lot of small things to sort out still, like standing around doing nothing or leaving a battle if it could get a kill (think that part is actually better now), but two things are important in my eyes:
1. When does the ai leave a battle or how easy is it to kill it. In enhanced ai it leaves early, in 39 it stayed longer and still does in 44. We see more kills and it didnt use to be like that. Not sure if its more realistic or worse now
2. I had the feeling in 39 the ai did not go past the first tower to cap cooldown/gold flag and then waiting there because of low health for a miracle to happen. I port in and kill it. It does that often in 44 and I had the feeling it didnt do it in 39. There it attacked the tower and after tower was down it went for the flag. This behaviour nets too many easy kills.
On a positive note the endgame seems to have gotten better. In the 3v3 (against UB/Rook/Oak) enemy breaks through to the gold portal and locks it. We go over and manage to get two kills. All 3 stand to get portal back. Enemy has a 10to7 Warrank advantage so already Giants. Rook after it got killed ported to mana flag to make a run for the other portal, build 3 towers right at the portal flag and locked it while UB and Oak came for the portal on HP side to make sure we dont take it back. They actually attacked both portals at the same time and locked them both. We managed to get the HP portal back with 3v2 and Giants but never managed to get the other back and thats why we lost the game. That was a good and realistic behaviour. Hope it wasnt luck.
There have been no changes to when an AI will flee in any of these versions. The only thing that has change is that I've reenabled allowed the ai to attack structures. Peppe did have it commented out... perhaps because it could increase the chance of an AI dying.
heh... me too. You can see yourself that you are seeing some issues with things that haven't really been changed. Keep bringing up whatever you do see though. Could be I altered something that is impacting how long the AI stays, but I don't think so. Only thing I can think is the updated emphasis I placed on using pounce, bite, and pent. Outside of that, it all the same from a fleeing perspective.
copying this over to the enhanced ui thread. Sounds like its related to one of those mods.
Looking into the single general not buying monks thing at start now.
So, here are some test results (no coding change yet)
strange.
trying on hard setting
Ah - I have it sorted. It only impacts a single dg per team and is related to the new savefor function - I'll sort this now.
OK - been mucking around with things a bit - I'm going to leave the current version out there for now. I see what you are talking about w regards to the ai going balls to the wall and not retreating at times when it could now. I believe that mostly impacts just the AI's that I bumped the desire to pent/pounce/bite. I'm pretty sure I need to refine the levels I increased those values to so that they would rather flee than use an ability. Anyway, I think I'm taking the rest of the night off. So, unless I suddenly get inspired, no new release tonight anyway.
MIRI - perhaps you can help with some debugging on this bit. There are a few moving parts - I'll just describe them and you can look at the code if needed:
Desired action: AI with the most gold returns to base at ws2 or anytime after to pick up fs1 if the AI has enough money and the upgrade is available.
How I've been able to make it work (with an undesirable side effect): 1st - the behavior is PRECISELY what I'm looking for. The AI buggers off as soon as ws2 is hit if it has enough money and picks up fs1. If there was another high gold AI, this could result in the AI that just purchased fs1 no longer being the high gold guy - which i like early game. The problem (and note, the behavior is strange and I'm covering it accurately): if the high gold AI is on normal settings and is a general, it will refuse to buy monks. I'm telling it in your table to save for fs1 at ws1 (warrank is required for your table methinks). You'll note, that may sound strange, but its the only way I've found to send the ai back to base at wr2. Anyway, at the start of the game, the priority for fs1 is next to nothing. I only bump it to super high priority at ws2 to keep the ai's from buying it immediately. If I tell the high gold AI to save for fs1 at ws1 (which is not quite exactly what i want - I want the AI to buy whatever it can afford immediately and THEN save for fs1 - your table doesn't allow for that though - if it allowed for warscore as well, I think I could make it work). The AI (kind of) knowing that it needs to save for fs1 will refuse to buy any items that make that purchase impossible... at least at first. The AI then proceeds to buy scaled armor (400) and scaled helm (550). So, its like it iniitially honors the request for 600 gold, then immediately says fu after the 1st purchase (scaled armor) and buys something else. Also, in the log at this point, it indicates that its not saving for fs1. Anyway, its all quite strange.
Anyway, if I set it to save at wr2, the ai waits until it has enough money for cur1 and fs1. Also, the ai will freeze often between ws2 and 3 (which I resolved in testing by setting save for fs1 at wr1 (just no monks).
Anyway, hopefully its clear what I'm looking for. Any help would be appreciated as I've been knocking my head against a wall on this one.
side note - i do believe we need to have the ai buy specific upgrades based on its level and the number of players on its team
MIRI - anyway I can get a count of AI players on my team? Looking to make conditional logic to purchase certain upgrades ONLY IF I have X number of teammates or X number of teammates at X level (by level I mean easy/normal/hard/nm).
playing 1 last test game - then off to bed...
live now
Sorry, but I don't really have enough time to go through and answer every question or issue in this thread, so I'll just address what I remember:
1) Do not use WR1 in the SaveForUpgrades table. This forces the AI to save immediately, meaning it will only purchase cheap items. There is no reason to do this for FS1, as it's cheap enough that a simple Validate.CanPurchaseUpgrade check or a raw gold check in the goal update thread will suffice.
If you've significantly modified the SaveForUpgrades table, post it - the only kinds of things that should be in there are extremely vital, higher-cost upgrades like Currency I (and maybe II), and creep upgrades. You don't want to force the AI to save for too many things or at the wrong times, or you get very undesirable behavior (as with the old system).
The AI WILL buy citadel upgrades that it's not specifically saving for even during a normal shopping trip - they just need to be available (enough gold etc) and high-priority enough. If you're already forcing the highest-gold AI to return at WS2 to get FS1, and the upgrade itself has high enough priority, that should be all you need. It's obviously going to have 600 gold, and there's no reason to try to force it to start saving at the beginning of the game.
2) Anyone testing this mod should be running with a log file (add '/log ..\AILog.txt' to your Demigod shortcut's commandline, which should create an AILog.txt in the main \Demigod folder). If you run into significant problems like stuck AI, serious slowdowns, etc, put the log contents on http://www.pastebin.com and include the link in your post.
3) The stock AI already produces a significant sim/CPU drain, and peppe's version of the mod made this a bit worse due to more checks being run more often. If you've modified timer values, this could be making the problem worse. If there are no significant log errors during test games, then dollars to donuts it's some long sensor/goal update/etc process running more often than it was before.
I would strongly recommend you make external note of any timers or weight values you adjust, so that it's possible to troubleshoot this. If you can't recall which you've modified, it may be worth doing some file compares against peppe's version (at least the _AIAction files, and maybe the unit sensor files).
Getting this information is simple enough, but using it properly is much more difficult. Where would you put the checks for this? It would have to be fully integrated into every part of the shopping decisionmaking process, from goal picking, to saving, to actual item/upgrade priority. Like I said, getting the AI to shop at the right times for the right things really requires a huge overhaul of the goal picking/shopping logic, as having it do dozens of similar checks at every step is not only redundant and increases AI sim burden, but has a chance to produce conflicting results, making it get stuck in a loop like you're seeing happen.
If you're just using this for upgrade/item priority, then it's probably workable, but the information should be cached in a table in AIGlobals anyway.
There is a reason - to get the AI to pick up fs1 at wr2, which is the desired behavior (not during a shopping trip at ws3 and I don't want to rely on the AI getting its arse kicked and sent back to the crystal). The problem is conflicting code. If I raise the priority for fs1 at wr2 and issue a command at ws2 to save for gold, the AI generally doesn't quite understand what do it and freezes (this happens 100% of the time if your table says save for cur1 and I say make item purchase. If it doesn't have enough money to do both, it won't do either. And if I'm only playing with a normal ai as a teammate as soon as ws2 rolls around, its going to be told to save 1800 gold (which it won't have yet) and be told to go get fs1 (600 - it does have). So, the AI is told to go shop... but the AI can't afford to shop because it needs 1800+600. An AI with more money would not have a problem here. Anyway, as long as your savefor system is based on warrank and not wscore, I don't think I can make the change I need to produce the desired effect.
Even if I go the route of setting fs1 to a priority of 200 after, say 60 seconds of game time, the AI would ONLY pick up fs1 if it WAS forced to the crystal before ws2... which is unlikely in a 1v1 situation anyway. Anyhow, I could have a lot more control and flexibility if wscore was a variable in your table.
W/ re: to lag - the only new process that is running (it may sound like I've created a bunch of new conditional statements, but I have not) is the new functions miri helped with (qot shambler fix + savefor upgrades). I don't have the qot change outputting to the log file anymore as that tested fine and I commented it out, but I'm still writing all of your savefor debug info to the log. That, I'd think, could cause additional lag, but I don't know for sure. I'll probably just comment it out in the next release.
I have documented each and every change and it would be easy to mine out with a quick search of "0.26" in any file.
That's what I'm looking to do. I simply want to change the priority levels for a few upgrades (not forcing a shopping trip for them, but dropping priorities for some of the upgrades if there is just a single AI... or perhaps a single normal AI. For instance, if only 1 AI on normal difficulty = true then priority for cur2 = 0, otherwise cur2 =50 or somethign to that effect.
Use a WarScore check to force the AI back to shop just before War Rank 2. The WarScore levels for each War Rank should be in game.lua, if you don't have them memorized. Send the AI back <200 WS before WR2. Also, make sure that shopping condition only happens once, by setting e.g. unit.ShoppedForFS1 to true inside that goal condition, and adding a check to that condition for 'not unit.ShoppedForFS1' so it gets skipped once that AI has been told to shop once. That eliminates any possible loop errors.
I can also add a WS parameter to the save system quite easily that you can use in conjunction with this, to insure that FS1 takes priority over Currency I until after it's purchased. Here's a replacement SaveForUpgrade function that lets you use Score = num inside the condition table - 200 or so should be good for FS1, I think: http://pastebin.com/wAWJyTdt
As for performance, I wasn't trying to sound like your changes are necessarily to blame, but I know how twitchy and convoluted the AI goal system is, and that slightly decreasing e.g. action timers can have far-reaching consequences up to doubling or tripling the amount of sensor and goal assignment work. What I was referring to wasn't added conditions, but rather modified action weights and WeightTimes, which I think you mentioned decreasing in a previous post? That may not be the cause, but if performance is notably worse, that's the first thing I'd check, because it can exponentially increase the amount of work the AI code does, very stealthily.
I can assure you that the QoT action check has very, very minimal impact compared to the rest of the action/goal system at large, and the new save-for system actually has significantly less sim impact than the old one - that was the main reason for the re-write (that, and making it a bit more comprehensible).
Just replace Rank with Score, and adjust the amount appropriately? But I don't know why you'd need to modify the existing ones - they're probably fine where they are, I just added Score capability for FS1. Just shuffle the current indexes up, and add in FS1, e.g.:
Also, here's a function for getting the number of AI on a team, provided a unit:
The count it returns is all AI on the team, including the unit passed to it (assuming that unit is an AI). So it should always be >= 1.
I did some extensive testing today. Played 6 games with different versions but always same setup. Map is Cataract, 3v3 all ai on hard. I play Erb with TB and Oak vs UB/Rook/Oak. I played one game with version 45 then two with 35 (enhanced ai current mod), two games with 39 (still think its the best) and then again a game with 45.
First of all 45 is lagging. I tested a 45 just 1v1 and it was not lagging. I tried to figure out why 39 is harder and the only thing I could find is that UB and Oak have about the same starting hp in all three versions but for Rook is much different. In 35 Rook has 3150 at lv1, in 39 its 3000 and in 45 its 2415. You go out, bite twice and Rook is dead. In my first game with 45 I had 3 kills after 7 minutes and 5 after 11 minutes. Its too easy. I will show a small table with win or loss, what level I was at and the kills and death. Damage, flags, buildings, killed creeps depend on how long the game goes and there isnt anything special.
Version W/L Level Kills Death Assist Total Death of opponents
45 W 14 9 1 5
35 W 14 1 1 1
35 W 14 2 0 8 14
39 L 20 7 8 1 11
39 W 20 3 2 1 7
45 W 17 8 1 0 10
Didnt note total opponents died in the first two games. So easiest to kill by far is version 45. Hardest to survive by far is version 39. 39 was twice the longest game and it was really hard to play. 45 is a walk in the park compared to that. Granted in 39 the TB build is still sucky and thats why I lost the first game as it was Hybrid TB build (in second game it played Fire). In 35 the enemy retreats faster so its very hard to get a kill. That is actually better in 39 and 45 but in 45 its too much.
I have no idea what exactly you changed but I vote for going back to 39, changing the builds (TB, Sedna, still need to work on DA) and put in the new shopping routine and then release. As 39 is hard and fun to play. The other two versions are too easy to win.
Thanks for the in depth testing, sledge. I'm surprised that after the resetting of various dgs spam abilities etc that you still found them to die so fast. That more or less leaves the attacking tower code that has them focus on structures as resulting in them spamming. I'm guessing you still have version 39. I do not. Would you mind uploading that to box.net or somewhere and linking me?
Thanks again for the comprehensive testing - things like this are extremely helpful and the level of detail you are providing is excellent. I think I'll do a comparison of the coding between 39 and the current version. I'm also going to change how some things work that should ensure the AI has better equipment earlier.
If anyone has a moment, I could still use someone testing how often the AI is getting sigils in ver .45. That's a value I want to keep testing until we get to the sweet spot and the ai's generally have a sigil on hand. Maybe I've already hit that sweet spot... maybe not.
Oh -and when you say 45 is lagging, are you talking all of the time, at certain points in time, etc?
Anyway, for now, I'm going to work on integrating miri's changes and work on balance a little bit more. I'm also going to drop the log writing of miri's functions in the meantime as that could very well be contributing to the lag (no idea, tbh). Anyway, hopefully I'll get a chance to release something new tonight or get looking at comparisions between 39 and 45/46.
Just releasing a quick update to see if that helps with the lag issue. Made some minor changes - we'll see if I get a chance to continue on this tonight.
Changelog
New version is live now
If I get a chance, I'll release a new balance change version tonight. The goal will be to having the ai owning much better equipment early/mid.
... ooo - so many changes incoming. Doing some play testing now. Should improve balance a wee bit.
Miri - I'm actually VERY pleased with the changes I've worked into the build I'll be releasing soon. Could you check into 2 bits of code for me? The tb thing I mentioned (if the build is ice, stay in ice form - if fire, stay in fire form - no hybrid build will be used here) and a new request - I want the ai to stay at the crystal until it up to 100% mana. Builds like qot will summon their stuff and take off without waiting for mana to build back up at the start. I want the AI to sit there under all circumstances until its at least 90% mana. Can you help?
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 so I can focus on destroying everyone) - 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.
live now - gimme some testing plz! If I don't go back to focusing on balancing more, I'm going to look into forcing the AI to lock some flags if down in WS next.
OH - and suggest you use HARD AI for tests - that's what I'm going to stick with for now during my tests/builds
quick notes for pacov - for training which flags should be locked - I can do this by map/ws/whatever. I can find the code names for each flag type in flagasset.lua - no lock code there - just names. See captureactions.lua for coding - note folks generally notice slowdown late game - this code could be part of that problem (though I doubt it) - monitor cpu usage after changes made. I should probably queue off of some sort of math like if enemy ws > team ws by > 600, start locking. Human players should get ahead on flag control because they can make better decisions - if this enables the ai to catch up - its easy worth a bit of gold.
http://www.box.net/shared/2fp7zqtzrdbjt3xvb50x
This is version 39.
The lag is there from the start and is always. It moves, then stops shortly and moves again. Like slow motion a little bit. Its only a very short stop though so like a tenth of a second freeze every 1 or 1.5 seconds. This is all for 45, have not tried 47 yet.
Tested two games with 47. No lag. From my point of view the opponents use sigils quite often. As for comparison as yesterday did again a game with exactly same setup and I lost. Think its the TB again.
Was level 14, had 5 kills, 1 death and 2 assists. Opponents died a total of 7 times and none of my pals had a kill. It did not feel like version 39.
My first game was a mirror match with Oak/Rook/UB and the rook is the problem. That was better in 39. It is too easy to kill and the game overall was a walk in a park. Had 5 kills, no death and we easily won.
Try this - it goes at the end of HEMA01_AIActions.lua: http://pastebin.com/JUT8dASF
Upon first run, it gets the AI's skill build name and checks it for a few strings-- fire, ice, and hybrid-- and sets a variable on the unit to one of those three. Then each mode switch action/status function insures that this variable is not the opposite before switching - e.g. if the build mode is 'ice', the fire mode should always return false. This is a gross hack, and it should probably be implemented using ability checks or GoalWeights, but this method is quicker and should work fine as long as the available builds have these strings in their names (they currently do).
I'm not sure I totally understand how the AI picks its current action, so this is tricky. There's an action in /lua/sim/AI/Heroes/Actions/MiscActions.lua called 'ThreeSecondWait - near statue', but I have no idea how it's triggered. I can guess from the Flee goalset that it's only used for a retreat to the statue, in which case, converting it from a 3 second wait to a health/mana monitor might help when an AI general retreats and summons minions at the statue, but I don't know how often that happens (probably almost never? It usually likes to summon on spawn or immediately after losing minions).
Can you be more specific about when this happens (primarily on spawn?), which minions are being summoned (all?), and how long of a delay was between purchasing (if any) and summoning, and summoning and leaving?
I just spent about an hour trolling through the hero action code, and I'm not really any more sure of how actions are picked or how to chain e.g. a wait action onto the end of a purchase action. If you can figure out which MasterGoal(s) the AI is set on when it summons after respawning/purchasing, then it might be possible to just add that MasterGoal to the current statue wait function, and update the function to check health/mana levels instead of just waiting 3 seconds.
Thanks. I will look into your holy grail. I still think the only difference is the attack structure code. I might back that out for one quick version and see if you are back to feeling like its 39 again. If needed, I'll refine the attack structure rules, but I really want them in the game.
Glad to hear my hunch was correct. The lag was primarily due to spamming the log file with info from miri's save function. Kill the log output and lag vanished. Good.
Sorry if you covered this elsewhere, but what specifically made the rook so killable? I can take a look at fine tuning his item build or giving him blood or vial if needed (he uses staff of renewal now). Is it him pushing too much towards towers? Or what exactly? Any specifics help.
Ok good. I gave sigils a very high priority after ws 2 this time around. I thought it might be overkill, but it seems to be doing the trick atm.
MIRI - thanks for the tb code. I'll check that out today and see how it goes.
W regards to the mana thing - yeah, it does the 3 second wait BEFORE summoning any minions. QoT, for instance, will wait at the start, buy whatever she needs, summon a shambler, summon priests and immediately take off after that. So the ideal behavior would be to wait after summon is near a crystal 3 seconds or so.
That said, its fairly minor at the beginning of a game (stupid not to wait, but minor). I might be wrong, but I'm thinking the AI sometimes forgoes the 3 second wait at the crystal on subsequent shopping trips. I seem to recollect the AI buying vlemish and immediately summoning its minions and taking off... This resulted in to going out down about 1700 mana instead of full... think that's what got my attention. Anyway - i'll look at the 3 second wait deal and see if tweaking that helps at all on return trips. I'll provide more info when I come across it again. If you have any more ideas, shoot. But otherwise, thanks for looking into this!
Regarding the Rook it is his total HP. Rook is slow so cant run. If I as Oak show up with more HP than him and no one joins the battle the Rook is dead, as long as he doesnt have a tower farm around him. In earlier versions his HP was higher. I started three games just to see its starting HP. Version 35 3150, version 39 3000, version 45 2415. 2400 is just too low and the rook has around 3.5-4k before level 10. It needs more HP. This seems to be a build issue though.
Lets focus first on non-lag (most important) and standard behaviour like capping flag, leaving battle, buying cit upgrades, getting and using sigils,... From my point of view the TB, Rook and DA build just suck, could also discuss Sedna. But I am more than glad to test the important things with other characters and then we fix the builds. Staff of Renewal for Rook is wrong from my point of view. Should be Vial although that doesnt help with more HP at start either. Could it be that it used to be blood as starting favor?
There are many great features available to you once you register, including:
Sign in or Create Account