Author Topic: SE choices for AI - suggestions  (Read 32317 times)

0 Members and 5 Guests are viewing this topic.

Offline kyrub

Re: SE choices for AI - suggestions
« Reply #60 on: January 25, 2013, 11:38:25 AM »
First let me ask about the things I don't understand. What does the following mean in your patch description?
d  close base and fungus love from 70
e   unit_abilities_8
g   formers chance
These are my internal notes, they give little sense in themselves, sorry.
d - close base, I forced AI to place bases not as close (I dislike the ICS). I reversed the change afterwards, because it changes game's rules. It works normally now.
d- fungus love: when AI places new bases, it has a strong dislike for fungus. As a result, it failed to populate whole zones on its continents. I put a time cap on the dislike, to free the AI colonization, from 70 turns it ignores the fungus threat.
e - I made a whole new AI design set (8 means it is the 8th generation of the set in my book). The AI now designs new units (like AAA/ECM defenders, or clean garrison, submarine ships, SAM rovers etc.). You may verify that by clicking on AI cities in test mode, just take a look at its build choices. The trouble is, even if I designed them, the AI still fails to build them most of the time. -- I need to make another step and improve the unit building routine now.
g- AI builds a LOT more formers. This i quite evident from the game, I think.

Quote
All in all, I see big improvement in:

1) not sticking to preferred SE at all costs
2) use of Wealth by Morgan and Hive, really congrats guys and good for you
3) smarter use of FM (i.e. AI uses it but switches off under Vendetta)
Thanks a lot for some positive feedback, we achieved something without actually changing a lot.

Quote
However, I still think that Wealth is under- and Power is overused. Can Power be made as something of last resort? Or barring that, something which is used only if >95% bases build combat units?
If we make INDUSTRY setting more pertinent, the AI will prefer Wealth and use Power only as a last ressort. This should do the trick, easy.[/quote]

Quote
Which reminds me - what's the difference between aggressivity and power? (you mentioned them along with growth, eco and commerce).
It's "ai-fight", the first number of the five. Willigness to use army (the number can range from -1 to 1.). I say aggressivity, because it seems to fit better to the fact. This number is quite powerful throughout the code. Of all numbers, most used are (sorted): ai_fight, ai_power... ai_tech, ai_wealth. Ai_growth is severely underused, it's strong only in the research choice, IIRC. Surprisingly, AI growth does not lead to ICS.

As far as those numbers go, we could MAYBE tie them to specific situations, without nullifying them. Like, when AI is the last in power chart AND not in war, behave as if ai_tech = 1, ai_wealth = 1 (runs FM/DEMO, tries to catch with tech). Or when last in power chart and in war, behave as if ai_fight=1 and ai_tech=1, to try to probe enemies.

This, instead of rewriting the whole AI, we could use those numbers for "behaviour under special conditions". Normally, AI would still use their own traits, just in special circumstances it could change them.

Offline Kirov

Re: SE choices for AI - suggestions
« Reply #61 on: February 01, 2013, 10:00:23 PM »
d - close base, I forced AI to place bases not as close (I dislike the ICS). I reversed the change afterwards, because it changes game's rules. It works normally now.

This could also discourage AI from building any further bases at all. I don't know if you changed anything, but in this test I played (it's 2220), I noticed all AI have 1-3 active colony pods and look like they are not sure what to do about it (the numbers are 1, 3, 1, 1, 2, 1).

I checked my old SMAX game (MY 2261) and the AI have 0-2 colony pods. So maybe the difference is not that big. Still, it's better that AI dump colony pods anywhere than just roam around for no apparent reason.

Quote
g- AI builds a LOT more formers. This i quite evident from the game, I think.

The numbers are 4, 13, 3, 3, 8, 1, so it's seem fine. I wonder why the difference between 1 and 13? Is there any way to introduce a lower limit ('thou shalt not have less than 2/3 X # of bases')?

Meanwhile, for comparison purposes I checked my other game and funny thing - 3 AI have no formers and 3 other haven't even prototyped the basic one! Some of them still have fungicidal formers, to be fair. And Miriam has 24 regular formers. These are some huge differences, only partially accountable by wars waged. Do they come from ai_growth or map factors?

Quote
It's "ai-fight", the first number of the five. Willigness to use army (the number can range from -1 to 1.). I say aggressivity, because it seems to fit better to the fact. This number is quite powerful throughout the code. Of all numbers, most used are (sorted): ai_fight, ai_power... ai_tech, ai_wealth. Ai_growth is severely underused, it's strong only in the research choice, IIRC. Surprisingly, AI growth does not lead to ICS.

We are talking about how these numbers affect the AI behaviour. Can you say a few words how they can in turn be affected by external factors (specific faction choices, map, game settings, situation on the map)? Maybe we could manipulate it in this way. 'If 1st in military - increase ai_fight.' 'If alone on a continent - decrease ai_fight'. Something along these lines.

Also, can they be interrelated or are they uber-factors? 'If ai_tech=1, then increase ai_growth'.

Offline kyrub

Re: SE choices for AI - suggestions
« Reply #62 on: February 02, 2013, 12:17:30 AM »
I am quite busy, working on a few things. I get some better results on advanced terraforming (boreholes and condensers) now and I have got clear image of AI unit's design and building decision.  I found some of the AI to AI diplomacy code, which could really help to make AI's mood a bit more stable. Trouble is, it will affect the relations to human player as well... SMACX is a sincere game, everybody gets the same diplomatic treatment!

This could also discourage AI from building any further bases at all. I don't know if you changed anything, but in this test I played (it's 2220), I noticed all AI have 1-3 active colony pods and look like they are not sure what to do about it (the numbers are 1, 3, 1, 1, 2, 1).
There's no change, I just pushed some factions to be more pro-active in spreading (Morgans, University). It's quite visible. AI has a general problem to place its colonies, the pods go round in circles. The bug source is not known, yet.
 
Quote
The numbers are 4, 13, 3, 3, 8, 1, so it's seem fine. I wonder why the difference between 1 and 13? Is there any way to introduce a lower limit ('thou shalt not have less than 2/3 X # of bases')?
Room for improvement? Surely. I am currently working on better AI building, so Formers can fall in. I am pretty positive about the potential improvement here, it will make AI better.

Quote
We are talking about how these numbers affect the AI behaviour. Can you say a few words how they can in turn be affected by external factors
Oh no, these are constants from the faction txt files. Open Morgan.txt and the 5 numbers you see in the header are the constants that influence 60% of AI behaviour in the game. That's why AI Hive is usually the best, it has the most succesful number combination.

What I suggested was to make them not_constant. Switch ai_fight on +1 even for "peaceful" factions (-1), under some defined circumstances.


EDIT: I've found the answer on the new wiki (thanks ete).
« Last Edit: February 02, 2013, 09:05:50 PM by kyrub »

Offline Yitzi

Re: SE choices for AI - suggestions
« Reply #63 on: February 03, 2013, 12:27:01 AM »
What I suggested was to make them not_constant. Switch ai_fight on +1 even for "peaceful" factions (-1), under some defined circumstances.

It might not be a good idea to mess with ai_fight, as think that really determines more what circumstances it prefers (i.e. aim for peace or not) rather than how it acts in a particular circumstance.  If it's in a major conflict, I'd think you'd want more focus on ai_conquer and leave ai_fight alone.

Offline kyrub

Re: SE choices for AI - suggestions
« Reply #64 on: February 04, 2013, 02:49:13 AM »
It might not be a good idea to mess with ai_fight, as think that really determines more what circumstances it prefers (i.e. aim for peace or not) rather than how it acts in a particular circumstance.  If it's in a major conflict, I'd think you'd want more focus on ai_conquer and leave ai_fight alone.

Try to read this thread: http://apolyton.net/showthread.php/19938-Re-Balancing-SMAX-Factions?highlight=Switching%20Sides
They think ai_fight has massive influence on how much army is built, how offensive / radical the AI behaves... What I see, seems to confirm that. AI_conquer is less relevant.

Offline BFG

Re: SE choices for AI - suggestions
« Reply #65 on: February 04, 2013, 04:50:48 AM »
Kyrub, if you modify the AI so that it knows how to use gravship formers/supplies and aerial colonies properly, then I will be forever indebted to you!
I think I mentioned this to you on another board, but just having an AI that's capable of aerial colonization would, in my opinion, vastly strengthen it.

Offline Yitzi

Re: SE choices for AI - suggestions
« Reply #66 on: February 04, 2013, 06:08:54 AM »
Try to read this thread: http://apolyton.net/showthread.php/19938-Re-Balancing-SMAX-Factions?highlight=Switching%20Sides
They think ai_fight has massive influence on how much army is built, how offensive / radical the AI behaves... What I see, seems to confirm that. AI_conquer is less relevant.


Even so, I'm pretty sure that it also affects how much the AI tries to seek or avoid war in the first place, and that probably should not be situation-dependent (at least not for the same situations).

Offline ete

Re: SE choices for AI - suggestions
« Reply #67 on: February 04, 2013, 11:10:26 AM »
Kyrub, if you modify the AI so that it knows how to use gravship formers/supplies and aerial colonies properly, then I will be forever indebted to you!
I think I mentioned this to you on another board, but just having an AI that's capable of aerial colonization would, in my opinion, vastly strengthen it.
By the stage of the game when air is available, I'm generally not needing to build many of bases, and though getting there a few turns earlier is cool.. it seems to be a pretty minor thing compared to many of the AI's other weaknesses. And Gravship formers? Why not just make tank/speeder and sea ones, on land you'll have a magtube network by then anyway so they can get many places faster than a gravship. Plus by Gravships the AI is effectively always doomed, due to other issues.

Offline BFG

Re: SE choices for AI - suggestions
« Reply #68 on: February 04, 2013, 05:25:49 PM »
And Gravship formers? Why not just make tank/speeder and sea ones, on land you'll have a magtube network by then anyway so they can get many places faster than a gravship. Plus by Gravships the AI is effectively always doomed, due to other issues.
Frankly, I disagree.  Aerial colonies - as early as Needlejets - would open up new possibilities for the AI: rapid expansion to deal with drone problems, open up new vectors rapidly in Vendettas, settlement of far-off islands that would otherwise require a Transport + Colony pod (i.e. more turns building, and more support resources) and 5-10x as many turns, etc.  That said, I do agree that the AI has more glaring flaws than this one that need dealt with.

And Gravship formers? Why not just make tank/speeder and sea ones, on land you'll have a magtube network by then anyway so they can get many places faster than a gravship. Plus by Gravships the AI is effectively always doomed, due to other issues.
This is really just a personal annoyance of mine - I like replacing land+sea formers with Gravship ones, as they're more efficient support-wise and I think they look cool.  Plus they get additional protection due to being aerial units.  And I've got to believe it's a minor bug that causes Gravship formers to automate properly on land, but not on sea.  But yes, this has little if any priority in AI fixing :)

Offline ete

Re: SE choices for AI - suggestions
« Reply #69 on: February 04, 2013, 05:41:44 PM »
Frankly, I disagree.  Aerial colonies - as early as Needlejets - would open up new possibilities for the AI: rapid expansion to deal with drone problems, open up new vectors rapidly in Vendettas, settlement of far-off islands that would otherwise require a Transport + Colony pod (i.e. more turns building, and more support resources) and 5-10x as many turns, etc.  That said, I do agree that the AI has more glaring flaws than this one that need dealt with.
Rapid expansion tends to lead to more drone problems due to BDrones, even with high efficiency. Having a base as a recharge point in an attack is interesting, but unless the AI was very smart about it may just give away a base. The newly founded base is rarely going to contribute much to an attack other than healing which will be further away from the action than a captured base, and bringing a speeder colony pod along with an attack would do almost the same thing.

Expanding to far away islands in a way the AI is better at may be worthwhile, but ultimately bases nearish to the HQ are going to be a lot more valuable to an empire due to inefficiency issues and the fact that they can be defended much more easily (plus bases founded nearby can be improved by your main former pack, faraway bases are on their own).

Actually, I think perhaps the biggest advantage to flying colony pods would be bypassing all the fungus and the worms hiding in it, which may well pick off normal colony pods otherwise. This is somewhat notable, but not huge compared to many other AI problems.

I do think it would be kinda cool for AI to expand like this, but I'm not sure how much more of a challenge it would provide.

This is really just a personal annoyance of mine - I like replacing land+sea formers with Gravship ones, as they're more efficient support-wise and I think they look cool.  Plus they get additional protection due to being aerial units.  And I've got to believe it's a minor bug that causes Gravship formers to automate properly on land, but not on sea.  But yes, this has little if any priority in AI fixing :)
Long before Gravships all your formers should be Clean, negating support entirely, and you should have a tube network, making speeder formers faster in many situations. I could see gravship formers having a very few niche uses, and they do look cool, but teaching the AI when they're worthwhile and how to use them seems entirely not worth it. Maybe making automation work for them (at least a copy of Land automation) would be much simpler and so worthwhile though.

Offline kyrub

Re: SE choices for AI - suggestions
« Reply #70 on: February 08, 2013, 02:31:29 AM »
I have some bad news and a few good ones.


First, the bad and my sincere apologies. I thought I found a bug, the AI mixing up POLICE setting with SUPPORT. After hours of checking, I found I was wrong. Sorry.

Second, based on this disapointment, I decided to overview the whole SE code, in detail. I have found 3 bugs (this time I hope they are real!) and a number of underachievments.

The bugs are placed:
a) in POLICE setting code. The program carefully counts a large, negative Drone_factor, but in next step, it is multiplied by Police_Setting and added to the score. Now, let's imagine what happens for negative police* negative drone factor... positive result is added! --- Consequence: The AI with large unrest thinks that having POLICE -3 is simply great.
b) in PLANET setting code. Again, substracting what should be added. Consequence: The AI with Green predispositions (those who have ai_Growth) will try to avoid Green more than any other player. That's why Deirdre seems so reluctant to use her favourite Green, as Kirov noticed!
c) in EFFICIENCY setting code. Efficiency is wrongly factored in, so that AI does not recognize the effect it could have on improving economy. I have noticed this strange ignorance to efficiency in a test game with Spartans.

Other flaws
d) in GROWTH, AI tends to overestimate the growth potential even for bases that lack nutrient surplus. A large empire in mid-late game may thus go for large GROWTH, without significant effect.
e) AI seems to use precalculated Tech_deficit_to_HP in a questionable way. It never tries to catch up with favouring Energy, Efficiency or Tech, when low on Tech scale. Instead it goes immediately for power, ignoring the fact that a player who is 15-20 techs ahead won't probably crumble. If the AI has tech supremacy, it refuses to capitalise in power, on the other hand. Further refining of these choices is probably necessary.
f) sum_of_units variable is used a lot, which IMO makes AI vulnerable to its own strategy to create and store large hosts of soldiers. Morale is increased, if army is large, but ++Morale is a positive factor for building more soldiers as well. One can easily see, where this leads in the long run.

(.. and there is more.)
« Last Edit: February 08, 2013, 12:05:04 PM by kyrub »

Offline ete

Re: SE choices for AI - suggestions
« Reply #71 on: February 08, 2013, 11:22:35 AM »
Interesting finds! Especially the Police/Support multiplier, that could well be very significant. Would it be practical to post/share your disassembled version with functions you've identified, so that perhaps others would be encouraged to join in the search for improvements, or at least gain insight into the workings of the game?

Offline kyrub

Re: SE choices for AI - suggestions
« Reply #72 on: February 08, 2013, 10:32:35 PM »
Interesting finds! Especially the Police/Support multiplier, that could well be very significant. Would it be practical to post/share your disassembled version with functions you've identified, so that perhaps others would be encouraged to join in the search for improvements, or at least gain insight into the workings of the game?
It's police/police multiplier, I made a typo. Sorry.


As far as sharing of disassembled database, I understand your interest in testing and probing AI. I love studying current AI algorithms and finding new ones and better, same as you, ete.
But the short answer to your question is: not now.

The longer answer: I will most probably disclose my IDA database later, in months to come, to wider community for any use. I did so in all my other projects so far (bar one that was first and is still unfinished). So you may more or less rely on the fact.
Right now, I am doing the AI business myself, in the pace I set to myself, without any pressure and enjoying all the surprise and fun it offers. It's a bit egoistic but it's well deserved at the same time (see below). When I am done with my effort, I'll open the database to the community and you may improve it or build a new concurential model. You may try to create a scripted AI as well, if you wish and have abilities to do so.


To explain my stance a bit further: the ground disassembling is the really hard part, the rest are the fruits. When you disassemble a game, the first stage is "simple findings", very fruitful (like combat bonuses or POP limits locations). This is short. The second stage is very hard and can take a hundred of hours time, because you are trying to understand the non-obvious in the code. It also brings few fruits. After that, you may try to understand the AI. This is the hardest, because you must penetrate something that is not visible in the game AT ALL: how the AI uses its own data, what analysis it does for its goals, how it communicates in AI-AI mode. Also, without understanding the AI more than 80%, you fail to improve it. That's another hundreds hours thing (for SMAC I mean, other games have much simpler AI).

I have put this effort in the game, and that's why I tend to think I can enjoy a small time for tinkering with it, before I feed to the player's community. I am trying to do my work to help the players, but, for now, I do it privately, myself. - Hopefully that does make some sense to you and others here.

Offline Earthmichael

Re: SE choices for AI - suggestions
« Reply #73 on: February 09, 2013, 01:59:26 AM »
Sorry to be late chiming in here, but here are my two cents about SE:

Line 1: Unless you are Hive, all faction run Democratic.  Period.  No calculation needed.  Change as soon as you research it.  Hive will run Police State.  Immediately, as soon as you get the energy to change.  And do not waste the energy on anything else.

Line 2: ALL of the options are good in one situation or another.  But, other than Morgan maybe, I would not allow any other AI faction to run FM.  It is just too complicated to manage pacificism.  I don't see how an AI could be programmed to do it.  I would start all factions who can with Planned, and only move to Green based on: A. I am exploring fungus a lot and would like to attempt mindworm capture, or B. I am losing too much energy to inefficiency, and so I will give up the Planned bonuses to get a net +4 improvement in Efficiency.

Line 3: I would agree with Kirov that Wealth is the answer, but that is only taking the posititives into account.  If you are attacking, you may find having -2 Probe to be less troublesome than -2 Morale, so you might choose Knowledge.  But unless you have something that gets rid of the Power negatives, do not choose Power.

Line 4: Most AI would probably most benefit from the energy boost, so go with that, and combine with Wealth.  Yes, that is -4 morale, so maybe not if you are hot and heavy at war, but maybe it is worth it anyway.

Hope this helps.

Offline kyrub

Re: SE choices for AI - suggestions
« Reply #74 on: February 09, 2013, 02:47:38 AM »
Thanks a lot for important insight. There's a problem, that AI does not think in SE choices (e.g. "I like Democracy", or "Bleh, Free Market"), but rather in how good/important/harmful is settingX=Y. This should be conserved, as players are often modding the SE choices. Looking at your suggestions, I could strengthen Growth factor, and AI will go for the choices you emphasized more. But it will be hardly as straightforward.


That aside, I have a few important questions about pacifism drones: what's the problem with them? Why AIs cannot manage, in your opinion? Another question (trivial), is POLICE = -3 supposed to create more drones than 1 in every base (because that seems so in the code, as if "For every unit over 1 outside of borders, there's a PD" - while the help.txt suggests that only 1 pacifism drone is created in every base)?

Also, is it true that PDs cannot be stopped by classic facilities, like hologram theatre etc.?

 

* 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

Planet's Primary, Alpha Centauri A, blasts unimaginable quantities of energy into space each instant, and virtually every joule of it is wasted entirely. Incomprehensible riches can be ours if we can but stretch our arms wide enough to dip from this eternal river of wealth.
~CEO Nwabudike Morgan 'The Centauri Monopoly'

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

[Show Queries]