Command Mission AI - Ares-Lite v1.1 (NEW)
Moderators: michaelm75au, angster, RoryAndersonCDT, MOD_Command
RE: Command AI [Beta]
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
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
RE: Command AI [Beta]
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.
RE: Command AI [Beta]
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.
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.
RE: Command AI [Beta]
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.
RE: Command AI [Beta]
This is amazing, good work and good luck for the future!
RE: Command AI [Beta]
Thanks for the fix Dimitris. As for the language conversion, I have a working fix, so all's good.
RE: Command AI [Beta]
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
SJ
RE: Command AI [Beta]
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.
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
RE: Command AI [Beta]
dis gon b gud!


- Attachments
-
- popcornfight.jpg (81.76 KiB) Viewed 1299 times
Certa Cito
RE: Command AI [Beta]
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.
RE: Command AI [Beta]
================================================
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.
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
RE: Command AI [Beta]
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
RE: Command AI [Beta]
Don't worry, as long as the "destroyHuman" variable is set to false, we should all be fine.
RE: Command AI [Beta]
That's all well and good until SkyNet sends a T1000 back in time to change the "destroyHumans" flag to true.
RE: Command AI [Beta]
Played through once. I noticed that the AI switches aircraft very frequently between missions. Note: I was using a beta build at the time.


- Attachments
-
- Capture2.jpg (165.29 KiB) Viewed 1259 times
Certa Cito
RE: Command AI [Beta]
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.
RE: Command AI [Beta]
Hi angster.
Any recent updates ? I was hoping to try and drop the module into some older missions I love to replay ?
Any recent updates ? I was hoping to try and drop the module into some older missions I love to replay ?

