Page 1 of 1

[dev] Gecko AI

Posted: Mon Oct 04, 2010 10:09 pm
by Gecko
I'm currently working on creating a rather generic AI system for OpenRA (Only for the RA mod at this time)

You can find the most recent published sources @ http://github.com/geckosoft/OpenRA/tree/gecko_ai

I'll use this topic to inform of changes.

If you think you got a great idea for a bot to have, do tell :)

To give you the idea of the bot layout (system not feature complete yet):

Code: Select all

	RABot:
		InternalName: Gecko AI | Cheats!
		Brains:
			RETURN_FIRE:
				OnDamaged:					
					ReturnFire:
		Triggers:				
			INIT_CHEATS: Called on start (gives fast building) - Dev mode must be enabled!
				Enabled: true
				Actions:
					PlayerOrder: DevFastBuild
					DisableTrigger: 
			DETECT_MCV_DEPLOYED:
				Enabled: true
				Actions:
					Debug: MCV Deployed!
					DisableTrigger:
				Conditions:
					Actors: 
						fact: Detect CY
							<=Amount&#58; 1
			DETECT_CY_DESTROYED&#58;
				Enabled&#58; false					
				Conditions&#58;
					Actors&#58; 
						fact&#58; Detect CY
							Amount&#58; 0
				Actions&#58;
					Debug&#58; Construction Yard destroyed!
					DisableTrigger&#58;
					EnableTrigger&#58; DETECT_MCV_DEPLOYED	
			
		Groups&#58;
			BASESETUP&#58;
				Priority&#58; 2
				Actors&#58;
					powr&#58;
						Id&#58; PowerPlants
						Priority&#58; 1
					proc&#58;
						Requirements&#58;		
							Actors&#58;
								powr&#58; 1	
					tent&#58;
						Requirements&#58;		
							Actors&#58;
								powr&#58; 1
								proc&#58; 1		
					barr&#58;
						Requirements&#58;		
							Actors&#58;
								powr&#58; 1
								proc&#58; 1	
			WARFACTORY&#58;
				Priority&#58; 2
				Actors&#58;
					weap&#58; 1
				Requirements&#58;
					Group&#58; BASESETUP
			BASEUNITS&#58;
				Priority&#58; 3
				Actors&#58;
					e1&#58;
						Chance&#58; 50
						Amount&#58; 5
						Brain&#58; ONDAMAGEDTEST						
					e3&#58;
						Chance&#58; 50
						Amount&#58; 5
						Brain&#58; ONDAMAGEDTEST	
				Requirements&#58;
					Group&#58; BASESETUP
			AUTOPOWR&#58;
				Priority&#58; 3
				Description&#58; Automaticly builds Power Plants &#40;POWR&#41; when available energy is < 20% of total energy
				Actors&#58;
					powr&#58;
						CountActors&#58; false
						Requirements&#58;
							Power&#58;
								Type&#58; 1
								<Available%&#58; 20
								

[/code]

Posted: Mon Oct 04, 2010 10:15 pm
by Iran
Will it support splitting the AI mind into multiple files? How are you gonna handle different sides and difficulty settings?

This looks like a great start.

Posted: Mon Oct 04, 2010 10:20 pm
by Gecko
Mind is just stored in YAML, cant really split up.

I has support for multiple sides already : The AI works on all sides + you can, in the 'groups', define both barracks for example (soviet / allies) and it'll ignore if the building is from the other side.

Might improve this later, but with the new trigger system, you can do things clean and have different groups per side :)

Posted: Mon Oct 04, 2010 10:37 pm
by Iran
Hmm, that's a nice way to support multiple sides. Wouldn't it be possible to split taskforces and miscellaneous settings up into seperate YAML files? I could imagine that one file can get pretty big.

Posted: Mon Oct 04, 2010 11:35 pm
by Gecko
Actually, I think you can (ab)use Inherits for this :)

edit: Nope cant :(

Posted: Tue Oct 05, 2010 12:25 am
by chrisf
You can merge multiple yaml files just fine.

Posted: Mon Aug 27, 2012 11:45 am
by Matt
Note: someone offered a monetary bounty: Donating to AI dev