[Mod Release] Better AI - Tweaks for deadlier AI

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Will the mod get an update for the current game version or is the better AI mod v1.7 compatible with the newest game version?

Sorry to say I haven't been free at all to update my mods to 1.8. If someone on the BT modders collective wants to get access, check with the group leads on the github. I want to get some time to play 1.8, but my IRL schedule just doesn't allow me time to myself anymore.

EDIT: I'm back an intend to update this mod.
 
Last edited:
  • 1Like
Reactions:
The Resurrection
I'm back and here's a new 1.9.1 daily test build. I've worked on increasing the aggression of the AI, specially vehicles and am working with some new AI tools the community has made to make this mod even better. Check out the new daily build at github at BattletechModders/BetterAI/tree/Daily-Test-Branch and download it at the green "clone or download" button to DL the zip file from there. This should work in both HBS mod loader or ModTek.

Let me know how it plays, I think it's close to releasable.
 
  • 2Like
  • 1
Reactions:
So I've found something new in the AI.

A Master Tactician (used Arclight in stock Skirmish) won't reliably pull the "Sniper" role when the unit they're in is lighter in exact tonnage than the other's in the same Lance. Load up a GRF-1N with Arclight and 3x AS7s with other pilots and the GRF won't hang back. Swap the AS7s for HBK-4Gs and it will. I was hunting some role inconsistencies all day and this is where I've ended up. I tried equal weight Lances (3x SHD and 1 GRF or 3x HBK and 1 TBT) but the results were inconsistent. The TBT would pull sniper, but the GRF wouldn't. This has some implications for contract Lance generation I will have to research. It's possible support units with Master Tacticians have not been pulling the "Sniper" role and are rushing in to combat. I need to confirm this in a live contract, but I can consistently reproduce this in Skirmish. I don't know if I should bother reporting this bug, given development has stopped. However, for mod makers who need to touch Lance generation or AI, this is something to be aware of.
 
  • 5
  • 1Like
Reactions:
Was looking forward to trying this. Love the game but the vanilla AI is so bad it ruins the experience IMO.

Just testing out the mod for the first time. I'm a few battles in. I jumped up close with a fire starter to a gunner griffin that was sniping me to see what it would do. I expected the griffin to respond by either punching the fire starters face in or even Death from above it but it just ran around like a chicken with it's cut off instead. Punching the fire starter would have definitely been the optimal play IMO.

Is there some hard coded reason the AI never uses DFA or even uses jump jets effectively?
 
Was looking forward to trying this. Love the game but the vanilla AI is so bad it ruins the experience IMO.

Just testing out the mod for the first time. I'm a few battles in. I jumped up close with a fire starter to a gunner griffin that was sniping me to see what it would do. I expected the griffin to respond by either punching the fire starters face in or even Death from above it but it just ran around like a chicken with it's cut off instead. Punching the fire starter would have definitely been the optimal play IMO.

Is there some hard coded reason the AI never uses DFA or even uses jump jets effectively?

It's kind of hard for me to get the AI to use DFA smartly and not just use it all the time to the point where it feels "cheep" like you know it's just trying to make you incur repairs.

The 1.7 Better AI build is now too scared for the current game. I'm actually doing a clean slate rebuild of Better AI from stock values and this is going to take me a while. Given the 1.7 version works without breaking anything, I feel like I can update some of my smaller mods and pick at Better AI 2.0 in between. I'm leaving up the "daily test build" branch on my git and that one is far more aggressive, but I feel it's too easy to flank due to the aggression.

The reason I'm doing a clean slate rebuild is that I now have mpstark's wonderful AIToolkit that gives me the final output values of each possible movement dot the AI can get to, along with a breakdown of the individual values that make the final weight. It also lets me easily compare dots to one another and I can make much finer grained changes instead of the usual method of throwing a larger value at something to see if that happens to work or slowly reading logs post combat.

For anyone else just skimming this thread or waiting for updates - It's going to be a while, I'm making Better AI 2.0.
 
  • 5Like
  • 2
Reactions:
Wonderful news.

I'm sure it will be worth the wait.
 
  • 1Like
Reactions:
It's kind of hard for me to get the AI to use DFA smartly and not just use it all the time to the point where it feels "cheep" like you know it's just trying to make you incur repairs.

The 1.7 Better AI build is now too scared for the current game. I'm actually doing a clean slate rebuild of Better AI from stock values and this is going to take me a while. Given the 1.7 version works without breaking anything, I feel like I can update some of my smaller mods and pick at Better AI 2.0 in between. I'm leaving up the "daily test build" branch on my git and that one is far more aggressive, but I feel it's too easy to flank due to the aggression.

The reason I'm doing a clean slate rebuild is that I now have mpstark's wonderful AIToolkit that gives me the final output values of each possible movement dot the AI can get to, along with a breakdown of the individual values that make the final weight. It also lets me easily compare dots to one another and I can make much finer grained changes instead of the usual method of throwing a larger value at something to see if that happens to work or slowly reading logs post combat.

For anyone else just skimming this thread or waiting for updates - It's going to be a while, I'm making Better AI 2.0.

that's the one i'm using. the dailytest branch one. The enemies still seem fairly timid.

Especially when they have reinforcements. there's nothing really stopping 8vs4 from rolling right over you I feel, if they played properly. But that might make it insanely hard if they were that aggressive!

Thanks for all your hard work. I'm going to keep playing. AI must be really hard obviously or they would have done a better job with the vanilla game AI.
 
that's the one i'm using. the dailytest branch one. The enemies still seem fairly timid.

Especially when they have reinforcements. there's nothing really stopping 8vs4 from rolling right over you I feel, if they played properly. But that might make it insanely hard if they were that aggressive!

Thanks for all your hard work. I'm going to keep playing. AI must be really hard obviously or they would have done a better job with the vanilla game AI.

Yea, I think I dialed uo the aggression, then noticed it was too easily flanked, the dialed up the protect rear stuff and just realized it was easier to clean slate the things. I'll get to undoing some of the rear protective bits in that one today. This has been reverted in the daily build.

Check out "Relentless AI" on Nexus, he took Better AI and made it more aggressive. I've been working with him on discord and he's a big part of why I have been back at this mod. Be aware, I think he didn't even bother to adjust the mod.json or names, so it has to go in to the existing better AI folder and you can't have both in the mods folder at the same time as they have the same mod ID.
 
Last edited:
So, today I've learned that you can enable "Bool_SimpleShortRangeLOF" and in skirmish, this disables the "dumb" long range sprinting to combat. That "dumb mode" ignored any mod edits and is a simple "move fast fast as you can at a target" which is what results in a SDR blazing across the Tidal map leaving the Urbs behind.

However, this triggers stuff relating to the "personal space while sprinting" and somewhere that value is set to -20 and I don't see where to alter that. I had to set another unused but related variable to +20 to cancel it out, and that's the most correct way I can see to fix this, but I feel this can have downstream consequences I haven't found yet.

However, the devs have a note:
(TODO: roll this behavior out to all encounters.)
So now I I'll probably have to test this in every contract type (and possibly even campaign missions) to see if it works and the AI doesn't get lost. This is in addition to testing that the extreme -20 and other values needed to get the AI to sprint to combat when very far away don't screw up contact range movement or LoS combat turns.

These hurdles are still worth it though. The AI ignoring variables until it got full LoS on the player is a huge, long term sore spot for us editing the AI. This is what sets up those AI first round, first move suicidal rushes to LoS that let you isolate and destroy that first mover and snowball from there.

I've also noticed that for some reason, flat open ground gives the bonus to not affecting stability variables (as it should) while forests don't get that same bonus weight. It should, as forests have the normal 1.0 modifier to stability in the file. I don't know if I can work around this (maybe a cFixes issue?) as the file for no-effect terrain just doesn't have anything in the file to edit, as it's supposed to be empty.
 
  • 3
Reactions:
The 1.7 Better AI build is now too scared for the current game.

Ah. I never played the game before Heavy Metal, but it makes sense that the AI worked better when the player's weapons weren't usually as powerful.

AI must be really hard obviously or they would have done a better job with the vanilla game AI.

This is a bit of an aside, but I've been listening to a podcast with Roger Keating of SSG, who used to be pretty admired for programming good TBS AIs in wargames and the Warlords series back in the 80s and 90s. One of his design principles was 'limit your game system's complexities by what your AI can handle', to paraphrase him. You have to think of what you expect your AI to do right from the start of the design phase, if you want it to work right. But AI is usually not a priority for most designers.
 
  • 1
Reactions:
Started a new career with the test build--its pretty early to make any judgments, because I'm mostly seeing enemy forces with only armor or armor + a light mech or 3.

I did encounter a Locust-1M sprinting to LOS and then being within minimum range (and getting wrecked by my lance) when it should have hung back and let the Scorpions and Galleons close the distance.
 
  • 1Like
  • 1
Reactions:
This is a bit of an aside, but I've been listening to a podcast with Roger Keating of SSG, who used to be pretty admired for programming good TBS AIs in wargames and the Warlords series back in the 80s and 90s. One of his design principles was 'limit your game system's complexities by what your AI can handle', to paraphrase him. You have to think of what you expect your AI to do right from the start of the design phase, if you want it to work right. But AI is usually not a priority for most designers.

HBS made a pretty comprehensive AI framework, even if we modders find the behavior tree structure not optimal. Overall, I think HBS tuned the AI to be as smart as they wanted it. It's easy to make it move smarter, reserve, pile on to objectives and force the player to lose a mission in addition to wrecking their gear. But we here are not the average players. I feel like they set the AI for those who maybe get through the campaign once, coming from near zero BT background. I remember watching the early access streamers and watching them make bad choices in the lab and on the field. The AI didn't seem anywhere near as dumb fighting them as they didn't know how to play.

A downside I find to smarter AI is my mission complete times balloon to an hour for contracts I can win in under 30 with stock AI. I progress slower in the Sim game because every move with advanced AI becomes something you really need to stop and think about. I get less rewards and advancement per play session at the cost of superior tactical challenge. It's a balancing act that affects the entire game experience and not just how combat feels.
 
  • 4Like
  • 1
Reactions:
Had another interesting AI battle: it was a 'light' swarm mission where after the 2nd turn all reinforcements were on the map and there was a pitched battle. The main enemy lance was two spiders and two Panthers. The panthers stood off at range, made no attempt to close, and pinged with PPC's. That made sense.

But the Spiders did the same thing! They got to Max medium laser range, and almost stood still, pinging away. I had a Blackjack and Vindicator on top of a wooded hill firing down on them. Tactically, the Spiders had every reason to rush the hill. I thought it was odd and wanted to report here.
 
  • 1Like
Reactions:
I can't remember who you were or what forum/discord you brought this up to me but I updated the Better AI Perm-Evasion module to cancel out the conservative shot restriction.

It's on github if you look for my username here or search BetterAI-Permanent-Evasion-Add-On

As for Better AI 2.0 - With AI Toolkit I'm finding a lot of variables don't actually work the way they say they should or how you think it would. This is going to go a long way in to making the AI more controllable. I will need to make a write up of what I have found so far, so others don't need to make the same mistakes.
 
  • 4
Reactions:
Ah. I never played the game before Heavy Metal, but it makes sense that the AI worked better when the player's weapons weren't usually as powerful.



This is a bit of an aside, but I've been listening to a podcast with Roger Keating of SSG, who used to be pretty admired for programming good TBS AIs in wargames and the Warlords series back in the 80s and 90s. One of his design principles was 'limit your game system's complexities by what your AI can handle', to paraphrase him. You have to think of what you expect your AI to do right from the start of the design phase, if you want it to work right. But AI is usually not a priority for most designers.

I'm looking for a challenge and was playing with all the hardest setting toggled on in career more. So i am probably not typical BUT these are the most infuriating things I've noticed about the AI..

a vindicator standing behind a hill shooting only it's lrm 5 every turn.

mechs mindlessly wandering out from cover for no reason even when they have bulwark. This one is really bad. Staying in cover is so important.

i make a mistake. they could punish me and cause heavy damage to one of my mechs. instead they decide to fire 1 medium laser at my mech with high evasion (lol).

In base defend missions enemies mindlessly run toward the buildings totally ignoring your mechs who just blow them up by shooting them in the back. This is so bad it actually feels like cheating after awhile.

Enemies refuse to use jump jets and aggressively position even when they have you outnumbered.
 
  • 1Like
Reactions:
I'm looking for a challenge and was playing with all the hardest setting toggled on in career more. So i am probably not typical BUT these are the most infuriating things I've noticed about the AI..

a vindicator standing behind a hill shooting only it's lrm 5 every turn.

mechs mindlessly wandering out from cover for no reason even when they have bulwark. This one is really bad. Staying in cover is so important.

i make a mistake. they could punish me and cause heavy damage to one of my mechs. instead they decide to fire 1 medium laser at my mech with high evasion (lol).

In base defend missions enemies mindlessly run toward the buildings totally ignoring your mechs who just blow them up by shooting them in the back. This is so bad it actually feels like cheating after awhile.

Enemies refuse to use jump jets and aggressively position even when they have you outnumbered.

Yep, that just about sums up the feedback I've been getting. Downside is some of those points are directly linked.

The "Enemies refuse to aggressively position when they outnumber you" and "mindlessly wandering out of cover" are the same activity to the AI.

Either A - tree hug or B - aggressive movement. However, the AI can't differentiate when it has 2 units left or 12. Two units rushing out of cover vs 4 player units is bad, 12 is good. The AI just doesn't consider units not spawned outside it's Lance that I can tell. Same goes for JJ movement, I can't directly tell it to use that more or smarter.

The target selection I think I can work on now that I have AI toolkit, but all of that is kind of hidden from diagnostics. I have to crawl through logs to get an idea about why it picks something over another when it comes to target selection. The priority targeting, like for base defense and escorts I do have the power to tune. I initially set them to try to complete their objective ASAP but this is exploited as you mentioned. I'll need to find a balance and know the variables for that already work, this should be possible.

Thanks for the feedback!
 
  • 2
  • 1Like
Reactions:
Yep, that just about sums up the feedback I've been getting. Downside is some of those points are directly linked.

The "Enemies refuse to aggressively position when they outnumber you" and "mindlessly wandering out of cover" are the same activity to the AI.

Either A - tree hug or B - aggressive movement. However, the AI can't differentiate when it has 2 units left or 12. Two units rushing out of cover vs 4 player units is bad, 12 is good. The AI just doesn't consider units not spawned outside it's Lance that I can tell. Same goes for JJ movement, I can't directly tell it to use that more or smarter.

The target selection I think I can work on now that I have AI toolkit, but all of that is kind of hidden from diagnostics. I have to crawl through logs to get an idea about why it picks something over another when it comes to target selection. The priority targeting, like for base defense and escorts I do have the power to tune. I initially set them to try to complete their objective ASAP but this is exploited as you mentioned. I'll need to find a balance and know the variables for that already work, this should be possible.

Thanks for the feedback!

Sorry. this was not a critique of your mod. This was a critique about the things I noticed about the Vanilla game AI. I have not really play tested your mod enough yet.

Does the AI consider evasion charges? Usually it seems they just meander out of cover slowly to get promptly destroyed, where as if they jumped out of cover max distance they would generate a decent number of evasion charges atleast.
 
  • 1Like
Reactions:
Nevermind. you already said they wont use jump jets properly so that basically answers the evasion charges question. lol.

Not sure why the AI was not programmed to alpha strike whichever target they had the highest hit percentages against and least amount of cover/bracing damage reduction. instead of getting so easily distracted by lighter mechs with very high evasion.

I'm assuming they will not consider load out either. A locust flanking is just as bad as a star league griffin flanking in the eyes of the AI.
 
Sorry. this was not a critique of your mod. This was a critique about the things I noticed about the Vanilla game AI. I have not really play tested your mod enough yet.

Does the AI consider evasion charges? Usually it seems they just meander out of cover slowly to get promptly destroyed, where as if they jumped out of cover max distance they would generate a decent number of evasion charges atleast.
No worries, it's just I only really have others critiques as feedback for what to improve. I can train the AI to fight me, but that's not going to work for everyone else

As for evasion - the AI seems to measure how far they move as what can be valuable. The AI isn't aware of evasion pips, likely because they didn't exist in the current form until much later, after the AI was written. Downsi to this is if a pilot is capped at 4 evasion, and you set it to really love moving more, they'll bypass great offensive positions to just keep going and end in a just OK position tactically. The stock AI certainly doesn't value moving enough in the Brawler role, but this was likely done before evasion tanking was possible and Bulwark required you to stay still. If they were to write the AI from scratch using 1.9.1 combat mechanics, we'd have a much smarter AI.