Command Mission AI - Ares-Lite v1.1 (NEW) (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


angster -> Command Mission AI - Ares-Lite v1.1 (NEW) (11/21/2017 1:30:59 AM)

Ares-Lite is a more practical redesign of the original Ares AI. Instead of creating its own missions sets, the lite version will work with existing user defined missions and parameters. Ares-Light seeks to improve the survivability and effectiveness of assigned units while giving the user the ability to assign AI to tailored missions. Units under the AI will take advantage of the recent update on engagement rules (http://www.warfaresims.com/?p=4884). Units will push harder and exploit LOS restrictions on most units.

Installation guide and sample scenario are in attached.

------------------------------
Features:
------------------------------
1.) Categorize units by roles (AAW, AG, ASUW) by their payload and assigned mission. No more reference files. (NEW)
2.) Units will avoid missiles on first detection instead of last possible moment. (OLD)
3.) Updated avoidance to factor in ARH seeker heads. Units will attempt to dive and retreat outside the FOV of ARH missiles. (NEW)
4.) Avoidance behavior based on roles (EX: AAW will avoid SAMS and Ships) (OLD)
5.) Avoidance behavior is divided into two methods. (NEW)
a.) Line of Sight avoidance - Units will attempt to fly under the radar and still approach threats. To improve fuel efficiency, units will fly at the maximum height possible while avoiding radar. Height values are pre-determined by the distance to horizon equation.
b.) Hard avoidance - When line of sight avoidance can no longer mask a unit's approach, the unit will attempt to avoid the threat altogether.
6.) Units under Strike Missions will attempt fly under radar to avoid any detected SAMs or ships. They will "Pop-up" only when close to the target. (NEW)
7.) Units under Patrols (SEAD, Land, Anti-ship) will occasionally "Pop-up" to detect and engage targets. (NEW)
8.) Unit avoidance will only trigger on contact detection. The better the ELINT, the better the unit will perform. (NEW)
9.) Ares-Lite will command missions containing the tag "<Ares>" in the mission name. The AI will ignore any missions without the tag. (NEW)
10.) Improved retreat logic. RTB units will now factor their home base when determining retreat vector. (NEW)

------------------------------
Sample Scenario Summary:
------------------------------
This scenario is designed to test the effectiveness of Ares-Lite. Blue Team, under control of the AI, will be facing an assortment of high-tech air, land, and naval threats. The main objective is to destroy all priority targets while minimizing losses if possible. In order to successfully complete the mission, the AI must perform the following:

a.) Execute AAW patrol missions inside the engagement envelops of hostile SAM's and ships.
b.) Execute ASUW patrol inside hostile SAM and air cover.
c.) Execute Land Strikes against targets protected by air, land and naval threats.

Blue Team
------------------------------
Blue Team consists of 4.5 generation fighters:
a.) 16x F-15C (AMRAAM-D) => AAW Patrol
b.) 12x Rafale M (Exocet) and 6x F-15E (SDB II) => ASUW Patrol
c.) 10x F-15E (SDB II) => Land Strike
d.) 8x EA-18G (AARGM) => Sead Patrol
e.) 3x Phalcon (AEW) => Support Patrol

Red Team
------------------------------
Red Team consists of 4.5 and 5th generation fighters, backed by high tier SAMs and ships:
a.) 24x Eurofighter (AMRAAM-C5)
b.) 6x F-22A (AMRAAM-C7)
c.) 1x Arleigh Burke Destroyer BLK3 (ESSM,SM-6)
d.) 2x Type 45 Daring Destroyer (Aster-15, Aster-30)
e.) 3x David Sling SAM Battery
f.) 3x PAC-2 Patriot SAM Battery

Scoring
------------------------------
Scoring is used to determine AI performance. AI will lose or gain points based on kills and losses in the following amount:
a.) 4th/4.5 Generation Fighters => 10pts
b.) 5th Generation Fighters => 20pts
c.) Ships and SAM batteries => 40pts
d.) Priority Land Target => 10pts
e.) Radar => 10pts
f.) AEW Aircraft => 20pts

------------------------------
Update v1.1
------------------------------
a.) Modified scenario to add AEW to Red Team and add more units to Blue Team
b.) Improved AEW height approach
c.) Memory usage improvement




Rory Noonan -> RE: Command AI [Beta] (11/21/2017 8:22:38 AM)

Very impressive angster!




mikmykWS -> RE: Command AI [Beta] (11/21/2017 2:35:50 PM)

Cool!

Mike




DWReese -> RE: Command AI [Beta] (11/21/2017 3:04:07 PM)

The link that you provided is apparently down, so I have no background for my question.

You have put in a tremendous amount of work in this project. It looks great.

My observations:

I have been playing (watching) your training scenario for a while. I see somethings that I like, and others that I am puzzled by. For instance, many AA missiles are fired a such a long range that almost all of them miss. Additionally, everyone of the LRASM were either shot down (a few) or simply impacted the surface without damaging anything. I'm not sure what they are supposed to do, but they didn't accomplish anything. I'm not familiar with that missile.

In my opinion, you have too many units involved to successfully display the various "changes" in your methodology. I find myself watching this, or that, and I can't ever seem to "learn" whatever it is that you are trying to exhibit.

Personally, I would love to see a slimmed down version (less units, more of a tutorial type) of the way that your procedure works, AND some POP UP MESSAGES that detail the changes what we are observing in the "play methodology" of your actions. In other words, if you TELL US what the differences are that we are seeing, it will make it more apparent to all. I really think that that would help.

You have done a great job. I would be interested in what others think.

Doug




angster -> RE: Command AI [Beta] (11/21/2017 5:13:25 PM)

Hey DWReese, the LUA script AI should complement the one in Command. The lua AI acts just like a player by creating and updating missions. Occasionally, it will give direct course corrections to individual units if it is too near of a threat, just like a player would. In the scenario, you will see that the F-35C on air patrol will try to maintain distance from the ships and sams until the threat is taken out. The RQ-180 demonstrate this by occasionally course correcting away from potential threats.

For the Amraam and LRSAM issues, they can be fixed by slight in game doctrine changes (next update). I will also be adding land targets to demonstrate AI land attack ability. Good point on the scenario scale, I'll probably make it simpler in the near future.




hellfish6 -> RE: Command AI [Beta] (11/21/2017 6:04:05 PM)

I'm keen to try this when you're ready to upload it again.




DWReese -> RE: Command AI [Beta] (11/21/2017 6:33:45 PM)

Thanks for the reply. I am still going through the scenario and I'll pass along some other observations as they come around, if you like.

I do like the concept of better intelligence means netter performance, so I do enjoy what you are attempting to do.

Keep it up.

Doug




Filitch -> RE: Command AI [Beta] (11/21/2017 6:37:45 PM)

angster It's impressive! Take off hat to your job.

Unfortunately, I got an error "Lua script execution error: [string "Loading AI Scripts"]:208: attempt to perform arithmetic on local 'lon2' (a string value)"
I think this is in function MidPointCoordinate(lat1,lon1,lat2,lon2)




gosnold -> RE: Command AI [Beta] (11/21/2017 9:10:09 PM)


quote:

ORIGINAL: Filitch

angster It's impressive! Take off hat to your job.

Unfortunately, I got an error "Lua script execution error: [string "Loading AI Scripts"]:208: attempt to perform arithmetic on local 'lon2' (a string value)"



Same here in build 972.11.




angster -> RE: Command AI [Beta] (11/21/2017 9:23:34 PM)

Hmm... I'll take a look at it tonight.




angster -> RE: Command AI [Beta] (11/21/2017 10:44:55 PM)

Aha! Found the issue. The error happens when the language preference is Russia/French or any language that replace "." with ",". I'll have to investigate this further but if you change the language preference to English, it will resolve the issue.

For Windows 10, it will be:
1.) Go to Settings
2.) Time & language
3.) Additional date,time,regional settings
4.) Change date,time, or number formats
5.) Change from Format to English (United States)
6.) Restart CMANO

This should resolve the problem for now, but I'll see if there's a more permanent solution to this.


Also, thanks for the feedback DWReese. Any suggestions or feedbacks are most welcome.




Dragon029 -> RE: Command AI [Beta] (11/22/2017 12:59:52 AM)

I tried out the AI and it works great! It does sometimes do silly things, but it did manage to eliminate all flying red air in 4 simulated hours and (with some Time to Ready cheats) destroyed 100% of red air / naval assets within 8 simulated hours.

I haven't looked much through the code (there's a fair bit), but I did examine your scenario to observe how the Lua script was implemented in regards to events, triggers and actions and I ended up being able to create my own scenario that implements the AI. I understand that this is a work in progress, but I hope you don't mind if I provide a guide for others?

To implement angster's AI as of the time of this post (22 November 2017):

1. Go to angster's scenario, go to Editor / Event Editor / Actions, go to edit each of the 3 actions and copy the Lua scripts into separate Notepad (or an equivalent text editor) files (for ease of storage). Also be sure to record the names of each action / Lua script (I list them below though). Once you have the Lua code, exit out.

2. Create a new scenario (with any name), with 2 sides: "Blue Force" and "Red Force"; set them to be hostile to one another but skill level, etc can be whatever you want.

3. Go to Editor / Event Editor / Actions and recreate the 3 actions from the original scenario (remember that you have to select "Lua script" from the dropdown box before you can click the "Create new action:" button). When creating these actions, be sure to have "Load Functions - DBLoad Override", "Load Functions - Merimack Monitor AI" and "Update AI Functions" as the 'description' of each action. Lua script goes into the big blank box.

4. Go to Editor / Event Editor / Triggers; here we need to create 3 triggers:
a)"Scenario is Loaded" - select that from the dropdown box and create it; nothing else required,
b)Select 'regular time' and create a new trigger, put "Trigger - Every Five Seconds" into the description and from the dropdown box, select 'Five Seconds',
c)Do the same as last time, but give it the description of "Trigger - Load Every Minute" and set it to fire every 'one minute'.
Once those 3 are created, exit out of that window.

5. Go to Editor / Event Editor / Events; here we need to create 2 events:
a)Description = "Loading AI Scripts", only tick the 'Event is active' and 'Event is shown in Log' boxes, leave probability at 100%. For the triggers, add "Trigger - Every Five Seconds". For the actions, add "Load Functions - DBLoad Override" and "Load Functions - Merimack Monitor AI". Then click OK.
b)Description = "Update AI", only tick the 'Event is repeatable' and 'Event is active' boxes, leave probability at 100%. Add the trigger "Trigger - Load Every Minute" and the action "Update AI Functions", click OK.

6. Create your scenario; as angster alluded, you can use whatever units you want, not just the ones in the demonstration scenario. Do not run the scenario yet.

7. Create 4 reference points on the map for Blue Force, they must be named "AI-AO-1", "AI-AO-2", "AI-AO-3" and "AI-AO-4". As their name suggests, these points will mark out the area of operations for the AI. I haven't done enough testing to fully 100% understand how the AI treats this area, but it should essentially envelope all of the airspace that you want Blue Force to recon, defensively protect and offensively engage within. Once it has those 4 reference points, it'll generate its own mission areas inside and outside the AO (SEAD / DEAD missions inside it, support missions like AEW outside it).

Once that's done, you're done and you can try the scenario out - as a reminder, only Blue Force will be the smart AI; you have to control Red Force or otherwise set up conventional missions for them (it shouldn't be super hard to edit "Load Functions - Merimack Monitor AI" and have both sides be AI, but I haven't attempted that).

Edit:

Also I should add for those that have been having issues, that angster's [originally posted] scenario runs DB3000 build 469 and ran fine on my copy of CMANO (v1.13 - Build 972.5). My own scenario using his AI worked fine on DB3000 build 470 as well.




angster -> RE: Command AI [Beta] (11/22/2017 2:34:20 AM)

Thanks for the guide dragon, good work! [8D]

Here's a few additional areas you can customize:

1.) You can actually apply the AI to whatever side you want as long as that side has the reference points "AI-AO-1", "AI-AO-2", "AI-AO-3" and "AI-AO-4".

Find the following lines at the bottom the "Load Functions - Merimack Monitor AI" script:

local sideOption = ScenEdit_GetSideOptions({side="Blue Force"})
InitializeMerimackMonitorAI(sideOption.guid,"a")

You can change "Blue Force" to the side you want.

2.) You can also add multiple AI's to multiple sides (Haven't tested it myself though)

Find the following lines at the bottom the "Load Functions - Merimack Monitor AI" script:

local sideOption = ScenEdit_GetSideOptions({side="Blue Force"})
InitializeMerimackMonitorAI(sideOption.guid,"a")

Add Additional AI:

sideOption = ScenEdit_GetSideOptions({side="Red Force"})
InitializeMerimackMonitorAI(sideOption.guid,"b")

NOTE: The InitializeMerimackMonitorAI function's second parameter must be single letter and unique, also Red Force must have reference points "AI-AO-1", "AI-AO-2", "AI-AO-3" and "AI-AO-4".

3.) The AI prioritize specialty aircraft over multi-role aircraft. This means that a F-15 (Fighter) will be deployed before a F-22 (multirole). To prevent this from happening, you can tell the AI by adding an entry in "Load Functions - DBLoad Override"

Ex: ScenEdit_SetKeyValue("lo_25342","fig")
In this example, the 25342 is an AMRAAm payload linked to F-22 in fighter configuration. This will tell the AI to identify this F-22 as a "Fighter"




Dimitris -> RE: Command AI [Beta] (11/22/2017 11:03:07 AM)

quote:

ORIGINAL: angster

Aha! Found the issue. The error happens when the language preference is Russia/French or any language that replace "." with ",". I'll have to investigate this further but if you change the language preference to English, it will resolve the issue.

For Windows 10, it will be:
1.) Go to Settings
2.) Time & language
3.) Additional date,time,regional settings
4.) Change date,time, or number formats
5.) Change from Format to English (United States)
6.) Restart CMANO

This should resolve the problem for now, but I'll see if there's a more permanent solution to this.


That may indicate a bug in our Lua parsing. We had to deal with commas and periods at various times in the past and this may be one more such case. We'll have a look.




angster -> RE: Command AI [Beta] (11/22/2017 8:17:12 PM)

Thanks Dimitris for looking into it.

A minor thing I noticed => Accessing the loadout id of an aircraft with "No Loadout" will throw an exception for some reason.




gosnold -> RE: Command AI [Beta] (11/22/2017 9:04:03 PM)

I used your fix in the language settings and now it works (I had French format set before). I'm impressed by your AI, blue force managed to destroy red force (it took a few losses as I adjusted WRA to fire the AMRAAMs from closer). I'll try to plug it in a scenario of mine see how it fares.




serjames -> RE: Command AI [Beta] (11/23/2017 12:53:54 PM)

This is potentially Game changing..

Would it be possible to build in some sort of randomisation function.

e.g. Choose your period, side, location and type of mission etc... and then a function would correctly populate airbases naval stations etc... and then provide a credible enemy and mission objective for the AI to accomplish.. Would make a new game practically...

Very excited to try this out and see if I can bolt the existing AI scripts onto existing missions... Talk about re-play-ability !

Thanks for this !




serjames -> RE: Command AI [Beta] (11/23/2017 6:53:14 PM)

Wow... amazing job ! Really impressed with this.

I think some of the Tactics the AI have used could be subject to refinement - e.g. doctrine, EMCON etc.. The basics are all there - So clever.




angster -> RE: Command AI [Beta] (11/24/2017 3:22:53 AM)

Hey serjames, thanks for your response. The idea of random function to generate a scenario sounds cool. Currently, I'm thinking about ways to improve the existing AI (EMCON is a top item) and make it more portable for players. Here's a short list of items I'm planning to tackle in the future.

1.) Better User setup => In theory, I want the user to add only one lua line in order to setup the AI. The area of operations will be optional with the AI determining the search area if no user AO points are provided.
2.) Land Attack Capability
3.) Offensive AEW and Tankers => I want patrols and strike packages to be accompanied by AEW and tanker support.
4.) Create Strike Packages in addition to simple patrols
5.) User modifiable AI personality => User can setup the personality of an AI, the AI can be purely offensive, defensive or mixture of both
6.) Smart EMCON => Patrols accompanied by AEW's should not have their radar turned on and other examples.




gosnold -> RE: Command AI [Beta] (11/24/2017 6:48:24 PM)

Regarding EMCON I can suggest this:
- turn off ground radars when over land, as they don't detect fixed ground units currently
- be more conservative with EMCON for stealthy platforms, in order not to give them away




gosnold -> RE: Command AI [Beta] (11/25/2017 12:19:59 PM)

I tried to set it up for a scenario of mine but I get an error. It tracked it down a little bit and it is due to a bug occurring when updating the AI aircraft inventory.
The error message displayed in the message log is
[string "local function index(obj,name)..."]:7: A .NET exception occurred in user code




Maromak -> RE: Command AI [Beta] (11/25/2017 12:25:43 PM)

Very impressive stuff!




angster -> RE: Command AI [Beta] (11/25/2017 1:01:59 PM)

Hey gosnold, Command returns an exception when the script tries to access aircraft with "No Loadout". You will need to give every aircraft at least a loadout. Hope this helps.




Dimitris -> RE: Command AI [Beta] (11/25/2017 10:01:14 PM)

Hi angster,

I had a look at the script execution error. I can confirm it happens only in European-style locales, which use commas instead of periods to mark decimals. The problem is in the method MidPointCoordinate(lat1,lon1,lat2,lon2), on the first line of the method (local dLon = math.rad(lon2 - lon1)). The problem seems to be that the inputs are treated as strings. In US locale, because of the period, they are automatically converted to decimal variables, but in European locale, because of the comma, this auto-conversion fails.

Unfortunately it's not something we can fix on our end since this is happening entirely in your code. This seems to be a fairly common issue with a number of solutions floating around:
http://www.luafaq.org/gotchas.html#T5
https://stackoverflow.com/questions/34906189/i-am-trying-to-convert-a-string-in-decimal-format-to-a-number-in-lua
https://www.lua.org/pil/2.4.html

If nothing else works, we can provide access to our own implementation of this method (it's a common GIS function) through the Lua API. This way we can also apply proper decimal filtering.




Dimitris -> RE: Command AI [Beta] (11/26/2017 8:09:09 AM)

quote:

ORIGINAL: angster
Thanks Dimitris for looking into it.

A minor thing I noticed => Accessing the loadout id of an aircraft with "No Loadout" will throw an exception for some reason.


Thanks for the heads up on this, fixed for the next update. Lua will now return "0" in such a case.




DrRansom -> RE: Command AI [Beta] (11/26/2017 12:06:55 PM)

This is amazing, good work and good luck for the future!




angster -> RE: Command AI [Beta] (11/26/2017 7:15:30 PM)

Thanks for the fix Dimitris. As for the language conversion, I have a working fix, so all's good.




serjames -> RE: Command AI [Beta] (11/26/2017 9:16:44 PM)

All sound very good Angster... perhaps you should speak with the Devs... I would happily pay for a developed AI Addon DLC / module.... This could be a gamechanger.. literally.

SJ




Dimitris -> RE: Command AI [Beta] (11/27/2017 8:43:41 AM)

Hi angster, one other thing that can help you with refining your theater AI.

The attached scen is from Mike Mykytyn, and is a port of his original H3 scen "The Humbler". It is a "mirror image" scen and pitches two identical US carrier groups against each other. It was designed explicitly so a human player can pit himself against the AI using the exact same equipment, so there is no advantage/handicap. This may be a good opportunity to test your AI against Command's standard built-in AI routines. (You will need to set up appropriate missions for the enemy side).

If you are going to need additional features from the Lua API, let usknow on the "Running Poll" thread.

Cheers.




Maromak -> RE: Command AI [Beta] (11/27/2017 5:02:33 PM)

dis gon b gud!

[image]local://upfiles/27647/91BB716BF2954F5ABDE1E53453E53B04.jpg[/image]




Page: [1] 2   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.609375