[DEV] BetaAI | TOTAL REDO ?
Improvements and ideas
Here's a crash I got running the AI:
Here's another crash, same function from the looks of it (this was after an hour or so):
Code: Select all
Exception of type `System.InvalidOperationException`: Attempted to get trait from destroyed object (e1 215 (not in world))
at OpenRA.TraitDictionary.CheckDestroyed(Actor actor)
at OpenRA.TraitDictionary.Contains[T](Actor actor)
at OpenRA.Actor.HasTrait[T]()
at OpenRA.Mods.RA.Classic.AI.Squad.React()
at OpenRA.Mods.RA.Classic.AI.BetaAI.AssignRolesToUnits(Actor playeractor)
at OpenRA.Mods.RA.Classic.AI.BetaAI.Tick(Actor self)
at OpenRA.World.<Tick>b__7(TraitPair`1 x)
at OpenRA.WorldUtils.<>c__DisplayClass18`1.<DoTimed>b__17(T x)
at OpenRA.Exts.Do[T](IEnumerable`1 e, Action`1 fn) in C:\Users\Maikel\Desktop\OpenRA-OpenRA-3e81a4b\OpenRA.FileFormats\Exts.cs:line 36
at OpenRA.WorldUtils.DoTimed[T](IEnumerable`1 e, Action`1 a, String text, Double time)
at OpenRA.World.Tick()
at OpenRA.Game.Tick(OrderManager orderManager)
at OpenRA.Game.Tick(OrderManager orderManager, Viewport viewPort)
at OpenRA.Game.Run()
at OpenRA.Program.Run(String[] args)
at OpenRA.Program.Main(String[] args)
Code: Select all
Exception of type `System.NullReferenceException`: Object reference not set to an instance of an object.
at OpenRA.Mods.RA.Classic.AI.Squad.React()
at OpenRA.Mods.RA.Classic.AI.BetaAI.AssignRolesToUnits(Actor playeractor)
at OpenRA.Mods.RA.Classic.AI.BetaAI.Tick(Actor self)
at OpenRA.World.<Tick>b__7(TraitPair`1 x)
at OpenRA.WorldUtils.<>c__DisplayClass18`1.<DoTimed>b__17(T x)
at OpenRA.Exts.Do[T](IEnumerable`1 e, Action`1 fn) in C:\Users\Maikel\Desktop\OpenRA-OpenRA-3e81a4b\OpenRA.FileFormats\Exts.cs:line 36
at OpenRA.WorldUtils.DoTimed[T](IEnumerable`1 e, Action`1 a, String text, Double time)
at OpenRA.World.Tick()
at OpenRA.Game.Tick(OrderManager orderManager)
at OpenRA.Game.Tick(OrderManager orderManager, Viewport viewPort)
at OpenRA.Game.Run()
at OpenRA.Program.Run(String[] args)
at OpenRA.Program.Main(String[] args)
-
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
It is spelled "aborted". I think Iran is mainly working on the classic mod and adapting your bot to the legacy gameplay, but not further improving the artificial intelligence.
I tried your latest version and it captured my construction yard in the early game. I captured it back but it still kept sending spies and engineers only, also one lonely rifle men. That was a little annoying as the spy stole some money and the engineer avoided the anti-infantry cleverly. However it did not send any bigger attack waves and kept wasting money on multiple refineries. I then captured the bots base.
I don't really understand what
is. Maybe you should implement a build-order instead of hard-coded times.
I tried your latest version and it captured my construction yard in the early game. I captured it back but it still kept sending spies and engineers only, also one lonely rifle men. That was a little annoying as the spy stole some money and the engineer avoided the anti-infantry cleverly. However it did not send any bigger attack waves and kept wasting money on multiple refineries. I then captured the bots base.
I don't really understand what
Code: Select all
Tweaks:
rand_b: 20%
rand_u: 10%
TicketsLimits:
iteration0: 0
iteration1: 4000
iteration2: 8000
iteration3: 12000
-
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
BetaAI needs a total redo.
If such things happens I will need someone that know red alert strategies well, to work on it with me (I will handle coding).
Every AI available yet (BetaAI first) are wrong.
The first thing that need to be done is a full 'base handling'. Anything such as units, superpowers or attack/defend will have to wait.
I'm taking a one week holidays so, if you're interested Cmd. Matt, we could start working on it.
If such things happens I will need someone that know red alert strategies well, to work on it with me (I will handle coding).
Every AI available yet (BetaAI first) are wrong.
The first thing that need to be done is a full 'base handling'. Anything such as units, superpowers or attack/defend will have to wait.
I'm taking a one week holidays so, if you're interested Cmd. Matt, we could start working on it.
I am not a good player. Have a look at http://www.sleipnirstuff.com/forum/view ... hp?t=15916 or http://content.open-ra.org/index.php?p=replays
I let 4 AI bots play against each other and everyone had a different build order (interesting). One bot was a little too passive getting his harvester destroyed in the early game. After the aggressive bot also tried to steal money the game crashed.
Exception of type `System.InvalidOperationException`: Attempted to get trait from destroyed object (e3 85 (not in world))
at OpenRA.TraitDictionary.CheckDestroyed (OpenRA.Actor actor) [0x00025] in /home/matthias/Projekte/OpenRA/OpenRA.Game/TraitDictionary.cs:61
at OpenRA.TraitDictionary.Contains[CrushableInfantry] (OpenRA.Actor actor) [0x00000] in /home/matthias/Projekte/OpenRA/OpenRA.Game/TraitDictionary.cs:65
at OpenRA.Actor.HasTrait[CrushableInfantry] () [0x00000] in /home/matthias/Projekte/OpenRA/OpenRA.Game/Actor.cs:216
at OpenRA.Mods.RA.AI.Squad.React () [0x00919] in /home/matthias/Projekte/OpenRA/OpenRA.Mods.RA/AI/HackyAI.cs:289
at OpenRA.Mods.RA.AI.BetaAI.AssignRolesToUnits (OpenRA.Actor playeractor) [0x001d3] in /home/matthias/Projekte/OpenRA/OpenRA.Mods.RA/AI/HackyAI.cs:1147
at OpenRA.Mods.RA.AI.BetaAI.Tick (OpenRA.Actor self) [0x00066] in /home/matthias/Projekte/OpenRA/OpenRA.Mods.RA/AI/HackyAI.cs:1015
at OpenRA.World.<Tick>m__78 (TraitPair`1 x) [0x00000] in /home/matthias/Projekte/OpenRA/OpenRA.Game/World.cs:177
at (wrapper delegate-invoke) <Module>:invoke_void__this___TraitPair`1<ITick> (OpenRA.TraitPair`1<OpenRA.Traits.ITick>)
at OpenRA.WorldUtils+<DoTimed>c__AnonStorey27`1[OpenRA.TraitPair`1[OpenRA.Traits.ITick]].<>m__4C (TraitPair`1 x) [0x0000c] in /home/matthias/Projekte/OpenRA/OpenRA.Game/WorldUtils.cs:152
at OpenRA.Exts.Do[TraitPair`1] (IEnumerable`1 e, System.Action`1 fn) [0x00013] in /home/matthias/Projekte/OpenRA/OpenRA.FileFormats/Exts.cs:36
at OpenRA.WorldUtils.DoTimed[TraitPair`1] (IEnumerable`1 e, System.Action`1 a, System.String text, Double time) [0x00026] in /home/matthias/Projekte/OpenRA/OpenRA.Game/WorldUtils.cs:149
at OpenRA.World.Tick () [0x000e0] in /home/matthias/Projekte/OpenRA/OpenRA.Game/World.cs:175
at OpenRA.Game.Tick (OpenRA.Network.OrderManager orderManager) [0x0017a] in /home/matthias/Projekte/OpenRA/OpenRA.Game/Game.cs:184
at OpenRA.Game.Tick (OpenRA.Network.OrderManager orderManager, OpenRA.Graphics.Viewport viewPort) [0x00030] in /home/matthias/Projekte/OpenRA/OpenRA.Game/Game.cs:131
at OpenRA.Game.Run () [0x00026] in /home/matthias/Projekte/OpenRA/OpenRA.Game/Game.cs:335
at OpenRA.Program.Run (System.String[] args) [0x00010] in /home/matthias/Projekte/OpenRA/OpenRA.Game/Support/Program.cs:91
at OpenRA.Program.Main (System.String[] args) [0x0002b] in /home/matthias/Projekte/OpenRA/OpenRA.Game/Support/Program.cs:36
-
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
why redo? I never had the bugs, and its still a huge improvment that changes the way the AI play.....
If 36 can get into next playtest (soon?), then players can give comments that will make it easier for you to program. Else you can schedule a day for programming and get some testers and strategy masters to help you on irc.
But IMHO I think 36 was amazing, and would love to see it into game. If you have the energy to redo it all, then it will be even more amazing.
Just please make some easy examples in the code, so its easier for others to improve it..
You also seemed to comment the code well, thanks for doing that.
And if possible, please make it possible to create easy AI maps like wave-games. Without the need for editing cs and making mods. Just a new file into oramaps, like AI.yaml and some examples on some maps would make a whole lot of new games..
Tips for modders: https://github.com/OpenRA/OpenRA/wiki/M ... ding-Ideas
If 36 can get into next playtest (soon?), then players can give comments that will make it easier for you to program. Else you can schedule a day for programming and get some testers and strategy masters to help you on irc.
But IMHO I think 36 was amazing, and would love to see it into game. If you have the energy to redo it all, then it will be even more amazing.
Just please make some easy examples in the code, so its easier for others to improve it..
You also seemed to comment the code well, thanks for doing that.
And if possible, please make it possible to create easy AI maps like wave-games. Without the need for editing cs and making mods. Just a new file into oramaps, like AI.yaml and some examples on some maps would make a whole lot of new games..
Tips for modders: https://github.com/OpenRA/OpenRA/wiki/M ... ding-Ideas
Does your AI support loading and dropping units? Maybe parts of the logic could get reused to fix https://github.com/OpenRA/OpenRA/issues/2246
-
- Posts: 2
- Joined: Sat Nov 10, 2012 8:39 pm
I tried to clean this up for a merge into https://github.com/OpenRA/OpenRA and rebased it onto current bleed, but there is lot's of stuff to do. I did a dos2unix with your text files so we can see a proper diff: https://github.com/Mailaender/OpenRA/co ... mproved-ai You also use spaces instead of tabs which is a little annoying. The more severe problems are the compiler warnings:
I agree that this addresses many https://github.com/OpenRA/OpenRA/issues and should make it's way into the game sometime. The BetaAI currently focuses too much on lame tactics such as engineer and spy wasting lot's of money and you can't see it's full potential. This can be fixed easily if you restrict this to a Secret Service AI - I suggest to name it "M" in yaml and the other ones use tanks, jeep rush and planes to kick the players ass in a more traditional way.
You also added lot's of Red Alert specific code:CSC mods/ra/OpenRA.Mods.RA.dll
OpenRA.Mods.RA/AI/HackyAI.cs(404,27): warning CS0472: The result of comparing value type `OpenRA.CPos' with null is `false'
OpenRA.Mods.RA/AI/HackyAI.cs(405,17): warning CS0162: Unreachable code detected
OpenRA.Mods.RA/AI/HackyAI.cs(426,32): warning CS0472: The result of comparing value type `OpenRA.CPos' with null is `false'
OpenRA.Mods.RA/AI/HackyAI.cs(427,21): warning CS0162: Unreachable code detected
OpenRA.Mods.RA/AI/HackyAI.cs(436,24): warning CS0472: The result of comparing value type `OpenRA.CPos' with null is `false'
OpenRA.Mods.RA/AI/HackyAI.cs(437,17): warning CS0162: Unreachable code detected
OpenRA.Mods.RA/AI/HackyAI.cs(471,24): warning CS0472: The result of comparing value type `OpenRA.CPos' with null is `false'
OpenRA.Mods.RA/AI/HackyAI.cs(472,17): warning CS0162: Unreachable code detected
OpenRA.Mods.RA/AI/HackyAI.cs(621,17): warning CS0219: The variable `refund' is assigned but its value is never used
OpenRA.Mods.RA/AI/HackyAI.cs(751,17): warning CS0219: The variable `myBuildings' is assigned but its value is never used
OpenRA.Mods.RA/AI/HackyAI.cs(826,31): warning CS0472: The result of comparing value type `OpenRA.CPos' with null is `true'
OpenRA.Mods.RA/AI/HackyAI.cs(1071,45): warning CS0472: The result of comparing value type `OpenRA.CPos' with null is `true'
OpenRA.Mods.RA/AI/HackyAI.cs(1147,42): warning CS0472: The result of comparing value type `OpenRA.CPos' with null is `false'
OpenRA.Mods.RA/AI/HackyAI.cs(1148,21): warning CS0162: Unreachable code detected
OpenRA.Mods.RA/AI/HackyAI.cs(499,29): warning CS0414: The private field `OpenRA.Mods.RA.AI.HackyAI.playerSupport' is assigned but its value is never used
OpenRA.Mods.RA/AI/HackyAI.cs(1017,15): warning CS0414: The private field `OpenRA.Mods.RA.AI.HackyAI.repairTarget' is assigned but its value is never used
Compilation succeeded - 16 warning(s)
- https://github.com/Mailaender/OpenRA/bl ... der.cs#L79
- https://github.com/Mailaender/OpenRA/bl ... AI.cs#L104
- https://github.com/Mailaender/OpenRA/bl ... AI.cs#L140
- https://github.com/Mailaender/OpenRA/bl ... AI.cs#L856
I agree that this addresses many https://github.com/OpenRA/OpenRA/issues and should make it's way into the game sometime. The BetaAI currently focuses too much on lame tactics such as engineer and spy wasting lot's of money and you can't see it's full potential. This can be fixed easily if you restrict this to a Secret Service AI - I suggest to name it "M" in yaml and the other ones use tanks, jeep rush and planes to kick the players ass in a more traditional way.