[DEV] BetaAI | TOTAL REDO ?
Improvements and ideas
Ok, this is one more TODO list with some things that can be discussed...
*some units or features not yet in OpenRA, but it would be possible in future.
Service depot and repairing/restoring.
-Repairs air units on service depot when they damaged.
-Repairs submarines/ships in subpens/shipyards where they near base and damaged.
-Repairs vehicles when they defending base and damaged.
-Repairs vehicles after destroying one computer/player. (after battle, return to base and repair)
-Selling unused harvesters in service depot when all ore on map is collected. (and no ore mines at all)
-Selling some vehicles in service depot when they has no money, no harvesters and no unnecessary buildings.
-Mechanic follow friendly troops to enemy base, but if troops stops, mechanic stay in back of tank crowd for safety. Like this:
B - base which AI player attacked.
T - AI troops.
M - Mechanic(s).
BBBB T TT
BBBB TT TT
BBBB TTT T M
BBBB T TT TT
BBBB T T T
-Engineers to repair buildings. Place engineers near construction yard, war factories, and other important buildings, then repairs after buildings critically damaged.
Attacking and moving.
-Can flee the battle sometimes, example:
HackyAI trying to destroy enemy ore truck > enemy defend truck and send many tanks > HackyAI saw there are no chance and flees to base.
  
-Send supply trucks to ally. In this cases: HackyAI have ally player/computer, player have no money (0-50 or something), and HackyAI have much money. (10000 and more, or something)
Harvest and resources.
-If ore trucks collect both gold and crystals, they more preferred to collect crystals instead of gold.
Buildings and stuff.
-Place SAMS and AA Guns in direction where enemy plane with paratroopers dropped first time. (may be in place which close to map edge?)
-If ore very near to base, place ore refineries in that direction, near ore.
-Produce MCV's and able to build new bases in other places on map.
-Selling all buildings if there are no chances. (Example: HackyAI have 4 SAMS, 2 power plants, 2 silos, then sell all buildings and attack. This means there are no key buildings, and no money, like in Red Alert 1)
On water.
-Using a transports with units, looking for shore tiles to landing.
-Using helicarriers with helicopters, send with group of ships/subs, and protect them.
Tricky.
-Minelayers lay mines near small/big bridges and river passes, then return to service depot for reloading mines (probably HackyAI trying to find tile with bridge/river pass. Other mine tactic may be hard to implement for now).
-Destroying bridges near enemy bases in some cases.
-Hide infantry under the trees. Like rocket soldiers, dogs, or something. (HackyAI search where is a tree)
-If lose all units and structures (means enemy attack with many units, HackyAI only have group of 2-5 weak technicians and gunners), then split and try to run away from enemy in opposite direction (Cowards?). Probably in some cases.
-Shoot and run tactics. Artillery or V2RL shoot in enemy buildings 1-2 times, then return back to base/previous place.
-Using thiefs. Especially after spy infiltrated enemy ore refineries (in this case HackyAI know how much money available, 6000-12000 whoa... it's good to try steal some money)
			
			
									
									
						*some units or features not yet in OpenRA, but it would be possible in future.
Service depot and repairing/restoring.
-Repairs air units on service depot when they damaged.
-Repairs submarines/ships in subpens/shipyards where they near base and damaged.
-Repairs vehicles when they defending base and damaged.
-Repairs vehicles after destroying one computer/player. (after battle, return to base and repair)
-Selling unused harvesters in service depot when all ore on map is collected. (and no ore mines at all)
-Selling some vehicles in service depot when they has no money, no harvesters and no unnecessary buildings.
-Mechanic follow friendly troops to enemy base, but if troops stops, mechanic stay in back of tank crowd for safety. Like this:
B - base which AI player attacked.
T - AI troops.
M - Mechanic(s).
BBBB T TT
BBBB TT TT
BBBB TTT T M
BBBB T TT TT
BBBB T T T
-Engineers to repair buildings. Place engineers near construction yard, war factories, and other important buildings, then repairs after buildings critically damaged.
Attacking and moving.
-Can flee the battle sometimes, example:
HackyAI trying to destroy enemy ore truck > enemy defend truck and send many tanks > HackyAI saw there are no chance and flees to base.
-Send supply trucks to ally. In this cases: HackyAI have ally player/computer, player have no money (0-50 or something), and HackyAI have much money. (10000 and more, or something)
Harvest and resources.
-If ore trucks collect both gold and crystals, they more preferred to collect crystals instead of gold.
Buildings and stuff.
-Place SAMS and AA Guns in direction where enemy plane with paratroopers dropped first time. (may be in place which close to map edge?)
-If ore very near to base, place ore refineries in that direction, near ore.
-Produce MCV's and able to build new bases in other places on map.
-Selling all buildings if there are no chances. (Example: HackyAI have 4 SAMS, 2 power plants, 2 silos, then sell all buildings and attack. This means there are no key buildings, and no money, like in Red Alert 1)
On water.
-Using a transports with units, looking for shore tiles to landing.
-Using helicarriers with helicopters, send with group of ships/subs, and protect them.
Tricky.
-Minelayers lay mines near small/big bridges and river passes, then return to service depot for reloading mines (probably HackyAI trying to find tile with bridge/river pass. Other mine tactic may be hard to implement for now).
-Destroying bridges near enemy bases in some cases.
-Hide infantry under the trees. Like rocket soldiers, dogs, or something. (HackyAI search where is a tree)
-If lose all units and structures (means enemy attack with many units, HackyAI only have group of 2-5 weak technicians and gunners), then split and try to run away from enemy in opposite direction (Cowards?). Probably in some cases.
-Shoot and run tactics. Artillery or V2RL shoot in enemy buildings 1-2 times, then return back to base/previous place.
-Using thiefs. Especially after spy infiltrated enemy ore refineries (in this case HackyAI know how much money available, 6000-12000 whoa... it's good to try steal some money)
- 
				BenjaminLSR
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
AAAAAHHHHHHHHH !!!!!
someone had to say that...
Ok, let's say I need to prepare the code for such TODO.
I need it to be clearer and optimized before we go any further.
Also i would be pleased if those todo list could be more segmented and closer to code.
AI cooperation will come in a 2nd time, once units are "brained".
Something like:
Spy:
- Infiltrate power when enemy have superpowers.
- Infiltrate refinery when current ore is low.
- ACTION when CONDITION.
			
			
									
									
						someone had to say that...
Ok, let's say I need to prepare the code for such TODO.
I need it to be clearer and optimized before we go any further.
Also i would be pleased if those todo list could be more segmented and closer to code.
AI cooperation will come in a 2nd time, once units are "brained".
Something like:
Spy:
- Infiltrate power when enemy have superpowers.
- Infiltrate refinery when current ore is low.
- ACTION when CONDITION.
- 
				BenjaminLSR
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
Hi everyone,
I've been quite busy with my workd and studies lately.
I'm also trying to recode the whole thing in a more proper way.
I don't know if I've got enough skill to make the AI reach you're goal. I will try to improve it as much as I can. Yet I'm focusing on "STANDARD" behaviors and AI "BRAIN".
AI is using troops as squads.
AI can build only X number of the same building.
AI can build X number of the same building once ticks per iteration is reached.
			
			
									
									
						I've been quite busy with my workd and studies lately.
I'm also trying to recode the whole thing in a more proper way.
I don't know if I've got enough skill to make the AI reach you're goal. I will try to improve it as much as I can. Yet I'm focusing on "STANDARD" behaviors and AI "BRAIN".
AI is using troops as squads.
Code: Select all
Dictionary<string, List<string>> afinities = new Dictionary<string, List<string>>()
        {
            {"e1", new List<String>(){"Assault","Long"}},
            {"e3", new List<String>(){"Assault","Long"}},
            {"e4", new List<String>(){"Assault","Long"}},
            {"dog", new List<String>(){"Defense"}},
            {"e6", new List<String>(){"Assault","Defense"}},
            {"medi", new List<String>(){"Defense","Assault"}},
            {"e7", new List<String>(){"Assault"}},
            {"spy", new List<String>(){"Assault"}},
            {"shok", new List<String>(){"Assault"}},
            {"harv", new List<String>(){"Harvest"}},
            {"yak", new List<String>(){"Air"}},
            {"heli", new List<String>(){"Air"}},
            {"mig", new List<String>(){"Air"}},
            {"hind", new List<String>(){"Air"}}
        };Code: Select all
/* Squad react */
            foreach (Squad squad in squads.Where(a => a.isFull()))
            {
                switch (squad.type)
                {
                    case "Assault":
                        BotDebug("Sending ASSAULT");
                        attackTarget = ChooseEnemyTarget();
                        CPos attackTargetLocation = attackTarget.CenterLocation.ToCPos();
                        squad.Move(attackTargetLocation, true);
                        squad.TryAttackNearBy();
                        break;
                    case "Harvest":
                        squad.Harvest();
                        break;
                }
            }AI can build X number of the same building once ticks per iteration is reached.
Code: Select all
Dictionary<string, int> BuildingLimits = new Dictionary<string, int>()
        {
            {"dome", 1},
            {"proc", 4},
	        {"stek", 1},
	        {"atek", 1},
	        {"fix", 1},
	        {"barr", 2},
	        {"tent", 2},
	        {"weap", 2},
	        {"spen", 1},
	        {"syrd", 1}
        };
        Dictionary<int, int> TicketsLimits = new Dictionary<int, int>()
        {
            {0, 0},
            {1, 6000},
            {2, 12000},
            {3, 18000}
        };It seems to crash on small maps where there is few space to build (this happened on Man to Man after few seconds)
			
			
									
									
						Code: Select all
Exception of type `System.NullReferenceException`: Object reference not set to an instance of an object
  at OpenRA.Mods.RA.AI.HackyAI.ChooseBuildLocation (System.String actorType, Boolean defense) [0x00082] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Mods.RA/AI/HackyAI.cs:646 
  at OpenRA.Mods.RA.AI.BaseBuilder.Tick () [0x0018d] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Mods.RA/AI/BaseBuilder.cs:83 
  at OpenRA.Mods.RA.AI.HackyAI.Tick (OpenRA.Actor self) [0x00090] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Mods.RA/AI/HackyAI.cs:816 
  at OpenRA.World.<Tick>m__79 (TraitPair`1 x) [0x00000] in /home/matthias/Projekte/OpenRA-AI/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__AnonStorey28`1[OpenRA.TraitPair`1[OpenRA.Traits.ITick]].<>m__4D (TraitPair`1 x) [0x0000c] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Game/WorldUtils.cs:157 
  at OpenRA.Exts.Do[TraitPair`1] (IEnumerable`1 e, System.Action`1 fn) [0x00013] in /home/matthias/Projekte/OpenRA-AI/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-AI/OpenRA.Game/WorldUtils.cs:154 
  at OpenRA.World.Tick () [0x000e0] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Game/World.cs:175 
  at OpenRA.Game.Tick (OpenRA.Network.OrderManager orderManager) [0x0017a] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Game/Game.cs:184 
  at OpenRA.Game.Tick (OpenRA.Network.OrderManager orderManager, OpenRA.Graphics.Viewport viewPort) [0x00030] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Game/Game.cs:131 
  at OpenRA.Game.Run () [0x00026] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Game/Game.cs:335 
  at OpenRA.Program.Run (System.String[] args) [0x00010] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Game/Support/Program.cs:91 
  at OpenRA.Program.Main (System.String[] args) [0x0002b] in /home/matthias/Projekte/OpenRA-AI/OpenRA.Game/Support/Program.cs:36- 
				BenjaminLSR
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
more crash
			
			
									
									
						Code: Select all
Platform is Linux
Using Gl renderer
Desktop resolution: 1366x768
Using resolution: 1318x720
Available mods:
	cnc: C&C ({DEV_VERSION})
	d2k: Dune 2000 (beta) ({DEV_VERSION})
	example: Example Mod (a0001)
	ra: Red Alert ({DEV_VERSION})
	ra_perf: RA Perf (a0001)
Loading mods: ra
Game started
Game started
Game started
Exception of type `System.InvalidOperationException`: Attempted to get trait from destroyed object (e1 111 (not in world))
  at OpenRA.TraitDictionary.CheckDestroyed (OpenRA.Actor actor) [0x00000] in <filename unknown>:0 
  at OpenRA.TraitDictionary.Contains[CrushableInfantry] (OpenRA.Actor actor) [0x00000] in <filename unknown>:0 
  at OpenRA.Actor.HasTrait[CrushableInfantry] () [0x00000] in <filename unknown>:0 
  at OpenRA.Mods.RA.AI.Squad.React () [0x00000] in <filename unknown>:0 
  at OpenRA.Mods.RA.AI.BetaAI.AssignRolesToUnits (OpenRA.Actor playeractor) [0x00000] in <filename unknown>:0 
  at OpenRA.Mods.RA.AI.BetaAI.Tick (OpenRA.Actor self) [0x00000] in <filename unknown>:0 
  at OpenRA.World.<Tick>b__7 (TraitPair`1 x) [0x00000] in <filename unknown>:0 
  at (wrapper delegate-invoke) System.Action`1<OpenRA.TraitPair`1<OpenRA.Traits.ITick>>:invoke_void__this___TraitPair`1<ITick> (OpenRA.TraitPair`1<OpenRA.Traits.ITick>)
  at OpenRA.WorldUtils+<>c__DisplayClass18`1[OpenRA.TraitPair`1[OpenRA.Traits.ITick]].<DoTimed>b__17 (TraitPair`1 x) [0x00000] in <filename unknown>:0 
  at OpenRA.Exts.Do[TraitPair`1] (IEnumerable`1 e, System.Action`1 fn) [0x00000] in <filename unknown>:0 
  at OpenRA.WorldUtils.DoTimed[TraitPair`1] (IEnumerable`1 e, System.Action`1 a, System.String text, Double time) [0x00000] in <filename unknown>:0 
  at OpenRA.World.Tick () [0x00000] in <filename unknown>:0 
  at OpenRA.Game.Tick (OpenRA.Network.OrderManager orderManager) [0x00000] in <filename unknown>:0 
  at OpenRA.Game.Tick (OpenRA.Network.OrderManager orderManager, OpenRA.Graphics.Viewport viewPort) [0x00000] in <filename unknown>:0 
  at OpenRA.Game.Run () [0x00000] in <filename unknown>:0 
  at OpenRA.Program.Run (System.String[] args) [0x00000] in <filename unknown>:0 
  at OpenRA.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
AL lib: ALc.c:1879: exit(): closing 1 Device
AL lib: ALc.c:1808: alcCloseDevice(): destroying 1 Context(s)
AL lib: ALc.c:1420: alcDestroyContext(): deleting 32 Source(s)
Inconsistency detected by ld.so: dl-close.c: 731: _dl_close: Assertion `map->l_init_called' failed!
- 
				BenjaminLSR
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
Trying out and giving feedback
You can try it out the recent versions (no install):
svn: http://xp-dev.com/svn/openRA/
			
			
									
									
						- rev35 -> Superpower, ore cheating (cause crash on multiplayer) http://www.bigwaste.fr/ra1/openRA%20-%2 ... 0rev35.zip
- rev36 -> No superpower, no cheat (stable)http://www.bigwaste.fr/ra1/openRA%20-%2 ... 0rev36.zip
svn: http://xp-dev.com/svn/openRA/
He needs ppl to help with yaml. He's written over 1200 lines code, but most can be configured in yaml (what to attack, build etc)Cmd. Matt wrote: ↑Btw I like the early Yak/Heli and Jeep attacks. However the AI has problems reloading their aircrafts. They immediately take up again.
I can't find anything new to configure at http://xp-dev.com/svn/openRA/mods/ra/rules/system.yaml It looks like everything is still hardcoded to http://xp-dev.com/svn/openRA/OpenRA.Mod ... HackyAI.cszypres1 wrote: ↑He needs ppl to help with yaml. He's written over 1200 lines code, but most can be configured in yaml (what to attack, build etc)
You should really just fork https://github.com/OpenRA/OpenRA instead of using this private read-only SVN
- 
				BenjaminLSR
- Posts: 43
- Joined: Sun May 22, 2011 3:26 pm
Next release will support customisation: http://pastebin.com/FFLke1skCmd. Matt wrote: ↑I can't find anything new to configure at http://xp-dev.com/svn/openRA/mods/ra/rules/system.yaml It looks like everything is still hardcoded to http://xp-dev.com/svn/openRA/OpenRA.Mod ... HackyAI.cszypres1 wrote: ↑He needs ppl to help with yaml. He's written over 1200 lines code, but most can be configured in yaml (what to attack, build etc)
You should really just fork https://github.com/OpenRA/OpenRA instead of using this private read-only SVN
Github: https://github.com/Valkirie/OpenRA


