Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => The Theory of Everything => Topic started by: Induktio on August 20, 2018, 10:44:45 AM

Title: SMACX Thinker Mod
Post by: Induktio on August 20, 2018, 10:44:45 AM
Thinker (https://github.com/induktio/thinker) is an AI improvement patch for Alien Crossfire that greatly boosts the stock AIs while providing various gameplay improvements.

Summary of main features:

* New production AI for bases (more sensible and balanced production choices)
* Improved terraforming AI (lots of condenser-farms, boreholes and forests)
* Rewritten code for AI faction social engineering choices
* AI builds more crawlers and deploys them better
* AI will deploy colony pods much sooner instead of wandering on the map
* Unit auto design feature creates improved prototypes for the AIs
* Customizable options for free formers and satellites for AI factions
* Possible to select which landmarks are placed on random maps
* Faction placement balances random map starting locations
* Does not affect player-run factions or game mechanics
* Game binary includes Scient's patch v2.0

Installation:

* Extract the files to game folder
* Check the readme for release notes
* Change configuration from thinker.ini or use the defaults
* Bundled alphax.txt includes optional/recommended changes only
* Start the game from terranx_mod.exe
* Mod version/build date should now be visible in the game version menu

Downloads and more details: https://github.com/induktio/thinker

Latest features are provided by develop builds if the release date indicates it is the newest file.

Other possible mods to use with Thinker:
* Pracx graphics enhancement patch (https://github.com/DrazharLn/pracx)
* SMAC-in-SMAX mod (https://github.com/DrazharLn/smac-in-smax)
Title: Re: SMACX Thinker Mod
Post by: bvanevery on August 21, 2018, 03:46:20 AM
I think it's my appointed role to be the bearer of bad tidings...

You can't legally license the binaries you provided under the GPL, because you have no rights to the original game .exe.  Those rights belong either to GoG and/or Firaxis.  When people make .exe patches, they are merely hoping that the right holders never catch up with them.

The choice is also a bit nonsensical, as no source code exists for the game .exe anyways.

You are probably trying to protect your own source code somehow.  I'm not exactly sure how one properly finesses that, given that the endeavor probably violates the game's End User License Agreement.  I'm not up on what various jurisdictions allow for binary patching or reverse engineering, or what the consequences are for violating a EULA.

Modding the factions.txt and alphax.txt doesn't have this problem, because all of those files contain text from Firaxis giving people permission to change whatever they want in those files.  Ergo, I have never "licensed" my mod work.  I put a Copyright on it, on the off chance that somehow I have rights of authorship when creating a derivative work.  I don't know that I actually have any, I just put it in there anyways just in case.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 21, 2018, 10:23:09 AM
You can't legally license the binaries you provided under the GPL, because you have no rights to the original game .exe.  Those rights belong either to GoG and/or Firaxis.

There's nothing controversial in the source code regarding Firaxis, simply because it does not contain copyrighted works by Firaxis. It does, however, contain the needed binary diff to reconstruct the patch exactly given the game binary in GOG installation. Other binaries compiled from the source are licensed under GPL. Furthermore, any players need to have the game installation provided by GOG to start the game.

All in all, even a 5 minute search of the web would have revealed how similar projects like OpenRA or OpenTTD, that even reversed whole game engines, manage their licensing. They've been doing fine under GPL for 10 years now, and that's the way it's going to stay.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on August 21, 2018, 03:39:24 PM
All in all, even a 5 minute search of the web would have revealed how similar projects like OpenRA or OpenTTD, that even reversed whole game engines, manage their licensing. They've been doing fine under GPL for 10 years now, and that's the way it's going to stay.

If they are distributing binaries with a GPL, that doesn't make their actions legal.  Distributing a patched original game binary, is also not the same legal circumstance as entirely reverse engineering your own implementation of a game.  I wonder how they wordsmithed their licensing, vs. what they cannot license?  I will check.

My suggestion is that you make some kind of plain and obvious statement in your distro, that you do not have any rights to GoG or Firaxis' work, and that the license only applies to your own code.  Otherwise, you are vulnerable to summary takedown notices.  Even with such a notice you may be vulnerable anyways, but at least you wouldn't look like you are willfully trying to pass the work off as your own, under a GPL license.

Takedowns can affect other .exe patches, i.e. Yitzi, Scient, Pracx, if GoG or Firaxis gets interested. Trying to make it look more kosher, is about more than just your own work.  Historically, nobody else has ever been claiming a license on anything.  They just have offered patches, and have not typically offered source code to go with the patches.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 21, 2018, 07:36:01 PM
Takedowns can affect other .exe patches, i.e. Yitzi, Scient, Pracx, if GoG or Firaxis gets interested. Trying to make it look more kosher, is about more than just your own work.  Historically, nobody else has ever been claiming a license on anything.  They just have offered patches, and have not typically offered source code to go with the patches.

Well, duh. If the mod author does not specify a license for a work, it does not mean it's public domain. Quite the contrary. In most jurisdictions copyright is automatic for any applicable works and needs to be explicitly disclaimed by an author for the item to be in public domain. If Pracx authors didn't explicitly specify some kind of a license, it could not be combined with other programs (they seem to only provide a public domain clause in the forum thread).

Now, any kind of implication I would be claiming copyrighted Firaxis content as my own is not true. If people have an issue with the way licensing is presented, it's really easy to add the trademark clauses excluding any Firaxis content from the mod's licensing, which is what I'm probably going to do. Other than that, there's no real issue here.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on August 22, 2018, 06:06:23 AM
Now, any kind of implication I would be claiming copyrighted Firaxis content as my own is not true. If people have an issue with the way licensing is presented, it's really easy to add the trademark clauses excluding any Firaxis content from the mod's licensing, which is what I'm probably going to do. Other than that, there's no real issue here.

That is the sum total of what I'm suggesting.  It may protect you better in some circumstance, and it protects the community.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 08, 2018, 11:03:30 AM
Now to get back on topic, there's some new features that could get into the next release. It could be possible to incorporate some of the fixes from Scient's patch to this one.

I attached the descriptions from Scient's patch v2.0 (http://alphacentauri2.info/index.php?topic=14141.msg64080#msg64080) readme below and assigned numbers on them. Of the players who regularly play with that patch, which one of these fixes do you consider essential? These changes are more extensive than the ones in older v1.0 which is still linked in the sidebar for some reason.

(click to show/hide)
Title: Re: SMACX Thinker Mod
Post by: bvanevery on September 08, 2018, 06:43:34 PM
Now to get back on topic,

The licensing of your work was never off-topic.  I hope in the future you remember that just because someone objects to what you are doing, that doesn't make it off-topic, irrelevant, or out-of-bounds.  I don't have presently have anything else to say, because 1) I'm busy with my own modding stuff and haven't vetted your latest efforts, 2) what you just posted is somewhat long and requires effort to think about, and 3) claiming "not on topic" doesn't dispose me to thinking about it.  So for now I've spoken my peace about 3), hoping I don't have to again.  Similarly, if feedback goes in a direction you didn't like and didn't want it to, that doesn't automatically make it a "derail".


Title: Re: SMACX Thinker Mod
Post by: Induktio on September 08, 2018, 08:21:06 PM
To be fair I don't really have any interest in the sort of meta-level wrangling where somebody has to prove some kind of point on this forum. The mod's copyright disclaimer was updated, so there's that. So far there has not been much discussion of the mod's technical side in this thread and I also suspect lurkers are not interested in contributing in threads that look like arguments.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on September 08, 2018, 09:59:23 PM
There isn't any "meta" on my part.  Regarding copyright, it took me some time to get you to understand what was at stake.  You seemed to eventually get it, and my last message on the subject was pretty clear about all I thought you really needed to do.  I think you actually did it, although I haven't checked, but I'm willing to assume "case closed" on that one.

The previous issue with you ruining how the Explore, Discover, Build, Conquer weights work, is very important to any modder who knows how alphax.txt actually works and has done non-trivial tech tree modding.  It's not meta, it's critical.  I don't know what you're currently doing about that, and I feel like I have the burden of going over your sources with a fine toothed comb now to check.  Which is not a fun project, definitely something that I push farther and farther into the future.  I hope you've changed your tune on this issue in the interim.  There's nothing meta about it, it's just that your previous approach was a dealbreaker.  At the time, you didn't seem to appreciate the seriousness of ruining, say, 50% of the work I've done in my mod over 3+ person months.  Even releasing version 1.19 sometime next week, I am still working on those Explore, Discover, Build, Conquer weights.  They matter.  They're the difference between factions going up one side of the tech tree or the other, or being completely unable to go up it at all.

I understand and appreciate the problem of you getting a lack of feedback on technical details.  That's just the reality of working on a game as old as this, in a community that's had stronger participation as recently as 5 years ago.  I hope that when people come along with "knowledge" of the ins and outs, and have a reasoned basis for what they're trying to tell you about how things work, that you take it seriously.  The reality is, there aren't going to be a lot of experts coming your way to tell you X Y Z, so I hope you use what you actually get.

95% of stuff in my own mod, I've figured out myself.  The other 5% I've gotten from other people, has been very useful though.  Frankly, that's why there's about to be this substantial 1.19 release.  I thought I was done.

I will get around to responding to your technical details when I think it will be constructively received.

I might suggest, you have a chance of getting more response, if you try posting on a narrow issue.  In other words, like one uses a bug tracker.  Then people can say yes / no / maybe / here is the relevant resource.  I don't know that people will respond, I just think it increases your chances.  It definitely increases chances that I will respond, helpfully, for instance.  Like if you ask something and I happen to know the answer, then hey boom here's your answer.

Title: Re: SMACX Thinker Mod
Post by: Induktio on September 09, 2018, 01:11:01 AM
That's some quite big accusations you have going there despite my explicit request not to turn this thread into that sort of thing. I'm not requesting help specifically from you - probably never did, yet you seem to act like I was doing that. You're not accomplishing anything by continuing on that line, not to mention all the other accusations.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on September 09, 2018, 02:51:31 AM
I've been trying to explain the difference to you, with what you frame as "meta battles of the ego", and actual problems with your binary modding.

The licensing issue, I said I think you got that sorted, probably "case closed".  Me saying this, shouldn't be making you mad.

Ruining the Explore, Discover, Build, Conquer weights in a previous version of your patch, isn't an accusation, it's a fact.  I explained it all to you in great detail in the other thread.  I don't feel a need to do it here again.  In the time that has passed, I was hoping you'd figured out the factual consequences of changing zeros into non-zeros, in the weights.  If you can't / won't figure that sort of thing out, there's no point contributing any technical feedback to you about anything.  You'd just be an engineer who isn't that good and can't be worked with, on basic issues of protocols, stability, standards, maintenance, packaging, etc.  I'd like to think that's not you.  But, the world of Open Source does have a fair number of people who really don't care.  In a previous generation I think we called them code jocks or cowboys.  If it suits their personal careers, they will ruin a previous generation's work.  Breakin' eggs to make omlettes, early and often.

Any project I've ever been on, when I break stuff, and someone points it out to me that I broke it, I've fixed it.  I don't talk about accusations, I fix what I broke.

If you did fix it already, great!  Glad to hear it.  I'll need to verify it at some point, but it would be good to know.

If you didn't fix it... if you defend it... well, that is why I'm not keen to start responding to other technical questions.  The last one was pretty easy, from an engineering standpoint: zeros matter and you nuked them.  The fix for that wasn't hard either.  Just put back the zeros and be more conservative with the math you insert.  This is an easy thing.  If you don't see the easy things, or their serious consequences, why talk about any other stuff?

If you don't want help from anybody, then you don't need to be posting in a public forum.  Posting publicly for input, implies "help me".  Doesn't say how much help you're looking for, or on exactly what.  But you've definitely asked, "help me do some thinking about some issue I brought up," or you would not have posted that big list of stuff you just did.

If you don't want help from me, that's your choice.  You might get some feedback anyways, because it's a public forum.

But you'd get a lot more useful out of me personally if you actually gave an indication you understood the issues I've raised, as something beyond ego, meta, accusations, or topicality.
Title: Re: SMACX Thinker Mod
Post by: BU Admin on September 09, 2018, 03:40:04 AM
b, why are you looking to make this your problem?  Please let it drop.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on September 09, 2018, 06:14:24 AM
I will drop the Explore, Discover, Build, Conquer weights issue for now.  Having these work correctly is critical to my own modding work however, and Induktio's patch is designed to be used with other mods.

Binary patches vs. text mods have some general issues, not specific to Induktio's work.  Transparency of changes, encodings.  Yitzi's patch has a few problems with that, I think there are 3.  That's close to zero, which in hindsight is commendable, but not ideal.  Maintainability.  "Is it breaking something?" is a hard question to answer if you don't know the assembly code intimately, and the original author who had the knowledge has disappeared.  Even when they're available, it's a lot of work.  Packaging.  Yitzi for instance steps on alphax.txt, precipitating Yitzi-specific versions of other mods.  Some things I bring up to Induktio now, on the hope that he doesn't become "author of a super popular patch that disappears" several years from now.  There are some lessons of history to be learned here.

That's why I care.  I'm at the stage where someone else is now manually Yitzifying my mod.  Later it could be Induktifying my mod.  Easier if no one has to.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 09, 2018, 02:42:32 PM
I will drop the Explore, Discover, Build, Conquer weights issue for now.  Having these work correctly is critical to my own modding work however, and Induktio's patch is designed to be used with other mods.
Well, it's a good thing if we can get over this tech value issue for now. About the binary maintainability, this is still the patch that provides absolutely the most functionality using the minimal amount of binary patching, only a fraction of the other patches actually. Aside from a full open source fork, binary patches are not getting much more maintainable.

I intended to post this link earlier, and it is still valid to say some of the other comments have crossed the threshold for this: https://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt
Title: Re: SMACX Thinker Mod
Post by: bvanevery on September 09, 2018, 05:55:44 PM
I intended to post this link earlier, and it is still valid to say some of the other comments have crossed the threshold for this: https://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt

Since it's your thread, you're free to set the tone for how you want people to talk about things in any way you like.  Just be advised it has an effect.  I already commented about this in posts above.  Now we will see if someone wants to talk tech with you.  I am unsubscribing, and will wait a few more months to see where your project actually ends up.
Title: Re: SMACX Thinker Mod
Post by: BU Admin on September 09, 2018, 10:03:43 PM
;no
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 10, 2018, 03:15:35 PM
Okay. The development of this mod goes on anyway regardless of whatever antics we've had on this thread. It's not like anything has changed in that aspect.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on September 11, 2018, 10:39:08 AM
1,2,7,10,15,18,20,21,27(! - major obstacle),34,36,37,38,43,51.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 11, 2018, 03:25:59 PM
For clarity, here are the items from PvtHudson's list:
Quote
1.  [BUG] If a faction's cumulative PROBE value is greater than 3 (SE morale, covert ops center) it is possible to "mind control" their bases when they should be immune. If the University uses SE Knowledge putting PROBE value down to -4, it would act as if it were 0 erroneously increasing "mind control" costs. After patch, PROBE values greater than 3 will always be immune to regular probes and values less than -2 will be treated as if they were -2.
2.  [CRASH] It is possible usually on larger maps that scrambling air interceptors would cause the game to crash. Even when the game didn't crash incorrect altitude values were being used in checks. Both of these have been fixed.
7.  [BUG] Fixed a check that was ending the turn for certain air units (choppers/missiles/grav) when entering a base which had no adjacent enemy units. There is still a check which will end the unit's turn if when entering a base it has less then one turn remaining unless an enemy is adjacent to base.
10. [CRASH] When moving units near or at the poles, it is possible for y coord to exceed the map bounds and crash the game. Patch adds handling to prevent y coord from going over min/max.
15. [BUG][SMAX] Enhanced probes (Algorithmic Enhancement) are now able to mind control bases/units normally immune due to high SE morale as stated in SMAX manual. For units it's purely the morale SE value so >=3 acts as if it were 2 (cost doubled). For bases, the value is calculated from morale SE and any base facility modifiers (Covert Ops: +2, Genejack: -1). If final value is >=3, it acts as if it were 2.
18. [BUG][SMAX] Enhanced probes don't receive a penalty to survival probability when target faction has built Hunter-Seeker Algorithm. Instead, the success probability is erroneously given the penalty for a second time after it has already been displayed in UI. This could cause diminished success rate when it should have been higher. Patch corrects check so survival rather than success probability is modified.
20. [MISC] Disabled cpu check which serves no purpose other than preventing the game from starting on newer cpu's. Patch enables ForceOldVoxelAlgorithm=1 in code by default and suppresses annoying warning.
21. [BUG][SMAX] Sealurk units now do not get a penalty when moving onto Sea Fungus like Isle of Deep.
27. [BUG][SMAX] Fixed bug when AI successfully completes probe action of freeing a captured faction leader (FREEWILLY/FREEWHO) where it would reset a non-captured faction.  The problem was that AI would always try to free the very first faction (usually PC) regardless of whether they were elminated or not.  Fix now obtains all potential faction leaders to free and randomly picks one.
34. [BUG] Fixed logic in PB code to prevent ODP/Flechette defenses being called a 2nd time (with a chance for defenses to fail) even after PB had already been shot down.  Each faction has one chance to defend against incoming missile based on closest base or unit to PB blast.  However, there is secondary check to give the tile owner a chance to defend against PB even if they have no units or bases in this space.  This check didn't take into account whether or not PB had already been shot down.
36. [BUG] Fixed a bug that would display NERVEGAS message even when attack on base failed -> checking attacker health
37. [MOD] Add ability to set reactor (1-4) for #UNITS in alpha/x.txt (ex. "Colony Pod,..., 00000000000000000000000000,4" -> gives Colony Pods Singularity Engine).  To do so, just add comma after Abil with value of reactor you want for unit.  If no value is set, it defaults to "1" like original code.  For SMAX only, there are two exceptions for Battle Ogre MK2 and Battle Ogre MK3 where default isn't "1" but "2" and "3" respectively.  The Ogre default can still be overriden if you set a different reactor value in alpha/x.txt.
38. [BUG] Allowing colony pods to be added to bases with fungus on tile ; allowing sea/land pods to be added to existing sea/land bases ignoring building restriction
43. [BUG] Abandoning a base after building a colony pod no longer skips the base production of the next base.  This was caused by the upkeep function using incorrect base values after the abandoned base was destroyed.  Fixed so acts like #STARVE.
51. [BUG] Additional check to initial tile when build aquifer rather that tiles around it

Scient's patch was built on a slightly different version of the game binary than the GOG version, so in the case one tried to import all of the patches, there's some chance it might cause new glitches. Over some of the changes, it could be said people have learned how to play around the bugs over the years, so changing them is not strictly necessary. At minimum, I think the crash bug fixes 2. and 10. should be included maybe in addition to 27. also. Probe bug fixes could be quite important too. If people have save games where bugs 2/10/27 can be triggered easily, that would be useful.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 14, 2018, 04:25:23 PM
After some investigating it seems Scient's patches can be imported almost verbatim to the GOG version. There are some interdependencies in the code, so it would not be simple to take out any single fixes out of the whole patch, though. Importing all the fixes is pretty simple and can be done for at least v1.0. Here are the changes that would be imported from Scient's v1.0 patch:

(click to show/hide)

A total of 21 fixes is less than the 51 in v2.0 but many of those extra changes are a little bit on the modding side in contrast to simple bugfixes. I already have a savegame for the interceptor scrambling bug but can anyone remember where to find savegames where these bugs trigger?

[CRASH] When moving units near or at the poles, it is possible for y coord to exceed the map bounds and crash the game.
[BUG][SMAX] Fixed bug when AI successfully completes probe action of freeing a captured faction leader (FREEWILLY/FREEWHO) where it would reset a non-captured faction.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on September 15, 2018, 09:33:00 AM
Attached a save to reproduce "AI frees wrong captured leader" bug. Just press End turn and you will be "freed". Made on configuration described in http://alphacentauri2.info/index.php?topic=21007.0 (http://alphacentauri2.info/index.php?topic=21007.0) though.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 15, 2018, 04:00:14 PM
Yeah, that is a really funny bug when it occurs in the game. It is also reproducible in the base game without any mods. After I applied the patch, I can confirm the AI now frees Peacekeepers instead of the player. It seems the AI will not always perform the same probe action though.

I could probably consider creating a separate development build of Thinker if people want to try these changes before they get into the actual release. There's been quite a lot of stuff added to the code since the last release (v0.6).
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 19, 2018, 08:45:22 PM
I now updated the downloads page (https://github.com/induktio/thinker) to also include develop builds of the mod. They are versioned by the build date rather than a normal version number and contain all the recent changes from the repo. Also Scient patch v1.0 is included in the mod from now on.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 27, 2018, 12:46:00 AM
Scient did good work on their patch and their fixes aren't controversial. I don't really see why you don't just use their latest patch or Yitzi's as your starting point. Maybe that's been covered in another thread.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 27, 2018, 01:05:47 PM
Scient did good work on their patch and their fixes aren't controversial. I don't really see why you don't just use their latest patch or Yitzi's as your starting point. Maybe that's been covered in another thread.

Well, occasionally somebody has requested "include some patches" without going to specifics. The issue is just binary patching is not very maintainable and the behaviour is not configurable. Particularly Yitzi's patch diverges from vanilla game behaviour on multiple aspects. Maybe it would be easier to look at this if you could describe the features that people want from those other patch versions?

On other news, I included a screenshot of a test game to see how the AI builds its empires in the current version. Turn is 145 and this is the moment when Gaia actually first reached 1000 labs output per turn. This test was done using version Thinker-dev-20180924 (it's in the downloads page). Next version after this will also see another big improvement because it will contain a patch that makes the governors choose borehole tiles more often.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on September 28, 2018, 09:32:34 AM
OMG, then what will Yang look like!
Title: Re: SMACX Thinker Mod
Post by: Geo on September 28, 2018, 10:20:18 PM
OMG, then what will Yang look like!

Boreholes I have known...
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 29, 2018, 02:50:05 AM
Scient did good work on their patch and their fixes aren't controversial. I don't really see why you don't just use their latest patch or Yitzi's as your starting point. Maybe that's been covered in another thread.

Well, occasionally somebody has requested "include some patches" without going to specifics. The issue is just binary patching is not very maintainable and the behaviour is not configurable. Particularly Yitzi's patch diverges from vanilla game behaviour on multiple aspects. Maybe it would be easier to look at this if you could describe the features that people want from those other patch versions?

Vanilla SMACX has a bunch of bugs, some of them game breaking, many of them confusing. Everything listed in Scient's patches is worth including IMO because they're almost all bug fixes and where they're not they're small and unobtrusive fixes (and I have checked the entire list :) )

The only controversial change I can find in the changelog is: "Fungal Missiles would spawn MW in ocean tiles -> fix by spawning IoD instead and adding in one Sealurk instead of Fungal Tower.", and the only controversial bit about that is what to do instead of spawning a fungal tower (which looks awful and dies at the end of the turn if on water). The remaining non-fix changes are backwards compatible and small.

I don't entirely understand your point about maintainability, either. Scient and other members of the community spent a lot of time discovering and fixing bugs and then testing the fixes. These bug fixes don't really need onward maintenance. The sites of the fixes are also annotated by scient, so if you're going to be hacking on some code nearby you can be aware of it. Tell IDA about it, even.

Similarly for configurability: bug fixes don't need configuration switches.

The only way these fixes could hurt maintainability are if they 1) confuse your reverse engineering tools too much; 2) break the boundaries of functions you want to hijack (unlikely). Including these fixes is likely to improve maintainability by removing bugs from the code base and so reducing bug reports etc.

Scient and others on the bugfixing team did good work over many years on SMACX. It seems pretty daft to me not to build on that work.

I attach scient's v2 patch files here for ease of access.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 29, 2018, 02:52:46 AM
Also Gaians shouldn't be building loads of roads and boreholes ;)
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 29, 2018, 12:25:10 PM
The only way these fixes could hurt maintainability are if they 1) confuse your reverse engineering tools too much; 2) break the boundaries of functions you want to hijack (unlikely). Including these fixes is likely to improve maintainability by removing bugs from the code base and so reducing bug reports etc.

Scient and others on the bugfixing team did good work over many years on SMACX. It seems pretty daft to me not to build on that work.

Yes, I've seen what those changes are in v2, and maybe you consider them important changes but you can't expect to have the opinions heard if you don't comment which patch should be included. There's a big difference in patch size when it comes to v1 and v2. The first has 1300 bytes of changes while the second has over 3100 bytes. Even this website offers the v1.0 patch in the sidebar. Maybe it should be updated, but dunno. We might look into that later.

I do take an issue here about saying that I would not be building on Scient's work. There's probably very little chance I would have undertook this project if it was not for the reverse engineered databases Scient had provided. Maybe you notice this if you look at the header files. Figuring out what all those variables do would have been way too time consuming to do without any help. Even then I had to fill in some gaps continuously because some features needed to added.

***

Looks like I cannot overstate the importance of that borehole worker allocation patch. In some cases it can increase AI research output by as much as 50% because so many of those boreholes are left unused until the population is high. I actually continued the game in the screenshot after some changes and in only 10 short turns Gaia would deploy satellites, build cloning vats, and balloon the labs output to way over 2000 per turn. It would probably transcend around turn 180 but it is kinda bottlenecked by the mineral cost of the Ascent project when it has "only" 50 minerals in the top base.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 30, 2018, 05:54:14 PM
> maintainability

Why not load your code as a dll and only modify the stuff you want to? We can hack the .exe to load a common loader dll that will then load all mod dlls in the directory (perhaps identified in a text file?).

That's roughly how PRACX works and would allow us to make these binary changes more easily composable and means you don't need to include anyone else's work in your project if you don't want to. It also means you don't need to distribute the updated terran binaries, just your dll, the loader dll and a script to patch terran.exe to use the loader.

I can help you build this if you don't know how.

> comment which patch should be included

I've been through the list of changes a few times recently and I think all of scient v1 and v2 should be included. I think they're all important and together make the game more predictable/understandable and a lot less buggy.

> Even this website offers the v1.0 patch in the sidebar

It probably should be updated, but v2 wasn't released in a big way because it was included in Yitzi's patch.

> building on that work

The IDA db is very useful (and I hope you upload your local copy if you've made improvements :)), but there was a wider bug-fixing effort that catalogued, tested and fixed bugs. These bugs are real and do make a significant difference to how the game is played and the general quality of the game, IMO.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 30, 2018, 07:20:50 PM
Why not load your code as a dll and only modify the stuff you want to? We can hack the .exe to load a common loader dll that will then load all mod dlls in the directory (perhaps identified in a text file?).

That's roughly how PRACX works and would allow us to make these binary changes more easily composable and means you don't need to include anyone else's work in your project if you don't want to. It also means you don't need to distribute the updated terran binaries, just your dll, the loader dll and a script to patch terran.exe to use the loader.

I'm not sure what do you exactly mean by the first part because the code is already executed in the dll. Binary patching is only used to insert dll function calls to certain important places. That was the idea of this project, to avoid binary patching as much as possible. Basically all the variable locations that I reversed are present in the header files. Borehole patch is almost the only thing that changes the logic without calling a dll function.

Maybe it could be made more composable by some loader utilities but it's a potentially error-prone step for users if they patch an incompatible file, and dynamic patching brings some complexity too. The issue is just you commented about this thing so late in the release cycle, next mod version has already been delayed quite a lot. I'm in the process of finalizing changes to the build queue algorithms and other stuff can probably wait for later. Depending on how balanced the different factors are, it could be released very soon.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 01, 2018, 10:48:54 PM
Looks like the new version is almost ready in most aspects, at least I shouldn't be adding any more features. The problem is a glitch with the AI psych management. Often the bases grow so fast that the psych buildings can't keep up. When a drone riot happens, the governor usually deploys enough doctors to suppress it. On the next turn it tends to always deploy the workers back, resulting in a perpetual drone riot.

Some bases seem to get stuck into that loop, so it does not seem viable to rely on the AI to switch enough workers to doctors. Unless that behaviour is somehow changed. It would really need some kind of a fix or else those bases would just keep wasting production. Despite that, the AIs still tend produce huge amounts of stuff, like stacks of 30 needlejets etc.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on October 03, 2018, 05:58:55 AM
I was proposing:

1. A simple binary patch is made to terran.exe that causes it to load a dll. This is the only change made to the smacx binary on disk
2. This dll provides functions that will edit SMAC's memory at runtime and perhaps a higher level hooks interface
2. Other patches (PRACX, thinker, scient v2, yitzi) are implemented as dlls that call those functions

Rationale:

1. Patches are described more clearly and in a format that encourages inline documentation
2. Patches are easier to combine for users and developers
3. Conflicts can be identified
4. Patches are easier to remove

---

I'm not suggesting you delay your release. This is just an idea.
Title: Re: SMACX Thinker Mod
Post by: dino on October 03, 2018, 11:49:35 AM
Hey @Inductio

Why you didn't choose Ytzi's patch as a base for your work ?
There are some serious bugs fixed there not included in Scient's patch and quiet a few modding features that can improve game balance and increase challenge.
Don't remember... does popboom with golden age works with this patch ? It's the only way to boom with morgan/hive.
Also I use only +GROWTH for PLANNED, to require golden age for every faction to boom before eudaumonia/clonning vats, to make booming more difficult.

Being able to customize factions ai with weights in the tech tree is important, so all AIs don't play exactly the same.
Do I understand correctly that tech_balance=0 value in thinker.ini gives me original formula and let me set all the weights myself ?

After you give them more minerals to work with terraforming and other means.
You could create some kind of support to production percentage treshold after which, they are forbidden from building more units.
The treshold could be based on formula that would take into account ai-fight value and threat/diplomacy status.

In simillar fasion you could hardcode it to keep at least one former per base  ( or develop some formula to determine how many ).
So AI can rebuild lost formers at any stage of the game and doesn't have to depend having many formers build early, when it didn't had much stuff to pick.
Same with crawlers.

I've just installed the game for the first time this year, only to try your work.
Thank you very much and I look forward to further developments.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 03, 2018, 05:06:10 PM
> Why you didn't choose Ytzi's patch as a base for your work ?
> There are some serious bugs fixed there not included in Scient's patch and quiet a few modding features that can improve game balance and increase challenge.

It's just hard to see what those important bugfixes might be in Yitzi's patch. Mostly it deals with modding ecodamage, some variables in alphax.txt that provide new features instead of bugfixes. There's so many changes in the binary level that it's not very interesting to go through to see what they do.

> Don't remember... does popboom with golden age works with this patch ? It's the only way to boom with morgan/hive.

Pop booming with golden age should be working with this patch.

> Do I understand correctly that tech_balance=0 value in thinker.ini gives me original formula and let me set all the weights myself ?

It will take into account the weights regardless of which setting is selected here. Tech balance just prioritizes crawler/former/resource cap lifting techs so the AIs can hopefully reach them sooner.

> You could create some kind of support to production percentage treshold after which, they are forbidden from building more units.
> The treshold could be based on formula that would take into account ai-fight value and threat/diplomacy status.
> In simillar fasion you could hardcode it to keep at least one former per base  ( or develop some formula to determine how many ).

It's currently limited to 2 formers and 3 crawlers per base if the population is at least 6. There's a soft limit scaled on map size after which it stops producing new colony pods but sometimes it might go over it. I have not implemented any cap on military units yet. At least if players run into the global unit cap in real games, that kind of a limit might be coded in pretty easily. In the next version ai-fight values will have some impact on how many military units it produces.


Title: Re: SMACX Thinker Mod
Post by: bvanevery on October 03, 2018, 06:50:50 PM
[delurks]

> Why you didn't choose Ytzi's patch as a base for your work ?
It's just hard to see what those important bugfixes might be in Yitzi's patch.

Tell me about it.  And it'll be a problem for every .exe modder who ever tries his/her/its hand, until some kind of standard way of interfacing and describing binary patches is devised.  5 years from now, if a modder is tired of their project and has moved on with their life, nobody else is going to be willing to maintain their code.  This has serious peril of "starting from scratch" problem over and over again, until finally nobody cares enough about SMAC anymore.  It's also a big deal if an .exe modder turns out to have made a serious game breaking bug that they didn't catch during their own development.  Effort of fixing a "showstopper" after the original modder is gone is prohibitive, it simply won't happen.  At least in Yitzi's case, he mainly had a bent about fixing bugs, so he was less likely to create them.  Still not impossible in his case though.

[lurks]
Title: Re: SMACX Thinker Mod
Post by: dino on October 03, 2018, 07:47:46 PM
It's just hard to see what those important bugfixes might be in Yitzi's patch.

You are right, I've looked through Ytzi patch readme and there are no really critical bug fixes, I've attributed to him some stuff fixed earlier, my memory failed me.
But few are useful, maybe you could look into incorporating few selected  fixes/features into your patch instead.

Simple mods I find really nice to have and hopefully would be easy to do:
Only units in enemy territory cause drones - you can explore unclaimed terrain, or defend pact brother territory without pacifism drones.
Option for condenser to not provide extra nutrients, only rainfall, condensers are too good and this change makes ICS a bit less viable.
Supply crawler penalty - I like 1 point penalty, so I don't have to fight my OCD and use crawlers only on tiles yelding more than two, improve challenge and reduces mikro.
Modable "planet pearls"- I like to reduce it, worm farming in fungus or popbooms feels like a cheat and reduces economy balance. They should just be a threat, not a welcome income source.
Option to choose landmarks to be used by map generator, including Nessus Canyon.
Option to disable expansion features like spawning ogres, fungal towers, spore launchers:
ai deals with them poorly, while greatly reduces amount of wandering worms in early game which are actual threat to human player, allows the original SMAC on terranx.exe mod, with alphax.txt edits.

Important bugfixes:
Capturing a base from, or by, a faction with a free facility ability will now work properly.
AI units will no longer rehome to other factions' bases.
Ending the turn where an air unit in the air has movement left will no longer cause all other air units to regenerate all fuel and prevent the turn number from progressing.
The AI evaluation of the worth of psi no longer behaves erratically or causes crashes when psi-combat-relevant projects have been built.

Minor bugfixes ( probably not worth the effort ):
Artillery will no longer "intercept" other artillery from the same faction, or one with a truce or better. (As of patch 3.2, native-owned spore launchers will also not attack each other.)
Drones will no longer revolt to their former owner if that faction has been eradicated.
Techs that are supposed to give free maintenance to particular facilities will now do so.
The bonus comm frequency and REVOLT abilities now work properly.
Fungal pops on the shore now properly have a chance of overflowing into nearby sea spaces.
When the AI frees a captured faction leader, it will now do so properly, and not have a substantial chance of "freeing" a faction that is still in the game.

@bvanevery
Induktio does dll injections and released source code of his mod, what else is he supposed to do. If he'll ever abandon it, it'll be easy to pickup by someone else.
He made his ai tech weights optional as you requested. You sir camplain too much.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 03, 2018, 09:24:16 PM
Okay, it took a while but decided now to release version 0.7 to the downloads (https://github.com/induktio/thinker).  :)

Most important changes:

* Land-based former code rewritten
* Formers will attempt to raise land bridges to nearby islands
* Crawler code improved to choose better tiles
* Prototype picker values fast units and useful special abilities more
* Design_units configuration option added. Produces improved probe teams and AAA garrisons.
* AI produces now planet busters. Amount depends on the UN charter status and aggressiveness settings.
* AI prioritizes secret projects that match their interests
* AI builds secret projects now in their top third mineral output bases
* Tech requirements now fully moddable in alphax.txt
* Governors of all factions will use more borehole tiles
* Scient patch v1.0 added

With the auto design units feature it would be good to know what kind of special units the AI is lacking/should produce. It's now possible to specify all the proper tech requirements/special abilities in ANY combination and have the AI build the units too. Also, if you have some kind of a complex problem, send the save game to me so that it's possible to properly debug it.

> Option to choose landmarks to be used by map generator, including Nessus Canyon.
> Option to disable expansion features like spawning ogres, fungal towers, spore launchers:

Actually I've been thinking about implementing some of that stuff. I'm not too keen on changing most game mechanics but these would be interesting to have, not sure if it will get added though.
Title: Re: SMACX Thinker Mod
Post by: dino on October 04, 2018, 09:12:23 AM
I will have time to extensively test your mod on the weekend. Now I'll throw some ideas i had over time about improwing ai, but no knowledge to implement them:

The major winning strategy for a player, is to do nothing but spawn crawlers in the early game, cover most of the territory with crawlers on forest.
After lifting restrictions and growing bases, use all the excess crawlers to hurry projects, use huge mineral output to build huge army and destroy ai neighbors.
It's almost fail proof strategy to dominate power chart within first 100 turns on transcend.

You are allowed to do this only because as long you have noble integrity rating, ai will never attack you if you keep giving in to their demands, until you are ready to destroy them.
It's wrong, military deterrent should be absolutely necessary condition of peace when dealing with agressive factions, like in real life cold war.

So far, you've concentrated mostly on isolated builder efficiency. It's time to improve their diplomacy game performance against human player.
If a player have poor integrity rating, ai often give demands and then attack anyway.
My idea is to give ai modifier to how they perceive human player integrity, based on relative military power, social choices and agessiveness.

You can design specifics of the formula as you see fit, but you should want to roughly achieve a state when:
If ai has >2x military power of human and ai_fight=1, it will always attack the player even if he give in to all their demands.
If ai has >2x military power of human, ai_fight=0 and the player is an ideological enemy ( social choices ), it will attack the player even if he give in to their demands.
If ai_fight=-1 it shouldn't be affected by this modification.
AI factions shouldn't be affected by this perceived integrity penalty either, since they start enough wars as it is.

Human player will be forced to back their diplomacy with at least half the force AIs have to be able maintain peace with bribes.
Being forced to mix more military units with crawlers, colony pods, formers and facilities will slow human builder early development speed at least 2x times.

If player starts isolated it's fine, because he can't trade/steal techs early and naval invasion require more time and resources to execute, so AIs have more time to catch up.

***

Regarding units and support I had this rough idea that ai shouldn't eat more than 70% production with military support:
 -10%,0,+10% depending on ai_fight,
+10% when enemy units present within own territory,
+ 0-20% depending on military power compared to other factions,

You can design your own formula, but AI's should have some minerals left for base facilities, crawlers, probe teams, formers production, etc.

***

Does your ai rebuilds lost formers in mid and late game? Vanilla ai builds some in early game, but rarely builds them later.
Thats why the mods to give them early additional super formers so it can do tons of terraforming in advance, before it'll loose them were used.
With a function to always maintain certain number of them, it won't be necessary to give ai that many formers, or super former ability early.

***

Option to disable expansion features - I'd seriously consider this.
I know of people, who dislike most of expansion features, factions and tech tree changes enough, to refuse using Ytzi's patch until he made the original SMAC mod possible.

Title: Re: SMACX Thinker Mod
Post by: Induktio on October 04, 2018, 07:06:42 PM
Phew, that's a lot of stuff there.

> The major winning strategy for a player, is to do nothing but spawn crawlers in the early game, cover most of the territory with crawlers on forest.
> After lifting restrictions and growing bases, use all the excess crawlers to hurry projects, use huge mineral output to build huge army and destroy ai neighbors.
> It's almost fail proof strategy to dominate power chart within first 100 turns on transcend.

Human players can always use crawler upgrading/rushing tricks and gain an advantage, sure. The AI doesn't rush production currently, so that also favors humans quite a lot. Other big factor is also pop booming. The AI doesn't understand how to do it, but maybe these are mechanics that can be modded away or maybe players can just refrain from using them too much.

> You are allowed to do this only because as long you have noble integrity rating, ai will never attack you if you keep giving in to their demands, until you are ready to destroy them.
> It's wrong, military deterrent should be absolutely necessary condition of peace when dealing with agressive factions, like in real life cold war.
> If a player have poor integrity rating, ai often give demands and then attack anyway.

Are you positive the AI refrains from attacking every time if you cave in with noble rating or is there some other factor influencing this? I have some idea where the diplomatic variables are stored so it could be pretty simple to just change them to cause more diplomatic friction.

> You can design specifics of the formula as you see fit, but you should want to roughly achieve a state when:
> If ai has >2x military power of human and ai_fight=1, it will always attack the player even if he give in to all their demands.
> If ai has >2x military power of human, ai_fight=0 and the player is an ideological enemy ( social choices ), it will attack the player even if he give in to their demands.
> If ai_fight=-1 it shouldn't be affected by this modification.
> AI factions shouldn't be affected by this perceived integrity penalty either, since they start enough wars as it is.

Something like that could be implemented. AI factions are currently so aggressive against each other it could be good to reduce their early wars so their development doesn't suffer so much. Against humans they probably declare very easily too unless that diplomatic exploit you described is working.

Anyway, there are 3 main areas this mod doesn't touch currently: 1) diplomacy 2) social engineering 3) combat unit movement. Infrastructure is fully in place to modify #3 and I'm actually considering some changes on how the AI could use its combat units. Ideas are welcome there too.

> Regarding units and support I had this rough idea that ai shouldn't eat more than 70% production with military support:
> You can design your own formula, but AI's should have some minerals left for base facilities, crawlers, probe teams, formers production, etc.

The formula was changed many times but currently it basically keeps half of the minerals in reserve before switching off combat unit production.

> Does your ai rebuilds lost formers in mid and late game? Vanilla ai builds some in early game, but rarely builds them later.
> Thats why the mods to give them early additional super formers so it can do tons of terraforming in advance, before it'll loose them were used.

With this mod you could see AIs with 50 formers + 50 crawlers so I'm not sure if that super former ability would even be needed. It should still build them if possible.
Title: Re: SMACX Thinker Mod
Post by: dino on October 04, 2018, 09:33:13 PM
I should probably first test your mod extensively before commenting, you seem to already addressed formers and production better than I thought.
I have not enough time at the moment, but I was too excited that someone is working on it finally and couldn't hold off, sorry.

As for diplomacy yes, with modded AI buffs it can be in possition to easily destroy my crawler parks and bases when I am in a building up phase.
But as long as I keep noble integrity and give them whatever they want, they won't attack and giving them tech and money is not an issue, they'll trade them elsewhere anyway.
If they hate you because you're leading power chart they'll attack eventually, but early game when I'm weak, I don't recall a situation when it didn't work.
Maybe with intense rivalry it wouldn't work, but I never play with this option. I like to try maintain some stable treaties with one, or two factions in my games.

So, my proposition is, if the human player is determined to be an easy prey and the AI is aggresive, or erratic but human is their ideological enemy, it should just attack.
This way player won't be able to safely build up, with just one defender per base to fend off worms, supporting unused military deterrent is a huge strain on economy.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 05, 2018, 09:39:04 AM
Interesting reading about endowing AI with right amount of aggression: https://steamcommunity.com/app/287580/discussions/0/1620599015872353241/
It's about SMAC-like 4x TBS Pandora: First Contact, which currently possess one of the best AIs in the field. For example, the need to back your development up with a standing army is already a must there.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 05, 2018, 06:42:20 PM
> If they hate you because you're leading power chart they'll attack eventually, but early game when I'm weak, I don't recall a situation when it didn't work.
> Maybe with intense rivalry it wouldn't work, but I never play with this option. I like to try maintain some stable treaties with one, or two factions in my games.

In early game I think it's usually that dialogue where they demand you two techs in a row. Refusing will almost certainly cause them to declare. Intense rivalry affects quite a lot of things in diplomacy, haven't checked if it has any effect here. Probably it harms the AIs more because they already have too much wars.

> Interesting reading about endowing AI with right amount of aggression: https://steamcommunity.com/app/287580/discussions/0/1620599015872353241/

Yeah, I've heard about that project. Not sure if he ever published any source code or described the algorithms in detail. It's closed source anyway?
Title: Re: SMACX Thinker Mod
Post by: dino on October 06, 2018, 11:11:57 AM
Maybe just switching to "intense rivalry" diplomacy code path against human player, when conditions described in previous posts are met could be possible.
There was an effort on this forum to identify all instances of the code affected by this option.
Title: Re: SMACX Thinker Mod
Post by: k3v on October 08, 2018, 11:31:57 AM
Long time smac/x community lurker here.

Mod sounded great so played a game for the first time in 2 years.

Transcended 2231 with zak, pretty sloppy play.

Sven built 60 bases lol (counted), only had 110 science at the end though. Almost lost governor vote because of the pop.

4 ais had really bad small island starts (even on 30-50% land) and couldnt get going till foil/former raise land, which was then seen to great effect.

Aki had 850 science at the end, compared to ais rarely getting higher then 150. Aki actually got knowledge before me, pretty impressive. I force sell tech to ais for money but they dont use it properly in a builder sense.

Is it possible to force the ai to build tree farms and tech structures first if they have the tech? Only yang built a few tree farms and no one built research hospitals or higher at all. I feel that would really help their builder game, as they just stall with 1 food per tile for ages.

Avoiding war is obviously quite easy, only built like 5 military units all game, sven just ignored me all game and i payed him off half price once. Ais fought each other as well (alot of foil probe team taking bases), i was further away. Sven is actually the most annoying even pre patch as he plops down bases intrusively close with high chance of unavoidable conversations typically resulting in vendetta.

Either way great mod, i can imagine how difficult it is to do anything with this game, so always great to see people trying.

I know it will be hard to have the ai compete with the optimal fast transcend strategy but it would be cool to see whats possible. (fm+wealth->forest->crawlers->get all good sps->restrictions->tree farm->pop boom->all tech boosters->energy park->drop colony/transport on remaining pods for aa's->gg).

A game where the ai's have better land, 6 aliens might be an interesting challenge. This mod with all 14 factions on one map would be interesting, base spam leads to closer proximity and fireworks.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 08, 2018, 02:51:13 PM
Yeah, I've heard about that project. Not sure if he ever published any source code or described the algorithms in detail. It's closed source anyway?
Yeah, it's closed source. The game is property of Slitherine/Matrix Games, they just allowed one volunteer developer exclusive access to codebase. Probably, sources won't make SMACers any good anyway, completely another game, much simpler withal. But AI intricacies were discussed on that forum in pretty hefty detail, including antagonism between ruthless "play-to-win" and honorable "role-playing" AI designs, which is relevant for SMAC. Most surprising pitfall for that AI developer was the amount of ire some players poured down on (non-cheating!) AI when they started to lose badly to said AI.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 08, 2018, 08:24:46 PM
> Transcended 2231 with zak, pretty sloppy play.
> Sven built 60 bases lol (counted), only had 110 science at the end though. Almost lost governor vote because of the pop.
> 4 ais had really bad small island starts (even on 30-50% land) and couldnt get going till foil/former raise land, which was then seen to great effect.
> Aki had 850 science at the end, compared to ais rarely getting higher then 150. Aki actually got knowledge before me, pretty impressive. I force sell tech to ais for money but they dont use it properly in a builder sense.

Interesting test results right there! :)

May I ask what kind of mapsize/world configuration did you play on? Any other custom rules active? Do you have examples where they could use the builder techs better?

> Is it possible to force the ai to build tree farms and tech structures first if they have the tech? Only yang built a few tree farms and no one built research hospitals or higher at all. I feel that would really help their builder game, as they just stall with 1 food per tile for ages.

Tree farms are quite high on the build order, just before hab complexes. If they didn't build them, it probably means a) they didn't have the tech, or b) military build up overruled other priorities. Research hospitals should be built too, but they are much later on the build order, with specific conditions. Unless you post save games or screenshots, can't analyze it in more detail.

> Avoiding war is obviously quite easy, only built like 5 military units all game, sven just ignored me all game and i payed him off half price once. Ais fought each other as well (alot of foil probe team taking bases), i was further away. Sven is actually the most annoying even pre patch as he plops down bases intrusively close with high chance of unavoidable conversations typically resulting in vendetta.

So it seems the diplomacy mod for credible military deterrent is much needed in this game. Have to look into it more.

It must be mentioned the single biggest factor deciding the AI growth is still the size of their starting landmass. They do build transports and (later) attempt to raise land bridges, but if they start on a small island, they can probably never recover from the turn disadvantage. High erosion/bigger continents helps them the most because then they can expand easiest and fit more boreholes on the flat terrain.

Here's one WorldBuilder configuration for alphax.txt that produces bigger continents, less small islands and more rivers:

(click to show/hide)
Title: Re: SMACX Thinker Mod
Post by: k3v on October 09, 2018, 09:43:42 AM
I attached my saves. It was a huge map. Default rules with look first. Plenty of bad decisions, for example i forgot PEG was a thing and build a few energy banks before it. I dont build boreholes at all because I dont think their actually worth it even with WP. They take too long, are dirty minerals which you cant use without eco damage risk, and just delay your crawler sps/popboom. But thats another discussion. I go for hybrid farms asap and sea energy park. My beeline was all over the place because I still cant decide whats best. I got clean reactor super late this game, I went like hybrid farm->SC->ToE->Fusion.

For comparison my fastest transcend with stockpile bug fixed (not here) and air drop bug fixed is 2210 with zak, huge transcend (yitzi patch 3+ years ago). Unpatched I did a air drop hopping bug game in 219x not optimised for fun.

From empath guild onward, im force selling tech for money. Its a *bug/feature* that if you ask for money and offer tech the ai will always buy for at least 25 until they get impatient and end the call (even putting them negative energy, but that rarely happens). So the Ai's have my tech from EG onwards unless they just ignore me or i cant sell enough to them.

The only reason to not do it is if the ai was actually a threat lol. The goal is fastest transcend using everything available. I want them to have the best bases for more commerce/chance that they research tech off the beeline to get later. I switch SE before talking to ai's keep them happier, how else can you run fm+weath and have treaties/pacts with anyone except morgan lol.

Lal, yang, aki and cult all started close so maybe the war took over their build orders but I would force treefarms/tech buildings over everything. the base spam means ais end up closer together creating potential for fireworks, but even morgan didnt build anything and he was isolated at the bottom. I should check my old saves to see what the ai builds back then in other games.

But its like, do you want the ai's to roleplay their ideologies, or do you want them to play optimised builder.

I should try the map settings, I played 35 turns of a new game and mogan started on a tiny island and lost his transport foil to worms so hes screwed on one base lol.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 09, 2018, 11:54:08 PM
> I attached my saves. It was a huge map. Default rules with look first. Plenty of bad decisions, for example i forgot PEG was a thing and build a few energy banks before it.

Looks like for most of the game, Morgan was tied in the labs output with Aki-Zeta. Near the end Morgan had almost 700. Some of the starting locations are pretty horrid considering there's so much land on the other continents. If the AIs are near each other but neither can conquer anything due to islands, that usually slows them down pretty badly. Sometimes I've been considering redoing the faction placement algorithm, but not sure if there's any simple solution. Pirates are quite weird when they plop down so many bases, but they still underperform due to the inability to transition to land. They have not received any improvements for that, though.

> I dont build boreholes at all because I dont think their actually worth it even with WP. They take too long, are dirty minerals which you cant use without eco damage risk, and just delay your crawler sps/popboom. But thats another discussion. I go for hybrid farms asap and sea energy park.

I just don't get the problem with the clean minerals. It's very easy to manage if you wait for the first fungal pop before deploying the tree farms. Without the first fungal pop, one would miss the clean mineral cap increase. Hybrid forests are pretty expensive at 240 minerals considering they basically bring in just a couple of extra nutrients, so the AI doesn't build them either.

> From empath guild onward, im force selling tech for money. Its a *bug/feature* that if you ask for money and offer tech the ai will always buy for at least 25 until they get impatient and end the call (even putting them negative energy, but that rarely happens).
> I switch SE before talking to ai's keep them happier, how else can you run fm+weath and have treaties/pacts with anyone except morgan lol.

Yeah, these could be considered diplomacy exploits. Scient's patch doesn't seem to address any of these either, at least not mentioned in the v2.0 changelogs. I will probably soon check if the patch update to v2.0 works anyway. There's also a couple of improvements coming in the way these patches are inserted, so some patch features could be selected at runtime.
Title: Re: SMACX Thinker Mod
Post by: k3v on October 10, 2018, 11:57:15 AM
I dont want to derail the thread into fast transcend strats, but I love talking about it. Ive kinda retired from it though, 221x was my goal on a yitzi patch version. Any faster I think you need better "luck" or reloading map spawns/pods/aas/better ai combinations. I'd love to see others trying to see what they can come up with.

Heres a picture of mine which compared borehole vs no borehole strat. Right was the 2210 game.
(click to show/hide)

Boreholes take 16 turns with WP (if the terrain allows, longer if you need to lower and you have to get WP first or EE tech), in that time you could build 8 forests. Early on you want squares for crawlers and PTS boom, so you might have 1 borehole, and no other squares. Then by working that borehole, you cant use other forest squares because eco damage. And you cant sustain 3 pop at PTS (the biggest early booster), and you wont have food to get to size 16. Need condesors which is more former time and eco damage, and no energy.

To have the former power to build it all fast you need clean reactor and a former army which slows down other techs/preparing pop boom etc. Of course boreholes are usable, I dont think their worth it to go fast.

In this sloppy 2231 game, I couldve build borehole later post boom which is what Ive done before, but I actually forgot about it, but I dont think it mattered. I never had a former army anyway (late clean reactor, overbuilt crawlers), also I never had time to build more orbital farms, so bases barely had 32 food, and had land to build new bases. I stayed in wealth vs knowledge and had money I couldnt use etc.

The thing is, development of this patch might result in passive fast transcend being impossible so the times will definitely go up.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 10, 2018, 01:37:46 PM
Sometimes I've been considering redoing the faction placement algorithm, but not sure if there's any simple solution.
Standard faction placement algorithm is truly horrible, if you aren't up for a rush challenge. In my games it routinely places 3-4 factions in the vicinity of each other on large random map. I've heard a tell-tale that if you start a game, then save map, then start a new game from that map, then faction placement suddenly becomes sane. Didn't checked it myself, though.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 10, 2018, 06:37:42 PM
After updating all the relevant patches, a new version is available in the downloads (https://github.com/induktio/thinker). Develop build 20181010 has these changes:

- Scient patch v2.0 added (see details.md)
- Ability to select which landmarks are placed on random maps (see thinker.ini)
- Nessus Canyon included also

To make sure this new patching method works on all machines, post here any problems you might find.

@k3v You might interested in T-Hawk's speedruns (http://www.realmsbeyond.net/forums/showthread.php?tid=9288) if you haven't seen them already. He plays vanilla SMAC only though.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 13, 2018, 06:48:36 PM
New testing version 20181013 is now available from the downloads.

This time it adds a new option called "faction_placement" which aims to improve on the original starting location algorithm. It tries to average out the distances to other factions so that many factions should not start in close proximity to each other any more. The distances look pretty consistent especially on huge maps.

Other new option is "load_expansion" which can be disabled to turn off any expansion related features. Note that the tech tree will not adjust the dependencies without modding, so any techs or items depending on expansion-only techs will be unavailable, including some victory conditions.
Title: Re: SMACX Thinker Mod
Post by: dino on October 13, 2018, 10:21:34 PM
How deos load_expansion work ? Does it use alpha.txt, or you have to mod alphax.txt to get functional game ?

I've got used to playing smax with original seven, especially since I've figured a way to cut aliens tech out of the game if there are no aliens, without having to replace alphax.txt each time I alternate alen/no alien playthrough. Few new expansion facilities are ok, the only thing that bothers me is getting an ogre in a pod, it's too strong. I'll have to keep my autism in check and stop bothering you with mundane stuff like that in the future ;)
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on October 13, 2018, 10:26:05 PM
This is no place to bother keeping your autism too far in check; we're basically a whole community of autists...
Title: Re: SMACX Thinker Mod
Post by: dino on October 14, 2018, 01:41:56 PM
It seems that load_expansion = 0 still uses alphax.txt, but ignores entries introduced by the expansion.
So copying over tech tree from alpha.txt, or otherwise editing it, is required to get functional SMAC game without holes in the techtree.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 15, 2018, 10:15:40 AM
Some partial test results. Large random map, transcend difficulty.
SP movies don't show for some reason, even with movies folder inside game folder.
AIs fare markedly better than in kyrub's version.
Gaians got Weather Paradigm and spiked no less than half of Monsoon Jungle tiles with condensers. I thought adjacent condensers are forbidden, not sure about that? This led to max size bases where half pop are doctors. When I took one of these, it had 2-digit eco-damage despite meager minerals.
All AIs do heavy foresting, even Antimind, who previously relied mostly on fungus. The algorithm doesn't consider faction's fungus production?
Minor nuisance: at mid-game AIs twice scared me with 'Start building SP' message and then presumably switching to other production in the same turn.
Looking forward to future versions of this mod, great work!
Title: Re: SMACX Thinker Mod
Post by: dino on October 15, 2018, 10:44:38 AM
Adjecent condensers are allowed, it's not a glitch.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 15, 2018, 06:14:38 PM
> SP movies don't show for some reason, even with movies folder inside game folder.

Hmm, sounds strange. Do they show up normally if you open the save without the mod active?

> Gaians got Weather Paradigm and spiked no less than half of Monsoon Jungle tiles with condensers. I thought adjacent condensers are forbidden, not sure about that? This led to max size bases where half pop are doctors. When I took one of these, it had 2-digit eco-damage despite meager minerals.

Well, one could check this example (http://www.realmsbeyond.net/forums/showthread.php?tid=8755&page=6) of good old ICS. Probably the former code should be tweaked to prefer more forests on jungle tiles. Happiness management is a continuing problem because of various reasons. At this point I'm considering making some kind of NODRONE ability an optional boost.

> All AIs do heavy foresting, even Antimind, who previously relied mostly on fungus. The algorithm doesn't consider faction's fungus production?

Currently it tries to do its best to get rid of fungus. It would need some kind of a way to decide when using fungus is beneficial by considering the current techs and faction bonuses. This could be useful to implement but usually it's only relevant in the end game. What kind of stats does this Antimind faction have?

> Minor nuisance: at mid-game AIs twice scared me with 'Start building SP' message and then presumably switching to other production in the same turn.

Sometimes it tends to happen when there's few minerals accumulated. Maybe it could use some kind of a fix.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 16, 2018, 09:52:55 AM
> Gaians got Weather Paradigm and spiked no less than half of Monsoon Jungle tiles with condensers. I thought adjacent condensers are forbidden, not sure about that? This led to max size bases where half pop are doctors. When I took one of these, it had 2-digit eco-damage despite meager minerals.

Well, one could check this example (http://www.realmsbeyond.net/forums/showthread.php?tid=8755&page=6) of good old ICS. Probably the former code should be tweaked to prefer more forests on jungle tiles. Happiness management is a continuing problem because of various reasons. At this point I'm considering making some kind of NODRONE ability an optional boost.

> All AIs do heavy foresting, even Antimind, who previously relied mostly on fungus. The algorithm doesn't consider faction's fungus production?

Currently it tries to do its best to get rid of fungus. It would need some kind of a way to decide when using fungus is beneficial by considering the current techs and faction bonuses. This could be useful to implement but usually it's only relevant in the end game. What kind of stats does this Antimind faction have?


The Antimind is a classic NetworkNode faction:
TECH, Ecology, SOCIAL, ++++PLANET, SOCIAL, ---INDUSTRY, SOCIAL, --GROWTH, FUNGNUTRIENT, 2, FUNGENERGY, 2, IMMUNITY, PLANET, FREEABIL, 18, TERRAFORM, 0, MINDCONTROL, 0, FANATIC, 0, WORMPOLICE, 0, PSI, 50, POPULATION, -2, TECHSHARE, 3, ALIEN, 0
Economics, Green, PLANET,
Economics, Free Market, nil,

Currently they benefit from crawlers on forests, but in other regards forests are detrimental to them: all bases are size 3-5, while normally they should be all 8-9 at this stage, and almost no captured natives, that should constitute backbone of their army at this stage (I play with abundant native life on). With such INDUSTRY, they can't afford Tree Farms and Hybrid Forests. In kyrub's they work as energy-rich worm rusher with minimal terraforming and almost no facilities, providing sharp gameplay difference. Ideally they should buy most things, using farm/solar rolling tiles before Industrial Automation for all mineral needs and crawler on rocky tiles after that.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 16, 2018, 04:11:47 PM
The Antimind is a classic NetworkNode faction:
TECH, Ecology, SOCIAL, ++++PLANET, SOCIAL, ---INDUSTRY, SOCIAL, --GROWTH, FUNGNUTRIENT, 2, FUNGENERGY, 2, IMMUNITY, PLANET, FREEABIL, 18, TERRAFORM, 0, MINDCONTROL, 0, FANATIC, 0, WORMPOLICE, 0, PSI, 50, POPULATION, -2, TECHSHARE, 3, ALIEN, 0
Economics, Green, PLANET,
Economics, Free Market, nil,

Well, that is certainly an unusual faction. In nearly all possible ways, it plays different from the normal human factions for which this AI is tuned. Getting it to play this faction as well would require pretty extensive changes to the code. Normally fungus is relevant maybe for a couple of turns before the game ends, but with those massive bonuses, it could pretty much skip most terraforming. It would still need the minerals from somewhere though.

Do you know what kind of units the AI normally uses to capture natives? It appears you're saying the AI might normally have some different units that are more often used to capture/fight the native life. And which version of kyrub's patches are you referring to here?
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 17, 2018, 07:48:00 AM
Well, that is certainly an unusual faction. In nearly all possible ways, it plays different from the normal human factions for which this AI is tuned. Getting it to play this faction as well would require pretty extensive changes to the code.

Well, I'll just place them past factions_enabled limit then.
Do you know what kind of units the AI normally uses to capture natives? It appears you're saying the AI might normally have some different units that are more often used to capture/fight the native life.

Unfortunately, most of this activity takes place before any AI observation sans Scenario Editor could be established. But I believe first worms are captured by basic scouts and sentinels on exploration duty, and then those first worms trigger something like chain reaction, capturing more while driving towards bases or exploring. Of course, if you employ natives in a war against AI, it will soon field empath scout rovers and trance scouts, but I guess that wasn't the point of your question?
And which version of kyrub's patches are you referring to here?

http://alphacentauri2.info/index.php?action=downloads;sa=view;down=108 (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=108)
I checked SP movies from the save - without Thinker Mod they're played.
Title: Re: SMACX Thinker Mod
Post by: T-hawk on October 18, 2018, 05:57:00 AM
Adjacent condensors are not forbidden (and are a good idea since they'll always make both squares rainy.)  The only things forbidden adjacent are boreholes and drill-to-aquifer.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 18, 2018, 06:49:07 PM
But I believe first worms are captured by basic scouts and sentinels on exploration duty, and then those first worms trigger something like chain reaction, capturing more while driving towards bases or exploring. Of course, if you employ natives in a war against AI, it will soon field empath scout rovers and trance scouts, but I guess that wasn't the point of your question?

I was mostly asking what kind of units the AI normally uses to fight the native life. It might have something to do with the default unit plans or abilities. The AI might need some tweaking to be more aggressive in hunting down the worms.

I checked SP movies from the save - without Thinker Mod they're played.

Yeah, this issue has been verified now. The cause is still a total mystery. I don't remember any part of the code interacting directly with the movie playback stuff. Sometimes it's a little bit frustrating to develop mods by patching binaries without the source code because of these kind of unexpected interactions with the other parts of the game logic.

Other new option is "load_expansion" which can be disabled to turn off any expansion related features. Note that the tech tree will not adjust the dependencies without modding, so any techs or items depending on expansion-only techs will be unavailable, including some victory conditions.

This might need some clarification is somebody wants to create a vanilla game mod. The settings are still loaded from alphax.txt but the important thing here is that alpha.txt cannot be copied in its place, because many of the id numbers and item types in alphax.txt tables are hard coded. The game will crash if any of the tables has too few items when it's loading the data. To recreate the whole SMAC environment, one would have to keep the various expansion items in alphax.txt and set their requirements to "Disable" or similar. Load_expansion=0 will still disable many of the hard coded expansion-related stuff. It might even make sense to hide this option from thinker.ini because it's not relevant without a modded alphax.txt.
Title: Re: SMACX Thinker Mod
Post by: dino on October 20, 2018, 12:19:15 PM
I use modified txt files for the ai, but for each faction have the same few buffs.
Maybe instead of providing full support for separate ai factions definitions with all attributes and syntax, better implement few chosen optional buffs for all of them.
My first choices would be: ++GROWTH : so they can popboom, NODRONE : at least until ai psych management is improved,
Second choices would be: INDUSTRY,  INTEREST, TERRAFORM : some turn advantage, without changing drastically how the game plays out, or player perception when interacting with them.

As for smac mod, just add a line of description to thinker.ini variable about modified alphax.txt with SMAC tech tree and expansion features disabled being required and put it at the end of file.
Probably just replacing tech definitions with SMAC ones, while keeping unused ones in the file is enough, changing anything to disabled won't hurt, but probably is not required.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on October 20, 2018, 01:40:02 PM
I helped write a smac in smax mod that works pretty well a little while ago. The alphax, help, etc work has already been done if anyone wants to use it here.

For that mod we used features Yitzi's provided for removing some pods and stuff, iirc. You may have replicated that already.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 20, 2018, 05:57:48 PM
> I helped write a smac in smax mod that works pretty well a little while ago. The alphax, help, etc work has already been done if anyone wants to use it here.

Any download links?

> For that mod we used features Yitzi's provided for removing some pods and stuff, iirc. You may have replicated that already.

It's pretty hard to figure what was done there without any source code level documentation. Setting the smacx_enable flag in the engine is the only thing load_expansion config variable does. Reading some of the patch docs one gets the impression that load_expansion=0 disables even more of the expansion content than Yitzi's patch.

If you have already created new alphax, help, etc files it is possible to set the engine to read the modified content from different filenames, e.g. alpham.txt when expansion is disabled, so that users don't have to overwrite any files if they want to install that mod. I would actually prefer to do it that way.

Btw, the cause for the SP movies not playing has been somewhat narrowed down. If Thinker starts just with the normal GOG binary, movies play as usual. With Scient patch v2.0, movies are not shown even if they are enabled in the settings. I'm not sure what's going on there or if this is some kind of an undocumented feature of the patch.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 21, 2018, 09:30:58 PM
Reporting serious bug in Thinker-dev-20181013. Mimi, being in pact with me, off-loaded 2 colony pods on my soil and settled without any harm to the pact. Autosaves before and after event are attached. I play as Satori custom faction from http://alphacentauri2.info/index.php?action=downloads;sa=view;down=264. (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=264.)
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on October 22, 2018, 01:00:57 AM
> Any download links

http://alphacentauri2.info/index.php?topic=17869.0 (http://alphacentauri2.info/index.php?topic=17869.0)

On page 2 Yitzi briefly talks about what they did on the exe side.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 23, 2018, 09:55:13 PM
New version 20181023 is now available from downloads (https://github.com/induktio/thinker). Changes include:

- Fixed base creation bug on other factions territory.
- Improved spawn placement. Now it guarantees factions wont spawn on tiny islands.
- When expansion is disabled, modified txt files are now read from "ac_mod" folder (see thinker.ini).

> http://alphacentauri2.info/index.php?topic=17869.0 (http://alphacentauri2.info/index.php?topic=17869.0)

It must be said here this mod is not instantly compatible with Thinker because Yitzi's patch changed the alphax.txt file format. Those additions are not supported by this mod in any way. Otherwise smac-in-smacx should probably work with this mod after some changes.

If anyone has ideas how to get the SP movies working again, could be also useful to know.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 24, 2018, 09:46:32 AM
More test results. Large random map, random opponents, transcend difficulty. Miriam flawlessly crusaded Caretakers (who were being eaten by Antimind), then Antimind proper. Yang meanwhile annihilated University. He undoubtedly would conquered me if got Doc:Flex earlier. Pirates, as in previous test, were very passive and almost not settled - perhaps, some of my alphax.txt edits hinder them (but then again, in kyrub's they were always widespread and strong with the same settings). I cornered market for less than 10k EC just before Fusion Power. Probably, economic victory using Satori with their commerce bonus should be considered cheating.
Question to all: are AIs always so indifferent to player's attempt at economic victory? I didn't tried it in ages, so don't remember. Not a single hostile action in those 20 turns, despite being obstinate to seething.
Also noticed change in game behavior, could be bug: in kyrub's Unity pods inside base radius were skewed toward favorable pops - almost never worms, mostly monolith/resource bonus, oftentimes together with unit/tech/comm frequency. Now all 3 pods near HQ produced worms.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on October 24, 2018, 12:34:52 PM
I'm on a cycle tour atm, but I can have a look at the videos next week if you haven't sorted it by then.

I had quite a root around in that code a while ago.
Title: Re: SMACX Thinker Mod
Post by: dino on October 24, 2018, 12:41:40 PM
I'd consider both economy and transcend, but especially economy cheating and have these disabled in my games.
I think it's impossible to code AI to successfully counter them, I'm not even sure a human player can successfully counter these, short of initiating nuclear holocaust.

If you'll tell me that conquering the world is tedious grind, than don't do it ?
I quit the game and consider it won once I know, I can't be stopped.
I don't need a score on a victory screen to confirm that.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 24, 2018, 01:54:55 PM
I think it's impossible to code AI to successfully counter them, I'm not even sure a human player can successfully counter these, short of initiating nuclear holocaust.
This! One surgical planet buster at enemy HQ is all you need. Even before Orbital Spaceflight AIs could at least try to stop the offender with force. Particularly in that game I wrote last comment about, Mimi had resources of 3 factions at her disposal, and Yang those of 2. If they stopped their squabble and turned attention on greedy merchants sitting in 7 bases on medium island, in 20 turns all will be over for me.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 24, 2018, 10:21:24 PM
Question to all: are AIs always so indifferent to player's attempt at economic victory? I didn't tried it in ages, so don't remember. Not a single hostile action in those 20 turns, despite being obstinate to seething.

I don't remember them having any special logic for countering economic victory. That might change, however. There has been some talk of implementing the diplomacy mod for these kind of situations, but I haven't researched the variables much yet.

One thing that probably should be changed is the fact that AIs almost always stay content if you give them the techs they demand. A very simple way of changing the diplomacy behaviour would be to flip the "want revenge" or even "fight to the death" diplomacy flags if the AIs determine another faction is too weak or attempts the economic victory. I'm not sure if the latter variable strictly needs to be used, but always giving in to demands works a little too well as an exploit. These variables are also visible in the scenario editor, if anyone knows more of their effects on diplomacy.

Also noticed change in game behavior, could be bug: in kyrub's Unity pods inside base radius were skewed toward favorable pops - almost never worms, mostly monolith/resource bonus, oftentimes together with unit/tech/comm frequency. Now all 3 pods near HQ produced worms.

Hmm, was that an one time occurrence or does it keep repeating for you? This might be related to the faction placement patch but I'm not sure. Often the pods seem to produce goodies next to the HQ in my tests.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on October 25, 2018, 09:05:33 PM
Hi Induktio.
Thank you for your hard work. I started to play your mod and it seems interesting so far. One question about releases. I navigated to download page which leads to your GitHub project which has a link to your dropbox with releases. Latest one I see there is 0.7 from 10/3/2018. Yet somewhere in this topic you mentioned you created another on on 10/23.
Another thing is that I've looked inside of 0.7's thinker.ini and it is pretty small and doesn't contain all these configuration variables you mentioned recently - like including other mods, etc. Would you mind publishing your latest version in installation format? Or tell me how to make it out of your code or something. Much appreciated.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 25, 2018, 09:38:04 PM
> Would you mind publishing your latest version in installation format?

All the recent posts here relate to the develop builds which are also on the download page but on the "develop" folder. They are just versioned by their build date and their install process is also the same, just unzip to the game folder. There isn't any reason not to use them if you want to try the latest features. :)
Title: Re: SMACX Thinker Mod
Post by: tnevolin on October 25, 2018, 09:48:01 PM
Cool. Thanks!
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 31, 2018, 10:27:48 AM
Also noticed change in game behavior, could be bug: in kyrub's Unity pods inside base radius were skewed toward favorable pops - almost never worms, mostly monolith/resource bonus, oftentimes together with unit/tech/comm frequency. Now all 3 pods near HQ produced worms.

Hmm, was that an one time occurrence or does it keep repeating for you? This might be related to the faction placement patch but I'm not sure. Often the pods seem to produce goodies next to the HQ in my tests.
Doesn't repeat, must have been one-off bad luck.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on October 31, 2018, 01:14:39 PM
Also noticed change in game behavior, could be bug: in kyrub's Unity pods inside base radius were skewed toward favorable pops - almost never worms, mostly monolith/resource bonus, oftentimes together with unit/tech/comm frequency. Now all 3 pods near HQ produced worms.

Hmm, was that an one time occurrence or does it keep repeating for you? This might be related to the faction placement patch but I'm not sure. Often the pods seem to produce goodies next to the HQ in my tests.
Doesn't repeat, must have been one-off bad luck.
I believe pods can produce anything. It is just at the beginning they are more favorable probabilities that's how I understand it.
Title: Re: SMACX Thinker Mod
Post by: Fibonacci on October 31, 2018, 02:16:55 PM
Having done lots of save scumming, I can demonstrate that there is a difference between pods at the landing site of a base, and random scattering pods across the planet. Scattered pods seem to be able to produce anything, and can also fall within the batch at a faction's landing site at the start of the game. Landing site pods on the other hand seem to fall into one of four categories, just guessing based on what happened after several hundred save/reloads. "Blessed" landing site pods seem highly skewed in favor of a free tech, a comm. link to another faction, or a monolith. "Cursed" landing site pods seem skewed toward a mind worm, spore launcher, fungal growth, or alien artifact. "Vehicle" landing site pods seem to be skewed toward a unity rover, the 6r/3r police Mk1 thing whose name escapes me currently, or a unity foil (when along a coast). The fourth being regular chances at everything. The other thing that suggested to me that landing site pods are even a thing is the severely decreased chance of getting both a bonus resource (nutrient/energy/mineral) along with a "positive" (as in non-alien life based result). Taking a sample of rewards on different pod pops in the landing site radius suggests there are both landing site regular pods and scattered pods, based on similar reward, but vastly different secondary bonus along with the reward.

The last hint that "Cursed" landing site pods are even a thing at all, if you take units over to a neighboring AI landing site base, and there are any pods that the AI could have popped, but "chose" not to. I have saves of both Domai and Zakharov leaving a pod alone into the later game, I then come over and save scum a bit to test it out, and it was indeed "Cursed".

It's a game feature that settling a base next to a pod eliminates "alien life form" results from the pod, regardless of whether it was regular or cursed. Similarly, completely occupying all of the surrounding 8 squares of a "Cursed" pod reduce the "negative" rewards to just fungal blooms, but positive results seem to replace the native life rewards.

I have several saved games on turn one with Iron Man and Do or Die disabled, Look First enabled, and 3 or 4 pods that can be popped on turn one before disbanding the colony pods to cheat death and start again elsewhere. They are easiest to produce with Cha Dawn or Santiago when beginning on a river, although I suspect it's possible to get 5 or more pods if you start along a coast and get a bonus Unity Foil or Rover (unlike alien artifacts these bonus units get their moves the turn they're found).

I can probably dig out the saves to share if anyone is interested in verifying my observations. However since they're almost all first turn, they're fairly easy to replicate. Using Yitzi's 3.5D and Good Old Game's Alien Crossfire at the moment, but I'm willing to try out a few more in Alpha Centauri unpatched, or with official patches.

I can test using WINE, regular or virtualbox XP, virtualbox win98 (while I still have the installation disks/box/license for Windows 98, I no longer have a machine that reliably runs Windows 98 natively), regular or virtualbox win7, or regular win10. (Just in case one of the combinations gets some the entropy sources for the pseudorandom number generation wrong, I'm thinking WINE in particular)
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 31, 2018, 06:50:22 PM
> Having done lots of save scumming, I can demonstrate that there is a difference between pods at the landing site of a base, and random scattering pods across the planet.

Interesting, but apparently you didn't run those tests with the Thinker binary? It would be mostly useful to know if there's any differences between Thinker and vanilla behaviour. Any significant differences should probably be apparent after a much smaller number of tests though.

> I can probably dig out the saves to share if anyone is interested in verifying my observations.

Thinker should not affect any RNG outcomes directly, however, there may be some indirect effects when a new map is generated with faction_placement enabled. There's one function call in the vanilla placement algorithm that sets some bits related to the starting location which might have an effect on pod results. Next version will include a small tweak so that the modified faction placement algorithm also calls this function. Note that this fix should not have an effect on maps which were already generated using a previous version.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on October 31, 2018, 08:21:52 PM
Induktio,

#1. Why your topic is not in modding section? I was confused when I couldn't find it there.

#2. Wow. Great mod! I really see how AI behavior changed. Now it tries to occupy the big continent completely. As well as some other improvements. Please keep up this work. I believe together with Scent's bug fixes this is the most complete/advanced mod base there is. I call it mod base as anyone can drop alphax.txt changes on top of it to finalize the experience the way they like. Maybe I've said it before but that's OK.

#3. Observation.
In vanilla game I noticed two things about AI expanding bases. 1) They easily go from land to water and vice versa for aquatic factions. In other words, shore doesn't stop their expansion a bit. 2) AI expands like crazy at the very beginning. Then when they reach somewhat 20-30 bases they suddenly slow down tremendously to the point when huge land areas right next to their territory stayed unoccupied for the rest of the game. Me or other still expanding faction usually go there in the middle of the game when it seems to be much easier for this landmass originated one to take over this territory.
In your mod I see these changes. 2) They continue producing colonies like crazy throughout the whole game and tend to squeeze in every tiny spot on their continent or ocean. 1) They somehow do not go over the shore border. Land factions do not go to water ever. Aquatic ones do not go to land at all and instead infest complete ocean. I am the only one who cross the body of the water to found bases on inhabitant islands or in water. Ocean is completely empty when there is no aquatic factions - not a single sea base.
It maybe this particular game fluctuation but I don't think so. With total of 100 bases on a planet some of them bound to be in sea. I wander if your fix to 2) somehow affects 1)? Maybe AI got priority in building colonies but this priorities got so skewed that they effectively nullify the chance of building colony of other realm (sea for land faction and land for aquatic).
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 01, 2018, 08:00:10 AM
They somehow do not go over the shore border. Land factions do not go to water ever. Aquatic ones do not go to land at all and instead infest complete ocean. I am the only one who cross the body of the water to found bases on inhabitant islands or in water. Ocean is completely empty when there is no aquatic factions - not a single sea base.
Can't support this on both accounts. In my playtest all factions happily switched to seabases when they ran out of unoccupied land, albeit shrinking due to sea level rising. Also seen a few colony pods moved by boats to claim empty islands.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 01, 2018, 01:21:24 PM
They somehow do not go over the shore border. Land factions do not go to water ever. Aquatic ones do not go to land at all and instead infest complete ocean. I am the only one who cross the body of the water to found bases on inhabitant islands or in water. Ocean is completely empty when there is no aquatic factions - not a single sea base.
Can't support this on both accounts. In my playtest all factions happily switched to seabases when they ran out of unoccupied land, albeit shrinking due to sea level rising. Also seen a few colony pods moved by boats to claim empty islands.
This may be. My testing is not exhaustive. I'll keep looking.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 01, 2018, 02:42:11 PM
I call it mod base as anyone can drop alphax.txt changes on top of it to finalize the experience the way they like.

A big problem with this game has been the very convoluted ruleset which complicates AI coding greatly. They noticed that in the later Civ games and made some design decisions which made the game easier for AIs. It's maybe possible to write the AI in a really generic way that handles all kinds of modded values in the strategy, but that would probably balloon the codebase by thousands of lines at least. :-/

In vanilla game I noticed two things about AI expanding bases. 1) They easily go from land to water and vice versa for aquatic factions. In other words, shore doesn't stop their expansion a bit. 2) AI expands like crazy at the very beginning. Then when they reach somewhat 20-30 bases they suddenly slow down tremendously to the point when huge land areas right next to their territory stayed unoccupied for the rest of the game.

If you're talking about unmodded game there, it sounds quite unlike the performance I've seen. Often there's been instances where factions stagnate on 5 bases or something, so 20-30 would be a pretty good result for an AI. That was actually some of the reasons that prompted me to start this project. Also one of the eternal gripes with AI programming has been the coordination of land and sea units. I don't really remember the AI transitioning well from sea to land bases at all (in the unmodded game). I'm planning some features for the next version to address that issue.

Currently Thinker AIs will try to colonize sea but only if the land area nearby is already full. While occupying the land area is the first priority, they could maybe produce more sea colony pods but the AIs rarely seem to get any good production out of the sea bases.

Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 01, 2018, 02:45:52 PM
If you're talking about unmodded game there, it sounds quite unlike the performance I've seen. Often there's been instances where factions stagnate on 5 bases or something, so 20-30 would be a pretty good result for an AI.
I meant it as a max limit which they almost never cross. Sometimes they could stagnate below that for sure.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 04, 2018, 05:38:47 PM
Induktio,

I understand you modified some exe functionality in your mod. I am working on balancing conquer strategy with development strategy. Here is the relevant topic I opened to discuss the thing.
http://alphacentauri2.info/index.php?topic=21046.0 (http://alphacentauri2.info/index.php?topic=21046.0)

Regarding this I am quite curious if you can and like to extend your modding in this direction. Not that I insist. If you don't then I'll continue tweaking txt options to achieve it. However, if you do then I can build on top of it so it'll be slightly different txt tweaks.

Here are few things relevant to my work. Let me know your predisposition toward them.
* Disable healing completely or modify healing rates under different circumstances (territory, base, bunker, corresponding morale facility).
* Modify unit cost calculation formula. I am not talking about specific changes now - just a generic possibility.
* Modify how weapon picture is assigned to a weapon. Currently it is assigned by the weapon attack rate. Could it be done by the weapon name? This is to be able to change weapon attack rate without losing corresponding picture. This change is pretty minor and optional.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 05, 2018, 06:18:15 PM
This might be a good time to give an update of the features I've been researching. After PvtHudson pointed out the Antimind faction, that got me really thinking about expanding the strategy to native-heavy factions. It will require some additional code, but actually it's not too much.

I'm planning to implement some more ways to make use of fungus and probably the AI will also build native units if its psi bonuses are high enough. Antimind should be a pretty good test case for this since the bonuses are so abnormal. Another new feature relates to the way AI uses its colony pods and transports.

* Disable healing completely or modify healing rates under different circumstances (territory, base, bunker, corresponding morale facility).
* Modify unit cost calculation formula. I am not talking about specific changes now - just a generic possibility.
* Modify how weapon picture is assigned to a weapon. Currently it is assigned by the weapon attack rate. Could it be done by the weapon name? This is to be able to change weapon attack rate without losing corresponding picture. This change is pretty minor and optional.

Hmm, not sure about these. After all we're just dealing with a binary without source code here and changing some things is very brittle and time-consuming. This project just started as an AI coding exercise of some sorts so I'm not very inclined to go modifying the engine, at least not without a clear understanding of how the change is supposed to benefit AI performance.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 05, 2018, 07:44:34 PM
I agree that changing these formulas is very risky. Remember I didn't insist just asked if you inclined to do something like that.

If you looking for reason it is explained here http://alphacentauri2.info/index.php?topic=21046.0. (http://alphacentauri2.info/index.php?topic=21046.0.) I can repeat reasons for disabling healing here once more.
The multi round combat strongly skews odds toward stronger unit. As an example, with 3:2 odds you wins not 60% of the time as would be calculated directly from the odds but nearly 100% of the time. So slight strength advantage gives you almost 100% winning chance. Combined with healing it makes army of such units indestructible. You can build like 10 needlejects capable of knocking out enemy base defenders and just bomb-heal-repeat conquer them without casualties. Once such slight advantage is achieved it makes conquest expansion not even exponential but explosive like.
This breaks build-conquer balance. For AI it is even worse as it doesn't know about indestructible army tactics and doesn't use it. Humans do and that's why they beat it every time.
Disabling healing breaks this vicious win-heal cycle. Now fully healed more advanced unit still wins all the time. However, it irrecoverably expends HPs and is bound to die at some point. This alone makes casualties proportional to unit strengths ratio. No more indestructible armies and grades of weaker armor now do matter as they wear attacker down proportional to armor rating.

Unit cost is a different story. It doesn't help AI directly as it equally affects all players. So it may not lie in the path of your improvement. However, in its current form it makes infantry attackers ridiculously cheap. This again benefits conquer strategy where AI sucks. Changing this formula allows balancing attacker-defender unit effectiveness ratio to the extend where AI tactical choices becomes reasonable.
Once again, unit cost is kinda generic improvement. So I do not advertise it to you. Merely sharing my opinion about it.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 06, 2018, 08:44:02 AM
You can build like 10 needlejects capable of knocking out enemy base defenders and just bomb-heal-repeat conquer them without casualties.
So can them. AIs even before ThinkerMod were capable of amassing needlejets and destroying every former, colony pod and crawler in range, then switching to base defenders.
For AI it is even worse as it doesn't know about indestructible army tactics and doesn't use it. Humans do and that's why they beat it every time.
Sorry, I don't catch. AI builds units with highest available attack, and it uses healing, doesn't it? But probably we should talk about this in your thread, not here.

It's indeed time to summarize testing experience of ThinkerMod. It aimed at improvement of AI performance, and in my opinion it achieved this goal brilliantly. Faster expansion, aggressive land claim, crawler infrastructure help AI tremendously. Maybe it's just my poor skill, but I fear I have to abandon long-customary Transcend difficulty. Bravo, Induktio! Looking forward for future developments. Is it time to improve diplomacy?
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 06, 2018, 01:18:48 PM
You can build like 10 needlejects capable of knocking out enemy base defenders and just bomb-heal-repeat conquer them without casualties.
So can them. AIs even before ThinkerMod were capable of amassing needlejets and destroying every former, colony pod and crawler in range, then switching to base defenders.
For AI it is even worse as it doesn't know about indestructible army tactics and doesn't use it. Humans do and that's why they beat it every time.
Sorry, I don't catch. AI builds units with highest available attack, and it uses healing, doesn't it? But probably we should talk about this in your thread, not here.
Sure if you like I can copy your response and continue there.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 07, 2018, 04:28:13 PM
Oh, hellooo. I included a screenshot from the first test game I ran with these newest changes. It was a large random map with 4 standard factions plus Pirates and Antimind. Turn is 140 and the Gaian AI dominated throughout the whole game. Some of the fast growth is explained by the nearby jungle but it is not everything. Labs output here is about 4600 per turn, and the growth speed has been far above any typical test runs. Gaia would later transcend on turn 160 with labs output finally breaking ten thousand if I remember right. Manifold Harmonics contributed to this in a significant way probably.

So, develop version 20181107 is now available from downloads. Changes summarized:

- Rewritten colony pod movement algorithm
- Sea bases are now able to transport colony pods to land
- AI has an understanding of fungus production bonuses and will plant it if it's useful
- AI will build native units whenever psi bonuses are high enough compared to conventional weapons
- Other minor tweaks to production priorities
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 08, 2018, 10:11:23 AM
Fantastic!

It still seems weird to see Gaians with loads of boreholes and so eco damage. It would be great to see their philosophy reflected in their play, but OTOH boreholes are crazy good.

I can't see an immediate solution.
Title: Re: SMACX Thinker Mod
Post by: k3v on November 09, 2018, 05:51:23 PM
Played a new game with the latest version. Huge transcend in 2236.

This is the kind of carnage i wanted!
(click to show/hide)

Caretakers were booming so hard that a meteor took out his cap and 4 other bases lol. I think ive only seen this happen once before.

I thought my start was average, but turned out very slow. Missed WP+ME, had to disband formers to get VW in time lol.
Missed EG, slight beeline error, but I dont think it wouldve mattered, gaia goes straight for it. Hence lost Govenor. Didnt get governor till 2210! Two allies killed, forgot to set dont restart killed, so morgan came back but stayed on two bases rest of the game. So heaps of potential energy lost.

I think without a really good start, first governor is impossible due to how well the ai booms now, 60 pop at first governor (I had 46 with PTS, turn 70). Ive havent played with Lal in the game yet lol, that would definately be impossible.

Something ive never seen before was overall terraforming damage causing rising sea levels, because it was never a factor before (ai just didnt terraform enough). I lost a base and like 7 boreholes because of it.

Angels maxed at 1000 science at the end. I got a few level 6+ techs from AI's which is huge. Usurpers kinda sucked, even though they were isolated. I think they're unable to take fm+wealth, which hurts them alot as well as no commerce.

I think the only way to improve ai builder from here would be forcing them to play the builder strat. The AI cant really build space pods, cause they'll never get CBA and then only have a few bases with an aerospace academy. But with the 70% production boost forcing aerospace academies in all bases is easily doable. Do they treat pods as a base facility? Can they build more then 1 per base? I imagine space pods arent that easy for the ai to understand, but with the base spam they add up to a lot.

I'd love to have this mod on a double size huge map with all 14 factions, too bad theres so many hardcoded obstacles for it.

Anyway, the mod is amazing, really great work.

Saves attached if anyone wanted.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 09, 2018, 11:25:06 PM
Hi Induktio.
I was playing your mod with all but Fission reactors disabled. Works right in the way that I cannot equip unit with any other reactor. However, I see that AI equip their custom units with Singularity one!!! Like rover formers and armored sea probes. That seems like a glitch in a game. When reactor is disabled AI somehow can pick it up for new unit design. I saw only non combat units with Singularity reactor so far, though.
Anyone observed something like that?
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 10, 2018, 11:25:46 AM
If anyone has ideas how to get the SP movies working again, could be also useful to know.

You need movlistx.txt from scient's v2 patch. Attached here.

Scient added this file so that we can have different end-of-movie text for smac and smax (because hunter seeker alg does different things in each).
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 10, 2018, 04:04:57 PM
Lots of interesting stuff here to address.

> Something ive never seen before was overall terraforming damage causing rising sea levels, because it was never a factor before (ai just didnt terraform enough).

Yeah, I bet the original designers didn't anticipate AIs with 50 boreholes. The speed of the sea rise is getting pretty excessive with this heavy terraforming. I should probably recommend players to lower this setting in alphax now? Maybe put recommended settings in Details.md for documentation?

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

> Angels maxed at 1000 science at the end. I got a few level 6+ techs from AI's which is huge. Usurpers kinda sucked, even though they were isolated.

I'm thinking the fact that aliens cannot engage in commerce is now a very significant limiting factor for them. With all the new energy being produced, the AIs seem to earn a lot from trade. This might be a good thing.

> The AI cant really build space pods, cause they'll never get CBA and then only have a few bases with an aerospace academy.

Do you just mean satellites here? They do build aerospace complexes and satellites pretty quickly after learning the techs. It seems your game ended almost just after they learned spaceflight. :-/

> I'd love to have this mod on a double size huge map with all 14 factions, too bad theres so many hardcoded obstacles for it.

There have been many modding ideas, but this is actually the one that will *never* happen without a full open source port. Consider the fact that there are exactly 8 bits in a byte, and single byte values are used all over the binary to store faction boolean values. Now you get the idea.

> However, I see that AI equip their custom units with Singularity one!!!

There was a bug in the old code where it didn't check properly for disabled techs. It is fixed in the most recent version but it can't undesign already designed units in an old save. It should work properly on newly started games of course.

> You need movlistx.txt from scient's v2 patch. Attached here.

So this file is basically a verbatim copy of movlist.txt if expansion is enabled? If I were to keep this feature, I think the game should read those modded values from ac_mod folder just like the other modified files if expansion is disabled. Does not feel useful to distribute a copy of a standard file with the patch. I'm not sure if some other files might have to be put into that folder too, currently the list is: alphax.txt, helpx.txt, conceptsx.txt, tutor.txt, labels.txt

Also, what do the players think about these things:

- Should the AI build armored crawlers in mass? After fusion reactors armor becomes so cheap I'm tempted to have them build crawlers with armor installed.
- Is the colony pod production rate good enough now or should it be changed? Maybe the difficulty level should affect the desired AI expansion rate?
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 10, 2018, 04:56:18 PM
> However, I see that AI equip their custom units with Singularity one!!!

There was a bug in the old code where it didn't check properly for disabled techs. It is fixed in the most recent version but it can't undesign already designed units in an old save. It should work properly on newly started games of course.

You mean in your old code? Good to know. Cool man. Thanks for fixing this! I can continue crunching unit costs now.
:)
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 10, 2018, 07:41:18 PM
Quote
So this file is basically a verbatim copy of movlist.txt if expansion is enabled? If I were to keep this feature, I think the game should read those modded values from ac_mod folder just like the other modified files if expansion is disabled. Does not feel useful to distribute a copy of a standard file with the patch. I'm not sure if some other files might have to be put into that folder too, currently the list is: alphax.txt, helpx.txt, conceptsx.txt, tutor.txt, labels.txt

The text files in scient's patch are generally better than the ones that come with the game. If I were you I'd just expand scient's installer (code available) and add thinker to it. If you really don't want to use movlistx.txt either make a copy on first run or just change the binary to use movlist.txt?

This reminds me: have you had a look at the save-game logic? It would be good to save a list of the active factions in or related to each save game: at the moment you will end up with the wrong art etc. for factions if you load a scenario and you have to keep fiddling with alphax if you use custom factions a lot.

Title: Re: SMACX Thinker Mod
Post by: Induktio on November 10, 2018, 08:05:43 PM
The text files in scient's patch are generally better than the ones that come with the game. If I were you I'd just expand scient's installer (code available) and add thinker to it. If you really don't want to use movlistx.txt either make a copy on first run or just change the binary to use movlist.txt?
Hmm, yeah. Basically there are two behaviours one could choose from:

1. If expansion is enabled, use "movlist.txt"
    Else use "ac_mod\movlist.txt"

2. Use a filesystem call to copy movlist.txt to movlistx.txt if the latter is missing.

Movies would work fine after either of these two steps, but not sure really which one is better. Option 2 would work better if one also plays the Scient-patched game without Thinker but I don't currently see any other reason to use it over option 1.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 11, 2018, 12:46:00 AM
In scenario 1 what is the difference between the two files?

And if you're distributing one of the scient variants why not both?
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 11, 2018, 02:17:26 PM
> And if you're distributing one of the scient variants why not both?

I'm not distributing any of the txt files currently. Probably it's better for people to install the Scient patch files separately if they want all the stuff. My plan is to just have the binary either work with those or with the stock files provided by the game installer. The preference is to allow installing this mod without having to overwrite any other stuff. Keeping it very minimalistic with the dependencies.

I'm not sure how much use the load_expansion feature is going to get or how much time should be spent on it, but in theory it would be nice to have a way to turn off the expansion related features.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 11, 2018, 04:42:26 PM
I think SMAC is the better game, so I'd vote for it :)

As for movlist this seems pretty trivial:

if (expansion && exists(movlistx.txt))
    use movlistx.txt
else
    use movlist.txt
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 12, 2018, 01:07:19 PM
- Should the AI build armored crawlers in mass? After fusion reactors armor becomes so cheap I'm tempted to have them build crawlers with armor installed.
Sure, why not. Armored probe teams already added me worries.
- Is the colony pod production rate good enough now or should it be changed? Maybe the difficulty level should affect the desired AI expansion rate?
It's good that AI always has several CPs idly rolling back and forth through his lands (and mine if allied), thus they near instantly claim any released land. I'd say, rate is at least enough, perhaps even slightly excessive.

Can the "Empty facilities NN" from #FACILITIES be added to AI's build queues with low priority if their prerequisite has been changed from Disable to something?
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 12, 2018, 04:42:00 PM
> It's good that AI always has several CPs idly rolling back and forth through his lands (and mine if allied), thus they near instantly claim any released land.

Players can probably see the difference pretty quickly there, the new colony pod algorithm actually iterates every reachable tile nearby and sends the pods to the best square that fits the desired city spacing.

> Can the "Empty facilities NN" from #FACILITIES be added to AI's build queues with low priority if their prerequisite has been changed from Disable to something?

Building effects are hardcoded, so I'm guessing these are the buildings that would provide some free energy only if alphax is modded. Build queue is somewhat hardcoded in the mod too. What I think could be done here, the queue needs to look at each of the energy bonus buildings abstractly and calculate expected return versus minerals and maintenance cost. Then select the building with the highest score. It can be done fairly easily but one needs to figure out the energy bonus calculation and balance this with other priorities.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 15, 2018, 12:00:47 PM
I feel like soon it would be the time to wrap up an another release of the mod. It's been a while since v0.7 already. Still it would be nice to have a couple of more features related to either social engineering or diplomacy. I've been looking at those areas and the reversing database does not cover them very well, so any progress is not that quick. In the case of adjusting SE choices, I'm not sure if it's doable to attempt to patch it or if it will require a larger rewrite. Some of the default AI choices are quite horrible so it may actually be the biggest obstacle to AI performance right now which is pretty annoying.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 15, 2018, 01:59:27 PM
Still it would be nice to have a couple of more features related to either social engineering or diplomacy. I've been looking at those areas and the reversing database does not cover them very well, so any progress is not that quick.
Maybe, start with a couple of small bugfixes to get grasp of the matter? Like, fix annoying multiple late game hate-messages in a row, or exploit of provoking AI into vendetta with troops removal demand?
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 18, 2018, 05:17:03 PM
During the last week or so, I've been planning a feature Thinker has not modified before: combat unit movement! :)

Arguably this is the most complex part of AI programming, at least in the original game, the single biggest function dealt only with unit movement. There's certainly many different variables to consider, starting with combat odds and zones of control that interfere with path finding. In the first phase, this feature will probably be limited to evaluating counter attacks up to a couple of tiles away from the unit.

I think generally, the AI is really passive in attacking the native life, so having this feature will be important for the AIs to handle abundant native life. The units should also start to heal at monoliths because currently the AI does not seem to understand that, they only try to acquire the morale upgrades and then forget them. Also I'm not sure if the normal AI ever attacks with a hasty penalty, but in this case, it is possible to implement this behaviour now.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 19, 2018, 04:56:39 AM
I think generally, the AI is really passive in attacking the native life, so having this feature will be important for the AIs to handle abundant native life.
So true! Single spore launcher can stiffle an entire AI faction in the start.
Also I'm not sure if the normal AI ever attacks with a hasty penalty.
I've seen that.

Thanks to your efforts, SMAX has received biggest AI upgrade in 20 years and is already much harder and involving game than before. I don't dare to imagine what can be achieved in the tactical combat field!
Title: Re: SMACX Thinker Mod
Post by: MercantileInterest on November 19, 2018, 10:08:49 PM
Good to have a code modder among us once again.

Before his disappearance, Yitzi was talking about ways to scale back infiltration. Rather liked the thought of being able to remove infiltration by sending a probe team into an enemy base, perhaps with a low chance of success. Other ideas include a Planetary Council measure to vote on removing all infiltration or using one of the extra secret projects slots for the same effect. No idea how practical these measures might be, except that Yitzi said the first one was doable. Concern with infiltration mainly applies to multiplayer but that's my preference anyway.

Be back with more observations on Yitzi features later. Glad to have you here!
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 19, 2018, 11:51:22 PM
Before his disappearance, Yitzi was talking about ways to scale back infiltration. Rather liked the thought of being able to remove infiltration by sending a probe team into an enemy base, perhaps with a low chance of success. Other ideas include a Planetary Council measure to vote on removing all infiltration or using one of the extra secret projects slots for the same effect. No idea how practical these measures might be, except that Yitzi said the first one was doable. Concern with infiltration mainly applies to multiplayer but that's my preference anyway.

Be back with more observations on Yitzi features later. Glad to have you here!

I think it is too small scale change. There are much bigger clearly visible problems. Besides, AI doesn't need an infiltration to see all your units.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 20, 2018, 04:51:38 AM
If the works ever came to changing the rules of the game, there are plenty of ideas waiting (albeit of various utility and difficulty), at least http://alphacentauri2.info/index.php?topic=19520.0 (http://alphacentauri2.info/index.php?topic=19520.0) and http://alphacentauri2.info/index.php?topic=17418.0. (http://alphacentauri2.info/index.php?topic=17418.0.)
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 21, 2018, 01:02:50 AM
Okay, so develop version 20181120 is now available from downloads. Most interesting changes since last update:

- SP movies should now work by default in GOG installation
- AI starts building armored crawlers after fusion reactors

First phases of land combat unit logic implemented:
- AI considers any possible counter attacks on enemy units up to ~3 tiles away
- Attempts only attacks on tiles it can reach in one turn, sometimes with a hasty penalty
- Even base tile defenders can counter attack now, given favourable odds
- AI heals units at monoliths now

Triads other than land are not affected yet. It's hard to say how accurate the combat odds or tactical calculation formulas are yet, so they will probably receive some revisions later. Post here your observations if the AI behaviour changes noticeably.

> Concern with infiltration mainly applies to multiplayer but that's my preference anyway.

Note that IP multiplayer is not supported in this mod due to the large amount of extra code required to synchronize the game state across networks. I'm not sure if I would even attempt implementing that.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 22, 2018, 12:51:35 AM
I saw it first few times when I was talking to Lal. Later on it displays 25 as it should.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 22, 2018, 12:53:22 AM
Chart is not scaled properly.
Another thing is that regardless of whether I right-click left or right panel and select what to display it displays my choise on left panel only.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 23, 2018, 09:04:28 AM
Does AI build probe ships? Vanilla AI built Probe Foils if predefined and put them to good use (however, it didn't use them against coastal bases). In the recent game on standard random map with the latest ThinkerMod dev build, there were no probe ships in unit roster screens of all factions. Was it due to Librarian difficulty? By the way, my impression is the new Librarian corresponds to the old Transcend most closely.
Another question about predefined units. On what condition AI builds disabled *Sea Formers and Sea Escape Pods? Looks like those two rows 5 and 22 are hardcoded, possibly wired to MY. Sven in particular goes mad on *Sea Formers.
About unit movement amends regarding unarmored probe teams and, in a lesser degree, attackers in general. Is it feasible to teach them to end turn in one tile with friendly defender, or as far from target as possible to cross in one turn (especially ships), or outside of enemy vision, or at least not adjacent to enemy if possible? Recently my garrison unit broke record, eliminating a stack of no less than 25 Free Drones probe teams.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 23, 2018, 02:33:43 PM
My apologies. Looks like these errors were there result of txt misconfiguration. I've verified it and updated and don't see it happening any more.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 23, 2018, 08:30:54 PM
> Does AI build probe ships?

If the AIs have foils + probe team tech, they should also build probe foils randomly along with normal ships. So dunno why you might not be seeing any foils. They might develop slower on easier difficulty levels though. I don't think I've implemented any significant changes there.

> Another question about predefined units. On what condition AI builds disabled *Sea Formers and Sea Escape Pods?

Yeah, the meaning and order of the standard units is hardcoded. Those units are a fallback default type for the prototype picker if the factions don't have a custom prototype of that type even though they should have the tech. The code would behave weirdly if it's not able to produce the unit types it would have the techs for.

> Is it feasible to teach them to end turn in one tile with friendly defender, or as far from target as possible to cross in one turn (especially ships), or outside of enemy vision, or at least not adjacent to enemy if possible?

Sure it's feasible to rewrite some of the movement code and there's already some changes, but currently it doesn't directly affect unit types with the probe weapon. Remember that even if they stopped away from enemies now, the new attack code considers any tiles that can be reached by roads from the attackers current location in one turn (including the attack). Rovers are able to cover pretty large distances now. Any unit that has to end its turn next to enemy roads is now in *real* trouble, including other rovers.  Probe teams often have difficulty reaching their targets, sure, so they could probably use some improvements.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 24, 2018, 11:22:28 AM
Attached save crashes the game after pressing End Turn. Made entirely in Thinker-dev-20181120. Hope this will help to catch some bug. Satori custom faction is from http://alphacentauri2.info/index.php?action=downloads;sa=view;down=264. (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=264.)
Also looks like (at least Librarian) AI doesn't build any user-predefined units, i.e. beyond #UNITS line 23, despite having prerequisite tech.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 25, 2018, 08:29:07 PM
Hmm, that was quite a serious issue, but it should be now fixed in version 20181125 (https://github.com/induktio/thinker). It should also properly build the user defined units listed in alphax.txt. It is now redundant to define probe foils in alphax.txt but it should cause no issues after this update. So basically you can continue playing that save game normally.

The code indeed crashed on a null pointer dereference, but the thing is, the source code included a check for this null value and it worked with optimizations disabled, but gcc decided to heuristically eliminate this check when using the -O2 switch! I actually had to check this from the emitted assembly code and the condition was really missing. I now have to override this behaviour with -fno-delete-null-pointer-checks.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 27, 2018, 01:18:02 AM
Such a quick fix, thanks a lot. Crash indeed gone, and AI is building user predefs. But so far no probe ships, neither predefined nor self-designed. Will see how it unfolds.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 27, 2018, 07:03:17 AM
Here's a quick port of the smac_in_smax files I wrote to the format thinker expects. labels.txt is just a copy of the base game's one.

Just extract this dir to your smac dir and set load_expansion = 0 in thinker.ini.

It differs from original smac_in_smax in that all SMAX features are disabled whereas the original release thru yitzi allowed and used selective enabling of some SMAX features (sealurks, landmarks).
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 27, 2018, 11:57:52 PM
Induktio,
By the way, did you see this mod? It seems to working on the same AI performance enhancement thing. Just FYI.
http://alphacentauri2.info/index.php?action=downloads;sa=view;down=260 (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=260)
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 28, 2018, 12:11:12 AM
Re: combat mechanics, from an email chain with induktio but made public in case anyone has anything to add and for posterity.

There's no need to monte carlo it, the advantage is if you can find the right function you can let SMAC handle disengagement rules (including whether the unit can disengage due to surrounding units), different kinds of combat (e.g. artillery, naval), collateral damage, etc and you can just treat it as a black box. I suspect this is harder than one would like because of all the global state in SMAC, but maybe it's OK.

---

So from the manual and from some experiments done ages ago on apolyton[1][2], we can get a pretty accurate idea of what the real combat system is (SMAC combat system is very similar to Civ2, see [2]).

let ah, dh = attacker's health, defender's health.
let p = probability of attacker hitting in a single round (this seems to have a slight fudge factor on it in Civ2 and maybe also SMAC that benefits the stronger unit).

In post#5 in [1] they argue that the true probability of the attacker winning is the sum of the probability of hitting the defender dh times for all possible number of rounds that the attacker could survive for (they're using the probability mass function for the binomial for each round, except they subtract one from each operand in the combination, I don't know why they do that.).

let f(k, n, p) = probability of getting exactly k successes from n rounds with probability p of each success

(or mess with the combination like they do? I'd want to understand why).

Their formula in python:

probability of attacker winning = sum((f(dh, n, p) for n in range(dh, dh+ah-1))

In terms of efficiency, that's a linear time function if you make a lookup table for the factorials or n^2 if you don't, which is probably fast enough.

[1] also provides a constant time approximate formula.

---

I was going to plot the probabilities for a variety of initial healths for a range of strengths and see if I could fit a constant time model, but I haven't got around to it yet.

Any model you do use can also be tested against experimental data from SMAC in [3] and [2].

[1]: https://web.archive.org/web/20140905043718/http://apolyton.net/showthread.php/22856-Info-Combat-(GL)?s= (https://web.archive.org/web/20140905043718/http://apolyton.net/showthread.php/22856-Info-Combat-(GL)?s=)
[2]: https://web.archive.org/web/20140907092936/http://apolyton.net/showthread.php/103023-Combat-results?s= (https://web.archive.org/web/20140907092936/http://apolyton.net/showthread.php/103023-Combat-results?s=)
[3]: https://apolyton.net/forum/other-games/alpha-centauri/151230-combat-mechanics (https://apolyton.net/forum/other-games/alpha-centauri/151230-combat-mechanics)
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 28, 2018, 10:38:11 AM
> Here's a quick port of the smac_in_smax files I wrote to the format thinker expects. labels.txt is just a copy of the base game's one.

Nice. I didn't check it yet myself but we could place this mod in a separate repo so it doesn't get lost in this thread. I'm also wondering whether I should supply a new alphax.txt with this mod, but anyway the recommended changes are visible in Details.md in the repo.

> By the way, did you see this mod? It seems to working on the same AI performance enhancement thing. Just FYI.

Yeah, but he made that using only binary patching. It's pretty hard to compare changes without source code. By developing Thinker using C++ we're basically unlimited in what kind of new algorithms the AI could use. Now that I also implemented the method where the patches can be applied dynamically at startup, it's pretty rare to even have to change the actual game binary.

> [1] also provides a constant time approximate formula.

Are you referring to this formula below? It's somewhat similar to what Thinker calculates now but "firepower" doesn't have the same meaning in this game as far as I know. There's only one value derived from A/D strength/modifiers that is used to scale the random numbers and determine winners in combat. I wouldn't make any assumptions the page is applicable to SMAC.

(click to show/hide)
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 28, 2018, 01:13:06 PM
Yes, that formula, but firepower is always 1 in SMAC. In [2] and [3] there's a discussion based on empirical data.

Also the description of the smac and civ2 combat systems is very similar: they're both multi-round you hit or I hit things.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 28, 2018, 02:32:48 PM
they're using the probability mass function for the binomial for each round, except they subtract one from each operand in the combination, I don't know why they do that.

Because all possible chain of events should end up with loser to take the hit. So you put this last hit aside and everything else is a complete permutation.
For example, ah = 2, dh = 2. The probability the attacker winning the combat is p (last blow to defender) + sum of other combinations: 0 or 1 times attacker loses and 1 time defender loses.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 28, 2018, 02:35:43 PM
> By the way, did you see this mod? It seems to working on the same AI performance enhancement thing. Just FYI.

Yeah, but he made that using only binary patching. It's pretty hard to compare changes without source code. By developing Thinker using C++ we're basically unlimited in what kind of new algorithms the AI could use. Now that I also implemented the method where the patches can be applied dynamically at startup, it's pretty rare to even have to change the actual game binary.

I didn't mean to integrate this patch blindly. Merely scan through a list of changes and think if you want any of them in yours.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 28, 2018, 02:41:51 PM
Are you referring to this formula below? It's somewhat similar to what Thinker calculates now but "firepower" doesn't have the same meaning in this game as far as I know. There's only one value derived from A/D strength/modifiers that is used to scale the random numbers and determine winners in combat. I wouldn't make any assumptions the page is applicable to SMAC.

(click to show/hide)

Is this a formula SMAC uses to display odds? I understand it just multiplies round odds with both unit hit point proportion. That is incorrect combat odds due the fact it results in multi round binomial distribution which is not a direct multiple of hit points. In fact, stronger unit with smaller amount of hit points may have better combat chances even though the program displays the opposite.
:)

Anyway. Thank you for publishing it. It's a good information.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 29, 2018, 11:07:25 PM
Looks like the last big feature missing from the next release is doable after all, namely rewriting the AI social engineering. :)

I've had some really interesting results with the new SE code. The AI actually now considers all the possible society effects resulting from a SE change in an abstract manner, so it's able to understand the nonlinear effects of the different modifiers. For example +2 ECON +4 EFFIC is some of the combos it tries to achieve now. It is also able to understand pop booming and toggle growth modifiers based on that. It only considers the actual cumulative social effects, so it's not hardcoded to rely on any particular choice.

When doing some tests with the Technocrat Foundation custom faction, I noticed ROBUST modifier seems to be bugged in the game. It's supposed to cut some penalty modifiers by half, but sometimes it reduces BOTH the negative and positive modifiers by half. It seems really few custom factions make use of this modifier since it's so marginal, so I would suggest avoiding those. PENALTY modifier that only applies to one social model seems to be working okay though. Again, its use is probably really rare among the custom factions.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on November 29, 2018, 11:40:38 PM
Interesting work.
By the way, were you able to determine original AI algorithm of SE model selection?
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on November 30, 2018, 03:15:46 PM
they're using the probability mass function for the binomial for each round, except they subtract one from each operand in the combination, I don't know why they do that.

Because all possible chain of events should end up with loser to take the hit. So you put this last hit aside and everything else is a complete permutation.
For example, ah = 2, dh = 2. The probability the attacker winning the combat is p (last blow to defender) + sum of other combinations: 0 or 1 times attacker loses and 1 time defender loses.

Yes, that makes perfect sense :) Thanks.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 30, 2018, 10:11:56 PM
New release version 0.8 is now available from downloads (https://github.com/induktio/thinker). Changes since the last release:

* New combat logic for land-based units attempts to do counter attacks more often
* New code for selecting social engineering priorities
* AI understands the value of fungus and will sometimes plant it
* AI sometimes builds native units when the psi bonuses are high enough
* Faction placement option added: avoid bad spawns on tiny islands and equalize distances to neighbors
* Landmark selection options added to config
* Experimental load_expansion option added
* Many other fixes and adjustments
* Scient patch updated to v2.0

This new social engineering AI is probably really significant in boosting the AI capabilities. It should be able to fairly reliably pop boom via SE if +4 growth is just attainable. It also takes into consideration the distance to any enemies and might decide to switch out of Free market (or any other model with -police) to avoid the pacifism penalty. I'm not sure yet if the switch happens too soon though. Tell us here your experiences with the new SE priorities.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 01, 2018, 12:39:30 PM
Nice work, Induktio. Let me try it.

Are you still up to some non AI enhancement directly related changes?
One thing I noticed about psi combat in Yutzi's patch. He made it affect both attack and defense. Which makes sense to me. With vanilla settings goring deeper and deeper on negative PLANET ratings doesn't change things. Player just stop building natives and attack them. The defense strength still the same. That is why FM PLANET penalty is almost not noticeable.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 01, 2018, 02:10:51 PM
Was just played your new version and observed strange thing. I never made a treaty with Gaian's and started a war against them. Then at some point it turned out we are in truce. Don't remember how it happened but OK. Then at some point they start attacking my units without game telling me that they are doing sneak attack. I've checked the comm screen and it says we are in truce. Yet both of us can attack each other without any problems.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 01, 2018, 04:50:04 PM
> Then at some point they start attacking my units without game telling me that they are doing sneak attack.

Looks like I can't replicate this bug at all. Did this happen even on the same turn? There's a Gaian laser squad a couple of tiles away, and I did notice one thing. If you station one impact infantry both next to the Cyborg base and the laser squad, it may seem the squad is attacking, even though it is the recon rover *inside* the base that actually counter attacked there. Visually on the map it might look really similar, but the laser squad should not attack in this case.

Are you using the default WorldBuilder btw? It looks like there's quite a lot of small islands. I didn't mention it in the thread yet, but the modded WorldBuilder can be seen in Details.md (https://github.com/induktio/thinker/blob/master/Details.md). Not that it affects this issue though.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 01, 2018, 06:13:08 PM
> Then at some point they start attacking my units without game telling me that they are doing sneak attack.

Looks like I can't replicate this bug at all. Did this happen even on the same turn? There's a Gaian laser squad a couple of tiles away, and I did notice one thing. If you station one impact infantry both next to the Cyborg base and the laser squad, it may seem the squad is attacking, even though it is the recon rover *inside* the base that actually counter attacked there. Visually on the map it might look really similar, but the laser squad should not attack in this case.

Are you using the default WorldBuilder btw? It looks like there's quite a lot of small islands. I didn't mention it in the thread yet, but the modded WorldBuilder can be seen in Details.md (https://github.com/induktio/thinker/blob/master/Details.md). Not that it affects this issue though.

I didn't change worldbuilder.
They didn't just attack me once. We are at war. I attack their units they attack mine. Yet game says we are in truce and we can communicate and trade technologies, etc. I'll see if it happens again.
Title: Re: SMACX Thinker Mod
Post by: LastConformist on December 03, 2018, 07:33:45 PM
Dumb question maybe... I found this mod when a renewed interest in SMACX was sparked recently. But I can't figure out how to install it properly. I downloaded the files from Github and thereafter am completely stumped. I do have the GOG version of the game. Ine instructions on Github don't seem to make sense to me. I don't see a terranx_mod.exe. Can anyone help?
Title: Re: SMACX Thinker Mod
Post by: dino on December 03, 2018, 09:36:23 PM
It's a bit dumb question indeed. You've probably downloaded source code from github.

Go to github page linked in the opening post, scroll down a bit to the Download section of the description.
Go Release versions -> Thinker_v0.8.zip -> click download on the top right corner.



Title: Re: SMACX Thinker Mod
Post by: Induktio on December 04, 2018, 09:08:19 AM
Yeah indeed.  :)

Re: bug reports. Make sure the issues are repeatable given some save file. If the issue cannot be repeated even after multiple save game reloads (in the case it's non-deterministic), then basically nothing can be done about it.

Anyway, currently I'm not planning to mod the combat mechanics in any way. Probably in the future releases I will attempt to streamline or extend the current AI behaviour. There might still be an issue with the foil probe team prototypes not being created properly for the AIs, have to investigate that later.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 04, 2018, 01:49:13 PM
Speaking about bugs there is a minor one. Saving and loading production queue. Annoys me a little by adding more mouse-clicks but harmless overall.

In original game it saves the current production as well. That is if I save the queue with Scout Patrol currently produced. Then when I load it in new base the currently produced item is changed to Scout Patrol. This is not reflected in UI immediately but if you close the base screen and open it again you'll see it.
In your mod the currently produced item is not changing for sure.
This is repeatable I won't attach a save.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 06, 2018, 02:08:17 PM
Speaking about bugs there is a minor one. Saving and loading production queue. Annoys me a little by adding more mouse-clicks but harmless overall.

I think I see the difference you're talking about here. In the base game it saves/reloads the currently produced item along with the queue, but looks like this behaviour was changed in Scient patch v2.0. It's mentioned in Details.md:

Quote
50. [EXPLOIT] Using the right click "Save current list to template" and "Load template into list" features of base queue can be used to bypass retooling completely. Fixed so these queue template features only save and load the actual queue and not affect the item currently in production.

Thinker by itself should never modify production items in player bases, so this is entirely a feature caused by the Scient patch. Whether this change should be reverted or patched differently is another question then. Arguably it's slightly annoying if the current production item is not changed along with the queue.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 07, 2018, 02:49:18 PM
Well then. If it is an exploit, I'll live with it.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 13, 2018, 01:00:25 PM
I added the smac-in-smax mod link on the readme page (https://github.com/induktio/thinker) while expanding the details documentation. It has now its own repository (https://github.com/DrazharLn/smac-in-smax) in github so it doesn't get lost in this thread.

About that patch #50 I'm not yet sure if we should keep it that way or change it to something else. I think the old behaviour with the build queue would be better if the retool exploit could just be patched in a different way. There's also many other modding options that could still be added, that's for sure. I have not entirely abandoned the idea of modding satellites, probably there just isn't any simple of way of doing it, not to mention even deciding *how* they should be modded.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 19, 2018, 08:56:31 PM
Induktio,
We were discussing the way of balancing psi attack and defense in general. It turned out that AI does not attack well with native nor it defends well against them by mean of building cheap units with trance/song.
Did you pay attention to it in your mod? This alone would give AI great advantage if it can assess current situation and shift toward building normal or native attackers/defenders. I.e. when enemy sends waves of worms - build more cheap trance/song units, otherwise not. When assaulting neighbor see if they have strong psi defense. If not - build worms, otherwise not.

Would creating predefined units with these abilities help AI?
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on December 20, 2018, 05:38:30 AM
Speaking of worm wars, I didn't see any AI in the latest version switching from FM to Green, even on the brink of collapse under worm waves.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 20, 2018, 02:01:20 PM
Speaking of worm wars, I didn't see any AI in the latest version switching from FM to Green, even on the brink of collapse under worm waves.

Yep. That's too. AI has a lot of things it can do better. We just touching some most visible flaws.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on December 20, 2018, 05:30:54 PM
When assaulting neighbor see if they have strong psi defense. If not - build worms, otherwise not.

Not correct.  Successful use of mindworms on offense is usually a combined arms operation, not a monolithic attack.  There's a stage during city siege at which you throw mindworms, because now you're fighting units that aren't strong enough to stand up to them.  If something has Psi defenses, you just have to weaken those units first in some other way.  This is no different from ECM defenses, or AAA defenses.  Combined arms is the way you take all these buffs down.

You might not want to build mindworms for offensive assault, if you yourself have pathetically weak mindworms.  Like your PLANET rating is negative and you don't have Biology Labs etc. to level up what you produce.

Even still, weak mindworms are a good bush scouting and defense option.  The stock AI likes to sneak across big fields of fungus, and this is complete disaster for them if you bring a couple mindworms to intervene.  Having the mindworms be terribly strong is not all that important here, because likely to survive and level up, just getting fed all these human sacrifices.  A better AI would both plan to utilize these death traps as home defense, and also would be wiser about blundering into them.

I'm sure people could write better AI all day if they had a clear foundation to work from.  My point is that these AI problems are difficult, not simply reduced to cranking this setting up or down as a pass filter.  I'm sure Induktio knows that already and is allocating his efforts accordingly.

Defensive units, is more about cranking a pass filter up or down, as you suggest.  There's not as much tactics to defense, as you're just trying to withstand a siege that might be a complete ambush, no preparation on your part.  "Stack with cheap Trance units" is a good countermeasure to a mindworm spawning faction, or a mindworm apocalypse.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 20, 2018, 05:41:34 PM
When assaulting neighbor see if they have strong psi defense. If not - build worms, otherwise not.

Not correct.  Successful use of mindworms on offense is usually a combined arms operation, not a monolithic attack.  There's a stage during city siege at which you throw mindworms, because now you're fighting units that aren't strong enough to stand up to them.  If something has Psi defenses, you just have to weaken those units first in some other way.  This is no different from ECM defenses, or AAA defenses.  Combined arms is the way you take all these buffs down.

You might not want to build mindworms for offensive assault, if you yourself have pathetically weak mindworms.  Like your PLANET rating is negative and you don't have Biology Labs etc. to level up what you produce.

Even still, weak mindworms are a good bush scouting and defense option.  The stock AI likes to sneak across big fields of fungus, and this is complete disaster for them if you bring a couple mindworms to intervene.  Having the mindworms be terribly strong is not all that important here, because likely to survive and level up, just getting fed all these human sacrifices.  A better AI would both plan to utilize these death traps as home defense, and also would be wiser about blundering into them.

I'm sure people could write better AI all day if they had a clear foundation to work from.  My point is that these AI problems are difficult, not simply reduced to cranking this setting up or down as a pass filter.  I'm sure Induktio knows that already and is allocating his efforts accordingly.

Defensive units, is more about cranking a pass filter up or down, as you suggest.  There's not as much tactics to defense, as you're just trying to withstand a siege that might be a complete ambush, no preparation on your part.  "Stack with cheap Trance units" is a good countermeasure to a mindworm spawning faction, or a mindworm apocalypse.

Well, come on! I didn't mean to give specific tactical advice. Just to find out if this is possible or plausible at all. So read my "build worms" as "build more worms than usual", etc.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on December 20, 2018, 07:42:31 PM
Well, come on! I didn't mean to give specific tactical advice. Just to find out if this is possible or plausible at all. So read my "build worms" as "build more worms than usual", etc.

In general it's not a good idea for an AI to build units it doesn't really know how to use, and doesn't have a firm plan for using.  The stock SMAC AI isn't that smart about such things.  For instance if you crank up the Scenario Editor and watch AI vs. AI games from an Omniscient view, you'll see lots of units being manufactured and lots sent out into the wilderness to wander around.  It is incredibly and egregiously wasteful.  It runs cities out of SUPPORT.  It is not effective at stopping a human player from seizing cities.  How many times have you attacked a city, and wondered "Where are all those other units it's supposed to be supporting?  I didn't have to fight that many."  Well they're out in the bush being stupid.

So no, please don't ever recommend producing anything offensive unless it is known how it's going to get used.  Defense, it's much easier to crank up a setting that will help.  That's the main point I was trying to make, despite the number of words spilled on the "offensive" side of the equation.  Gotta convince people why it is so.

Every offensive thing built is a choice, that consumes production, and can be very very stupid.  Like planes in the stock .exe that just mill around doing nothing important.  The AI builds such sheer quantities of those planes, that it could take down entire empires with them, if only it knew how to use them properly.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 21, 2018, 01:09:37 PM
It turned out that AI does not attack well with native nor it defends well against them by mean of building cheap units with trance/song.
Did you pay attention to it in your mod? This alone would give AI great advantage if it can assess current situation and shift toward building normal or native attackers/defenders. I.e. when enemy sends waves of worms - build more cheap trance/song units, otherwise not. When assaulting neighbor see if they have strong psi defense. If not - build worms, otherwise not.

Would creating predefined units with these abilities help AI?
Yeah, so currently the AI has no logic for adapting the production to counter any specific enemy units. It just builds a little bit of everything. At least in the unmodded game I feel the worms are a little too weak, so the AI does not put much emphasis in producing them. Generally they need to have at least some kind of a faction/tech psi bonus before the worms are even considered for production. One good thing with the worms is that they don't need support when sitting in fungus, but this logic would also have to be coded in the movement AI. The prototype picker puts some extra value on trance/empath units, but this bonus is not adapted to the current game situation. Sometimes it might be pretty irrelevant, sometimes really useful.

There's at least one case where predefined units might be really helpful: if the AI knows how to use the unit properly but the prototype planner does not auto-design any comparable unit for some reason. Otherwise the results might be a little hit and miss.

Speaking of worm wars, I didn't see any AI in the latest version switching from FM to Green, even on the brink of collapse under worm waves.
Does the stock AI actually understand when its losing many units to psi attacks and try to increase the planet rating because of that? Not sure really. Anyway, the SE selection will get some further tweaks when I'll get back to it. Defining the conditions for when to increase the planet rating because of the psi attacks might be a little tricky though. It's just generally these strategies are a little bit rock-paper-scissors, so you can't go all in rock because then it would be vulnerable to paper and so on.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 21, 2018, 02:32:51 PM
Otherwise the results might be a little hit and miss.

I agree. I am not telling about making AI smarter at all. This is too big of a task for modding at least. Any attempts to make AI perform better boils down to giving it a right tool that it would stupidly use without thinking and yet succeed.
:)
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on December 22, 2018, 06:44:45 AM
Does the stock AI actually understand when its losing many units to psi attacks and try to increase the planet rating because of that? Not sure really.
In stock AI I noticed only one pattern of "military situation - SE choice" kind, and fairly detrimental to him: after losing a base to mind-control, AI would often switch to Fundie, clear over-reaction in most cases. IMHO, this calls for a more generalized approach: in time of peace, choose SE maximizing growth, economy, research, etc; in time of war (and this means real danger, not some empty vendetta from a faction half a globe away), maximize morale, support, planet, etc. Mixed character of most choices makes this a little difficult, so basically "many enemy units in my territory - switch out of Demo/FM/Wealth and into PS or Fundie/Green/Power".
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 27, 2018, 02:48:30 PM
Induktio,
More on generic "Probe team actions" topic.
Barring HSA, probe team success rate depends on unit morale only and not own or opponent's PROBE rating. Since middle game most probe teams are Elite as it is very easy to raise their morale level by various means. Elite probe destroys defensive facilities (perimeter, tachyon) with 75% success rate. As they are so cheap destroying enemy defensive facilities in front of your army becomes a very effective strategy. The problem here is that AI does not use it massively while human does. It essentially renders AI defensive facilities useless against human player.
As your mod targets AI improvement do you consider modding this aspect of the game? If yes, there could be multiple ways to do it starting with those I pull from the top of my head in this post.
http://alphacentauri2.info/index.php?topic=21129.msg117489#msg117489 (http://alphacentauri2.info/index.php?topic=21129.msg117489#msg117489)
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on December 28, 2018, 05:04:07 AM
The problem here is that AI does not use it massively while human does.
In my games on Thinker difficulty, AI definitely builds tons of probe teams (albeit without Algorithmic Enhancement, but with armor, Hypnotic Trance, Comm Jammer). Though he uses them not so smartly, they are a force to be reckoned with; a couple of defensive probes in border bases aren't sufficient.
Having said that, changes to probe system are begging. This is evidenced by frequency with which those proposals arise.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 28, 2018, 02:34:51 PM
The problem here is that AI does not use it massively while human does.
In my games on Thinker difficulty, AI definitely builds tons of probe teams (albeit without Algorithmic Enhancement, but with armor, Hypnotic Trance, Comm Jammer). Though he uses them not so smartly, they are a force to be reckoned with; a couple of defensive probes in border bases aren't sufficient.
Having said that, changes to probe system are begging. This is evidenced by frequency with which those proposals arise.

I didn't mean AI doesn't build them. It does all right: buys bases, steal technologies, incite drone revolt, assassinate researchers, even destroy random buildings. It does not destroy specific defensive structure targets. I never saw that.
Target destroying defensive facilities is relatively easy to do: Veteran 34/25, Commando 34/40, Elite 50/50. The effect of this is tremendous: you lose 3-5 times less units capturing a base. The cost of probe team is so small that it is incomparable to the cost of extra lost units capturing defended base. With all these factors combined this can be considered as a super effective strategy that only human is aware of = exploit.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on December 29, 2018, 07:47:27 PM
Not sure if this is Thinker bug or something from existing code. I've captured University city that was building some project.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on January 03, 2019, 08:46:45 PM
Induktio,
Did you see anywhere if AI is able to build units with Soporific Gas Pods at all? In general, are there settings for AI prescribing what unit types to build (chassis, weapon, armor, abilities) and in what proportion?
Title: Re: SMACX Thinker Mod
Post by: tnevolin on January 05, 2019, 10:48:24 PM
Found a bug.

I am playing Thinker mod with my txt mod on top of it. SMAX. Usurpers.
Every time I found a base I see the base name edit window. In this window I can move cursor way beyond the right end of the name. When I keep pressing right arrow cursor does not move any further to the right beyond some position. When I then keep pressing left arrow it doesn't start moving left until some number of left clicks passed. It seems like the actual text is much much wider that the one displayed.
When I delete the whole name the text from script.txt appears in the name input.
Looks like program is reading the string and doesn't break at end of line of something. See screenshots. The cursor is not visible.

I tested the same playing Usurpers on original GOG version of SMAX. It repeats there too. Since I have a mess of different versions on my machine I am not 100% sure it is actually original one. Didn't do any more test yet. However, I don't remember noticing this bug before.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on January 06, 2019, 01:36:15 AM
Wow. Never mind. I just uninstalled and reinstalled a fresh original version from GOG. It has the same bug!
Title: Re: SMACX Thinker Mod
Post by: Mart on January 06, 2019, 02:09:48 AM
I have seen something similar in Unit Workshop, where you can move cursor, in unit name, if I remember correctly, on large number of spaces, that seem to be there for no reason. But I play Planetary Pack version.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on January 06, 2019, 04:50:01 PM
Mine is also GOG Planetary Pack (SMAC + SMAX).
Are you saying early SMAC version didn't have it?
Title: Re: SMACX Thinker Mod
Post by: Mart on January 06, 2019, 04:57:10 PM
I do not know that, my Planetary Pack comes from edition years ago. It was sold in a separate box, I think it might be before GOG existed, it was like shortly after original game release and its expansion released, compared to today's 2019 year.

It may be similar bug, but not exactly the same. Bugs can be very complex.


[Edit]
I think it is release from year 2000:
https://www.amazon.com/Sid-Meiers-Alpha-Centauri-Planetary-Pack/dp/B00004NHFD (https://www.amazon.com/Sid-Meiers-Alpha-Centauri-Planetary-Pack/dp/B00004NHFD)
Title: Re: SMACX Thinker Mod
Post by: tnevolin on January 06, 2019, 07:40:01 PM
It may be hard noticeable bug then. People rarely rename stuff. And even if they do they do not move cursor beyond the text on purpose.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 06, 2019, 07:43:33 PM
I recently had an idea to add one new feature: the ability to select custom factions while the expansion is disabled (using the smac-in-smacx mod). Currently if you set load_expansion=0, the choices in the faction selection screen are locked, like in vanilla SMAC. With some small tweaks, it is possible to reactivate the faction drop down menu that is available in SMACX and select any custom factions.

Alas, there's one issue with this: Alien factions are also visible in the menu and selecting them causes some weird behaviour while playing the game. I'm not sure if there's any easy way to hide them from the drop down menu, but this is not an issue as long as they are not selected. Otherwise I don't see any major obstacles to adding this feature.

Elite probe destroys defensive facilities (perimeter, tachyon) with 75% success rate. As they are so cheap destroying enemy defensive facilities in front of your army becomes a very effective strategy. The problem here is that AI does not use it massively while human does. It essentially renders AI defensive facilities useless against human player.
As your mod targets AI improvement do you consider modding this aspect of the game? If yes, there could be multiple ways to do it starting with those I pull from the top of my head in this post.
http://alphacentauri2.info/index.php?topic=21129.msg117489#msg117489 (http://alphacentauri2.info/index.php?topic=21129.msg117489#msg117489)

Well, it can be said probe teams are a little overpowered against AI, but then again, lots of other units can also be used to overwhelm the AI defenses because it doesn't allocate the defenders that well. I'd say modding those probe action success rates is not really priority, although disallowing certain probe actions in addition to just mind control might make sense if the target has +3 PROBE. If we went on changing those probabilities, then the mind control costs could need tweaking as well. They can also be a really easy way to capture some bases.

Wow. Never mind. I just uninstalled and reinstalled a fresh original version from GOG. It has the same bug!

So are you saying this bug is present in the unmodified game (GOG version) as well?

Title: Re: SMACX Thinker Mod
Post by: Induktio on January 06, 2019, 08:31:09 PM
Induktio,
Did you see anywhere if AI is able to build units with Soporific Gas Pods at all? In general, are there settings for AI prescribing what unit types to build (chassis, weapon, armor, abilities) and in what proportion?
I haven't seen the AI design any Soporific units. There's a long, complicated function in the game binary that chooses which prototypes to create. I have not directly modded it, instead Thinker creates independently a couple of additional prototypes (probe teams etc) which are then usually chosen for production.

PvtHudson mentioned it doesn't build any Algo Enhanced probes, but this might be caused by the fact that Algo Enhancement is so late in the standard tech tree it's somewhat unsual to see the AIs reach that stage of development. The prototype planner should design Enhanced probes immediately when it has the Enhancement tech in addition to fusion reactors and the tech to select 2 special abilities.

As a clarification to the previous post, I might consider tweaking the AI probe team actions especially if it ignores some useful probe team actions altogether. I have not written any code for that part yet, so it's in the "maybe" category of future improvements.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on January 07, 2019, 12:15:41 AM
Wow. Never mind. I just uninstalled and reinstalled a fresh original version from GOG. It has the same bug!
So are you saying this bug is present in the unmodified game (GOG version) as well?

Yep. I've uninstalled completely, deleted folder, reinstall from my GOG library and was able to reproduce.
Title: Re: SMACX Thinker Mod
Post by: tnevolin on January 07, 2019, 12:26:48 AM
Elite probe destroys defensive facilities (perimeter, tachyon) with 75% success rate. As they are so cheap destroying enemy defensive facilities in front of your army becomes a very effective strategy. The problem here is that AI does not use it massively while human does. It essentially renders AI defensive facilities useless against human player.
As your mod targets AI improvement do you consider modding this aspect of the game? If yes, there could be multiple ways to do it starting with those I pull from the top of my head in this post.
http://alphacentauri2.info/index.php?topic=21129.msg117489#msg117489 (http://alphacentauri2.info/index.php?topic=21129.msg117489#msg117489)

Well, it can be said probe teams are a little overpowered against AI, but then again, lots of other units can also be used to overwhelm the AI defenses because it doesn't allocate the defenders that well. I'd say modding those probe action success rates is not really priority, although disallowing certain probe actions in addition to just mind control might make sense if the target has +3 PROBE. If we went on changing those probabilities, then the mind control costs could need tweaking as well. They can also be a really easy way to capture some bases.


Disabling probe actions against +3 PROBE is a good idea. Makes perfect sense. Need to think which ones. Disabling infiltration completely is probably not needed.

Actually, if you want go this path, I have an interesting idea in mind. Each enemy +1 PROBE decreases ALL percentages by 25% both success and survival. This way at +3 PROBE rating no targeted destroying defensive facilities possible as even for Elite team with AE the success chance goes down to 0%. It makes a very good sense as now PROBE rating is actually plays defensive role as it should and makes it more difficult for enemy to carry out their spy tasks. At the same time normally 100% success actions like infiltration are still possible at 25% rate. That includes random sabotage that may occasionally destroy defense but it'll take a lot of probes to get to it.

It will also make PROBE effect actually quite valuable. In vanilla game its effect is pretty unimportant besides disabling subversion at +3 rate.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 29, 2019, 11:43:51 AM
It's been quite a while since last update, but there's still more in development. I added a couple of smaller tweaks this time, e.g. the ability to select custom factions while smac-in-smacx is active. Could still add a couple of more features before deploying a new version for testing.

It's hard to say which features would be the best to implement here given the benefit/time ratios. I could maybe improve the unit movement code or tweak the production AI but not sure if there's any simple, obvious improvements left. If the build queue was rewritten we could maybe look at the facility choices in a more abstract way, so the planner could rebalance the production choices even if the costs/maintenance of facilities are modded. That's how the AI works in later Civ games also, so in essence it doesn't have any hardcoded build order.

Other topic is also the possibility of implementing new modding features. There's been a couple of ideas in this thread, but do we have any consensus of some really useful modding features that are currently missing?
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on January 30, 2019, 02:15:19 PM
The bug where you get the wrong faction art and stuff when loading a scenario save game or similar is pretty annoying, especially for people playing multiplayer games (including PBEM, which your mod presumably doesn't break?)

That bug makes lots of modding more tedious and reduces potential audience.
Title: Re: SMACX Thinker Mod
Post by: BFG on January 31, 2019, 03:03:07 AM
I've had random crashes with Thinker...they usually occur when I tried to load a colony pod onto a Unity Transport Foil.  But the crash didn't happen every time.  It seemed like it was trying to set the move coordinates to (0,0) so it could be due to that fix.  I'll try to get more info to make sure.

Meanwhile...I approve!  Tried to play a pacifist/builder Miriam game and got my butt kicked.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 31, 2019, 01:14:12 PM
> I've had random crashes with Thinker...they usually occur when I tried to load a colony pod onto a Unity Transport Foil.

Can't say much without a save game to inspect. I do suspect it's because of something else happening in the background because Thinker is not supposed to affect player-controlled units in any way.

> The bug where you get the wrong faction art and stuff when loading a scenario save game or similar is pretty annoying, especially for people playing multiplayer games (including PBEM, which your mod presumably doesn't break?)

I'm not familiar with this bug at all. How do you actually trigger it? Does it have anything to do with this entry in Scient patch notes?

Quote
52. [BUG] Fixed an issue where diplomacy dialog could be incorrectly displayed due to faction id value being set incorrectly. This is best exhibited where Progenitors switch into "Human" dialog syntax.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 02, 2019, 02:22:34 AM
I failed to save the game where I had the random crashes.  Will be sure to do so next time.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on February 07, 2019, 01:21:01 PM
It's hard to say which features would be the best to implement here given the benefit/time ratios.
IMHO, it would serve AI's best interests to tighten up diplomacy. I.e., fight well-known exploits, and teach AIs to better choose their friends and enemies. Though don't know how about benefit/time ratio for these.
Other topic is also the possibility of implementing new modding features.
Is it possible for predefined units to not grant prototypes?
Title: Re: SMACX Thinker Mod
Post by: BFG on February 08, 2019, 10:22:23 PM
I’d just be happy at this point if the AI knew how to automate gravship formers correctly.  But I am sure I am in the minority there :)

On a different note, I can no longer find a solution for “get every single Secret Project” with Thinker like I can with the base AI.  My old primary strategy (Zak builder and pacifist) is no longer good enough to win, even on Librarian.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 08, 2019, 11:38:00 PM
IMHO, it would serve AI's best interests to tighten up diplomacy. I.e., fight well-known exploits, and teach AIs to better choose their friends and enemies. Though don't know how about benefit/time ratio for these.

Is it possible for predefined units to not grant prototypes?
Diplomacy could be a topic of interest.. I have done some research on it but the code seems a little complicated to modify. It would need some more insight to figure out what all the variables actually do there. But there seems to be much potential for improvement.

Probably there is some way of disallowing prototypes that have not been researched, so is this a feature that is considered generally important?

I’d just be happy at this point if the AI knew how to automate gravship formers correctly.  But I am sure I am in the minority there :)

On a different note, I can no longer find a solution for “get every single Secret Project” with Thinker like I can with the base AI.  My old primary strategy (Zak builder and pacifist) is no longer good enough to win, even on Librarian.
Hmm, interesting. Just think of it, this mod doesn't even grant any artificial production bonuses on top of the default cost ratios in the difficulty levels, unless they are explicitly activated from the config. If we compare this to let's say Civ 3, my main aim was to make Transcend level feel like, maybe not quite, but close to Deity in Civ 3. Maybe we can declare "achievement unlocked" in that aspect.

Gravship formers are certainly a possibility, I've already thought about implementing them, but they feel a little like some late-game esoteric feature.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 09, 2019, 01:54:58 AM
The main problem with gravship formers automation is that the AI thinks they can only alter land when in fact they can alter both land and sea squares.  I’ve been surprised at how poorly they are automated versus other key units I have added such as needlejet colony pods.  Still, there aren’t many games that even see gravships so it’s not much of a priority.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 09, 2019, 02:09:32 AM
Probably there is some way of disallowing prototypes that have not been researched, so is this a feature that is considered generally important?

It's been important to my modding.  Because predefined units give away the prototypes, I adopted a policy of giving out such prototypes "one tech later" than when you could, in principle, make a given unit.  So for instance I have Doctrine: Initiative as a prereq for Doctrine: Air Power.  I can't give out a Cruiser Probe Team until Doctrine: Air Power.  It's annoying.  It makes a big difference later in the game, as Tier 4 vs. Tier 5 techs can be separated by a rather long time in my tree.  Even Tier 2 vs. Tier 3 can take a long time in my tree, because I've pressed so many techs earlier.  My tree is "broad" now.  In your core area of research, Explore Discover Build Conquer, not as many delays, but outside your core, considerable delays.  To the point that some people have noticed it can feel like a tech stagnation game. 

So my $0.02 is yes, this matters.  A lot.

I also increased prototype cost by 200% in my mod.  Originally Tim's idea, but I ran with it.  So getting a Synthmetal Sentinel together is a substantial challenge in my mod now.  If you're really in a pinch, you can blow an Artifact on it.  That'll work.  I actually had to do that in a recent game I played, and I think it was worth it, to overcome the otherwise 10..15 turn delay.

Quote
Gravship formers are certainly a possibility, I've already thought about implementing them, but they feel a little like some late-game esoteric feature.

I don't know where your .exe is at with late game AI terraforming.  For a stock .exe it's a non-issue.  The AI is never going to beat a competent player on Transcend.  The human player will get ahead, the AI is always going to be somewhat behind.  Caveat: the interim periods when I didn't know how to play my own mod yet.  But that passes.  Anyways, I terraform every single square by hand.  Gravships would never be useful to me.  Too late game, I've already done everything needed by then.

The uber technology is the Hovertank Former.  That is very useful for making long rails over fungus or rocks.  One may need to remove fungus to lay a mag tube, depending on one's tech.  You just hover over the fungus instead of wasting a turn moving onto it.  Same things with rocks.  Infantry and Rover chasses lose a turn getting onto the rocks.

Meanwhile on the oceans, Cruiser formers work just fine and will be available way, way earlier than Gravships.  In version 1.27 of my mod I made Gravships available "earlier".  It still doesn't manage to come early, it's a late game thing.  Hovertanks come much earlier too, like midgame, same time as Cruisers.  In fact I have Cruisers and Hovertanks as the prereqs for Needlejets.  That may not be logical from a lore standpoint, but I consider a faster chassis to be an Explore tech.  So they feed the next big deal Explore tech, which is planes.  One could argue for a Ship -> Plane -> Hovertank progression instead, and I wouldn't call it wrong, but I'm doing it the way I'm doing it.

I haven't been able to get the stock AI to use Hovertank Formers.  I tried, but it just wasn't interested in building them.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 09, 2019, 05:15:16 PM
I don't know where your .exe is at with late game AI terraforming.  For a stock .exe it's a non-issue.  The AI is never going to beat a competent player on Transcend.  The human player will get ahead, the AI is always going to be somewhat behind.  Caveat: the interim periods when I didn't know how to play my own mod yet.  But that passes.  Anyways, I terraform every single square by hand.  Gravships would never be useful to me.  Too late game, I've already done everything needed by then.

Stock AI's put up such a bad performance it's not really even a point of discussion. For a long time players used to do things like build-every-secret-project to find some challenge. I used to do that myself sometimes but now it's probably a little bit more challenging (read: have to conquer most of the early game ones).

In the original game they added lots of complex mechanics which the AI was not designed to handle very well. Also, I don't think I would go on increasing prototype costs by such a large margin or even at all. It's probably going to make the game harder for the AIs because it's not well equipped to strategize around those limitations unlike a human player.

The main problem with gravship formers automation is that the AI thinks they can only alter land when in fact they can alter both land and sea squares.  I’ve been surprised at how poorly they are automated versus other key units I have added such as needlejet colony pods.  Still, there aren’t many games that even see gravships so it’s not much of a priority.

Yeah, gravship formers would need some moderate restructuring of the movement code because they can modify both types of squares. So I have to consider that.

It's important to note here that the player's formers still use the default code when they are automated. They could be adjusted pretty easily to use Thinker's code instead, but the problem is that then they should obey the "automation preferences" selected by the user. Do you think we should have them use the new former code instead if the preferences are just followed? Probably it would be a good change.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 09, 2019, 07:16:26 PM
In the original game they added lots of complex mechanics which the AI was not designed to handle very well.

True.  I run into things all the time that the AI doesn't know how to do.  Nowadays I think of them as "human cheats".  I push some of the HCs later in my tech tree, so that by the time they become available, the human will have probably already figured out some way to win anyways.  It's a soft way of taking things out of the game, without strictly removing content from the game.

Quote
Also, I don't think I would go on increasing prototype costs by such a large margin or even at all. It's probably going to make the game harder for the AIs because it's not well equipped to strategize around those limitations unlike a human player.

I have not observed the stock AI having any problem coming up with the more expensive prototypes.  Probably because the AI on Transcend is "cheating" like a mad dog, being given these huge INDUSTRY equivalent bonuses.  Also possibly because I have sufficiently delayed contact between hostile factions, by (expected) map size, extra land mass, and more defense for cities.

I don't know if it's been addressed, but I'd severely like to see the AI actually cash Artifacts to get techs.  And I'd like to see the number of pods that appear on the map be controllable by user input somehow.  They can so easily turn the game into just candy.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 10, 2019, 07:14:36 PM
Yeah, gravship formers would need some moderate restructuring of the movement code because they can modify both types of squares. So I have to consider that.

It's important to note here that the player's formers still use the default code when they are automated. They could be adjusted pretty easily to use Thinker's code instead, but the problem is that then they should obey the "automation preferences" selected by the user. Do you think we should have them use the new former code instead if the preferences are just followed? Probably it would be a good change.

That’s a great question.  So long as user preferences are followed, yes, I would agree that any units automated by the user (not just formers) should use the same code as the AI.  I know that that means the player automated units will now be stronger, which flies in the face of what Thinker is about, but not having player AI be the same as other factions’ AI seems a bit unfair.

On a related note: you may also want to look at sea and gravship crawlers.  So far, whenever I automate sea crawlers they want to explore rather than harvest. I presume gravships would do the same but haven’t tried them yet.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 10, 2019, 08:08:01 PM
I know that that means the player automated units will now be stronger, which flies in the face of what Thinker is about,

Not really.  Even if Induktio has come up with "better" terraforming AI, it will never, ever be as good as a human terraforming every tile manually.  If you automate them, it's suboptimal.  That's your choice as a player.  Induktio could make it less suboptimal, but he wouldn't be giving an advantage to the human.  The human already has the ultimate advantage of being able to do it all manually.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 11, 2019, 01:52:08 AM
True, but I was talking relatively.  Now, automated player formers are inferior to AI ones.  Changing to the improved code would put them on par with each other.  Of course, direct control is superior to either.

Moving player automated formers to the new code will make the player stronger, if the player was going to automate in either case.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 11, 2019, 07:54:44 AM
As for the optimal strategy, good luck with that. ;b; Humans weren't able to calculate optimal strategy for Go either despite thinking for a couple of millenia.

Anyway, sea crawlers are not currently implemented. So whether behaviour they were doing is the result of the standard movement code which probably means the AI doesn't understand how to use them. Have to keep that in mind too.

I think, overall, having player's formers use the same code than the AI ones would make the game feel more consistent, since then the two types of formers wouldn't operate in a vastly different way.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 11, 2019, 07:28:42 PM
As for the optimal strategy, good luck with that. ;b; Humans weren't able to calculate optimal strategy for Go either despite thinking for a couple of millenia.

I think near optimal strategy for terraforming is quite a bit less complicated than that.  It is mostly a minigame about leveling up squares.  Better vs. worse sequences of square improvements for a single city over a short period of time are fairly easily to determine.  That's how we all manage to do it manually.  Long term?  Well, war is hell.  Not really important to crystal ball too far into the future.

Optimal sequences of connecting roads and rails is more involved.

Quote
Anyway, sea crawlers are not currently implemented. So whether behaviour they were doing is the result of the standard movement code which probably means the AI doesn't understand how to use them.

AI sea terraforming is not incompetent.  It just overemphasizes minerals instead of energy.  It will even raise the ocean floor if you have the tech to do so and allow it to happen.

Quote
I think, overall, having player's formers use the same code than the AI ones would make the game feel more consistent, since then the two types of formers wouldn't operate in a vastly different way.

In principle it's a perfectly reasonable and obvious thing to do.  In practice, you may have a transitional period where you invent new bugs and misbehaviors.  Then someone might wish for that "dumb" original code.  Especially irritating in other games, is anything that gets a Former gratuitously killed.  Like moving the units right into the path of oncoming enemies, or failing to stop work and retreat.

Title: Re: SMACX Thinker Mod
Post by: BFG on February 12, 2019, 12:10:32 AM
AI sea terraforming is not incompetent.  It just overemphasizes minerals instead of energy.  It will even raise the ocean floor if you have the tech to do so and allow it to happen.
We were talking about crawlers there, not formers.  Sea crawlers are not implemented at all, and gravship crawlers poorly.

Quote
In principle it's a perfectly reasonable and obvious thing to do.  In practice, you may have a transitional period where you invent new bugs and misbehaviors.  Then someone might wish for that "dumb" original code.  Especially irritating in other games, is anything that gets a Former gratuitously killed.  Like moving the units right into the path of oncoming enemies, or failing to stop work and retreat.
True, though there are rare situations where you don’t want the formers to retreat...to buy you that last turn on a new defensive unit for an exposed colony, for example.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 12, 2019, 02:17:21 AM
Oddly enough, Needlejet Supply works.  Although, it seems only for the AI.  I got rid of Copters in my mod.  I replaced the Unity Chopper with a Supply Needlejet, so that it can't attack anything.  I wanted to use a Transport module but it was too slow.  The Supply module doesn't have that problem.  So, the AI can gain one of these from the Unity crash site, or occasionally from popping a pod.  I was quite surprised to see the AI put them over a square somewhere and convoy resources indefinitely.  When the AI uses them, they stay aloft indefinitely, never leaving the square they're convoying from.  When I use them, they crash and burn in short order!

I don't think they go for optimal squares.  Like seeking out a Nutrient or some such.  They just seem to pick something and stick to it.

I can't remember if I've tried adding a sea crawler to the predefined units.  Guess I can try it now.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 13, 2019, 12:53:24 PM
Had an interesting idea recently. I guess most players remember how later Civ games introduced the rule that units cannot use the roads in the enemy/non-allied territory?

It seems the same rule could be implemented quite easily in SMAC by changing the movement cost function. In the gameplay it could be a pretty big change, but I think it would make more sense especially after the introduction of mag tubes. It would also have to be decided how this rule would apply on native units on fungus or any faction with the Xenoempathy dome project. Native units could become relatively more valuable if they were able to use fungus as roads even in enemy territory.

This rule could make land-based probe actions a little harder but I'm not sure if that's a negative thing at all. Basically any kind of new rule could be implemented if the movement cost function is rewritten.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 14, 2019, 12:27:49 AM
That is indeed an interesting idea, but I have to admit, I'm generally not in favor of adding new gameplay rules / tweaks that are outside the bounds of what could happen within the vanilla game.  I'd rather focus on improving the AI / behavior of what's already there.

I could certainly see that becoming an option in Yitzi's patch, however.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 14, 2019, 01:21:46 AM
Yeah, there is indeed an argument against changing game mechanics in a significant extent due to the way players are used to playing this game. There's a bunch of ideas that could be implemented, but at this point of development it's kinda unlikely I would add many drastic changes to the game mechanics. At least if stuff like this gets added it should have a configuration option. AI improvement is still the main goal here anyway.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on February 14, 2019, 05:47:18 AM
+1 for road movement rule experiment. Fungus movement unchanged.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 14, 2019, 10:18:34 AM
-1.  You will split the rather small player base into different groups.  Whatever is the default will get testing coverage.  Whatever is not the default, won't get the coverage.  In the less tested group, in the real world there will be bugs aplenty.  I say this having played Freeciv for many years.

What you're proposing is known as "mission creep" in industry.  It may be a sign that you're getting bored of the project you're working on and really want to do something else.  With your programming skills, I would strongly encourage you to work on a new 4X TBS game, that you personally can make money from.  Rather than trying to turn SMAC into something other than what it is, as though messing with a  binary is an easy thing to keep bug free.

There are wild bugs in the pathfinding already.  Units that just go in nonsensical directions because borders and enemy units are in the way.  Particularly in the case of non-combat units.  When someone proposes to really tear up the behavior of the pathfinding code, I say gee, what can possibly go wrong?
Title: Re: SMACX Thinker Mod
Post by: dino on February 15, 2019, 07:14:15 AM
Magtubes allow to snowball through enemy picking with overwhelming force severeal bases one by one in a single turn, so at least a rule to treat magtubes as roads on enemy territory should help AI with defense.
Not being able to use enemy magtubes also makes sense from simulationist pow.
With roads, I'd consider making them cost 1/2 movement points on enemy territory, not being able to use them at all would be too much of gimp for assault forces.

Depends, how much it'd take to do and how much you like this feature, you can be the only judge. I'd certainly try it if it was made.
The mod is singleplayer focused, as long as it's optional no consensus among the players is necessary imo.
If we were concerned about "fracturing community", than by this logic no one should make any txt rules editing either.


The other modding feature, that could be really useful in improving game balance, would an option to change [1,2,3,4] reactor constants in unit hit points and cost formulas.
Both are already identified in the code, so unless it's impossible to use floats as these exponent values, should be doable.

I'd suggest just implementing two separate tables of four values for cost and HP, configurable in thinker.ini
There is no way you would reach consensus about these formulas and yet most experienced players would like them adjusted, so making it completely configurable is the only way.
I personally, if given such a feature, as first experiment would make reactor reduce unit cost, but by a smaller factor and remove HP increase completely.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 15, 2019, 08:20:35 AM
(https://i.telegraph.co.uk/multimedia/archive/01505/mission-accomplish_1505293i.jpg)

There has been some tragic examples of calling the mission accomplished too early on... But in all seriousness, the majority of stuff that will get added in this mod is already done. It probably wont become one of those "forever" projects until I move on to something else.

I agree how the magtubes provide excessive bonuses for the attackers as they are currently implemented. This is not mentioned in the docs, but currently Thinker does not build any magtubes on its territory precisely for that reason. Magtubes don't provide any particular economic benefits either. About the feasibility of that reactor modding, it might be kind of hard to do when the reactor values are referenced hundreds of times in the game binary. It's probably a lot easier to change the movement cost function.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 15, 2019, 01:32:35 PM
Not being able to use enemy magtubes also makes sense from simulationist pow.

It doesn't make any sense at all.  What would Lawrence of Arabia do?  Blow up Turkish railways, because he can freely move there.  Why not deny the use of roads entirely?  Because roads are roads, they are not turrets or troops.  Roads are what you fight over, they do not defend themselves.  Why not deny movement over enemy terrain entirely?  Because the ground doesn't magically inflict pain upon enemy troops, unless it's Elvish fantasy root grabbing stuff, a Russian winter, or an African disease.

Mag tubes are definitely overpowered, but artificial limits on the ability to use them is a cheap shot.  Nobody's empire has an expenditure for "implicit defense", representing some kind of intangible of fortifications spread everywhere.  This is a game where you move all of your military units one by one.

Some games have taken the approach of a rail allowing faster movement than a road, but it still costs movement points.  I don't have an opinion on the enjoyability of that as a game mechanic.  Call To Power 2 may have done that, but it's been eons since I played that game and I have no clear memory of it.  My concern is, SMAC is tedious enough to win already.  Making long distance map movement even more difficult than it already is, strikes me as heading towards The Very Dull.

Some games don't allow terrain improvements to be built on your same turn.  This prevents a rail from appearing instantly, without the AI having any chance to react to it.  However it also burdens the player with a lot more planning and mouseclicking.  There's a very basic challenge vs. usability tradeoff here.

I am pretty sure Freeciv has that "no instant improvements" mechanic.  All you really end up doing is putting a good piece of armor at the tip of your rail head, like a Mechanized Infantry.  You may be slightly slowed down by having to drive your Howitzers over roads, only knocking off a "front" of cities instead of all of them.  It doesn't greatly change the human ability to wipe the AI out. 

Title: Re: SMACX Thinker Mod
Post by: dino on February 16, 2019, 12:55:33 AM
Steam/Diesel locomotive carries it's own source of energy. You can cut power from magtube, sabotage electric grid. We can also imagine whole infrastructure being automated / remotely controlled.

Being able to use enemy infrastructure and potentially strike any city connected to tube network deep into enemy territory is not realistic.
Unit in transport is vulnerable and not combat ready, you can't just uninterrupted carry your army on a train up to enemy gates even now.

Half, or third of a road movement cost, instead of infinite range would be nice too.

Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 16, 2019, 03:19:42 AM
Being able to use enemy infrastructure and potentially strike any city connected to tube network deep into enemy territory is not realistic.

Look, roads were great for Rome projecting force outwards, but they were also great for enemies swarming inwards.  "All roads lead to Rome."

Quote
Unit in transport is vulnerable and not combat ready, you can't just uninterrupted carry your army on a train up to enemy gates even now.

"Instantaneous" travel is not realistic for us now.  But if you accept that as a basic part of the game on its timescale, then the tactical consequences are realistic.  The US Civil War for instance saw a great speeding up of troop movements compared to previous eras of combat.

The "interruption" problem is basic to IGOUGO game mechanics.  If you want realistic interruption, you have to use finer and finer grained timespans to do the simulation.  If you're not willing to simulate by the hour or even the minute, then you have to accept that something is not realistic.

Lacking realism, one worries about whether systems are game mechanically fair, and whether they are cumbersome.  These virtues and vices cannot necessarily be satisfied at the same time.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 16, 2019, 02:11:24 PM
Those bigger features might need a little more evaluating before implementation.

Anyway, today develop version 20190216 is available from the downloads (https://github.com/induktio/thinker/) with a couple of other changes:

- New parameter: cost_factor allows one to change AI production bonuses
- New parameter: max_satellites specifies how many of them AI will build normally
- Config file format reorganized
- AI now sometimes nerve staples bases after UN charter has been repealed
- Possible to select custom factions in smac_only mod
- Command line parameter -smac added

I estimate that nerve stapling can have a big impact on AI bases if the charter gets repealed. Funnily enough, you will get a message each time AI staples one of its bases. Post here any observations on how this will affect the game balance.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 16, 2019, 06:08:57 PM
Thanks for your continued work!  It has to be rather tedious on such an old game.

Did I catch that the AI will not build mag tubes?  I know they are OPd but personally I don’t like blocking things the AI is supposed to have access to.  Is there anything else in that category?  Is there a complete list of changes somewhere?
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 17, 2019, 02:29:39 PM
Complete list of what kind of changes exactly? Maybe source code... Thinker doesn't build every single thing that is available, e.g. mag tubes, bunkers and echelon mirrors are some of the things that are not built. Hard to find good use cases for those, although mag tubes could be implemented, but then I certainly wouldn't want the formers building them on every possible square. It would have to be more selective in some way.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 17, 2019, 11:30:00 PM
Personally I would prefer if it could build those, IF doing so would further strengthen the AI competitiveness.  I’m sure it’s a lot harder to implement than it sounds, but perhaps the AI could start building some of those when it would otherwise run out of instructions to execute.

I don’t mind if the AI is able to build overpowered improvements, is what I am trying to say.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 18, 2019, 06:21:20 PM
Not building Bunkers is an extremely good call.  In my own mod, I've disabled Bunkers entirely.  All they provide is a ready invasion route for the human player.  They are of no tactical value to the AI at all, they are a liability.  I don't really know what the original authors were thinking, implementing that.  I believe they were not thinking, or rather, not playtesting enough.

In my mod, mag tubes are available rather early.  It's a Tier 2 tech, you are expected to get it at the beginning of the game.  To actually build a meaningful mag tube network, takes a lot of Formers though.  I find there are many competing needs for quite awhile, even potentially to midgame, depending on your circumstances.  I have the bias of assuming a Huge map with deliberate extra land mass, to give AIs room to grow real empires.  YMMV if you are playing Standard maps that are more like island water worlds.

The stock AI builds acceptable if somewhat wasteful mag tube systems on the maps that I've given it.  I seriously doubt the AI makes good tactical use of such systems.  Rather, they end up being networks for me to use in my conquest.  The stock AI mainly just builds large numbers of units that mill around between cities, as though they're afraid someone's gonna sneak up on them, and that defense by lotsa trip wires in the field is a good idea.  It isn't.  Conquering the stock AI is mostly about whacking a city, watching lots of units going out of support due to loss of minerals, and cleaning up after collapse.  A proper AI would use a mag tube as a combat spearhead, the way I use it against the AI.

I consider roads and mag tubes to be Conquer technologies.  My tech tree is weighted accordingly.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 18, 2019, 11:11:35 PM
What’s your opinion on Echelon Mirrors, out of curiosity?
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 19, 2019, 06:20:05 AM
In general, that it's a dumb game mechanic.  You stress about where to place these things "perfectly" in order to get some kind of bonus.  The randomly generated terrain never gives you a natural perfect layout.  What I actually do, is plant all my forests on flat terrain that's devoid of minerals.  And I plant my farms with solar collectors on rolling terrain so that they all get +1 mineral.  I think that's 2-1-2 most of the time, and ok for an early game tile.

I manually terraform everything.  Around midgame, I've probably finished doing all those farms.  Tree Farms are starting to become available.  If there's any rolling, moist terrain I haven't finished up yet, just sticking a tree on it is starting to look like a better idea.  Tree farms aren't just for happiness, money, and minerals.  Every square of forest, also staves off global warming some.  Planting more and more trees helps you.

In midgame I've probably had a war concern.  I've probably built a mag tube to someone's front door and invaded something.  Fighting wars is a major distraction from tooling around with Echelon Mirrors.  I think it is a piece of gratuitous content, in search of a real need to use it.  I think I've actually Drilled To Aquifer more than I've bothered with Echelon Mirrors, and [Q] is a truly obscure command.  I think that has tended to happen more on my Enormous maps, where I'm not in ready contact with enemies.  On Huge maps, by midgame I'm probably invading someone somewhere.

So let's say that despite every other demand on my attention, I actually get around to placing Echelon Mirrors.  Where will they go?  Well, I look for natural clusters of solar collectors, where I've already built them.  I don't like tearing up existing terrain to do this.  Consequently, there don't end up being all that many natural Echelon Mirror spots.  It's all random, and I developed what was there.

I don't believe in raising altitude either.  All it does in my experience, is mess up my weather patterns.  What's the point of working all these farms, only to have them suddenly go Arid?  Thanks for nothing.  I'd rather just keep working with what I've got, and not have it all fry as land gets raised.

Some people build high altitude energy parks and then put lots of supply crawlers on them.  I say, why not get all the energy from the oceans?  It's cheap and plentiful out there.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 19, 2019, 08:11:48 AM
The main use for echelon mirrors is really to build an energy park for the super science city, otherwise there's not much use for them. The way to get most energy is to build alternating rows of solar/echelon at max altitude, but the problem is usually finding enough terrain that is high enough. Usually the land raising part tends to make it not worth it, but at maximum each solar panel could yield around 10 energy which can be crawled.

Then if we look at this from the AI perspective, coding a behaviour like this would get pretty complicated since it requires so much coordination from multiple different units. The AI would need to preallocate terrain for the energy park and not build any bases there, etc. Things like that seem to make implementing land-based energy parks not worth it. There are also many other easier things to add to the AI.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on February 19, 2019, 11:27:52 AM
Things aren't helped by the fact that nearby forests do spread into echelon tiles, and then mirrors (unlike boreholes) stop working.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 23, 2019, 06:20:45 PM
Interesting. I didn’t realize that regarding echelon mirrors and forests.  Probably yet another bug or at least an oversight.

On a different topic, I have been testing various base units to see which can boost AI and which are useless.  I would be interested to hear thoughts or feedback.

Significant boost:
Needlejet Colony Pod (or any Aero Pod)
Probe Foil

Small boost:
Gravship Formers (AI can only use on land)
XX Missile (Not sure it’s better than vanilla missiles)
Aero Transports

No boost / detrimental:
Supply Foil (AI doesn’t know how to use)

To test:
Gravship Supply
Enhanced probes and various other enhanced units
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 23, 2019, 07:59:45 PM
Significant boost:
Needlejet Colony Pod (or any Aero Pod)

My testing said the stock AI would build them but not use them.  Do you have different results from that?  Or are you testing Thinker Mod's AI.

Quote
Probe Foil

If you provide this as a predefined unit, the stock AI will go after sea bases with these.  It's bad enough that I often refrain from building sea bases early on, since they're likely to get mind controlled before I can do anything to protect them.  However I can't see how this significantly boosts the AI in any way.  Rather, it annoys me.  I'm ok with that because I think it's fair, I've abused the AI with my own foil probe teams for years.
Title: Re: SMACX Thinker Mod
Post by: BFG on February 23, 2019, 09:40:34 PM
My testing said the stock AI would build them but not use them.  Do you have different results from that?  Or are you testing Thinker Mod's AI.
I was talking about Thinker, but I'll admit my testing on this one wasn't as good as it should be.  I was going off the computer's ability to successfully automate the unit and find a good base square, and how they're handled when they're the only colony in Scenarios.  I'll try an actual game scenario and see.

Quote
If you provide this as a predefined unit, the stock AI will go after sea bases with these.  It's bad enough that I often refrain from building sea bases early on, since they're likely to get mind controlled before I can do anything to protect them.  However I can't see how this significantly boosts the AI in any way.  Rather, it annoys me.  I'm ok with that because I think it's fair, I've abused the AI with my own foil probe teams for years.
Oh yes, these annoy the crap out of me too.  I've lost at least one Thinker game as Zak due to getting hit by a fleet of these.  From Deirdre of all people.  But they do strengthen the AI, which is a big part of the goal here!
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 25, 2019, 09:47:50 AM
> On a different topic, I have been testing various base units to see which can boost AI and which are useless.  I would be interested to hear thoughts or feedback.

> Probe Foil
> Enhanced probes and various other enhanced units

These have already been implemented by the design_units feature long time ago. It builds armored/foil probes and AAA garrisons when the proper techs are available. It's always possible to add new unit combos to boost the AI capabilities though.

> Needlejet Colony Pod (or any Aero Pod)
> Gravship Formers (AI can only use on land)
> XX Missile (Not sure it’s better than vanilla missiles)
> Aero Transports
> Supply Foil (AI doesn’t know how to use)
> Gravship Supply

These types of units are not currently implemented in Thinker, e.g. it does not provide any notable behaviour beyond the standard AI logic. I'm also evaluating which ones of these could be implemented in the next version. It does look like some of them could be helpful but we'll see later which ones will be implemented.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on February 28, 2019, 08:11:23 PM
I may have found a bug in Thinker mod's unit design stuff.

In my SMACX AI Growth mod I do not allow ECM or Hypnotic Trance on probe team units.  I figure that armored probe teams are already enough of an exploit.  Consider how easy it is to make an Elite probe team unit, as they get PROBE bonuses, MORALE bonuses, and whatever increases in base probe team morale that various techs give.  Incidentally, I also eliminated increases in base probe team morale, because they're clearly overpowered as the game goes on.  It's like exploit city and in my mod I've reined all that in.

So I was quite surprised to see the AI make an armored hovertank probe team unit with Trance capability.  I checked my design changelog and indeed, I did eliminate this, it wasn't some mistake in the flags I set.  In my alphax.txt the flags are:
Code: [Select]

; Flags  =
;          000000000001 = Allowed for Land units
;          000000000010 = Allowed for Sea units
;          000000000100 = Allowed for Air units
;          000000001000 = Allowed for Combat units
;          000000010000 = Allowed for Terraformer units
;          000000100000 = Allowed for Noncombat units (non-terraformer)
;          000001000000 = Not allowed for probe teams
;          000010000000 = Not allowed for psi units
;
Hypnotic Trance,       1, CentEmp, Trance, 000011111111, +50% defense vs. Psi

Another possibility is Thinker is exposing a bug that was already in the game's code.  But the stock AI has never designed a hovertank probe team unit, so I've never observed it before.

Adding a Fusion reactor into the mix might be relevant as well.  I know that Scient's patch allows a reactor type to be specified for a predefined unit.  I don't do that in my mod, nor do I use Scient's patch.  My point is the Scient patch may have changed the flag behavior somehow.

The importance to my current game, is Morgan is dominating with all those nice thermal boreholes.  I'm dead last, and he's sending these Trance hovertank probe teams at me.  Fortunately I built the Hunter-Seeker Algorithm, just barely before he and others were going to.  But if it weren't for that, I'd have a real problem.  Mindworms are my armored probe team antidote, since they aren't affected by probes and regular armor doesn't matter to them.  I do allow probe teams to have 3-Res armor, for lack of any way to prevent it, and I think that's all the anti-mindworm buff a probe team should have.  I don't want invincible probe teams in my mod.

probe teams should not have Trance capability
probe teams should not have Trance capability

Note the unkillability.

armor determines probe team combat
armor determines probe team combat

I can't take it out with a probe team either.  Note that I have an Elite probe team vs. his Disciplined team.  Note that I'm using an infantry chassis probe team, to avoid the enemy getting any bonus from his 3-Pulse armor.  Finally note that I'm the Data Angels.  In my mod, they get the usual +2 PROBE bonus, and no other factions get any PROBE bonus at all.  Furthermore in my mod, the only ways to get a PROBE bonus from social engineering are +1 for Power and +2 for Thought Control.  I've chosen Power so I have +3 PROBE.  Now, maybe that just raises my probe team morale, I forget.  The point is, I'm the baddest ass probe team faction that anyone can possibly be in this game, no one else has my advantages, and I still can't even crack these things.  They are invulnerable in probe-to-probe combat, because you can't add a weapon to a probe team to counteract the armor!

Sorta forgot that he's got a Fusion engine and I'm attacking with Fission, but I still think I should be doing better.  I'll try throwing a few units at it to check...

It's quite an exploit.  I did choose to teach the AI to use this exploit, by providing a 3-Pulse Speeder Probe Team predefined unit.  I figure if the player can do it, why not let the AI do it too.  I wouldn't mind changing the game so that probe team armor is not allowed.  However there's no way to do that by .txt modding the stock game.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 01, 2019, 04:58:43 AM
I'm not seeing a way to delete my posts, so I'm reusing this slot for another possible bug.

In my mod, as in the stock game, the compulsion of the Cybernetic Consciousness is to choose Cybernetic Future Society.  Nevertheless, I check on my ally in my current Thinker test game, and I see they've chosen Thought Control!  I've never seen that happen before.

Cyborgs that do not believe in Cybernetic
Cyborgs that do not believe in Cybernetic

My compulsion line in cyborg.txt is a little different from the stock game.  Instead of:
Code: [Select]
  Future Society, Cybernetic, GROWTHI have:
Code: [Select]
  Future Society, Cybernetic, RESEARCHI have no idea if that would make any difference, but that there is a difference, is worth mentioning.




Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 01, 2019, 06:49:31 AM
I'm reusing another one of my undeleteable thread slots for the same bug.  This time it's Deirdre!  Why the heck is she Socialist?  (My version of Planned.)

Gaians who are not Green
Gaians who are not Green

Both the stock game and my mod have the same compulsion line:
Code: [Select]
  Economics, Green, PLANET
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 01, 2019, 06:50:37 AM
Oops, sorry, had multiple tabs open in my browser and posted some AAR stuff in the wrong place.  I've replaced those errant posts with a bug report.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 01, 2019, 10:10:50 AM
So I was quite surprised to see the AI make an armored hovertank probe team unit with Trance capability.  I checked my design changelog and indeed, I did eliminate this, it wasn't some mistake in the flags I set.  In my alphax.txt the flags are:

Another possibility is Thinker is exposing a bug that was already in the game's code.  But the stock AI has never designed a hovertank probe team unit, so I've never observed it before.

Adding a Fusion reactor into the mix might be relevant as well.  I know that Scient's patch allows a reactor type to be specified for a predefined unit.  I don't do that in my mod, nor do I use Scient's patch.  My point is the Scient patch may have changed the flag behavior somehow.

The importance to my current game, is Morgan is dominating with all those nice thermal boreholes.  I'm dead last, and he's sending these Trance hovertank probe teams at me.  Fortunately I built the Hunter-Seeker Algorithm, just barely before he and others were going to.  But if it weren't for that, I'd have a real problem.  Mindworms are my armored probe team antidote, since they aren't affected by probes and regular armor doesn't matter to them.  I do allow probe teams to have 3-Res armor, for lack of any way to prevent it, and I think that's all the anti-mindworm buff a probe team should have.  I don't want invincible probe teams in my mod.

So yeah, that marvelous piece of engineering was indeed created by Thinker's design_units feature. And that's not even the end of story. When it gains more techs, it will upgrade both the armor and the reactor. And also add Algo Enhancement when it's available. Thinker calls Smacx's native propose_proto function to create those prototypes, but the problem with those abilities looks like this function does not do any checks if the rules allow the ability for the unit. So that looks like an oversight. Probably should rewrite some parts of that code.

What those lopsided combat odds really reflect is the overpowered value of fusion vs. fission reactors ("Power" number). Anyone fighting with obsolete reactors is at a huge disadvantage. It would be nice to mod those reactor values but the last time I checked, they were hardcoded in the binary in so many places it's difficult to change them.

In my mod, as in the stock game, the compulsion of the Cybernetic Consciousness is to choose Cybernetic Future Society.  Nevertheless, I check on my ally in my current Thinker test game, and I see they've chosen Thought Control!  I've never seen that happen before.

My compulsion line in cyborg.txt is a little different from the stock game.  Instead of:
Code: [Select]
  Future Society, Cybernetic, GROWTHI have:
Code: [Select]
  Future Society, Cybernetic, RESEARCHI have no idea if that would make any difference, but that there is a difference, is worth mentioning.

That one is intended behaviour. New social_ai decides what society models they will run and the old code has been replaced. They are not allowed to select social opposition models, but currently the social preference category does not get any specific priority either. I could maybe increase that priority but I'd rather avoid situations where the AI's always choose one model regardless of other considerations. Now it has some situational awereness, where if the AI has enemy factions closeby, it will prioritize POLICE, MORALE, and PROBE more, among other effects.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 01, 2019, 10:46:18 AM
Thinker calls Smacx's native propose_proto function to create those prototypes, but the problem with those abilities looks like this function does not do any checks if the rules allow the ability for the unit.

Well that solves a mystery at least.

Quote
New social_ai decides what society models they will run and the old code has been replaced. They are not allowed to select social opposition models, but currently the social preference category does not get any specific priority either.

This isn't good from a character narrative perspective.  Deirdre could chew you out about not being Green, when she herself could be the very Planned or Free Market economy she's railing against!

It's also not necessarily good from a game political perspective.  The original 7 factions were carefully positioned to be at each others' throats in various balanced and predictable ways.  Possibly similar with the 7 factions in the expansion, by themselves at least.  Now, randomly combine any / all of them, and social choices definitely slant one way or another.  Player makes choices like, "No one will get pissed about my Politics this game.  Free ride."

So, I've modded to get rid of "weak" factions.  There's nothing like a stock Morgan in my mod, he's much tougher because he's got piles of instant money.  No SUPPORT penalty either.  Most of my factions are supposed to be retaining their original character, i.e Morgan builds.

Some of the social engineering choices weren't championed by anyone, so I changed that.  The Pirates champion Wealth.  The Data Angels champion Thought Control.  The Believers champion nothing!  Only faction that has complete free will like that.  The Cult of Planet takes over the championing of Fundamentalist.  Marr goes for Power because he is a Conqueror, and Svensgaard isn't doing it anymore.

Lots and lots of playtesting to balance these.   Don't really want the factions or the techs to be genericized, with some kind of "one true borehole" path through the game.  It makes TOTAL SENSE for Morgan and is TOTAL ANATHEMA for Deirdre.

Some of the factions, they retain a secondary compulsion, i.e. ECONOMY for Morgan, PLANET for Deirdre.  Other factions, in my mod they don't have a secondary compulsion.  It's a limiter, it straitjackets their choices in the social engineering table.  I made a lucky find, that setting this to Nil, gives the stock AI more choices.  And that the stock AI will actually make those choices!

I only want them limited if it's totally to the faction's advantage, and also true to their narrative personality.  So yes, it's ok if Zhakarov fixates on RESEARCH.  Desired, even.  Cha Dawn, however, I do not require to fixate on PLANET.  He's already got +2 PLANET, maybe the AI will decide that's enough?  Maybe he's like a televangelist, completely cynical.  Will damage the planet with Capitalism to keep his mindworms well funded.  Dishonesty in cults and religions is a thing!

Quote
I could maybe increase that priority but I'd rather avoid situations where the AI's always choose one model regardless of other considerations. Now it has some situational awereness, where if the AI has enemy factions closeby, it will prioritize POLICE, MORALE, and PROBE more, among other effects.

My view is, the .txt modder should be deciding what's constrained about a faction and what isn't.  That's what makes a faction a faction.  But to the extent that constraints are relaxed, the AI should be doing whatever it thinks best.  I've changed things around so that Chairman Yang can end up with a Capitalist Police State, even with the stock binary.  Yes the AI actually chooses that, no new code!  Or he may choose something else.  Point is, Capitalist Police State is modern China.  It's a thing.

One thing I would like all factions to do, regardless of orientation, is spread better at the beginning of the game.  Not do stupid things with colony pods.  With the stock binary, I and others noticed that an Explore focus seems to trigger better early empire growth.  Don't know why, only that it does.  Hence how I got the name, "AI Growth mod".  The Explore trigger wasn't an original idea, it was something I found in the forum archives.

Title: Re: SMACX Thinker Mod
Post by: Induktio on March 01, 2019, 12:12:40 PM
Lots and lots of playtesting to balance these.   Don't really want the factions or the techs to be genericized, with some kind of "one true borehole" path through the game.  It makes TOTAL SENSE for Morgan and is TOTAL ANATHEMA for Deirdre.

Some of the factions, they retain a secondary compulsion, i.e. ECONOMY for Morgan, PLANET for Deirdre.  Other factions, in my mod they don't have a secondary compulsion.  It's a limiter, it straitjackets their choices in the social engineering table.  I made a lucky find, that setting this to Nil, gives the stock AI more choices.  And that the stock AI will actually make those choices!

The thing here is that playing according to some narrative doesn't appear from nowhere, instead somebody has to code very specific rules how that should be handled. And often in the stock game there are situations where playing strictly according to a factions narrative, e.g. using only their prioritized social settings, results in inferior play. The dilemma didn't rise earlier with borehole building because the AI basically never built them anyway. Sea level rise wasn't really relevant when the AI had such poor production etc. Like if one AI is planet friendly, should it stop borehole building altogether? How is it going to deal with the disadvantage in production vs the other factions then? Possibly they could have a reduced amount of borehole construction for the sake of the narrative but not sure how well they would do.

The social_ai formula is still a work in progress, it will probably receive tweaks to the scoring system. But people shouldn't expect the choices to be exactly similar to the stock AI's choices because there will probably be significant differences.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 01, 2019, 01:55:59 PM
I think I now remember an issue that came up during testing the social_ai feature. If we look at Gaian faction file for example, it has these lines:
Quote
  Economics, Green, PLANET
  Economics, Free Market, nil

The last values on each line are supposed to be the social priority and opposition effects, in that order. In the actual data structure, these values are always -1 which is an undefined value. It probably means the rules parser ignores these two values and they have no actual effect on the AIs. These values are also mentioned here: http://alphacentauri2.info/wiki/Faction.txt_editing_guide (http://alphacentauri2.info/wiki/Faction.txt_editing_guide)

Scient might know more about this since he contributed to the guide but don't know when he's going to release the decompiled code. 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.

Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 01, 2019, 06:44:34 PM
And often in the stock game there are situations where playing strictly according to a factions narrative, e.g. using only their prioritized social settings, results in inferior play.

That's why I sat around for 10 months rebalancing factions to make them superior again.  My Gaians aren't weak, they kick ass.  They have free Biology labs.  I had to give Zhakarov free Biology Labs and Network Nodes, because he really wasn't tough enough in the face of escalating competition between all my rebalanced factions.  And he doesn't have any PROBE penalty anymore, nor any unhappiness every 4 citizens.  All of that was necessary, partly because the Discover part of the tech tree doesn't give any weapons anymore.  You can't count on the University being the guy with the Chaos gun now.  Nor the Hunter-Seeker Algorithm.  Nor are the Gaians the ones with the Missiles now.  Nor do the Morganites have the Silksteel Armor.

I don't want your AI to try to adjust every flaw of the game.  Other modders deal with that stuff. 

You can't anticipate every balance issue that arises with mods.  Yes, you can focus on the stock factions and alphax.txt rules.  Please don't.  Not in ways that mess up what other modders are doing in their mods.  There's a difference between being compatible and having an interface boundary with other mods, and thinking you personally are supposed to solve every problem yourself, with Thinker mod as some kind of standalone ultra-competent game experience.

Many of us like SMAC, and still talk about it and recommend it to others 20 years later, because of the narrative and world building.  I mean, that's why /r/4Xgaming actually gives me the most downloads, because people over there still have collective memory and still care.  Nobody, literally nobody, has done anything remotely close to SMAC in the narrative dept.  It's still the exemplar.

Stepping on that in the interest of gameplay, is not a feature for some of us.  Yes we want to be more challenged, because we are bored.  But for many of us, we don't want the Gaians to be turned into the Morganites, or really every faction to be the Morganites.  If we wanted that, we could play with Randomize Faction Personalities, or just start a game with 7 Morganites!

I think it's notable that Pandora happened, and didn't get traction, very exactly because they didn't really bother with all the narrative and world building stuff.  I'm told they eventually achieved a somewhat modern AI, due to some uber-modder's work.  Sort of like you, Induktio, you could have easily been that guy.  Going that road, Pandora's your endgame.

Quote
Sea level rise wasn't really relevant when the AI had such poor production etc.

Actually it is still not relevant.  I have proven in the other thread, that the game is cheating on AI eco-damage.  3X difference compared to a human playing the same faction!  There's a reason I've never adopted the play style you've implemented for the AIs.  I'd get slaughtered by mindworms doing that.  The whole world would end in a dripping wet mindworm apocalypse.

I hope you decide to make it relevant, i.e. make the AI play by the same eco-damage rules as a human player.

Quote
Like if one AI is planet friendly, should it stop borehole building altogether?

I'd go so far as to say, the Gaians should never be allowed to build a borehole at all.  If that was a modding feature, prohibiting some particular action, I'd be all for it.

In contrast, the Cult of Planet would build the most boreholes.  They're complete jerks.  They'll tell you anything, long as they get you indoctrinated into the cult.  Anyone remember In God We Trust with Marty Feldman, and the Church of Divine Profit?  That's Cha Dawn!  Or at least, that's how I imagine Cha Dawn in my mod, certainly a direction they can be going in.  Deirdre is absolutely earnest.  Cha Dawn could easily be a big fat liar.

Quote
How is it going to deal with the disadvantage in production vs the other factions then?

In an ideal world, the Spartans would deal with it by invading.  The Peacekeepers would deal with it by turtling up, growing population, and voting.  The Gaians would make mindworms and attack -3 PLANET factions.  The University would turtle up and research.

Yeah, that's all much more AI than just cranking up the condenser, crawler, and borehole production.  I have no idea how much more, or what the stock AI already did.  I've adjusted as much as I could at the .txt mod level, giving the few AI inputs I was allowed to give.  Some of those did help, so I know that the stock AI isn't a complete dunce at differentiating play styles, as a matter of faction input.  The original designers did try to do this, it's only a question of how successful they were.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 01, 2019, 07:09:42 PM
It probably means the rules parser ignores these two values and they have no actual effect on the AIs.

I know for fact that setting the secondary compulsion to Nil, caused a greater range of stock AI choice than I otherwise saw them do.  The Hive never went Police State Free Market until I did that, for instance.  Obviously I've never looked at the plumbing, the machine code.  But I would submit, it's not so easy to observe how a piece of machine code behaves.

I also observed factions being much more willing to move back and forth between Fundamentalist and Democratic, after I gave them this freedom to do so.  If for instance you compel a faction to seek MORALE, well then they're always going to go Fundamentalist.  So I refrain from compelling them.  Or I'm careful about what compulsions actually result in meaningful choice in the SE table, and what compulsions don't.

I believe that choosing a secondary compusion, such as PLANET, makes the AI seek those entries in the social engineering table, and prefer those over others.  However, it is not ironclad.  I have often seen a faction choose the None column choice, if the AI thinks it's a better deal.  For instance, my mod gives +1 GROWTH for Survival.  Factions often choose it, rather than Capitalist or Socialist or Green.  It gives 1 benefit and 0 penalties, which might be better than the 3 benefits and 2 penalties of other choices, depending on what the AI wants to do.

I don't have rigorous proof of what an "affirmative" secondary compulsion does.  I think of it as a "strong suggestion" to the AI.  I'm guessing the AI will not choose something that goes against the suggestion, i.e. a PLANET penalty instead of a bonus, but I'm uncertain of this.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 01, 2019, 07:51:18 PM
You can't anticipate every balance issue that arises with mods.  Yes, you can focus on the stock factions and alphax.txt rules.  Please don't.  Not in ways that mess up what other modders are doing in their mods.  There's a difference between being compatible and having an interface boundary with other mods, and thinking you personally are supposed to solve every problem yourself, with Thinker mod as some kind of standalone ultra-competent game experience.

Many design problems are balancing acts, including finding a balance between difficulty and interesting narrative. It certainly doesn't have to be exclusive, although currently this mod has been slanted in favor of increasing challenge. I will say straight up though, Thinker is supposed to be a playable experience without extra mods, but modding should always remain a possibility. There's simply so many players that prefer the vanilla game mechanics.

Quote
Sea level rise wasn't really relevant when the AI had such poor production etc.


Actually it is still not relevant.  I have proven in the other thread, that the game is cheating on AI eco-damage.  3X difference compared to a human playing the same faction!  There's a reason I've never adopted the play style you've implemented for the AIs.  I'd get slaughtered by mindworms doing that.  The whole world would end in a dripping wet mindworm apocalypse.

I hope you decide to make it relevant, i.e. make the AI play by the same eco-damage rules as a human player.

It seems like the post is jumping to conclusions pretty fast. Although it's not fully documented, in the stock game the AI gains an advantage in eco damage at thinker and transcend difficulty levels, as can be seen from here: http://alphacentauri2.info/wiki/Difficulty (http://alphacentauri2.info/wiki/Difficulty) At librarian and below, the eco damage should be equal for human and computer bases, unless I missed something.

The post also looks like you've entirely ignored how the clean mineral formula works or are not aware of it. As a player, it's perfectly possible to run 50 mineral production from boreholes with zero eco damage. This just requires some timing with the first fungal pops and then rushing lots of tree farms or similar clean mineral boosting facilities. The AI might be able to do this too if the behaviour was coded in, but currently it's not implemented obviously. http://alphacentauri2.info/wiki/Ecology_(Revised) (http://alphacentauri2.info/wiki/Ecology_(Revised))

If we were to go on increasing AI eco damage, then the increased fungal pops would also act to lower the eco damage because the clean mineral cap increases faster. The increased number of fungal pops would also cause sea level rise even sooner. Fungal pops can also be highly exploitative mechanic for the player since the worms generate planet pearls. That's just the way eco damage works in the stock game. Now, Yitzi's patch did attempt to do lots of changes here, but not sure if it makes sense to duplicate them.

It's always possible to change librarian level cost factor to 7 and see how the equal eco damage would change things when the cost factor is similar to transcend level. I just doubt it makes that much of a difference here.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 02, 2019, 07:02:52 AM
As a player, it's perfectly possible to run 50 mineral production from boreholes with zero eco damage. This just requires some timing with the first fungal pops and then rushing lots of tree farms or similar clean mineral boosting facilities.

It "just" requires you to do a whole lot of stuff.  As opposed to say, spamming whatever you like with all kinds of nifty boreholes, free pass no problemo.  All those requirements constrain your growth and conquest.  The AI suffers none of that by comparison.  I mean the game "just" requires you to conquer everything on the map in order to win it, just about everything could be spoken of this way.

Quote
If we were to go on increasing AI eco damage, then the increased fungal pops would also act to lower the eco damage because the clean mineral cap increases faster.

You still have to stay on top of it, and some factions with their Economy choices will not have the same options for mitigation.  What's AI Morgan gonna do?  Double down on Free Market like a good little climate denier, that's what.

Quote
The increased number of fungal pops would also cause sea level rise even sooner.

I'm not worried about that.  I want the AI to suffer the consequences of the eco-damage it does.  So that it isn't so easy for it to make 40 minerals cities and invade me like I'm standing still.  I may get some flooding, they may get giant mindworm stacks that completely wipe out their cities, no matter how big they are.  Have you played through that sort of thing?  Did it because of illegal chemical weapons a couple of times, it wasn't pretty.

Quote
It's always possible to change librarian level cost factor to 7 and see how the equal eco damage would change things when the cost factor is similar to transcend level. I just doubt it makes that much of a difference here.

And then other things change like how many drones are unhappy.  Shifting these things up and down doesn't work unless all of the factors can be adjusted.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 02, 2019, 10:21:55 AM
I'm not worried about that.  I want the AI to suffer the consequences of the eco-damage it does.  So that it isn't so easy for it to make 40 minerals cities and invade me like I'm standing still.  I may get some flooding, they may get giant mindworm stacks that completely wipe out their cities, no matter how big they are.  Have you played through that sort of thing?  Did it because of illegal chemical weapons a couple of times, it wasn't pretty.

Did you read how that eco damage formula works? Of course you're going to get lots of problems when doing atrocities while UN charter if effective. I suppose that part of the formula works as intended, e.g. limits certain exploitative strategies. Otherwise the original eco damage is pretty broken in the sense it can be gamed by very simple strategies. It doesn't make sense to say eco damage gives some huge advantage to the AIs since human player can easily exploit it. With higher eco damage, it's even easier to trigger the first fungal pops and increase the clean mineral cap...

Sure it's possible to play a variant where the player is not allowed to cause any eco damage, but that is a self-imposed limitation and the game will get much tougher as a result. But then again, giving AIs cost discounts is a self-imposed choice for the player too. What maybe could be done here, is have some kind of a config option to have the AI adjust the extent it uses heavy terraforming improvements, like boreholes and condensers. It could even adjust it according to the faction definition, but I'm not sure yet how that might be implemented.

Edit: So looks like the wiki has two guides for eco damage:
http://alphacentauri2.info/wiki/Ecology_(Advanced) (http://alphacentauri2.info/wiki/Ecology_(Advanced))
http://alphacentauri2.info/wiki/Ecology_(Revised) (http://alphacentauri2.info/wiki/Ecology_(Revised))

There are some discrepancies in the details how the eco damage is calculated, in this case the advanced version is probably correct. Improvements number should be divided by 8 before added to the minerals, and one of the terms in the final eco damage number is "3 - PLANET", and not "PLANET + 3". But the textual description of eco damage should be correct there.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 02, 2019, 06:51:36 PM
I suppose that part of the formula works as intended, e.g. limits certain exploitative strategies.

Until you get everyone to legalize chemical weapons.   :clap:  Which can be surprisingly easy or surprisingly hard to do.  Depending on what, I don't even know.  Dumb AI thoughts about weapons it's not even gonna use?  Anyways, gotta love the morality of Planet giving its blessing according to the United Nations protocols.

Quote
It doesn't make sense to say eco damage gives some huge advantage to the AIs since human player can easily exploit it.

How much Super Hover Former empire repair have you really done?  It gets old.  Especially those flooded river plains that actually kill any unit you leave on them.  I don't care how much benefit you're supposed to be getting by fighting the good fight against mindworms, it's really a drag to have your empire ripped apart again and again, never being able to make any progress on it.

And that's assuming you still have land to work with.  Once the world turns to water, your minerals drop like a rock!  Even the Pirates can be affected, because deep ocean doesn't generate any minerals.  Once you have no productivity, you don't have a way to get out of your situation.  You die.

I learned the hard way that I actually have to premeditate about that.  The climate scientists of Planet have to be really really good.  They have to anticipate that they're going to lose all their minerals and start picking city sites and production strategies early to counteract that.  Like, if you built a lot of mining platforms and subsea trunklines in advance, you'll be ok.  If you didn't, well screw you, you're just not a good scientist are you!

You also have to premeditate about how to survive the mindworm attacks.  Like build the Neural Amplifier before you set off the world destruction.  There's a lot of stuff you have to do, it's no free lunch.  You also spend all your time fighting mindworms and none of it fighting other factions.  That can turn into a real problem.

Never once, to this day, have I survived a chemical weapons triggered mindworm onslaught.  And the only reason I survived Fission Armor's early factory debacle, is because Tim made the Ascent to Transcendence take super duper long to produce.  If it had been the stock game's version, or my version, the game would have been over with complete AI victory.  When I played my 1st Thinker mod game combined with my mod, I knew that endgame was coming, which is why I quit.

Quote
What maybe could be done here, is have some kind of a config option to have the AI adjust the extent it uses heavy terraforming improvements, like boreholes and condensers. It could even adjust it according to the faction definition, but I'm not sure yet how that might be implemented.

What I actually want, is for the AI to do what it's already doing, and suffer for it.  The same pain that I get.  Because then we get to see, this isn't some kind of best / obvious / uber strategy for the AI to be doing.  The AI could easily make all these great productive minerals and then burn out.  Or maybe it will actually build some eco-friendly facilities, I've actually seen the stock AI do that, when testing the early factories debacle of Fission Armor mod. 

But the point is, the AI will not simply get to cakewalk human players, like we're all some kind of pile of dummies who don't actually know how to play the game, and should have been using the same strategies the AI is using.  The game is set up to cheat like a mad dog for the AI, the AI doesn't pay the cost of its ecological transgression at all.  That was fine when the AI wasn't any good at supply crawlers and boreholes, but you've totally changed that.  You've given it the knowledge of a power gaming minimaxer.  Well, such a "player" needs to suffer the consequences fairly.

I'm not interested in my life being easier with the eco-damage, like dropping down to Librarian.  I think the eco-damage, as is for humans on Transcend, are ok rules.  I've been playing with those rules forever.  Dropping to Librarian is basically nerfing eco-damage rules out of the game.  So now you've got your AI, and it's doing its horrible crawlers and borehole thing, forcing me to play that way to keep up.  Because it's now the golden path through the game.  I don't want there to be only 1 golden path through the game.  I don't want to be forced to play the game the AI's way.

So in my perfect world, the AI has to actually play the game that I'm playing, and not be given a huge eco-damage cheat.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 02, 2019, 07:28:07 PM
and one of the terms in the final eco damage number is "3 - PLANET", and not "PLANET + 3".

I fixed it.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 05, 2019, 10:35:20 AM
Just for fun, here's a talk called Playing to Lose: AI and "Civilization" (Soren Johnson) (https://www.youtube.com/watch?v=IJcuQQ1eWWI). He was the main AI designer at Firaxis from Civ 3 onwards.

Btw, one of the lines on that revised eco damage should be like this:

Quote
Improvements = ((2*WorkedImprovements + 1*UnworkedImprovement + 8*Boreholes + 6*EchelonMirrros + 4*Condensors + Seabase - Forests) / (8 * (1 + TreeFarm) * (1 - HybridForest))

A very important detail in the ordering of the brackets.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 05, 2019, 03:11:01 PM
Btw, one of the lines on that revised eco damage should be like this:

You mean on one of the wiki pages?  You could just edit the wiki to be correct.  It doesn't require any kind of special permissions to do that, just an account here.

I skipped through the Soren Johnson video.  I didn't really get a lock on anything I'd especially comment on.  In general, the problem of an AI being written that simply kicks the player's ass, and thereby isn't any fun to play against, is a known game design problem.
Title: Re: SMACX Thinker Mod
Post by: dino on March 05, 2019, 06:15:46 PM
In general, the problem of an AI being written that simply kicks the player's ass, and thereby isn't any fun to play against, is a known game design problem.

Giving lame AI so many cheats, that it can crush a player mercilessly no matter what is indeed unfun, unlike competent ai with little cheats.
So I call it bullsh*t, if we are talking actual good AI, not AI cheats, since I've never played a 4x game where too good AI was a problem, opposite was always a prablem,

Most probably 90% of players never spend enough time with 4x games to learn to play competently enough, to require competent AI to enjoy the game, so producers can't financially justify spending more resources on AI development and what we were getting was considered good enough for overwhelming majority of gamers.

Other less likely explanation is it's actually so hard to do, that no one ever succeeded despite trying and allocating serious resources to AI. This one may, or may not be true, we will never know, because probably spending something like 25% of a game budget on competent AI programmers in order to make really great one, was never even attempted by any game studio, since it wouldn't be considered a smart bussiness decision.
Imo it was always a financial decision, not a game design decision, but a small vocal minority of hardcore fans need to be addressed in an interview, so we get "bad ai is actually a good game design" argument...

Short version: Average gamer is too dumb, or lazy to care enough about AI, so a good one would brought far less revenue, than it would cost to develop.

Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 05, 2019, 06:42:03 PM
What I said is nevertheless a known concept in the game industry, and is not limited to 4X games.

Budgets have been a historical issue, as have computing resources.  I don't know whether either are issues lately.  I haven't been keeping up, as it mostly doesn't matter to me what the rest of the industry is doing with AI.

The only data point I've collected in that regard, is Gal Civ III is reputed to have tried to really sink some 64-bit threading resources into AI.  The player feedback I read in /r/4Xgaming, doesn't seem to say that yep, they obviously succeeded.  I haven't been willing to embark upon GC3 learning and mastery to find out one way or the other.  Got other development priorities right now.

Multiplayer bias is an ongoing issue.  The idea that since humans are "always" going to do better than AIs, that human players would prefer to seek other humans to play against.  This claim leaves out a substantial chunk of players, like myself, who do not enjoy interacting with other humans online.  Either because humans turn out to be too much into hardcore minimaxing to be any fun to play against (a subset of the general lobbying problem), or they're just jerks, making Life more unpleasant than it needs to be.

Multiplayer bias is further encouraged by social media marketing models.  Which again, I personally don't like, and do my best to avoid participating in.  I'm a Facebook refusenik, for instance.

Aside from those problems, is game production bias, which Soren Johnson did comment on at one point in his video.  The game designers are out in front with all these rules and systems they keep heaping onto a game.  Human playtesters egg it on: yeah yeah yeah MOAR MOAR MOAR!  The AI programmer plays catch-up to those concerns, in an industrial studio setting at least.

As a solo indie developer, I have the power to say "no" to that.  To recognize that half of what's in SMAC, is game mechanically useless.  I've never seen anyone endeavor to put a 4X franchise on a diet.  I've only seen developers follow the mantra of "MOAR".  I intend to do differently.  My SMACX AI Growth mod is like a dress rehearsal for what does and doesn't matter about the game.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 06, 2019, 10:38:58 AM
Upgrading an engine to 64 bit is really only significant if one has to allocate more than 2 GB memory. That's what the purpose is. Rarely do these AI routines perform such heavy computation that 64 bit would help there. Most of the time we're mainly dealing with scripted routines, not some computationally heavy machine learning stuff.

Usually something like pathfinding might be a bottle neck, probably also in SMAC it's the culprit that hangs the game from time to time. Though that might have to be investigated further with a profiler. Interestingly I created a separate, simpler pathfinding routine for Thinker which seems to perform its role very efficiently. From very early on, I figured it was necessary so the AI would have an idea how to deal with the complex and modifiable terrain.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 07, 2019, 07:42:48 AM
Most of the time we're mainly dealing with scripted routines, not some computationally heavy machine learning stuff.

GC3 may have attempted to do some computationally heavy, threaded, machine learning stuff.

Quote
Interestingly I created a separate, simpler pathfinding routine for Thinker which seems to perform its role very efficiently.

The main thing I hate about the stock binary's pathfinding, is the way it makes mistakes with Formers and other non-combat units.  Get near a border, and the pathfinding goes crazy!  If it would just use whatever the combat units are using, all would be well.  Then you just get the occasional total meltdown where a unit moves back and forth until it asks you if you want to quit doing that.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 08, 2019, 12:02:16 PM
> GC3 may have attempted to do some computationally heavy, threaded, machine learning stuff.

It would be good to have a source for this kind of claim. If they were using something like that, I'd guess it's a pre-computed model. Large strategy games don't necessarily lend themselves easily to that kind of analysis. The range of possible actions is very large in those games, compounding the problem.

About the other issues raised in this thread, I won't give any promises what stuff will be in the next version of Thinker. Mostly it should deal with fine-tuning the existing behaviour though.
Title: Re: SMACX Thinker Mod
Post by: MercantileInterest on March 08, 2019, 04:47:25 PM
What does Thinker do to the faction placement algorithm?
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 09, 2019, 08:54:07 AM
> GC3 may have attempted to do some computationally heavy, threaded, machine learning stuff.

It would be good to have a source for this kind of claim.

Search /r/4Xgaming and also /u/draginol.  That's Brad Wardell's account.  I remember reading something about this, but not caring enough to get into the details.  First I'd have to see if it plays well, and I was unwilling to put in the time.  Only if it was beating me, or challenging me, would I bother to figure out how it was doing that.  So I read what other people said about it, and the results were mixed.  Like, some people said it wasn't particularly smart and definitely relied on resource buffs to provide challenge.  I don't actually know one way or the other.

My memory of 2 years of posts in /r/4X gaming is also, that nobody else has done 4X AI worth a spit.  GC3 is the only one that is worth investigating for its technology.

Quote
Mostly it should deal with fine-tuning the existing behaviour though.

You really don't need roads on every single square.  It's a waste of terraforming production, and it makes AI territory easier to invade.

You don't need a Condenser like every other freakin' square.  Personally I have preferred to put them on Rolling, Arid squares.  Then I get a mineral to go with my food and complete lack of energy.  I never put mine on Flat terrain because then you just get a pile of food with no minerals and no energy.  If squares are already Rainy, then they don't need Condensers next to them.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 09, 2019, 02:12:53 PM
What does Thinker do to the faction placement algorithm?

Well, it is described in the documentation, the new algorithm decides where all the factions will spawn on the map. The main purpose for this is to prevent multiple factions being bunched up in a small island or similar. That part the algorithm does really reliably, it will evaluate the size of the starting landmass and discard bad locations. Random map generation also works better when it's paired with my WorldBuilder enhancements that are now also available from the project page (https://github.com/induktio/thinker/blob/master/Details.md).

And yeah, I looked at those testing reports. It might be getting redundant to test the same parts of the game any further though. But then again, the next version is not ready.
Title: Re: SMACX Thinker Mod
Post by: dino on March 12, 2019, 11:05:57 AM
Compared to vanilla, builder gameplay is nailed, but thinker has now opposite problem to vanilla it's extremely passive with no defences.
Enemy territory full of boreholes and condensers, tightly packed with bases and roads is like free candy and leading faction can be easily overrun in few turns in late 2100s.
It's literally easier to conquer the world than vanilla and I saw bvanevery here and one guy on rpgcodex having exactly the same experience with thinker.

My thinking is that you can't make ai capable of determining when it can safely buildup and when it needs defenses, so it has to do both all the time and rely on cheat bonuses to compete with more adaptive human.

1) I've proposed already a formula that it needs at all times to have ( 50% + ( ai_fight * 10% ) + 10% if vendetta + 10% if enemy units inside borders ) of mineral production used by unit support.
2) It needs a way to keep the units upgraded, from my testing vanilla ai do upgrade units when it has excessive amount of money, so maybe some change to make it more of a priority and reduced upgrade cost for the ai.
3) It shouldn't build so many sentinel type of units.
4) If player military power variable ( used for military ranking ) is 3x smaller than ai and ai mood toward player is bad enough it should just trigger vendetta straight away.
    Under some conditions vanilla ai can just declare vendetta without going into dialogue ( meybe it's in perihellion only ), so it's an idea to replicate this when these conditions are met.

Whathever you have on your plate currently, you should put it on hold and try to address issues above first, because currently it's boring and passive in early game and easy to conquer.

Another issue is ics style of bases placement, it doesn't compete for land in early game I can easily and without conflict, grab more land early, than against vanilla ai with exploration focus.
1) Maybe you could incorporate vanilla colony pod ai into yours, like give it 40% chance it will behave like vanilla, 60% chance it'll use your movement/ base placement code.
2) Make it spread bases 3 tiles away, never 2 I can give ai cheats that makes it popboom, which will be wasted with too tight placement, also tightly packed early bases have less special resource, monoliths, rainy tiles to work with, plus the issue of not grabbing land fast enough early.

As amazing, as builder aspect of the ai is in thinker, it's as unsatisfactory to play against as vanilla currently, just for different reasons.
It can compete only if you don't rush them. If you don't attack it, you can either give it enough cheats, that you don't have a chance, or not and you'll always win a very predictable and uninterrupted builder game.
Title: Re: SMACX Thinker Mod
Post by: MercantileInterest on March 12, 2019, 06:20:34 PM
A pair of variables from Yitzi alphax:


Disable, ; Technology to convoy all three resources
Disable, ; Technology to convoy all three resources outside of base radius

Convoying all three resources doesn't sound like a useful gameplay feature but this would be:


Disable, ; Technology to convoy resources outside of base radius

With this option, crawlers could be a very early game tech but not overwhelmingly powerful.

Another Yitzi variable:


0        ; If non-zero, borehole count per base is squared when determining ecodamage {under -2 billion to over 2 billion}

Makes it eco-suicide to spam more than one borehole per base. This would interfere with Thinker's current functioning.

Right before he left, Yitzi talked about the need for huge armies of formers bogging down gameplay. His proposed solution was to make all formers cost mineral an extra mineral upkeep regardless of clean reactors or support value but at the same time to reduce the time needed for terraforming in the alphax file.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 12, 2019, 07:14:26 PM
Umm yeah, recently progress with the mod has been somewhat slower than I would have liked. I've evaluated several new changes to the terraforming algorithm and scrapped some ideas along the way. It's pretty difficult to code robust heuristics that work well in a wide range of situations.

> Compared to vanilla, builder gameplay is nailed, but thinker has now opposite problem to vanilla it's extremely passive with no defences.
> 1) I've proposed already a formula that it needs at all times to have ( 50% + ( ai_fight * 10% ) + 10% if vendetta + 10% if enemy units inside borders ) of mineral production used by unit support.

I've been wondering about this as well, it looks like currently Thinker builds too few military units. Luckily this can be modified easily by adjusting the threat formula. Currently the main heuristic it uses is the distance to the nearest enemy base. The formula has a wide range of variables but I think it does make sense to add "if enemy units inside borders" factor there. We'll see what kind of effects this stuff will have when I get the next develop version ready.

> 2) It needs a way to keep the units upgraded, from my testing vanilla ai do upgrade units when it has excessive amount of money, so maybe some change to make it more of a priority and reduced upgrade cost for the ai.

I don't remember seeing the AI upgrade any of its units. Can you provide some kind of a save game where this happens consistently?

> 3) It shouldn't build so many sentinel type of units.

It's just currently it builds too few units. When its adjusted to build more, the units should be mostly offensive in nature.

> 4) If player military power variable ( used for military ranking ) is 3x smaller than ai and ai mood toward player is bad enough it should just trigger vendetta straight away.

Diplomacy stuff probably will not be a part of the next update. It will need a lot more reversing before anything can be implemented.

> 1) Maybe you could incorporate vanilla colony pod ai into yours, like give it 40% chance it will behave like vanilla, 60% chance it'll use your movement/ base placement code.

This colony pod argument is something I will mostly disagree with. Grabbing territory doesn't do much by itself unless it's populated by bases. Closely packed based can be defended more easily anyway. Each turn a colony pod spends on movement is a turn of missed productivity from a future base.

> Disable, ; Technology to convoy all three resources
> Disable, ; Technology to convoy all three resources outside of base radius

Would make crawlers super-overpowered and require lots of patching. Nah.

> Disable, ; Technology to convoy resources outside of base radius

Insignificant, Thinker mostly crawls tiles that are inside base radius anyway. Thinker formers wont even consider improving tiles that are not workable by some base.

> 0        ; If non-zero, borehole count per base is squared when determining ecodamage {under -2 billion to over 2 billion}

Not planning any patches on the eco damage formula currently.
Title: Re: SMACX Thinker Mod
Post by: dino on March 12, 2019, 09:21:41 PM
This colony pod argument is something I will mostly disagree with. Grabbing territory doesn't do much by itself unless it's populated by bases. Closely packed based can be defended more easily anyway. Each turn a colony pod spends on movement is a turn of missed productivity from a future base.

You're too much concentrated on how well it does isolated buildup, too little how its behaviour interact with other factions and human player.

Grabbing territory deny it to other factions, player controlled one specifically. For a player it's essential to have more land to work with than AIs to counter their cheat bonuses.
With current strategy I can easily corner thinker faction on my contient on a small piece of land and grab 2x more land myself.
Prevent war with diplomacy until I'm ready and after buildup 2x more land mean 2x more support minerals, easy future war.

With 3 tiles spread, infantry from neighbouring base can still reinforce threatened one within a single turn. More spread mean more special tiles per base, one extra food, mineral, or monolith tile early will offset 2 turns spent getting there.

When the amount of land is constant, than less spread mean more bases and faster utilisation of limited land.
But more spread in early game will result in 2x more land and 20% less bases in a given timeframe, but after buildup 2x more land equals 2x more resources and 2x more really good tiles that are crucial in early game.
Especially with growth bonus that gives AI popboom ability, at the same stage human player starts to popboom.

But denying land to human player is the main argument for a fast land grab.
Imo you should be a bit more concerned with how it interfere with what human player wants to do and how human can interfere with what it does.

***
As for unit upgrade, I remember experimenting with custom AI factions few months ago, I was curious what AI will do with excess money.
I gave Gaians starting money bonus and 10% interest rate, it was generating mad money.
It build tons of scout patrols early, at some point all scouts were gone and it had tons of plasma sentinels and it didn't lost scouts in war since it was only me and them on the continent.
I assumed it upgraded scouts at some point, sadly I didn't pinpoint the moment when that happened with a save, so I am not 100% sure it was the case, maybe it lost them to worms.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 13, 2019, 04:14:17 AM
Makes it eco-suicide to spam more than one borehole per base. This would interfere with Thinker's current functioning.

Another option that would work in any alphax.txt without requiring a specific binary, would be to make Boreholes a lot more expensive.  I mean really, Thinker mod at this point seems to be built around major exploits in the game's rules.  I've plugged some of them, making Supply Crawlers and Boreholes available later in the game.  I didn't do that because of Thinker, it was already part of my mod design.  And it does help, as not every faction even makes it to being able to produce supply crawlers or Boreholes.  But really, should Boreholes be this cheap if the AI is so good at making them? 

Quote
Right before he left, Yitzi talked about the need for huge armies of formers bogging down gameplay. His proposed solution was to make all formers cost mineral an extra mineral upkeep regardless of clean reactors or support value but at the same time to reduce the time needed for terraforming in the alphax file.

What bogdown?  I just spend some turns executing all of Yang's Formers.  Yes he had an excessive number of them, but I'm not seeing the problem.  Fairly weak peons can kill the garden variety non-combat Former.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 13, 2019, 04:27:40 AM
The formula has a wide range of variables but I think it does make sense to add "if enemy units inside borders" factor there.

Bear in mind that if I'm rail heading, I may not be inside the AI's faction's borders at all.  Until I instantly link the next base in 1 turn.  A core principle of -5 POLICE combat is you have to whack a base in 1 turn.  Rail heads are an excellent way to do that, but not the only way.  All techniques involve jumping over borders rapidly.  Air units and drop pods can reach right over borders.

Quote
It's just currently it builds too few units. When its adjusted to build more, the units should be mostly offensive in nature.

Beware of glass cannons and paper tigers.

Quote
Closely packed based can be defended more easily anyway.

That's the main thing I consider rails to be for.  Before I go on offense, that is.  Integrated empire for robust defense.  I don't build "close" bases like Thinker AI.  I build almost perfectly terrain covering bases.  I don't like wasting space.  Bureaucracy does affect me, whether or not it affects the AI.  I try to build my empire with a perfect radius, assuming I have the resources to do it.  I'm poor as dirt in Thinker mod and have to react to conditions.

Closely packing bases and then putting roads everywhere is lousy defense BTW.  No bottlenecks to choke and eliminate the enemy in stacks.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 13, 2019, 04:45:17 AM
With current strategy I can easily corner thinker faction on my contient on a small piece of land and grab 2x more land myself.
Prevent war with diplomacy until I'm ready and after buildup 2x more land mean 2x more support minerals, easy future war.

You can kill a local enemy with any number of tactics, doesn't have to be anything fancy like you're saying.  How do you suppose your land grab is going to work with distant enemies, on a Huge map?  Answer: it doesn't.  You can't control distant AIs.  It doesn't matter how dedicated you are, how proactive you are, and I don't care what 4X TBS game you're playing.  You control whatever your logistical radius of early game control really is, and the AI fills in the rest.  Any specific AI can be a suicidal sacrifice.  In general the AI factions are spamming the map, spreading wherever you can't control.  If you are on a big map, they will gain their footholds somewhere, and you can't stop it.

My preferred technical term for this phenomenon is Whack-A-Mole.

If you typically play on Standard sized maps, you may not have noticed how "close quarters" your fighting always is.

Quote
or monolith tile early will offset 2 turns spent getting there.

I do game the popping of pods to get better starting resources for the earliest cities.

Quote
but after buildup 2x more land equals 2x more resources and 2x more really good tiles that are crucial in early game.

Another flaw in your claim is whether the human is actually willing to do 2x mouseclicks to play the damn game.  Yeah, sure you can win games by colonizing, colonizing, colonizing until you're blue in the face.  Do you personally have the stamina for that?  It's akin to grinding in a MMORPG, working the land so hard to get a result.  Now if you're sorta compulsive about colonizing, colonizing, colonizing, if you think that's fun and pretty much why you're playing the game, you need to recognize it's a specific play style and not everyone shares your joy in it.  Just as Infinite City Sprawl is a specific play style that I think is pretty lame too.

AIs don't get tired of doing very boring things over and over again.  That's a big problem with AI play mechanics that are mostly SPAM.  Does the human want to deal with all the cleanup required to win?  Does the human want to defend the same damn bases the same damn way for 100 turns in a row?  Sometimes the AI "beats" me because it has bored me to death.

Quote
It build tons of scout patrols early, at some point all scouts were gone and it had tons of plasma sentinels and it didn't lost scouts in war since it was only me and them on the continent.

It can lose them to exploration attrition.  It also doesn't have to upgrade.  It could disband, or give units to allies.
Title: Re: SMACX Thinker Mod
Post by: dino on March 13, 2019, 11:03:59 AM
Huge maps are boring. I never play on huge map, only on standard, or custom smaller than standard ( to keep standard rules ).
So land grabbing is crucial and thinker currently leave me way too much room for early expansion.

I also play with modded AI factions, that can popboom and have support bonus, so i need to have more land than them to have any chance at competing.
If thinker did spread more and kept bases defended from the beginning, it would provide serious pressure on me from the beginning.

If thinker spread bases more like I want, you would have less bases to conquer and manage later, not more.
Current almost ics style of placing in thinker is actually annoying and I advocate for less but bigger bases, as more fun singleplayer experience.
On top of being less annoying, it would be imo more challenging in right circuimstances ( buffed AIs that can popboom early ).

If there is no consensus, maybe we could have at least thinker.ini setting that would keep AI bases 3 tiles away.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 13, 2019, 01:57:39 PM
Well at least you're testing something different than I am.  Even if Huge maps can get boring, I almost never play on Standard maps because there's no challenge to them at all.  At least on Huge, particularly the way I've modded SMACX AI Growth mod, AIs do have the ability to take root, establish real empires, and be genuine threats for awhile.

I don't think it's a good idea to expect support bonuses and pop booms when contemplating Thinker mod's design.  It's supposed to be compatible with the stock game and with other people's mods, and that's quite a set of assumptions about modding.  I don't believe in giving any faction a SUPPORT bonus, that's one of the things I removed because it is quite overpowered.  Everyone has to choose Police State (+2 SUPPORT), Fundamentalist (+1 SUPPORT), or Power (+1 SUPPORT) if they want more SUPPORT.

I arranged it so that the combo of Socialist and Eudaimonic will give +4 GROWTH and an unconditional pop boom in the presence of a Children's Creche.  It's also possible to pop boom with less than that if you make people happy enough for a Golden Age.  Those both take time to happen.  The exception is Lal, who is given +2 GROWTH as one of his major faction advantages.  Under Thinker mod he pop booms like mad!  Really scary.  I thought the Pirates were scary, but Lal is at least equally scary.

For our great suggestions about Thinker mod, I don't feel a need to say "spread your bases differently".  I would rather see it directly address this list of core problems:


On the positive side, it does respect research foci.  That was my big issue back in the day.  Even the monster superpowered factions, have followed the research trends I expect from my mod.  And they are severely different and noticeable, as for instance you only get weapons and armor by researching Conquer.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 13, 2019, 06:30:46 PM
You're too much concentrated on how well it does isolated buildup, too little how its behaviour interact with other factions and human player.

Grabbing territory deny it to other factions, player controlled one specifically. For a player it's essential to have more land to work with than AIs to counter their cheat bonuses.

That kind of stuff probably is not something that can be implemented by just having the colony pods walk more distance. For example, if there are fewer, but bigger bases, drone management becomes even more of a problem than it is now. It already builds the bases mostly 3 tiles apart which is the distance infantry can cover in a single turn along roads. Fast horizontal expansion is pretty much the key in this game, at least if one looks at this speed run (http://www.dos486.com/alpha/university/). It's 3 pages long, the most interesting stuff is in the end.

I wouldn't recommend playing this mod on any maps smaller than standard. The AI needs some time to grow up before it can be effective. Even standard sized maps may be problematic here. The game still mostly has the old AI for combat unit movement, which in theory might be rewritten to assign new priorities for the units, but it would be a really big project.

That's why I slightly increased large map size to 50x100 in the recommended alphax.txt file (https://github.com/induktio/thinker/blob/master/docs/alphax.txt). That file is also the configuration I use for testing this mod. Mostly it just has the standard game configuration values there. With few exceptions, I don't do separate testing with mods, although on these issues it probably has no effect.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 13, 2019, 07:02:03 PM
Fast horizontal expansion is pretty much the key in this game, at least if one looks at this speed run (http://www.dos486.com/alpha/university/).


He cheated by playing with Directed Research.  That's a baby's game.

In my mod, the Caretakers and Usurpers have been stripped of their free armor, stripped of their recycling tanks, and their Battle Ogres' main armament has been nerfed to strength 3.  They get E1 Progenitor Psych and C2 Field Modulation to start with.  The latter gives the fairly useless Cloaking Device and nothing else.  Unlike all other factions in my mod, they get 1 penalty to go along with their 1 bonus.  Most factions just get 3 bonuses and no penalties.  That's how powerful I consider Directed Research to be.  If you play it outside of Alien factions, you are cheating.

It's for people who couldn't make the cognitive leap from Civ II and whined and screamed about things changing.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 13, 2019, 07:50:34 PM
You might then want to go argue with T-Hawk whether the speed run is valid or not. Lots of tactics can be considered exploitable. The basic principles for expansion should work about the same either way.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 13, 2019, 07:53:28 PM
I don't have anything to gain by arguing with T-Hawk, about a demonstration on his own website that doesn't purport to be anything other than exactly what it is.  But, you claimed it is an exemplar of how to win the game.  I don't agree with you, because his method relied on a very basic kind of cheating.  Just go to the biggest exploit of the game as quickly as possible to win it.

Notice furthermore that he took the research buff faction, on top of already having a directed research cheat.

If you took the Aliens in my mod, you'd have your few remaining Alien advantages, but you wouldn't have any research buff.  And it would be a long time before you got supply crawlers at all.  Even if you got the Weather Paradigm, it takes more time to get it in the 1st place, and more manufacturing cost.  There's no way you'd get all this done in under 100 turns.  That's 'cuz I've spent a lot of time rebalancing exploits and holes in the game.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on March 14, 2019, 08:47:43 AM
If there is no consensus, maybe we could have at least thinker.ini setting that would keep AI bases 3 tiles away.
+1. Or make it faction-dependent to add variety. If I remember right, vanilla Miriam preferred very wide spreading. I too have no stamina to play on huge maps and mostly use standard, and there colony pod wars become a minigame in itself.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 14, 2019, 04:40:16 PM
Well well, now we have a new develop build (version 20190314) available from the downloads (https://github.com/induktio/thinker). This update is focused on the build priorities and terraforming:

* Thinker now supports formers based on all triads. Design_units will also create gravship formers when the techs are available.
* Formers will build less roads and try to avoid placing them on forest tiles when they're not needed.
* Other smaller tweaks to former priorities.
* Military unit production priority is now notably increased from previous amounts.
* Whenever AI loses bases to conquest, this also triggers an extra priority to devote nearly all available resources to building new units.
* During peacetime these modifiers will have a much lesser effect, so economy building should still work.
* Small changes to social_ai to prefer priority category models more often. But social priority/opposition effect values (e.g. PLANET) have no effect because of the engine, and are still ignored.

It needs some more testing to determine if the military buildup is enough now. The next step would probably be to implement credit rushing for production items, currently it does not do that. It would be pretty powerful, since now rushing is basically a human exploit.

This update doesn't change anything with the base spacing though. For example the new road building method would need yet more changes if the spacing was changed from current values.
Title: Re: SMACX Thinker Mod
Post by: dino on March 14, 2019, 10:59:26 PM
I know you didn't change anything, but this time all bases were spread 3 tiles apart ( no base within borders of another base ).
If it looked like this in my previous game I wouldn't complain at all. Maybe I had weird map geography previously, will see after more games.

Idea regarding upgrading units: Just automatically disband all units, that are inside base and have both attack and defense values half, or less of maximum available.
Exception: Don't scrap scouts when laser/synthmetal available, wait for the next tier.
Half their mineral value will be returned toward production and can be always performed, no funds needed. It'll also free support minerals for non military production, if currently not threatened.

First impressions:
Level of military buildup probably would be suitable in late 2100s, for an early game it seems a bit too crippling.
Positive is it would be really hard to conquer it early. I'll continue with this game to see if AI will recover from a slower start.

If it doesn't, possible suggestion ( maybe I wrote it too early and should see how midgame plays out first, but since I've already typed it, I'll leave it here ):
Keep it like it was before, for the first x number of turns ( possibly make it dependant on mapsize, plus small random factor, you could also make it variable in the ini, so we can playtest to find the best value ).
If it looses a base during early game ( these x number of turns ), engage something less aggressive than "almost all production towards military".
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 15, 2019, 12:06:32 AM
I know you didn't change anything, but this time all bases were spread 3 tiles apart ( no base within borders of another base ).
If it looked like this in my previous game I wouldn't complain at all. Maybe I had weird map geography previously, will see after more games.

There is only one known exception to the 3 tiles between bases rule that Thinker follows currently. If a colony pod is on a jungle tile, then it is allowed to have one base within 2 tiles, otherwise the next base has to be within 3 tiles or more before a colony pod is deployed. It might be easy to miss this factor if the jungle is covered in forests etc.

Quote
Idea regarding upgrading units: Just automatically disband all units, that are inside base and have both attack and defense values half, or less of maximum available.

Something like that could be done. It might also be possible for the AI to run out of design slots in the late game, especially after new reactors are discovered. Not sure how often that is a problem. There always seems to be some obsolete designs lurking around. It might be even better if it upgraded the units, but have to investigate more how that could be implemented. Hmm.

Quote
First impressions:
Level of military buildup probably would be suitable in late 2100s, for an early game it seems a bit too crippling.
Positive is it would be really hard to conquer it early. I'll continue with this game to see if AI will recover from a slower start.

Early game is quite tricky to manage especially if the faction has support problems. When the bases reach 20+ minerals the problem would pretty much solve itself. Early on there might be also the problem of lacking any viable armor/weapon techs. If the new version is somehow crippled in the early game, then I might write some fix for that. But if the AI is at war with a close enemy, then it should probably be building lots of units regardless.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 15, 2019, 12:33:42 PM
+1. Or make it faction-dependent to add variety. If I remember right, vanilla Miriam preferred very wide spreading.

She does, but it's not faction dependent, it's Explore research focus dependent.  This phenomenon was observed by several modders previous to myself.  I brought it to its logical conclusion in SMACX AI Growth mod.  The inputs of faction personality and research foci do partly govern AI behavior in the stock binary.  Most factions in my mod use Explore as part of their focus.  For instance Morgan is not a Build faction, he's an Explore, Build faction.  Zhakarov is Explore, Discover.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 15, 2019, 12:47:39 PM
Early game is quite tricky to manage especially if the faction has support problems.

Having SUPPORT problems was a stupid, unbalanced idea in the original game.  So was having SUPPORT buffs.  In my mod this is all gone.  There is no crippled Morganite faction, he starts with the same SUPPORT that everyone does.  If you want more SUPPORT you have to choose the government forms that give it.  The only one that gives a SUPPORT penalty is Green and it is only -1.  So -1 is the lowest SUPPORT anyone can have in the game, and you have to choose it.

This is an instance where you can really kill yourself trying to solve AI problems, that as a matter of game design, don't even have to exist in the 1st place.  The game was not enriched by Morgan being a wimp or Yang being overpowered.  Heck I've had to buff Morgan to +2 ECONOMY.  I don't know what they were thinking, that +1 ECONOMY was supposed to be some kind uber power.  It isn't, at least with the stock binary and game behavior.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 15, 2019, 02:44:02 PM
If the players want, they can always go and mod the factions to have more resource buffs. However, it is not the default setting in this mod.
Title: Re: SMACX Thinker Mod
Post by: dino on March 15, 2019, 03:47:11 PM
It recovered from production paralysis, buildup really took off like 10 turns later, but it had solid defences up all time.
I think for a standard map it more or less works, but on a larger map it would be a bit of waste.
If it could on top of that modernize its armies somehow, it would be amazing.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 16, 2019, 03:53:14 AM
Well well, now we have a new develop build (version 20190314) available from the downloads (https://github.com/induktio/thinker).

I notice it contains an alphax.txt.  None of your previous development versions did, nor did your 0.8 release version.  Was this intentional?  I sure hope not, because that makes it de facto incompatible with any mods that change alphax.txt.  That really should be left alone as the text modder's territory / interface / boundary.

Well, looks intentional.  I'm looking at a diff of your changes compared to the stock game.  I guess you've decided you want to go a little into the .txt modding business as well.  My analysis shortly.

Most significant change is global warming frequency:
Code: [Select]
1, 2     ; Numerator/Denominator for frequency of global warming (1,2 would be "half" normal warming).
Your design philosophy here, is you're just going to make global warming easier for everyone.  I can see some players objecting to this.  They might want your AI, but not your reduction in global warming.  Yes they could change it to something else, if they're into learning those details and figuring out what you did differently.  What if they just want to play the stock game, but with your AI?  What if they want to play someone else's .txt mod?  Now they can't just drop your files on top of their installation, they have to be very careful about whose alphax.txt they've got.  That may not be a big deal to you, and you may not think it's a big deal to hardcore players here on this site.  But I encounter a lot of people on /r/4Xgaming or GOG games that don't seem to have gotten into modding before.  You're definitely creating a mod management problem on this.

I notice a lot of changes to #WORLDBUILDER settings.  Now at least, if someone else's alphax.txt simply throws those out in favor of their own, it's not necessarily incompatible.  It just generates a different kind of map.  That can be a problem if your .exe code is relying on a different kind of map though.

Like, I'm going to feed it whatever I feed it.  I spent a month or two on my own map generation conclusions, even before I started SMACX AI Growth mod.  It was one of the 1st things I folded into my mod.  I solved problems I thought needed solving, and I think I'm an expert at what you get when changing those settings in alphax.txt.  To any extent I need to refresh my memory on it, I've got articles written up on this site about it, in painful detail about why I did what I did.  So there's no way I'd be taking your map generator.   :D  I hope your code is not expecting some very particular thing, like for your new faction placement algorithm.  Because in general, people who alter #WORLDBUILDER can't obey constraints you might put there.

My own map philosophy, briefly, is no small islands ever, bigger continents, and plenty of ocean in case the Pirates are in the game.

I notice you redefined what a Large Planet is.  Stock is 44x90, yours is 50x100.  It's not a crazy idea or anything, but if your code is depending on that to work well, people are going to be violating your constraint.

Now maybe you don't have any constraint, only a desire.  Do you desire that people test your AI at 50x100?  Well, someone who prefers the stock alphax.txt, is still going to be on 44x90.  If they ever provide you testing results, you're always going to have to be nagging at them whether they played on 44x90 or 50x100.  And it will be a lot of durr durr d'oh! to straighten that out.   :doh

Maybe you're fine with that, but I tell people Huge map is how you're expected to play my mod for a reason.  That's the design center, and I get better feedback the more people I've actually got playing according to my design center.  If someone says to me, "Well your stuff doesn't work very well on Standard!" I don't have to be surprised, I can tell them I designed the whole thing around Huge maps and up.  Sadly, I don't think I've gotten enough feedback to date to be seriously worried about these map size differences.  Nevertheless I thought I would point out the problem with "going your own way" on map sizes.

Like, maybe you should just join us on the dark side of Huge?

In my mod I added 2 map sizes: Enormous 80x160, and Giant 128x256.  Those were driven by what I could and couldn't correct about faction placement at the .txt mod level.  "Giant" was a pretty easy term to come up with, but it took me a long time to come up with the intermediate term "Enormous".  Point is I added map sizes, I didn't change any existing ones.

How do you feel, for instance, about adding Very Large, instead of changing Large?

I notice you allow anti-gravity struts on air units.  It's a very minor change.  Why aren't Fuel Nanocells good enough?  Was that really important enough to you to roll into alphax.txt?  I'm guessing you don't actually depend on this behavior.  If you did, that would be a real problem, an actual incompatibility.

I notice you don't allow Clean Reactor on a probe team.  That's just a bug fix, I did it in my mod too.  Hopefully you don't rely on that bug being fixed.

I notice you removed the asterisk in front of the *Sea Formers unit.  I've always wondered about that asterisk, if it had any real purpose.  I hope removing it doesn't break something.

Your other changes are comments.  Helpful, and they don't create any problems.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 16, 2019, 01:48:16 PM
I notice it contains an alphax.txt.  None of your previous development versions did, nor did your 0.8 release version.  Was this intentional?  I sure hope not, because that makes it de facto incompatible with any mods that change alphax.txt.  That really should be left alone as the text modder's territory / interface / boundary.

Sure, of course it's intentional. Since I've been recommending some changes to alphax.txt, I'm not going to just leave it as a note on the Github page. But notice they are optional changes. Some of the earliest stuff I've been modding is that Worldbuilder stuff, and other people have already been doing that for many years. I also posted on forums about that even before Thinker project was started. What really here is unacceptable is if you're trying to portray your changes to Worldbuilder as some kind of a new, original innovation. You may have discovered something by yourself, but there's no way your mod was the first one in that. On various forums there's probably some posts written about that topic from over 10 years ago.

Faction placement algorithm shouldn't rely on that Worldbuilder stuff in any significant way, but there are some bugs in that algorithm that should be fixed in the next version. Specifically, if players are using some pre-made maps like Map of the Planet, I don't recommend them to use faction_placement until the bug has been fixed. It can be disabled from the config. For random maps it usually works how it's supposed to. If not, then one can roll another start from Quick Start button.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 16, 2019, 08:08:28 PM
No, it's not about who thought of what in Worldbuilder.  It's that I as a modder am never going to use your version of it.  This is the 1st time you've decided to reach into alphax.txt.  When you do that, you risk stepping on other people's lawns.  My inventory above is about what could be a problem, and what isn't a problem.  Because you've never offered anyone an alphax.txt before, I'm making sure you haven't done something like become dependent on your alphax.txt changes.  'Cuz there are enough substantial mods out there that simply aren't going to do it your way, on these various things.

It would be nice to have a mod manager.  That would mitigate a lot of "stepping on lawns" and "I want your AI, not your nerfed global warming" sort of issues.  But, I'm definitely too burned out to do it.  I'm nearing 1 year of psychological effort put into my mod, and 6 months of full time work countable hours on it.  I need to move on, to things that can make me money as a game developer.

I think testing is a very big deal, something I've made a huge commitment to over the past year.  Some of my comments are aimed at maintaining a sanity of testing regime.  I'm ultimately thinking about, whether some person on /r/4Xgaming thinks the results suck or not.  Lots of testing discipline has to be maintained to keep things from sucking.  Make one change you think is not that big a deal, everything can start sucking.  It takes a lot of testing and iteration to get things right, and I'm glad I'm pretty much at the end of it.  I'm not going to be churning my stuff much anymore, not unless some tester comes along and shows me how I really broke something.  It takes way too long to fiddle with things, get results on the fiddling, and correct the fiddling.  I feel very informed at this point as to what a commercial 4X TBS testing effort is going to be like, and there's gonna be a lot of stuff I won't do as a result.

So yeah, how about not changing Large, and adding Very Large?

I respect your work enough to test it for now.  I don't do that sort of thing forever.  I can't make a living playing games of SMAC indefinitely, not even for my own modding let alone yours.  It's buckets of time.  Time that should be spent on a new, better game than SMAC.
Title: Re: SMACX Thinker Mod
Post by: dino on March 17, 2019, 09:34:01 AM
This is the 1st time you've decided to reach into alphax.txt.  When you do that, you risk stepping on other people's lawns.
Since when it's *your* lawn?
Just include alternative version of your file meant for thinker if it'll ever be required, which is not the case currently and probably won't be.
Induktio already agreed to make changes to values from txt files optional if possible, during ai focus debacle.

Quote
I'm nearing 1 year of psychological effort put into my mod, and 6 months of full time work countable hours on it.
You've spent a year changing values in configuration files and playing the game, in your own words fiddling. If you think you've learned anything substantial about game development, you are delusional.
For what you've made, 6 months of full time work is insane, you'll never produce a game.

Quote
I respect your work enough to test it for now.  I don't do that sort of thing forever. I can't make a living playing games of SMAC indefinitely, not even for my own modding let alone yours.
Just play the game if you enjoy it and eventually provide feedback, or don't play if it feels like an unpaid job.
It's Induktio who is doing us a favor here, not the other way around.

Quote
Time that should be spent on a new, better game than SMAC.
Good luck.

I won't be escalating this topic beyond this post.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 17, 2019, 02:03:44 PM
Since when it's *your* lawn?


It's my lawn when deciding whether to recommend Induktio's work to others in conjunction with my own work, on other sites like /r/4Xgaming where the vast majority of new downloads actually come from.  A new user ends up dealing with 3 scenarios:


Historically, Induktio endeavored to do (2) although there was some very early stuff where "don't affect each other" was broken.  To his credit, he fixed that.  Now he's moving into (3) and for me, all kinds of alarm bells are going off.  I hope others take user packaging seriously and don't just think eh, everyone is and wants to be a modder.  Everyone will want to just set this here, tweak that there to make stuff "finally" work.

Quote
Just include alternative version of your file meant for thinker if it'll ever be required,


I am never, ever going to publicly support binary patches that require changes to alphax.txt in order to work.  It's not my job to keep trailing after a binary patch writer who feels like changing what is compatible, for however many years he or she decides to keep making things incompatible.  I'm not planning to be in maintenance mode indefinitely far into the future.

Yitzi did this somewhat in alphax.txt.  He changed the encodings of how a few things are interpreted.  And then Yitzi vanished, never fixing or resolving those few issues.  Nobody decided to follow in his footsteps and maintain his work either.  The legacy of that, is doubling the maintenance workload of anyone doing .txt modding.

Scient's patch, notably, did not do that.  All changes he made are optional.  You can drop any alphax.txt on top of it and everything is still interpreted the same way as the stock game.

Quote
which is not the case currently and probably won't be.


And the point of raising the stuff I raised, is to make it clear why I want it to stay that way, and why other .txt modders would want that as well.  Modders do not want their work getting bitrotted over time.  I've seen all kinds of work get destroyed in the Wesnoth community because some coder didn't think maintaining the existing encodings was important enough.

Quote
Induktio already agreed to make changes to values from txt files optional if possible, during ai focus debacle.


I can't keep track of details like that in a thread this long, and what does "if possible" mean anyways?  It's always possible, so what it really means is "if I want to, as a matter of my development."  I'm perfectly willing to make a push towards "please want to keep compatibility", especially the 1st time I ever see an alphax.txt appear.

Quote
You've spent a year changing values in configuration files and playing the game, in your own words fiddling. If you think you've learned anything substantial about game development, you are delusional.
For what you've made, 6 months of full time work is insane, you'll never produce a game.


Here you have no idea what you're talking about.  Show us your own mod, and tell us how you tested your mod in production to ensure that it actually works the way you want it to.  You speak as though writing is simply spewing a volume of words onto pages of paper.  That's not where the quality of the writing comes from.

I went back and looked at your old posts.  I see that you've posted about your work before (http://alphacentauri2.info/index.php?topic=21039.msg116012).  I've replied to your ideas about your work before, but I haven't actually tried your work.  I expect that your work is not in the same state now, as in that thread.  I also don't think you've been doing public releases to playtesters as one of your main goals.

I think you should be more considerate of others before claiming some job is easy, or that you've even remotely attempted the same job.  If you have any interest in wrapping your head around the scope of what I've done, you can read my entire CHANGELOG.  It's in the readme_mod.txt of my mod, and it is painstakingly thorough.  Every damn 'fiddle' is in there.  I wrote that thing, very exactly, knowing that unappreciative people like yourself would come along.  It gives you the opportunity to actually see the work, instead of hand waving about how easy something is supposed to be.

Alternately, you could read the entire thread of my mod's production.  The CHANGELOG entries do periodically show up there as well.  It is not easy to know what's important in a thread and what isn't.  But to give you an idea of the scope, this thread about Induktio's work is 18 web pages long.  My thread is 23 pages long.  The scope of discussion is "roughly comparable".

Quote
Just play the game if you enjoy it and eventually provide feedback, or don't play if it feels like an unpaid job.
It's Induktio who is doing us a favor here, not the other way around.


Do you understand the level of testing feedback I provide when I actually go at it?  Go read my threads.  I'm not doing Induktio a favor, he owes me nothing and I tested his mod with my mod for my own reasons.  But my feedback is valuable because it is thorough.

Do you have any idea how hard it is for indie game developers to get good playtesting feedback on anything, when they don't have the budget to pay people to playtest?  Try asking about it in /r/gamedev.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 17, 2019, 09:29:11 PM
Early versions of Thinker did not provide a separate alphax.txt because my assumption was that it would be mostly played on the standard game config. That's where I did my testing too, except that I also used the additional Worldbuilder stuff. It certainly would have been possible to provide modded alphax.txt even earlier so users wouldn't have to copypaste those changes which is even more error prone.

This kind of AI has to make certain assumptions what strategies are viable, otherwise it would take way longer to develop. So there is always going to be a certain reference config on which most of the testing is based. That's just the reality of things. Sure, one can always deviate from that config but then that kind of stuff will not be so tested or even work at all. Hopefully most of the settings can be modded though.
Title: Re: SMACX Thinker Mod
Post by: T-hawk on March 21, 2019, 03:54:18 PM
Induktio, you do the best thing for your mod and your goals, ignore anyone who's just here to poop on it.

Same as I do with my writeups, they're there and I'll ignore anyone who just comes to dump on it from some sanctimonious high horse.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 21, 2019, 04:40:57 PM
:)

Here's a preview of the most significant things that should be added in the next release:

Faction placement will get several bugfixes but also along with that I'm considering a new feature. Many games have map generators which guarantee X amount of resources near each player starting location, so why not implement it here. Currenly I'm testing a version of faction placement with a feature that adds 2 nutrient bonus resources near each land based factions starting location. Technically it works just by removing a supply pod and replacing it with a nutrient resource. Water factions will not get any extra here, they have way too much food anyway, so this will make land factions more competitive.

It should be also possible to implement credit based rushing for the AI production. I think it might be limited only to rushing facilities based on some selective rule. Maybe any facility in headquarters and drone management facilities in any base that is in danger of rioting. Upgrading existing units is more complex to implement, and it can also result in very unpredictable situations for the players if frontline enemy units get upgraded in between turns.
Title: Re: SMACX Thinker Mod
Post by: dino on March 21, 2019, 05:51:20 PM
I think you should try to money rush as much as possible of everything, money rushing increases production capacity by 50% - 100% depending on the stage of the game.
When ai sits on its wealth unused, it's a huge opportunity cost.

In my games I rarely rush stuff in core bases, I use funds generated in core bases to rush like crazy essential stuff in freshly deployed outer bases, so they can catch up faster:
recycling tanks, formers, crawlers, colony pods once a base grow beyond size 1 and as you suggested psych facilities in a base of riot danger, these are things I'd prioritise and prioritise smaller bases over big ones.
Exception being energy percentage bonus facilities, should be prioritised in big bases.
I wouldn't have selective rule what can be rushed, everything could be rushed, but I'd have rules on what and where is a priority.

Once AI borders with other factions ( make it year based and depending on mapsize, if there is no way to make it smarter ), I'd make it try to accumulate and maintain some emergency funds, for probe team actions and emergency rushing of military units after loosing a base. Make emergency fund x times current money output, maybe I'd make it enough to rush one up to date unit in each base + mind control a base.

Title: Re: SMACX Thinker Mod
Post by: T-hawk on March 21, 2019, 07:09:03 PM
Rushing drone control facilities does run into the problem that the (unmodded) AI doesn't realize when they won't actually work, because the drone problem is caused by pacifism units that override facilities.  And really the best way to rush your way out of drone problems is a colony pod to reduce the size of the base.

I agree with dino, rushing is for fresh bases not established ones.  Although the logic isn't because the base is new, it's because which item is much more important than which base, and the best items will occur at new bases.  Also because rushing is worth more in bases with low mineral production, because rushing minimizes the unspent-minerals-turns waiting in the box.  Formers are almost always the most important item for those new bases.  It's more colony pods if you have the PTS but of course most AIs won't.  Recycling tanks are always at least decent too and I think generally better than support-costing units.  Economic multipliers should rank a lot lower than the unmodded AI and most players think, basically never worthwhile until the input baseline is at least 20 units and more typically like 40.  And there is nothing special about the HQ, except for the rare cases of running -4 Efficiency or having a labs-doubler secret project.
Title: Re: SMACX Thinker Mod
Post by: dino on March 21, 2019, 08:02:18 PM
If I understand features description corectly, thinker AI can already switch out off free market, when hit with pacifist drones, so making them not trigger psych facilities rushing should be doable.
Thinker is also capable of popbooming, so two, or more extra worked tiles can make psych facility really worth investment.
But if free space on the continent isn't filled yet rushing colony pod instead could be better.
With right police and support, rushing police unit (with police abillity preferably ), is a cheaper alternative to psych facility.

In early stages developing outer bases faster and deploying colony pods from them faster, helps with land grabbing.
Base placed in poor location can be useless for many decades if left alone, but with rushed recycle tanks, two formers and a crawler, will catch up quickly.
Both cases can be recognised by smaller size, this why I'd prioritise smaller bases.

It should be up to the code that chooses production to recognise when percentage bonus facility is worth investment.
If it's choosen for production at all, then it could be rushed as well, if there is no other more usefull stuff to rush and "emergency fund" is maintained.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 21, 2019, 09:32:13 PM
Unspent energy is indeed a huge opportunity cost. Now with the increased AI productivity, the reserves can even reach hilariously high levels (many thousands). Without rushing the only major way for the AI to spend them was usually mind controlling bases. Up until now, I kind of wanted to see how far we can push this AI with organic growth, but credit rushing should be added at this point. Probably I'll still make it an opt-out configuration option.

So looks like the consensus is that it should be mostly used on new bases. That sounds good and probably we should make rushing recycling tanks a priority too. To a very significant degree, it seems to help the AI overcome some early nutrient/mineral obstacles. Later in the game the AI should probably maintain some reserves so that it can occasionally mind control some bases, but I wouldn't save too much credits for that. Hopefully the formulas here are correct though: http://alphacentauri2.info/wiki/Hurry (http://alphacentauri2.info/wiki/Hurry)
Title: Re: SMACX Thinker Mod
Post by: T-hawk on March 22, 2019, 02:21:18 AM
Those formulas are correct, yes.  (Would you end up reimplementing them, rather than calling the existing hurry function for the AIs?)

There's also the question of whether to partial-rush the item, just enough to complete it with the base's mineral production this turn.  That's generally more efficient since those last few minerals have no effect until completion of the next build item.  It is vulnerable to the base's mineral production changing somehow before the next turn, either from the faction's own terraforming or swapping tiles, or from an opponent doing something.
Title: Re: SMACX Thinker Mod
Post by: dino on March 22, 2019, 08:24:15 AM
It's most efficient most of the time, but:

* If you don't rush in full psych facility in a rioting base, it won't get built.
* In mid/late game I am often capable of rushing, units, satellites, or essential stuff in a fresh small base for many turns in a row, thanks to overflowing, but limiting overflow to 10 in most cases is beneficial. Exception being serial rushing of units in late game, when the more overflow, the cheaper next unit rush.
* If you have a doctor in a base without psych % bonus facilities and you rush colony pod in full, you can put this doctor to work and colony pod will be built without riot.
* It's often the case in a fresh base, that next production item will also qualify for rushing, so overflow will allow this one turn earlier.
* Fungus pop, enemy, or border change may delay essential unit rush in a threatened base ( if purposefully rushing units in threatened base can be implemented ).
* In a small base, that for whatever reason ends up with 1, or 0 minerals output, partial rushing up to first 10 minerals, of recycling tanks, crawler, or a unit in a threatened base , to finish the rush next turn is something that surprisingly often happens to me.

So there are many intricate ways, in which it can be optimised, as the most essential I'd choose:
1) In early game rush just enough to finish, with exception being, always rush in full psych facilities, colony pods. In mid game, always overflow 10 minerals.
2) Partially rush up to 10 minerals crawler/recycling tanks if the base has less than 2 minerals output. Overflow up to 10 minerals in bases with less than 2 minerals output even in early game.
Title: Re: SMACX Thinker Mod
Post by: dino on March 23, 2019, 11:34:58 AM
I'd also implement SP rushing with crawlers, since it should be easy to do:

1) If there is SP in production, multiply probability of crawler production in other bases.
2) When crawler is built, give it percentage chance proportional to multiplier from point 1) to go to nearest base with SP in production and add to it.
This way usual crawler deployment will be statistically unaffected by SP crawlers.

Benefits:
Resources accumulated for SP will provide return faster. AIs will start and abandon less SP, less resources wasted.
If at some point thinker will be so good, that we will want to play with increased cost_factor, it will be necessary for AI to compete with player for SPs this way.

***
I've made one observations regarding diplomacy AI and avoiding conflict.
If AI has vendetta with someone we have pact with ( sometimes treaty is enough ), it can go into a state where every contact is either instant vendetta, or demand to betray our ally and vendetta if we refuse.
Issue is when AI is in this state, it usually refuses to make contact with us and vendetta happens only if our units meet at the border, so it's easy to avoid.
Sometimes AI refuses to make treaty with us on early meeting and refuse any contact later, it's often in a simillar state then.

So my idea is:
If our military score used to make faction ranking is 2x smaller then ai and it has only truce with us, or has vendetta with our ally, force contact every 3-4 turns.
It should result in either vendetta, or barrage of demands for free money and tech. It potentially could make running first 100 turns with just 3 scouts, either costly, or stright up impossible.
I would make it opt in feature, since unaware player wouldn't know how to make them go away.

That said, I proposed it only because it should be possible to implement without disassembling inner workings of diplomacy code.
Otherwise, I think improvements to combat AI are much more important at this stage, and this code seems to be already worked on by you.
So, I'll start sharing my ideas for combat AI improvements, once thinker build with money (and crawler?), rushing is out.
I also put on hold playing the game, since money rushing update is imo huge game changer and I want to spend more time with it once it's out, instead of current build.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 23, 2019, 05:45:35 PM
Those formulas are correct, yes.  (Would you end up reimplementing them, rather than calling the existing hurry function for the AIs?)

There's also the question of whether to partial-rush the item, just enough to complete it with the base's mineral production this turn. 

Looks like in the game binary unit hurry cost is calculated in this form M*M/20 + 2*M. Because the code uses integers, it becomes obvious one cannot first calculate M/20 without massive rounding errors. The other thing that wasn't mentioned is that some factions have HURRY cost modifier. Only some custom factions seem to have it and it is just a simple linear multiplier.

This kind of stuff is usually mixed with the GUI code or coupled with some other logic, so one cannot easily reuse these functions. Production rushing is basically just incrementing accumulated minerals and decrementing energy reserves, so that part is easy to do.

At this point I don't see much additional benefit in implementing partial rushing. Production carries over up to 10 minerals and usually these items are rushed in bases producing less than that. Currently the code is set to never rush until 10 minerals are accumulated, and always do a full rush when deciding to do any. There might be some situations when a partial rush first might be needed though. Sometimes the bases might get stuck in a drone riot loop if the default doctor allocation doesn't work correctly. It seems to cause significant problems when the allocation doesn't anticipate drone riots at all.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 26, 2019, 06:52:56 PM
Looks like it's time for a new build. Version 20190326 is now available from downloads (https://github.com/induktio/thinker). Changes include:

* New parameter: hurry_items allows AI to use energy reserves to hurry production
* Major adjustments to faction_placement to improve starting locations
* Faction placement now creates two extra nutrient resources for each land-based faction
* Fix spawning issues on Map of Planet
* Fix sea colony pods sometimes freezing in place
* Fix sea bases sometimes not building enough transports
* Rebalancing of social_ai priorities

From testing, it looks like hurry_items will improve AIs to a moderate degree but it seems the effect will not be very large. If you sometimes spot from inflitration an AI base where the mineral box is exactly full, that usually means production was rushed. Other than that, it will not give players any other indication rushing was used. Most of the time it tends to do small rushes which cost less than 40 credits so the reserves can still keep accumulating. This update will not include any changes to diplomacy, the variables there are not really mapped so it would be difficult to make any changes.

These are the items the AI is currently allowed to rush when the situational conditions for hurrying are met: recycling tanks, pressure dome, drone control buildings, creches, perimeter defense, aerospace complex, formers, and (only rarely) combat units.

Title: Re: SMACX Thinker Mod
Post by: dino on March 26, 2019, 07:52:52 PM
Two nutrient resources shouldn't be hidden under faction placement. User should be aware of it and it should be a separate opt in setting imo. Maybe take 0,1,2 values as a number of nutrients.

I'd be interested in having it as an ai only buff if possible. Buffs that help early, but are irrelevant midgame are potentially good, since early game is a period when player outperfom ai the most.
In a current form when I also get this, I feel ambivalent, if I had an option to choose, I'd pick zero, or one nutrient, makes early game predictable.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 26, 2019, 08:27:16 PM
Sure, it's possible to make the bonuses an AI-only option and/or be adjustable in number with config settings for each. Generally I would avoid placing any more stuff in the config than we have to, so users wont get lost in the details. Is this necessarily the best way to give another AI-only buff? I'm not sure yet, but it might be changed before the next release.
Title: Re: SMACX Thinker Mod
Post by: dino on March 27, 2019, 08:12:25 AM
I wonder if nutrient + monolith wouldn't be more useful, monolith would bump production, energy and improve early units. Guaranteed 2 energy would help hive get early tech in time.

To not bloat config with new variable, I'd skip making it adjustable in number and suggest faction_placement:
0 - vanilla placement
1 - new placement
2 - new placement + resources
3 - new placement + resources only for ai
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 28, 2019, 01:20:27 AM
Two nutrient resources shouldn't be hidden under faction placement. User should be aware of it and it should be a separate opt in setting imo. Maybe take 0,1,2 values as a number of nutrients.

Although I agree that being able to turn it off is a desirable feature, I'm actually going to uncharacteristically side with Induktio's decision here.  I think he should actually retain his "two nutrient" idea as the default, unless and until he decides from play testing, that it's not a good idea for some reason and he should do otherwise.

Why?

I started a thread about possibly giving all factions 4 Colonists to start with.  I have noticed that the stock AI and Thinker AI (that I've tested) make bad decisions about early colonization.  When one of those decisions is delaying your 2nd colony pod's settlement for 13 years, you end up with a stillborn AI empire that loses the game.  It's quite noticeable.  I've seen what's most likely the effect of this in quite a number of test games, and recently I demonstrated the cause of this in one of my Thinker test games.

A similar problem is blithely walking across fungus with a colony pod.  For a non-PLANET faction, at a minimum it delays settlement due to the inevitable movement delays when walking across fungus.  At a maximum, it gets the colonist killed.  None of this is good for AI spreading at the beginning of the game.  It makes for stark differences in faction performance down the road.

Changes which stabilize the initial environment for factions, are to the good.  A nutrient is a way of stabilizing, it ensures that the faction start position isn't hopeless.  These AIs are too dumb to get from 1 city to 2 cities to 4 cities reliably.  Random stuff happens that can throw the whole game for some faction.  My "4 colonists" idea is about trying to skip this tiny initial portion of the game.  You could still move 4 colonists badly and get them killed, and I'm sure Induktio's AI code will continue to improve and make this important part of the game safer for colonists.  But until he's got some solution that's bulletproof, verified by extensive testing by many players, giving a couple free nutrients sounds like a good idea to me.

I mean, I pop my local pods trying to get those nutrients anyways.  So that I can settle on or near them, depending on whether they are Flat or Rolling.  Why not give the AI the same sense that I've got, in a less intelligent way?
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 28, 2019, 01:36:03 AM
To not bloat config with new variable,

I say that's a non-goal.  This is 2019.  .ini files can afford the storage space, CPUs can afford the processing time.  All that really matters is intentions are clear to the player.  I don't see why the placement of factions, should be compounded with what resources are given at the placement site.  I'd just make another variable for that.  I think linguistically named variables, are clearer than sequences of magic numbers with comments describing the magic numbers.  Probably less error prone too.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 28, 2019, 02:37:56 PM
Generally the early colonization part with Thinker works pretty well, but there are some specific map layouts or situations where the colony pods get stuck on some bottleneck area or keep forgetting their move orders. That's maybe the only significant bug in the current version that I can think of. There are probably some ways it can be fixed before the next release but we'll see.

With the starting bonuses I think it should be a nutrient+forest because then the forest can start spreading and improve the area even more. I agree it should be a configuration option because it makes sense to make it an AI-only bonus by default (but adjustable from config).
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 28, 2019, 03:28:48 PM
With the starting bonuses I think it should be a nutrient+forest because then the forest can start spreading and improve the area even more.

It solves a gamist problem, but from a narrative and simulationist standpoint it's not a good idea.  The drama of planting your own trees on new virgin land is violated.  There is no reason that trees should just magically appear on Planet without your action.  One might even argue that from a gamist standpoint, some player might not want trees, if for instance they are PLANET friendly and like moving on fungus.  Or if a player wants trees, they might want to choose very carefully where they put them for tactical reasons.

You have a problem with the 2 nutrient bonuses.  The Caretakers and Usurpers don't get them, presumably because they are placed later on the map in an ad hoc manner.  I expect the Cult of Planet to suffer from the same problem.  Any of these factions are put at a disadvantage compared to the factions that get the free nutrients.  In the Pirate test game I just started, the Caretakers are crippled by a bad start.

The Pirates also don't get the 2 nutrient bonus.  It just isn't a problem because they have lots of food anyways.
Title: Re: SMACX Thinker Mod
Post by: dino on March 28, 2019, 03:47:25 PM
Forest + nutrient: 321 indeed a perfect tile for a starting base.

I've currently returned to playing crossfire with original 7 and a mod that makes alien branch of tech tree optional and unavailable when there is no aliens in the game.
Can't decide between this and smac mod.

Three notices from playing no expansion mode:
1) It still plays crossfire opening movie instead of original, Ytzi version of no expansion mode had it covered.
2) Could smac mod use smac interface graphics ? It could read smac versions renamed to smax from ac_mod folder, like it does with txt files.
console_A.pcx
console_x_a.pcx
console_x2_a.pcx
console2_A.pcx
iface_down_A.pcx
iface_down2_A.pcx
iface_up_A.pcx
iface_up2_A.pcx
xopeninga.pcx
xopeningb.pcx
3) Potential user of SMAC mod will still want changes in alphax.txt, like worldbuilder and global warming.
    Wouldn't it be simplier to just include the smac mod with adjustments in thinker releases ?
Title: Re: SMACX Thinker Mod
Post by: dino on March 29, 2019, 09:18:15 AM
When searching for a solution for a Spartan visual glitch I had. I've ended up reimplementing my mods from scratch and forgot about tech research weight I had.
So I've got vanilla weights and relied only in what you gave in tech_balance=1 and it was a disaster compared to my previous games.

+2 to weights is not enough, many essential techs still have less weight than the ones related to ai focuses.

I play with tech stagnation, dense rainfall, low erosive forces.
In my previous games in 2170s most bases worked only improved terrain and half of the factions started to deploy crawlers and build boreholes.
With vanilla weights + tech_balance=1 in 2160s half of the factions didn't start to terraform at all, no boreholes in development, no crawlers, but Deidre is an industrial powerhouse obviously.

I had it well though out, so there was a bit of variance between factions, but I forgot the exact changes, but it was roughly something like this:
Centauri Ecology,              4, 4, 5, 6,
Biogenetics,                      4, 5, 4, 4,
Industrial Base,                4, 3, 5, 3,
Information Networks,      3, 5, 3, 3,
Planetary Networks,         3, 5, 4, 3,
Social Psych,                     2, 3, 5, 4,
Applied Physics,                5, 3, 2, 3,
Nonlinear Mathematics,    6, 4, 3, 4,
Ethical Calculus,                3, 4, 5, 5,
Industrial Economics,        3, 3, 5, 4,
Industrial Automation,       4, 4, 6, 5,
Gene Splicing,                    3, 4, 6, 5,
Environmental Economics, 3, 3, 6, 5,
Ecological Engineering,      4, 4, 6, 5,

It gets them complete economy and basic defenses with 4-2 units. From there I left them to play with vanilla weights.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 29, 2019, 03:12:10 PM
It is incorrect to say nutrient bonuses would not apply to alien factions. In pretty much all of my tests, they got the two nutrient bonuses upon spawning. Faction_placement works in a way that the bonuses will appear in squares that previously contained supply pods. Actually when we will add forests to the mix, it makes also sense from the storyline point of view because forests can be popped from supply pods.

Generally I strongly dislike the addition of alien factions in the expansion, they just don't fit in thematically at all. I almost never add them to the games when playing. Even modded custom factions are a lot more interesting, I kind of like how they did the factions in Sigma pack (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=264). They seem to be fairly balanced. Can't really say any faction in there is broken when it comes to mini-maxing.

> 1) It still plays crossfire opening movie instead of original, Ytzi version of no expansion mode had it covered.

It's been such a long time since I last had opening movies enabled, didn't even thought of that. Is that as simple as using opening.wve instead of openingx.wve? About those interface graphics not sure if that is necessary, they seem to only change the colors a little.

> Wouldn't it be simplier to just include the smac mod with adjustments in thinker releases ?

If we have to keep making some adjustments to the txt files, then I would probably prefer to include it with Thinker. Now I'm just linking to the repo which has the original files offered by DrazharLn. Might have to reconsider that based on what changes we'll need.



Title: Re: SMACX Thinker Mod
Post by: dino on March 29, 2019, 04:15:57 PM
I think, I've figured out how your colony pod placement works...
It just use the original code, but before it moves you check if there is a base within 2tiles radius, if not and a base can be built, you do it instead of moving.

colony pod pathing
colony pod pathing

You could disassemble a bit more of the original function and reduce the radius in witch it seeks for spots to lets say 12 (or 9 ?) tiles.
Maybe then Peacekeepers could find a destination on an excellent terrain to the west, instead of settling barren wasteland on a path to the distant Monsoon Jungle.
It's a common issue, I've observed in most of my games. I once saw Deidre settle whole Great Dunes, because they were on a path somewhere, while ignoring 4 bases worth of rainy hills in the opposite direction.

If we are at Monsoon Jungle, you could get rid of the original code that build bases two tiles away on it, the bases are too cramped and have no space to grow to their full potential there.
Small error, maybe it's vanilla - ai can build a base on top of volcano, in fact it almost always does that.

> About those interface graphics not sure if that is necessary, they seem to only change the colors a little.
It's not necessary, but it'd be a nice touch, it's also a bit more than colors. It bothers me enough to overwrite smax pcx files with renamed smac files in my installation folder, ocd, autism, whatever it is, it's no joke ;)

Any thoughts on the tech ai weights from my previous post ?
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 29, 2019, 05:07:17 PM
I play with tech stagnation, dense rainfall, low erosive forces.
In my previous games in 2170s most bases worked only improved terrain and half of the factions started to deploy crawlers and build boreholes.
With vanilla weights + tech_balance=1 in 2160s half of the factions didn't start to terraform at all, no boreholes in development, no crawlers, but Deidre is an industrial powerhouse obviously.

I had it well though out, so there was a bit of variance between factions, but I forgot the exact changes, but it was roughly something like this:
Centauri Ecology,              4, 4, 5, 6,
Biogenetics,                      4, 5, 4, 4,
Industrial Base,                4, 3, 5, 3,
Information Networks,      3, 5, 3, 3,
Planetary Networks,         3, 5, 4, 3,
Social Psych,                     2, 3, 5, 4,
Applied Physics,                5, 3, 2, 3,
Nonlinear Mathematics,    6, 4, 3, 4,
Ethical Calculus,                3, 4, 5, 5,
Industrial Economics,        3, 3, 5, 4,
Industrial Automation,       4, 4, 6, 5,
Gene Splicing,                    3, 4, 6, 5,
Environmental Economics, 3, 3, 6, 5,
Ecological Engineering,      4, 4, 6, 5,

It gets them complete economy and basic defenses with 4-2 units. From there I left them to play with vanilla weights.

What you did here is somewhat similar to what tech_balance did in its earliest version before the scope of changes was significantly reduced. So in essence, your changes increase the bonus assigned to economy techs and also value the beeline to Industrial Automation significantly more. In the default tech tree the economy bonuses are so much stacked in the Growth part that Gaians always tend to get them first. But if one goes to edit the weights in alphax.txt, it will also significantly skew the blind research results of player factions. Tech_balance should not affect player factions.

Basically the AI factions and players doing blind research always iterate through all available techs, calculate the values by multiplying tech weights with research priorities, and then usually research the highest value tech. It seems there is some random element to that. Tech valuation function is just pretty complex and the result is really far from a simple dot product the weights would imply. The default valuation code stacks so many modifiers on top of that, the values might even change according to the game situation.

One basically needs a debugger to see what kind of actual values the AI factions assign on the techs. I could print out all the tech/faction pair values the AI calculates but the results might change because of those other modifiers that are calculated on top of that. But if you put weights like 5,5,5,5 on a tech you should be able to force the AI always research it when it is available. I think I need to address the fact that Gaians tend to get these techs so much earlier before the other factions in the next release. For example the bonus multiplier that is given on some of the economic techs could be increased significantly.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 30, 2019, 08:02:26 PM
Tech valuation function is just pretty complex and the result is really far from a simple dot product the weights would imply.

Nevertheless at least with my mod's tech tree, in recent development versions of your Thinker mod, it behaves as though a simple dot product is all that's happening.  Believe me, in all those test games I looked really hard to see if you'd pulled something weird with this.  We both know it was a huge issue between us at the beginning of your development.  But now I find nothing, nada, zip.  AI factions learn exactly the techs I expect them to, exactly as they do with the stock binary.

Now why might this be?  Well with rare exceptions, the highest weight I ever give to a tech is "4".  I have many techs that have secondary categories of weight "3".  Using a "2" or "1" is uncommon in my tree.  I have strict categorization rules about what Explore, Discover, Build, and Conquer imply, so many of my weights are "0".  I generally do not put a "1" in something to "help things along", I make hard barriers.  Some parts of my tech tree are also very narrow, like the Discover and Build portions.  The Conquer part of the tree is particularly broad, because Firaxis actually put more combat oriented techs in the tree than anything else.  I don't try to hide that or dole them out in "different" subtrees.  You wanna fight, you have to study Conquer.  I have a lot of "pure" Conquer techs in the tree, with the other categories zeroed out.  That could be suppressing some of the "complex" code tweaks.

Whatever the under-the-hood complexity, my approach to the weightings seems to have simplified it.  It appears to work like a straight dot product. That's all I can actually observe in real games.

For many years I've wondered if things like exploring more land, or using more navy, somehow changed what kinds of techs you'd get.  Like suddenly you're stimulated to get Doctrine: Initiative or something.  But I have no proof of that.  And I've read articles about players looking at AIs for various games, where they attribute all sorts of random noise to "intelligent" AI behavior, where none exists.  Player confirmation bias can work in the positive or the negative for a game developer.  I just refrain from saying "this is what's going on" when I can't actually observe it.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 30, 2019, 08:20:13 PM
Faction_placement works in a way that the bonuses will appear in squares that previously contained supply pods.

That would explain my observations on land.  It would also seem to imply, that factions that don't have supply pods next to them, won't get any help.  And also, that the help will be overwhelmingly nutrients.  Not other things you might want like a minerals resource, an extra Speeder, etc.

Quote
Actually when we will add forests to the mix, it makes also sense from the storyline point of view because forests can be popped from supply pods.

Telling a story requires that you do A, B, and C, in order.  If forests just seem to randomly appear on the map, that's not a story.  Walking up to a supply pod, popping it, having forests go everywhere, and getting a dialog box explaining what just happened, that's a story.  Player did something, it had a consequence, player knows they could possibly do it again in the future.  Just randomly having forests appear on Planet is completely nonsensical, is not storytelling, and does not respect player agency.

This kind of tradeoff is exactly what GNS Theory (https://en.wikipedia.org/wiki/GNS_theory) is about.  What you might think is a perfectly ok thing to do as a Gamist, to drop forests on the map because the minerals are highly desirable for a starting city, is damn irritating to either a Narrativist or a Simulationist.

Please try to remember that there are a lot of Narrativists playing SMAC.  Narrative is the reason that people are still playing and talking about this game 20 years later.  When I post on /r/4Xgaming that GOG is having another $1.49 sale, it gets 93 upvotes.  That's the highest number of upvotes for any discussion subject right now, and it's the highest number of upvotes of the past three months.  That pattern has been generally true in the past as well, for that 13.5k subscriber forum.  SMAC in its own weird way is badass like that, or at least $1.49 SMAC is.
Title: Re: SMACX Thinker Mod
Post by: dino on March 30, 2019, 11:14:24 PM
I think one guaranteed monolith for ai would be the best, forest from the start could spread too fast and eat too many rainy tiles before ai can put farms on them.
If some player wanted to help ai with an early development even more, there is always free former option, it will mix forest with farms.
It also has to be ai only, I can utilise two nutrients on rainy terrain way better than ai, to spam colony pods.

***
Regarding colony pod placement, I've actually red through thinker source and it seems that all necessary functions are already disassembled, below I propose changes to the code that should:
1) Prevent ai form ignoring excellent terrain nearby and build bases in a stright line toward monsoon jungle, with increasingly higher travel distance for colony pods ( screenshot from my previous post ).
2) Prevent ai from ignoring few tiles of excellent terrain when it is surrounded by a lot of fungus.
3) Allow ai to travel colony pod across few tiles of empty terrain, to settle on the other side of arid plateu/west slope/great dunes.

Proposed changes, with comments explaining reasoning behind them:
I didn't compile, or test it, could made syntax errors ( but hope it's ok ), it's jus much easier to present my ideas this way)

Code: [Select]
int base_tile_score(int x1, int y1, int range, int triad) {
    const int priority[][2] = {
        {TERRA_RIVER, 0}, // was 2, river doesn't matter much and few river tiles scew the result
        {TERRA_RIVER_SRC, 0}, // was 2,  river doesn't matter much and few river tiles scew the result
        {TERRA_FUNGUS, 0},
// changed from -2, negative values from few arid/moist fungus tiles shouldn't outweight too easily good terrain with few rainy, or resource tiles
// I deal with the fungus with other changes later
        {TERRA_FARM, 1},  // was 2, reduce impact of terraforming from nearby base
        {TERRA_FOREST, 1}, // was 2, reduce impact of terraforming from nearby base
        {TERRA_MONOLITH, 6}, // was 4, but do not add rainy/rolling bonus later
    };
    MAP* sq = mapsq(x1, y1);
    int score = (!is_ocean(sq) && sq->items & TERRA_RIVER ? 2 : 0); // comparable with energy bonus, wich I'd value much less than nutrient/minerals
    int land = 0;
       
if (sq->landmarks && !(sq->landmarks & (LM_DUNES | LM_SARGASSO | LM_UNITY | LM_RUINS)))  // with my changes monolith provide a lot of weight and fungus doesn't have negative impact, so do not add magnetism to ruins
        score += (sq->landmarks & LM_JUNGLE ? 24 : 12); // one flat bonus for a landmark, 3 : 2 for each tile caused monsoon to outweight excellent land from 20 tiles away and medicore land from 40 tiles away

range *= (triad == TRIAD_LAND ? 3 : 1);
  // could be changed to 2 : 1, to increase search area, if colony pod was capable of refusing to settle on below 13 score terrain until it reach its destination.
// Basically before you build base when 3 tiles away from previous one, check base_tile_score() for current location, if it's less than 13, continue moving toward better destination
        // If it reach destination tile without deploying on the way, build base there.
// with these two adjustments it should be capable of crossing few tiles of arid plateu/east slope/great dunes to reach oasis/landmark on the other side,
// eventually these gaps of terrible terrain would be settled anyway, after all good spots were used

    for (int i=0; i<20; i++) {
        int x2 = wrap(x1 + offset_tbl[i][0]);
        int y2 = y1 + offset_tbl[i][1];
        sq = mapsq(x2, y2);
        if (sq) {
            int items = sq->items;
            score += (tx_bonus_at(x2, y2) ? 6 : 0);
    score -= (tx_bonus_at(x2, y2) == RES_ENERGY ? 4 : 0); // value energy much less

            if (!is_ocean(sq)) {
if (!(items & TERRA_MONOLITH)){
if (sq->level & TILE_RAINY && sq->rocks & TILE_ROLLING) // rainy and rolling is very valuable for a new base
score += (items & TERRA_FUNGUS ? 1 : 4); // fungus has to be removed
else if (sq->level & TILE_RAINY)
score += (items & TERRA_FUNGUS ? 0 : 2); // fungus has to be removed
else if (sq->level & TILE_MOIST && sq->rocks & TILE_ROLLING)
score += (items & TERRA_FUNGUS ? 0 : 2); // fungus has to be removed
}
                                else if ( sq->items & TERRA_FUNGUS ) score -= 2; // Monolith on fungus - ruins most likely, so reduce weight of monolith cluster
            }
if (i < 8) {
if (triad == TRIAD_SEA && !is_ocean(sq)
&& nearby_tiles(x2, y2, LAND_ONLY, 20) >= 20 && ++land < 4)
score += (sq->owner < 1 ? 20 : 5);
if (is_ocean_shelf(sq) && !(items & TERRA_FUNGUS)) //fungus has to be removed
                    score += (triad == TRIAD_SEA ? 3 : 2);
}
            for (const int* p : priority) if (items & p[0]) score += p[1];
        }
    }
    return score - range + random(6) + min(0, pm_safety[x1][y1]);
}

And again get rid of 2 tiles bases spread on jungle. Instead of using extra nutrients, to rapidly settle jungle and surrounding area ai gets clustered bases with too much food and too little production.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 30, 2019, 11:33:30 PM
I think one guaranteed monolith for ai would the be best,
From a human player's standpoint, it's definitely less disruptive to the narrative than a magically appearing forest.  Yes aside from the Ruins, Monoliths don't just appear on the map without a player popping a pod.  But story-wise a Monolith is not something that a player "does".  The player didn't bring a Monolith here, the player simply discovers that it is here.  Whereas, humans bring trees with them. And robot mining equipment.  And robot farmers.  And robot solar collectors.

Quote
If some player wanted to help ai with an early development even more, there is always free former option.

I wonder if it's possible to change the way a Headquarters works, so that it always gets an extra 1-1-1 of resources.  Or even 2-1-2.  Making sure that sure that every faction has at least 1 viable city, might help a lot with starting stability issues.  I think the idea of "your capitol provides more stuff" is pretty common in the 4X genre.
Title: Re: SMACX Thinker Mod
Post by: dino on March 31, 2019, 08:18:54 AM
The forest would appear in place of unity pod, near the place human crashlanded, it's obvious they spilled the seeds, when crshing.
You also complain about gamism in a game where harverstable forest can pop to existence in a year.
Title: Re: SMACX Thinker Mod
Post by: dino on March 31, 2019, 11:23:04 AM
I've realised that with my changes The Ruins would be almost as bad, as Monsoon Jungle previously, so I've added two lines of code to deal with it in my post about improving colony pod deployment.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 31, 2019, 02:21:56 PM
The forest would appear in place of unity pod, near the place human crashlanded, it's obvious they spilled the seeds, when crshing.

You are laboring under delusions of already knowing how the game is played.  There's a point at which I can't impart game design sense to anyone else.  You have forgotten that a human player never sees a supply pod.  They only see the forest near where they land.  The only reason you know about supply pods is because you're deep into the algorithms of how all this works internally.  You aren't trying to see it from the perspective of a player who's never seen this mod, and who may never ask questions about this mod.

Quote
You also complain about gamism in a game where harverstable forest can pop to existence in a year.

So go give tanks Pegasus wings then, because Nothing Really Matters [TM].
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 31, 2019, 03:02:49 PM
This kind of tradeoff is exactly what GNS Theory (https://en.wikipedia.org/wiki/GNS_theory) is about.  What you might think is a perfectly ok thing to do as a Gamist, to drop forests on the map because the minerals are highly desirable for a starting city, is damn irritating to either a Narrativist or a Simulationist.

Some features might result in autistic screeching, yeah. Adding resources on the map is definitely non-vanilla behaviour, so this should be a configuration option as have been earlier suggested. For the most part, this mod is suppposed to keep the vanilla game mechanics. I'm kind of inclined to keep this an AI-only feature by default, since the human player will have those pods to pop anyway. The point is to mostly provide an early game advantage so that the factions don't get bogged down in nutrient-poor starts. That's why a monolith may not be nearly as useful because it doesn't lift the nutrient production cap on a tile.

I think, I've figured out how your colony pod placement works...
It just use the original code, but before it moves you check if there is a base within 2tiles radius, if not and a base can be built, you do it instead of moving.

For the most part it was not supposed to use original movement code, since the new base placement code should replace it. The old code is only a fallback mechanism in case something fails with the search. There is some kind of a flaw in the way movement orders are processed that results in this weird behaviour. Usually it is supposed to go to the nearest usable base site, and not go seek far away landmarks.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 31, 2019, 03:34:46 PM
Looks I have to copy a screenshot from the recent playtesting thread, I just.... have to do it.

Quote
swiss cheese
swiss cheese

The Weather Paradigm driven Datatechs have been going nuts with Boreholes for a long time.

That's some advanced level terraforming right there. Just look at how nicely the pop-maxed bases are placed in rows and so on.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 31, 2019, 03:42:39 PM
I'm kind of inclined to keep this an AI-only feature by default, since the human player will have those pods to pop anyway.

At least the AIs don't care what story they're being told.  The human player will rarely if ever see what goes on at an AI landing site.  They might see what happens with the Cult of Planet, Caretakers, or Usurpers.  Even then, maybe they are always placed in an area of the map that's black / unexplored to the human player?  I can't remember if I've ever actually seen Courage: To Question get founded, for instance.

Quote
That's why a monolith may not be nearly as useful because it doesn't lift the nutrient production cap on a tile.

However the 2-2-2 of a Monolith has a pretty good nutrient to minerals balance for spewing out colony pods at a good clip.  3 nutrients and 1 mineral does not get you the fastest colony pods.  You want to get to size 2 rapidly, then kick up the minerals to knock it down to size 1 again.  Excess nutrients with no minerals to match, actually makes everything take longer, because it'll try to go to size 3.  Most factions will drone riot at 3.  Even if they don't, it's just taking a lot more food to make a colonist, absent any substantial minerals increase.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 31, 2019, 03:53:46 PM
That's some advanced level terraforming right there. Just look at how nicely the pop-maxed bases are placed in rows and so on.

It's also longstanding terraforming.  They got the Weather Paradigm pretty early on.  They've been the powerhouse of the game and were giving me lots of free troops when I was invading the Believers.

And would you believe that by delaying the availability of such terraforming techs to everyone else, and doubling their completion time, and making Supply Crawlers cost 50 minerals with a Fusion reactor, I'm not technically out of the game yet?  And I've not built a single Condenser or Borehole, nor do I convoy anything with Supply Crawlers except 1 that was left over from something.

You just made me think about Supply Crawler costs again.  In the screenshot, none are visible, but Reveal Map may not show units.  I'll check whether any were produced.  I'm playing this game so I'm not going to cheat to stare at it.  We are allied, so I could get a unit up there eventually to look around, but I've got other game pressures.  Even if we weren't, I could eventually launch a Conventional Missile and use it as a scout, since in my mod they don't use fuel and stay aloft indefinitely.

Roze's quantum supply crawlers
Roze's quantum supply crawlers
even quantum crawlers cost roughly 50 minerals
even quantum crawlers cost roughly 50 minerals

Long story short, I have +1 INDUSTRY and am paying 45 minerals for a Quantum Supply Crawler.  Roze effectively has +4 INDUSTRY and should be paying 30 minerals.  She has only built 4 recently.  I don't know if she built more before.  Does your latest development version use supply crawlers to rush Secret Projects?
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 31, 2019, 08:14:41 PM
Thinker does not use supply crawlers or energy reserves to rush secret projects in any situation. It maybe occasionally uses artifacts to rush projects, but I'm not sure actually. It might also just attempt to connect them to the network nodes. Artifacts are handled by the default movement code. I've been thinking about implementing project rushing but it might result in run away AIs accelerating even faster, and maybe it is also annoying for the players to see the projects snatched away with little warning. It regularly completes projects with the overflow minerals though.

Regarding colony pod placement, I've actually red through thinker source and it seems that all necessary functions are already disassembled, below I propose changes to the code that should:
...
And again get rid of 2 tiles bases spread on jungle. Instead of using extra nutrients, to rapidly settle jungle and surrounding area ai gets clustered bases with too much food and too little production.

Jungle bases are packed densely because by the middle game they will max out the population cap so quickly with all the extra food. Also formers will not attempt to build boreholes on jungle tiles because it would waste the food bonus. Probably this is not even a big issue, but the initial placement could maybe follow 3 tile spread and later (after more bases are built) it could fill the gaps using the 2 tile spread. I have not evaluated the code in that post in detail because there's been some other issues to look at too.
Title: Re: SMACX Thinker Mod
Post by: bvanevery on March 31, 2019, 09:20:19 PM
It might also just attempt to connect them to the network nodes.

I saw the AI do that in an AI vs. AI test game.  I was surprised.  None of the AIs are consistent about it either, because I can readily see the AIs hoarding Artifacts even late game.  Sometimes I'm able to take them when I conquer a city.  Other times they just get destroyed.

Quote
I've been thinking about implementing project rushing but it might result in run away AIs accelerating even faster,

It's a certainty.

Quote
and maybe it is also annoying for the players to see the projects snatched away with little warning.

It is.  I already see that in mid to late game.  Secret Projects are born and die like mayflies, and I usually can't do anything about it.  I'm too busy trying to catch up on the most basic production, in the face of all the AI production spam.

I hope some day you accept that your AI has become competent enough, that the buffs given to the stock "stupid" AI, need to go away forever.  It's not an interesting game to be summarily clobbered by an AI endgame when I've only just gotten an empire together.  My current test game, is the last time I'm going to  play on Transcend with cost_factor=7.

It remains to be seen if even cost_factor=10, same as the player, is enough.  The AI still has the eco-damage abuse advantage, and there just might be that much potential in Condensers and Boreholes, even with all the delays I've implemented in 1.29 of my mod.  There's a point at which I can't make it any more painful for players who are only playing the stock game, and don't even know what Thinker mod is.

I could see raising the Weather Paradigm from 400 to 600 minerals, but I can't see moving it later than B3 Ecological Engineering, which is already much later than the stock game.  Half the point of the Weather Paradigm is giving you early access to all the nifty terraforming gewgaws.  600 minerals would make it a "double cost" Secret Project, as all my other early ones cost 300.  Aside from the Ascent to Transcendence, 600 minerals is the highest expense level I have in the game.  It's for the latest game techs, like the Cloning Vats, which I deliberately stuck near the end of the tech tree.

Now I could increase the cost of many Secret Projects, totally recalibrating them to have a much steeper progression, as I've otherwise done with weapons, armor, and chasses.  IIRC correctly Fission Armor went somewhat down this road, and Mart did it in his work as well, although he didn't change when you got the techs.

But if it's only Thinker mod that is breaking the enjoyability of the experience for the usual player, I question whether it's worth going down that design road.  Seems like it would be more rational not to recommend Thinker mod to anybody.  At least, not without huge caveats about what kind of game a particular kind of player is expecting.  People make highly qualified appraisals of 4X TBS games on /r/4Xgaming all the time, and they aren't shy or kind about it.  There's definitely a class of player represented, where right now I'd honestly have to say the experience of Thinker mod sucks rocks.  It's an interesting piece of technology that demonstrates the production potentials of the game, but it's just there to abuse you and make you lose.

The kind of player who wants Thinker mod as it currently stands, is the player who wants "monster" challenges.  I'm not into it, and I never needed an AI for that anyways.  I could have just cranked various resource abuse settings up to Eleven.

I don't like GNU Chess either.  I've never been able to do a darned thing against it, and I'm not that interested in flailing myself with Chess book strategies to figure out why it's beating me.  That's saying a lot because I have played a fair amount of computer Chess, am reasonably competent at it, and have beaten other AIs of lesser abilities from the early 90s.
Title: Re: SMACX Thinker Mod
Post by: dino on March 31, 2019, 09:33:31 PM
Initial 2sq spread hurts early, for benefits later, so I thought getting rid of it completely requires no work and is a slight improvement overall imo.

>Probably this is not even a big issue, but the initial placement could maybe follow 3 tile spread and later (after more bases are built) it could fill the gaps using the 2 tile spread.

That would optimal, but I thought a bit much work just for monsoon.

> I've been thinking about implementing project rushing but it might result in run away AIs accelerating even faster, and maybe it is also annoying for the players to see the projects snatched away with little warning.

Or, eventuall thinker will reach a point at witch you can play on lower difficulty, or less cost_factor cheat and it still will be competitive.
At wich point it will become even more enjoyable and you'll be able to win a race for a SP despite such features, if you sacrifice enough for it.
You can also make an ini switch for it and disable by default, if you are concerned that some gamers would not enjoy that.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 31, 2019, 10:12:34 PM
> Seems like it would be more rational not to recommend Thinker mod to anybody.  At least, not without huge caveats about what kind of game a particular kind of player is expecting.

Recommend it or don't, it's not really my problem. But if people do mention it, one could link to the earlier screenshot with the Data Angels terraforming efforts. Then the players will know what they're signing up to, at least on the highest difficulty. :D
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 01, 2019, 07:17:06 PM
When one thinks about the game design, the main problem in SMAC balancing might be the lack of any effective mechanic to stop one faction from running away with the game. For example Civ 3 introduced an important change and made corruption affect the mineral production too. In SMAC, basically only the bureaucracy drone mechanic attempts to limit expansion, but the limit scales with the map size and efficiency, so the empires can grow pretty huge. Some factions can get really high efficiency bonuses too. Late-game features produce so much psych that even the drones can be taken out of the picture really easily.

Another compounding factor is that the tech costs scale only linearly (probably) while the production keeps increasing exponentially. Might be something to think about although stuff like that is pretty much out of the scope for the next release. I'm pretty much doing only bug fixes/some tweaks instead of new features now. At least one of the changes could be to remove Trance ability from the design_units created prototypes. Probe teams are already overpowered enough so no need to stack it further. I think the unit planner should only attempt to add Algorithmic ability on probes, but they can still keep the armor they were using.
Title: Re: SMACX Thinker Mod
Post by: dino on April 01, 2019, 08:25:17 PM
I think it's a problem mostly on big maps, on standard map factions will fill the land around 2200, end exponential growth ends there.

I think tech cost grows exponentially, but exponent is much smaller then exponential growth of competent player, or thinker.
I'm not sure, but I vaguely remember Ytzii posting tech cost formula somewhere, it was pretty complex. I think it wasmore  linear at the beginning and turned more exponential later.
I also remember year having an impact on the cost, the earlier year the higher cost. Thinker could definitely use rebalance of variables in tech cost formula.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 05, 2019, 03:45:16 PM
Looks like I've found a solution for the colony pod pathing issue. It seems the original movement logic was still somehow interfering with Thinker's commands but it should be dealt with now. The fix should basically eliminate early AI settlement issues but it might still take a little more testing. It really does seem to have a significant effect on the early game. Anyway, the state of the code is looking pretty good now.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 07, 2019, 12:15:40 PM
Thinker mod version 0.9 is now available from the project homepage (https://github.com/induktio/thinker).

A lot of effort and testing went into this version and the changelog reflects it too. Changes are listed relative to version 0.8 obviously.

* Thinker now supports formers based on all triads: design_units will also create gravship formers when the techs are available
* AI formers build less roads and other smaller tweaks to former priorities
* AI sometimes nerve staples bases after UN charter has been repealed
* Military unit production priority is notably increased from previous amounts
* Whenever AI loses bases to conquest, this also triggers an extra priority to devote more resources to building new units
* Tech balance prioritizes more early economic techs to ensure important items are not skipped
* Rebalancing of social_ai logic to match faction priorities more closely
* Alphax.txt included in releases to provide optional changes
* Trance ability removed from design_units created probe teams
* Major adjustments to faction placement to improve starting locations
* Possibility to select custom factions in smac_only mod
* Added command line parameter "-smac" to start smac_only mod
* New option: nutrient_bonus for use with faction placement
* New option: hurry_items allows AI to use energy reserves to hurry production (excluding secret projects)
* New option: cost_factor allows one to change AI production bonuses
* New option: max_satellites specifies how many of them AI will build normally
* Fix spawning issues on Map of Planet
* Fix sea bases sometimes not building enough transports
* Fix colony pods freezing in place or being unable to reach their destinations
* Fix stuff being built on volcanoes
* Fix smac_only showing the expansion opening movie
* Fix custom prototypes having incomplete names
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 18, 2019, 10:51:09 AM
Not much has been happening since the last release. There has been some requests in that the smac-in-smacx mod could be bundled with the release for easier installation. Maybe even dino requested it earlier in this thread, and it's also a good idea to include the other fixes in the smac-in-smacx alphax.txt. It's only going to require minor documentation changes anyway.

As far as the code base goes, I don't see it needing any major changes since v0.9 unless somebody reports something unusual. I'm not sure how much I'll be developing new features from scratch anymore but some bugfixes (if any) could be included. Long term I'm kind of wondering how this mod could be included with OpenSMACX. It would basically require OpenSMACX to provide a patched exe which keeps many offsets at their original values so it wouldn't break Thinker's patching method. It might still require some code rewriting but I haven't looked at it in detail. I would like to see OpenSMACX repo to include a clear build script to replicate the exe patching part, but I'm not sure what other plans Scient has here.
Title: Re: SMACX Thinker Mod
Post by: dino on May 20, 2019, 09:19:50 PM
Inspired by this project, I've returned to learning C++ and will try to implement few ideas I have, sometime next month.
If you are going to put this project on hold, or abandon it, it would be great if you could make your hooks to the exe Scient's way before you let it go.
So even unexperienced coders could continue to develop it and hopefully be able to port thinker to new opensmax releases without touching the exe.

I'm not even sure, if what I wrote makes any sense, I just want as much source code as possible to play with ;) while assembler and RE in IDA is out of my league.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 23, 2019, 07:40:06 PM
Inspired by this project, I've returned to learning C++ and will try to implement few ideas I have, sometime next month.
If you are going to put this project on hold, or abandon it, it would be great if you could make your hooks to the exe Scient's way before you let it go.
So even unexperienced coders could continue to develop it and hopefully be able to port thinker to new opensmax releases without touching the exe.

It's good to have others looking at modding as well, but as a word of caution it's not very simple to go on patching binaries without source code. That's why very early on I decided the project must be done in C++ for it to be maintainable except for some bugfixes that were done earlier. The code is still heavily coupled to the way game binary operates. Otherwise it's pretty standard style C code with the more complex C++ features used only sparingly (no heavy templating used here etc).

Now it's possible to override many parts of the game logic without having a deep knowledge of assembly, but if you need to go anywhere beyond the stuff Thinker currently does, then reversing game code with IDA is most certainly needed. There's no formal API when it comes to binary patching so it's hard to say at this point how easily this stuff could be ported to OpenSMACX without significant rewriting efforts. I don't consider this project abandoned or anywhere close to it, but sometimes one just has to do other stuff in the meantime.
Title: Re: SMACX Thinker Mod
Post by: dino on May 23, 2019, 08:46:45 PM
Good to hear you are going to return to this project at some point in the future.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on May 24, 2019, 03:54:44 PM
I don't consider this project abandoned or anywhere close to it
Ooh, a great weight off my mind. You are a real knight of progress, good sir!
Title: Re: SMACX Thinker Mod
Post by: Liebestod on June 16, 2019, 02:54:40 AM
I made an account here just to comment on this mod.

Especially because there seems to be some negative feedback, I want to express my opinion. This mod is awesome! The AI is so much better!

My game was a normal world size on Thinker level. 70% land and average everything. I played a "balanced" Consciousness (no techsteal, -2 growth instead of -1, +1 research instead of +2).
Using Thinker mod and PRACX mods together. No crashes experienced and secret project videos play.
Usually I crush the ai and their empires are quite sad. Pleasantly, the AI produced empires that had MORE bases than me and even MORE pop than me, EVEN AFTER I POP BOOMED!
The Drones found the monsoon jungle and as of 2200 they STILL have more pop than I do. Zak was able to stay ahead of me in tech much longer than usual.

Of course it wasn't perfect competition. I was able to get Airpower/MMI before the AI and they can't really stop me now. Morgan never really got off the ground, and Yang is lagging far behind even though he has sizable territory (small pop in bases - never boomed).  The AI also isn't ruthless at acquiring secret projects so it's totally possible to get all the ones you want. I understand there's a pro and con there so it's not really a negative. But it does contribute greatly to my advantage that I can get all the good early secret projects.

I didn't find the AI too hard to beat but it's way better than default and thus for me the "fun" level is much higher. Thank you!
Title: Re: SMACX Thinker Mod
Post by: Induktio on June 16, 2019, 11:35:32 PM
Especially because there seems to be some negative feedback, I want to express my opinion. This mod is awesome! The AI is so much better!
Well yeah, I think we can call mission accomplished on that one. Though it can be seen that most of the criticism comes from one source, so there's that. Beyond a certain point one just can't be bothered anymore.

Quote
My game was a normal world size on Thinker level. 70% land and average everything. I played a "balanced" Consciousness (no techsteal, -2 growth instead of -1, +1 research instead of +2).
Using Thinker mod and PRACX mods together. No crashes experienced and secret project videos play.
Usually I crush the ai and their empires are quite sad. Pleasantly, the AI produced empires that had MORE bases than me and even MORE pop than me, EVEN AFTER I POP BOOMED!
I assume you were using the new worldbuilder settings then. Do you think they made a significant impact on the gameplay overall? The AI is pretty adept now at economy building, so it can be much harder to acquire governorship and so forth. During development the economy building was the main focus in AI improvement, since I figured it was the obstacle that would have crippled AI challenge unless fixed somehow.

Quote
Of course it wasn't perfect competition. I was able to get Airpower/MMI before the AI and they can't really stop me now. Morgan never really got off the ground, and Yang is lagging far behind even though he has sizable territory (small pop in bases - never boomed).  The AI also isn't ruthless at acquiring secret projects so it's totally possible to get all the ones you want. I understand there's a pro and con there so it's not really a negative. But it does contribute greatly to my advantage that I can get all the good early secret projects.
On standard map sizes and below, almost always some faction seems to stagnate because of a lack of space, but probably it isn't a big issue if most of the time the factions develop pretty fast. I would call it an issue if it happened on huge maps instead.

What kind of early projects do you consider "good"? I would think it would be pretty hard to get all of the early good ones, since the player shouldn't be able to easily gain a significant advantage over the AIs early-to-mid game. Sure, it was a design choice not to have the AIs rush secret project production and I'll probably keep it that way. It might have a significant gameplay impact if it were changed from the vanilla behaviour.
Title: Re: SMACX Thinker Mod
Post by: Liebestod on June 17, 2019, 06:56:38 AM
I believe I was using the "new worldbuilder settings". Because the world looks like two giant continents rather than continents and islands of random sizes.

And okay I will try my next game on Large map.

I like the WP, Genome, Virtual World and Empath Guild. Was able to get all of them in my particular game. I don't prioritize Command Nexus, Citizens Defense Force, Planetary Transit System or Planetary Datalinks. (I think Transit System makes more sense for HUGE maps, not normal size). I also don't really start building any wonders until I have 10+ bases, supply crawlers to get 10-16 mineral production at most bases, and a few Rec Commons. So in other words I'm not rushing to get the wonders.

As for planetary council votes, I was able to get the governorship but only because things went my way. Someone voted for me instead of Domai, and then again someone chose me over Lal. I think being second on the power rankings for so long helped.

Title: Re: SMACX Thinker Mod
Post by: Induktio on June 18, 2019, 10:24:55 PM
By default the mod contains my Worldbuilder improvements in alphax.txt, so it looks like you were using them. With the original map generator archipelagos were pretty annoying from an unit movement point of view, and they also gimped the AI since it didn't understand how to populate islands. Though now it *does* understand how to do land/sea transitions, but it doesn't hurt to have more contiguous landmasses. I've had a kind of interest in procedural content generation algorithms, so tweaking this stuff was something I've done very early in modding this game.

If you come across some interesting gameplay moments, you could post some screenshots/reports of them too. Especially Thinker's endgame ICS builder empires are truly a sight to behold. Yeah, it's a little bit different than with the vanilla AI.
Title: Re: SMACX Thinker Mod
Post by: Rocky 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.
Title: Re: SMACX Thinker Mod
Post by: Induktio 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.
Title: Re: SMACX Thinker Mod
Post by: Rocky 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.

Title: Re: SMACX Thinker Mod
Post by: Induktio 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?
Title: Re: SMACX Thinker Mod
Post by: Rocky 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.
Title: Re: SMACX Thinker Mod
Post by: Rocky 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!

 

Title: Re: SMACX Thinker Mod
Post by: Induktio 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).
Title: Re: SMACX Thinker Mod
Post by: Rocky 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.

Title: Re: SMACX Thinker Mod
Post by: Rocky on July 04, 2019, 09:15:46 AM
Just wanted to let you know that after a fresh install, everything works perfectly now.

Thanks!
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 13, 2019, 10:16:10 PM
A new develop build 20190713 is now available from downloads. (https://github.com/induktio/thinker) 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.
Title: Re: SMACX Thinker Mod
Post by: Jade Panther 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) (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:
Title: Re: SMACX Thinker Mod
Post by: Jade Panther 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.
Title: Re: SMACX Thinker Mod
Post by: Induktio 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.

Title: Re: SMACX Thinker Mod
Post by: Jade Panther 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.
Title: Re: SMACX Thinker Mod
Post by: Induktio 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?

Title: Re: SMACX Thinker Mod
Post by: Jade Panther on July 20, 2019, 06:52:47 PM
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.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 21, 2019, 09:30:20 PM
> 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.
Title: Re: SMACX Thinker Mod
Post by: Jade Panther on July 22, 2019, 03:41:39 AM
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.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 22, 2019, 03:19:52 PM
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.
Title: Re: SMACX Thinker Mod
Post by: Jade Panther on July 23, 2019, 05:24:36 AM
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:

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?
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 25, 2019, 07:26:16 PM
> 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.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 16, 2019, 01:58:43 AM
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 ;)
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 17, 2019, 10:43:22 AM
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.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 17, 2019, 12:47:53 PM
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.
Title: Re: SMACX Thinker Mod
Post by: dino on August 17, 2019, 02:11:28 PM
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.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 18, 2019, 05:00:49 PM
> 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.
Title: Re: SMACX Thinker Mod
Post by: dino on August 18, 2019, 05:39:56 PM
> 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.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 18, 2019, 06:12:23 PM
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.
Title: Re: SMACX Thinker Mod
Post by: dino on August 18, 2019, 06:31:19 PM
> 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.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 18, 2019, 09:17:58 PM
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.

I tend to think that the biggest long-term factor affecting the AI power in this mod is how well their research focus matches those techs that lift the resource production caps per square and provide advanced terraforming. Early terraforming is important too, but the faction that gets to build boreholes with no resource restrictions first tends to balloon really quickly from there. That extra energy is so important by mid game. The idea regarding additive tech_balance bonuses seems valid. In essence it would act as a floor for tech values, while a multiplier would not have a big effect if the base value was already really small (sometimes it is).

Also what do you think of the default tech cost formula (http://alphacentauri2.info/index.php?topic=3505.0) in the game? Should it be adjusted to deal with the much higher tech rate in the later stages in this mod? That might be one area where it would be valid to reconsider some of the AI bonuses or adjust it so that the tech rate will not get compressed to 1 tech/turn levels in the late game, for both human and AI factions alike. It should be possible to rewrite the tech cost function entirely if there's enough of a reason for that.
Title: Re: SMACX Thinker Mod
Post by: T-hawk on August 18, 2019, 10:31:18 PM
If you do anything with tech rate, I think it should just work like all the later Civ games, the cost of each tech is fixed depending on where it is on the tree.  Something like 20 labs for first-level techs, times 1.5N for a tech of level N, would add up to roughly (and of course you could calculate it exactly) the current total cost for the entire tree but scale up more smoothly throughout the game.  This would also reduce the impact of beelining restriction lifting, since the level 4 and 5 techs would be more expensive compared to filling in more early techs.

That's a major change and not at all something you'd put into an AI-only mod, but if you've decided to take on broader scope, that's one of the most fundamental improvements from SMAC to all the later Civs.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 19, 2019, 12:22:51 AM
T-hawk, what else do you think the later civs improved on that might be worth sharing?

Maybe it would be interesting to solicit game design thoughts more broadly? I don't know what kind of changes you feel like making, induktio.

SManiaC was very well received when released. I'm not familiar with the more recent mods like Binary Dawn and bvanery's one, but there could be some lessons to learn. Edit: Probably more from the multiplayer mods because so much of other mods is messing with the AI in ways that don't really apply any more for Thinker.

Interestingly, SManiaC's description explicitly mentions infinite forest as a common effective strategy in multiplayer. Perhaps we can teach the Gaians to use it effectively to give them that different flavour.
Title: Re: SMACX Thinker Mod
Post by: T-hawk on August 19, 2019, 03:31:26 AM
The big one Civ 3 players rejoiced over was unit support paid at the nationwide level rather than having to micromanage it per base.

The other big one in Civ 3 is that your units can't use roads in enemy territory, so building them isn't a huge potential liability.

The big one Civ 4 players rejoiced over was no riots - only the unhappy marginal citizen ceases to work, not the entire city.

The other big one in Civ 4 is tracking production and tech per item, so if you change production or research orders, the invested progress stays with the original item.  That would be quite a task to implement in SMAC, for sure.

The big one for Civ 5 is that cities have their own inherent strength and hit points, no more wiping out a civ's best base or capital with a single warrior.

Some less major stuff:

Scaling tech cost by tree depth applies to diplomacy too, starting in Civ 3, techs at the trade table are worth money roughly equal to the labs investment.

Civ 4 significantly downscaled the load of worker micromanagement, by increasing their costs but reducing the time to build improvements.  You have half as many workers but each completes things twice as fast, same results, half the micromanagement.

And of course the culture subsystem for borders, although I don't know how you'd invent that from scratch for SMAC.  Although one subtle but welcome tweak would be that a tile at equal distances from two competing bases should belong to the older base, not the newer.  It's stupidly easy to steal territory by aggressive settling in SMAC.  I think Civs 4+ outright disallow settling in someone else's owned territory, which is a good rule, although SMAC's 8-tile border distance is a bit too much range for that.
Title: Re: SMACX Thinker Mod
Post by: dino on August 19, 2019, 08:37:20 AM
> Also what do you think of the default tech cost formula in the game?

It's very needed, half of the tech three has almost no playing time. When you start geting new tech every 1-2 turns, it's best to just tech away and skip few tiers of units.

1)
The big offenders are parts of the formula that reduce tech cost as the game progress: with turns passed and with amount of tech owned by leading faction.
These are mechanics meant to ease casual player. The second one could be left in place for ai, but removed for human player.

2)
The cost could use, some adjustable through ini file exponential modifier to number of techs count impact on the cost, to match exponential growth of thinker ai, or competent player.
So at the beginning it would be the same as vanilla and at the end of the tech tree cost could be few times higher ( lets say 2x, but adjustable variable would make it easy to playtest, adjust to personal preferences ).

Tech cost dependant on tech tier is an excellent idea, that would help ai, that can't consciously beeline the most necessary tech, but it's probably difficult to implement.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 19, 2019, 11:28:07 PM
Thanks for the response, T-hawk.

I'm not sure I'd want all of those, but it's interesting to hear your perspective.

Continuing to muse on SMAC game design, I'd like it if supply crawlers made a bit more sense, too. Perhaps more like the caravans that continue to move around the map. Obviously one would hope that it leads to interesting piracy opportunities and territory control issues, but I kinda doubt it would really make much difference.
Title: Re: SMACX Thinker Mod
Post by: dino on August 19, 2019, 11:39:15 PM
Crawled resources could be divided by a calculated by pathfinding algorithm amount of turns it would take a crawler to reach a home base.
Would make crawlers on better chasis, or building roads/magtubes to crawled tiles useful.

Interrupting supply line with ZOC of enemy unit, would lenghten calculated distance, or even cut out resource.
Crawlers sitting on resource are even easier target than travelling ones, so actually travelling them on the map wouldn't bring much to the table.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 20, 2019, 12:01:44 AM
I was thinking of a bigger departure from the system with a crawler going to an area, sitting there statically and sending resources back in caravans.

Anyway, I think it's a pretty off-topic thought ;)
Title: Re: SMACX Thinker Mod
Post by: Vidsek on August 20, 2019, 05:56:18 PM
   Interesting crawler ideas.

  I've been wishing that there could be an option to give crawling resources a cost based on the distance to the base receiving, but a cost in *energy* (meaning fuel) not the resource being harvested.

  Having the crawlers actually moving about might run into one snag: they can send home stuff across water gaps they themselves cannot cross.  I usually just imagine invisible trucks and ships handling the relay :D
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 20, 2019, 09:31:12 PM
If you do anything with tech rate, I think it should just work like all the later Civ games, the cost of each tech is fixed depending on where it is on the tree.  Something like 20 labs for first-level techs, times 1.5N for a tech of level N, would add up to roughly (and of course you could calculate it exactly) the current total cost for the entire tree but scale up more smoothly throughout the game.  This would also reduce the impact of beelining restriction lifting, since the level 4 and 5 techs would be more expensive compared to filling in more early techs.

That's a major change and not at all something you'd put into an AI-only mod, but if you've decided to take on broader scope, that's one of the most fundamental improvements from SMAC to all the later Civs.

Lots of replies here it seems, so this tech rate issue has been bothering other players too. It does feel somewhat broken if the end game techs get compressed into only 10 turns of gameplay or similar. I would also identify the tech cost function as the main point of interest for inclusion in the next Thinker release.

I've been digging through the relevant parts of code and it seems implementing the tech cost change shouldn't be too difficult. After all, we're just reimplementing a function that returns a simple integer. Of course, this change hasn't been implemented yet in the develop builds, and I don't generally promise to implement any particular things because motivation lol. Just to note, this mod isn't "only" about AI, it has also a rewritten random map generator, so this kind of change isn't entirely off the theme.

Later Civ games changed some fundamental game mechanics mainly for balance reasons and also to help the AI. Coindicentally T-Hawk also mentioned some of those mechanics which have been talked in this thread previously. Nationwide unit support to name one of the most important ones. But now I'm probably going to look mostly into the tech cost issue when I'll have more spare time to dig through the code. I kind of prefer the idea that costs should follow a formula like 20 * 1.5^N, scaled for map size (square root?) of course.
Title: Re: SMACX Thinker Mod
Post by: Rocky on August 23, 2019, 04:01:50 PM
Induktio, would it be possible to add a setting in the AI config files that allows the player to set the amount of bases the factions can build?

Your AI does an amazing job with expanding but on larger maps it gets so many bases that any kind of war becomes a drawn out fight with lots of micro-management. Several times I considered trying to stop a neighboring faction from becoming too powerful by invading them, but at that point they have so many bases (somewhere between 20-40) that I end up going for a more peaceful builder-game instead.

I like the option/idea of the Gaians having a different terraforming process as was discussed earlier. With the Gaians having fewer Boreholes, would it be possible to encourage the AI to place higher priority on building Tree Farms/Hybrid Forests? (Unless that was already the case) It would fit their nature theme.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 24, 2019, 03:53:25 PM
Well good news, it seems it is very feasible to rewrite the tech cost function. As a proof of concept, I implemented a patched version of tech_rate function that can change the costs for any tech. Changes are immediately displayed in the infiltration window etc. Now the main thing remaining is to decide how to do the cost scaling in this new version.

On a standard sized map with default tech rate, the first tech costs normally 14 labs. Using T-Hawk's formula the first one would cost 20*1.5^1=30, so not sure what to make of that. Level 16 Transcendent Thought would cost 13 thousand labs. That's maybe too much. There's also some other mechanics that could be used here:

1) Tech costs can be combined from a linear and an exponential factor. The latter should become more relevant towards the end of game to account for all the energy increases.
2) Use tech costs as an anti-runaway faction mechanic. Researching a tech for the first time should be much more expensive than researching it when all the other factions already know it.
3) Should we equalize tech costs for human and AI factions or keep them somehow dependent on the difficulty level?

In any case the new system should probably be based on these elements: 1) tech costs are mainly dependent on the tech's level, 2) map size scaling should stay the same as previously.


> would it be possible to add a setting in the AI config files that allows the player to set the amount of bases the factions can build?

Well sure, I've been thinking about that. But the main thing is that the bases have both an upper limit (40 bases on Huge) and another scaled on map size. It might need two different config options to have it adjust sensibly on different map sizes. Maybe a percentage multiplier for the default map scaled limit and another value to set the global upper limit?
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 24, 2019, 08:30:49 PM
I think the base limit setting could be the number for standard size maps with a comment explaining how it is scaled with map size.

Re: tech costs, I think techs get shared around OK already through trade, so if everyone else knows a tech it is cheaper to get it.

I think bonuses for the AI should be decided experimentally, it's just about getting a good play experience.
Title: Re: SMACX Thinker Mod
Post by: T-hawk on August 26, 2019, 03:33:08 PM
The factors of 20 and 1.5 were just an off-the-cuff guess, adjust it however you want for the higher tiers to come out right.  Or never mind a formula and just specify some reasonable sequence directly like 20, 30, 50, 80, etc.  Do remember there's often only about two techs per tier up at the high end, unlike the later Civs, so it could be okay if they cost quite a bit each.

The existing formula already includes discounts for a faction trailing in tech and for AI difficulty level.  I think those are good enough to just keep the same rather than mod.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 27, 2019, 05:37:35 PM
> I think the base limit setting could be the number for standard size maps with a comment explaining how it is scaled with map size.

In the next update, base limit setting will get a new configuration option called expansion_factor. It multiplies the default expansion limit by a percentage. Default limit will now be scaled proportional to (MapWidth*MapHeight)^0.4. Smallest map sizes will get some additional scaling because otherwise space would run out so quickly. It will be a very nice addition to the other difficulty config options. Planet factions will also build less boreholes in the next update.

However, the main thing I've been thinking is of course the tech cost update. It requires some more number crunching before I'll deploy a new version. One of the oddities of the default tech costs is that the first tech is dirt cheap, and then it multiplies very quickly after that. I might even try to replicate the same costs for say first 3-4 techs in the new formula. Level 1-3 costs should probably stay close to their previous amounts, but it might be hard to factor in various tech beelining tactics that were used with the old formula. First notable cost increases should appear on levels 4-5.

> The existing formula already includes discounts for a faction trailing in tech and for AI difficulty level.  I think those are good enough to just keep the same rather than mod.

But there's one gotcha here: human players could purposefully avoid learning redundant techs because having a lower known tech count, they would gain an advantage in "trailing" tech level mechanics. If the discounts are only tied to how many factions know a particular tech, then it might be harder to exploit.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 27, 2019, 06:39:51 PM
Those sound like good changes :)

Did you explore the effectiveness of a forest-heavy approach?

I wouldn't worry too much about exploits, but decreasing cost by number of other factions with tech does make more sense.
Title: Re: SMACX Thinker Mod
Post by: dino on August 28, 2019, 08:05:21 AM
I'd be vary of overdoing various anti "runaway" mechanics. The whole point and fun of the game is to either runaway, or to not let runaway the ai, depending on difficulty and player skill.
The fact that tech cost raise exponentially is an anti runaway mechanic in itself.

This could also be an occassion to give diplomacy more meaning:
No contact, no bonus. For each faction in contact, that own the tech:
1) informal truce, truce, or war: -2% ( infiltration -4%)
2) treaty: -4%  ( infiltration -6%)
3) pact: -8%

It's too easy for a player to exploit certain mechanics and negate ai tech advantage, so some other mechanics from later civs could be useful ( I understand that, these ideas may be difficult to implement ):

Make it impossible to trade/steal tech you don't have prerequisites for. It's reasonable in itself, but additionally if we went for fixed tiered tech costs, it'd prevent ai to some extend from trading away high end techs easily. Or better yet make ai refuse to trade tech with too high tier difference.

Make tech trade, probe steal, or spoils of war, reduce cost by 50%, instead of just giving tech. You could hold a separate list of traded/stolen techs and it should override diplomacy bonus, not add to it.
Eventually you could display these techs in tech report screen in brackets, so player could track the techs he already has traded/stolen.

Make stealing a unit, don't give prototype, but cause all unknown techs required for stolen unit, to be included in traded/stolen list ( if the player has prerequisites for them of course ).

Increase ai weights for research selection of lower tier and traded/stolen techs.

Title: Re: SMACX Thinker Mod
Post by: Induktio on August 28, 2019, 07:55:25 PM
Hmm :) Been a little busy lately with other things, so this is still under consideration.

> This could also be an occassion to give diplomacy more meaning:
> No contact, no bonus. For each faction in contact, that own the tech:

Something like this could be done quite easily, but I'll probably first try a simple version where the costs are reduced by how many factions know the tech, regardless of diplo status. The later items you mentioned are getting more complicated. I'd like to adjust how much energy the AI demands for techs in trades, but not sure if there's any simple way of doing that. Plus some of those other items might require changes to the save game format, which is something not to be taken lightly.

> Did you explore the effectiveness of a forest-heavy approach?

I did test factions with/without boreholes but that's about it. The latter would just get stomped by the end game because of the energy difference.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on August 28, 2019, 08:30:15 PM
I think the point of the forest strategy is to save money on formers and expand more in the early and mid game.

Also, I guess if you play with default climate change and native life it can make a difference.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 31, 2019, 08:46:07 PM
Okay, finally an update. Develop build 20190831 is now available from downloads (https://github.com/induktio/thinker). This update features a new tech cost implementation in addition to the features I posted before (config option is revised_tech_cost). In the end it was a tricky feature to implement, so for the first time ever, Thinker also stores some variables in the save game to manage the game state. The save games should be fully compatible with non-Thinker versions of SMACX.

The main formula for new tech costs is:
2 * Level^3 + 98 * Level

So it results in this kind of cost progression on standard sized maps:
(click to show/hide)

It seems a cost formula with an exponential term is not needed, because a cubic term will increase the costs quite quickly. I'm still totally undecided on what kind of constants to use in this formula or how to do the difficulty scaling. These kind of factors are multiplied with the base cost:

* For AIs, one unit of cost_factor below/above 10 equals a 5% bonus/penalty
* For humans, cost discount is 7% * (Transcend - current difficulty)
* Map size scales according to the square root
* All other faction/alphax.txt factors should work as before
* Tech stagnation is the same as before, but it could changed
* If 2 or more factions with commlink has the tech, discount 25%
* If only 1 commlink faction has it, discount 15%

For example, if you play on Transcend with cost_factor=10, then you are on equal footing with the AIs.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 02, 2019, 07:59:59 PM
One more factor that I forgot to mention on the list:

For the first 10 techs a faction discovers they get decreasing cost discounts. So on a standard map, the first tech will cost 14 labs instead of the 100 labs default price. This approximates the tech costs in vanilla game mechanics for a couple of first techs.

The idea here is that level 1-3 costs stay relatively modest and the big cost increases should begin from level 4 onwards. I was also considering using 3*Level^3 instead of 2*Level^3 as the cubic factor, but there might be some issues how that will scale on huge map sizes, because then the later techs would get really expensive. On huge maps techs cost 90/56 = 1.6 more than on standard maps.
Title: Re: SMACX Thinker Mod
Post by: dino on September 03, 2019, 10:17:10 AM
I'm not in the mood to reach the end game currently, but early to midgame works fine.

As for tech for energy trade ai should only accept an energy equivalent of tech cost, adjusted by some modifier based on commerce difference betwean factions.

If we are at diplo, the minimum bribe ai should accept when it threatens you, should be based on your highest owned tier tech cost.
If you can't pay and don't have any tech, they should demand a base that is nearest their territorry.
If their military score ( not power score ) is 2x, 3x, 4x for ai_fight 1/0/-1, this demand should never be an empty threat and always result in vendetta if refused, even when original code would back off.

This new tech cost mechanic will be very easy for a player to abuse by saving money on research and stealing techs with probes.
The only reason it's not a problem with vanilla game, is because player can easily be a tech leader himself instead.
With super high tech costs in the endgame, probe teams will be extremely unbalanced. So my proposal to solve this issue is:

Make a successful tech steal attempt cost half the research cost in energy, adjusted by PROBE social effect.
The part of the original code used for base mind control could be repurposed to display an appropriate dialog window.
If we are at it, the amount of money required for mind control and diplomacy base trade could be given a multiplier.

These ideas are based on the code that is already there and should be easier to implement, then my previous proposals regarding tech trade and probes balance.
I understand the diplomacy code is not dissassembled yet and these ideas won't happen probably, but you've said you'll be looking at diplomacy tech trade, so I threw some more ideas worth looking at when you'll be at it.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 03, 2019, 12:49:10 PM
Glad to see someone playtest it. Do you feel that the revised formula is an improvement in the early and mid game?

I disagree that militarily stronger factions should never make empty threats. I think it should still be probabilistic.

Re: probes, maybe we can just teach the AI to keep their bases defended? Unescorted probe teams are quite easy to deal with and escorted ones can be defeated by probe defences or by destroying their escorts. I don't know how you balance this game mechanic effectively, keeping it not OP and also not tedious or useless. Probably requires some experimentation.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 04, 2019, 08:04:46 PM
Actually some parts of diplomacy are known. For example, there are two separate functions for deciding how much the AI will bid/ask for techs in trade. They are not even very long functions. The right approach here would be to rewrite them in C++ and just redirect the calls to Thinker.

If there's some place where to start rewriting the diplomacy code, that would be a good choice. Only obstacle I see is that some stuff needs to be figured out so that the dialog box code can be called from C++. Now it's just a question of finding enough time to code such a thing.
Title: Re: SMACX Thinker Mod
Post by: Rocky on September 04, 2019, 09:24:39 PM
Does this version also have the option of setting the amount of AI bases? Or is this planned for a later update?
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 05, 2019, 07:34:24 PM
> Does this version also have the option of setting the amount of AI bases? Or is this planned for a later update?

That change was already committed over a week ago, it's in the newest config file.
Title: Re: SMACX Thinker Mod
Post by: Rocky on September 07, 2019, 01:17:04 PM
> Does this version also have the option of setting the amount of AI bases? Or is this planned for a later update?

That change was already committed over a week ago, it's in the newest config file.

Thanks! I somehow totally missed it. I'm looking forward to try it out.
Title: Re: SMACX Thinker Mod
Post by: silva on September 16, 2019, 01:53:09 AM
Hi there folks. First post here.  :D

Alpha Centauri is my favorite strategy game of all time, and is the first game I install in every new PC I buy (the second being King of Dragon Pass). It seems we've finally found a way to improve the AI. So thanks very much to Induktio for this project.

BUT I have this worry that is more or less reflected in the following comment..

Please try to remember that there are a lot of Narrativists playing SMAC.  Narrative is the reason that people are still playing and talking about this game 20 years later.  When I post on /r/4Xgaming that GOG is having another $1.49 sale, it gets 93 upvotes.  That's the highest number of upvotes for any discussion subject right now, and it's the highest number of upvotes of the past three months.  That pattern has been generally true in the past as well, for that 13.5k subscriber forum.  SMAC in its own weird way is badass like that, or at least $1.49 SMAC is.
..pretty much this! SMAC/X is not only a pure logical challenge for me, but also an opportunity to role-play a leader in a ideological conflict in an amazingly evocative futuristic setting. So my question is: Do the patch upgrade the AI while also respecting the planet and factions original personalities? I mean, will Morgan still pursue the more economic enabling techs, or Deirdre pursue environmentalist ones, etc? Or will Deirdre build thermal boreholes left and right and Morgan become a warmonger just because it's more "efficient" from a pure gameplay standpoint?

I intend to give the patch a try anyway, but this is an important question to me.

Thanks again Induktio for the great work.  ;)
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 16, 2019, 02:30:20 AM
In the latest beta, at my suggestion ;p, PLANET factions will build fewer boreholes.

Thinker makes some small changes to AI tech selection: https://github.com/induktio/thinker/blob/de26192bfa0c600d7bb2580a0a30176938971ef2/src/main.cpp#L329

If tech_balance is on in thinker.ini, the ai will prioritise techs that provide certain important benefits, if any of those techs are in the available panel of techs (The AI will not beeline to any techs). In my opinion, these do not affect the lore of the factions.

Thinker optionally also provides a changed tech cost progression formula which makes the late game techs come slower (by default they come all at once at the end, if you have an efficient empire, so you never use a bunch of them).

As far as I remember, thinker makes no changes to faction strategic or diplomatic choices.

Thinker improves the AI's tech selection, terraforming, tactical combat and more. Overall it moves them from "pretty useless" to "quite challenging".

Overall, I find it less immersive to eventually find the AI scrubbing about with completely undeveloped territories and tiny bases than it is to see Gaians with a few boreholes. I would recommend that you use this mod.
Title: Re: SMACX Thinker Mod
Post by: silva on September 17, 2019, 02:07:09 AM
That's great to hear DrazharLn! You just made me more anxious to try this mod.

Are there any options that should set to an .ini file or something to have this more "role-playing inclined" experience?

And what difficulty level is recommended with Thinker? I used to play Thinker level (duh) Ironman in original SMAX as it gave a me a mix of fun and challenge, but an I right to infer that would be too tough in Thinker mod ?
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 17, 2019, 12:27:25 PM
Glad to hear that you are excited :)

Get the latest develop build from here (bottom of page): https://www.dropbox.com/sh/qsps5bhz8v020o9/AADv-0D0-bPq22pgoAIcDRC3a/develop?dl=0&lst=

(That link is from the github project page)

If you're used to Thinker difficulty and don't want a tough challenge, you might like to drop down two difficulty levels or stay on Thinker difficulty and adjust the cost_factor in thinker.ini

No changes are required to get the experience I described in the latest development builds, though you should be aware that the revised tech cost formula is enabled by default (disable in thinker.ini if you like)
Title: Re: SMACX Thinker Mod
Post by: Nevill on September 17, 2019, 09:46:27 PM
I've been away from the SMAC community for a year and a half, and it seems like I've missed some major developments.

Will definitely be trying this out. However, when reading the "State of affairs" thread I noticed DrazharLn mentioning something about Thinker not working in Multiplayer properly? Could anyone please elaborate what issues currently exist? I don't think anything of a sort is mentioned in the readme. Did anyone try a multiplayer game?
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 17, 2019, 10:05:04 PM
Hello to new players. :)

Multiplayer support (or lack of thereof) is mentioned in Details.md. It's maybe easy to gloss over if you just glance over that page, but one has to put all the details somewhere. It should only affect network multiplayer because in those situations, the game has to continuously synchronise data over network. Thinker works by patching lots of stuff in game memory and that would cause a network desync unless some extra large development effort is spent on implementing that feature. I'm not currently planning on doing that because network desyncs are really annoying to debug.

The two main variables that affect the difficulty level are cost_factor (of course) and expansion_factor. The latter decides how many bases the AI wants to build before it stops expansion. On large maps, Thinker AIs can expand *a lot* unless it is limited. Recommended values range from, say, 70 to 140. Anything over that is probably in the extreme challenge territory.

Latest development build also enables a new tech cost algorithm, but that itself shouldn't increase difficulty level. It's more like supposed to slow down the late game tech race. It is also in an experimental phase, so the various factors in the formula might get readjusted before v1.0 based on playtesting. I'm also considering if expansion_factor should be tied to the difficulty level somehow, but now it's just a constant variable that gets applied on all levels.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on September 18, 2019, 12:46:58 AM
I should have been clear that Thinker works with PBEM/hotseat games, I'll edit the post :)

I think Thinker would work well for PBEM/forum games and I would be interested to see how our MP regulars fare against the enhanced AI :)
Title: Re: SMACX Thinker Mod
Post by: Nevill on September 30, 2019, 10:57:23 AM
Been playing a multiplayer game with the mod enabled. Could probably attach screenshots or files if need arises.

AI still defends their bases with scouts while having access to better armor. No, it builds armored units too, but it is strange how a size 6 base building a secret project is only defended by a scout. And it's Sparta of all factions! Was something done to tackle AI building priorities?

It got somewhat better at expansion, but sometimes the logic gets wonky. I conquered PeaceKeepers and had them left with 2 bases, both in the Moonson Jungle. I figured they'd recover quickly, as usually the one with the Jungle gets an enormous advantage. Nope, built nothing but units for the next 20 years, and the first Colony Pod he produced was a sea one! Why? You have all this unclaimed land with insane bonuses, why are you going for the sea? The sea pod got sent to the nearby shore in the vicinity of a Nutrient bonus on a shelf... which was in Gaian territory, since they had one of their starting bases on a shore. So now Lal's newest base is working a shelf square which gives it 1-0-0. Why, just why?

The conquest happened in 2120, and it's 2175 now, yet Lal only has 3 bases one of which is completely useless. He is building a colony pod now, thankfully, but I wonder what's been stoping him the last 50 years.

Also something I noticed in the mod was... an inconsistency when it comes to finishing production. It is not rare to see an AI fill the mineral rows necessary to build a unit... only the unit isn't built next turn. The rows are filled, and there are even red minerals there indicating wasted production, but the unit fails to materialize. This can go on for several turns before the AI decides that yes, it's okay to come out now. It's all very bizarre.

I know AI can switch prioduction at will with no penalties, so something like this could be going on (switching to a more expensive unit, then switching back). I can't remember things like that happening in vanilla, though. Could it be a side effect of hurrying somehow?

If you aren't sure what I am talking about, I have 2 (or possibly 3) consecutive turns of Lal having a base with an armored sentinel in production. All production rows are filled, and the F4 base production screen for his base reads: Sentinels (0 turns). This happens for several turns. Units just do not appear.

No events were observed that could make him switch production or otherwise delay it.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 30, 2019, 08:13:23 PM
Been playing a multiplayer game with the mod enabled. Could probably attach screenshots or files if need arises.

So do you mean you're playing this in PBEM mode then? Potential bug reports dealing with this kind of low level stuff definitely need a save game to inspect. PBEM mode has received very little testing, but first thing I would verify is whether both players are running the same version of Thinker with the same settings. Otherwise AI behaviour might be very inconsistent, worse still, if the other player does not have Thinker AI enabled. So this kind of thing can't be debugged without a save game in any meaningful way. There might some things in your description that can be looked at for the next version, though.
Title: Re: SMACX Thinker Mod
Post by: Nevill on September 30, 2019, 08:19:01 PM
I can't imagine why would anyone download Thinker AI mod and then disable Thinker AI. We are both running the latest dev version with default settings except for SMAC-in-SMAX (smac_only=1).

I suppose I can give you the saves, and we both could give you passwords in PM? The game is still ongoing, which means we don't have access to each other's saves, and can't really do much testing.

You know the Codicil utility, the one that allows you to substiture a player with an AI and vice versa? The MP game can be converted to SP that way. The first thing I'd do would be checking if the behavior persists in SP, but Codicil requires all passwords to work.
Title: Re: SMACX Thinker Mod
Post by: Induktio on September 30, 2019, 08:31:46 PM
You can keep playing the game normally, if you've got this far I doubt there's any show stopper bugs that would prevent all progress in the game etc. Just remember to store some save games to inspect afterwards. :)

Sometimes the AIs might do silly things anyway even if on average they expand much faster than in the vanilla game. They might also appear to be stuck in military building mode if there's lots of enemy bases nearby. Happens more often on smaller maps. At least what could be checked afterwards is if there's some kind of a bug in the production queue, it might be possible.
Title: Re: SMACX Thinker Mod
Post by: paul7 on October 01, 2019, 10:08:51 PM
Well, this looks very promising! Haven't really tried this mod yet, but I feel I must.
There has been an argument in this topic regarding narrative vs. AI performance. Well I do value the narrative part of SMAC very much, but I personally feel that a competent AI is really important to support the narrative. So I'm really excited about this mod. Induktio, thank you for your work!

BTW, it looks like the asterisk in "*Sea Formers" in alphax.txt was there for a reason after all. Probably some kind of weird bug that Firaxis never got to fix causes it to become "ea Formers" in datalinks without the asterisk (see the screenshots).

And could you please tell, do you plan to include V2.1 of the Scient's patch?
Title: Re: SMACX Thinker Mod
Post by: ocelotter on October 05, 2019, 10:10:27 AM
I played a game with the 20190831 dev build and figured I'd post my feedback. I used default settings with no other mods (PRACX installed but disabled), playing as the Cybernetic Consciousness. Custom map settings:

Large (50x100)
50-70% ocean
Weak erosion
Abundant native life
Average cloud cover
Librarian difficulty
Directed research, iron man, do or die, pod scattering on

For perspective, this is only the second game of SMAC/X I've played since I played the game as a kid, so I imagine I'm pretty bad at the game.

I found the updated tech_cost function either worse than the original or of negligible impact. Granted I was playing as the Consciousness, so I eventually reached +6 research (and Free Market), but as soon as I switched to market I was getting a new technology close to every turn (I transcended in 2266, though I probably could have been elected to Supreme Leader 30 turns earlier), eventually multiple per turn. I suspect the way it's set up actually accelerated my rate of tech acquisition at the beginning of the game, leading to me rapidly running away with things while the AI sat there wondering what was happening.

Here's a screenshot to illustrate the situation (https://imgur.com/a/8Fmq4CS). This is the 62nd tech I'm researching, so per the original tech_cost formula (http://alphacentauri2.info/index.php?topic=3505.0) the base cost should be 20*20*58=2320, if I read that correctly. This is multiplied by something for world size adjustment (sqrt((50*100) / (40*80)) = 1.25?), then presumably 0.4 for +6 research, and 2320*0.4 = 928. So the base cost should be 928*(worldsize adjustment >1) for this tech.

So... I'm not too sure how to get 971 out of your formula (1808*0.4*1.25 is already 904, not counting the difficulty adjustment), but it seems too low. Furthermore, I'd recommend Librarian as the equal-to-the-AI difficulty, not Transcend, though that's probably besides the point here.

I checked starting a new game, same settings, with revised_tech_cost=1 and =0, and with it on, Centauri Ecology required 12 cost to research, while with it off it required 17 cost to research. That's a pretty substantial acceleration right off the bat, and probably a problem.


Other feedback:

1) I cycled through a few map generations with different settings just to test out your Worldbuilder update, and I'll probably reset it back to the original version. I imagine it does a great job of balancing faction starting locations, but it creates a world that looks too similar all over for my taste: large squarish blocks of land bolted on to other large squarish blocks of land. Archipelagos, peninsulas, isthmuses... these features help break up the monotony and make Planet feel like a planet, even if perhaps balance suffers for it.

2) The AI seemed to constantly suffer from drone riots, especially--and ironically--the Free Drones. Not sure what's going on there, but they should probably do a bit better at avoiding that.

3) Despite having the Hunter-Seeker Algorithm, the AI constantly suicided probe teams into my bases.

4) It seems like an intended rubberband mechanic in the game is "gang up on the leader." Yet, even when it was clear the AI had no chance unless they all banded together in vendetta on me, the Spartans came over and donated 15-20 units to my cause, while only under treaty with me. Seemed odd, though I doubt it was Thinker that was responsible.


Let me know if you want a saved game or something to look at. I'm not sure exactly what files to give you, but I'll figure it out.

I'll probably try Thinker 0.9 on Transcend difficulty at some point to see how that goes. Probably on a much smaller map, managing anything more than 10-15 bases feels awfully tedious.

Thank you for creating this, hopefully I can eventually figure out the right settings to muster a challenge from the AI.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 05, 2019, 06:58:48 PM
And could you please tell, do you plan to include V2.1 of the Scient's patch?

Short answer - Scient's patch v2.1 is already included because it had no changes *binary-wise* compared to the v2.0 version. The only changes there related to txt files which needed a fix to prevent the game from crashing on certain datalinks pages. You can copy the txt files and use them with Thinker mod (but this is not required in any way). Also PRACX can be used together with this mod, but it isn't required in any way. Especially for bug reports, it would be preferable if people just use the default binary of Thinker.

I found the updated tech_cost function either worse than the original or of negligible impact. Granted I was playing as the Consciousness, so I eventually reached +6 research (and Free Market), but as soon as I switched to market I was getting a new technology close to every turn (I transcended in 2266, though I probably could have been elected to Supreme Leader 30 turns earlier), eventually multiple per turn. I suspect the way it's set up actually accelerated my rate of tech acquisition at the beginning of the game, leading to me rapidly running away with things while the AI sat there wondering what was happening.

Here's a screenshot to illustrate the situation (https://imgur.com/a/8Fmq4CS). This is the 62nd tech I'm researching, so per the original tech_cost formula (http://alphacentauri2.info/index.php?topic=3505.0) the base cost should be 20*20*58=2320, if I read that correctly. This is multiplied by something for world size adjustment (sqrt((50*100) / (40*80)) = 1.25?), then presumably 0.4 for +6 research, and 2320*0.4 = 928. So the base cost should be 928*(worldsize adjustment >1) for this tech.

Lots of detailed feedback there, that will be useful when I'll try to figure out how to set up this tech cost mechanic in v1.0. Earlier I described the new costs in this post (http://alphacentauri2.info/index.php?topic=21013.msg121462#msg121462) in case anyone wonders. The discrepancy with your numbers can be explained quite easily.

The base cost for level 8 techs is 1808. The other modifiers applied in this case include a 2*7% = 14% discount on all techs because you're playing 2 levels below Transcend. Also Research SE is modifier is capped at +5/-5 according to the documentation in alphax.txt. That gives a final cost of 1808*1.25*0.5*0.86 = 971 as it is visible in the screenshot (decimal values truncated).

Probably some of these modifiers should be adjusted further. I'm not exactly sure which number the original tech cost formula would give here because it has some situational variables, and also it was described in the post in a non-exact way, imho. That kind of formula would be just better described in C++ code. We could remove the 7% discounts and adjust the base costs slightly higher for example. It may be that the AI is at too much of a disadvantage on levels below Transcend now.

I could have increased the costs even further but I avoided it so far, because then it would balloon the high-end tech costs on huge maps to very large proportions. How much do you think the Threshold of Transcendence tech should cost on standard maps for example?

1) I cycled through a few map generations with different settings just to test out your Worldbuilder update, and I'll probably reset it back to the original version. I imagine it does a great job of balancing faction starting locations, but it creates a world that looks too similar all over for my taste: large squarish blocks of land bolted on to other large squarish blocks of land. Archipelagos, peninsulas, isthmuses... these features help break up the monotony and make Planet feel like a planet, even if perhaps balance suffers for it.

Well, uh, if you like lots of small islands then it might not have been what you wanted. You can still use faction_placement regardless of WorldBuilder settings though.
Title: Re: SMACX Thinker Mod
Post by: ocelotter on October 05, 2019, 11:00:31 PM
I could have increased the costs even further but I avoided it so far, because then it would balloon the high-end tech costs on huge maps to very large proportions. How much do you think the Threshold of Transcendence tech should cost on standard maps for example?

I don't know, but at that point in my game I doubt any change in the cost of Threshold of Transcendence would have made any difference. Multiplying its cost twice or even thrice would just mean an extra turn or two while the AI did nothing.

I think it's probably worth investigating the total tech tree cost created by the original formula in the early (tiers 1-4?), mid (5-9?), and late game. In the early game, overall tech tree cost should be about the same as before, but with stronger differentiation between the tiers to discourage beelining for key techs. In the mid game, overall tech cost could inflate a bit to account for geometric inflation caused by lab facilities + free market + uncapped energy terraforming + social engineering. Non-researchers can still use probe teams to catch up, of course. In the late game, tech costs should probably be much higher than they are right now in both Thinker and the base game.

I don't know how easy it is to do, but it might be worth simulating an AI University/Consciousness playing through the game with and without Thinker, trying to match the pace of tech acquisition in the base game (original tech costs, bad AI) to the pace in Thinker (revised costs, good AI).

I do like the idea of using an analytic function to describe the costs per tier, but something less continuous might be a better fit for SMAC/X.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 06, 2019, 08:47:32 PM
I think it's probably worth investigating the total tech tree cost created by the original formula in the early (tiers 1-4?), mid (5-9?), and late game. In the early game, overall tech tree cost should be about the same as before, but with stronger differentiation between the tiers to discourage beelining for key techs. In the mid game, overall tech cost could inflate a bit to account for geometric inflation caused by lab facilities + free market + uncapped energy terraforming + social engineering.
Well, I agree with the basic premise here. Increasing the tech costs significantly from levels 4-5 onward is also a design goal here since many powerful items become available by then. But it does also matter how much the most advanced techs should cost since the tech tiers should form some kind of an intuitive continuum. Probably the highest-tier tech costs should be bumped beyond 10k even on standard maps anyway.

I don't know how easy it is to do, but it might be worth simulating an AI University/Consciousness playing through the game with and without Thinker, trying to match the pace of tech acquisition in the base game (original tech costs, bad AI) to the pace in Thinker (revised costs, good AI).
This one is really easy to do because you can run Thinker/non-Thinker AIs side-by-side with the factions_enabled setting. It does not affect tech costs though, to do that one would need to compile a slightly modified version of Thinker. I'm not providing an update with the new tech cost values just yet, but the consensus here seems to be that they should be increased.
Title: Re: SMACX Thinker Mod
Post by: ocelotter on October 07, 2019, 01:17:03 AM
Well, I successfully managed to get crushed by the AI in a game with completely different settings: smac_only=1,  revised_tech_cost=0, Transcend difficulty, small map, blind research on. The Spartans and Hive rapidly pincered me and cut me to pieces. So that's a good sign.

Does Thinker include scient's fix to the energy stockpile bug/exploit? I see it on the download page for scient's v2 patch (http://alphacentauri2.info/index.php?action=downloads;sa=view;down=364) but not in the details for Thinker on github (https://github.com/induktio/thinker/blob/master/Details.md).
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 07, 2019, 07:55:43 AM
Is it feasible to expose in thinker.ini some exponential coefficient for tech costs calculated by standard algorithm (revised_tech_cost=0), based on number of accrued techs? So as users could experiment with the curvature.
Title: Re: SMACX Thinker Mod
Post by: ocelotter on October 07, 2019, 11:54:08 AM
nutrient_bonus seems potentially unreliable when used with the original Worldbuilder settings, unfortunately. Using nutrient_bonus=2 on a small map with 50-70% ocean, 4/7 factions started with zero bonus nutrients (first screenshot). The very next map gen (second screenshot), again 4/7 factions started with zero bonus nutrients (University started with one in the ocean I guess).



Title: Re: SMACX Thinker Mod
Post by: Induktio on October 08, 2019, 12:47:50 PM
> nutrient_bonus seems potentially unreliable when used with the original Worldbuilder settings

The main issue here is that a small map with high water content is really small. There won't be that many ideal spawn locations to choose from, although some adjustments might be made in the algorithm. Some factions just won't have enough room there.

I didn't quite get what PvtHudson was asking here. Do you want to see a table on how the tech costs change with the number of researched techs? It's possible to run some simulations with it by spawning the factions on a random standard map, then continuously marking one tech more researched and calling the original tech_rate function to see how the costs change. But there's probably some factors that are not taken into account in that test (number of turns elapsed etc).
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 09, 2019, 07:56:22 AM
I didn't quite get what PvtHudson was asking here. Do you want to see a table on how the tech costs change with the number of researched techs? It's possible to run some simulations with it by spawning the factions on a random standard map, then continuously marking one tech more researched and calling the original tech_rate function to see how the costs change. But there's probably some factors that are not taken into account in that test (number of turns elapsed etc).
I'd like not to see, but to have an ability to change costs returned by standard algorithm. So as each cost returned by standard algorithm is multiplied in game by the result of some_func(number_of_techs_known, some_coefficient_taken_from_ini), and the some_coefficient_taken_from_ini governed the curvature of some_func. This will allow to experiment with different speeds of tech cost rise.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 09, 2019, 09:00:34 PM
I'd like not to see, but to have an ability to change costs returned by standard algorithm. So as each cost returned by standard algorithm is multiplied in game by the result of some_func(number_of_techs_known, some_coefficient_taken_from_ini), and the some_coefficient_taken_from_ini governed the curvature of some_func. This will allow to experiment with different speeds of tech cost rise.

Well yeah, I suppose I could add some options to configure stuff like that. Let's assume the cost formula is something like x * Level^3 + y * Level. Those factors x and y could be read from the config file and I could add them to the next develop build for testing purposes. Changing the exponent value wouldn't be recommended though since it would have drastic implications towards the end of the tech tree.

I realized some of the difficulty scaling calculations were a little bit off in the current version so I'll adjust those too. In the original game at Transcend level, the first techs are roughly equally expensive for human/AIs but after that the AI gains up to a 50% discount for all techs. That's much bigger than the industry discount actually (30%).
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 10, 2019, 08:35:08 AM
* Level
I'm not so sure the tech cost shall be based on level of the tech in question. Of course, this spawns issues with beelining. But it seems SMAC creators were much more concerned with preventing tech runaways. And it mostly works, except they hadn't envisioned the level of energy runaway players could accomplish.
I had adjusted (with the combination of alphax.txt/thinker.ini edits, starting conditions, and handicaps) my copy of ThinkerMod so that in almost every game tech parity with 1-2 top AIs continues well into and beyond quantum era, thanks to vastly different costs of the same techs for player and AI. Actually, I'm fairly satisfied with the behavior of standard tech cost algorithm (standard map, tech stag) except too costly early techs and too cheap late techs.
Hence I'd vote for adding means to adjust standard algorithm alongside with rewriting it completely.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 11, 2019, 06:40:53 PM
If SMAC creators were concerned about tech runaways, it certainly was not reflected in the tech cost mechanism. It doesn't really do anything to prevent those, more like it does the opposite. I put some thought into what could be with the old tech cost mechanism, but I don't see any meaningful way to adjust it without rewriting something.

The advantages of basing the costs on tech ranks are significant, and these kind of mechanics were incorporated into later Civ games too. In the vanilla game, the AI tech discounts are so large on higher levels that it's no wonder if it manages to keep tech parity most of the time. It doesn't really mean the tech cost mechanic "balanced" things in any way though. But I need to do a little bit more play testing before releasing the next build.