Yes the AI can react to threat and is able to change its behavior.
Its not changing a kind of strategy, but builder will change what they build or what they attack.
In case we use custom made functions then we can also cancel build orders or stop an ACU
enhancement when we need to move the ACU. My AI is using a custom function for the ACU and is
able to cancel enhancements.
And again thanks for your detailed hints how the AI should make the first decisions.
I said it already i am a turtle player. My only experience with a competitive opening is watching
replays from Nexus and Tagada.
Since you are very interested in how the AI works, here is a good example of how
complex is it to move just the ACU around.
Here is a link to the LUA code lines for the ACU:
You don't need to read the LUA code itself.
Just read the remark lines between the code (starting with --)
The function starts at line 3396 and ends in line 4181.
So there are about 780 lines of code needed to just move the ACU in a more smart way
than the original function.
The following function (ACUChampionBaseTargetThread) with 230 lines of code
is for the ACU targeting and awareness of enemy units around the ACU
Like Sprouto said, technically; Yes we can do everything.
But, you can't make every function more smart like the ACU function because we don't
have the CPU power for it.
The whole AI is programmed in LUA, and LUA is a language that is not precompiled.
The game is loading the plain LUA textfiles, then compiling it in a c-engine friendly format
and executes the LUA code.
And this is so incredibly slow compared to c-code.
But we can make better decisions on the start for buildorder or eco using.
(btw, upgrading the closest mex to the base is also a custom function,the original function
was uprading following the buildorder no matter how far away from the base the mex was)
We can't do anything but at least we can try to make a more competive 1vs1 AI.