Author Topic: SMACX Thinker Mod  (Read 11181 times)

0 Members and 1 Guest are viewing this topic.

Offline Induktio

Re: SMACX Thinker Mod
« Reply #330 on: July 20, 2019, 01:54:28 PM »
  • Publish
  • > 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?


    Offline Jade Panther

    Re: SMACX Thinker Mod
    « Reply #331 on: July 20, 2019, 06:52:47 PM »
  • Publish
  • Zip file attached.

    I was using vanilla files, because I wanted a control run of your mod so that I could understand what it does before I start modding it myself :). (The exceptions are that I turned used your SE choice algorithms until around 2235 and then switched to vanilla SE algorithms, and I played about 5 turns with borehole-drilling disabled, which I don't think that made any substantial long-term differences.)

    Yang (and Marr) are build-conquer leaders, and the conquer value of Planetary Networks is 0, so they want it, but they want a lot of other things, too. I think what happened to them is that the focus on Gene Splicing opened up other options that the RNG normally wouldn't give them, plus bad luck, plus the settings of my map, which I'll get to in a few paragraphs. Miriam is build-explore, which means she hardly wants Planetary Networks at all, which is ironic since the Believers are built around the probe game. (I think I'm going to edit the conquer value of Planetary Networks to 3 in my house rules, since Planned and probe teams are both pretty useful to conquerors.)

    In any case, I think that adding Planetary Networks to your prioritized techs makes sense, since it's a strong tech in its own right and, being a prereq for crawler tech, it doesn't hurt your other goals.

    If you look at the base views for Sanctity Base, New Eden, and Sparta Command, they all have 9 or 10 rocky squares within the base radius. So leveling terrain is something that the AI's should know how to do in order to handle low-erosion maps. After examining the save games in more detail, I no longer think it key. (I eventually concluded that any rainy rocky square in the radius of one of my bases was going to get leveled unless it had a mineral resource, something I wouldn't do on normal erosion maps.)

    I used the scenario editor to play as Hive in 2250 and discovered a few more things. Yang has a couple more bases that are excellent candidates for hab complexes, but he's overwhelmingly building military units. Well, I'm at vendetta with him, I'm next to him, and I'm much higher on the power graph than him (it is a Librarian game), so that makes sense. By contrast, k3v's AI's presumably felt secure, as they were either more powerful than or distant from the factions they had vendettas with. And they had +3 growth from the difficulty setting, unlike the AI's in my game. Lal was much the strongest AI in my game, but his bases could and did grow to size 9 without hab complexes.

    Taking over from AI Yang, one of the first things I did was try to trade with the AI's for tech. I was able to pick up 8 techs by tech trading. So, why didn't the AI do that?

    I think that the AI is triggered to talk to each other by their non-air units encountering each other (because normally that's when the AI starts conversations with the player). I noticed that the AI's expanded relatively quickly until they reached 22 bases, then they paused. Because your algorithm distributes factions evenly across the map, this meant that there were still substantial distances between the factions, and so their units would have rarely encountered each other, hypothetically resulting in less tech trading between the AI's than in a vanilla game. It's possible that the high land % of my map settings contributed to this as well. It's also possible that tech trading in a vanilla game masks Conquer factions not researching Planetary Networks, because the other AI's trade it to them, or they take it when they capture a base.

    Also, I don't know whether you have control of this or not, but the AI's should build more cheap infantry units(!)

    If you look at the 2184 save, AI Peacekeepers have 2 land combat units for 12 bases. (I left a couple of fungal towers on the border between myself and them, and I could see their units suiciding on the fungal towers, perhaps they don't distinguish between fungal towers and spore launchers?)

    Edits in italics or struckout.
    « Last Edit: July 20, 2019, 11:43:10 PM by Jade Panther »

    Offline Induktio

    Re: SMACX Thinker Mod
    « Reply #332 on: July 21, 2019, 09:30:20 PM »
  • Publish
  • > Yang has a couple more bases that are excellent candidates for hab complexes, but he's overwhelmingly building military units.
    > Well, I'm at vendetta with him, I'm next to him, and I'm much higher on the power graph than him (it is a Librarian game), so that makes sense.

    One of the newer features implemented in v0.9 was that if the AI loses bases to conquest, it triggers an extra priority to build more combat units. Some people observed previously the AI built too little defense so that thing was upgraded. Speaking of that, it seems Hive is really going nuts with that rover building, way over 30 impact+ rovers in some of the later saves. Though it would certainly build more needlejets instead if it just had the tech.

    > I noticed that the AI's expanded relatively quickly until they reached 22 bases, then they paused.

    That one is actually a self-imposed limit, the AI just stops building pods whenever it reaches the map size specific limit. It isn't even related to any lack of production lol. Maybe I should sometimes run a testing game with this limit removed and see what happens. Maybe this limit could even be configuration option.

    > Because your algorithm distributes factions evenly across the map, this meant that there were still substantial distances between the factions, and so their units would have rarely encountered each other, hypothetically resulting in less tech trading between the AI's than in a vanilla game.

    You seem to have a pretty detailed understanding on how the map layout might affect tech trading. I'm not certain on how the AI-to-AI tech trading works, since diplomacy code is still largely unreversed. But I could imagine something like this could be happening here.

    > Also, I don't know whether you have control of this or not, but the AI's should build more cheap infantry units(!)

    Those Peacekeepers have way less infantry than they should have, not sure even if those fungal towers can explain all of that. It seems like some kind of an anomaly. Generally the AI also needs to avoid building too much unneeded defensive untis that eat up support, that was also a major problem with the vanilla AI.

    Offline Jade Panther

    Re: SMACX Thinker Mod
    « Reply #333 on: July 22, 2019, 03:41:39 AM »
  • Publish
  • One of the newer features implemented in v0.9 was that if the AI loses bases to conquest, it triggers an extra priority to build more combat units. Some people observed previously the AI built too little defense so that thing was upgraded. Speaking of that, it seems Hive is really going nuts with that rover building, way over 30 impact+ rovers in some of the later saves. Though it would certainly build more needlejets instead if it just had the tech.

    He's already doing that buildup after I've started killing his units but before I take any bases from him. (See 2244 and 2250 saves.) Which is good.

    > I noticed that the AI's expanded relatively quickly until they reached 22 bases, then they paused.

    That one is actually a self-imposed limit, the AI just stops building pods whenever it reaches the map size specific limit. It isn't even related to any lack of production lol. Maybe I should sometimes run a testing game with this limit removed and see what happens. Maybe this limit could even be configuration option.

    Don't worry about it. They paused when they reached approx. 22 bases. Then they resumed settling new bases. Santiago (for example) expanded from 18 bases in 2225 to 28 bases in 2250 and 30 bases in 2261.  At "Librarian" difficulty. Presumably it would be worse under Thinker or Transcend.

    You seem to have a pretty detailed understanding on how the map layout might affect tech trading. I'm not certain on how the AI-to-AI tech trading works, since diplomacy code is still largely unreversed. But I could imagine something like this could be happening here.

    I'm guessing.

    For 20 years I've assumed that the SMAC/X AI's trade techs among themselves, because the AI's in other Civ games do that. Then a few days ago I used the scenario editor to take over and play as Hive, and I was able to trade for 8 techs in the first turn. "I shouldn't have been able to do that." So maybe the AI's weren't trading amongst themselves because of the map settings, or maybe they're not trading amongst themselves because AI's just don't do that in SMAC/X, or maybe who knows what?

    The AI's do get techs faster than research alone would account for - I keep detailed enough stats that that much is clear. So they are getting techs from somewhere else too. The Hive and Believers didn't have probe teams, so that wasn't a source for them in this game. So - probably they're trading some? Not nearly as many as they could.

    I've been paying more attention since then, and certainly the AI will talk to you without units meeting. Units meeting is one trigger for AI's to talk, there are others, and units meeting doesn't always trigger the AI to talk.

    > Also, I don't know whether you have control of this or not, but the AI's should build more cheap infantry units(!)

    Those Peacekeepers have way less infantry than they should have, not sure even if those fungal towers can explain all of that. It seems like some kind of an anomaly. Generally the AI also needs to avoid building too much unneeded defensive untis that eat up support, that was also a major problem with the vanilla AI.

    I think it's more complex than that. (Although it's certainly true that that was an issue with the vanilla AI).

    The factions fall into 3 categories: Morgan (usually running FM with negative Support), Peacekeepers and University (may be running FM or Planned, rarely have Support bonuses), and Believers/Hive/Sparta and, to an extent, Gaians, (rarely or never running FM, vanilla AI usually runs Power if they have that choice, except for Gaians they have additional bonuses to Police and/or Support.)  Ideally, an AI should look at a faction's SUPPORT and POLICE settings when it's deciding how many units to have sitting around.

    Unless you're running Free Market, at least one of your units per base will function as a police unit. So you're getting some return on that mineral.  I noticed that your AI often had newly-founded bases without defensive units in them.

    I'd guess I sniped about 5 over the course of that game. Those bases don't show on later maps because they went from pop 1 to pop 0 when I took them, which was fine by me: I wanted to deny the bases to the AI, not to acquire undeveloped bases in inconvenient locations. (There's a reason why the Believers in my game stopped expanding when they did, and it's not that they stopped sending out colony pods after reaching 22 bases.)  And, of course, when Lal only had two combat units, he wasn't getting the police bonuses in most of his bases.

    I would suggest that if the AI doesn't send out military units specifically tasked with guarding its colony pods (which would be a nontrivial amount of code), the first item built at a new base should be a cheap defensive infantry unit, not a recycling tank or anything else.  I haven't checked what it does now, and it's possible that it would have promptly built a garrison unit at Thinker and Transcend difficulty but took a while because Librarian. At Transcend, with SMAC rules, a "cheap infantry" is 1-3-1 typically costing 2 rows of 7 minerals for 14, i.e. 4 above the 10 free minerals when founding a base. At Librarian, with SMAX rules, the AI's preferred "cheap infantry" is a 1-3r-1 costing 3 rows of 10 minerals for 30 minerals total.

    Believers/Hive/Spartans all have bonuses to Police and/or Support, and they usually run Power when they have the chance. Take the Hive for example (I just played 20 turns with them.) Running Police State without Power, they have +2 Police and +2 Support, which gives them 4 free units per base and up to 3 units per base count as police suppressing up to 6 drones. So, I had, on average, 1 former per base, 1 at-large unit such as a rover or an assault infantry per base, and two or three (police) defensive infantry units just permanently sitting in the base. Under Power SE it's better.

    My workhorses before fusion power are 1-3-1's, because they only cost 2 rows of minerals, not 1-3r-1's because they cost 3 rows of minerals. The present AI prefers 1-3r-1's, though, I presume because they're better once built. It'd be cool for Progenitor factions to use 1-3r-1's for thematic reasons, but I think the AI should ignore 1-3r-1's for the human factions, because they're too situational for the AI to use well.

    There's a lot of synergies between the Power SE setting and the AI. The -2 Industry modifier for Power really hurts a player, but the AI has +2 or +3 Industry at Thinker or higher difficulty, so it can afford it. Having +4 support (Believers running Fundy/Power or Hive running Police/Power) allows the AI to keep massive numbers of units support-free at large bases, so it can defend in depth everywhere without having to think at all, really. The player, on the other hand, really doesn't want that -2 Industry modifier, which makes unit maintenance a scarce resource for the player, and means the player has to think about where to put their scarce units, which makes the game fun.

    The vanilla AI has problems with never scrapping obsolete units and not putting non-lethal methods on any of their garrison units. But it doesn't have a problem with those factions that run Power having too many current-edge technology units.

    Offline Induktio

    Re: SMACX Thinker Mod
    « Reply #334 on: July 22, 2019, 03:19:52 PM »
  • Publish
  • Don't worry about it. They paused when they reached approx. 22 bases. Then they resumed settling new bases. Santiago (for example) expanded from 18 bases in 2225 to 28 bases in 2250 and 30 bases in 2261.  At "Librarian" difficulty. Presumably it would be worse under Thinker or Transcend.

    Actually that limit is the same for every difficulty level, it's only scaled for the map size. Whenever the AI reaches the maximum base limit, it simply stops building pods in all bases. Currently the upper limit is equal to min(40, MapSquareRoot/2) so that means it caps at 40 bases on huge maps. Usually it will stop expansion sooner if there's no unclaimed territory near its bases or it becomes involved in vendettas. Do you think this variable should be scaled for difficulty level too?

    The AI's do get techs faster than research alone would account for - I keep detailed enough stats that that much is clear. So they are getting techs from somewhere else too. The Hive and Believers didn't have probe teams, so that wasn't a source for them in this game. So - probably they're trading some? Not nearly as many as they could.

    I've been paying more attention since then, and certainly the AI will talk to you without units meeting. Units meeting is one trigger for AI's to talk, there are others, and units meeting doesn't always trigger the AI to talk.

    I'm quite certain the AIs trade techs amonst themselves sometimes, but not sure about the details how it occurs since it's related to the diplomacy code. The factions have two main ways of initiating contact:

    1) during turn_upkeep diplomacy phase based on some unknown variables
    2) whenever their units meet and some variables indicate that contact should be initiated

    So can't say for sure how that trading might occur unless somebody has more info here. Diplomacy code is still mostly unknown, not sure how much will get done about it.

    Offline Jade Panther

    Re: SMACX Thinker Mod
    « Reply #335 on: July 23, 2019, 05:24:36 AM »
  • Publish
  • Actually that limit is the same for every difficulty level, it's only scaled for the map size. Whenever the AI reaches the maximum base limit, it simply stops building pods in all bases. Currently the upper limit is equal to min(40, MapSquareRoot/2) so that means it caps at 40 bases on huge maps. Usually it will stop expansion sooner if there's no unclaimed territory near its bases or it becomes involved in vendettas. Do you think this variable should be scaled for difficulty level too?

    A good question.

    For context, when I wrote my comment I thought that there was no limit on the number of bases, and I merely meant that the AI would have presumably created more bases if it had had the +Industry and +Growth bonuses that go with higher difficulty levels.

    The cap of 40 seems arbitrary and obsolete. Scient's patch #21 increases the maximum number of units on a map from 2048 to many. When the maximum number of units was 2048, restricting any particular AI faction to 40 bases made sense. Now that that limit has been raised, and given that modders create maps significantly bigger than "huge", it seems reasonable to drop that limit.

    As for theory about the limit:
    • N+1 well-managed bases will beat N well-managed bases, all else being equal
    • I don't like feeling that I need to build more bases to keep up with the AI
    • Spamming bases shouldn't be a trivial way to beat an AI that's hard-coded not to grow above a certain number of bases

    So, if I were writing my ideal specs, I'd put a lower cap, but release the AI from that cap if the player built "too many" bases. And I'd probably give "conquest" factions a higher base cap than "builder" factions. (So how should the AI distinguish between "conquest factions" and "builder factions"?)  Etc.

    But in practice I think the current rules are fine.



    I've been looking at the code, and I think I understand it well enough to make a couple of simple changes. Specifically, I think that the "tech_balance" option should prioritize probe teams as well as formers and crawlers, and I think I understand how to code that. Secondly, I think that a base that has called the need_psych() function, and already has a rec commons and a holo theatre, should build a research hospital - that's what the vanilla AI does and that's what I do as a player - and I think I understand how to code that. Would you be interested in my opening a branch on Github and making those changes for your review?

    Offline Induktio

    Re: SMACX Thinker Mod
    « Reply #336 on: July 25, 2019, 07:26:16 PM »
  • Publish
  • > When the maximum number of units was 2048, restricting any particular AI faction to 40 bases made sense.

    The limit has always been 2048 units/512 bases in the game engine. Maybe you already realized by reading the patch notes, the cap cannot be lifted by applying any simple patches, so that feature was removed from Scient's patch.

    > I've been looking at the code, and I think I understand it well enough to make a couple of simple changes.

    Sure, go ahead and experiment with some new values. I did attempt to write it in a way it would be understandable without extensive reverse engineering knowledge. It's still possible to break things by applying new features if those don't interact well with the binary code. I don't promise to pull any changes but could do it if it's a really interesting feature or contributes new knowledge about the headers.

    If you're familiar with IDA, you can find the reversing database stuff from the decompilation coordination thread I think. The most important thing there is to import the variable/function names to IDA.

    Offline DrazharLn

    Re: SMACX Thinker Mod
    « Reply #337 on: August 16, 2019, 01:58:43 AM »
  • Publish
  • Disclaimer: I haven't played SMAC in a while now, but here are some unsolicited game-design thoughts anyway!

    Do the Gaian's still use boreholes a lot in the latest version of the mod? If so, I think it would be a nice change to automate a decent strategy for them that makes sense in the lore, at least at the "Thinker" difficulty and below.

    Slightly more sparse and less machine-like settlements might be more aesthetic, too.

    But this might just be my bias: I get put off if I feel like an optimising machine when I'm playing a strategy game; I like to play a bit more loosely and narratively. If the AI look like they're just tessellating base grids with the same terraforming strategy across the map that takes away from the fun a little.

    Again, I don't know if Thinker still does this or at what difficulty levels, but another potential issue if the AI has many bases that are all very good is that there may be less meaningful choice in what to attack. If some bases are producing loads of food and science and others loads of industry I can make a more narrative and strategic choice if e.g. I want to stop someone getting too far ahead in the techs or something.

    For me, that will contribute significantly to war weariness (I really don't want to have to beat a long and tedious war through a large empire; I would rather do something smaller but decisive). I understand this is not how some other people play ;)

    Offline Induktio

    Re: SMACX Thinker Mod
    « Reply #338 on: August 17, 2019, 10:43:22 AM »
  • Publish
  • So what kind of a terraforming strategy do you suggest? No boreholes/more forests or something? I mean, the Gaian AI usually does really well in this mod, so they could even be "nerfed" to level the playing field with other factions. This mod doesn't hardcode any behaviour for any particular factions, so the change in terraforming strategy should be tied to positive PLANET rating or similar, with +0 rating or less staying like they are now.
    « Last Edit: August 17, 2019, 12:52:48 PM by Induktio »

    Offline DrazharLn

    Re: SMACX Thinker Mod
    « Reply #339 on: August 17, 2019, 12:47:53 PM »
  • Publish
  • Yep, that's exactly what I'm getting at.

    Make forests, go for the fungal resource bonuses, etc. I don't play enough to know whether that is actually a competitive enough strategy.

    It would be real neat to just have eco-damage as a variable that pro-planet factions care about in all their key decisions (what terraforming to do, where to place workers, diplomatic relations, which bases to attack), but I think that's pie-in-the sky thinking.

    Offline dino

    Re: SMACX Thinker Mod
    « Reply #340 on: August 17, 2019, 02:11:28 PM »
  • Publish
  • Nerfing Gainas would be wrong, fix other factions insead...

    The only reason Gaians do so well is because they start with Centauri Ecology, and social_ai setting just multiply select few techs weights by 4, it doesn't ensure that factions with power, or tech focus will take it.
    In fact it ensures the opposite. I have this setting disabled and use edited weights in alphax.txt instead.

    But you could also change in HOOK_API int tech_value(int tech, int fac, int flag) function value *= 4; to value += 10; for example and other factions shouldn't be far behind Gaians with terraforming.

    As for Gaian flavor I am personally not bothered much by them, but one could make them build half the boreholes, one condenser per base, plant forest and build hybrid forest, It'd nerf them a bit though.

    Offline Induktio

    Re: SMACX Thinker Mod
    « Reply #341 on: August 18, 2019, 05:00:49 PM »
  • Publish
  • > In fact it ensures the opposite. I have this setting disabled and use edited weights in alphax.txt instead.

    I don't see how it could do the "opposite". It may not always guarantee the factions will research the techs quickly because of randomness, but it shouldn't cause any opposite effects.

    Following my usual method of testing, I tried some 1vs1 AI test games to see what effects the various nerfs might have. When Gaians are playing with/without boreholes, they stay almost equal for the first 100 turns. After that the borehole building version will begin to gain an insurmountable lead because of the extra energy, and will just stomp the other faction. Heheh.

    If the borehole building density is reduced by half, the effects are much more modest. The default Gaian AI will still remain somewhat stronger but not by a huge margin. In fact this kind of change would probably bring the Gaian AI to somewhat equal level with the other factions excluding the weakest ones.

    Although I think this nerf would not change the look of Gaian territory much. They might build more condensers instead of boreholes and the bases have still the same spacing etc. Going for fungal bonuses would fit the theme for planet factions, but the most bonuses are locked in the upper part of the tech tree and then fungus will quickly become overpowered. So for the most part of the game, it's not very competitive.

    Offline dino

    Re: SMACX Thinker Mod
    « Reply #342 on: August 18, 2019, 05:39:56 PM »
  • Publish
  • > I don't see how it could do the "opposite".

    I've meant tech_balance instead of social_ai, my mistake but it should be obvious from the rest of the post.

    Maybe opposite is the strong word, because with vanilla it's probably the same. If they don't get it early and trade some tech or pop a pod, they start to explore tech tree and can get CentEco with a huge delay. Additionally when they get it this late they often don't put formers fast enough since there is a lot of other stuff to build, especially if they're in war. I sometimes get factions that didn't start terraforming in 2150s with thinker tech_balance.

    I use modified alphax.txt that ensures that everyone take CentEco as their first tech to research and Gaians have only few turns advantage in terraforming.
    Using additive bonus, instead of multiplicative, like I suggested should assure that all factions will take selected techs asap, no matter what their ai weights are.

    Offline DrazharLn

    Re: SMACX Thinker Mod
    « Reply #343 on: August 18, 2019, 06:12:23 PM »
  • Publish
  • If in AI vs AI games all the factions are staying competitive (averaging across several games), then I don't really see that a change is required to the priority for C. Ecology.

    If the right choice for first tech really is always formers then that's a bit rubbish. There should be other valid options.

    Offline dino

    Re: SMACX Thinker Mod
    « Reply #344 on: August 18, 2019, 06:31:19 PM »
  • Publish
  • > If the right choice for first tech really is always formers then that's a bit rubbish. There should be other valid options.

    For humans you can prioritise getting free market, or planned first and do nothing but spam colony pods. In fact you need 2x bases ai have to get an advantage when playing thinker.
    With vanilla starting locations and standard map size, you could consider impact speeder rush.

    It's out of thinker scope to teach ai when the first one is safe to do, neither to perform second one sucessfully. So starting early terraforming is indeed the best choice for ai and the way the ai and  tech advancements works, if they don't get formers stright away, they will get them with a huge delay and got crippled. Gaians performance in thinker is all proof you need.

     

    * 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)
    -=-
    17 (7%)
    XP Compatibility patch
    -=-
    8 (3%)
    Gog version for Windows
    -=-
    66 (27%)
    Scient (unofficial) patch
    -=-
    24 (9%)
    Kyrub's latest patch
    -=-
    14 (5%)
    Yitzi's latest patch
    -=-
    84 (34%)
    AC for Mac
    -=-
    2 (0%)
    AC for Linux
    -=-
    5 (2%)
    Gog version for Mac
    -=-
    10 (4%)
    No patch
    -=-
    12 (4%)
    Total Members Voted: 242
    AC2 Wiki Logo

    * Random quote

    The substructure of the universe regresses infinitely towards smaller and smaller components. Behind atoms we find electrons, and behind electrons quarks. Each layer unraveled reveals new secrets, but also new mysteries.
    ~Academician Prokhor Zakharov, ‘For I Have Tasted The Fruit’

    * Select your theme

    *

    Facebook Comments