Author Topic: SMACX Thinker Mod  (Read 168373 times)

0 Members and 1 Guest are viewing this topic.

Offline Rocky

Re: SMACX Thinker Mod
« Reply #300 on: June 22, 2019, 02:28:03 PM »
I just want to say I'm really enjoying your AI. I used to only play AC with the Kyrub AI, and couldn't play SMACX anymore because of its vanilla AI. But thanks to your AI I can play the expansion now as well.

I like the different flavor in playstyle and terraforming. I really have step up my game not to get outpaced by the other factions. I can also notice the differences in build orders in comparison with the vanilla AI; they are more efficient and make more sense.

There are two things I noticed but you're likely already aware of.

1. There have been a few times some AI bases got stuck in a drone riot. I especially noticed it with Zakharov. The base still has food but it doesn't assign specialists to counter the drones. This can go on for a few turns with the base doing nothing. Then suddenly specialists do get assigned and the base continues operating. I'm not sure if this is related to your AI or was already in the vanilla AI.

2. The AI doesn't really take advantage of its industrial output to pursue Secret Projects. It happened a few times I was behind in the race for Secret Projects but still was able to catch up because the AI delayed building theirs.

Example: I needed a few more turns to get Pre-Sentient Algorithms. The Consciousness and the Gaians already had this tech but hadn't begun working on the Project (Hunter-Seeker Algorithm) yet. I immediately start building it when I got the tech. After a few turns the Consciousness begins building the Project and the Gaians follow soon after.

I was able to get the Project one turn before the Cyborgs. If the AI had initiated it earlier I would have had no chance getting it. I noticed this with other Projects as well but in this case it was especially noticeable.

Awesome work! I love how I can play both SMAC and SMACX now.
« Last Edit: June 22, 2019, 02:46:27 PM by Rocky »

Offline Induktio

Re: SMACX Thinker Mod
« Reply #301 on: June 23, 2019, 01:37:08 PM »
Hello there, nice to have more players.

> 1. There have been a few times some AI bases got stuck in a drone riot. I especially noticed it with Zakharov.

Yeah, it's somewhat of a known problem. There has been a couple of workarounds for this issue but the main problem is related to the way default governors assign specialists/doctors. Sometimes when the bases grow large enough, this problem starts to manifest when the base would have to keep many doctors to avoid rioting. Usually after a riot the governor allocates doctors, but after that it forgets about the issue and reallocates all the workers, causing a drone riot loop.

Unless we give AIs more bonuses (like free talents) it seems to me the only way to fix this would be to rewrite the worker allocation routine. No idea if it's going to be included in the next version, but should probably look into it more.

> 2. The AI doesn't really take advantage of its industrial output to pursue Secret Projects.

Not sure what you mean by that. Are you saying AI should rush secret projects or prioritize it more in the build queue? But if you got the project only one turn before the AIs, at least they put some effort into it? Here's a summary how the project queue works:

Each turn all the bases are ranked by the mineral output and SPs are only started in the top third output bases. Number of project building bases is always limited to three (to cut down the popup spam). Initially the AIs start building only SPs that match their research interests, but if they have overflow minerals they are allowed to start any available secret project. One of the main choices in the build queue is whether to build infrastructure or military, but if it opts for the peaceful option, SPs are really high in the build order, provided that the base meets the mineral output requirement and some SPs are available for building.

Offline Rocky

Re: SMACX Thinker Mod
« Reply #302 on: June 23, 2019, 03:11:07 PM »
Hello there, nice to have more players.


> 2. The AI doesn't really take advantage of its industrial output to pursue Secret Projects.

Not sure what you mean by that. Are you saying AI should rush secret projects or prioritize it more in the build queue? But if you got the project only one turn before the AIs, at least they put some effort into it? Here's a summary how the project queue works:


Thank you for the explanation. I appreciate it.

Sorry, I should have been more clear. I meant that the Gaians and the Cyborgs already had the tech to build the Hunter-Seeker Algorithm while I was still researching it, but they didn't start building it until later.

Example:  (I don't know the exact year)

2255: Two AI's obtain Pre-Sentient Algorithms. I'm still researching it.
2260: I complete Pre-Sentient Algorithms and start building Hunter-Seeking Algorithm.
2263: Both AI's start building HSA.

This is not meant as criticism. It was just noticeable because I'm used to the vanilla AI aggressively going after this project as soon as they research the technology.

« Last Edit: June 23, 2019, 03:26:38 PM by Rocky »

Offline Induktio

Re: SMACX Thinker Mod
« Reply #303 on: June 23, 2019, 09:42:39 PM »
> I meant that the Gaians and the Cyborgs already had the tech to build the Hunter-Seeker Algorithm while I was still researching it, but they didn't start building it until later.

At least Cyborgs should go after the HSA since they have ai-tech focus, but the project might be delayed for example if military considerations override the build priorities. That usually means enemy bases are close or similar. Can't say for sure anything else without a save game to inspect.

> It was just noticeable because I'm used to the vanilla AI aggressively going after this project as soon as they research the technology.

The new build queue does not have any project specific special priorities. The project is just chosen by comparing the research priorities and ai-fight values. I think it's somewhat similar than what the vanilla AI did, but I never fully reversed the old process since the code was quite messy. It's possible the old AI had some project specific priorities though. Did you notice any other significant differences with old priorities then?

Offline Rocky

Re: SMACX Thinker Mod
« Reply #304 on: June 23, 2019, 11:08:07 PM »
I'm sorry, I don't have the save anymore. I was mostly going by memory. I've been making multiple copies of SMAC/SMACX so I can keep them separate with different AI's/mods, and I deleted the Thinker version by accident.  (I've re-installed a new copy with the Thinker AI)

However, I can tell you that my previous games were all on smaller maps (One map size below the Standard map) The factions expanded fast and hostilities often started early on. Now that you mention it, the Cyborgs had Hive seabases near their territory and the Gaians had the Believers pretty close by. So that could have been why the Secret Projects were delayed.

I've started a new game on a large map earlier today and I can honestly say I'm already noticing a difference. The AI started building Secret Projects not only earlier in comparison with the previous games, they're also competing over it.

The Spartans are hostile to me and are overwhelming the University. (despite Zakharov being in the lead with tech) The Gaians were the first to build the Weather Paradigm and their powergraph is skyrocketing. This is going to be an interesting game.

If I notice anything during this game I'll post here.
« Last Edit: June 23, 2019, 11:46:41 PM by Rocky »

Offline Rocky

Re: SMACX Thinker Mod
« Reply #305 on: July 02, 2019, 11:25:32 PM »
I've been playing with your Thinker AI and I must say I'm really enjoying it. The factions expand on all available land quickly and they're able to field impressive early game armies that cannot be underestimated. I like how the AI is also adding Probe Teams to their attack forces and uses them relentlessly.

The AI is much more responsive to military threats. It also responds well to alien creatures, in contrast to the vanilla AI which would just stagnate because of one Spore Launcher getting in the way.

The only thing I noticed is that the AI does encourage excessive eco-damage with their Boreholes/Condensors. In the games I played eco-damage triggered rising sea levels around 2250-2280 and despite efforts most of the available land became submerged around 2300. I realize it's part of the game but it adds a lot of micro-management and at some point it becomes unmanageable, taking away some of the fun.

Other than that, I'm enjoying it.  Awesome work!

 

« Last Edit: July 03, 2019, 12:20:52 AM by Rocky »

Offline Induktio

Re: SMACX Thinker Mod
« Reply #306 on: July 03, 2019, 08:27:28 PM »
Hmm yeah, nice to hear. Just before v0.9 I actually did a major fix on the colony pod pathfinding, previously the AIs had some issues where they often weren't able to reach their destinations. Now that the pods should move without issues, it's going to be visible in their growth rates too. It might increase the perceived difficulty.

The funny thing with probe teams is that now they also understand how to use them in defensive purposes, not just offensive. Usually after fusion reactors the prototype planner designes upgraded probe teams with armor, so they work pretty well as defenders too.

About that eco damage problem, I'm wondering whether you're playing on the default global warming setting or my recommended config. At the default settings the sea level rise is almost guaranteed to occur by the mid game, ensuring lots of micromanagement that does not add much to the game. Even for AIs, the eco damage gets really excessive. If you want the effects reduced, this line should be in alphax.txt. You cannot undo already occurred effects if you change it mid-game though. But this modified setting should push the effects to "late game" phase instead of "mid game".

Code: [Select]
1, 2 ; Numerator/Denominator for frequency of global warming (1,2 would be "half" normal warming).

Offline Rocky

Re: SMACX Thinker Mod
« Reply #307 on: July 03, 2019, 08:57:33 PM »
Thanks for the reply. I appreciate it.

I have multiple versions of Alien Crossfire with and without mods. I don't think I have installed your recommended config though, which would explain the higher eco-damage. I'll do a fresh install with the recommended config.

Looking forward to start a new game.


Offline Rocky

Re: SMACX Thinker Mod
« Reply #308 on: July 04, 2019, 09:15:46 AM »
Just wanted to let you know that after a fresh install, everything works perfectly now.

Thanks!

Offline Induktio

Re: SMACX Thinker Mod
« Reply #309 on: July 13, 2019, 10:16:10 PM »
A new develop build 20190713 is now available from downloads. This update mostly streamlines the smac-in-smacx mod support.

Smac-in-smacx is now included in the default distribution. Due to some oversight, labels.txt was earlier included with the mod but it was not necessary as it contained no changes compared to the SMACX version. It was removed from ac_mod folder in this update. I also added some information about the custom faction support. They work in both game modes with this mod, unless some other non-Thinker mod interferes with that.

A new config option fast_project_start tells the Thinker AI whether it is allowed to start secret projects for which the human player doesn't have the techs. This was mostly added because in the original game on lower difficulties, the AI waited until the human had the tech requirements.

Offline Jade Panther

Re: SMACX Thinker Mod
« Reply #310 on: July 16, 2019, 03:51:32 AM »
Hi Induktio,
By coincidence, I played my first game using your 0.9 rules over the weekend. I think it's fair to say that difficulty 4 is now harder than difficulty 6 used to be! Awesome job  :D.

So now I'm going make some arguments for changes, but please keep in mind that I'm nitpicking.


First, I found an unusual situation which your social engineering AI doesn't take into account.

I'm playing the Gaians, and I'm fighting Morgan. [All is right in the world  ;)]  He has a small, compact nest of tightly packed bases, and he's running Police State-Free Market-Wealth, which gives him -2 EFFIC, which is a good choice for that tight nest of bases.

Then I take his capital. Both his energy income and his research instantly fall to 0, and stay there even after he signs a Pact of Submission and is at peace for some turns. What happened?

If you look at the rules for Inefficiency, they say:
Quote
The formula used to compute the energy lost by a base to inefficiency is:
Inefficiency = (Energy × Distance ÷ (64 - (4 - Efficiency) × 8 ))
Where:
Energy   = amount of energy produced by base this turn
Distance   = distance from Headquarters base (16 if no HQ)
Efficiency   = social engineering efficiency (+2 if Children’s Crèche)
If denominator reaches zero, all energy is lost to inefficiency.
Source: http://alphacentauri2.info/wiki/Inefficiency_(Advanced) but the F1 Help in-game says the same thing.

Let's plug the numbers in for social engineering efficiency of -2 and 16 distance since there is no HQ:
Inefficiency = Energy x 16 / (64 - (4 - -2) x 8 )
  = Energy x 16 / (64 - (4+2) x 8 )
  = Energy x 16 / (64 - 48 )
  = Energy x 16 / 16

Oops.

Energy and research from things like specialists and biology labs would be immune, and creches would matter too, but this is early midgame and Morgan's surviving bases have none of these things.

Suggestions:
  • If a faction doesn't have a HQ, it should value EFFIC from SE choices significantly more highly than a small faction with a HQ does.
  • If a faction without a HQ is at peace, one of its highest priorities should be building a new HQ. (Edit: perhaps factions without HQ's should treat HQ's like Secret Projects they can build.)
« Last Edit: July 16, 2019, 06:44:55 AM by Jade Panther »

Offline Jade Panther

Re: SMACX Thinker Mod
« Reply #311 on: July 16, 2019, 06:39:43 AM »
In my playthrough I noticed that Santiago was running Knowledge values. I am going to make a case that this is a change to game rules, not just an AI change.

Before we go further, I'd like to establish that running Knowledge in that situation was absolutely how a competant human player in that situation would have run player-controlled Spartans. The Spartans hadn't researched the prerequisite tech for Power values yet, and even if they had they weren't actively at war and the bonuses from Knowledge clearly served them better. I'm not claiming that your algorithm is evaluating the choices poorly. I think it's evaluating them well. I'm arguing that the game rules prohibit AI-controlled Spartans from running Knowledge, the same way that they prohibit both human-controlled and AI-controlled Spartans from running Wealth.

To set the stage, let me repeat something from page 15 of this thread:

I notice the guide also states that "The Social Priority line specifies the social choice a faction will oppose and be unable to select in social. This has no effect for a human using the faction." This seems incorrect, it should refer to "Social Opposition line" and the opposition category value should also affect human factions equally.

IMO the guide is correct. Let me quote the relevant section in full, and then I will explain my understanding of it.

Quote
Social Priority
The Social Priority line specifies the social choice a faction will support (be more friendly towards factions that use it, less towards factions that use other models), and the social effect the AI will prefer to increase. This only affects AI playing a faction, not humans using the faction. It takes the form Social Category, Social Model, Social Effect. Example:
...
Social Opposition
The Social Opposition line specifies the social choice a faction will oppose and be unable to select in social. This also affects human factions. It takes the form Social Category, Social Model, nil.

The Social Opposition is straightforward, as we've all experienced that you can't run the SE choice your faction hates.

The social priority (Agenda) for the Spartans is Power. In my experience, "social effect the AI will prefer to increase" means that the AI will choose between its Agenda and the default option for that SE group, not even considering other options in that SE category. For example AI Lal chooses between Democratic and Frontier, ignoring the existance of Police State and Fundamentalist. Thus I've only ever seen AI Lal running Democratic, even though player-controlled Peacekeepers can also run Fundamentalist (which is what I think "This only affects AI playing a faction, not humans using the faction." means). Similarly, I've only seen AI Miriam running Fundamentalist, even though player-controlled Believers can also run Democratic and Police State. Etc.

I've collected a database of about 150 censuses of factions from multiple game years over several games, and in my previous experience the AI's behaviour has always followed this rule, so I noticed immediately when the rule wasn't followed in your mod. (At first it confused me. I thought "if Santiago is running Knowledge, I can run Knowledge without irritating her." After thinking about it more, I decided not to test this hypothesis!)

To test this as much as I could, I took an autosave from my game under your executable, a turn when I had both that turn and the next turn as autosaves. Santiago was running Knowledge in that autosave, and she was still running Knowledge in the next turn under your executable. If, when I had run that turn under the vanilla executable, Santiago had continued running Knowledge, it would have shown that my understanding of the rules for AI SE choices was incorrect. But, when I pressed "End Turn" instead of playing my turn, after the computer had played the AI turns Santiago had switched to Survival values, consistent with my understanding of the rules for AI's. Unfortunately, it's also consistent with the hypothesis "the vanilla AI is stupid", which is also without a doubt a viable hypothesis.

I could provide the saves, but given that they're consistent with two different hypotheses, I don't know how much use they really are.

Since probably some players prefer the AI playing like a human as much as possible, while others prefer it to play as it does in the original game, I think it would be reasonable to make this a configurable option.

Offline Induktio

Re: SMACX Thinker Mod
« Reply #312 on: July 16, 2019, 08:04:11 PM »
Hmm, let's see what we have here...

> If a faction doesn't have a HQ, it should value EFFIC from SE choices significantly more highly than a small faction with a HQ does.

Not sure if that's going to have much effect, it would be better to just have the new HQ built.

> If a faction without a HQ is at peace, one of its highest priorities should be building a new HQ. (Edit: perhaps factions without HQ's should treat HQ's like Secret Projects they can build.)

Thinker AIs should rebuild their HQs almost always. It may not happen immediately if there's some stuff interfering but it should be done eventually. Did you check if Morgan rebuilt their HQ sometime later? This one might actually need some more priority because it's really important it's rebuilt quickly.

> IMO the guide is correct. Let me quote the relevant section in full, and then I will explain my understanding of it.

I edited out a slightly incorrect phrasing from that guide long time ago. But now that I look at again, there's also another inaccuracy "The Social Priority line specifies [...] and the social effect the AI will prefer to increase."

Scient has also tried to decipher how social effect priorities work, and I think we came to the conclusion that the AI just ignores social priority effects (e.g. industry). When the parser reads alphax.txt this value in question is not parsed properly, so the vanilla social AI just assumes the value is undefined. Also Thinker doesn't try to reparse the files so the value is ignored in the mod too.

> The Social Opposition is straightforward, as we've all experienced that you can't run the SE choice your faction hates.

Yeah, I like to make the distinction here between "hard" and "soft" limits. Both the AIs and humans are not allowed to take social opposition model, so it's kind of a hard rule. Humans can make choices differing from social priority models but the vanilla AI most often tends not to. You might compare it to the fact vanilla AIs never rushed production until it was implemented in this mod (also a config option). Thinker AIs are biased to select the social priority model, but by design, sometimes other priorities can override it if the other choices provide vastly better benefits.

> Since probably some players prefer the AI playing like a human as much as possible, while others prefer it to play as it does in the original game, I think it would be reasonable to make this a configurable option.

Ehm, but it *is* a config option, and should not be even hidden in any weird place. If you set social_ai=0 in thinker.ini you should see exactly same social engineering choices than what the vanilla AI does, unless there's some indirect effect somewhere, which I'd doubt.


Offline Jade Panther

Re: SMACX Thinker Mod
« Reply #313 on: July 20, 2019, 03:42:07 AM »
I played my game (Librarian, large world, low erosion, 30-50% land) to 2261, at which point I won a diplomatic victory and did a post-mortem. I also downloaded k3v's game from post #96 for comparison.

Morgan lost his HQ, in my game, in 2219, and hadn't started rebuilding one by 2261. In k3v's game, both the Gaians and the Caretakers lost their HQ's and rebuilt them. So it's not that the function for the AI to rebuild its HQ doesn't exist, but that it specifically didn't work for the Morgans in my game. Possibly the issue was that it was Morgan: none of his bases were larger than 4 pop, and none of them had much in the way of infrastructure (why build recycling tanks when you can build another supply crawler?), so any code that started by saying "if the faction has no HQ and this is a decently developed base, consider building a HQ" would ignore all of Morgan's bases.

It took the Caretakers about 10 years to rebuild their HQ after the meteor took it out, half that for a base to decide to build HQ and half for the HQ to actually be built. I didn't check for his Gaians. So I still think that your SE AI should take into account whether the AI has a HQ or not.  It's not realistic to expect the AI to promptly rebuild lost HQ's unless you write code specifically for that purpose.

A second issue in my game was that the Believers and the Hive never ran "Planned" and never built Probe Teams. I eventually figured out that this was because both of them skipped researching "Planetary Networks" (as of 2261). Looking at k3v's save, I see that his AI Usurpers never researched Planetary Networks either.  I suspect that this trend is a side effect of your tech_balance code.

I suggest adding this tech that gives probe teams and the Planned SE choice as well as being a prereq for the tech for crawlers (and some minor obscure SP) to the list of techs your tech_balance code prioritizes.

The third issue was that practically none of the AI's in my game developed bases large enough to need hab complexes. Yang had built one hab complex by 2250, and Morgan had built one by 2261. Looking at k3v's game, it's not a general problem of the mod - the prosperous AI's in his game built plenty of hab complexes. Upon review, I think it's because I chose the "low erosion" and mostly land settings when I started the game. That meant there were a lot more rocky tiles than under other erosion settings and most bases did not have access to water tiles to compensate. Your AI's space their bases closely together, so if they have a lot of rocky tiles close together it's easy for them to have access to only 7 productive tiles in their radius (after you take into account that neighbouring bases want those tiles too).

You may want to consider teaching your terraformers to break up rocky terrain (the "level" terraforming command) when appropriate.

Offline Induktio

Re: SMACX Thinker Mod
« Reply #314 on: July 20, 2019, 01:54:28 PM »
> I played my game (Librarian, large world, low erosion, 30-50% land) to 2261, at which point I won a diplomatic victory and did a post-mortem. I also downloaded k3v's game from post #96 for comparison.

Just remember that k3v's game was played on a much earlier version of Thinker so there might be some differences. :) Can you upload your games somewhere and send the link to me? Preferably multiple saves at different points of time because some of that stuff needs a closer look.

> so any code that started by saying "if the faction has no HQ and this is a decently developed base, consider building a HQ" would ignore all of Morgan's bases.

It is possible sometimes the AI can fail to start the new HQ buildup. Basically I could write that particular piece of code in a different way so that it is guaranteed to start the new HQ somewhere if it ever loses the previous one.

> A second issue in my game was that the Believers and the Hive never ran "Planned" and never built Probe Teams. I eventually figured out that this was because both of them skipped researching "Planetary Networks" (as of 2261).

Currently Thinker does not prioritize Planetary Networks either way (on the default tech tree) but that might be changed. The priorities could be easily extended to include the prerequisities for the crawler tech. Though it does seem really strange Hive would not research Planetary Networks when that tech should match Hive's default Build priority. Are you playing with the default tech tree and factions?


 

* 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 Earth is the cradle of the mind, but one cannot stay in the cradle forever.
~Konstantin Tsiolkovsky, The Father of Rocketry

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

[Show Queries]