Author Topic: Improving AI - what are the priorities?  (Read 23353 times)

0 Members and 3 Guests are viewing this topic.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #45 on: February 26, 2013, 10:31:58 AM »
It would really help me if I had some saves just before the situations where

a) AI is about to attack with an aircraft and instead of the base, it attacks a former nearby
b) AI moves to contact with a unit on a road but fails to attack, probably because of hurry penalty
c) AI moves his probe team too close to the base and it spends all its movement instead of waiting
d) AI should attack from the base but does not (with a unit whose attack >1)

and this is more complicated but possible to find
e) where AIs have unequal techs and could easily trade them in next turns, yet they do not

I am cautiously optimistic. But without these saves, it all remains in hypothesis. With them we may see the solutions. - Thanks!
« Last Edit: February 26, 2013, 12:10:44 PM by kyrub »

Offline ete

Re: Improving AI - what are the priorities?
« Reply #46 on: February 26, 2013, 04:41:17 PM »
I'll play my next game in SMAC (maybe with total vision on) and watch out for those saves. Or would using scenario editor be unlikely to make situations unrealistic? How much info does the AI save between turns? Not sure when my next game will be though, lots of wikiprojects.

Also, about b, the AI does not generally move to contact then fail to attack. They tend to just not move into an attack unless they can attack their target without a hurry penalty.

And for d, there's a few common situations where attacking from base with a one attack unit is by far the best option (e.g. a Chaos Rover with no armor is sitting outside a base defended by only a plasma garrison. 1 weapon vs 1 armor is a lot better than 3 defense against 8 attack, even if the garrison had to take a 33% penalty or there's a Perimeter Defense (though not both).).

Offline BFG

Re: Improving AI - what are the priorities?
« Reply #47 on: February 26, 2013, 05:57:57 PM »
It would really help me if I had some saves just before the situations where

a) AI is about to attack with an aircraft and instead of the base, it attacks a former nearby
c) AI moves his probe team too close to the base and it spends all its movement instead of waiting
Rats. I had both of these happen in a game a week ago but didn't think to save either one.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #48 on: February 26, 2013, 08:23:52 PM »
I'll play my next game in SMAC (maybe with total vision on) and watch out for those saves. Or would using scenario editor be unlikely to make situations unrealistic?
No problem with scenario editor. The key thing is that the situation when AI should act differently, happens there, and repeatedly.

Quote
Also, about b, the AI does not generally move to contact then fail to attack. They tend to just not move into an attack unless they can attack their target without a hurry penalty.
This explains why I have so many problems with tracking it. Next time, we need to be more specific. To move or to attack are quite different decisions.

Quote
And for d, there's a few common situations where attacking from base with a one attack unit is by far the best option (e.g. a Chaos Rover with no armor is sitting outside a base defended by only a plasma garrison. 1 weapon vs 1 armor is a lot better than 3 defense against 8 attack, even if the garrison had to take a 33% penalty or there's a Perimeter Defense (though not both).).
If I understood well, the AI fails to attack even in clearer cases. For testing, these would be ideal. Further on the road, we may need what you just mentioned.

Offline ete

Re: Improving AI - what are the priorities?
« Reply #49 on: February 26, 2013, 08:59:30 PM »
I'll play my next game in SMAC (maybe with total vision on) and watch out for those saves. Or would using scenario editor be unlikely to make situations unrealistic?
No problem with scenario editor. The key thing is that the situation when AI should act differently, happens there, and repeatedly.
Quote
Also, about b, the AI does not generally move to contact then fail to attack. They tend to just not move into an attack unless they can attack their target without a hurry penalty.
This explains why I have so many problems with tracking it. Next time, we need to be more specific. To move or to attack are quite different decisions.
Sorry about that, will try to be more precise in future.

Quote
And for d, there's a few common situations where attacking from base with a one attack unit is by far the best option (e.g. a Chaos Rover with no armor is sitting outside a base defended by only a plasma garrison. 1 weapon vs 1 armor is a lot better than 3 defense against 8 attack, even if the garrison had to take a 33% penalty or there's a Perimeter Defense (though not both).).
If I understood well, the AI fails to attack even in clearer cases. For testing, these would be ideal. Further on the road, we may need what you just mentioned.
Yes, you understand correctly. That was just a note that defenders with 1 attack may want to attack too, since you said only >1 attack.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #50 on: March 02, 2013, 12:46:38 AM »
a) AI is about to attack with an aircraft and instead of the base, it attacks a former nearby

Would it be too bad, if AI simply stopped its general inclination to attack formers more than anything? For planes and for ground units? I find it a bit stupid, but I may be wrong. This seems so far the closest option to happen out of all. The production point as well.



(btw, I still need these saves with AI situations. The AI is creepily complicated, lot more than I thought and after dozens hours of work I am running out of patience. Fact is, without a bit of blind testing, 50 * (hit and miss), this will not get anywhere.)

Offline Nevill

Re: Improving AI - what are the priorities?
« Reply #51 on: March 02, 2013, 10:33:39 AM »
Quote
(btw, I still need these saves with AI situations. The AI is creepily complicated, lot more than I thought and after dozens hours of work I am running out of patience. Fact is, without a bit of blind testing, 50 * (hit and miss), this will not get anywhere.)
Hello, kyrub.

Here is something for you to ponder over.

Testing-Hurry-Base.SAV - here you can see that AI does indeed attack other bases if he has an overwhelming advantage, although not consistently. Note that defensive facilities can dissuade AI from attacking (Testing-Hurry-Base-Defence.SAV), even though they would not have altered the outcome significantly.

Testing-Hurry-More Units.SAV - here I added more units. Note that no attack comes (infantry units stand still or move aimlessly). For an added bonus, play this for 1 more turn. This shows that the problem lies deeper, because AI does not attack bases even when it doesn't have 'hasted' penalty. Sometimes, as the save indicates, it even fails to occupy a base that has no defenders.

Testing-Hurry-Other.SAV shows some quirks in AI behavior, as well as proves further that 'hasted' penalty is perhaps not at fault here. Note that defenses do not deter AI from attacking this time. Also note that a rover that could have attacked and possibly captured my HQ was assigned to attack a base that is further away.

Offline Nevill

Re: Improving AI - what are the priorities?
« Reply #52 on: March 02, 2013, 11:03:39 AM »
Here is another batch of saves.

I gave AI a pair of String Needlejets (Testing-Air-Base.SAV). It attacked me ONCE and then never bothered as much as to move the needlejets around. They just sat there, ignoring everything.

Then, after 30 years passes, it mounted an attack (Testing-Air-Attacking.SAV), but its units (not only the air ones, mind you) pretty much only attacked my formers, even when they had more defence (in a forest) than my scouts had inside the base. The problem is even more apparent with Choppers, as the AI only sends one to get rid of my formers and then ignores the rest (Testing-Air-Copters.SAV).

Offline Nevill

Re: Improving AI - what are the priorities?
« Reply #53 on: March 02, 2013, 12:00:38 PM »
Quote
d) AI should attack from the base but does not (with a unit whose attack >1)
Replicating this situation is a bit tricky. Most of the time AI will recognize the threat and act accordingly. However, sometimes it will assign units with a high attack power as defenders. Those units will not leave the base and will not attack. Please check the second base of the Peacekeepers. Their defences consist of 6-1-1 missile squad units. If you can hold off reinforcements from U.N. HQ, you will see that the AI will not attack with its 6-1-1 defenders, no matter how many are there.

Well, this covers a), b) and d). I am not sure if c) is even a bug, as making probe teams wait at a distance before commencing attacks might open a way to potential exploits. Still, it is easy to reproduce, as AI will use all of its probe moves  in any given situation. Just create a probe team 3 tiles away from your unit/base and you are set (it should move 2 tiles and end up at point blank range, provided there are no movement penalties due to terrain).

Please note that all of my previously posted savegames are affected by a bug I had not previously encountered. Then again, I have never before used Yitzi's patch with the GOG version.

All attack against my (Consciousness) units are made with a strenght at 25% of what is should have been. It is similar to how Psi combat with the wild life works at the beginning of the game (all their attacks up until 2115 are made at -75% strenght), except it lasts the whole game and only against my units.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #54 on: March 02, 2013, 09:00:47 PM »
Nevill, welcome - and thanks for your effort!
The description made me avid to see it all, and the diagnostics seems very well thought out...


Only to read later that you used SMAX. I am afraid, I cannot use your saves, because my workspace is SMAC exe. So, to test, I would need these occurences made with SMAC.exe. (or is it possible to use SMAX saves if all factions are SMAC ones? I doubt that).

Could you please help me and reproduce them in SMAC? That would represent a big thing for me.
« Last Edit: March 02, 2013, 11:46:07 PM by kyrub »

Offline Yitzi

Re: Improving AI - what are the priorities?
« Reply #55 on: March 03, 2013, 01:30:13 AM »
Please note that all of my previously posted savegames are affected by a bug I had not previously encountered. Then again, I have never before used Yitzi's patch with the GOG version.

All attack against my (Consciousness) units are made with a strenght at 25% of what is should have been. It is similar to how Psi combat with the wild life works at the beginning of the game (all their attacks up until 2115 are made at -75% strenght), except it lasts the whole game and only against my units.

I don't really see any way that that could be caused by what I did.  However, have you tested whether it happens with Kyrub's patch but not mine?  Also, what difficulty are you playing on in that game?  (At low difficulties, you get a combat bonus.)

Offline Nevill

Re: Improving AI - what are the priorities?
« Reply #56 on: March 03, 2013, 12:25:05 PM »
Could you please help me and reproduce them in SMAC? That would represent a big thing for me.
I might be mistaken, but the behavior might differ between game versions. I might not be able to reproduce the exact same patterns.

Anyway, here is my latest attempt.
Testing-Hasted-Scouts - AI mobile units do not attack bases with scouts in them, hasted or not.
Testing-Hasted-Others - other units are fair play, it seems. I have replaced scouts with heavy attackers, and AI started to attack them. One of the enemy rovers attack with 'hasted' penalty 100% of the time, while the rest might decide not to (even though their advantage is overwhelming). Note that the AI is reluctant to attack a Scout Rover, and the HQ where it is located is the last to go down among 3 bases. But at least the AI attacks it eventually.
Testing-Hasted-Infantry - added missile infantry to the enemy force. They do not have problems with attacking scouts (or anything else, for that matter). Still they are reluctant to attack when hasted, which leads to much pointless roaming around.

If we leave AI alone, it will eventually build its own army and come knocking, and those new units apparently do not have any reservations against attacking scouts. Seeing as AI might attack with 2-1-2 rovers, but refuses to do so with 24-12-2 ones, it seems that it assigns certain plans for its units and then proceeds to use them accordingly, never utilising them for any other purpose. The problem is, its plans make little sense.

Here is a bit more tests on AI plans and maybe pathfinding.

Testing-Hurry-1 - four weapon-heavy rovers (24-12-2) placed in a closed space with my base covering the only exit. They get stuck, never attacking.
Testing-Hurry-2 - added 4 scouts to the other side of the base. They promply attack the base. 4 rovers are still stuck.
Testing-Hurry-3 - relocated 4 scouts to the same side where the rovers are. They get stuck along with the rovers.
Testing-Hurry-4 - put 4 scouts on the same side with the rovers but close to the base. They attack the base, and rovers may even help them, though it rarely happens.
Testing-Hurry-5 - removed 4 rovers, added 2 scout rovers to the other side of the base. They attacked the base. No problem here.
Testing-Hurry-6 - placed the same scout rovers in a closed space. They get stuck.
Testing-Hurry-7 - same as Testing-Hurry-2, except 4 scouts are replaced by missile squads. They do not attack my base immediately, and instead run around, doing random things. Eventually they either get to attacking my base, or Miriam just builds her own 2-1-2 rovers and assigns the task to them.

Some testing on air units.
Testing-Air-SMAC-Scouted-Once - here is an example of AI working semi-correctly. It has spotted my HQ, it sets its jets to attack mode until all defenders are dead. Note that if you kill the enemy scout, the attack never comes. More that that, the AI never bothers to destroy my own scout that is dangerously close to its Needlejets. It is as if AI never acknoledges it even has air units unless it is planning to attack.
Testing-Air-SMAC-Scouted-Twice - here is where things get worse. AI spots 2 bases. It attacks one of them and completely forgets about the other. When it captures one, it still has a scout near the other, its Needlejets are still intact, but it does nothing with them.
Testing-Air-SMAC-Scouted-Thrice - the AI prefers attacking units in the field to attacking bases, even when the bases have next to no defencive capabilities.

I don't really see any way that that could be caused by what I did.  However, have you tested whether it happens with Kyrub's patch but not mine?  Also, what difficulty are you playing on in that game?  (At low difficulties, you get a combat bonus.)
I never said your patch was responsible for that. It might have been a one-time glitch, seeing as I have never encountered this before and can not reproduce it. And no, it is not a difficulty bonus, none of them grant -75% penalties to your enemies. I just mentioned it in case you wanted to take a look at those saves and see what caused it.

Offline Yitzi

Re: Improving AI - what are the priorities?
« Reply #57 on: March 03, 2013, 04:30:43 PM »
I never said your patch was responsible for that. It might have been a one-time glitch, seeing as I have never encountered this before and can not reproduce it. And no, it is not a difficulty bonus, none of them grant -75% penalties to your enemies. I just mentioned it in case you wanted to take a look at those saves and see what caused it.


Well, I looked at it, and it is difficulty-related (changing the difficulty to specialist reduces it); it is in fact nothing other than the difficulty bonus that gives a penalty to enemies attacking you on the lowest three difficulty levels.  It is mentioned here (though not with the formula, which I do not remember at the moment).

Offline Nevill

Re: Improving AI - what are the priorities?
« Reply #58 on: March 03, 2013, 04:53:27 PM »
Sorry for the mix-up then. I didn't play at the lower difficulty levels for a long while. It seems that at Citizen all your attacks are made at twice their power level, and all AI attacks are made at a quarter of their power level.

I guess I just installed the game, hit quickstart, and the game picked up the lowest difficulty by itself.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #59 on: March 03, 2013, 11:55:28 PM »
If we leave AI alone, it will eventually build its own army and come knocking, and those new units apparently do not have any reservations against attacking scouts.

Bad news again. There seems to be something affecting this type of tests with scenario editor. If the normally built AI units don't act like this, it's not probably a bug, no? Maybe the problem is that these scenario created units have not got the right unit plan, as you suggested. This messes AI up, obviously. I cannot blame it.

I will look at the saves to see if they are invalid. Have you made them all with editor?


Quote
Seeing as AI might attack with 2-1-2 rovers, but refuses to do so with 24-12-2 ones, it seems that it assigns certain plans for its units and then proceeds to use them accordingly, never utilising them for any other purpose. The problem is, its plans make little sense.

Why do you think its plans make little sense? It is the mechanics AI uses, indeed.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

The first living thing to go through the device was a small white rat. I still have him, in fact. As you can see, the damage was not so great as they say.
~Academician Prokhor Zakharov 'See How They Run'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 47 - 1280KB. (show)
Queries used: 46.

[Show Queries]