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

0 Members and 1 Guest are viewing this topic.

Offline ete

Re: Questions to modders, what would you like?
« Reply #135 on: May 02, 2014, 04:30:55 PM »
Quote
What is the architecture of AI movement?
Infowar units are treated separately, there are too many instances. Defenders are totally separate again; I cannot easily explain the AI that this defender "cannot defend", in fact, so the base needs reinforcing. Every other unit other than defender moves out of base. There are emergency defenders, maybe I could try to squeeze probes inside that code, but then I'd lost emergency counter-attacking from the base, which I won't do.

I don't say it is impossible, just the function is so complex that I have very little idea what to do. I still have no clue how to stop Infowar units from running close to other bases. Maybe, after that, I can stop some of them from running out of the base, if there are no probes inside. Maybe.
hm, stab in the dark/a bit off topic, but could you potentially create a custom unit (infantry probe) and force it to use the defender plan, plus code unit building priorities so the base always 'wants' at least one of them?

Offline kyrub

Re: Questions to modders, what would you like?
« Reply #136 on: May 02, 2014, 04:35:45 PM »
Good try, but Infowar unit clash is built... on unit plan. And AI needs to recognize it has base only with infowar defender left and therefore emergency (many instances). Still, I don't say it cannot be tested (can a unit in alpha.txt be specified as defender?). I have my doubts.

[btw, we are cluttering this thread and we should not] [/move out]

Offline Buster's Uncle

  • With community service, I
  • Ascend
  • *
  • Posts: 49414
  • €135
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: Questions to modders, what would you like?
« Reply #137 on: May 02, 2014, 04:46:53 PM »
I can always split topic drift off into its own thread on request.  A list of post #s would help.

Offline ete

Re: Improving AI - what are the priorities?
« Reply #138 on: May 02, 2014, 08:10:52 PM »
Good try, but Infowar unit clash is built... on unit plan. And AI needs to recognize it has base only with infowar defender left and therefore emergency (many instances). Still, I don't say it cannot be tested (can a unit in alpha.txt be specified as defender?). I have my doubts.

[btw, we are cluttering this thread and we should not] [/move out]
Right.. that could get very messy then. Still, probably worth a test, see if the defending probe starts an infowar clash even if it's set as defender. No AC access until July, so someone else will have to play around with it.

#UNITS does let you specify AI plan:
; Plan    = Unit "plan" for AI purposes:
;          -1  = Auto Calculate
;           0  = Offensive
;           1  = Combat
;           2  = Defensive
;           3  = Reconnaisance
;           4  = Air Superiority
;           5  = Planet Buster
;           6  = Naval Superiority
;           7  = Naval Transport
;           8  = Colonization
;           9  = Terraforming
;           10 = Supply Convoy
;           11 = Info Warfare
;           12 = Alien Artifact

hmm... tricky.. again, guessing at potential ways around it if the simple solution does not work (may be over complicated and/or non-functional: I've not seen the code)

If the infowar battle does not start when a probe goes into a base with a probe defender, perhaps that specific check is modifiable (from is there an infowar plan unit to is there a unit with probe module)? Sounds like it could get very messy though, so maybe not practical. Probably crazy alternative: make a unit plan 13 which switches between behaving as infowar (if other faction's turn) and defender (in its turn), so it'll act as a defender when it can move, and act as a probe when someone tries to probe its base.

Perhaps to stop AI's leaving bases with just a probe to defend, modify AI's 'do i need emergency defenders' to also count number of probe defenders, something like:
If total_defenders - probe_defenders = 0 then emergency

though counting a specific unit may be tricky.. though you're doing something like that for crawlers so maybe that code can be made to work?

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #139 on: May 02, 2014, 09:02:33 PM »

Quote
If the infowar battle does not start when a probe goes into a base with a probe defender, perhaps that specific check is modifiable (from is there an infowar plan unit to is there a unit with probe module)?

I like your thinking, ete. This could actually work (the other things won't, though).  It is a fragile idea, we still don't know how AI will handle defensive probe, as there are many instances of check for def units, I am not even aware of them. But if the game does not immediately crash, one can solve side-effects later.

I'll stick for the moment with the idea I came upon while answering to Yitzi (as that seems less risky). If we can spot the right place, why not simply:
- check if Infowar unit, which is about to move, is in theplayer's base
- check if sum of Infowar units in the base without GoTo order > 1
- if not, stop movement (e.g. "defend")
- if yes, continue (issue GoTo order)

Let's have your plan, ete, in the reserve, always good to have more plans, when things get tough.

Offline Yitzi

Re: Improving AI - what are the priorities?
« Reply #140 on: May 02, 2014, 09:24:04 PM »

Quote
If the infowar battle does not start when a probe goes into a base with a probe defender, perhaps that specific check is modifiable (from is there an infowar plan unit to is there a unit with probe module)?

I like your thinking, ete. This could actually work (the other things won't, though).  It is a fragile idea, we still don't know how AI will handle defensive probe, as there are many instances of check for def units, I am not even aware of them. But if the game does not immediately crash, one can solve side-effects later.

That's a dangerous way of thinking, as side effects might not be discoverable immediately.  However, most checks for defensive units won't apply to defensive probes (i.e. unarmored infantry probes), so that's not so relevant there.

Quote
I'll stick for the moment with the idea I came upon while answering to Yitzi (as that seems less risky). If we can spot the right place, why not simply:
- check if Infowar unit, which is about to move, is in theplayer's base
- check if sum of Infowar units in the base without GoTo order > 1
- if not, stop movement (e.g. "defend")
- if yes, continue (issue GoTo order)

You'd also want to encourage the AI to distinguish between infantry and rover probes, and build the former but use them only for base defense.

Offline Geo

Re: Improving AI - what are the priorities?
« Reply #141 on: May 03, 2014, 04:16:34 PM »
In my latest (SMAC) game, I could designate a tactical needle as defender. It kept the flag where ever I sent it.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #142 on: May 17, 2014, 03:12:11 AM »
Updated the patch:

http://alphacentauri2.info/index.php?action=downloads;sa=view;down=260
Quote
Description: New release of AI patch for SMAC - 17/5/2014
http://alphacentauri2.info/index.php?action=downloads;sa=view;down=260

Features

AI Terraforming
- AI got a basic lesson in advanced terraforming (boreholes, condensers, less raising terrain)
- it builds no more bunkers
- it builds denser sensor array network

AI crawlers
- AI builds now tends to build crawlers earlier and slightly more of them
- AI crawls more intelligently its resources

AI Social Engineering
- the patch includes an emergency fix of the worst parts of social engineering code
- AI now understands that pacifist drones are a major problem

AI buidling units
- AI spreads quicklier on oceans
- Morgan has got new incentive to spread quickly
- AIs build less of probes, bar Miriam
- a lot more AAA defense
- AI now likes rovers and choppers


Special thanks to:
Kirov, Blaneck, TarMinyatur, Geo
Sorry, that I could not adress more features. Will try to do that in (more distant) future.

Offline Buster's Uncle

  • With community service, I
  • Ascend
  • *
  • Posts: 49414
  • €135
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: Improving AI - what are the priorities?
« Reply #143 on: May 17, 2014, 03:17:48 AM »
File approved.

In more than one way. ;b;

Offline ete

Re: Improving AI - what are the priorities?
« Reply #144 on: May 18, 2014, 03:45:27 AM »
Cool stuff kyrub :)

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #145 on: May 19, 2014, 04:23:25 PM »
Thanks, ete and BU.

I have got reports of malfunctioning, on other forums. The AI seems to have big problems with manning their defensive lines  (as some have noticed here in the previous version), and the newest patch does not help, more the contrary. I am working on the matter, since I cannot leave the patch in such a disarray.

Offline Nexii

Re: Improving AI - what are the priorities?
« Reply #146 on: May 21, 2014, 04:12:38 AM »
Ok so I watched an AI game under the new patch.  Overall the AI is much stronger with terraforming farm/solar and forest/farm about 50%/50%.  They can now produce enough to close out a game consistently which is a big improvement.  They build Hab Domes meaning a lot more late-game power.

A few simpler things the AI could do better:
- AI doesn't rebuild destroyed HQs (or relocate if distant from most bases)
- AI avoids Children's Creches.  Similarly puts a low priority on Tree Farm / Hybrid Forest.  These are probably the top facilities to get, so should be built before things like Perimeter Defense, Energy Grid, etc.
- AI seems to pick techs based on category only.  Best example I can give was Sparta getting Fusion tech before Centauri Ecology.  AI should get Centauri Ecology and Biogenetics first so it can grow.  Predictably, Sparta fell way behind on its own continent in this game.
- AI will build some satellites but generally avoids them (higher priority for N-sats).
- AI prefers drop troops but tries to drop them into invalid Sea or Airport-covered zones, eventually giving up and ending the unit's turn
- AI could make more sea probes, for tech steal

More subjective/difficult things:
- AI is more expansionist although I would recommend pushing it to expand a little more.  At least to expand until bureaucracy limit.  Commonly I see 4-5 bases only constructed.  Seems some factions are more prone to this than others.  If boxed in, AI should go to sea bases early.
- AI generally is very war crazy, as others noted before.  Gaia won the game I watched because 5 of the other AI were on the same continent, and just warred each other into the ground while Gaia buildered to population victory.  I could write a lot more on diplomacy strategy - but probably this is the area where the AI could stand to improve the most.  At the same time, you wouldn't want to water down the hatred of picking certain governments, or faction personalities.  I haven't tested but it seems the AI wars between itself more indiscriminately and considers government more for Human player only.  I would say the AI should consider power level a lot more heavily when trading techs and when agreeing/breaking Treaty/Pact.  At least on higher difficulties, anyways.
- AI is pretty decent at land war.  AI could raise land towards enemy cities when having an advantage in war.  Probably more difficult where even advanced terraforming is complex.
- AI should probably go 90% forest, with the odd condensor/borehole.  Farm/solar can be okay but with default values it's generally weak.  The AI doesn't know how to do specific echelon strategies to really make use of solar/farm.  Terraforming/crawling gets rather complex if you start modding it - as both former-time and FOP can be modded. 

On the flip side, has anyone documented a list of AI "cheats" that exist in game that give it an advantage?  What is everyone's opinion of the various AI bonuses?  For example, extra workers that aren't drones, hidden IND bonus (I think +3 on Transcend), very low (or no) cost to subvert using probes.  Tech cost curve is one of the bigger ones (about 40% cost on Transcend).  At what point does the AI need less of these unfair advantages?

 

* 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

Therefore the Lord God sent him forth from the garden of Eden. He drove out the man, and he placed at the east of the garden of Eden Cherubim, and a flaming sword which turned every way, to keep the way of the tree of life.
~The Conclave Bible, Genesis 3:23-24

* 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: 45 - 1228KB. (show)
Queries used: 42.

[Show Queries]