Page 2 of 3
RE: Command AI [Beta]
Posted: Sat Nov 25, 2017 10:19 am
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
RE: Command AI [Beta]
Posted: Sat Nov 25, 2017 10:25 am
by Maromak
Very impressive stuff!
RE: Command AI [Beta]
Posted: Sat Nov 25, 2017 11:01 am
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.
RE: Command AI [Beta]
Posted: Sat Nov 25, 2017 8:01 pm
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.
RE: Command AI [Beta]
Posted: Sun Nov 26, 2017 6:09 am
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.
RE: Command AI [Beta]
Posted: Sun Nov 26, 2017 10:06 am
by DrRansom
This is amazing, good work and good luck for the future!
RE: Command AI [Beta]
Posted: Sun Nov 26, 2017 5:15 pm
by angster
Thanks for the fix Dimitris. As for the language conversion, I have a working fix, so all's good.
RE: Command AI [Beta]
Posted: Sun Nov 26, 2017 7:16 pm
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
RE: Command AI [Beta]
Posted: Mon Nov 27, 2017 6:43 am
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.
RE: Command AI [Beta]
Posted: Mon Nov 27, 2017 3:02 pm
by Maromak
dis gon b gud!

RE: Command AI [Beta]
Posted: Mon Nov 27, 2017 3:51 pm
by mikmykWS
RE: Command AI [Beta]
Posted: Mon Nov 27, 2017 11:29 pm
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.
RE: Command AI [Beta]
Posted: Sat Dec 02, 2017 1:53 am
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.
RE: Command AI [Beta]
Posted: Sat Dec 02, 2017 3:50 am
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.
RE: Command AI [Beta]
Posted: Sat Dec 02, 2017 2:31 pm
by angster
Don't worry, as long as the "destroyHuman" variable is set to false, we should all be fine.
RE: Command AI [Beta]
Posted: Sat Dec 02, 2017 5:00 pm
by thewood1
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]
Posted: Sat Dec 02, 2017 8:33 pm
by ComDev
Wow [X(]
RE: Command AI [Beta]
Posted: Sun Dec 03, 2017 5:15 pm
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.

RE: Command AI [Beta]
Posted: Sun Dec 03, 2017 8:56 pm
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.
RE: Command AI [Beta]
Posted: Sat Apr 28, 2018 7:01 am
by serjames
Hi angster.
Any recent updates ? I was hoping to try and drop the module into some older missions I love to replay ?