Company of Heroes 3

Company of Heroes 3

414 ratings
Advanced AI
21
14
5
6
9
4
7
5
5
4
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
443.050 KB
5 Mar, 2023 @ 10:06am
18 Jul @ 9:52am
80 Change Notes ( view )

Subscribe to download
Advanced AI

Description
Fully custom script-based AI replacement for a more challenging and human-like AI.

Join the discord server to discuss the mod, get notifications about new updates, see development progress!
https://discord.gg/Xx8XGBgJpq

List of main features:
  • An option to play the game where AI controls player units and the player is only responsible for purchasing tech, units and using battlegroup abilities.
  • AI personality selection, altering the way AI makes some of its decisions.
  • Extra game mode for fully customizing AI bonuses.
  • Fully custom AI economy:
    • Ability to counter enemy team's unit composition.
    • Timing-based purchase priorities.
    • Full usage of battlegroup abilities and call-ins.
    • Emplacement and mine usage.
    • Sandbag and barbed wire usage.
  • Full control of all AI units:
    • Custom large-scale movement logic.
    • Custom capture logic.
    • Different movement logic for different kinds of units.
    • Ability to pick up dropped weapons, supply crates, recrew team weapons.
  • Close-in logic for assault units, including avoidance of MG arcs, shot blockers.
  • Custom cover taking logic, including avoidance of MG arcs, shot blockers.
  • Custom logic for all abilities.
  • Unblob functionality.
  • Vehicles will stay away from anti-tank.
  • Vehicles will attempt to face the enemy properly.
  • Vehicles can dive.
  • Vehicles will retreat for repairs.
  • Control of barrage units - smoke barrages, flares, general barrages.
  • Special logic for HMG, AT, sniper units.
  • Custom and complex retreat logic for all units.
  • Danger avoidance, especially for non-combat units.
  • Ability avoidance.
  • "Attention" system, AI will make more mistakes if multiple go on at once.
  • Action speed setting which adjusts AI overall attention and responsiveness.
  • "Pullback" system, AI is more likely to attack concentrations of enemy in waves.
  • Full use of USF veterancy.
  • Many more smaller features.

Source code available here: https://gitlab.com/AGameAnx/coh3-advanced-ai

This mod is based on a long standing COH1 project - Back to Basics mod.

Special thanks: Quicksilver, YouMoMCallME, Janne252, Garbhus
Popular Discussions View All (4)
9
1
18 Mar @ 2:43pm
PINNED: AI bonuses
AGameAnx
2
21 Apr, 2023 @ 12:19pm
AI use of mines and entrenchments
15267
0
8 Dec, 2024 @ 1:26am
Only AT rifle upgrade for infantry sections
Danny
1,109 Comments
[901st] Medojed 28 Jul @ 3:10pm 
Well, I played couple of games and seemingly they stopped doing this, I did not spawn a single MG and instead switched to Brits and used infantry sections and engineers to bully my way against the enemies and it worked out. By constantly just moving everywhere they used infantry and normal vehicles, completely forgetting about artillery.
AGameAnx  [author] 28 Jul @ 12:04pm 
Indirect unit values also don't scale linearly. Relic somewhat forces my hand here really because coastal BG exists. But even so, AI will get more indirect units than a human for the most part, because AI is just not that good at breaking defensive positions by other means, and it's really beneficial for AI to have units which deal damage without taking damage Of course some people really don't like playing against this, but now there's a slider which lets you adjust this.

AI generally tends to always get heavier vehicles because there's really not much downside to that and I want it to use all of its resources (so spending fuel). Of course the downside is if it's like a chokepoint map where it just feeds the vehicles... Maybe one day I'll address that but yeah.

There's a lot to that stuff, I'm trying to make sure AI uses pretty much all units that I've implemented at least in some situations.
AGameAnx  [author] 28 Jul @ 12:04pm 
AI custom economy balancing is something I always work on. There are a total of 7 unit archetypes (units are allowed to have any weights for any number of them), that AI tries to balance for and counter.

The numbers are kinda magic, it's really hard to balance them or know precisely how they work together, so it takes a long time to truly figure out great balance, but yea I've not been tweaking them too much for a long while now, I am pretty happy with where things are.

Some of the numbers don't scale linearly such as how it scales its AT defenses and especially how it counters the first potential enemy armor.

Maybe something people won't expect is that there's an archetype for rushable units, so in some cases it will just opt to rush the defensive setups, and of course especially stuff like snipers.
AGameAnx  [author] 28 Jul @ 11:59am 
Mortars reveal themselves when they deal damage I believe (or maybe even right as they fire, but I don't think so) and AI will target them quite fast especially if they're somewhat close to enemy units. There's a functionality where units in combat will request nearby artillery support and target visible team weapons and such, akin to how a human might immediately smoke out or barrage machine guns in a real match.

The ability avoidance timing is something I have to define by hand, so I am guessing halftrack barrage numbers aren't setup correctly. Needless to say it's pretty annoying to choose those numbers well because it's hard to account for barrage distance. I'll take a look.
[901st] Medojed 28 Jul @ 11:32am 
The main issue I had with fog of war is that I repositioned my mortar several times in the span of 2 minutes, it never saw it but always barraged it with it's own mortar. And yes it dodges abilities before they even finish casting. I cast my barrage from the US halftrack to a location and before the truck even started firing it immediately started retreating. But as I said, I will try to fix things on my own end, thank you.
[901st] Medojed 28 Jul @ 11:29am 
Thanks for the reply though, I thought the AI just behaved like that normally, but if it adapts actually based on what you build then I will try to see what's up. To me it seems like I am doing alright for it to not spam the same units over again, but if what you said is true, then there has to be issue on my end somewhere.
[901st] Medojed 28 Jul @ 11:28am 
Interesting, because from my experience with my friend we often try to push and capture more areas, sure we build some static units and place HMG's and 1 AT gun somewhere, but it results in the same end, it only spams artilleries and after it pushes us a bit back we get spammed by tanks. Though when I tried again last game, I don't think I changed my tactic any differently and the AI went for infantry and vehicles and completely said no to artillery. Though I assume that is because I had 2 AT USF trucks that I usually barraged it's units with.
AGameAnx  [author] 28 Jul @ 8:09am 
There are a plethora of systems which govern how AI sees into fog of war, it's not like it doesn't see anything, but it sees actually very little directly, and as far as I can tell it feels quite close to what a human would remember / deduce. There's basically no cases where it'll just randomly bombard a thing it never saw before, maybe unless you've sat in a spot for over 10 minutes, heh. There are cases where it will sometimes start avoiding something before it even sees it, but that's kinda the worst of it, and can be chalked up to prediction too, it's pretty rare that it happens vs small amounts of units.
AGameAnx  [author] 28 Jul @ 8:09am 
Not to be annoying, but it's pretty easy to win even against expert if you know what you're doing. But you're not required to pick Expert, if you're having trouble just pick an easier difficulty, even Easy, there's nothing wrong with that, and AI won't be directly dumber because of it.

The reason you're seeing AI build a lot of team weapons is because it thinks these are the types of units that will beat you, in normal circumstances it makes a pretty varied composition that's pretty similar to what you'd see a human make.

Seems like you're playing very static, so of course AI will build up a large force of units which will be able to destroy emplacements, bombard you.

It has memory of where it saw units, so especially for emplacements it will keep bombarding, but even vs team weapons and rarely vs normal units it will bombard into fog of war if it sees its opponents hold the same positions, and especially if they're clumping up.
[901st] Medojed 28 Jul @ 5:43am 
I am sorry but this is actually unwinnable. The mod does not even fix the issue of the enemy artillery shooting through fog of war with pinpoint accuracy. It also foregoes all units and just spams AT/MG/tanks and artillery. That is definitely not a human behavior.