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

0 Members and 3 Guests are viewing this topic.

Offline ete

Re: Improving AI - what are the priorities?
« Reply #15 on: February 05, 2013, 10:55:53 PM »
If as I believe you found the AI treats humans the same as AI it should be offering to trade with you just as much as with other AI, no? And by disaster, do you mean the AI will become much more powerful? Because that sounds really great to me.

I can see how tech trading is very important, but that does not necessarily make it an exploit in my mind. It feels entirely realistic to be able to exchange information and for information exchange to be almost entirely positive for both sides, and entirely realistic for the AI as well as human players to engage in tech trades whenever the opportunity arises (not every turn, but every time you get a new tech which someone with useful tech wants).

If one change which is consistent with the rules, consistent with the spirit or realism, and is not excessively complicated (hopefully) can let the AIs keep pace with humans in tech.. It seems like a definite priority to test if you're wanting the AI to be a challenge.

Offline BFG

Re: Improving AI - what are the priorities?
« Reply #16 on: February 05, 2013, 11:01:27 PM »
Out of curiosity, what puts you off shortlisting getting the AI to offer tech trades more?
Yep, I forgot to explain. My experience with MoM AI tells me: trading techs is an exploit. It is a feature with no downsides, in 98% of cases good for all the parties. The genuine question is not "whether" but "how often" should AI trade techs? Every turn, I say, it's that good. - But if I make them trade techs every turn, it will turn into a disaster for you. And you'll have very little room for trading yourself.
That could always be linked to the difficulty level - i.e. current trading practices at the lowest level but full-trading-every-turn behavior at Transcend.

Offline Impaler

Re: Improving AI - what are the priorities?
« Reply #17 on: February 05, 2013, 11:43:08 PM »
Base tech trade willingness on factors such as Pact status, attitude, Scrupulousness, and comparative power levels.  All these elements are non-biased between Humans/AI and are good sound criteria for a tech-trade.

An Faithful Pact make that an AI is Magnanimous towards and which is behind in power-level should be practically an automatic gime for technology, this will slightly lower the attitude for a while of course but not ruin it.  The further you are from that status the harder it is to get a tech trade and the better deal the AI needs to perceive in-order for it too agree.  But any AI should still take a 2 for 1 deal with a hated rival if they are making out like a bandit, their is no cut-off ware all trading is refused, it just requires a really lopsided deal to work.

One simple factor you could put in is a 'monopoly' period for each technology, if the AI knows or estimates that it has a monopoly on a technology then it could put a simple lock-out on any trading of said technology for a moderate number of turns.  The lockout could be renewed if necessary when it lapses.  This would keep the AI from doing some otherwise sloppy and ill-advised trades if the overall trade proclivity is going to go up.
 
Also with regard to Terraforming what ever you do DO NOT HARD CODE IN FOREST SPAMMING, make terraforming AI read the alpha.txt and do the math on what terraforming is worth what and try to maximize intelligently, many people mod the terraforming (nerf forests for one because they are OP irregardless of what the AI is doing) and to have the code force forests on the AI would cripple the AI if the forests were actually balanced.

Offline ete

Re: Improving AI - what are the priorities?
« Reply #18 on: February 06, 2013, 11:06:44 PM »
Okay, got something for you. Worker placement. And perhaps a better solution than hardcoding forming stuff in, assuming the forming code was/is linked to the square preference code. Basically, I think the AI has too strong a preference for Nutrients, which means that even if they are forced to plant forests they may not use them, and forcing them to plant forests may remove their original flexibility (I think there was some old thread which had AI planting fungus with enough fungal bonuses?).

Anyway, in the extremely early game Nutrients are key, but very quickly Minerals and Energy become comparably valuable and the AI's focus on getting maximum nutrients means they miss out on some great squares (easy to test the AI's current focus, just pick a base, turn all workers to specialists, then change them back by clicking on them). I've loaded up some old games and found things like AI picking (nut/min/eng):
1/0/0 over 0/3/0
2/0/0 over 1/2/1
Which is going to put them behind. Though in some situations the AI does seem to make sensible choices.. the people from the other thread seemed to think it was mostly to do with mission year.

I'm also very curious about what the AI takes into account when it's figuring out where to place workers.
« Last Edit: February 06, 2013, 11:34:26 PM by ete »

Offline TarMinyatur

Re: Improving AI - what are the priorities?
« Reply #19 on: February 07, 2013, 05:01:25 PM »
...make the AI read the alpha.txt and do the math on terraforming and maximize intelligently...
I agree, if this is not too much of a programming headache.

I like to set Forest production to 0-1-2. Farms become essential. (In contrast, I've played entire vanilla games without ever cultivating a farm.)

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: Improving AI - what are the priorities?
« Reply #20 on: February 11, 2013, 01:04:36 AM »
Two things which I'd like to add:

1. The Heroic Feat of Not Going Out To Kill Spore Launchers or Artillery
All SMAX players know this pain, and the AI is able to tolerate it. Emo AI. :|

2. Lots of Pathetic Defending Units
Suggest that if there's more than like, 3, to build new defenders and disband the old ones. Or send them out to the front.

On a minor note, one of my factions in LE has +50% PSI, and doesn't build enough native units. That's probably not worth including here though.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #21 on: February 11, 2013, 01:15:13 AM »
@ete
There's a problem with workers, I concur. But I find it hard to decipher, how the AI does it and why it's wrong.

@Tarminyatur and @Impaler, terraforming does not belong in this thread. Please look at first post.


2. Lots of Pathetic Defending Units
Suggest that if there's more than like, 3, to build new defenders and disband the old ones. Or send them out to the front.
I am doubtful about this one. What is good for player, may not be very good for AI.

I'd prefer if AI had 3-4 AAA defenders + 1-2 ECM-police or ECM-Trance (which is free combination!), to prevent Air blitzkrieg by human player. It's not very cost-effective, but it's key to improve the mid-game AI and, even more so, to force human player to search alternatives to simple air-power + drop squad. And a killer unit that can attack from base on top, when in war?

For me, having 2-3 more defenders is far better than having bases prone to easy blitzkrieg.

Offline Kilkakon

  • Likes cute things but is
  • Mostly Harmless
  • *
  • Posts: 1155
  • €695
  • View Inventory
  • Send /Gift
  • It does something (It's free and yet priceless)  
  • Creator of Lost Eden and C&C: Dawn of Tomorrow
  • Scenario Creator Custom Faction Modder AC2 Hall Of Fame AC2 Wiki contributor Downloads Contributor Author of at least one AAR Planet tales writer author of the Lost Eden mod for Alien Crossfire
    • View Profile
    • My website!
    • Awards
Re: Improving AI - what are the priorities?
« Reply #22 on: February 11, 2013, 01:21:05 AM »
I'm just remembering games when people have like 10 1-2-1 units in a city which aren't going to do very much against tough units. But you know SMAX better than me!

Offline BFG

Re: Improving AI - what are the priorities?
« Reply #23 on: February 12, 2013, 07:01:33 PM »
Here's another one I'd like to see: improved pathing in uncharted areas.  I've lost count of how many times an AI Naval Transport, etc. has gotten "locked" in a small inlet, going back and forth between two cells over and over again while trying to find a way around the continent to the other side.

And here's another one:  Probe Team suicides.  I've had factions throw dozens of unenhanced Probe Teams at me when I had Hunter-Seeker Algorithm.  It's a waste of their time and resources, and no human player would have continued after the first unit died.

Offline ete

Re: Improving AI - what are the priorities?
« Reply #24 on: February 12, 2013, 07:09:03 PM »
Pathing is likely to be hard to tackle in assembly (edit: though improvements would be cool, and processing power is a VASTLY smaller concern now so maybe there's something there), but agree with adding a check for probe immunity before using probes offensively.
« Last Edit: February 12, 2013, 08:13:15 PM by ete »

Offline JarlWolf

Re: Improving AI - what are the priorities?
« Reply #25 on: February 13, 2013, 08:47:36 AM »
One thing I'd like to see more of as well. While the AI concerning diplomacy can be quite tact at times, I would like the AI to have more devious planning and agreements. You often see pacts offered to betray certain groups, but I'd like to see the AI Work together quite a bit, and not only that use much more treacherous gameplay as well. Such as launching a planetbuster at you when you least expect it, etc. It'll keep us on our toes.


"The chains of slavery are not eternal."

Offline ete

Re: Improving AI - what are the priorities?
« Reply #26 on: February 13, 2013, 11:06:02 AM »
They can be passive, but more often than not you'll be betrayed by your allies if you're starting to get too strong for their liking, and all but the pacifist factions are quite happy to backstab at higher difficulties. The more aggressive factions do sometimes launch a surprise PB at you, I had a surrendered Yang who I'd let build up a little too much PB one of my main SP bases out of the blue in one game. Making the AI more keen to betray may make them feel like constantly false allies, the balance seems pretty good currently in my opinion.

Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #27 on: February 19, 2013, 12:48:28 AM »
Okay, got something for you. Worker placement. And perhaps a better solution than hardcoding forming stuff in, assuming the forming code was/is linked to the square preference code. Basically, I think the AI has too strong a preference for Nutrients, which means that even if they are forced to plant forests they may not use them, and forcing them to plant forests may remove their original flexibility (I think there was some old thread which had AI planting fungus with enough fungal bonuses?).

This seems more important than I thought. The problem lies in faction differences in treating worker placement, as the code shows. The value of nutrients/minerals/energy can be vastly different, depending on AI priorities. The most problematic is the treatment of minerals, where certain factions can see double value compared to others.

The formula uses as a factor:
Minerals value factor = (6 + ai_wealth + ai_fight + ai_power - ai_tech)


If you compare it with the list of classic SMAC factions, one faction has MVF = 9, while another three have MVF = 5. That's quite a gap in valoration and a sign of concern. The identities of the faction are telling as well: the former with the highest MVF is Hive, while the latters are University, Gaians and Peacemakers.

I am unfamiliar with SMAX factions, but if there is one with ai_tech=1 and ai_fight= -1 and ai_wealth and ai_power = 0, it will have MVF=4 and will probably fail to prioritize minerals, in a self-damaging way.

Offline Kirov

Re: Improving AI - what are the priorities?
« Reply #28 on: February 19, 2013, 03:48:11 AM »
As far as movement is concerned:

1) AI should create and move in stacks. This was finally solved in Civ4 (where AI has literally tens of units per stack) and I liked it, or at least it's the best approach you can give it. In SMAX, as in other Civ games, in 99% situations big stack = good stack. And too often you can win with just a handful of attackers against a cloud of undeveloped units, arranged and moving in no discernible pattern.

2) Several times in my life the AI employed the "chop & drop" strategy. I don't know what triggered that, but I was shocked and pleased at the same time. If you can just make the AI attack base tiles with air power, this combined with better tech parity (e.g. via trading) can be a powerful tool for AI.

3) I agree with the guys that there is big room for probe improvement. On the one hand, AI will never outsmart player, so it's bound to lose many resources allocated to probes. On the other, as it is right now, the AI use of probe is almost non-existent and in most cases you can safely take many bases per turn even from a rich AI without the fear of being on the receiving end of mind control. If AI so much as forced human to use one probe defender per base, I think it would be cool.

When we talk about diplomacy, I think it warrants a separate thread. Two notes that comes to my mind:

1) Some AI behaviour towards player could be improved. Tech trading is one, I also think that this 'everyone hates the Unsurpassed guy' makes for more static game, especially when you get Unsurpassed vey early and stay this way. If only it pushed all the AI towards some sort of uneasy alliance, it would be at least partly justified. As it is, they hate you for being the first, but also hate each other for reasons of their own and you still get to pick them one by one.

AI should be more peaceful/cooperative towards everyone when it gets its as$ kicked. Sometimes I'd like to help a dying AI (I prefer to collect pact-slaves than coffins), but it's so stubborn that it refuses to talk even when completely losing a war with somebody else. In some other situations, I would reduce Santiago to her last two bases... only to see her demand 3000 EC 'or else'. A huge chunk of "why AI is so stupid"  facepalms comes to me precisely on the diplomacy screen.

Basically, its mood should be more or less 'submissive' towards anyone who is stronger like ten times. Dear Colonel, you had your time to show me how feisty and tough you are. Now you're just being stupid and everyone watching it is embarassed.

2) Is it possible for you to fix the base trade bug? Can we teach AI to assess the value of bases? Is this feature non-existent or just flawed? Also, there are some other minor quirky bugs in diplomacy (very rarely, a Morgan AI can approach you and demand 0 EC for not killing you, and you can either bow to his demands or plea for mercy and offer 'just -1 EC'... :) ) I love it so much.


Offline kyrub

Re: Improving AI - what are the priorities?
« Reply #29 on: February 19, 2013, 10:22:08 AM »
stacks... that's unlikely, I am afraid.
air attacks on bases... hopefully, this should be possible.

Notes on diplomacy are interesting. AI works more with might ranks, than actual might assessment. It has some "humble pie" situations, but these are often bound to "being 7th in might". Maybe with faction elimination, this stops to work.
(I will make a thread on diplomacy)

Quote
2) Is it possible for you to fix the base trade bug? Can we teach AI to assess the value of bases? Is this feature non-existent or just flawed?

Yes. In fact I did already.

 

* User

Welcome, Guest. Please login or register.

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

Einstein would turn over in his grave. Not only does God play dice, the dice are loaded.
~Chairman Sheng-ji Yang 'Looking God In The Eye'

* 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: 48.

[Show Queries]