The Forums Are Now Closed!

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

AI Skirmish Mod, v. 24 (more tweaks- 9/9/2010)

By on September 9, 2010 5:21:14 PM from Demigod Forums Demigod Forums

the_hunger

Join Date 05/2009
+9

This mod (version .24) is the latest revision of Peppe's AI Skirmish mod (https://forums.demigodthegame.com/369930).  It further refines Peppe's excellent work by addressing a few outstanding issues.  The mod is designed to make single-player skirmishes more challenging and enjoyable. 

(This version of the mod incorporates some of miriyaka's code for checking team status and upgrades, which makes the gameplay more dynamic and "human like.")

Additional Features and Changes (v. 24)
 
 

            -AI demigods upgrade citadel health (fortify structures upgrade) based on war rank and the percentage of health that the citadel has loss due to enemy attacks.  AI demigods will buy trebuchets and Finger of God based on whether the enemy team has catapults or war rank of 9 or higher (creeps are still the highest priority).

            -Teams start buying creeps at war rank 8 or when the enemy team reaches war rank 8.  So even if a team has less than war rank 8, it will try to get priests and angels if the opposing team has achieved war rank 8.

            -AI demigods will dynamically buy Armory and Blacksmith upgrades based on war rank, the creeps its team has, and the creeps that the enemy team has.  By war rank 10, AI demigods will try to buy all Armory and Blacksmith upgrades.

            -Tweaks to flagassets file that makes AI demigods more aggressive for portals after either the allied team or enemy team achieves war rank 8.  Also, makes AI demigods fight for portals well after giants show up.

            -AI demigods will now only buy capture locks after their team or the enemy team reaches war rank 7.  At that point, capture locks become a high-priority consumable and are used for locking portals and the reinforcement (fortitude) flag.

            -Teleport scrolls become a higher priority for AI demigods by war rank 7 (they are a high-priority consumable throughout the game).

            -Added new hammer slam/tower spam build for AI Rook.

Known Issues (v .24):

  • Occasionally starting Regulus, Oak, or Unclean Beast in the number 2 slot on either the Light or Dark team will result in the demigod not leaving the health crystal at the beginning of the game.  I am not sure why this is, and it does not occur every game.  The solution is simple: Don’t place any of these three demigods in the number 2 slot.
  • On a few maps (like Cataract), AI demigods can be overly aggressive about going after portals in enemy territory.  Generally, AI demigods are good about avoiding enemy towers and staying away from tower-protected portals.
  • This mod is best played on Nightmare difficulty, with the Conquest win condition, and with 2v2 or larger teams.  However, the AI improvements apply to other difficulties and win conditions.  Unfortunately, the AI in the single-player tournament is unchanged.

Installation:

Place the Skirmish_AI_v24 folder in your Mod folder in your Demigod game directory.  This is usually found in C:\Program Files\Stardock Games\Demigod\bindata\mods.  After starting the game, go into the “Mods” option and enable the mod.  Be sure to disable any previous version of this mod.

Disclaimer:

The core code of this mod belongs to a guy named Peppe, who apparently no longer frequents these forums.  The Demigod modding community is in his debt for improving the AI of this game.

Download:

Get version .24 of the Skirmish Mod at: http://www.filefront.com/17277395/Skirmish_AI_v24.zip/. Download includes mod folder and readme.

 

--------------------------------------------------------------------

.23 Changes: 8/16/2010

  • Teleporting: AI demigods will no longer teleport very short distances.  Demigods are likely to carry at least 1 teleport scroll, but a little less likely to carry more than 1.  Generally, AI demigods teleport more intelligently.
  • Flag Capturing: Greatly increased desire of AI demigods to capture and hold flags for warscore.  Also, coded custom flag-capturing routine for most maps.  AI demigods battle for flag control more and are more aggressive at capturing portals (and recapturing their own portals and other important flags).
  • Tweaked AI builds for Rook and Regulus.

 

.22 Changes: 2/08/2010

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

 

.21 Changes: 2/07/2010

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

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

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

 

.20 Changes: 2/03/2010

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

 

.19 Changes: 1/25/2010

Mainly Stun/Interrupt Changes.

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

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

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

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

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

 

.18 Changes: 12/15/2009

Sedna Heals earlier, @75%

QoT Casts shield earlier, @75%

Some flag cap changes.

 

.17 Changes: 12/14/2009

Sedna build changed.

Minor changes to survival goals.

Flag capture range extended.

 

.16 Changes: 12/13/2009 Mark II

Minor changes to Teleport distance check and consumable item priorities.

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

Sedna Item priorities changed.

Locked Post 54 Replies +3
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
September 10, 2010 7:38:23 AM from Demigod Forums Demigod Forums

Looks pretty good.  If there's a way to determine whether or not an AI is set to Nightmare (this might be somewhere in AIBrain, but I haven't checked), or better yet, how many are on a team, it might be worth re-introducing both death penalty I-II and gold II-III - both are brutally effective for a team full of nightmare AI.

 

Poked around for a few minutes, and figured out how to get an AI's difficulty:

Code: c++
  1. ScenarioInfo.ArmySetup[unit:GetAIBrain().Name].Difficulty

ScenarioInfo should be a global table accessible to all of the AI files.  Difficulty is an integer from 1 to 4, 1 being easy and 4 being nightmare.

Reason for Karma (Optional)
Successfully updated karma reason!
September 10, 2010 9:48:33 AM from Demigod Forums Demigod Forums

Quoting miriyaka,
Looks pretty good.  If there's a way to determine whether or not an AI is set to Nightmare (this might be somewhere in AIBrain, but I haven't checked), or better yet, how many are on a team, it might be worth re-introducing both death penalty I-II and gold II-III - both are brutally effective for a team full of nightmare AI.

I agree, miriyaka.  Would you be willing to work this into the mod?  If you would send me the revised version, I would be happy to post it at Filefront with a new link in the description above.

Reason for Karma (Optional)
Successfully updated karma reason!
September 11, 2010 2:03:52 AM from Demigod Forums Demigod Forums

-AI demigods will dynamically buy Armory and Blacksmith upgrades based on war rank, the creeps its team has, and the creeps that the enemy team has.  By war rank 10, AI demigods will try to buy all Armory and Blacksmith upgrades.

I don't think that's the best choice.  A good rule of thumb is to get one level in Armory and Blacksmith by level for each player on your team

In a 2v2 game, maxing out Blacksmith and Armory is a poor idea, because that is a LOT of money that could have been used to buy a powerful artifact that would make a significant impact on flag control.

However, in a 5v5 game, the burden of purchasing all 8 upgrades in total is very much distributed, and so it may not be a bad idea to get it. 

Even in a 3v3 game I wouldn't get more than 2 levels each. 

Reason for Karma (Optional)
Successfully updated karma reason!
September 11, 2010 2:23:49 AM from Demigod Forums Demigod Forums

Thanks again for working on this, hunger.  Glad to see more enhancements to a great mod! 

Reason for Karma (Optional)
Successfully updated karma reason!
September 11, 2010 2:25:19 AM from Demigod Forums Demigod Forums

Side note - make with the karma, ya bums.  He's enhancing a mod that makes the AI not a POS.  This is great content!

Reason for Karma (Optional)
Successfully updated karma reason!
September 11, 2010 5:53:52 PM from Demigod Forums Demigod Forums

Quoting awuffleablehedgie,

-AI demigods will dynamically buy Armory and Blacksmith upgrades based on war rank, the creeps its team has, and the creeps that the enemy team has.  By war rank 10, AI demigods will try to buy all Armory and Blacksmith upgrades.


I don't think that's the best choice.  A good rule of thumb is to get one level in Armory and Blacksmith by level for each player on your team

In a 2v2 game, maxing out Blacksmith and Armory is a poor idea, because that is a LOT of money that could have been used to buy a powerful artifact that would make a significant impact on flag control.

However, in a 5v5 game, the burden of purchasing all 8 upgrades in total is very much distributed, and so it may not be a bad idea to get it. 

Even in a 3v3 game I wouldn't get more than 2 levels each. 

Thanks for the feedback, awuffle (and the karma, Pacov!).  That's a reasonable suggestion.  In the next version, we can remove the third and fourth upgrades for Armory and Blacksmith, or make them very low priorities. 

Reason for Karma (Optional)
Successfully updated karma reason!
September 11, 2010 8:46:54 PM from Demigod Forums Demigod Forums

One thing that might be useful to try in testing would be seeing how the ai skirmish mod works if its enabled in a 3v3 all human game.  Assuming a player dropped, having smart ai would be VERY beneficial, but I frankly don't know if the ai would automatically start behaving according to the way the mod is coded, if it would just do crazy shite, or what. 

Reason for Karma (Optional)
Successfully updated karma reason!
September 12, 2010 7:56:54 AM from Demigod Forums Demigod Forums

It's perfectly doable to scale upgrade priority based on the number of players per team, further weighted by AI difficulty levels.  Some time this week, I'll try to make some functions that do this, and give examples of how to implement them.  As I said in the other thread, I'm not entirely sure exactly which upgrades should be considered when, although I find that with these settings, the AI very rarely gets Blacksmith and Armory II+ unless it's already dominating.

If anyone can think of similar conditions that might make some upgrades worthwhile, let me know.

Reason for Karma (Optional)
Successfully updated karma reason!
September 12, 2010 11:11:23 PM from Demigod Forums Demigod Forums

Can you check which forts you have to allow the AI to decide to buy trebs or not?

eg: On crucible, if you have centre forts, you should buy trebs. If you do not have the centre forts, you should not buy trebs.

Can you check if you have a general on your team or not? No general? If XP1 and gold 1 is bought, and you have your standard item load (nimoth, vlemish, unbreakable), you should buy cit priests. Or whatever condition someone thinks is better.

Those are the only out of cata routine things I can think of for cit upgrades. When you can buy early priests and trebs. 

That also leads to, if you have early priests, you should start armory and blacksmith before rank 8.

If you have trebs, FS2 becomes an idea. 

Reason for Karma (Optional)
Successfully updated karma reason!
September 12, 2010 11:26:59 PM from Demigod Forums Demigod Forums

Never buy units on Exile?

Reason for Karma (Optional)
Successfully updated karma reason!
September 13, 2010 9:04:31 PM from Demigod Forums Demigod Forums

Yes, and yes.  Checking demigod types on a team is easy (I already have a function in the file for doing half of this), as is getting a quantity of surviving forts (you'd have to check for sufficient war rank first, of course).  I haven't yet had time to work on this further, but I haven't forgotten about it.

Reason for Karma (Optional)
Successfully updated karma reason!
September 17, 2010 7:25:28 PM from Demigod Forums Demigod Forums

Keep up the great work    Karma for you!

Reason for Karma (Optional)
Successfully updated karma reason!
November 7, 2010 8:10:26 AM from Demigod Forums Demigod Forums

This is amazing, especially for all us LAN players out there! Thanks so much, keep up the great work. My suggestion is to have allied demigods occationally group up with each other to take towers and get kills, and to improve the point at which they run. As it stands, they occationally do this well but most of the time they wander around alone and fight way past the point of no return.

 

Regards,

Violetsreason

Reason for Karma (Optional)
Successfully updated karma reason!
November 16, 2010 3:35:04 PM from Demigod Forums Demigod Forums

 

Disclaimer:

The core code of this mod belongs to a guy named Peppe, who apparently no longer frequents these forums. The Demigod modding community is in his debt for improving the AI of this game.

 

I checked in on the forum every few months.  Didn't mean to abandon the community I got burned out on the mod and then real life took priority.   My father and mother in law were both diagnosed and treated for cancer this year.   Both have responded to treatment and things are starting to get back to normal, so I may be around a little more.

 

Today was the first time i thought about playing in a long time and with a new skirmish AI version out I will have to play.  

 

The code belongs to the community.  I had always hoped others would contribute and it is very nice to see new releases come out of the base I built.   The mod appears to be in good hands.  Hope to contribute again in the future.

 

 

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

I checked in on the forum every few months. Didn't mean to abandon the community I got burned out on the mod and then real life took priority. My father and mother in law were both diagnosed and treated for cancer this year. Both have responded to treatment and things are starting to get back to normal, so I may be around a little more.



Today was the first time i thought about playing in a long time and with a new skirmish AI version out I will have to play.



The code belongs to the community. I had always hoped others would contribute and it is very nice to see new releases come out of the base I built. The mod appears to be in good hands. Hope to contribute again in the future.

Really glad to hear from you again, Peppe.  Sorry to hear about your father and mother in law.  I'm also glad to hear that they are both responding to treatment.  Hope life slows down a little bit for you.  Thanks again for all your contributions on this mod. 

Reason for Karma (Optional)
Successfully updated karma reason!
November 18, 2010 4:23:46 AM from Demigod Forums Demigod Forums

 

One of the things I was frustrated with in my last go around was not being able to mod/edit anything outside of skirmish games.

 

I have tinkered with it tonight and have found a work around to get the game to load modded files from anything in dgdata.zip. 

 

To verify I modified auto-fill in the skirmish lobby to put nightmare AI's in with no issues.

 

I tried to get the skirmish AI to load in the tournament mode, but some revisions will be needed to the skirmish files since the modded files are no longer hooked, but loaded directly by the game.  Hooked files have access to all the functions of the parent they replaced and in some cases use different syntax (replace an existing instance vs creating it).

 

I don't know if we will be able to share this, but the method i used to get this working was:

Extract the LUA folder and Units folder from dgdata.zip to the demigod bindata folder.

Delete LUA folder and Units folder from dgdata.zip.

Launch the game - it will give you a popup with the MD5 it is looking for an the current MD5 of dgdata.zip.

Open the demigod.exe in a hex editor.  Search for the md5 it is looking for and replace it with the current MD5.

You now have a neutered exe that will load custom files from the bindata\lue and bindata\units folder.

Mods can then be applied directly to those folders.   You could remove other files from dgdata.zip, but most mods only affect those two folders.

 

Doubt you can go online with this.  Game should either give an error, push a new exe to you, or push a new dgdata.zip.   But you could certainly create a separate folder for offline fully modded game.

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 18, 2010 7:05:53 AM from Demigod Forums Demigod Forums

Yikes.  Yeah, that's a bit of work.  I experimented a bunch with trying to get a lobby-level mod loaded, and even got the game to mount additional zip files and folders with a modified retailpath.lua, but it refused to actually hook or use the lua files in them.  All of this was possible, even easy in SCFA, so I assume this change is some kind of safety measure added to insure against desyncs or exploits.

The moddability progression of FA -> Demigod -> SC2 is not a good one, but supposedly Kings and Castles will have 'full' mod support again...

Reason for Karma (Optional)
Successfully updated karma reason!
November 18, 2010 12:21:35 PM from Demigod Forums Demigod Forums

 

I got the idea from reading sorian's old posts.  In beta they did not have a md5 check on the dgdata.zip file, so to mod all you had to do was edit the files in there directly.  For release they added the checksum.

 

For multiplayer they probably had to ensure people were using the same files, but they could have added a command line argument or something to let the game load from alternate paths to allow us to mod everything.

 

At any rate i got the .24 AI running in tournament mode.  Letting it play in the background to verify stability and whatnot.   I had to touch almost every file to update syntax or uncomment code. 

 

I enjoyed tournament mode a lot when i first started.  You could sit down and get a lot of verity game to game without having to setup each individual game. 

 

Thinking of just playing some tournament mode for a while

or

Should  I tinker with custom tournament settings.  Changing the hard coded settings for the default tournament should be easy... might even be able to create new buttons and have them launch different tournament types.  Maybe have all the AI's  be the same difficulty, so there is competition for score at the end.

or

Should i just flush out some instructions and release it as is?   I'm thinking I cannot include a modded demigod.exe in the release, so the hurdle to use it may be too high for most. 

or

Maybe I can put my hex editing hat back on and try to modify the zip file it looks for.  Then you can have a modded exe look for a modded dgdata.zip folder.  Use normal exe for online play use the modded exe for single player skirmish/tournament mode.   That would be a something just about anyone could install and use.

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

Anyone want to test this out?

I created a modded exe that loads a modded zip file.


1. Extract contents of Skirmish_v24_TE.zip file to your demigod folder, ex: D:\Stardock\Demigod
2. Go to demigod\bin folder and run Demigod_skirmish.exe to play.
3. It may best to deactivate any other installs of skirmish AI in the mod manager.


Demigod_skirmish.exe is a modified Demigod.exe that loads dgSKIR.zip instead of dgdata.zip.
The skirmish AI is in dgSKIR.zip and will automatically be active in any game mode.

 

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 20, 2010 3:24:13 PM from Demigod Forums Demigod Forums

 

New release of the tournament edition of skirmish AI. 

 

I have to port back the change files to the mod version, but with some testing i think it will warrant a release of that version as well.

 

Tournament Edition:

Skirmish AI active in tournament mode.

Tournament mode has now 5v5.   Hard is player+ hard ai vs hard ai.  Nightmare is Player + Hard AI vs Nightmare AIs.

Auto fill in lobby fills nightmare ai's.

AI is locked into specific goals for about the first minute.

After the first minute if the enemy team has more flags than the AI it will go capture some to get back to balance.

May have fixed the stuck AI issues at the start, but need more test cycles to confirm.


Install--

1. Extract contents of Skirmish_v24_TEb.zip file to your demigod folder, ex: D:\Stardock\Demigod
2. Go to demigod\bin folder and run Demigod_skirmish.exe to play.
3. It may best to deactivate any other installs of skirmish AI in the mod manager, but initial testing showed no ill affects.


Skirmish AI will be active in all game modes (tournament and skirmish).  

Demigod_Skirmish.exe is a modified Demigod.exe that loads dgSKIR.zip instead of dgdata.zip.

 

I have a growing honey do list, so I won't get a mod version out for a day or two.

Please test and submit feedback.

Reason for Karma (Optional)
Successfully updated karma reason!
November 20, 2010 3:43:13 PM from Demigod Forums Demigod Forums

Peppe - could you clarify one thing for me.  You might have indicated this elsewhere, but I want to be sure.  Is your mod based on the_hunger's updated version of your mod or did you scrap the changes he made and go back to your last release?  Just want to know.  Thanks. 

Reason for Karma (Optional)
Successfully updated karma reason!
November 20, 2010 5:11:40 PM from Demigod Forums Demigod Forums

I started from the_hunger .24 release.

 

For the release above i did disable one capture action as I thought it might have been causing the stalled start for some demigods (regulas and oak sitting around for a minute or two), but don't think it was that in the end.  The remaining two capture actions seem to be more than enough to keep the AI on top of the flags though.

 

On the opening script i just meant what should the AI be looking to do.   Went forward with a simple shop, start capping.   If the neutral flags are all gone and the flag situation is even the ai will act how it used to and do random stuff.  If the flags are in the enemy favor the AI will go capture a flag.  

 

I think for this release i may have left the experience multiplier off for the different difficulties.  I was trying to get the leveling even in tournament mode.  Let me know if the AI's level too slow.   The part I removed should only apply to tournament mode, but let me know if skirmish mode leveling is off. 

 

I have a couple hours to run some games and see whats going on.  The game I did early was 4v4 nightmare AI's and after 25 or so minutes each AI had ~15 flag captures. 

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 20, 2010 9:05:38 PM from Demigod Forums Demigod Forums

 

I think I have a stable release for tonight:

 

Skirmish Mode Version - http://www.filefront.com/17538636/Skirmish_AI_v24c.zip

Tournament/UI Version - Version d on page 2

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 20, 2010 10:15:21 PM from Demigod Forums Demigod Forums

Peppe - how specific do you want for that first few minutes of script?  I don't really want to overdo it, but the typically scenario is 3v3 on cataract.  I could give you a general guide for where dgs go, but things change based on dg selection (for instance, if there is a reg on your team, they typically start the game the same way, but will then buy currency/fs1 for the team before they get any items outside of their initial build).  I don't want to give you more info than is needed (as it will take me a bit).  I can just give you generic strat on cataract and that might be good enough, but I don't know. 

Reason for Karma (Optional)
Successfully updated karma reason!
November 20, 2010 11:01:55 PM from Demigod Forums Demigod Forums

 

Don't go into too much detail looking for overall macro type things it can do early.  I want to get the AI pointed in the right direction.  Should it maybe not worry about flags for the first minute or two and just move with the creeps?  I believe the biggest issue in the past was map control.  I human could go cap a few flags and the AI may not get around to capping it back for a long time.  Now the AI caps aggressively, so if the flags get out of favor the whole team will usually act to capture flags back.  

Right now the AI race to the closest flag is a little odd, but once the first battle is sorted out they each go off and push flags well.  A lot less standing around.

 

Found a pathfinding bug in the capture actions.  Found it on one of the circular maps, and it shouldn't come up on cataract. 

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