Making Hard AI, hard?
-
- Posts: 4
- Joined: Sat Apr 14, 2012 6:48 pm
Making Hard AI, hard?
Is there a way to make the Hard AI hard?
I played against 8 or 10 Hard AIs with two friends and they were simply too easy.
We expected 3 AIs to be enough, fighting one each. But 8 or 10 Hard AIs is still too easy for us. Any suggestions please?
I played against 8 or 10 Hard AIs with two friends and they were simply too easy.
We expected 3 AIs to be enough, fighting one each. But 8 or 10 Hard AIs is still too easy for us. Any suggestions please?
It's actually pretty easy to tweak some values and get different behavior.
open this in a text editor:
openra/mods/ra/rules/system.yaml
(er... probably c:\program files\openra\moda\ra\rules\system.yaml for you windows folks)
copy and paste the lines from "HackyAI@HardAI:" to "SquadSize", so you've not got two HardAIs.
change "@HardAI" to "@myTestAI" and give it a name such as "Name:my AI" (if you have two that are named HardAI, it'll crash on startup).
To see what the things under "BuildingFractions" and "UnitsToBuild" are, open up structures.yaml, infantry.yaml, and vehicles.yaml and look around. It's fairly self-documenting.
It is very easy to tweak these values and get different behavior, it is NOT however very easy to make the AI actually harder.
If you cut down on proc (ore processing facility) for example, the AI gets a very slow start early on in the game.
Here is something y'all may find interesting: Just as I was typing this, a bot that I've been tweaking attacked me... with aircraft!
EDIT: And that AI only built 4 ore refineries, too.
open this in a text editor:
openra/mods/ra/rules/system.yaml
(er... probably c:\program files\openra\moda\ra\rules\system.yaml for you windows folks)
copy and paste the lines from "HackyAI@HardAI:" to "SquadSize", so you've not got two HardAIs.
change "@HardAI" to "@myTestAI" and give it a name such as "Name:my AI" (if you have two that are named HardAI, it'll crash on startup).
To see what the things under "BuildingFractions" and "UnitsToBuild" are, open up structures.yaml, infantry.yaml, and vehicles.yaml and look around. It's fairly self-documenting.
It is very easy to tweak these values and get different behavior, it is NOT however very easy to make the AI actually harder.
If you cut down on proc (ore processing facility) for example, the AI gets a very slow start early on in the game.
Here is something y'all may find interesting: Just as I was typing this, a bot that I've been tweaking attacked me... with aircraft!
EDIT: And that AI only built 4 ore refineries, too.
Hard AI
There are 2 ways of making AI harder.
In yaml in your maps you can also change what they are supposed to build, for each map.
They rotate in order in what to buid.
Questions:
1: what is harder, bigger squad size or smaller? Seems like it depends when in game it is..
2: https://github.com/OpenRA/OpenRA/issues/2014 would make the Ai harder, if you can limit on how many ore refins they are allowed to build.. Comment on it if you agree
In yaml in your maps you can also change what they are supposed to build, for each map.
They rotate in order in what to buid.
Questions:
1: what is harder, bigger squad size or smaller? Seems like it depends when in game it is..
2: https://github.com/OpenRA/OpenRA/issues/2014 would make the Ai harder, if you can limit on how many ore refins they are allowed to build.. Comment on it if you agree
Re: Hard AI
Early in the game, smaller is harder. Later in the game, larger is harder.zypres1 wrote: ↑ 1: what is harder, bigger squad size or smaller? Seems like it depends when in game it is..
For #1. I'm working on making it so the squad size that is sent is pseudo random, but still trends towards squadsize: https://github.com/OpenRA/OpenRA/issues/2048
I haven't gotten around to fixing what head honcho wants fixed in the code, but I will at some point.
Challenge accepted!
I created an AI with optimized build order that currently beats all available bots. Put this into your mods/ra/rules/system.yaml:
It builds less refinerys (it seems to stop at 5 in the end game, but builds the second one early after the barracks) and can spend therefore more money for units. It techs faster, but only builds each production building once (not 3 radar domes). It also builds more advanced units (Mammoth tanks and medics) which can give favor to it in battles. The attacks are still a little careful stopping at the base entry hunting harvesters down and using artillery to bomb down base defend buildings, but this seems to be the attack waypoint code. It won't build any turrets to become more offensive and because the placement algorithm is not very clever at the moment. https://github.com/OpenRA/OpenRA/issues/2064
Code: Select all
HackyAI@OptiAI:
Name:Optimized AI
BuildingFractions:
proc: 25.1%
powr: 35%
tent: 0.1%
barr: 0.1%
weap: 0.1%
fix: 0.1%
dome: 0.1%
atek: 0.1%
stek: 0.1%
UnitsToBuild:
e1: 50%
e2: 1%
e3: 10%
medi: 1%
apc: 10%
jeep: 10%
ftrk: 25%
1tnk: 25%
2tnk: 50%
3tnk: 75%
4tnk: 100%
arty: 30%
v2rl: 30%
SquadSize: 10
-
- Posts: 50
- Joined: Sun Sep 26, 2010 12:06 am
Re: Challenge accepted!
Call it Matt AI (or some other cooler name - I went with famous WW2 dudes for the "Rommel AI" and "Zhukov AI" that you now see, but Patton and Monty remain unclaimed) and submit it to the bug tracker.Cmd. Matt wrote: ↑I created an AI with optimized build order that currently beats all available bots. Put this into your mods/ra/rules/system.yaml:It builds less refinerys (it seems to stop at 5 in the end game, but builds the second one early after the barracks) and can spend therefore more money for units. It techs faster, but only builds each production building once (not 3 radar domes). It also builds more advanced units (Mammoth tanks and medics) which can give favor to it in battles. The attacks are still a little careful stopping at the base entry hunting harvesters down and using artillery to bomb down base defend buildings, but this seems to be the attack waypoint code. It won't build any turrets to become more offensive and because the placement algorithm is not very clever at the moment. https://github.com/OpenRA/OpenRA/issues/2064Code: Select all
HackyAI@OptiAI: Name:Optimized AI BuildingFractions: ... v2rl: 30% SquadSize: 10
Maybe all bots could get this new build order. If not then I will submit it as Eisenhower AI.
Another thing: at the end the bots seems to build the last building in the list multiple times even though it is just 0.1%. Maybe the power plant should be last so he won't waste money on another radar dome or tech center.
They also don't care too much about percentage in UnitsToBuild as medi: 1% will result in ~50% medics.
Another thing: at the end the bots seems to build the last building in the list multiple times even though it is just 0.1%. Maybe the power plant should be last so he won't waste money on another radar dome or tech center.
They also don't care too much about percentage in UnitsToBuild as medi: 1% will result in ~50% medics.
I added a patch at https://github.com/OpenRA/OpenRA/issues/2204 All my github branches are full of other stuff so I can't get a clean pull request. Now also with heroe units to fulfill Generalcamos wish. However he builds too many Tanyas ignoring the 0.01% setting (it's more like 30%).