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

All discussions & material related to Command's Lua interface

Moderators: michaelm75au, angster, RoryAndersonCDT, MOD_Command

gosnold
Posts: 248
Joined: Wed Jul 10, 2013 5:37 pm

RE: Command AI [Beta]

Post by gosnold »

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
Attachments
2040Europe.zip
(629.8 KiB) Downloaded 668 times
User avatar
Maromak
Posts: 1071
Joined: Wed Dec 26, 2007 1:40 pm
Location: Australia

RE: Command AI [Beta]

Post by Maromak »

Very impressive stuff!
Certa Cito
angster
Posts: 89
Joined: Mon Oct 12, 2015 10:25 am

RE: Command AI [Beta]

Post by angster »

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
Posts: 15393
Joined: Sun Jul 31, 2005 10:29 am
Contact:

RE: Command AI [Beta]

Post by Dimitris »

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/349 ... ber-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
Posts: 15393
Joined: Sun Jul 31, 2005 10:29 am
Contact:

RE: Command AI [Beta]

Post by Dimitris »

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
Posts: 166
Joined: Sun Jul 14, 2013 12:52 pm

RE: Command AI [Beta]

Post by DrRansom »

This is amazing, good work and good luck for the future!
angster
Posts: 89
Joined: Mon Oct 12, 2015 10:25 am

RE: Command AI [Beta]

Post by angster »

Thanks for the fix Dimitris. As for the language conversion, I have a working fix, so all's good.
serjames
Posts: 201
Joined: Sun Feb 21, 2016 11:48 am

RE: Command AI [Beta]

Post by serjames »

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
Posts: 15393
Joined: Sun Jul 31, 2005 10:29 am
Contact:

RE: Command AI [Beta]

Post by Dimitris »

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.
Attachments
Humbler.zip
(100.91 KiB) Downloaded 202 times
User avatar
Maromak
Posts: 1071
Joined: Wed Dec 26, 2007 1:40 pm
Location: Australia

RE: Command AI [Beta]

Post by Maromak »

dis gon b gud!

Image
Attachments
popcornfight.jpg
popcornfight.jpg (81.76 KiB) Viewed 1299 times
Certa Cito
mikmykWS
Posts: 7185
Joined: Tue Mar 22, 2005 4:34 pm

RE: Command AI [Beta]

Post by mikmykWS »

Two men enter one man leaves

https://www.youtube.com/watch?v=9yDL0AKUCKo


Mike
angster
Posts: 89
Joined: Mon Oct 12, 2015 10:25 am

RE: Command AI [Beta]

Post by angster »

Nice! I will certainly try out that scenario once I have the second version of the AI complete. Hopefully things won't get busy and I have some time finishing it up.
angster
Posts: 89
Joined: Mon Oct 12, 2015 10:25 am

RE: Command AI [Beta]

Post by angster »

================================================
Version 2.0 Additions
================================================
1.) OODA changed to 30 seconds, allowing better response time
2.) AI is now aware of hostile missiles
3.) AI can now differentiate between 5th gen fighters and plebs
4.) AI will now use 5th gen fighters to do recon (Internal loadout only)
5.) AI will "attempt" to use 5th gen fighters to "Quarterback" offensive air patrols
6.) AI will now use AEW aircraft to support offensive air patrols
7.) AI planes in general will attempt to outrun missiles once detected
8.) Added threat range library to better estimate air defense ranges
9.) AI can un-assign units when necessary
10.) Dynamic AI area of operations, no map setup needed anymore
11.) Better EMCON discipline
12.) Setup initial AI personalities (work in progress)
13.) Added land attack ability

Added new Humbler scenario by Mike Mykytyn to test the AI against an equal opponent. Added a squadron of F-35 for both sides to make things spicier and demonstrate AI 5th gen tactics.

AI controls Stennis CBG, just load scenario and watch the AI do it's work.
Attachments
CommandAIProject.zip
(150.02 KiB) Downloaded 151 times
User avatar
Maromak
Posts: 1071
Joined: Wed Dec 26, 2007 1:40 pm
Location: Australia

RE: Command AI [Beta]

Post by Maromak »

By the time Skynet became self-aware it had spread into millions of computer servers across the planet. Ordinary computers in office buildings, dorm rooms; everywhere. It was software; in cyberspace. There was no system core; it could not be shutdown.
Certa Cito
angster
Posts: 89
Joined: Mon Oct 12, 2015 10:25 am

RE: Command AI [Beta]

Post by angster »

Don't worry, as long as the "destroyHuman" variable is set to false, we should all be fine.
thewood1
Posts: 10151
Joined: Sun Nov 27, 2005 6:24 pm
Location: Boston

RE: Command AI [Beta]

Post by thewood1 »

That's all well and good until SkyNet sends a T1000 back in time to change the "destroyHumans" flag to true.
ComDev
Posts: 3116
Joined: Fri May 12, 2006 1:20 pm
Contact:

RE: Command AI [Beta]

Post by ComDev »

Wow [X(]
Image

Developer "Command: Modern Air/Naval Operations" project!
User avatar
Maromak
Posts: 1071
Joined: Wed Dec 26, 2007 1:40 pm
Location: Australia

RE: Command AI [Beta]

Post by Maromak »

Played through once. I noticed that the AI switches aircraft very frequently between missions. Note: I was using a beta build at the time.



Image
Attachments
Capture2.jpg
Capture2.jpg (165.29 KiB) Viewed 1259 times
Certa Cito
angster
Posts: 89
Joined: Mon Oct 12, 2015 10:25 am

RE: Command AI [Beta]

Post by angster »

Thanks for looking into it. Looks like this is a case of AI having too much jobs and too few planes. The solution is probably prioritize missions and not allow the AI strip units from more important missions. Probably address this in the future.
serjames
Posts: 201
Joined: Sun Feb 21, 2016 11:48 am

RE: Command AI [Beta]

Post by serjames »

Hi angster.

Any recent updates ? I was hoping to try and drop the module into some older missions I love to replay ?
Post Reply

Return to “Lua Legion”