Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/alphacen/public_html/Sources/Aeva-Subs.php on line 2546

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/alphacen/public_html/Sources/Aeva-Subs.php on line 2546

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/alphacen/public_html/Sources/Aeva-Subs.php on line 2546
Print Page - SMACX Thinker Mod

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 Mod project homepage (https://github.com/induktio/thinker)




Thinker is an AI improvement mod 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
* Faction placement balances random map starting locations
* Possible to select which landmarks are placed on random maps
* Many other additions to gameplay 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
* See detailed info on compatibility on the homepage

* Download links here (https://github.com/induktio/thinker)
* More detailed information (https://github.com/induktio/thinker/discussions)

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: Induktio on September 08, 2018, 11:03:30 AM
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: 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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: Alpha Centauri Bear 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.
Title: Re: SMACX Thinker Mod
Post by: ocelotter on October 23, 2019, 12:17:20 AM
I've played more with Thinker, this time on Tiny maps, and have a bit more feedback. Non-default settings:

Transcend difficulty
directed research
iron man
base game Worldbuilder settings
revised_tech_cost=0
smac_only=1
nutrient_bonus=0
jungle=0

The first half of the last game I played as the Spartans was really tense and interesting. I hamstrung Morgan early and took most of his territory, but once war broke out with the Believers, things started to fall apart. They pressured me heavily for a long time, trading a few bases back and forth, and diplomacy with the other factions felt important to avoid elimination. Each turn had interesting problems, and since the map was so small, base/former micromanagement was not burdensome.

Unfortunately, once needlejets started to take over, the AI seemed to lose confidence in their ability to attack me. They got air power before me, and so even though I pretty quickly fortified my bases with AAA troops, they still should've been able to mount a strong offensive, or at least take out most of my formers/crawlers. I went back and checked a save (see the attached) from around this time, and you can see that Far Jericho is stacked with 12 missile needlejets; if you end the turn, they just fly them around between a couple of their bases, doing nothing unless one of my units enters their immediate vicinity.

Eventually I got copters, cleaned up the Believers (who seemed mostly helpless against them), and then the game gradually slipped away from the AI from there. The smaller AI factions mostly squabbled amongst themselves, despite clearly needing to gang up on myself or the Gaians to have a chance. The Gaians seemed to suffer from a similar air AI problem with handling interceptors, stacking them all in one out-of-the-way base where they couldn't protect any of their workers or bases.

So I think the AI needs improvement with handling air units to stand a chance in the mid game. At least with ground units they make aggressive moves, even if they often leave them vulnerable. Any offensive military unit that just sits around without attacking is an opportunity cost that drags the AI down.


I also noticed a few issues in the game that might be worth fixing, though they could be considered out of scope for this project:

1) The stockpile energy exploit is indeed in the game, I checked on some turn in the middle. I had hurried a bunch of facilities, and the next turn I ended up earning double my predicted income in credits due to the exploit, without even taking advantage of adding stockpile energy after unit production. I don't imagine the AI benefits from this, so this amounts to a substantial one-sided advantage for a human player, even one who isn't trying to use it. I think scient removed it from his patch because kyrub's fix had unintended consequences, but it's still worth fixing in my opinion.

2) I'm not sure if this is actually a bug or intended behavior, but it looks like interceptors still fight bombers with attack vs. attack when scrambling defensively, when it seems like it should be attack vs. armor. If this is "fixed", it might give needlejets and copters a bit more counterplay than there seems to be at the moment.


Questions about smac-in-smax:

1) If I add the Algorithmic Enhancement ability back in to the game in the smac alphax file, will the AI use it? Hunter-Seeker seems too strong in base SMAC.

2) Is there a way to add back in the SMAX alternative native units?
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on October 23, 2019, 08:12:53 AM
G'day. I've been playing a few games with this mod, trying it out with the SMAC and Sigma factions, and the improvement in the AI's performance is like night and day. Excellent work.

Other people have covered most of the issues I have, so I'll just mention a few.

There is a major bug in Thinker: the orbital attack view in F6 menu does not work properly. The faction and target selection appears normally, but when you press the "ATTACK" button, nothing happens - the code to process the attack doesn't get called. This is pretty bad when I have a force of planet busters ready and I want to take out my enemy's defense pods before I launch.
It's a simple workaround to just load the save in the default terranx.exe, make your attacks, and then switch back to Thinker, but having a vanilla mechanic be straight-up broken isn't great.
(Incidentally, it turns out that ODPs intercept PBs everywhere on the map, not just against the owner's units.)

Speaking of satellites, I've noticed in my games that only one AI tends to build them, both SMAC and Sigma. In my Sigma game, by 2289, Navarro had 10 of each, and Fedorov had only built a single ODP. They were both at war for most of the game, so it could be that Fedorov's build orders prioritized more units to defend himself.
Given that the AI benefits a lot more from satellites now due to having many bases, they really should build more.

Another thing the AI could do with is some better defenses. They already build a lot of sensors, AAA defenders, and some Aerospace Complexes; but not many of their bases had Perimeter Defenses, and they built zero Tachyon Fields despite having the tech for many turns. I think they should especially prioritize building the latter as they become available: they will help to blunt the impact of the player going all-out on the chop-and-drop.
(Ideally defenses would be buffed across the board, but that's out-of-scope for Thinker.)

Lastly: the AI does not react to an Economic Victory being triggered, making it simple to win just by hitting next turn 20 times (although Econ Victory is so painful that this will not be relevant very often). Both Navarro and Fedorov were building the Ascent to Transcendence, but it would have been trivial for me to stop them by nuking their bases.
They also had Planet Busters built, but never used them despite the charter being repealed. This may be a function of their aggressiveness settings (both had 0).
It would be nice if the AI could somehow adjust its tactics and strategy in response to these events. I'm not sure what rules should be used to make that happen, though. At the very least, it should attempt to nuke your HQ and/or project bases if it detects you are nearing victory (and, obviously, you are not pacted with them - treaty is debatable).

I realize this is a lot, so I just want to say thanks again for all your hard work. Thinker mod has really given new life to the game for me.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 26, 2019, 10:03:15 PM
Time to post a new develop build of Thinker (20191026) (https://github.com/induktio/thinker). Time allocation for this project vs. other stuff I've been doing has been problematic, but nevertheless today's update changes a couple of things:

* Fix long-standing bug where AI sometimes ignores undefended enemy bases next to them (reported by DrazharLn)
* AI should now rebuild HQs faster than was the case before
* revised_tech_cost values are increased from the previous version, difficulty scaling is also modified

For AI factions, each unit of cost_factor applies a 10% bonus/penalty. 10 = 100% of human cost on Talent/Librarian level.

For human factions, difficulty level applies a multiplicative modifier based on this list:
(click to show/hide)

The baseline tech cost function is also changed to the form: 3 * Level^3 + 117 * Level. All other modifers are applied on this number to determine the final tech cost. With these settings, AI bonuses shouldn't differ too much from the values in the vanilla tech cost formula.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 26, 2019, 10:23:51 PM
> If I add the Algorithmic Enhancement ability back in to the game in the smac alphax file, will the AI use it? Hunter-Seeker seems too strong in base SMAC.

I can't say for certain without testing, but it might work. At least design_units planner will attempt to add the enhancement feature if it is just available.

> Is there a way to add back in the SMAX alternative native units?

That would require some kind of new binary patching, so it's not available for now.

> At least with ground units they make aggressive moves, even if they often leave them vulnerable.

That's great to hear. At least the AI is supposed to be making more attacks with the new land-based combat AI. But as you can imagine, air unit handling is still just the vanilla AI, so it is what it is. Some air units are just inherently overpowered when micromanaged properly, so in the end I'm not sure what could meaningfully be done there.

> There is a major bug in Thinker: the orbital attack view in F6 menu does not work properly.

I couldn't verify this bug at all. Is it maybe related to some game settings or maybe smac_only mode?

> Speaking of satellites, I've noticed in my games that only one AI tends to build them, both SMAC and Sigma.

That's also strange. Usually all of them should start building satellites as soon as they get the prerequisities, so not sure what might be happening there. Would need a save game to look at.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on October 27, 2019, 01:00:49 AM
>I couldn't verify this bug at all. Is it maybe related to some game settings or maybe smac_only mode?
I turned off smac_only mode, and I was indeed able to shoot down satellites again. Some sort of binary weirdness?

>That's also strange. Usually all of them should start building satellites as soon as they get the prerequisities, so not sure what might be happening there. Would need a save game to look at.
No problem. Here are all the saves I kept from that Sigma game. Uses the latest Sigma factions (included for completeness).
Navarro starts to build satellites sometime between 2240 and 2251. Fedorov built his single ODP around 2283 to 2286.
Mind you, those two were at war for almost the whole game...
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on October 29, 2019, 12:38:14 AM
Hi, Induktio.
Nice to see you are still on it and released new version while I was away.

Blunt question. Did you manage to encourage AI to equip units with Soporific Gas Pods?
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 29, 2019, 05:53:20 PM
> I turned off smac_only mode, and I was indeed able to shoot down satellites again. Some sort of binary weirdness?

Okay, this issue is confirmed now. Having smac_only enabled seems to break the orbital attack selection. Probably it's some kind of a binary issue since enabling that flag toggles a bunch of stuff in the binary. It's possible this issue has been discovered earlier since Yitzi et al. did some modding using this same flag to toggle the smac-in-smacx thing. Let me know if anyone has info on this.

> Navarro starts to build satellites sometime between 2240 and 2251. Fedorov built his single ODP around 2283 to 2286.

Not sure about this one. Having lots of wars with nearby neighbors might also mess up the build queues somewhat. In the previous version, the priorities were tweaked to emphasize unit production when there are enemies nearby.

> Blunt question. Did you manage to encourage AI to equip units with Soporific Gas Pods?

I haven't changed anything in that regard. Design_units planner will only create a couple of custom units which will not have that capability.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on October 29, 2019, 06:29:09 PM
> Blunt question. Did you manage to encourage AI to equip units with Soporific Gas Pods?

I haven't changed anything in that regard. Design_units planner will only create a couple of custom units which will not have that capability.

Pardon my ignorance in this area. Does AI design custom not predefined units at all? If so, how adding different abilities and other features is controlled in general? Is it just random or in response to the game state? Could it be that frequency of adding features is controlled by each feature individually? Like Soporific Gas Pods just turned out to be off all the time?
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 30, 2019, 05:26:50 PM
> Does AI design custom not predefined units at all?

Eh? I mean it should be obviously visible the AI designs some custom units, when new garrison units and so forth appear on their prototype lists.

> If so, how adding different abilities and other features is controlled in general?

The game binary has its own complicated functions that decide what kind of prototypes are created. Apparently soporific gas pods and some other abilities are not on their list. Just to clarify, design_units is a completely separate feature from the game binary's prototype creator. It just creates a couple of extra prototypes that the vanilla binary does not do. If somebody wants to reverse how the vanilla binary designs the prototypes, then be my guest.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on October 31, 2019, 12:09:54 AM
Ah, one more thing I wanted to ask. Sorry, if I asked this already.

Did you tweaked unit cost calculation? There is one rule in unit cost calculation that sets attack value to 1/2 of armor value for cost calculation purposes only. I understand it stems from previous civilization versions where all defensive units have attack value at least half of their defense. I guess AC designers wanted to encourage players to follow the same unit design. However, cost formula multiplies attack and defense. Thus making defensive unit cost growing quadratically by its defensive value even if you don't invest in their attack value. And there is no way to make it less expensive!!! Whereas attack unit cost with minimal defense growths linearly proportionally to their attack value (as anyone would expect).

Would you mind dropping this rule if you are able and willing to? Thank you.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 01, 2019, 08:03:59 PM
Actually, Induktio,
I am up to modify in game unit cost calculator myself if you let me be a co-author. I can do it either in stand-alone fashion to provide you the modified code or you can share yours with me so I can build on top of it if you prefer this more. Either way I'm eager to contribute. In game cost calculator annoys me so much and long already that I don't see other choice to deal with is besides code modification.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 02, 2019, 10:32:22 AM
> Did you tweaked unit cost calculation?

I don't know if you had some reason to think there were some differences, but Thinker should not include any kind of changes to vanilla cost mechanics unless the documentation says so. For the most part, my priorities weren't in rebalancing existing mechanics since that tends to be an endless endeavor, and some players would not like to see the game diverge too much from the original settings.

> In game cost calculator annoys me so much and long already that I don't see other choice to deal with is besides code modification.

Have you looked at how the calculation works in the binary level? Using Scient's IDA database it seems there are mainly two functions dealing with this, consider_designs and proto_cost. They are very closely linked to another when the AI uses them to design units. Just saying I am not actively developing any changes to this part. I would say fixing the orbital attack bug would be a priority before next release, but dunno about adding any new stuff that requires extensive reverse engineering and then more testing to make sure it doesn't break any existing game logic.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 02, 2019, 03:07:14 PM
No worries. I won't include this logic into your mod if you don't like to. It this case I'll ask permission to fork your mod and add these changes on top of it. Or maybe I will be able to patch the original executable that your mod uses. Then there won't be need for forking. Don't know yet.

I don't understand "not altering game mechanics" while designing mod(ifications). You are altering something anyway. It may be not in line of your mod targeted changes, though. That's another story.

Thank you for sharing functions names.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 02, 2019, 04:19:22 PM
No worries. I won't include this logic into your mod if you don't like to. It this case I'll ask permission to fork your mod and add these changes on top of it. Or maybe I will be able to patch the original executable that your mod uses. Then there won't be need for forking. Don't know yet.

I think the word you're looking for here is "pull request". You might rebase the changes on top of the master branch and then submit a pull request. Something along the usual procedures for accepting external contributions on git projects. Then we can evaluate how it might work. I doubt you would want to maintain a fork of Thinker with divergent features over long term. And then any forks would have to be renamed to something else.

About patching the binary directly, it's a serious problem for maintenance and mostly unnecessary. Nobody wants to maintain patches that are described only on a binary level. For several releases now, Thnker has not featured any changes to the game binary because the patches are loaded dynamically at startup.
Title: Unit cost calculation formula
Post by: Alpha Centauri Bear on November 18, 2019, 02:31:50 PM
I am planning to mod unit cost calculation. Here is the formula I currently programmed. I focused mostly on chassis, weapon, armor, reactor involvement. Abilities were secondary concern. However, since I've rewrote a complete function I had to include them too.

Formula
==============================================================

UC = ([max(WC, AC) + (WC + AC)] / 2) * (CC / 2) * (1 + PAC / 4) + FAC

UC = unit cost
WC = weapon cost * reactor level (for weapons), module cost (for modules)
AC = armor cost * reactor level
CC = chassis cost, it is divided by 2 to allow 50% step increase in unit cost
PAC = proportional ability cost (positive ability cost value)
FAC = flat ability cost (negative ability cost value)

Title: Unit cost calculation formula - description
Post by: Alpha Centauri Bear on November 18, 2019, 02:32:47 PM
And here is the complete readme for the unit cost formula. Just in case anyone is asking questions.

Modification to SMACX unit cost calculation
==============================================================

Unit cost plays a role in economics of the war. However, slight modifications to unit cost does not change war outcome that much comparing to other factors like overall economics advantage, aliances, technology advantage, terrain, prepared defense, etc. Therefore, I din't bother balancing unit cost with utmost precision. Such fine grained tuning is not required. Rather I just fixed major SMAX unit cost problems by revising basic principles.

I based these principles mostly on Civ 1 and 2 unit pricing model since they seem to be quite nicely balanced already.

Chassis and movement speed
--------------------------------------------------------------

Movement speed privides two major advantages: shorter relocation time accross the globe and tactical advantage. With faster unit you have flexibility of choosing between attack/chase or retreat/escape. It also gives you longer reach range protecing more territory around your bases. All the above multiplies unit value regardless of its battle statistics (weapon and armor). Therefore, speed and chassis type should be a simple multiplier to unit value. The exact chassis value can be set in text configuration.

Weapon vs. armor cost
--------------------------------------------------------------

In Civ 1 offensive units are 50% stronger than same speed and cost defensive ones. That is probably because Civ 1 and 2 have large number of defensive bonuses starting from fortification - a free defense multiplier available for all units. Since SMACX doesn't have such bonus I propose to treat same weapon and armor values equally.

Technology advantage
--------------------------------------------------------------

Naturally attack and defense rating grows exponentially in such games so that each next gadget is proportionally stronger than its predecessor. Even when cost should follows the rating increase there is no strict need for it to grow equally fast. In fact, Civ 1 and 2 unit cost grows slightly slower than its strength. This pattern gives slight economical advantage to more advanced faction. In Civ 1 more advanced units have about 20% reduction in price. I think such reduction can be implemented by assigning costs to individual weapon and armor types. Such costs do not need to be equal to weapon/armor rating but can progress somewhat slower toward higher end of the spectrum.

Mixed units
--------------------------------------------------------------

Units fitted with both weapon and armor provide definitive tactical advantage. They are versatile and are more survivable then pure attackers and defenders. Obviously, they should be valued more than single purposed unit with same primary battle statistics. They should not be priced higher than combined price of two single purposed attacker and defender with same primary statistics. Otherwise, it would be cheaper to build single purposed units only as in vanilla SMACX. I decided to price them exactly half way between max(weapon value, armor value) and sum(weapon value, armor value). As I pointed earlier unit pricing fine tuning is not needed as long as it makes generic sense.

Reactor
--------------------------------------------------------------

Reactor increases unit attack and defense values proportionally. So it should do to the cost. Even proportionally more expensive stronger unit has an advantage due to increased survival rate and later healing.
Reactor should not increase cost of non combat moudles as they do not benefit from increased health.

Abilities
--------------------------------------------------------------

Some abilities normally improve battle statistics. Those should proportionally increase unit price as they are now. Others provide benefit unrelated to unit statictics and should be priced flat. I'll implement those as negative values.

Formula
==============================================================

UC = ([max(WC, AC) + (WC + AC)] / 2) * (CC / 2) * (1 + PAC / 4) + FAC

UC = unit cost
WC = weapon cost * reactor level (for weapons), module cost (for modules)
AC = armor cost * reactor level
CC = chassis cost, it is divided by 2 to allow 50% step increase in unit cost
PAC = proportional ability cost (positive ability cost value)
FAC = flat ability cost (negative ability cost value)

Unanswered questions
--------------------------------------------------------------

Any special treatment of chassis for speicial units: colonies, formers, supply, probe. They all have different usage and differently benefit from chassis speed. Should their speeder version be more expensive than infantry? Should their foil version be same as infantry or more expensive?
This is all very subjective and can be done either way without much game impact. However, there is still small impact on playing style and tactics.

I personally don't see point in pricing worker vehicles (colony, former, supply) sea versions higher than their land counterparts. What significant point does it achieves? Naturally land bases build land units and sea bases build sea units. It is not like there is much choice. Therefore, such units are not directly comparable and should not be priced differently. I'd say foil units at sea are same as infantry on land. Whereas cruiser units should be logically priced higher. Same way as speeder units do comparing to infantry.

Moreover, generally I think we should not increase unit cost without compelling reason. Otherwise, game becomes unit poor and, therefore, tactically poor as well.

Probe teams are special case. Their speed is an important quality that factors into their primary performance rate. That is why they are created on speeder chassis by default. Does it make sense to create infantry probe teams for defensive purposes? Should it be cheaper? What about foil probe team - should it be priced same as speeder or infantry one?

Title: Unit cost calculation formula - abilities
Post by: Alpha Centauri Bear on November 18, 2019, 02:51:16 PM
Yitzi introduced different formulas for abilities as proportions between different statistics. Personally, I don't believe we should go into such complication as exceptionally fine tuning game parameters is not needed. It is much better to give player a clear and uncomplicated picture of rules and let them decide what is good for them.
I prefer to keep either a vanilla simple cost multiplier only or to add a flat row cost as an additional option. However, I am open for discussion and ready to listen to opinions if any.
Title: Re: SMACX Thinker Mod
Post by: T-hawk on November 18, 2019, 03:52:56 PM
Sea units do cost more for significant reasons.  A base founded by a sea colony pod includes a pressure dome facility for free, which counts as recycling tanks for 1-1-1 production.  A sea former is more productive than a land former, both because it doesn't consume a turn moving into a new space, and because sea improvements (kelp and tidals) yield more per former-turn of labor than equivalent land improvements.  A sea crawler is slightly better than a land one also because of the mobility, in consuming fewer turns of movement to reach the tile it wants.  Same goes for sea probe teams; they are more similar to a rover-chassis land probe, because the movement allows the capability to threaten multiple cities at once.

I don't really have any overall opinion on redesigning unit costs, but that's one point to make.  Oh, one more point: upgrading is a factor for high weapon/armor units.  You can't price them too high, or it becomes more cost-efficient to build cheap basic unit shells and upgrade them instead.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 19, 2019, 12:01:38 AM
Sea vs. land is heavily opinionated discussion. That is why I welcome different opinions and thank you for expressing them. Even if we cannot prove anything we can at least build something that most people would like.

So you believe foil units should be priced similar to speeder one? That makes sense to me on some accounts. In my mod I price speeder units 50% more than infantry ones. Let's see how does it turn out for foil units if I price them same as speeder based units.

Colony
In my mod I set colony cost to 6 to reduce infinite colony spawn exploit.
infantry: 6, speeder: 9, foil: 9
Generally I agree with you that sea colony should be more expensive than land one. Is 3 rows of minerals too much a difference for you? I think I can live with that.

Former
infantry: 2, speeder: 3, foil: 3
Fine with me. They are very cheap. Nobody will notice the difference.

Supply transport
In my mod I set supply cost to 8 to reduce supply spawning a little.
infantry: 8, speeder: 12, foil:12
I don't think I agree on higher priced foil supply. Yes, it is faster but once it reaches the destination it just sits there for eternity. Moreover, sea mineral squares are usually poorer than land ones. You can build enormous amount of mines on land and create the huge supply of minerals without any spare resources. Nothing like this is possible on sea.
For me foil supply is kinda correspond to infantry one, not the speeder one. That is actually why there is no much sense in building speeder supplies at all.

Probe
In my mod I set probe equipment cost to 4 to reduce probe spawning by AI.
infantry: 4, speeder: 6, foil: 6
Makes sense to me. One can as well build cheaper probe teams for defense purposes.

Combat units
Sea units meet land units only attacking ports. They mostly fight with each other. Considering that base foil cost makes no difference when you compare sea units with sea units. They just will be all proportionally cheaper or expensive.
In my mod mixed unit (with both high weapon and armor) is 50% more expensive than single purposed one. Sea units are usually mixed (fully armored). If we also increase foil cost by 50% comparing to infantry than fully armored foil would cost twice more than pure infantry defender in port. That is a huge disadvantage for attacking ports with sea units comparing to attacking land bases with land units. Although, sea bases do not benefit from sensor which equalize above disadvantage a little. Besides, sea bases are more vulnerable to sudden attack. There are no ZOC there.
Overall I agree that sea combat units should be more expensive.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 21, 2019, 08:54:44 PM
Based on above discussion I plan to do just one change: price foil supply as if it had infantry chassis, price cruiser supply as if it had speeder chassis. Not that anyone would want to build speeder and cruiser supplies for harvesting but they can build them for project building since they are more expensive and faster.
Title: Reactor
Post by: Alpha Centauri Bear on November 22, 2019, 02:04:05 AM
I found where the reactor level is used to check whether unit lost all HP during the battle. The code uses reactor id/level directly, not the value. Then it multiplies it by 10 inline constant. This is completely hardcoded. There is no any function or configuration variable to modify - only the code itself. Even though, I think I can track all usages of this and still modify inline.

Modding wise, I also think it may be possible to 1) set the reactor value, not the level to the prototype reactor field and 2) use this reactor value as a direct amount of HP without any transformation and use it in the code like that.
This way anyone can just put an amount of HP per reactor right in the text configuration and be done with reactor imbalance nightmare.

Other reactor use such as needlejet extra range or planet buster blast radius can be left intact. They have pretty interesting uses and do not break game that much.
Title: Reactor value
Post by: Alpha Centauri Bear on November 22, 2019, 02:33:33 AM
Now why do I bother with reactor HP value since I've factored it into unit cost already thus fixing infamous reactor game break? Well, now when I made unit cost proportional to its health, I am thinking - whether I actually need to quadruple both health and the cost by the end of the game. Top level units already cost like 200-300 there is no need to raise it significantly any more. So I was thinking to give each reactor a health boost but not too big. Maybe by 10-20% for every level?
Now if the health increase is not that big, would it make sense not to increase price as well. That effectively makes reactor upgrade an improvement. However, 10-20% improvement is something worth putting on single technology without breaking unit effectiveness progression too much. What do you think, guys?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 23, 2019, 06:08:43 PM
I've analyzed reactor usage in the code and it looks pretty gloomy. There are hundred places where unit reactor power is used and all for different reasons. Some just multiply it by 10 to get the total health, I guess. However, other usages are completely different. They may use reactor power directly comparing it to something, like detecting whether unit uses Fusion reactor or above. Others involve it in some unclear math.
A lot of algorithms tied to reactor like collateral damage adding percentage of health, native combat ignoring armor, etc. Don't want to disturb all this machinery.
Title: Reactor value
Post by: Alpha Centauri Bear on November 23, 2019, 09:31:21 PM
I think I came up with a compromise. Let reactor increase health as they do now and increase cost gradually slower so that fitting units with new reactor is economically beneficial but not that insanely by much as in vanilla to break the progression. I've build a scale where each following reactor drops effective cost by 20%. That is each following reactor health/cost ratio is only 80% of its predecessor.

REACTORS
Fission: 10 health, cost*1.0
Fusion: 20 health, cost*1.6
Quantum: 30 health, cost*1.9
Singularity: 40 health, cost*2.0

Along with decelerated item cost progression it makes late game units 4 times as less expensive comparing to 1:1 item and reactor cost. For example, 30-1-1*4 infantry would cost 30*4=120 rows of minerals with 1:1 cost model and only about 30 rows with decelerated cost model. Which is pretty affordable for late game bases with ~50 mineral production. After all one have to pay for better unit and with decelerated model higher end items are still more beneficial to use.

Here is my weapon and armor progression list for completeness sake
#WEAPONS
Hand Weapons,         Gun,            1, 0, 1, -1, None,
Laser,                Laser,          2, 0, 2, -1, Physic,
Particle Impactor,    Impact,         4, 0, 3, -1, Chaos,
Gatling Laser,        Gatling,        5, 1, 4, -1, Super,
Missile Launcher,     Missile,        6, 2, 5, -1, Fossil,
Chaos Gun,            Chaos,          8, 0, 6, -1, String,
Fusion Laser,         Fusion,        10, 1, 7, -1, SupLube,
Tachyon Bolt,         Tachyon,       12, 1, 8, -1, Unified,
Plasma Shard,         Fusion,        14, 2, 9, -1, Subat,
Quantum Laser,        Quantum,       16, 1,10, -1, QuanMac,
Graviton Gun,         Graviton,      20, 0,12, -1, AGrav,
Singularity Laser,    Singularity,   24, 1,14, -1, ConSing,
String Disruptor,     String,        28, 1,16, -1, BFG9000,
#DEFENSES
No Armor,            Scout,       2, 0, 1, None,
Synthmetal Armor,    Synthmetal,  3, 0, 2, Indust,
Plasma Steel Armor,  Plasma,      4, 2, 3, Chemist,
Silksteel Armor,     Silksteel,   5, 1, 4, Alloys,
Photon Wall,         Photon,      6, 1, 5, DocSec,
Probability Sheath,  Probability, 8, 2, 6, ProbMec,
Neutronium Armor,    Neutronium, 12, 1, 8, MatComp,
Antimatter Plate,    Antimatter, 16, 2,10, NanEdit,
Stasis Generator,    Stasis,     24, 2,14, TempMec,

As you can see even though item strength growth exponentially, cost is not that much. The most expensive weapon is only 16 comparing to 30 in vanilla.

Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 23, 2019, 09:42:46 PM
Another possible adjustment to unit cost may involve reducing number of item ratings. Many people say that SMACX has too many combat items. They keep popping up so frequent during the game that about half of weapon/armor items are never prototyped and used due to lack of time and opportunity. Civ 2 managed to build quite balanced unit set with only 9 distinct attack values ranged 1-12: 1, 2, 3, 4, 5, 6, 8, 10, 12. I don't count values 14 and 16 as they are are used by single special units only (stealth bomber and cruise missile). If we would limit SMAX weapon and armor values to 12 max, that would make higher end unit cost somewhere ~10 rows (~20 with best reactor). It would be absolutely no problem to build such units by the end of the game.
I don't think it make sense to go this path, though. We have what we have and downsizing our weapon inventory by 2/3 doesn't change game flow too much. Although, I'm open for suggestions there.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 24, 2019, 07:20:04 PM
Hmm ok. One of the main things to note here is that modifying reactor hit point values was already mentioned in Details.md, in the sense that those values are hardcoded in so many places in the game binary I would seriously discourage anyone from attempting to patch them.

Other than that, if you want to keep adjusting this mod further, it's possible to later squash the items to one commit and merge it to the main branch. But there's a couple of style issues in the code I would adjust to keep it consistent with Thinker. Also I think these changes are extensive enough that they should be opt-in from the config file and a separate alphax.txt could be shipped for them. It's just that Thinker generally tries to avoid changing game mechanic formulas.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 30, 2019, 10:45:01 PM
Something is going on with prototype cost when you use ability. I don't know if it is your code or remnant of something Yitzi did but it does not add up. I tried freshly installed Thinker 0.7.

560 * 1.5 = 840 and not 750 as on the picture.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 06, 2019, 01:23:52 AM
I am playing your mod with my text changes on top of it. Research pace feels much much faster than in vanilla. I doubt this is my changes as I am just rearranging things a little and actually increasing cost of formers and colonies. Yet I need to turn research speed down to 50% and even then I feel like everybody are exchanging technologies at incredible speed.
Did you notice anything like that in your mod? If so, how do you cope with it?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 10, 2019, 01:47:52 AM
What is your revised_tech_cost for? It doesn't seem to affect a sequence in which technologies are picked by AI. True that in this sequence higher leveled technologies will take somewhat longer to research. However, if you keep the total tech tree research cost the same then it also doesn't change research pace on large scale either.
Title: Re: SMACX Thinker Mod
Post by: dino on December 10, 2019, 07:44:05 PM
Maybe I shouldn't, but I'll try to answer for him.

It's supposed to remove the cheese of gaining an advantage, by avoiding to trade techs, in order to keep the cost of essential tech you are beelining toward low.
Also an annoynce of picking some currently unnecessary tech from a pod.

The other goal was to make late game techs cost rise much faster to keep up with the development speed of competent player/ improved AI and prolong the late game, without changing the pace of early game research much. It's the first time Induct0 dabbed into changing gameplay mechanics, since he improved AI enough for it to become even more noticeable problem, than in vanilla game. It's also the first attempt, you can play with the source and try to find a better balance.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 10, 2019, 08:21:46 PM
Maybe I shouldn't, but I'll try to answer for him.

You definitely should. That is why I posted it on a forum to solicit opinions.
:D

It's supposed to remove the cheese of gaining an advantage, by avoiding to trade techs, in order to keep the cost of essential tech you are beelining toward low.

Sorry, I do not follow.
What is "remove the cheese of gaining an advantage"? Isn't the advantage what everyone wants? Why remove the cheese? Why do we want to avoid trading techs?
How does it keep the cost of essential tech you are beelining toward low when it penalizes higher level techs??? I think it does the opposite and keeps the cost of lowest techs low = penalizes beelining.

Also an annoynce of picking some currently unnecessary tech from a pod.

I may have gap in my knowledge but I am unaware of how pod tech selection relates to researched cost. The pod tech has no any research cost associated with it - you get it for free.

The other goal was to make late game techs cost rise much faster to keep up with the development speed of competent player/ improved AI and prolong the late game, without changing the pace of early game research much. It's the first time Induct0 dabbed into changing gameplay mechanics, since he improved AI enough for it to become even more noticeable problem, than in vanilla game. It's also the first attempt, you can play with the source and try to find a better balance.

I am explaining exactly this thing in my post that you are replayed to.
Mere reassigning existing research cost from higher level techs to lower level techs does not change research pace as long as it maintains same total research cost and same acceleration rate as in vanilla. It doesn't even alter research pace on average in each historical period. Everything it does is generating local research cost fluctuations depending on whether you pick slightly higher level or slightly lower level tech for current research. The average cost of researching 10 technologies stays the same.

Now. Please don't engage into exact math proving contest. I do not care if my math above is exact but it is somewhere in the ballpark. I would discourage any change that fails to deliver a clear an unambiguous understanding for all players. Even those with basic math level. The feature we are currently discussing is not.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 10, 2019, 09:02:56 PM
I agree with the problem statement. Yes, it is quite noticeable that early game research rate stays somewhere at 20 turns/tech after you pick few very cheap initial technologies. Middle game pace varies in range of 4-10 turns/tech. Whereas very late game gives 2-3 techs a turn!

I do not agree that beelining is a problem and should be penalized. However, this is completely different statement and should be discussed and fixed separately if at all.

Obviously, research rate doesn't match the contemporary civilization research power. By itself it does not break the game as it applies fro all factions equally. However, it is inconvenient from strategy planning point of view. Waiting 20 turns for tech to research is as frustrating as getting a rain of them. Either extreme defeats the feeling of research direction control.

Logically the fix is straightforward. Match the rate that is currently unmatched. One way to do it is to make growth more exponential looking: slower in the beginning, much faster at the end.

Current game formula is very convoluted. It is more convoluted by using different formula elements for human and AI.
http://alphacentauri2.info/wiki/Technology_Cost
http://alphacentauri2.info/index.php?topic=3505.0

For starter I don't see a point in "add 1 for factions with a natural penalty to research, or subtract 1 for factions with a natural bonus to research" step. There is already RESEARCH SE scale that does this. No need for additional hidden value.

Then the "Modify by WORLDSIZE" notorious problem. The world size does not scale your civilization. It limits it. So it should put more cost on latest technologies when you are utilizing whole map surface but it shouldn't affect initial research cost when your civilization is as small as on any other map size.

What is "faction tech cost modifier"? Never heard of such.

Prevalent factors are number of techs faction researched already plus small discount if faction is behind. It seems that linear dependency on TECHS is the root of evil here. It does block research quickly at the beginning and doesn't block them enough at the end. Game designer overlooked obvious exponential empire growth. It is actually double exponential: both in number of bases and base sizes dimensions but whatever.
I'd suggest to replace it with exponential growth formula. Say each following tech is 7% more expensive. That doubles the cost every 10 techs and increases ~400 times for the last tech. Giving that you starts with 4 working squares (2 bases * 2 square) and end up with 400 working squares (40 bases * 10 squares) * 3 for improved terraforming and facilities * 2 for multiplying facilities = 2400 / 4 = 600 times bigger research contribution. That seems like a match.
Of course, it takes few tweaks like bonuses for those fell behind, etc. However, I don't want to add obscure bonuses for AI vs. human - AI is already very nicely tuned by growth and production multipliers.
Title: Re: SMACX Thinker Mod
Post by: dino on December 10, 2019, 09:34:30 PM
In vanilla game the tech cost is based on the number of techs known, so you avoid trading the techs until you get the essential ones you need, so you keep the research cost low and can get these essential techs much faster, than AI which can't purposefully avoid trading could. The new formula makes tech cost static (except for first 10 techs, due to early game balance issues ). So gaining a new tech from trade, or any other mean is never a disadvantage. It's also the way it works in later Civ games, it's more realistic for sure, whether realistic is better is another question. On one hand it prevents mentioned cheese/exploit and has more versimilitude to it, on the other it penalizes beelining deep into the tree, limiting viable player options.

In a discussion before this feature was implemented, the main stated goal of the feature was to make late game techs much more expensive than vanilla, to keep up with exponential growth of energy income of competent player, or improved AI, while not fundamentally changing the pace of early and mid game research.

Now, I've never analysed the new formula mathematicaly and played only some early games with it.
From what you are saying, it seems that Inducti0 in the first revision of the feature, implemented only static, tech tree level based cost, while keeping the general cost curve close to vanilla.
He probably was going to play with the tech cost curve itself in the next release, but was distracted with his other projects, or work and didn't get around doing it.
Last time he talked about the feature in this thread, he asked for a feedback and shared how he thinks the curve should be adjusted.

Since the feature is implemented and we have the source code, anyone can play with it and try to find a satysfying solution.
You could even get rid of the static tree level based cost and only change the cost curve if you wanted.

> What is "faction tech cost modifier"? Never heard of such.

I think it's a trait you can give a faction in the editor/ txt file, none of the vanilla factions uses it, there are few more functional, but unused by vanilla factions traits.
Title: Re: SMACX Thinker Mod
Post by: dino on December 10, 2019, 09:46:10 PM
I agree that this feature is not in a satysfying state and I agree with your complaints about it's current state.
I thought you could be the right person to make it work, this is why I mentioned it in the other thread.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 11, 2019, 12:11:15 AM
Good point about trading hold off exploit. I agree setting fixed price for each tech would solve it and makes it easy for everybody.

So we have two fixes:
1. Fix technology cost.
2. Adjust cost growth to match economical progress.

#1 Can be done arbitrarily. It doesn't much matter as long as they are reflecting how far the technology down the tree. Level based is a simplest and most visual idea.
#2 I think exponential approach is the easiest. It does fix both initial technologies and late game ones. We just need two parameters: initial cost and multiplier.

Inductio already started working on it. I don't want to tamper with it until he finishes. He may be in the middle of it. Then I can see if I can tweak his parameters.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 11, 2019, 01:52:33 AM
Here is the sample tech cost graph assuming everything goes smoothly: 400 turns for 85 techs, everybody has same number of techs, etc. It varies very slightly with parameters but mostly stay the same. Apparently it is practically linear, which is exceptionally incorrect design for 4X game.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 11, 2019, 02:11:57 AM
And here is the simulation of what happens when labs grow exponentially, research cost as in previous post and all research got discovered by 270 turn something. I don't think the exact year matters it is just an illustration how vanilla research cost formula deals with exponential labs growth.

Clearly there is a plateau in first third of the game and surge in the last.

----------------------------

Below are slightly more accurate simulation. Standard map. This time I assume sigmoidal number of bases growth from 2 to 15 in the turn 150 and then to 30 in turn 300. Average number of worked tiles per base grows from 2 to 10 in a turn 300 linearly. Average labs yield per tile grows from 0.5 (1 energy per tile * 50% allocation) to ~9 in turn 300 (4 energy/tile * 50% allocation * 3.5 multiplier * some RESEARCH bonuses).

It is more linear. Still the first third slowness is there.

----------------------------

However, keep in mind these are some math simulation only. Could be far off the real game. For example, the labs growth in the very beginning when you only explore, don't have third base yet and don't have Ecological Engineering is practically zero.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 12, 2019, 07:17:08 PM
I agree that this feature is not in a satysfying state and I agree with your complaints about it's current state.
I thought you could be the right person to make it work, this is why I mentioned it in the other thread.


First of all, see my elaboration of tech cost here http://alphacentauri2.info/index.php?topic=21359.msg122661#msg122661.

About forcing blind research engine to pick lower level techs first. I don't think it is even a problem. What's wrong with getting better tech by all means possible? If you are so afraid to give up advanced technologies then just forbid it on engine level and be done with it. Of course, this would kill a strategical research element of the game but now everybody are equal - complete balance.
:)

For AI to miss an important low level techs in blind research is another question. I agree this is an AI related problem. However, it is there not because higher level techs are better but merely because blind research is presented with multiple opportunities and not always pick the best choice. That is extremely easy to fix. Just give best technologies best weights (in all domains) and be done with it. Now when such technology appears it'll be chosen automatically by blind research engine. That is what weights are for.
In my mod I did exactly same and then emulated random research progress to assure best technologies are selected first.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 12, 2019, 08:05:15 PM
Thinker version 1.0 is now available from downloads (https://github.com/induktio/thinker). Releasing this version was important to update the documentation to keep up with the changes in develop builds. Here's the changelog since the last release:

* SMAC in SMACX mod files are now included with Thinker by default (can be enabled with smac_only=1)
* Removed smac_only dependency for ac_mod/labels.txt (redundant file for the mod)
* Factions with positive Planet rating will build less boreholes than the average
* Adjust tech_balance feature to also prioritize probe team prerequisite tech
* AI should relocate lost HQs faster than previously
* New option: revised_tech_cost provides an extensive overhaul for the research cost mechanics. More info in Details.md.
* New option: expansion_factor limits how many bases the AI will attempt to build before stopping expansion entirely
* New option: limit_project_start determines how soon the AIs are allowed to start secret projects
* Fix issue where AI sometimes ignored undefended enemy bases when it had the chance to capture them

I don't currently have much plans to keep on adding more features on this mod. Of course, tnevolin is welcome to keep on developing his fork of this mod. I don't know if I can merge all of that stuff though if it changes game mechanics in a really extensive way and does not have configuration options. But maintaining a separate fork should not be problematic at all if the upstream release is mostly static.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 12, 2019, 08:11:10 PM
* Factions with positive Planet rating will build less boreholes than the average

AI factions?
Do you count current PLANET rating = innate + SE? If so, does it mean when faction chooses specific SM to increase their PLANET rating it actually program itself to build less boreholes?

Stupid question.
How does this improve this specific faction AI? Isn't it a drawback?
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 12, 2019, 08:21:45 PM
AI factions?
Do you count current PLANET rating = innate + SE? If so, does it mean when faction chooses specific SM to increase their PLANET rating it actually program itself to build less boreholes?

Only the Planet rating defined in the faction's txt file is considered for this. SE choices are ignored. And yes, it only applies on the AI factions. Reasons for this were discussed in earlier pages of this thread, it's there for the purpose of narrative.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 12, 2019, 11:52:38 PM
Bug?

Ctlr-Shift-Q starts new game in vanilla. It quits in Thinker.
Title: Re: SMACX Thinker Mod
Post by: dino on December 13, 2019, 10:44:13 AM
Why would thinker had anything to do with it ? Maybe PRACX ?

Just tried and Ctlr-Shift-Q quits to the main menu, Ctlr-Q quits to desktop, was it any different in vanilla ?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 13, 2019, 01:16:43 PM
I have no clue who has what do with anything. Just reporting.

Did you try Ctlr-Shift-Q in Thinker? Do you have PRACX or anything else installed?
Title: Re: SMACX Thinker Mod
Post by: dino on December 13, 2019, 02:47:49 PM
Vanilla and thinker, both with, or without pracx, behave the same for me, as I described.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 13, 2019, 03:06:49 PM
Thanks for verification. I'll test some more.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 13, 2019, 06:09:31 PM
Induktio,
Looking at you tech cost formula in latest build. Have you compared its progression to vanilla? I mean, of course, you'll have differences within a level as you price them flat while in vanilla they are progressing costs. However, if you average vanilla costs per level - does it become close to yours? If not what are most noticeable differences? Are these difference intended?
Title: Re: SMACX Thinker Mod
Post by: dino on December 16, 2019, 12:01:13 AM
I was thinking about the enemy territory monopole magnets and you should definitely try to implement your idea, if you find the time.
From a versimilitude point of view, you shouldn't be able to drive on enemy magnets since defender would just cut off the power, or sabotage it, roads should be usable.

Player can easily concentrate defenses in endangered bases, but you won't be able to make AI recognise incoming invasion.
If you prevent player from snowballing within a single turn through AI territory, it'll have a chance to quickly move units toward invading forces and reinforce neighboring bases.
I don't think AI will be capable of any serious resistance against competent player without this change, but you know this, this is why you've started to think about it in the first place.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 16, 2019, 04:43:37 PM
> I was thinking about the enemy territory monopole magnets and you should definitely try to implement your idea, if you find the time.

That is kinda undecided. It's maybe not the most important rule change, but might be useful. In any case I think magtube deployment greatly favors human players when they can strategize how to work around pathfinding issues and utilize various chokepoints. That's why Thinker AI's don't even build magtubes because it might just make conquest easier for humans. And magtubes should be located towards the end of the tech tree for balance anyway.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 16, 2019, 04:52:55 PM
AI doesn't build magtubes? You mean on purpose? Interesting.
Title: Re: SMACX Thinker Mod
Post by: dino on December 16, 2019, 05:51:05 PM
> That's why Thinker AI's don't even build magtubes because it might just make conquest easier for humans.

But while player can easily predict an attack direction and concentrate forces there, or reinforce defenses/retaliate within a single turn with his magtubes network, AI can't and is easy to divide and conquer.
If it had full magtubes network, but it would be impossible to use magtubes on the enemy territory, it would also be able quickly respond to an attack without exposing itself.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 11, 2020, 12:46:43 AM
Have you fixed the Children Creche morale mess? Or include any path that does?
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 25, 2020, 09:55:10 PM
Apparently there haven't been many bug reports since the release which is a good thing. The main unresolved issue there related to the satellite bug which only happens while smac_only is active. Anyways if there's some new issues that aren't related to features in the forked version, it can be still posted here. I haven't changed Children's Creche behaviour in any way.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 25, 2020, 10:58:03 PM
I did in my mod.
Title: Re: SMACX Thinker Mod
Post by: MercantileInterest on February 26, 2020, 08:56:21 PM
Induktio, will Scient's open source mod work with Thinker?
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 27, 2020, 11:58:00 AM
> will Scient's open source mod work with Thinker?

I think it would require some more development to get them working simultaneously. I haven't monitored closely what changes have been made in OpenSMACX so it's hard to say exactly. The difficulty here comes from the fact that both mods have to patch the binary in their own ways, so I'm not sure about the incompabilities at the moment.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on March 07, 2020, 07:42:51 PM
Hey just wanted to say your mod rocks. I recently reinstalled SMAX on a whim from my original CDs and Thinker has really been keeping things fresh and interesting.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 10, 2020, 06:26:25 PM
Nice to know! You're welcome to post on this forum any stories or screenshots about the gameplay too.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on March 10, 2020, 06:50:59 PM
The Management enthusiastically agrees...
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on March 22, 2020, 05:51:23 AM
Hi there.

My friend Nevill and I have been playing another PBEM game with the Thinker AI over the past few months, testing out some custom factions, tech trees, and SE settings. Almost everyone ended up on their own island, so the AI hasn't really been given a chance to shine. Ah well.

We've had a few strange occurrences with techcosts. The first one occurred in 2150, when I was researching Doctrine:Loyalty (C2), and the techcost suddenly jumped from 143 to 367.

The second one happened just now, around 2208. Both of us were researching Planetary Econ (B6), but my techcost was 683 and Nevill's was 1215. This is somewhat unbalancing to say the least.

We're not really sure what could possibly cause this. The only factors which come to mind are my +5 EFFIC and +4 RESEARCH score, and my faction having +1 labs per base (the RESEARCH rule in Faction.txt).

Saves and custom files are available if needed.
Title: Re: SMACX Thinker Mod
Post by: Hans Lemurson on March 23, 2020, 05:54:31 AM
I've been playing a game on Transcend as the Morganites, and have been enjoying the challenge of the other AI's actually developing past me (with one exception).  I got lucky starting out with a large continent to myself, with a nearby Manifold that allowed me to capture enough mindworms to survive.  I've had to avoid Free-Market because I can't risk the wrath of the nearby Gaians who have taken much of my coastline, so I may have to stay Green this run.

The one AI that has done very poorly this game was the Free Drones.  They started on their own small island, but have stopped settling it after two cities (it could hold 4), and haven't set foot on another continent or even made any sea-settlements.
(http://)

The University has similarly given up settling their land.  After losing a city to a mind-worm attack, the northern half of their land has just been left alone as a wasteland of fungus while they churn out sea-colonies.  Their many sea-colonies and their lucky city built in the middle of the Monolith Ring have prevented them from falling into obscurity, but they have a big chunk of un-used land.  Even the Pirates have more land colonies than they do!

I've attached my save-game if you're interested in taking a look at the world.  I'm playing with Thinker_v1.0 and PracX 1.11 (in case that matters)
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 24, 2020, 10:01:38 AM
> My friend Nevill and I have been playing another PBEM game with the Thinker AI over the past few months, testing out some custom factions, tech trees, and SE settings. Almost everyone ended up on their own island, so the AI hasn't really been given a chance to shine. Ah well.

Very good to hear reports about PBEM play too. It's one of the least tested game modes here I think.

> We've had a few strange occurrences with techcosts. The first one occurred in 2150, when I was researching Doctrine:Loyalty (C2), and the techcost suddenly jumped from 143 to 367.
> The second one happened just now, around 2208. Both of us were researching Planetary Econ (B6), but my techcost was 683 and Nevill's was 1215. This is somewhat unbalancing to say the least.
> We're not really sure what could possibly cause this. The only factors which come to mind are my +5 EFFIC and +4 RESEARCH score, and my faction having +1 labs per base (the RESEARCH rule in Faction.txt).

As far as I know, the formula that I've presented in Details.md should accurately reflect the new tech cost code. You didn't mention what SE RESEARCH modifier Nevill had. Having +4 SE RESEARCH applies a 40% discount over the default cost, per original game rules. The difference in that modifier doesn't fully explain 683 and 1215 costs, so there's some additional modifier at work here, but I'm not sure which one.

Personally I think research modifier is overpowered especially when combined high efficiency. It could have been easily nerfed to a 7% discount per point or similar, but I didn't want to go on overwriting original game rules to such an extent. I only refer here to the social engineering research variable, not this one:

> RESEARCH    = Free research points per base per turn.

Free research points should not have any kind of impact in the tech costs in this new formula. Neither does the EFFIC rating.

When you say "the techcost suddenly jumped from 143 to 367" what was the tech you were trying to research previously? Just remember that all the modifiers in Details.md are multiplicative, so sometimes there might be large jumps in tech costs. But then again, the cost should immediately be updated if you decide to switch research target (directed research only?)

Title: Re: SMACX Thinker Mod
Post by: Induktio on March 24, 2020, 10:20:44 AM
I've been playing a game on Transcend as the Morganites, and have been enjoying the challenge of the other AI's actually developing past me (with one exception).  I got lucky starting out with a large continent to myself, with a nearby Manifold that allowed me to capture enough mindworms to survive.  I've had to avoid Free-Market because I can't risk the wrath of the nearby Gaians who have taken much of my coastline, so I may have to stay Green this run.

The one AI that has done very poorly this game was the Free Drones.  They started on their own small island, but have stopped settling it after two cities (it could hold 4), and haven't set foot on another continent or even made any sea-settlements.

Nice to see a couple of the AIs developing so well that they can match the player in research speed too. Even though Pirates start on the ocean, this game display their amphibious colonization ability as well. Needless to say, stock AI doesn't understand that strategy AT ALL.

Overall I think this is about the expected level of AI performance on this map size. Standard 40x80 maps are relatively small, so some AIs almost always get stuck in a corner and cannot expand properly. Faction placement can't do much there, since there's only so many valid locations to choose from.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on March 24, 2020, 11:30:29 AM
> You didn't mention what SE RESEARCH modifier Nevill had.

He's running Fundie in 2208 with no faction modifiers, so that should be -2 RESEARCH.
Still doesn't fully explain the difference, as you said. It does put things into perspective, though - one would expect a delta of 6 RESEARCH to have a significant effect.

> When you say "the techcost suddenly jumped from 143 to 367" what was the tech you were trying to research previously?

I should've phrased that more clearly: the cost of the tech jumped while I was in the middle of researching it. As in, it went from 6 years to research to 16 between turns. Quite a surprise.
Unless that's what you were referring to and I misunderstood, that is.

And yes, we are playing directed research only.

That said, I went back a few saves and found that in 2147 I was researching EcoEng (E4), and the stated cost for that tech was in fact 367. Then I switched to researching C2 in 2148, and the cost updated immediately to 143.
I'm not sure what this means, but it's probably worth noting.


We actually had some other AI-related questions / curiosities too, now that I remember:

1: The mod we're using nerfs boreholes down to 0-2-6. As far as we can tell, the AI hasn't built a single one. This isn't necessarily a bad thing (since boreholes were so epic before), but I wonder how this affects the AI's terraforming decision-making?

2: Could you possibly elaborate a little on how the AI makes SE choices? In our mod, Police State was changed to +2 SUPPORT +2 POLICE -2 TALENT, and Planned changed to +2 GROWTH +1 INDUSTRY -2 ECONOMY. All but one AI (whose faction is banned from running PS) has been running PS+Planned for the whole game, and this hasn't changed even when at war. Again, not necessarily bad (I myself ran Police State for most of the game), but kind of interesting.
None of the AI factions have any political or economic preferences, if that affects things.

Table of SE settings we are using:
Code: [Select]
Frontier,        None,   
Police State,    DocLoy,  ++SUPPORT, ++POLICE,   --TALENT
Democratic,      EthCalc, ++EFFIC,   ++GROWTH,   --SUPPORT
Fundamentalist,  Brain,   ++PROBE,   +MORALE,    +INDUSTRY,  --RESEARCH     
Simple,          None,
Free Market,     IndEcon, ++ECONOMY, ----POLICE, --PLANET,   -INDUSTRY
Planned,         PlaNets, ++GROWTH,  +INDUSTRY,  --ECONOMY
Green,           CentEmp, ++EFFIC,   ++PLANET,   --GROWTH,   +TALENT
Survival,        None,   
Power,           MilAlg,  ++SUPPORT, ++MORALE,   -INDUSTRY,  +TALENT
Knowledge,       Cyber,   +EFFIC,    ++RESEARCH, --PROBE,    -POLICE
Wealth,          AdapEco, +ECONOMY,  +INDUSTRY,  --MORALE,   -PLANET
None,            None,
Cybernetic,      DigSent, ++EFFIC,   ++RESEARCH, +PLANET,    ---POLICE
Eudaimonic,      Eudaim,  ++ECONOMY, ++GROWTH,   +SUPPORT,   ---MORALE
Thought Control, WillPow, ++POLICE,  ++INDUSTRY, +MORALE,    ---SUPPORT

In more general commentary, it seems that the AI has done the best it can considering the challenges of dealing with islands and water. The ones that started on decently-sized landmasses are quite powerful on paper, with many bases and competitive research (at Transcend difficulty). In fact, one of them has more council votes than me, and I have the Empath Guild giving me more votes!
(I do have a -2 GROWTH penalty on my faction, though, so perhaps this isn't that surprising after all.)

Nevill still overran his neighbour in a few turns once he had an actual military on hand, but that was to be expected.

Here is a picture of what the map looks like a century in. I am the white player in the top left, and he is the yellow player in the bottom right.
(https://i.imgur.com/m3KhJll.png)
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 24, 2020, 12:57:06 PM
> Still doesn't fully explain the difference, as you said. It does put things into perspective, though - one would expect a delta of 6 RESEARCH to have a significant effect.

Yeah that is a very large difference, could say almost unbalancing. The numbers still don't match exactly given that one faction is +4 research and the other is -2. Could it be that the other faction also receives the 15% discount when the target tech is also known by some AI faction with a commlink frequency?

> That said, I went back a few saves and found that in 2147 I was researching EcoEng (E4), and the stated cost for that tech was in fact 367. Then I switched to researching C2 in 2148, and the cost updated immediately to 143.
> I'm not sure what this means, but it's probably worth noting.

Those numbers are exactly what the costs should be according to the new formula. If you plug levels 2 and 4 to the formula given in Details.md you can also see that the cost jump from level 2 to 4 is a factor of 2.56, as can be seen from those numbers.

> 1: The mod we're using nerfs boreholes down to 0-2-6. As far as we can tell, the AI hasn't built a single one. This isn't necessarily a bad thing (since boreholes were so epic before), but I wonder how this affects the AI's terraforming decision-making?

I'm kinda surprised if they didn't build any boreholes. It's important to note here the AI doesn't do any cost-benefit calculations for most of the terrain improvement items, they just build them whenever they are available. The one exception to this rule is plant/remove fungus actions. The AI actually compares fungus yield to forest tiles when deciding which one to use. Just watch out if they ever get the Manifold Harmonics...

> 2: Could you possibly elaborate a little on how the AI makes SE choices? In our mod, Police State was changed to +2 SUPPORT +2 POLICE -2 TALENT, and Planned changed to +2 GROWTH +1 INDUSTRY -2 ECONOMY. All but one AI (whose faction is banned from running PS) has been running PS+Planned for the whole game, and this hasn't changed even when at war. Again, not necessarily bad (I myself ran Police State for most of the game), but kind of interesting.

Also here's one undocumented behaviour: the social engineering AI ignores TALENT modifier when deciding which model to choose. In this case they would see Police State as having only positive modifiers, so naturally it would tend to override other choices for most of the time. User interface doesn't display this modifier correctly and none of the default choices utilize it, so that's why I didn't program it there. It could be added in some kind of an update, but I haven't given any thought on how it should be weighted against other modifiers.

Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on March 24, 2020, 01:28:22 PM
> Could it be that the other faction also receives the 15% discount when the target tech is also known by some AI faction with a commlink frequency?

Hmm, well, I see in my save that 2 AI factions already know that tech (B6), and we obviously both have commlink with them by this time. I would expect that would affect both of us though, no?

Not sure if the AI plays by the same rules (playing at Transcend with default multipliers, i.e. cost_factor=7), but those two factions are currently researching level 6 techs with costs of 885 and 797. Neither should have any RESEARCH modifier, though one is PS+Planned and the other Demo+Green.

> Those numbers are exactly what the costs should be according to the new formula. If you plug levels 2 and 4 to the formula given in Details.md you can also see that the cost jump from level 2 to 4 is a factor of 2.56, as can be seen from those numbers.

Interesting. So the new formula is at least giving consistent jumps between levels.

>  In this case they would see Police State as having only positive modifiers, so naturally it would tend to override other choices for most of the time.

Yeah, I suspected this was the case tbh. I suppose it's a bit of a niche thing, since only mods mess with TALENT. We could always just adjust the penalties and see if the AI picks other choices more.

Of course, I wouldn't object if you did feel like adding support for it in an update! I suppose TALENT most closely compares to POLICE, since both affect the number of drones per base - however, POLICE requires you to invest in actual police, while TALENT is passive. This might benefit the AI a bit more, since it tends not to use police very well.
Title: Re: SMACX Thinker Mod
Post by: Hans Lemurson on March 24, 2020, 07:42:45 PM
I ran across two strange bugs, but I don't know if they are related to this Mod.

#1 is a text bug in the message about losing minerals when I switch projects.  When I first noticed it it said "Switching between Believers carries a 50% retooling penalty..."
When I closed the program and reloaded the game, the same message said:
"Switching between Mission Year 2211 carries a 50% retooling penalty..."

#2 seems to be the "Ghost Drone" bug, from what I've been able to track down.  Super-drones that are pacified by police appear as content in the Psych window, and do not cause drone-riots, but display as super-drones in the population display.

I bring these up here because this is the mod I was playing when I noticed the bugs.  Do you know if these issues have come up or been addressed elsewhere before?
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 26, 2020, 07:22:07 PM
> Hmm, well, I see in my save that 2 AI factions already know that tech (B6), and we obviously both have commlink with them by this time. I would expect that would affect both of us though, no?

If you both have the both commlinks, then the 25% discount should apply equally.

> Not sure if the AI plays by the same rules (playing at Transcend with default multipliers, i.e. cost_factor=7), but those two factions are currently researching level 6 techs with costs of 885 and 797. Neither should have any RESEARCH modifier, though one is PS+Planned and the other Demo+Green.

Just a guess, the faction with the cost of 797 has Manifold Nexus on their territory? It applies a +1 research modifier, so the cost would be 885 * 0.9 = 797. Edit: probably it's something else, since +1 research bonus applies only on alien factions when they have it inside their borders.

> I bring these up here because this is the mod I was playing when I noticed the bugs.  Do you know if these issues have come up or been addressed elsewhere before?

I'm not sure at the moment if Scient's patch adjusted something related to those features. I recall people reporting some kind of bugs with super drones in the vanilla game. Can you open the save with the standard terranx.exe binary and see if those problems persist?
Title: Re: SMACX Thinker Mod
Post by: Hans Lemurson on March 27, 2020, 12:58:44 AM
The standard terranx.exe will not open with the modified alphax.txt, I'll need to find the original version.

...Ugh, Windows 10 won't even let me delete or rename my original folder because applications are using the arialn.ttf file inside there as a font source!

....
Ok, got it running.  Started with a clean install of Alpha Centauri. 
With the original terranx.exe, the "ghost drones" DO appear, but there is no error in the retooling message dialog.
...
When I install PracX, same thing (super-drones yes, retooling message fine)
...
When I install Thinker, I see no change.

A clean install seems to have fixed all of the problems.  Interesting.  Good to know!
I did notice that the message was not just without errors, but actually different:
Quote
Switching production in mid-course carries a 50% retooling penalty for all but the first 10 minerals.  4 minerals would be lost.
as opposed to the previous message that had the error:
Quote
Switching production between Mission Year 2211 carries a 50% retooling penalty for all but the first 10 minerals.  4 minerals would be lost.

Now, interestingly, when I contacted the Hive (and left them seething after I refused their demands, and so remained at vendetta with me), the retooling message was as follows:
Quote
Switching production between monopolistic grasping carries a 50% retooling penalty for all but the first 10 minerals.  4 minerals would be lost.
The message seems to be trying to access memory that holds data which was never properly set.  Maybe it was somehow displaying the message for switching away from a Secret Project, but since no such project existed it read from old memory.

But anyways, the problem was clearly at my end, not yours.  Thanks for all the good work!
Title: Re: SMACX Thinker Mod
Post by: lolada on April 23, 2020, 10:22:45 PM
That is really annoying bug with drones and wrong display. Thats one of the reasons i started looking for patches - bug is also present in vanilla game. I think its connected with secret projects - Human genome project or Virtual world trigger it.. looked like it, not 100% sure. Got the bug in my last game.. i have HGP.. i also had it in Zakharov game recently. It would be a big deal to fix it.

Some feedback:

- AI is doing great in gneeral - would be also nice if it build trance units to defend vs worms - i dont see them ever build that. Recently i played with Gaians and used them a lot and poor Morgan just couldnt figure out to build some trance or empath units. Ive seen Miriam building empath rover before - which is great since she has negative planet rating. Also some morgan ench. probe team in actions, they can actually do some damage sometimes even through The Hunter-Seeker project.

- would be also good to have AI build more interceptors - it would be much tougher. Looks like they spam lots of penetrators and when i build interceptors AI start to mostly sit in their base.. but in the end they defend really badly due to lack of interceptors. AAA units are actually nicely used by AI - issue is that AI sometimes gets the tech late.

- another thing - terraforming - sometimes AI just skips Centauri ecology tech and they are pathetic (Spartans...) .. this tech should be really top priority - if not first tech every AI research. The weather paradigm is also game-breaking for AI or those resource unlocking techs - AI that gets it just run-away with game .. at least for a while.

- another issue is i see Morgan units removing 3-2-3 fungus tiles when they got Manifold Harmonics (i am playing will to power mod.. that SP is quite early there).. AI just got tree farms, looks like it doesn't understand those fungus tiles are way better than forests, especially since Morgan is already having eco damage issues

Great mod, really liking it!  ;b;
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 27, 2020, 06:09:22 PM
The project has been on a hold ever since I finished v1.0, but maybe I should consider doing a comeback. After all, how many Rocky movies are out there? :D

> would be also good to have AI build more interceptors

I think there were some issues getting the AI to properly design interceptor prototypes, so maybe it is lacking because of that regard. Not sure how easily that could be altered.

> another thing - terraforming - sometimes AI just skips Centauri ecology tech and they are pathetic (Spartans...)

That issue shouldn't persist with most of the factions since the research priorities are altered by tech_balance. Probably Spartans are the only ones that consistently suffer from it. If just altering game rules would be preferred here, I would consider removing the tech requirement from former units. That would level the playing field significantly at the start.

> another issue is i see Morgan units removing 3-2-3 fungus tiles when they got Manifold Harmonics

If fungus tiles yield more than forests (ignoring tree farms), then the AI should always prefer fungus. So I'm not sure what is going on there because that shouldn't be happening. It should take Manifold Harmonics into account in the calculations.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on April 28, 2020, 02:55:19 AM
I would most certainly welcome an update to this great mod! :)

> I think there were some issues getting the AI to properly design interceptor prototypes, so maybe it is lacking because of that regard. Not sure how easily that could be altered.

Some counter-feedback: I saw the AI build a modest number of interceptors in my last singleplayer game. They would regularly fly up and shoot down my nerve gas penetrators after I bombed their bases. Combined with all the AAA units and Aerospace Complexes the AI built, it was actually a bit of a challenge to get enough penetrators through to nerve gas their bases down to zero.

Ironically, this actually served as a liability in some cases: when my jets attacked a base with another jet in it, the jet would be chosen to defend first, rather than AAA units or mindworms. This gave my attack much better odds and, when I won, would result in a nerve gassing.

Perhaps the AI should attempt to set AAA units (or ECM units, or even psi units, depending on circumstances?) as the designated defender? Since I expect most player attacks will be performed with jets or rovers, this will probably be a net help to the AI.

> If just altering game rules would be preferred here, I would consider removing the tech requirement from former units. That would level the playing field significantly at the start.

I'm personally in favour of this, but I feel that altering core game balance to make the AI work better gets into a murky area.

> I'm kinda surprised if they didn't build any boreholes. It's important to note here the AI doesn't do any cost-benefit calculations for most of the terrain improvement items, they just build them whenever they are available.

An update to this: I have since observed that the AI does in fact build some boreholes even at 0-2-6. So it could've just been random chance.
Title: Re: SMACX Thinker Mod
Post by: lolada on April 28, 2020, 09:28:41 AM
Sure, if you can improve the AI more I don't see why not and if you have time ofcourse. Formers and yield unlocking techs are game breakers - but i don't know if unlocking that would break the mods that use your AI and build on top of it.

Some more feedback:

I observed Morgans more later in that game and they did leave most of fungus untouched. So  i think its working correctly in the end. I don't know what they built in that tile.. too bad i didn't check. Removing fungus makes some sense to plant mine or borehole for example. They might have started removing the fungus before they switched to Green - since manifold harmonics don't work with 0 Planet rating. Anyway.. Morgan did later switch SE settings from positive planet rating, so they didn't get much use of it. Fungus is still good in the mod - those were 2-1-2 and 2-1-3 tiles without Manifold Harmonics activated (thats at planet  rating = 0).

- I can confirm that AI build interceptors and use them decently. It likely depends on AI.. Miriam and Yang spam strong units while Lal seems to protect his sea bases with scout rovers  ;lol. In general I think AI would benefit from more interceptors. They do seem to spam pentrators more and use them well on killing formers and crawlers.

- AI uses probes to great effect - Morgan ruined Zakharov in my last game with 0-10-2 neutronium probes and mind controlled three of his biggest bases, except HQ ofc. They also build enhanched probes that can go though hunter seeker when they have the tech.

- I never saw AI to build Trance units. This is real weakness - as player can ruin AI with native units, Morgan for example.. especially if PSI rules are tweaked. It would be really beneficial if -planet rating factions were supplemented by some trance defenders.

- Same for planet factions - they should promote building more native units. I don't think they build them ?! I didn't play enough to notice maybe. In contrast its very beneficial to see for example Miriam building some empath rovers because she has trouble killing worms.

- Other than that AI seems very slow to build defenders in sea bases once they die. I'm seeing EMPTY sea bases build Tree farms.. they are near coast but there's no forests.. or there's like one.
AI should also try to build at least one strong defender per base.. something like 1-3+-1, no rovers or scouts. Sea bases certainly should have these. 


Title: Re: SMACX Thinker Mod
Post by: Induktio on April 29, 2020, 01:14:20 PM
There's one significant thing that needs to be decided though. Tnevolin has also been implementing lots of stuff in his The Will to Power fork (https://github.com/tnevolin/thinker-doer). Back then we decided the project could be forked because my focus was mainly AI improvement instead of the more balanced game mechanics tnevolin has been doing. I also didn't have that much time to evaluate what new stuff could be incorporated in this mod.

I suppose we could still keep these versions separate because Thinker is mostly supposed to be a "vanilla" game mechanics experience, but I have a feeling some of the TWP changes could be imported here too. If there's going to be new releases of Thinker, I probably won't be doing huge changes. What are your thoughts on this?
Title: Re: SMACX Thinker Mod
Post by: lolada on April 29, 2020, 10:00:04 PM
I am too new in this to give advice ^^  i guess anything goes as long as other modders can easily change it if they wish. I can see appeal to mod the game with better AI to own needs. Vanilla AI is really sad.

I started an AAR game with WTP mode - gonna comment on both AI and WTP so if you have time there will be some feedback there also. I played quite a bit more, but need to to write it down all, edit pictures etc..

http://alphacentauri2.info/index.php?topic=21438.0
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on April 30, 2020, 03:52:35 AM
Which changes in particular are you thinking of importing?

I do agree with the sentiment of keeping Thinker as a relatively vanilla experience; one of the things I like most about it is that it works as a base you can slap other changes on top of.
Granted, the change to the techcost formula is already a step in this direction, though in my opinion a positive one.

Relatedly, I've lately been playing with a mod that removes supply crawlers entirely from the game. I am pleased to report that the AI on Transcend remains a suitably tough opponent - their progression is slowed as much as the player's.

The AI remains enamoured with Planned economics, though they use both Police State and Fundamentalist politics to varying degrees. They seem to choose between the three values about equally.
The exception is my custom anti-PS "alien" faction, who always goes Green despite having no PLANET rating or SE compulsions in this regard. It's also the only one that chooses to go Democratic at any point.
I also just observed another faction that starts with +2 ECON choose Green. Presumably he didn't want to give that up (as I modded Planned to have -2 ECON instead).

I am wondering exactly what conditions would make an AI without relevant SE preferences switch to Democratic. By 2200, the AI has usually set up most of its bases* and should have a decent minerals income, so the -2 SUPPORT is less of a concern, while the +2 EFFIC helps to squeeze more income and prevent drones from all its sprawling. On the other hand, Fundy with +1 IND is very useful for war, and the AI has spent a lot of time at war in my recent games. More playtesting is required.

*I should probably qualify that this is on random Standard maps that tend to have a lot of ocean, so the AI tends to run out of space and stop by 2200. On a Huge map with less ocean, it can and does still have plenty of scope for expansion. So experience definitely varies.

There was a curious occurrence when one AI (an "alien" faction) loaded transports with troops and landed them on a then-unclaimed continent. Those troops then proceeded to wander around doing nothing useful, and they are still there after I landed my own colony pods to colonize the continent. It was the Monsoon Jungle too, so would've been valuable regardless. I'm not sure what can be done in this regard, but maybe it's possible to get the AI to queue up colony pods and transports together? My understanding of Thinker is that the AI plans turn-by-turn rather than committing to any long-term strategy, though...

EDIT: One feature from WTP that might be nice to import would be the changes made to unit reactors: specifically, the ability to disable the bonus hitpoints from better reactors. The alternative hurry formulas might be nice to have too.

Any of the modding hooks WTP added would also be very nice to have in base Thinker.
Title: Re: SMACX Thinker Mod
Post by: dino on April 30, 2020, 11:02:34 AM
There's one significant thing that needs to be decided though. Tnevolin has also been implementing lots of stuff in his The Will to Power fork (https://github.com/tnevolin/thinker-doer). Back then we decided the project could be forked because my focus was mainly AI improvement instead of the more balanced game mechanics tnevolin has been doing. I also didn't have that much time to evaluate what new stuff could be incorporated in this mod.

Adjustable changes to the combat are must have for me, he made them adjustable and vanilla by default:

1) Adjustable stack collateral damage.
2) Adjustable healing rate.
3) No reactor HP and adjustable reactor cost factor.
4) Adjustable tachyon filed/ perimeter defense bonus.
5) Weak artillery has a chance to make a damage.
6) Correct combat odds display.
7) Adjustable level of randomness in combat results.
8) Planet bonus on defense.

Other great stufff:
1) Borders of sea and coastall bases.
2) No mineral bonus for aquatic factions.

I'd also like from Ytzii's patch:
1) Condensers only increase rainniness of nearby tiles, no 50% nutrient bonus.
2) Pacifism drone rules.

> terraforming - sometimes AI just skips Centauri ecology tech and they are pathetic (Spartans...)
It's easily dealt with alphax.txt, just add 3 points to all ai research weights and no one will skip it ( or just make tech_balance=1 bonuses additive instead of multiplicative )
Title: Re: SMACX Thinker Mod
Post by: lolada on April 30, 2020, 02:14:20 PM
- No reactor HP is really nice change, they are otherwise gamebreaking, side with reactor can just stomp the oponnent. Making units cheaper with new reactors is elegant solution.

- Artillery change is great - vs WTP defensive bonuses especially - because its worth to have 2-3 arty units to soften the defenders, otherwise attacker loses a lot. Damage is fine if arty is not obsolete - advanced infantry artillery (smth like (6)-1-1 or (8)-1-1 is cheap and useful. Rovers are much more flexible but also more expensive.
One thing that I would like to see buffed is PSI artillery - it seems ineffective, at least its cheap.

- Healing rate change is 10/10.. it allows weaker units to gank up on strong defenders and helps AI a lot in attack. Player can use it as well so its not one-sided.

- Defensive bonus (territory +%50) is%  the most debatable.. but its the essence of the mod. I can see why some people might really not like it. But without it player can just stomp AI. Its a bit gamey bonus - but player got it as well. It would be interesting if bonus would scale farther from base.. for example a unit on right side of the border is 100% stronger than a tile away in enemy land.

- Combat randomness - i find that actually ok - its surprising a bit at first, but it gives the game replayability and invloves more tactics. Otherwise player can just stomp AI with 6-10 elite rovers (with some probe, defender suppoer) that are upgraded as new techs come out.
When there's real chance to 6-1-2 rover to die vs formers.. say former on forest thats 1.5 def, 2 in own land so ratio is 6:2... if rover is elite its 9:2.. 4.5:1 and with those round changes whatever is there... rover dying 15-20% of time increases risk drastically. Stomping everything with 95+% odds in vanilla just make me lose interest in game instantly.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 30, 2020, 02:23:46 PM
> I am wondering exactly what conditions would make an AI without relevant SE preferences switch to Democratic.

Did you mod the social models in any way from vanilla values? People need to always supply the modded values if asking "why does the AI choose X over Y?" Vanilla version of Democratic should be strong enough (but overpowered) for most AIs to prefer it most of the time.

> I also just observed another faction that starts with +2 ECON choose Green.

Having +2 ECON level or more is heavily preferred by the new social AI.

> My understanding of Thinker is that the AI plans turn-by-turn rather than committing to any long-term strategy

Yeah that is true. The issue is that any long term strategies would have to be stored with the save game or otherwise it would behave inconsistently with save game reloads. There is some possibility to save extra data with the save game but the space is constrained.

> specifically, the ability to disable the bonus hitpoints from better reactors.

That might be the biggest balancing change that could be done here. The patch only modifies combat calculation function to ignore reactor values, so it is really simple.

> The alternative hurry formulas might be nice to have too.

Maybe but I have no strong opinion on them yet.

> Any of the modding hooks WTP added would also be very nice to have in base Thinker.

And which ones would they be?

> Adjustable changes to the combat are must have for me, he made them adjustable and vanilla by default

I think disabling extra reactor HP would be the most important, because more advanced reactors would still be cheaper. In the original game, giving them both the cost/strength advantages was seriously a weird design choice.

Adjustable stack collateral damage would help the AI because it doesn't plan around those situations that well. About similar importance would be territory defend bonus and healing rate mods.

About those other modifications I'm not so sure, I really tend to keep a conservative approach when it comes to adding new features instead of just AI improvement. There's so much stuff to go through in TWP now but I don't think I can merge everything in this mod when the original design goals weren't like that.
Title: Re: SMACX Thinker Mod
Post by: dino on April 30, 2020, 02:49:08 PM
> About those other modifications I'm not so sure

Lower Healing speed is a must too, since even if AI spreads its assault over several turns it's still effective.
It also makes it much more difficult to steamroll with lightning speed through the enemy territory, since you have to take a few turns breaks to repair your assault force.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 01, 2020, 02:40:54 AM
I too enjoy the vanilla experience with Thinker augmenting it. So much so that I actually use the SMAC in SMAX mod included! I like that everything is toggleable and hope adding additional features would stay optional.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 01, 2020, 03:37:51 AM
> Did you mod the social models in any way from vanilla values? People need to always supply the modded values if asking "why does the AI choose X over Y?"

Yeah, I've since realized that giving feedback when I have mods on top of mods is probably not the most useful :V
It seems based on your replies that the social AI is in fact working as intended. Obviously, changing the balance of the various SE models will change how much the AI weights each of them. I was mostly just curious about the behaviour I saw.

I'm playing another PBEM game with vanilla factions now, though, so that might be more useful.

> And which ones would they be?

dino pretty much listed them all already, but I'd personally prioritize these ones:

- Adjustable Perimeter Defense and Tachyon Field bonuses.
- Adjustable repair rates.
- Changes to borders created by coastal and sea bases.
- Disabling free techs granted to alien factions.

If there was absolutely only one thing I could request to port from WTP, though, it would by far be the changes to unit reactors. Anything else would be a nice-to-have.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 03, 2020, 08:19:30 PM
> I like that everything is toggleable and hope adding additional features would stay optional.

Thanks for feedback. :) Possible alterations on the game rules should stay optional and I would not like to diverge on that design goal here.

Recently I've been toying with the idea of giving the AI some sense of long term planning. As it stands currently, Thinker just recalculates choices each turn and some elements of it are fairly static. Long term planning implies some changes to the save game format to store more data, but luckily there's many unused portions in the structures.

One way to tackle this would be to adapt Thinker's unit production more to the situation/opponent. I've been doing some testing with a feature that tracks how well each unit type does in combat and then selects more of those one with better values for production. In theory this could skew the AI to produce PSI units instead of the normal ones if they perform poorly against some opponent. Based on current trials it looks like some kind of an improvement, but there's lots of randomness in these A/B tests.
Title: Re: SMACX Thinker Mod
Post by: dino on May 04, 2020, 07:42:15 PM
> I've been doing some testing with a feature that tracks how well each unit type does in combat and then selects more of those one with better values for production.
> In theory this could skew the AI to produce PSI units instead of the normal ones if they perform poorly against some opponent.

By the time this solution would poke AI to produce good units, it'd be probably too late to produce them, since it'd require a large scale conflict first to net reliable results.

Better, determine 3 factions that are biggest potential threat ( score them by their military power, diplo status, mood, distance ).
Calculate statistics on amount of native, air, or artillery units they have, and produce more AAA/interceptor, trance/empath/native, artillery units to create a counter.
If some  threatening factions have tech advantage, produce more native, or psi units.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 05, 2020, 06:20:51 PM
That combat statistics feature would work best on bigger maps for sure, otherwise there isn't enough time to react. I'm not really sure if it's even necessary to implement though and I'm really trying to avoid any changes to the save game format unless it's necessary.

The logic for selecting whether to use PSI units might need some improving. At least I made a small update to the unit planner to emphasize trance/interceptor units more. Previously those unit types were mostly lacking from the AI. Trance/comm jammer ability can also be paired with AAA ability in the later phase of the game for some tough defense.

For completeness sake I've been also reversing the rest of Faction struct variables. It kinda bugs me to no end that it has so many gaps in the definitions, but it's maybe the most complex struct in the binary.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 07, 2020, 09:21:28 AM
- Just want to report that Drones are building tons of interceptors :D they are killing my air game lol. As long as AI has production and industry they spam units.

- I have one big issue with "advanced custom designes": AI can't really tell when thing is too expensive? For example they tend to build ton of armored cruiser probes - its a strong unit and quite a pain - but investing so much in them is kind of a waste. It would be much better if AI could mix both cheaper (unarmored for example, or foils) and more expensive units.
Can AI be learned to avoid building units that are for example > 12 turns? and build cheaper ones. Same for facilities, > 15 or 20 turns don't build. For example they build expensive rover colony pod when infantry one would be just fine.

Its interesting to see AI build some cheaper - non max tech units as well - as it really makes sense - for example to counter worms or probes. I would max design slots if possible, 64 is too restricting. Does it come with downside?

- Sea bases - AI does not protect them they stay empty for long time. That would be priority fix. I recall AI would insta change production in land bases from whatever to build to defender - if base loses the only defender. Sea bases do not do this.

Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 07, 2020, 10:50:43 AM
I am happy to report that I was defeated by the AI through a Progenitor Victory in 2281. It was a good game, and a learning experience for me.

Notably, the game was played with boreholes nerfed to 0-2-6, supply crawlers disabled, and no pop-booms available from Creches, which I understand are three of the main avenues for the AI to get ahead in Thinker. I think this might actually be a net buff for the AI, since the +30% multipliers it gets on Transcend let it far outproduce, and outtech, human players.

I noticed that the AI still has a bad habit of leaving bases empty sometimes, or only stationing rovers/hovertanks in some bases - although other bases had Isles and armoured defenders in them, which I was not equipped to deal with. While it didn't really make a difference in the end, it still makes one shake their head to see 14-size economic powerhouse bases totally undefended.

Though, there was an amusing occurrence at the start of the game, where this let me eliminate an AI in one turn by moving a rover into its empty HQ. Granted, this was on a Standard map; it'd be much less likely on a larger one.

The tech rate still rockets up into the stratosphere in late game. The AI was researching late-tier (10-12) techs in 1-2 turns (making 1500+ labs per turn) and had the whole tree finished by 2270 - and as an alien, he wasn't getting any commerce income. I heavily mismanaged my energy that game, but still had a tidy 3 turns for tier 6 tech with ~450 labs per turn - and if I switched to FM / Knowledge, 1 turn with 860 labs.

Here is what the victor's base looked like at the end of the game. He also had 10 of every satellite (except Geosynchronous Pods, which I'm sure the AI would find helpful on defense), a few PBs, and half of all the secret projects (i.e. all the good ones...).

(https://i.imgur.com/WjTdy3O.png)
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 07, 2020, 04:09:57 PM
> I think this might actually be a net buff for the AI, since the +30% multipliers it gets on Transcend let it far outproduce, and outtech, human players.

This is an important point that I've been thinking about. There are many mods out there that claim to "balance" gameplay by delaying crawlers/boreholes/pop booming and so forth. But the thing is, the AI doesn't micromanage these elements together as efficiently as a human could. The AI doesn't understand the value of stacking all these bonuses in one base to create super science cities, for example.

So in the end it might produce a benefit for the human player to have these tools available that can be combined in a powerful way. Without them, the game becomes much more about raw growth/colonization speed. And good luck trying to match 6 other Thinker factions with 30% discounts in the early land grabbing phase. :D

> I noticed that the AI still has a bad habit of leaving bases empty sometimes, or only stationing rovers/hovertanks in some bases

Can you provide save games where this happens consistently? Does it happen more often in sea bases?

> The tech rate still rockets up into the stratosphere in late game.

Were you playing this with Thinker or The Will to Power tech cost formula? Those two are NOT the same btw. We might increase the late game costs if they are still too low.

> Its interesting to see AI build some cheaper - non max tech units as well - as it really makes sense - for example to counter worms or probes.

I think I'll incorporate some changes on this for the next develop build.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 08, 2020, 02:56:57 PM
Quote
Without them, the game becomes much more about raw growth/colonization speed. And good luck trying to match 6 other Thinker factions with 30% discounts in the early land grabbing phase.


Really good point. That's been my experience with your mod, too. If I get a sucky start and my neighbor is Yang or Miriam then my whole early game turns into an extended delaying action until I can get crawlers for my own survival!


I only play on standard sized maps and restart until I get a big continent on the middle setting so everybody's in contact fairly quickly.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 08, 2020, 10:50:35 PM
Develop build 20200508 is now available from project website (https://github.com/induktio/thinker). The commits mostly deal with cleaning up the code base, but here are the changes since release v1.0:

* AI should build defenders on empty bases faster
* AI now sometimes builds Geosynchronous Survey Pods and Flechette Defense Systems
* AI tries to avoid building combat-related facilities on peacetime
* Small tweaks to prototype picker/PSI preference algorithm
* Prototype planner now tries to create trance/interceptor units
* New option: eco_damage_fix should increase AI eco damage to the same level than player bases

However, that eco damage change should NOT have significant effects to the game balance. It may just increase the frequency of sea level rises. Tell me if you notice differences.

Also due to glitches in the game binary, trance units may not always appear even if the AI faction has the prerequisite tech.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 10, 2020, 02:50:33 AM
* New option: eco_damage_fix should increase AI eco damage to the same level than player bases

However, that eco damage change should NOT have significant effects to the game balance. It may just increase the frequency of sea level rises. Tell me if you notice differences.


 Looking forward to helping the AI get rekd by Planet once I fix my mouse. ;deidre; Appreciate the work you're doing!
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 11, 2020, 06:00:57 AM
> I think this might actually be a net buff for the AI, since the +30% multipliers it gets on Transcend let it far outproduce, and outtech, human players.

This is an important point that I've been thinking about. There are many mods out there that claim to "balance" gameplay by delaying crawlers/boreholes/pop booming and so forth. But the thing is, the AI doesn't micromanage these elements together as efficiently as a human could. The AI doesn't understand the value of stacking all these bonuses in one base to create super science cities, for example.

So in the end it might produce a benefit for the human player to have these tools available that can be combined in a powerful way. Without them, the game becomes much more about raw growth/colonization speed. And good luck trying to match 6 other Thinker factions with 30% discounts in the early land grabbing phase. :D


Yea I had been thinking about this. I would say it's about more than just modding so the AI is more competitive. With the base tech tree, there was really one optimal way to play. Rush right to Condensor, Borehole, Crawler. And ICS. 75% of the tech tree just wasn't relevant due to overcosted abilities, overcosted facilities, overcosted armor, etc. Many SE picks weren't viable, air units very undercosted. And so on. It got a bit stale for me as it's more or less the same strategy every single game.

However:
A stronger AI is more fun to play against. I do sort of crave for that. It does a lot of silly things unmodded. At 30% Transcend would be pretty much impossible. Wouldn't be the end of the world IMO. Taking Master of Magic as an example the best players don't expect to win most games on the highest difficulty.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 12, 2020, 08:38:12 AM
> Can you provide save games where this happens consistently? Does it happen more often in sea bases?

I wasn't able to produce a situation where the AI consistently leaves its bases empty, unfortunately. I'll try and keep a lookout for these situations in my next game, with the new build.

I haven't noticed sea bases being particularly left empty; the AI usually builds at least a token defender there. In fact, since land units can't leave sea bases, it's probably less likely to find an empty one!

> Were you playing this with Thinker or The Will to Power tech cost formula? Those two are NOT the same btw. We might increase the late game costs if they are still too low.

This was with Thinker mod only. I haven't touched Will to Power yet.

What tech cost formula does WtP use? I couldn't find any description in its files despite saying one was in the readme.

> Without them, the game becomes much more about raw growth/colonization speed. And good luck trying to match 6 other Thinker factions with 30% discounts in the early land grabbing phase.

So in other words, it comes back down to the AI cheating its pants off again. ;lol

That said, I'd certainly prefer to err on the side of AI that's too strong rather than too weak. I'll keep playing at 30% and see what I can come up with.

Yea I had been thinking about this. I would say it's about more than just modding so the AI is more competitive. With the base tech tree, there was really one optimal way to play. Rush right to Condensor, Borehole, Crawler. And ICS. 75% of the tech tree just wasn't relevant due to overcosted abilities, overcosted facilities, overcosted armor, etc. Many SE picks weren't viable, air units very undercosted. And so on. It got a bit stale for me as it's more or less the same strategy every single game.

However:
A stronger AI is more fun to play against. I do sort of crave for that. It does a lot of silly things unmodded. At 30% Transcend would be pretty much impossible. Wouldn't be the end of the world IMO. Taking Master of Magic as an example the best players don't expect to win most games on the highest difficulty.
It seems to me that everyone agrees that the base game was broken, but nobody agrees on how to fix it. :D

I'd say the human player can be a lot more ruthless than the AI, though. The AI still isn't great at launching coordinated attacks, and large AI empires can be carefully dismantled through looking for weak points and concentrating force. The main difficulty is finding a way to do so before the AI's cumulative bonuses leads them into an unstoppable tech runaway.

Oh, by the way. It's been brought to my attention that nerve stapling drones has basically no consequences in the very early game. I wonder if it would be a good idea to teach the AI to nerve staple when it doesn't have any commlinks with other factions and/or commerce income coming in?
Title: Re: SMACX Thinker Mod
Post by: lolada on May 12, 2020, 10:16:43 AM
I don't think AI leaves the base empty. Defenders probably get killed by worms. Yesterday i thought stupid aliens.. they left the base empty again and i moved my units in just to see Drones needlejets around. So its not faulty AI per se.. units get killed at least in this case.
Now, AI do not switch production immediately but finish whatever it is building and (probably) then builds a defender. So base can get empty quite a few turns. This is with will to power and older thinker ai.

On improving AI.. AI will always be AI - i played several games with thinker AI only (on transcend) and its quite challenging - basically in "normal" playstyle as a player you need to build a lot of bases and pump those boreholes and condensers or its tought to keep up. AI also spams supply crawlers so as a player you have to do it or lag a lot. This does indeed make AI much stronger than in vanilla. AI can even popboom - i must admit i really don't like this mechanic.

It has its downside - you are pretty much forced to play certain playstyle. Massive former, colony pod spam, to crawlers and boreholes.. some infrastructure and then maybe to pop-boom its not mandatory, So it does get a bit stale => the reason why i tried Will to power. Then you get satelites early and game is kind of broken .. especially if you pop-boom properly. Anyway, another thing i found not fun is that for example in my last game i had very strong Hive (in monsoon jungle) that kept sending units and probes over war-zone and i waited behind for like 50+ turns and just killed anything quite easily until i got needlejets - after which i went on and slowly conquered him. Hive is hard to conquer, but there was no real danger attacker units usually win and level up and it goes snowbally.

Fun is subjective.. anyway Will to power changed a lot of things. Start - same applies, but formers are 40 minerals, colony pod 60 (it gets cheaper with reactors which are available eariler).. and supply crawlers are 120 minerals fixed. So that changes a lot. Forests nerfed - fungus buffed thats important as well. Anyway, Will to power changes combat - units are much more likely to die and factions have +50% to attack, defense in own territory. This really makes it hard to stomp AI as it equals the odds. Author wanted attacker to lose 2-3 units per 1 in base (if of equal strength). Armors and weapons are rebalance to be equal  :danc: lel until strength 10-13-16 then attacker gets ahead. Made a game much more fun for me at least. It can get you angry sometime tho lol. This mod also has some issues but they are of different kind.

Saying all this because i don't think only AI improvements only will "fix" the game. Now you may not like this mod, there are others i intend to try as well. In the end modding the game to own liking seems the final step ^^.

Title: Re: SMACX Thinker Mod
Post by: Nexii on May 12, 2020, 05:22:58 PM
Oh, by the way. It's been brought to my attention that nerve stapling drones has basically no consequences in the very early game. I wonder if it would be a good idea to teach the AI to nerve staple when it doesn't have any commlinks with other factions and/or commerce income coming in?
I believe it was said somewhere that you can only nerve staple a base 3 times total. That is a good idea to abuse it early.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 12, 2020, 05:57:32 PM
That's right, you can do it 2-3 times and then they build up an immunity to it.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 12, 2020, 06:18:01 PM
> I believe it was said somewhere that you can only nerve staple a base 3 times total. That is a good idea to abuse it early.

When previous staple count is < 2, next staple always succeeds. When it's > 7, next staple always fails, otherwise there's a random chance it will work. That's what the code says. But I wouldn't make the AI ignore atrocity restrictions in this one, it's sounds too gamey.

> What tech cost formula does WtP use? I couldn't find any description in its files despite saying one was in the readme.

Yeah, the tech costs are different and slightly bugged. WtP formula totally ignores faction research rating currently. Yep, you read right.

Basically WtP costs grow first in a cubic rate and then linearly. The point where it switches type depends on the tech's level. AI factions don't get any difficulty level discounts, instead human faction costs are determined by cost_factor parameter. That kinda mixes up the purpose of the parameter, since it already affects AI mineral/food production speed.

> I don't think AI leaves the base empty. Defenders probably get killed by worms.

In the latest update, they should also start rebuilding defenders faster, even force switch from producing some other facility.

I'm kind of interested in merging that patch for territory combat bonus, but I haven't made any decision on it since these patches are not simple. The code dealing with combat is pretty complex. Long term it would be useful to rewrite some combat functions in C++ so then they could be adjusted in an easier way. The bonus kind of reminds me of the idea I had earlier about making roads not usable on other faction's territory. In a way it serves the same purpose of making steamroll offense much harder, for players especially.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 12, 2020, 07:19:45 PM
What do you mean by research rating being ignored in wtp? I see i tech faster when i pick up + research from SE for example? You mean bonus like university have is ignored?

Merging territory bonus is quite a big change. Its great for challenge but, its not intuitive at first. Defenders gets +50% defense is clear - meaning you attack they defend better. Simple ok. But it also works if you enter their territory and they counterattack - they get +50% territory attack bonus. So entering enemy territory without  good armor is quite suicidal, surprised me quite a few times. Even armored units get quite a big disadvantage.. basically entering enemy land in forest or fungus is neutral. I believe this mechanic really annoyed bvanevery for example. WTP also makes you lose combat even when you are 4:1, 5:1 .. unlike vanilla, takes time to getting used to.

I find it great challenge tho, its really not that simple to go and stomp transcend AI. It does promote maybe builder style too much for first half of the game.

Two questions:
1. is mind-probe thing bugged? +3 Probe says bases can't be subverted, but AI overrides that. They didn't have enchanced Probe teams.
AI spams hundreds of probe teams - in wtp they are heavily armored and quite a pain.

2. Is +4 Probe team bug fixed? +4 being equal to zero? Thanks :)

Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 12, 2020, 11:07:15 PM
So far I'm enjoying watching the Zakharov that's way ahead of me getting savaged by fungal pops. I'm probably about to get taken apart by him and Yang, though, so this game might be at an end.


I have spotted him building fusion probability supply crawlers. Is that intentional?
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 13, 2020, 02:56:33 AM
> But I wouldn't make the AI ignore atrocity restrictions in this one, it's sounds too gamey.

Fair enough. It's a somewhat marginal advantage anyway.

And heh, with all this talk of making the AI stronger:

(https://i.imgur.com/AGIiOVr.png)
(https://i.imgur.com/mHiDcLH.png)

That's me (teal) about to be crushed by the AI's (orange) worm swarm. :unworthy:
(These are all custom factions I'm playtesting; the graphics are a placeholder.)

I suppose I could've played on after that, but let's be real, I'd never have caught up after losing half my production and all my projects.

It was a very frustrating game: playing as a peaceful trading faction with no real production advantages, every single AI I met instantly declared war on me. This isn't really Thinker's fault, but it does accentuate the difference between factions with strong production or military capabilities they can use to gain an edge.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 13, 2020, 08:03:08 AM
AI is cruel  :D its funny how in AC AI just declares war on first sight. Later civ games became so friendly.

Looking at that your screenshot you could have placed 10 more bases around and it wouldn't be ICS ^^. One of the great strengths of Thinker AI is that it does not go strolling around but places bases close to each other. And it generally fills tons of available space.

AI has some base breakpoints - 20ish bases? Then they build more? I've read this somewhere - i see AI place lots of bases and then stop - its a bit weird as they sometimes leave half the continent empty even when there are good settle spots. They often spam a lot of sea bases.

One thing that might hurt them badly is a loss of base. Induktio changed AI to spam military units if it loses the base ?! I think. Looks to me that they go all-out war mode for very long and stop colonizing.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 13, 2020, 07:13:23 PM
Wow, that's a lot of worms. :D What kind of faction are those "Believers", do they have planet/psi bonuses? The other factions have some eccentric looking base names too.

Very interesting to look at those screenshots. You can tell instantly from the screenshots if it's running the stock or Thinker AI. It has a very distinct base placement/terraforming style. It's not quite human in the way it develops the area but it has some kind of an unique flavor.

> AI has some base breakpoints - 20ish bases? Then they build more? I've read this somewhere

Try setting expansion_factor=200 or similar to get more bases. It's scaled to the map size.

> What do you mean by research rating being ignored in wtp?

The RESARCH rating that you see on the social engineering screen, that value is irrelevant as far as research costs are concerned.

> But it also works if you enter their territory and they counterattack - they get +50% territory attack bonus.

I actually don't think it makes to sense to also add *counterattack* bonus on top of the territory defend bonus. Or if it has both, then the amount should be nerfed from 50%. I believe this percentage is multiplicative on the standard combat strength value.

> 1. is mind-probe thing bugged? +3 Probe says bases can't be subverted, but AI overrides that.

Nothing is changed there unless it's mentioned in the Scient's patch notes.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 13, 2020, 08:53:37 PM
It's somewhere in the mid 2200s in my high eco damage test game. Zak got really savaged at first when he unlocked boreholes and condensers, popping big worm stacks and even locusts. I have him infiltrated so I could see him building Tree Farms. Hopefully that wasn't a coincidence!


He seems to get caught flatfooted by the pops. I'm regularly seeing defenseless and relatively small bases in his interior that I know were large, well developed bases before.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 14, 2020, 02:54:29 AM
I got bored with playing my test game so I let the AI play by itself for a while and then my macro messed up and I had to crash the game. There was a lot of odd behavior regarding sea colony pods. Morgan parked some in a two-tile strait off my shore for mission decades. I also saw one of Zak's inland bases with a sea colony pod inside. It was in the middle of the Uranium Flats and AFAIK never had access to the sea. I can get a screenshot of the latter if you need it. The only other mod I'm using is SMAC in SMAX.


The AI got better at handling fungal pops as it developed, and there were quite a lot of them. Consistently rebuilt trance units. I forgot to check to see if it was building anti eco damage buildings.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 14, 2020, 12:02:23 PM
In my current AAR (will to power and older AI thinker version) it took some time, but AI started to build lots of trance units eventually (defenders 3-10t-1 and similar), including some cruiser trance designs (like 16-3t-6). They also started to build more empath attacking units and counterattacking my worms. I was hitting them a lot with Sealurks and Mindworms, not sure what trigger them to start spamming more units. I eventually got to +5 Planet and big worm army.. maybe that.
Caretaker aliens and Drones - Domai AI.

Btw few extra notes:

- about that "territory combat bonus" - +50% might be too strong, including counterattacks, but wtp had specific goal to make attacker lose 2-3x more than defender.  Seems it does that. Still AI can conquer other AIs.. as well as player its just harder and takes longer. I presume it won't be big issue for player anyway unless combat formula is changed (wtp changed that to increase loses).. vanilla favors attacker a lot. Probably +50% def with vanilla combat rules won't slow player that much.. counterattacks are more dangerous and limiting.. it doesn't cut it to invade fungus tile with say few 4-1-2 rovers and 1-3-1 defender.. as that defender is nowhere near good in enemy territory. AI would likely counterattack with 2-1-2 units and wipe the stack.. as such rover would have edge over 1-3-1 unit in this case.

- ai builds hovertank units and probes (armored)

- ai builds and uses choppers but WTP has them beuatifully balanced -_- its hard to win combat vs any capable opponents without taking some damage and i can't see chopper killing more than 2 units in enemy territory.. 3rd one he's likely dead. I rarely used them because they get killed by interceptors and AI has enough aerospace complexes and AAA units
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 14, 2020, 12:22:12 PM
> What kind of faction are those "Believers", do they have planet/psi bonuses? The other factions have some eccentric looking base names too.

Good catch! Yes, they are intended to be a planet/psi-focused faction. At the moment they're kind of a Super Cult in terms of stats:
Code: [Select]
Personality: Aggressive, Explore, Conquer

^TECH: {Biogenetics}

^-2 ECONOMY: {Excess wealth viewed as sinful}
^+2 PLANET: {Practises responsible stewardship of their holy land}
^+1 mineral, +1 energy in fungus: {Taught to live off the land}
^+15% offensive combat: {Religious fervour}
^Mind Worms act as double police: {Native wildlife viewed as angels}
^{May not use Wealth values.}
That's definitely overpowered; I didn't consider the interaction between psi bonuses from +PLANET and general +attack bonuses. With the Manifold Nexus, her units already had an effective +45% advantage over mine. Add in my faction's inherent -1 PLANET and the 3:2 odds for psi attackers... even if I had every base staffed by Trance units with decent morale, I'm not sure I'd have been able to stand up to that.

And yeah, coming up with half-decent base names was one of the most tedious parts of making these factions. xD I'll probably make a thread about them soon, now that I've playtested them a fair bit.

AI is cruel  :D its funny how in AC AI just declares war on first sight. Later civ games became so friendly.

Looking at that your screenshot you could have placed 10 more bases around and it wouldn't be ICS ^^. One of the great strengths of Thinker AI is that it does not go strolling around but places bases close to each other. And it generally fills tons of available space.

AI has some base breakpoints - 20ish bases? Then they build more? I've read this somewhere - i see AI place lots of bases and then stop - its a bit weird as they sometimes leave half the continent empty even when there are good settle spots. They often spam a lot of sea bases.

One thing that might hurt them badly is a loss of base. Induktio changed AI to spam military units if it loses the base ?! I think. Looks to me that they go all-out war mode for very long and stop colonizing.
Aye, I'm finding that cranking out bases as fast as possible is essential to standing up to the AI in this mod. I used to be averse to having bases near each other, so it's been a bit of a change for me.

Basically, sprawl as hard as you can and hope that your girth impresses the AI enough to get them to leave you alone (gaining a decent energy income in the process), then consolidate and build up your pop and infrastructure so you can keep up in the tech race. I think that's the meta for now. The downside of this approach is that you'll probably be beaten by the AIs to various projects, barring unity pods or crawlers.

Anyway, I gave up trying to make that faction work for now after that experience, starting a new game with a different faction that emphasises pop growth at the expense of industry. Things have gone much better this game: I started on a continent with 4 other factions, and was able to sign pacts with 2 and treaties with the other 2, getting much needed exchanges of tech. Things were fairly peaceful for a bit, and we all kept about neck-and-neck in development; using the above strategy, I grew a nice population but missed out on most of the projects.

Then ideological differences inevitably led to war, helped along by some probe trickery to stir things up, and I invaded my neighbour to gain access to his projects. Rather amusingly, I conquered all his land bases and forced him off the continent, but he still survives with 6 sea bases somewhere, so I doubt he'll surrender (sunspots are currently in effect). I'm kind of curious to see if he'll make a comeback if I leave him alone.

If there was ever any doubt that the AI would know to prioritize psi units...
(https://i.imgur.com/LZuPgrQ.png)
Yowzers! :o

Infiltration shows they have 29 worms on the field, and little else. Those are going to be painful to dislodge; I may have to resort to Empath jets to clear a path.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 14, 2020, 12:30:48 PM
Regarding combat, always felt it made more sense to give large defensive bonuses in cities rather than territory. Territory bonus is like a 'for free'. I could see a small morale bonus fighting on home turf but not 50%.

Problem as I saw it was a costing issue, armor just costed too much. My solution was to just allow the use of best weapon/armor on everything. You shouldn't be discouraged from using your best technology. Using hand weapons or unarmored when you have better options is silly.

The choice should be in what chassis and abilities to pick.

I would try this but I feel with defense being so strong the whole game would come down to how fast you expand at the start, since you'd be so hard to conquer.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 14, 2020, 01:56:16 PM
> I can get a screenshot of the latter if you need it. The only other mod I'm using is SMAC in SMAX.

Always provide the save game if you're reporting bugs. An exception to this is if something is trivially repeatable, no matter which save game you load.

On a side note, next develop build will have an important fix contributed by Scient: satellite attack bug will be fixed when smac_only mode is activated!

> The AI got better at handling fungal pops as it developed, and there were quite a lot of them. Consistently rebuilt trance units.

That's what I'm thinking too. Fungal pops cause only a temporary stepback because each of them raises the clean mineral limit. It is actually best to trigger first fungal pop ASAP so then all the subsequent tree farms will raise the clean mineral limit. Some people don't actually understand this mechanic.

> Good catch! Yes, they are intended to be a planet/psi-focused faction. At the moment they're kind of a Super Cult in terms of stats:

Actually I've overlooked WORMPOLICE ability in the PSI unit preference algorithm. It makes sense to produce worms even more if they help quell the drones. In that factions case, +2 PLANET and +15% PSI causes AI to prefer worms heavily, also because it hasn't researched any advanced weapons yet.

> And yeah, coming up with half-decent base names was one of the most tedious parts of making these factions.

Bletchley Park, Comparative Advantage... you got something going on there. :D

> One thing that might hurt them badly is a loss of base. Induktio changed AI to spam military units if it loses the base ?

Maybe slightly spoiler info follows.

(click to show/hide)
Title: Re: SMACX Thinker Mod
Post by: lolada on May 14, 2020, 02:16:08 PM
Yes meta is spam enough bases to counter AI.. its effect of Thinker AI. AI spams bases and boreholes and its really hard to compete if you don't do the same. In turn you lose most of secret projects - but thats ok i guess. I managed to build 1-2 pretty much every game, you just may not get exactly the one you want. Thats for early project - player can get mid-late game project often at will if you direct research or spam crawlers.
Considering base spam, unit spam and boreholes, someone like Hive or Miriam is real threat if they spam bases get their production up and you end up in their attacking range.

Now on defensive bonus - I don't know.. human finds a way to turn pretty much every mechanic into his benefit sooner or later. For example Thinker AI spam units much better than vanilla - but still don't know how to use them well. Ie. you as a player can defend with token rover force against 3-4x larger AI force and build up behind. Mainly because attack is favored and you don't lose units. So in this case you can with few units sit behind and build up your economy while AI bangs in the wall.
Larger bonus in bases - i need to try bvanevery's mod i think he did that also. Will to power has 50% defense in base (sensors dont give bonus).. Territory bonus is on top of that.. but combat gives you chance to win even when attacking below odds. Making only bases stronger instead of territory might be good solution - but AI needs more boosts, like cheaper armor (to actually not get picked up by player in field).

Will to power makes this easy picking-off units strategy harder in general due to few cumulative changes:
1. Allowing cheaper armored units - attackers like 6-6-1.. or Rovers like 10-6-2. I think cost of armored infantry is comparable to unarmored rovers. Fine change as Nexii said.
2. Making combat deadly - you have a higher chance to lose even when attack > defense. Kinda leads to spearman kills tank scenario. For example rover 4-1-2 dies like 25% of time (less i think but not insignificant) vs 1-1-1 scout. So casual attacks are not safe win.. and even when you win its unlikely rover is at full HP.. so can't kill 2-3 in a row.
3. And on top of that that territory bonus.. making attack even harder.. so that scout is practically 1-1,5-1.. or Synthmetal would be 1-2-1 turned into 1-3-1, Territory counterattack is pain - i described that earlier in post.. Scout will really hurt/kill that Rover if it ever attacks it.
4. Then weapons and armors are balanced that odds are close to each other.. vanilla usually have attack > def.
5. Healing is nerfed to 10%.. 20% in base.. Command Center does not fully heal as well.

Now this is tricky.. all this means that you can't stop AI with only a handful of units. So when AI comes knocking on your bases - you might think i am safe with that def bonus. But then you lost map control and formers, can't work tiles.. and Probes really mess up everything - ai spams them and they are armored. And even weaker AI units have a chance to kill your defenders however small if you let AI amass units base will fall. And you don't heal fast and AI takes the base.

All this in the end makes you invest more in army - defending may look easier on paper - but none the less player loses units and you still don't want AI to roam into your lands. AI is programmed to spam units - this kind of forces player to make more units. Thinker AI also expands well so they start to attack from many sides.
Now if you try to use those units in attack - they tend to die even faster :D Its a challenge -_- but thats the point i guess. Its safe to say you will lose lots of units. I'll take a screenshot when i come home.. i lost ton of units in my last game.

In that sense i don't think doing just one change is enough to really improve AI combat to challenge player. This is my view ofcourse.. generally this way of modding leads to longer games - more build focus - someone might really not what to play that style. I did for example crush Gaians with Miriam with 4-5-6 weapons early on taking their 10 bases even when they had silksteel armor(4) in last few bases. Mod boosted  Miriam to +50% attack... but even 25% or 33% would work well because units get promoted. Morgan is still wimp due to support so Miriam cuts through him as well even if he has higher tech. Someone like Yang is tough to break ^^.

Title: Re: SMACX Thinker Mod
Post by: Nexii on May 14, 2020, 02:27:26 PM
Seems to me that raising defense that much would lead to massive amounts of artillery being the best strategy. Especially with healing slowed down.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 14, 2020, 03:05:36 PM
Seems to me that raising defense that much would lead to massive amounts of artillery being the best strategy. Especially with healing slowed down.

Good point - having a few units really helps - i've been using some (you can follow AAR ^^ shamefull self-promotion). I am still learning - so i think i failed in that department - heavy use of artillery would likely reduce loses a lot - and i used it consistently but in small numbers.. 2-3 units so it takes time to hurt defenders and then i attack impatiently. I used lots of spore launchers (cheap police) to soften up ships.  Was it Civ3 that promoted artillery stacks ^^.

Actually i discovered something last night - it even make sense to use conventional missiles when base is not heavily stacked with defenders. Like it takes 2-3 turns to build the missile - it takes same time or more to build good attacking unit. And when distance is big and attacking unit is likely to die - you can just hurl the missile directly (its 20 movement) rather then try to transport unit or build drop unit.. especially if you fight over the sea like in my game. Or when trying to take down sea base. Lategame there's enough resources for that.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 14, 2020, 04:47:50 PM
Quote
Always provide the save game if you're reporting bugs. An exception to this is if something is trivially repeatable, no matter which save game you load.

On a side note, next develop build will have an important fix contributed by Scient: satellite attack bug will be fixed when smac_only mode is activated!

Very well, I'll do the minimum asked of me! I finally figured out where Windows actually stores saves...

I believe the save has both examples. Zero Point is the University base with sea colony pods. As you can "see" it's in the middle of the Uranium Flats and yet it's home to two. If you look at the narrow strait that divides the Gaians from the Monsoon Jungle, you should see a Morgan sea colony pod that he doesn't move.

Unfortunately the game crashed so I don't have the results of many years of AI-only play (my holding Enter down macro got stuck).

Looking forward to raining death from above!

Quote
That's what I'm thinking too. Fungal pops cause only a temporary stepback because each of them raises the clean mineral limit. It is actually best to trigger first fungal pop ASAP so then all the subsequent tree farms will raise the clean mineral limit. Some people don't actually understand this mechanic.

I only learned about it when I started playing again recently. Does the AI know to wait for fungal pops before its first Tree Farm?
Title: Re: SMACX Thinker Mod
Post by: lolada on May 14, 2020, 07:57:01 PM
Here are some shots.. its will to power mod, but AI is thinker basically with some tweaks.

These are casualties, its M.Y. 2400 game is not over yet. I lost over 100 native units -_- lost many others but this display is bugged certainly - at least it can't show all the prototypes or merged them not sure. There's more to list but i didn't want to post more pictures.. i had 12 formers sniped by enemy air units. I lost quite a few 24-16-1 units and amphibious units but can't find them on list now. Checked Drones stats for example it says they lost hundreds of units but types seem all screwed up.

(https://i.imgur.com/sayuuQL.png)

This is AI city placement (terrain is not up to date - there are boreholes and improvements but my map don't show them - i can see them when i zoom to cities). Gaians stopped around 20-ish bases - they have lost some here. Aliens have even less somewhat. They are in war all the time. That's what i was talking about AI and losing bases - nothing east is colonized and there are Ruins with monoliths for example. Aliens also didn't colonize that much beside monsoon jungle and some sea bases - they have space or they could pack more cities in there (north is not visible on map.. but there's space - can be seen on minimap).

(https://i.imgur.com/4U0fQv1.png)

This is Drones map - they conquered Zakharov - defense didn't save him. He died quite quickly, he had at least 9 bases.

(https://i.imgur.com/LSS5Nhs.png)

This is AI building hovertank probes, empath and trance units. AI had lots of trance defenders at a time but it seem they upgraded them tu <> AAA units. I presume .. i doubt they died i didn't kill them.

(https://i.imgur.com/9S0BzcA.png)

Here's one lategame city, not sure what they are up to with eco damage at this point ^^ they usually keep that in normal levels.

(https://i.imgur.com/J6WivxE.png)

Thinking of it now - AI could maybe be better if they would actually be less aggressive  ::). They are fighting someone all the time.

Here's combat. For example Elite unit died -_- defender stayed alive at 10%. Then i had less exp unit win without taking dmg ^^ - so there's that randomness that happens. Yeah i forgot.. base bonus is +50%.. but Perimeter Defense makes it 100% total not 150. And With tachyon is i think 150. So thats nerfed otherwise it would be def overstacked. Without territory bonus i suppose those should be victories easily.

(https://i.imgur.com/04M9juQ.png)
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 15, 2020, 10:06:44 AM
I suspect nobody has realized this before, but the AI has a hilarious bug in faction_upkeep. When it has the energy reserves to do, it will attempt to corner energy market repeatedly each turn even if the previous attempt is still in progress! I guess having the original AI produce surplus energy is such an alien concept, this has never occurred before. This actually happened in one of the test games where one AI (guess which one?) ROFLstomped the others and was producing thousands of credits each turn. I'll incorporate some more fixes on late game events for the next release.

> Gaians stopped around 20-ish bases - they have lost some here. Aliens have even less somewhat. They are in war all the time.

Happens all the time on smaller maps. If they are at war with a neighboring faction, the AI kinda has no choice but to keep producing more units. In that screenshot the AI has also lost some of its own bases.

> I believe the save has both examples. Zero Point is the University base with sea colony pods. As you can "see" it's in the middle of the Uranium Flats and yet it's home to two.

I think what's happening here is that the AI randomly attempts to raise land bridges to adjacent land masses and sometimes it has some unforeseen consequences. It shouldn't be happening that often though. Land bridges are pretty important to help the AI grow sometimes.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 15, 2020, 10:33:00 AM
Landbridge happened in my  game i was so surprised ^^ Will AI raise land bridge to attack other AI ? Or is it accident (they wanted higher land or something?) - because AI's connected continents - but there was no room for expansion as land was taken by other AIs already. What motivates AI to terraform up/down?

Yes ok i now understand that about expansion and on number of bases. I suppose I'd like to see continent eventually filled with bases - it would be smart to sneak in colony pods even during the war. Sometimes its the best to stall the war effort  ie. defend and expand in safe zone. But i see that may be too complicated for AI.

On topic of AI aggressiveness: Is it known why AI is so aggressive? I had 5x weaker AIs declare war on me for example. Its possible if AI would refrain from silly wars in first 100-ish turns that it would have much better setup for winning the game. AI often threatens and declare wars on first contact - starting warfare that puts back both AIs.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 16, 2020, 11:56:41 AM
Well, I was ready to rage-quit my current game, as Orange's unstoppable hordes of +55% mind worms rolled over both of my pact sisters and wrecked my earlier conquests; meanwhile, Teal somehow rose to become the premier superpower on Planet, landing probe teams on my continent and harassing my sea formers with cruisers, and I had to buy him off with tech so I wouldn't have to split my attention across two fronts.

But after stepping away from the computer for a bit, I decided there was still a chance to win; and what do you know, things have turned around since then.

The answer? NBC warfare. I first discovered this magic in a previous game, and have since honed it further. My first action as Governor was to repeal the Charter, and then start pumping out jets equipped with nerve gas. They are disgustingly effective at wiping out enemy bases, and there's little they can do about it. I'd combine them with a gene warfare attack: this would take the base down to 1 pop and halve the defenders' HP, and then a single follow-up airstrike would wipe out the base for good.

The downside to this is that this precludes any possibility of surrender, and also prevents you from capturing the bases for your own use. But it utterly cripples the opponent, and you can always leave any bases with juicy projects alive for later.

I'm not actually sure if anything could or should be done about this. Frankly, at +30% I need every edge I can get. And since I already can't use crawlers or popboom...

The other godsend I had this game was probe teams. I got lucky and managed to spark a war between the two capitalism-loving factions, which neutralized their commerce advantage and kept them busy while I got my affairs in order. The advantage of the AIs being so aggressive is that I can repeatedly probe them for tech without having to fear any penalty.

Here is how the game looks like in 2225. Rather interesting setup, with 5 factions on the lower continent and 2 on the upper. I'm Lavender in the bottom-left. The no-man's-land in the centre is where Olive and Orange's bases used to be.
(https://i.imgur.com/07HEC8q.png)

Incidentally, Olive was the faction I mentioned before who got exiled to the seas. I had to exterminate him because he was being too much of a pest.

I came across an interesting quirk in the game. If you use a probe team to liberate an eliminated leader, they will reappear and then (most likely) immediately die again on the next turn, as there will probably be no space left for them to spawn. But it's possible to rescue them by calling them on the commlink and gifting them a base, preferably in a safe area. This can be handy to give you an extra vote on council proposals.

Once I've finished exterminating Orange I plan to run an experiment. I need more votes and energy, but I don't want to manage any more bases, plus that will kill my empire with B-drones. So I will ICS in Orange's former territory and then gift all the new bases to my puppet Grey. In theory, this will effectively resurrect the faction. It remains to be seen if they will actually all rebuild their "lost" facilities, or just get stuck in war mode forever more.

Curiously, the AI didn't immediately attempt to call the election for Governor when my term expired, even though Teal had the votes to win. I managed to stay in office for another 10 years as a result.

A question: Should the AI attempt to prioritize techs that lead to its preferred SE choices? Teal still has yet to research his preferred choice (Wealth, from a B4 tech) in 2225, even though he's grabbing level 5 and 6 techs left right and centre. On the other hand, this might make the AI more predictable and easier to manipulate (if you know an AI will focus on a certain tech, you can wait for them to finish it and then immediate steal or trade for it... but you can do this anyway with infiltration). Just a thought, anyway.

Tangentially, there seems to be a lot of people around here these days to talk balance and modding. Which begs the question... who's up for some PBEM? 8)

This actually happened in one of the test games where one AI (guess which one?) ROFLstomped the others and was producing thousands of credits each turn.
I bet it was the Gaians. They always seem to become a superpower in Thinker; probably because they begin the game with a terraforming advantage, and have strong bonuses for early-game exploration and mid-game empire management.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 16, 2020, 03:42:31 PM
> Landbridge happened in my  game i was so surprised ^^ Will AI raise land bridge to attack other AI ?

Yeah, it might be an interesting surprise for new players. Currently the decision making there is very random, the AI will attempt to connect any disjoint landmasses that are near each other. I think I will incorporate some new logic there for the new version. I would already have enough content for a new release but let's see what other features will make it in there too.

> On topic of AI aggressiveness: Is it known why AI is so aggressive? I had 5x weaker AIs declare war on me for example.

We've been reversing various functions with OpenSMACX but to my knowledge neither of us have really touched on the diplomacy functions. I guess some of this decision making happens in enemy_diplomacy that gets called by faction_upkeep. Coincidentally, faction_upkeep main function is now fully reversed and the next release will replace the vanilla version. Diplomacy mods have been a long requested feature for Thinker but that just depends on if anyone will make the effort to actually reverse those functions.

> A question: Should the AI attempt to prioritize techs that lead to its preferred SE choices?

The preferred way to do this is usually with the tech weights (EBDC). The research in this game is semi-randomly directed towards those techs that have matching weights with the faction priorities.

> I bet it was the Gaians. They always seem to become a superpower in Thinker; probably because they begin the game with a terraforming advantage, and have strong bonuses for early-game exploration and mid-game empire management.

Hahaha, yes. :D
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 16, 2020, 05:16:53 PM
Raising land is so much more preferable than AI attempted naval invasions! I loved it when a Miriam really ruined my day by connecting our continents and pouring over the land bridge with a horde of her crappy rovers.

Is there a way to teach an AI that gets ejected from all their land bases to try to turn things around by becoming sea-oriented? They kind of linger on in a constantly pissed off mood off the coast until somebody bothers to conquer them, even in the early game when there's plenty of time for them to expand over the ocean.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 17, 2020, 04:26:15 AM
I might try increasing the global warming denominator to 3. The AI is cooking Planet before anybody discovers Advanced Spaceflight!
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 17, 2020, 01:56:50 PM
> I might try increasing the global warming denominator to 3. The AI is cooking Planet before anybody discovers Advanced Spaceflight!

Were you previously using the default value 1/2 ? It might be convenient to adjust this also for the new release.

I might adjust the base placement a little bit for sea bases, it emphasizes coastal locations maybe too much to be optimal. But I've been also busy trying to develop better methodology to reverse some of the bigger functions in the binary. There's some serious challenges.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 17, 2020, 03:17:21 PM
Were you previously using the default value 1/2 ? It might be convenient to adjust this also for the new release.

I might adjust the base placement a little bit for sea bases, it emphasizes coastal locations maybe too much to be optimal. But I've been also busy trying to develop better methodology to reverse some of the bigger functions in the binary. There's some serious challenges.

Yes. I had been playing the previous version with 3/5. I'm not a big polluter myself so 1/2 was a little too aggressive in my games. I reverted to 1/2 for these tests. Might try 2/5 in my first test game. It's possible my personal alphax's 1,2,0 forest nerf is slowing the general rate of tech research Planet-wide, but I did that mostly to hurt myself! The AI surely gets most of its energy from advanced terraforming?

Quote from: Induktio
I might adjust the base placement a little bit for sea bases, it emphasizes coastal locations maybe too much to be optimal. But I've been also busy trying to develop better methodology to reverse some of the bigger functions in the binary. There's some serious challenges.

I wonder if their love of coastal tiles was Firaxis trying to stop the AI from wasting base squares on deep sea tiles they can't develop. Yet they often ring enemies with sea bases so they get no benefit at all from land tiles... I think getting them to settle even one tile offshore would be a big improvement. Or maybe any deep sea tiles within the base squares is deeply penalized by the placement algorithm. At one point in my last game, Santiago decided she wanted to colonize an entire shallow sea quite abruptly and very methodically. Maybe she saw the writing on the wall with all the global warming, lol.

Good luck! I wish I knew C++ but alas I do not.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 19, 2020, 08:04:15 AM
It's 2251 in my current game, and I think we're approaching the beginning of the end. With any luck, I'll be finished right as the new dev build comes out. :D

I had to postpone the AI resurrection experiment, as despite running Demo/Planned for a cumulative +5 GROWTH and PTS-ICSing like there was no tomorrow, the AI still had more population than me.

Upon learning the necessary tech, Teal immediately tried to become Supreme Leader despite not having the votes. I suppose he was hoping that I'd let him win out of frustration; I almost did for a moment there. As it happened, this mostly had the annoying effect of making me wait for another 20 years before I can launch my own bid for Supreme Leader.

My plan was therefore to launch a limited offensive to seize his naval bases, denying him votes, and then sit back on Demo/Green/Wealth raking in cash while the remaining AIs fight among themselves. Since I still had some leftover rovers from the Orange Extermination War, I decided I'd use a needlejet transport to drop them behind enemy lines and wreak havoc as a diversion.

Well, the diversion went too well and now I've found myself invading Teal's homeland with 3 rovers*, a stick, and a rock. (Let us not forget the expensive needlejet and cruise missile strikes that cleared a path for them, much like how the 300 Spartans were supported by a real army and navy too.) The AI has a lot of Perimeter Defenses and Aerospace Complexes, which slow things down a bit, but still doesn't have enough armoured defenders to man all of its bases.

(https://i.imgur.com/90JRNnQ.png)
I'm starting to think Will to Power may have a point with regards to totally nerfing offense. xD
*not even Elite rovers! smh

The AI has indeed begun building a few Geosynchronous Pods here and there, which posed a minor complication as my cheap 2e jets are no longer effective against unarmoured rovers. I'm now concerned they might start building Flechette Defenses to neutralize my missile spam tactics.

Teal also built a planet buster at some point. I'm not sure what he was planning on doing with it. It would've been somewhat hilarious to see him use it and then get swamped in worms as a result. (I reinstated the charter after finishing my chemical genocide of Orange.) I think he was trying to use it when he moved it to a frontline base, but I destroyed it and now he's building a new one.

I also saw that he managed to spend over 1,000 credits in a single turn. I'm not sure exactly what he spent them on.

Something I've noticed is that I'm consistently attacking with units that are lower in tech than the AI's. This is probably because they can build whatever they want with their snazzy +30% bonuses, but I can't afford to sit around waiting for stronger units to build, so I just spam a lot of weaker ones instead. I can concentrate them a lot better than the AI does.

It would be nice if the AI was a little less mindlessly dogmatic on occasion. While it's natural that Gold would hate me (he loves Free Market, and I can't run Free Market), you'd think he might moderate his tone a little after Teal captured half his bases and left him as a pipsqueak on the power graph. But no, he's totally going to personally crush me, any day now. ¯\_(ツ)_/¯
(Okay, granted, I was the one who started the war between Gold and Teal in the first place with a probe team. Maybe he's just pissed about that.)

RE: eco-damage. I've been playing with global warming set to 1,1, because I never actually see it otherwise. So far, two global warming events have been triggered, once by me and once by Teal. Both of us are now running Green, so it doesn't seem that we'll be polluting too much more. We'll see.

Tangentially: it turns out that two enemies pacted with the same third faction can both store their units in their bases at the same time. Diplomatic immunity!

Unrelatedly, while I remember to post about it: the AI now loves to use probes in stacks, attacking a single base multiple times in a turn. This is great. But they always use the same probe action in a given stack, and if that action is Infiltrate Datalinks, you'll see the AI using 5 probes to Infiltrate Datalinks in a row. This seems like a bug.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 19, 2020, 10:05:04 PM
AIs be like... "Human wants to have an easy victory.... hmm not today, hold my beer." :D

> I wonder if their love of coastal tiles was Firaxis trying to stop the AI from wasting base squares on deep sea tiles they can't develop.

That's not the original AI actually. Thinker always controls the movement of colony pods and decides base placement. The reason it settles so often on the coastline is that it can later transport colony pods to the land quite easily. Needs only a small priority tweak.

> The AI surely gets most of its energy from advanced terraforming?

A large part of it is usually from boreholes. Some AIs can also generate quite an hefty bonus from trade if they just manage to avoid wars.

> Tangentially: it turns out that two enemies pacted with the same third faction can both store their units in their bases at the same time. Diplomatic immunity!

Interesting, I didn't even realize this was possible!

> But they always use the same probe action in a given stack, and if that action is Infiltrate Datalinks, you'll see the AI using 5 probes to Infiltrate Datalinks in a row. This seems like a bug.

That sounds like a flaw in the game engine. Have to look into it if time permits.

Here's a hint of what features I've been planning recently. Looks like something related to this can be built into the next release:

(https://images.gr-assets.com/books/1387704240l/1411743.jpg)
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 19, 2020, 10:35:22 PM
Ahh, I thought I saw colony pods rolling out of sea bases! That's a cool hack.

Very excited!
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 20, 2020, 12:07:51 AM
> AIs be like... "Human wants to have an easy victory.... hmm not today, hold my beer." :D

Haha, yes. It looks like I will win this game (as humans always must, in the end), but it was a damn hard slog to get there.

> The reason it settles so often on the coastline is that it can later transport colony pods to the land quite easily. Needs only a small priority tweak.

Okay, that is a pretty cool trick. I've noticed the AI builds a modest number of transports in its sea bases, and this would explain why. They just need to build the colony pods to go with it. xD

Can't wait for SMACX AI to learn the art of realpolitik. :D
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 20, 2020, 02:31:26 PM
The game is finally over in 2266. I won a crushing Diplomatic Victory with 1163 votes against 133.

As another poster observed earlier in the thread, the AI performs at its best in the rover era of technology. After jets and missiles become available, it builds them but doesn't use them as effectively. And as for any kind of combined arms tactics... forget it.

There was an interesting period where the AIs suddenly became more conciliatory towards me: Teal offered a truce without preconditions (all the other times he demanded tech), and Gold was suddenly willing to sign a treaty with me if I helped him against Teal (I declined to preserve my Noble rating). I think this was when my population was at its peak, before I started gifting bases to Grey: the power disparity was so great that even Transcend AIs felt the need to cower. But when I started giving bases away, the disparity shrank and the AIs got cocky again.

I feel like the population numbers got absurdly high in this game. By mid-game both Teal and I were sitting on at least 300 pop each, and at the end I had nearly 600 pop with another 200 gifted to my puppet Grey. Granted, a large chunk of that was from conquests: Teal conquered a bunch of bases from Gold, and then I conquered all of Teal's land bases in turn. The other chunk was all the degenerate PTS-ICSing I engaged in, back when it seemed like Teal's rise was unstoppable.

The AI resurrection experiment didn't run for very long, but the initial results weren't too promising. It built some formers and facilities (mainly Rec Commons), but mostly it just focused on pumping out military units. This fits with previous observations that the AI doesn't do very well transitioning back from war to a peace footing. It also didn't know to move its HQ from its reservation to a more central location, so most of its energy got lost to inefficiency.

I also forgot to give them any drone control measures with the bases, so soon their entire gifted empire was rioting. Oops.

But hey, I still got a nice chunk of commerce out of the setup, so the theory is sound. Even if it is totally exploiting the game mechanics.

The tech rate didn't seem as crazy as in my earlier game, but maybe I just didn't play long enough to see it. My energy income was rather poor throughout the 2100s, as most of it got eaten up by facility maintenance; I'd be lucky to hit double digits with a 50/50 split most turns. It then rose steadily in the 2200s to 100-200 and suddenly spiked hard around 2252 to 400-600. By the end of the game I was researching a level 9 tech in 4 turns...

Oh, and I forgot to mention this before, but I have the tech rate set to 75% in my games. So it would probably be even worse otherwise.

I think part of the reason for this is that the gaps between techs become proportionately smaller as one goes up the tree. Going from level 3 to 4 is a roughly 50% increase, and the gap from 4 to 5 and 5 to 6 is similar. I notice that research tends to stagnate around this time, with tech times in the double digits: all the early techs have been eaten up, AI trades become rarer, and factions' energy income hasn't developed yet. However, the gap between levels 4 and 8 is roughly 300%, while energy incomes have shot up 1,000% since that time. So the time it takes to research higher level techs ends up being about the same as what it took to research lower level techs, and then declines as the game goes on.

And that's without building massive crawler energy parks or satellite constellations. I've heard you can get something like 2,500 energy per turn that way, which is utterly game-breaking.

Amusingly, despite all this, nobody researched Advanced Spaceflight (D8) throughout the whole game, so Planet was just left to cook by itself.

All in all, good game. I'll probably have to go and do something actually productive now before the next build comes out. :V
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 20, 2020, 07:53:45 PM
Quote
As another poster observed earlier in the thread, the AI performs at its best in the rover era of technology. After jets and missiles become available, it builds them but doesn't use them as effectively. And as for any kind of combined arms tactics... forget it.


Same here. My "solution" has been to disable copters, increase missile range and decrease its price, and decrease needlejet range. Copters are just too powerful and I'm too tempted to wreck the AI with them when given the chance. Missiles are nice because the AI does seem to build them and they will end up killing units when they hit. Needlejets are also extremely powerful so I took away my ability to do long range strikes deep into AI territory with them. Plus the AI can't stray too far from its own bases.

I justify it by telling myself that the factions on Planet don't want to repeat the early days of Earth flight with primitive instruments and line of sight weapons. If they want close air support, a needlejet works well. For long range strikes, they would use an unmanned missile not a B-17 style needlejet.

Quote
Amusingly, despite all this, nobody researched Advanced Spaceflight (D8) throughout the whole game, so Planet was just left to cook by itself.


Interesting. I wonder if that's been a problem in my games, too...
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 20, 2020, 11:55:04 PM
Same here. My "solution" has been to disable copters, increase missile range and decrease its price, and decrease needlejet range. Copters are just too powerful and I'm too tempted to wreck the AI with them when given the chance. Missiles are nice because the AI does seem to build them and they will end up killing units when they hit. Needlejets are also extremely powerful so I took away my ability to do long range strikes deep into AI territory with them. Plus the AI can't stray too far from its own bases.

I justify it by telling myself that the factions on Planet don't want to repeat the early days of Earth flight with primitive instruments and line of sight weapons. If they want close air support, a needlejet works well. For long range strikes, they would use an unmanned missile not a B-17 style needlejet.
I don't disagree - jets, copters, and missiles are all nerfed in the mod I use*. But I'm somewhat averse to changing stuff in the game just to make the AI work better. One of the things I like most about Thinker is that it makes the AI perform so much better regardless of whatever alphax.txt one happens to be running.

Now, nerfing stuff to ensure BalanceTM between human players, that I can get behind. :D

But yes, the ability to conduct long range strikes deep into enemy territory makes SMAC very swingy at mid-game. Having a generalized territory defense bonus like in WtP suddenly seems like a good idea after observing that.

*I say 'the mod I use' and not 'my mod' because I didn't actually come up with it myself. Someone else came up with it over a decade ago and we dug it out again for our PBEM games together. I like basically all the changes it makes so I'm low-key trying to get him to finish it and spread it around more, but he's rather busy lately...

Interesting. I wonder if that's been a problem in my games, too...
It could just be luck. As the modders tell us, the AI's tech selection is totally random. ;)

Depends on whether you've made any tech tree changes, as well. For me, C6 Retroviral Engineering is a second-order preq for Advanced Spaceflight (replacing Fusion Power), and nobody bothered to research that either.

It also turns out that none of the AIs ever researched the tech that allows 2 special abilities (B5 Bio-Engineering in my game). I actually realized this at one point and made a point of denying it to them. This should definitely join the list of AI-prioritized techs Thinker has.

Oh, another thought I keep forgetting to write down. Is it possible to make any changes to the mechanic that taking a base destroys half its facilities? I realize that war is supposed to be bad, and that collateral damage is inevitable, and that seizing fully-stocked bases might overpower an attacker too much; but those facilities represent over a century's worth of investment, and if one loses a substantial chunk of them, it becomes very difficult to recover in any reasonable timeframe. Even if you take the base back, it's already effectively lost to you - at least in any timeframe relevant to winning or losing the war.

If this could be changed, I propose that fewer facilities be destroyed when a base changes hands - say, 30% or so. Still a penalty, but less crippling.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 21, 2020, 10:08:10 AM
Changing combat that defending unit deals some damage to attacker even if outclassed really  nerfs copters. They are not nearly as  good in WTP due to randomness. Vanilla has snowball combat so one copter can kill ton of units. WTP copter gets damaged pretty much always and can kill _maybe_ 2-3 armored units in the field and will die. If armor is good it can kill 1 and has to retreat or risk dying. Downside is that sometimes (rarely but it happens since there's so much combat) you have scenario where weaker unit just stomps stronger unit.. spearman kills tank scenario.

Attacking the base with armored defender in - copter kills 1 unit max usually.. if there's AAA or aerospace complex its just not smart to risk copter dying. Cheap Infantry with +25% is way safer option.

When i used it in WTP - due to territory bonus - they really couldn't kill multiple armored units. For example they can sniper several unarmored formers. And they are still awesome for its movement and they are quite strong defending unit and counter to anything lightly armored. Same logic goes for needlejets - their advantage over copter is higher range.

Missiles i found almost useless in vanilla - because they "die". If combat is skewed that attacking unit has real chance to die (as in WTP) then missiles actually become useful and even cost effective.  They are not op as they are countered by AAA and aerospace complexes and they are not cheap. But their range and power really makes them interesting to spam in backward bases.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 21, 2020, 11:23:00 AM
> The tech rate didn't seem as crazy as in my earlier game, but maybe I just didn't play long enough to see it.

Originally I planned the costs in the tech formula pretty conservatively so that they would not diverge from the old values that much. Based on these reports it seems feasible to go way beyond that. Currently the base cost formula was 3 * Level^3 + Level*117. I think I'll change it to say 5 * Level^3 + 115*Level in the next build. This will proportionally increase the costs for the later techs much more.

> This fits with previous observations that the AI doesn't do very well transitioning back from war to a peace footing.

Did the AI still had vendetta status with other factions? Otherwise I can't see what would be the issue here.

> Is it possible to make any changes to the mechanic that taking a base destroys half its facilities?

I mean sure somebody can mod that easily by patching capture_base function, but I haven't considered how necessary that would be.

> Changing combat that defending unit deals some damage to attacker even if outclassed really  nerfs copters.

So talking about the WtP patches, the issue I see here is that combat mechanics are pretty complex and with Thinker Mod I've really tried to avoid extensive binary modding. With very few exceptions, the patches just work by writing new call pointers to the game binary and then the main logic gets executed inside dll. Looking at those combat patches they seem to require pretty extensive modifications to the main battle functions on the binary level, so I'm not sure what glitches can be hiding there. And then if I do merge them, it would seem to go against the spirit of the mod to make new combat mechanics enabled by default. I just can't feel it's necessary enough to just go patching these new combat mechanics in there. Maybe I'll import a couple of the non-combat patches though.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 21, 2020, 11:59:26 AM
Sure - just noting an interesting way to nerf copters. Obvious nerf would be to limit them to 2-3 attacks max (but i don't know if thats possible - some might hate that change actually) or to give them something gamey like -50% base attack. That would reduce their usefulness, but they could kill tons of units in the field.. so its half-measure.
This could be then exposed so modders can change it for example.
This logic works well for other units - for example worms are cool, but only have 1 attack per turn forever. Infantry has that base attack bonus and 1 attack per turn (there's that grav ability that gives them double movement..) and rovers attack twice and have bonus in open.
Bvanevery said he removed them completely from his mod due to how unbalanced he finds them - and i agree they are totally op in vanilla compared to other units.
Title: Re: SMACX Thinker Mod
Post by: dino on May 21, 2020, 12:57:08 PM
Air units don't require any other nerf than combat rules from WtP.

In vanilla attacker almost always win without looses in the open, combined with collateral few mobile units can wipe multiple SoD.
No collateral and increased armors slightly and all air units turns into very mobile, but economically inefficient combatants.

Same with magnet tubes, once defending in a base with perimeter is slightly in favor of defender instead of 1:1 like in vanilla and surviving attacker units need few turns break to repair, it's impossible to snowball, if anythig tubes should allow defender quickly concentrate forces in the point of attack and retake lost bases, so an option to make AI build them again should be made available.

Disabled by default, but available as an option, WtP features below are must have for this mod going forward imo:
1) Adjustable healing rates.
2) Adjustable collateral.
3) Adjustable perimeter and tachyon bonus.
4) Adjustable reactor impact on cost and HPs

Other combat features from WtP wouldn't hurt as an option, but are not essential.

I'd also love to see:
1) Coastall bases expanding borders into sea like sea bases.
2) Option to disable 50% condenser bonus.

***

Back on topic of AI improvement.

AIs loose it's edge mid to late game since it leave freshly established bases too much on their own:
1) It could build some additional crawlers, formers and defenders in established bases and rehome them to the new ones.
2) It could concentrate on hurrying essential infrastructure in new bases more.
AI could also get a cheat to hurry without penalty before first row is filled, since player can partially rush first row and then finish the next turn, would help with emergency hurryig defenders.

Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 21, 2020, 01:05:56 PM
> Did the AI still had vendetta status with other factions? Otherwise I can't see what would be the issue here.

Grey previously developed a vendetta with White (I'm not really sure why, though; they weren't near each other, both were my pact partners, and have no SE differences until Future Society. A stronger faction opportunistically declaring war on a weaker one?), but I had them call it off before I started gifting bases. It could be that whatever threat calculation the AI uses still considers this to be dangerous, despite having a truce (and later treaty).

I also wonder whether vendetta status actually gets cleared if the other faction gets eliminated. Specifically: Orange eliminated Grey, I used a probe to liberate Grey (who still had vendetta with Orange), then I eliminated Orange. But I think this doesn't actually remove the vendetta status between Orange and Grey. I saw a similar occurrence in a previous game where I eliminated a faction, then that faction got liberated, and still had vendetta with me upon meeting again. This might mean that the AI was never actually "at peace" to begin with.

Tangentially: if you commit atrocities against Faction A, then Faction A gets eliminated by Faction B, then you use a probe to liberate Faction A from B's HQ, they will still hate you forever. Can't exploit the game that way, alas.

RE: combat balance, I agree that I wouldn't want to see major changes enabled by default in Thinker. Just any options to tweak things around would be good. I see an option to tweak collateral damage has already been added to the repo, good stuff. ;b;

I think another big problem with copters is that because attacking doesn't end their turn, they can always return to safety after attacking - and even with a lower movement range, if they are used to support an assault, they can make their attack and then safely garrison inside the target base once it's captured. Conversely, jets (and gravships) are left exposed after their attack, so being too reckless with their use gets them shot down - and jets with decent weapons are pricey.

Of course, the real way to balance them is for my unarmoured rovers to get mowed down by the AI's own copters. Alas, while they build them, the AI seems unaware of their full power. :(
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 21, 2020, 10:25:07 PM
New develop build 20200521 is now out in the downloads. (https://github.com/induktio/thinker) The changes relative to the last release are listed below - and there's a lot of stuff! This is also a preliminary list of changes for the next release. Unfortunately diplomacy features can't make it into this build because they require much more testing first. Same with the other stuff that has been discussed here.

(click to show/hide)
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 21, 2020, 11:17:40 PM
> No collateral and increased armors slightly and all air units turns into very mobile, but economically inefficient combatants.

Actually in this version I disabled collateral damage by default. AI doesn't handle those situations very well so it should be very simple way to make them more competent.

> if anythig tubes should allow defender quickly concentrate forces in the point of attack and retake lost bases, so an option to make AI build them again should be made available.

But I would not make the AI just build magtubes nearly everywhere like it builds the roads. So it would need some kind of planning mechanism to only build them where they tactically support unit movement.

Also I've been thinking of another way of balancing the tech costs and it would be a really simple change. Right now SE Research effect feels overpowered when the player can stack bonuses up to 50% which makes research go at double speed. One unit of Research could be nerfed to only provide 5% bonus or similar. Also factions with research penalties would not be anymore so massively disadvantaged.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 22, 2020, 12:02:33 AM
+5 RESEARCH isn't double research rate btw, only +50% modifier.

However -5 RESEARCH is half research rate. RESEARCH is quite rough on the negative side.

Title: Re: SMACX Thinker Mod
Post by: Induktio on May 22, 2020, 12:58:27 AM
> +5 RESEARCH isn't double research rate btw, only +50% modifier.

Currently it's certainly implemented as a modifier where each point has an effect of 10 percentage points on the cost. So +5 Research cuts the cost in half, so the speed is doubled. But -5 Research would cause researching the same tech to take 50% longer because the cost is increased by that much.

So the fastest possible Research faction could proceed at the speed of three times the slowest possible faction. Unless there's some kind of a bug in the implementation, that's how it should go when revised_tech_cost is activated. F2 research menu should always show the actual cost after a new target has been selected. After that, the cost is locked until the tech is discovered or research is changed to something else.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 22, 2020, 01:17:28 AM
Ah so it got flipped so to speak. Yea that would make +5 RESEARCH very strong just like +5 INDUSTRY. Necessitates higher penalties on the SEs/factions that get it as a +
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 22, 2020, 01:46:37 AM
Always great to see a new build coming out. Keep up the good work :)

RE: tech cost balance:

How often does one actually get to +5 RESEARCH, though? SE Knowledge gives +2, and science factions like University or Cyborgs get +2, and that's all you're going to see for most of the game. I maintain that raw energy input is the biggest culprit behind unstoppable tech runaways.

That said, it's probably a good change. Brings factions with different RESEARCH scores more in line with each other.

> But I would not make the AI just build magtubes nearly everywhere like it builds the roads. So it would need some kind of planning mechanism to only build them where they tactically support unit movement.

I'd say a good starting point here would be to have the AI just build magtubes on straight-line distances between cities. Being able to build units in one place and bring them to another would already be a big boost. It'd require constant checking to see which cities already have magtubes between them though, if no data is being stored in the save file.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 22, 2020, 02:11:40 AM
Though now that I'm rechecking these numbers, it looks like the current revised_tech_cost is bugged. Depending on how these costs get calculated in the game engine, the SE research factor might not have an effect like it's supposed to have according to the documentation. Have to look into it more closely later. Should be easily fixed though in the next version and it doesn't affect games in other ways than the research costs.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 22, 2020, 03:26:10 AM
Something not right with Thinker AI former automation. See this former trying to build solar on mine while there are lot of unworked tiles around.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 22, 2020, 08:37:10 AM
Quote
Necessitates higher penalties on the SEs/factions that get it as a +

I don't think this is the case in practical gameplay for AI - it looks like Zakharov/University is weakest faction in the Thinker. He always gets stomped once Probe teams come into play. Maybe if he get Hunter-Seeker that he has some chance to be the best, but I doubt it.

The best factions are industry ones usually - Hive and Drones and whoever starts at Monsoon jungle. Both of these factions have slower research, but from what i can observe always play better. RESEARCH is actually not that great stat once probe teams are in play. Especially if AI is using armored probes - what poor Zakharov researches through hard work others easily steal and trade away. Drones also kill him its just too strong a nerf for AI - I'd like to see that removed from him - bvanevery removed it in his mod i think.

Quote
One unit of Research could be nerfed to only provide 5% bonus or similar.
This might help a bit to nerf player - but AI won't really get better.

I wouldn't speak of RESEARCH isolated - it needs to be looked through factions and SE choices. +2 Research is not really good if its coupled with -2 Industry.. and it doesn't save Zakharov, nor it ruins Drones/Hive.

I think EFFICIENCY is more important attribute especially to AI. Late on + EFF is often better than +RESEARCH or +ECONOMY.

Quote
I'd say a good starting point here would be to have the AI just build magtubes on straight-line distances between cities.

This would be great to have.

Another thing that would be good to improve:

AI using 1 food tile (in ocean) or 1f/1e fungus for example instead of much better specialist. 1 food in general is bad idea to work as city will grow and starve.


Title: Re: SMACX Thinker Mod
Post by: dino on May 22, 2020, 11:39:20 AM
But I would not make the AI just build magtubes nearly everywhere like it builds the roads. So it would need some kind of planning mechanism to only build them where they tactically support unit movement.

Magtubes only to connect bases, roads, could be limited to rocky mines, connecting bases, and tiles surrounding bases.
AI could build roads and tubes toward enemy  territory, *if* enemy is weaker and AI is going to invade.

Also I've been thinking of another way of balancing the tech costs and it would be a really simple change. Right now SE Research effect feels overpowered when the player can stack bonuses up to 50% which makes research go at double speed. One unit of Research could be nerfed to only provide 5% bonus or similar. Also factions with research penalties would not be anymore so massively disadvantaged.

Given exponential growth of tech costs, I'm not sure smaller bonus would allow meaningful long term advantage.

Title: Re: SMACX Thinker Mod
Post by: Induktio on May 22, 2020, 08:17:02 PM
Now that I'm reconsidering it, modifying Research effect doesn't make sense if Industry effect remains the same. The latter is certainly stronger for the AIs and probably can't be modded easily, the production stuff is hardcoded in so many places.

I'm thinking if Magtube building gets implemented, the AI should only build them between bases and avoid any redundant connections (that's how a human would build them too). If they get built everywhere, it looks a little too ugly. But it's somewhat tricky to code this process right. And there's the diplomacy features to consider too.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 23, 2020, 06:35:17 PM
I just completed a game with 2/5 global warming in alphax and the sea rise was still overwhelming. Morgan and Lal, who had the Monsoon Jungle, burned up the planet real fast. Nobody proposed a solar shade and I never got there due to being crippled early on by a massive Spartan attack.



I did not, oops. Still set to 1/2.


Will the diplomacy improvements cover the AI being smarter about Supreme Leader elections? I think Lal called one election as soon as he could and he was only a few votes off from winning outright, like single digits short. I was his pact sister. Maybe he thought I'd vote for him? He then waited much longer than 10 years to try again.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 23, 2020, 11:09:07 PM
> Will the diplomacy improvements cover the AI being smarter about Supreme Leader elections?

Probably not, since I haven't looked into this specifically. Rather I think the most flawed part of current diplomacy AI is that they tend to be a little too aggressive and declare vendettas recklessly. This would need some kind of adjustment if I can figure out a good way to do it.

How much did the sea level rises affect the size of the continents, e.g. how much of them got submerged and on which timeframe? Did you notice any other significant changes in AI behaviour?
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 24, 2020, 02:22:59 AM
Will the diplomacy improvements cover the AI being smarter about Supreme Leader elections? I think Lal called one election as soon as he could and he was only a few votes off from winning outright, like single digits short. I was his pact sister. Maybe he thought I'd vote for him? He then waited much longer than 10 years to try again.
Being the Governor only means you can call the Council every 10 years on different proposals. You still have to wait the full 20 years to bring up a specific proposal again.

I think of these votes as being kind of like warning shots: the AI has this big of a population, if you don't do something about it they're going to win the game outright. Of course, as was so aptly demonstrated in my last game, that something is usually to invade the offending AI to steal their votes...
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 24, 2020, 10:39:25 PM
How much did the sea level rises affect the size of the continents, e.g. how much of them got submerged and on which timeframe? Did you notice any other significant changes in AI behaviour?

Lal won a diplomatic victory in 2294 and by then I estimate there was nearly a kilometer of sea rise. The Manifold Nexus and The Ruins were placed on coasts and they were underwater by the end. Not sure if they start at a default height. Some of my coastal bases slid into the sea. One of mine was hit by a tidal wave. It was a strange game. Lal had a power graph like an experienced player playing Citizen difficulty.

I started a new game at 2/5 global warming and will let you know how things go in more systematic detail. I believe Yang has his own continent and he sniped the Weather Paradigm from me so I'm expecting him to be the big polluter. Standard planet, abundant worms, thinker difficulty. I disabled the Monsoon Jungle this time around.


Being the Governor only means you can call the Council every 10 years on different proposals. You still have to wait the full 20 years to bring up a specific proposal again.

I think of these votes as being kind of like warning shots: the AI has this big of a population, if you don't do something about it they're going to win the game outright. Of course, as was so aptly demonstrated in my last game, that something is usually to invade the offending AI to steal their votes...


I see, though it still seemed longer than 20 years. Could be wrong. I'll check next time it happens. There was no stopping Lal in this one. He got The Ascetic Virtues and covered the Monsoon Jungle in size 18 bases!
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 26, 2020, 03:27:08 PM
Update: So far I've had three sea rise events on 2/5 settings and abundant life:


2249: 66m
2263: 266m
2278: 266m


This is entirely AI-driven. I'm playing the Gaians and have almost no eco-damage and no advanced terraforming improvements. Lal and Zak have both chosen Green economics but I'm not sure if they need the efficiency (their empires are not very large). Morgan is on Simple for some reason. Yang, who sticks to Planned, did indeed start on his own continent. I saved the game at the start so it will be easier to compare initial coastlines with final. I know at least Zakharov has Advanced Spaceflight but he has not proposed a solar shade. It's not because of sunspots.


Lal seems to be getting his eco damage under control thanks to inducing vicious fungal pops and by building The Pholus Mutagen (damn him!). I am seeing trance units everywhere (which are really annoying for my worm-based army!).


By the way, AAA foils/cruisers are effective against me because I typically defend myself from sea invasions with needlejets. Is that your doing? :)
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 26, 2020, 04:31:48 PM
Update: So far I've had three sea rise events on 2/5 settings and abundant life:


2249: 66m
2263: 266m
2278: 266m


This is entirely AI-driven. I'm playing the Gaians and have almost no eco-damage and no advanced terraforming improvements. Lal and Zak have both chosen Green economics but I'm not sure if they need the efficiency (their empires are not very large). Morgan is on Simple for some reason. Yang, who sticks to Planned, did indeed start on his own continent. I saved the game at the start so it will be easier to compare initial coastlines with final. I know at least Zakharov has Advanced Spaceflight but he has not proposed a solar shade. It's not because of sunspots.


Lal seems to be getting his eco damage under control thanks to inducing vicious fungal pops and by building The Pholus Mutagen (damn him!). I am seeing trance units everywhere (which are really annoying for my worm-based army!).


By the way, AAA foils/cruisers are effective against me because I typically defend myself from sea invasions with needlejets. Is that your doing? :)

I don't remember if ecodamage sea raise is limited to some height or is it never stops when started. Does abundant life affect ecodamage? Don't remember this either.

All AI tweaking is Induktio's doing from Thinker mod that is included in this one.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 26, 2020, 04:52:52 PM
I always found the amount of sea level rise a bit ridiculous so I turned it off in my own mod. All ice on earth melting is only about 80m of sea level rise.

I'd argue that extreme pollution might actually lower sea levels as the oceans start to boil over, more water vapor in the air. Also would make the planet drier. But supposedly that takes a huge amount of pollution, 10x or so of all Earth's fossil fuels. And Chiron doesn't have any natural fossil fuels at all. Although all those synthetic ones could be theoretically worse somehow.
Title: Re: SMACX Thinker Mod
Post by: Geo on May 26, 2020, 06:16:58 PM
Edited
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 26, 2020, 06:33:37 PM
Here is a picture (https://www.dropbox.com/s/ft8o4c9825le8xp/road_building.png?dl=0) of some important features that are ready to be included in the build. Road building algorithm has been completely rewritten and Thinker will now build magtubes when it has the technology. In the image you can see how the new method would hypothetically plan the routes between the bases. Notice how it can now span very long uninhabitated gaps between the bases.

In practise it will look slightly different because Thinker will build the bases closer to each other if possible. The other mod may not be immediately obvious but it is a helpful visual aid to locate certain places. ;)

> There was no stopping Lal in this one. He got The Ascetic Virtues and covered the Monsoon Jungle in size 18 bases!

In times like that it may feel like the game is trolling you. "Well sure thing, try outvoting this!"

It might be useful to set the global warming modifier to 1/3 or something. It's probably not excessive given how quickly these thresholds are being met.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 26, 2020, 07:08:01 PM
This should work no matter how I mod alphax.txt on scients patch correct? Might give it a try once I get all the kinks out of my tech tree rebuild
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on May 26, 2020, 07:15:21 PM
I don't remember if ecodamage sea raise is limited to some height or is it never stops when started. Does abundant life affect ecodamage? Don't remember this either.

All AI tweaking is Induktio's doing from Thinker mod that is included in this one.


The native life setting a multiplier according to the wiki, yeah. This one?


I always found the amount of sea level rise a bit ridiculous so I turned it off in my own mod. All ice on earth melting is only about 80m of sea level rise.

I'd argue that extreme pollution might actually lower sea levels as the oceans start to boil over, more water vapor in the air. Also would make the planet drier. But supposedly that takes a huge amount of pollution, 10x or so of all Earth's fossil fuels. And Chiron doesn't have any natural fossil fuels at all. Although all those synthetic ones could be theoretically worse somehow.


It is pretty crazy that there's a Biblical amount of water, but I'm willing to gloss over all that because it's an alien planet blah blah blah.

It might be useful to set the global warming modifier to 1/3 or something. It's probably not excessive given how quickly these thresholds are being met.


That's my next step. I've also been playing with the world builder settings for other reasons (trying to get fewer noodle continents) and noticed the sea level rise setting there. I'll try nerfing that, too. I actually don't mind the idea of there being a period of widespread eco-chaos before the technology catches up, so long as it's plausibly reversible.

Those magtubes are so tidy! Much harder for me to grief the AI with them. ;) Did you mark the headquarters base??
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 26, 2020, 09:18:16 PM
A new develop build 20200526 is now available from downloads (https://github.com/induktio/thinker). Here are the changes:

* Road building algorithm has been completely rewritten to build more natural looking road networks.
* AI will now build magtubes after the tech is acquired.
* Draw visual marker around the population label of HQ bases to identify them more easily.
* New option: auto_relocate_hq will automatically move lost HQs to another suitable base.
* Fix revised_tech_cost formula to calculate SE research effect similarly to vanilla game.
* Reduce overall sea level rise frequency to 1/3.
* Add Trance Scout Patrol and Police Garrison predefined units.

....

> This should work no matter how I mod alphax.txt on scients patch correct? Might give it a try once I get all the kinks out of my tech tree rebuild

What do you actually mean here? Nothing here should be incompatible with alphax.txt editing.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 26, 2020, 10:35:56 PM
Sweet changes  ;b; like both magtubes and trance/police units.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 26, 2020, 10:40:07 PM
A new develop build 20200526 is now available from downloads (https://github.com/induktio/thinker). Here are the changes:

* Road building algorithm has been completely rewritten to build more natural looking road networks.
* AI will now build magtubes after the tech is acquired.
* Draw visual marker around the population label of HQ bases to identify them more easily.
* New option: auto_relocate_hq will automatically move lost HQs to another suitable base.
* Fix revised_tech_cost formula to calculate SE research effect similarly to vanilla game.
* Reduce overall sea level rise frequency to 1/3.
* Add Trance Scout Patrol and Police Garrison predefined units.

....

> This should work no matter how I mod alphax.txt on scients patch correct? Might give it a try once I get all the kinks out of my tech tree rebuild

What do you actually mean here? Nothing here should be incompatible with alphax.txt editing.

Yea all I have is modified so far is alphax.txt and faction files. I found the answer more or less on the first page. I'd have to run a lot of sim games to reach conclusions. Does the terraforming algorithm take into account how good options are? Like if borehole is 0/0/0 will the AI still make them? Does it consider fungus and farm/solar/echelon?
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 26, 2020, 11:20:10 PM
> Does the terraforming algorithm take into account how good options are?

In general, no. It doesn't do on the fly cost-benefit calculations for most terraforming actions. The only real exception to this is forest vs. fungus tiles. Thinker calculates which one of these will yield more and prefer to plant them unless some other advanced terraforming can be built on the square. So modders should be very careful if they change the relative value of terraforming improvements. Usually it's much better to disable something outright (like boreholes) instead of nerfing them into oblivion. :D
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 26, 2020, 11:46:44 PM
* Road building algorithm has been completely rewritten to build more natural looking road networks.

Does it mean not every improved tile will have a road?
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 27, 2020, 12:05:38 AM
Yea that was just hypothetical lol. I prefer boreholes in the game right now I have them at 0/0/8. It was more a ponderance whether it might do farm/enricher/solar/echelon on high altitudes
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 28, 2020, 07:26:32 PM
Hmm, at this point it appears there's already enough stuff for a new release so I won't be adding much new features to it anymore. HQ relocate feature will get a small fix so that it covers all cases where the previous HQ might be lost.

Existing features in this changeset are still subject to being adjusted based on feedback. Tech progression should be somewhat slower in the middlegame compared to v1.0 but I hope it doesn't stagnate research too much. The main purpose there is to significantly increase late game tech costs compared to earlier tiers anyway.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 28, 2020, 08:42:41 PM
Cubic seems ok, I was playing around with exponential functions. But I think those might make the tech too easy in the first half and a bit too steep in the second half.

for ax^3+bx, I'd say to increase a and decrease b. Early game tech costs are too high.

Edit: Also I'd probably do away with the 'first 10 techs are cheaper' thing. IMO it's kind of a relic of the old costing formula where it was too steep for the first 10 so they worked around it with a second formula.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on May 29, 2020, 02:25:58 AM
I actually do take advantage of the "first 10 techs are cheaper" thing, by intentionally researching as many level 2 techs as possible while the discount still applies. Then I can go back to researching level 1 techs and/or just trade them from the AIs. This is probably not the intended use of the mechanic. :P
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 29, 2020, 08:58:36 PM
> I actually do take advantage of the "first 10 techs are cheaper" thing, by intentionally researching as many level 2 techs as possible while the discount still applies.

Yeah it's possible to min-max it that way but the gains remain kinda limited. It was mostly there as a way for every faction to get the basic techs a little bit easier. But let's suppose we'll do away with that mechanic. Without discounts, tier 1 techs cost 120 labs in the current version. It would have to be lowered significantly from that because higher costs delay the acquisition of former technology, for example. We can add a constant factor to the formula to adjust it better for the first tiers.

Let's say we use 5*Level^3 + 95*Level - 40. In that case the costs for tiers 1-15 look like this:

Code: [Select]
60
190
380
660
1060
1610
2340
3280
4460
5910
7660
9740
12180
15010
18260

Current difficulty scaling would add 20% for human factions on Transcend level while AI factions gain a 30% discount (cost_factor=7). Any thoughts on this?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 29, 2020, 11:17:20 PM
There is no need to give AI research discount. They exchange technologies. So any discount for everyone will just speed up overall research rate. The game essentially becomes shorter. I don't think this is an intention.

Any faster AI discovery rate doesn't affect player much as human trade and steal techs as well.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 29, 2020, 11:57:28 PM
Yea the 10 techs thing was moreso abusable for going after early T3/4 techs (IndAuto is a big one). T2 was a bit less concerning.

Which bonuses the AI should and shouldn't get is another thing. I favor % boosts like the ones to growth, industry, and possibly research over arbitrary mechanical ones like a lower difficulty level (b-drones, growth drones, ecodamage).

30% boost in three areas is quite a lot. Compared to Deity (Civ2) which was 40% but only to industry. 30% in three areas is much more, since each is multiplicative with the others.

Adding 20% more to human lab cost is kind of the same as just giving the AI even more labs discount? To me that's a bit odd since human never had to pay 20% nutrients more or minerals more.

I'd have to recheck, I didn't think there was quite that much difference between human and AI lab costs in the stock formula..
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 30, 2020, 12:13:34 AM
Actually I was already considering nerfing that AI discount because proportionally it is a little too much. In the stock game AI gained quite a huge research discount if I remember right, but it didn't "feel" large because AI was always incompetent in managing the economic aspects.

Here it would be possible to drop either the human or AI modifer to simplify the formula. I would estimate a maximum 30% difference between human/AI on Transcend would be enough, maybe even less. Maybe just keep the player cost level the same and apply cost_factor on AI research costs.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 30, 2020, 02:30:10 AM
Somehow it feels less cheaty if the AI gets larger boosts in fewer areas.

I might be missing a few that others can point out, but the list of AI boosts is quite big:
- industry boost
- growth boost
- research boost
- drones by pop mitigation (by difficulty mod)
- ecodamage mitigation (by difficulty mod)
- b-drones mitigation (by difficulty mod)
- no production switching penalties
- no SE switching costs

Seeing the thinker AI in action did make me think how powerful ICS really is. Some of this tech increase need is due to the power of this style of play. Which everyone seems to complain about due to the micromanagement involved, but there's never a solution.

I considered that perhaps EFFIC should be reworked. B-drones were a novel idea but not really enough to stop ICS. Because really it's just +1 drone a base no matter how many bases you make. And that downside can mostly be mitigated with powerful police units.

The idea was that instead of pure distance from the capital inefficiency would be based on your # of cities. It would work something like where your closest base from the HQ suffers a small amount of inefficiency. Your 12th base from the HQ might suffer moderate inefficiency. Your 50th base might produce very little energy at all. EFFIC and mapsize would of course weigh in.

It's also worth noting that they dropped waste/inefficiency on minerals/shields going from Civ2. But this might be fine, as overall energy has many advantages over minerals in SMAC/X.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 30, 2020, 01:21:58 PM
Adding 20% more to human lab cost is kind of the same as just giving the AI even more labs discount? To me that's a bit odd since human never had to pay 20% nutrients more or minerals more.

It's not the same in big picture. Giving anybody research bonus makes overall research pace faster and game shorter, since everybody exchange techs.
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 30, 2020, 01:27:28 PM
Uh, hmm. That list is not entirely accurate. I'd say only the first 3 production bonuses are meaningful, the other bonuses here and there are only coincidental. At least Thinker works with the same rules than the player with eco damage and SE switching costs. There's no production switching penalty that I remember, but then again, Thinker changes production only very rarely. That would be different with the stock game.

Also I don't remember what kind of bonuses the AI gets with B-drones, if there's even any, but this statement doesn't seem correct. "Because really it's just +1 drone a base no matter how many bases you make." If you have multiple bases over the B-drone limit then you should eventually receive multiple B-drones in the same base, it's just they are semi-randomly distributed.
Title: Re: SMACX Thinker Mod
Post by: lolada on May 30, 2020, 01:51:05 PM
One suggestion: Is it possible to improve AI specialist usage? Activating them instead of using quite useless tiles. For example AI tend to work useless 1-0-0, 0-1-0 tiles or similar when it could use quite good specialists. Its notable on ocean bases - ocean producing only 1 food  - there's no even point growing.. base is gonna starve. Also notable in heavy fungus maps.

(https://i.imgur.com/fbGjC3c.png)
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 30, 2020, 02:33:38 PM
One suggestion: Is it possible to improve AI specialist usage? Activating them instead of using quite useless tiles. For example AI tend to work useless 1-0-0, 0-1-0 tiles or similar when it could use quite good specialists. Its notable on ocean bases - ocean producing only 1 food  - there's no even point growing.. base is gonna starve. Also notable in heavy fungus maps.

(https://i.imgur.com/fbGjC3c.png)

Vanilla does use specialists. It depends on their effect. Early specialists are not that valuable. For example doctor is good for quelling drones. There is not use for them when there are none. Technician and librarians are just 3 eco/lab only. This is not always better than 1 nut/min. Energy is kind of secondary thing. Whereas nut/min are essential for base growth. So even if 3 eco is better than 1 min the distinction is pretty slim. AI may not be that fine tuned to understand it.

Although, I agree that some extra tuning may render it slightly smarter.
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 30, 2020, 06:44:26 PM
Yea the other benefits aren't quite as strong as the production ones. I'd say the librarian level of drones on transcend is quite powerful though. -2 DRONES a base, effectively. I think a lot of the reason they put that in is because the stock AI doesn't really know 'when' to build Rec Commons and Holo Theatre.

I never looked into how b-drones get distributed. What I meant was the AI gets fewer due to librarian difficulty modifier. Multiple b-drones in one base might be possible. But even if they do all they do is make superdrones, which get controlled by police the same as normal drones. They are more of a penalty for -POLICE settings.

Governor has to take a lot into account also. The value of 1N changes a lot depending on how much surplus N is being made. In general I felt like it always undervalued energy, that is 1M > any amount of energy in a tile. It probably is one area where a human plays better than the AI heuristic.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 31, 2020, 03:16:54 AM
What is going on? I am playing WtP that uses Thinker AI for crawler placement. Look at the picture. Two crawlers convoying same 3 nutrient resources from the same square to different bases. How it this possible?
Title: Re: SMACX Thinker Mod
Post by: Nexii on May 31, 2020, 05:01:22 AM
How about those adjacent boreholes :P
Title: Re: SMACX Thinker Mod
Post by: Induktio on May 31, 2020, 01:12:28 PM
> What is going on? I am playing WtP that uses Thinker AI for crawler placement. Look at the picture.

Well, I only consider bug reports that happen with the latest version of Thinker. If you fork something, then debugging can only be done by you.

> One suggestion: Is it possible to improve AI specialist usage? Activating them instead of using quite useless tiles.

The problem here is that specialist allocation code is not reversed fully yet, so it's hard to integrate these solutions into the game engine. (Anyone want to contribute code here?) Remember that the governor for player factions uses the same logic too. I think the biggest flaw there is still that it can't fully anticipate drone riots and wastes a lot of production turns as a result. The stock AI even needed a patch to get it to use borehole tiles *at all*. Fixing the governor would probably have a really big impact on how much micromanagement it saves for the players.

I also deployed some changes to the tech cost formula: drop the difficulty modifier for player factions, drop 10 first techs cheaper rule, AI cost_factor bonus is reduced to 8% per unit, and base formula for tech costs is now 6*Level^3 + 74*Level - 20.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on June 01, 2020, 04:05:04 AM
I've installed Thinker 2.0 and tried my save there. The behavior stays the same. The Anvil of Men produces crawler in 2 turns and this crawler walks to (3,17) where there is already a crawler harvesting nutrients. Then the second crawler started harvesting nutrients too.
Title: Re: SMACX Thinker Mod
Post by: Nexii on June 01, 2020, 05:16:36 AM
So does the AI just ignore borehole placement restrictions? It wouldn't surprise me too much as it ignores tech requirements on basic improvements (farm, forest, road, sensor, mine, solar)
Title: Re: SMACX Thinker Mod
Post by: dino on June 01, 2020, 11:50:43 AM
How about those adjacent boreholes :P

Or the one on the slope of Mount Planet.
Title: Re: SMACX Thinker Mod
Post by: Induktio on June 01, 2020, 06:11:55 PM
> So does the AI just ignore borehole placement restrictions? It wouldn't surprise me too much as it ignores tech requirements on basic improvements

I'm not sure if you're trolling here. When was the last time unmodified Thinker built boreholes next to each other? When does it ignore tech requirements?

Duplicate crawlers on one square shouldn't normally happen either. There's some kind of an issue in the save game with the way it checks if the square can be crawled or not, but I doubt one would encounter that situation normally. If those crawlers had forest tiles available, they would switch to them. Though it should get some kind of a fix for the movement code.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on June 01, 2020, 11:16:09 PM
I've played WtP and then loaded save into Thinker. No trolling intended. I understand you may doubt this is a valid test. So I'll probably try to repeat the same with Thinker from beginning. Or maybe I won't be able to.
Title: Re: SMACX Thinker Mod
Post by: Nexii on June 02, 2020, 07:28:01 PM
I'm not sure if you're trolling here. When was the last time unmodified Thinker built boreholes next to each other? When does it ignore tech requirements?

Not trolling, AI ignores tech prerequisites for basic improvements - not boreholes though. It was noted in the bug forum.
Title: Re: SMACX Thinker Mod
Post by: Induktio on June 02, 2020, 08:43:31 PM
> Not trolling, AI ignores tech prerequisites for basic improvements - not boreholes though. It was noted in the bug forum.

Yeah but notice we're talking about Thinker here and the terraforming AI is vastly different, almost from another planet. ;)

Thinker should always check the tech requirement before performing any actions. If there's some instance where this is not the case then let me know.

And yes, it does *also* check if the tile has a valid slope before building boreholes. I haven't seen it build them on slopes where it wouldn't be normally allowed by the game rules, but the terrain shape can change afterwards because of various reasons and then the earlier boreholes will remain there anyway.
Title: Re: SMACX Thinker Mod
Post by: Nexii on June 02, 2020, 08:49:29 PM
Ok I had modded for plant forest to take tech: Ecology (Centauri Ecology). Formers take Indust (Industrial Base) to make. The AI can plant forests before getting the tech Ecology. This should apply to all basic improvements - Farm, Solar, Mine, Sensor, Road. As well the automated terraforming functions circumvent technology requirements for human players.
Title: Re: SMACX Thinker Mod
Post by: Induktio on June 02, 2020, 09:05:36 PM
I can't replicate what you're describing here. Are you talking about automated formers in player-controlled factions? They don't use Thinker at all. It should be described in documentation btw. The only place in the code where Thinker could decide to plant forests is preceded by this check:

Code: [Select]
has_terra(faction, FORMER_FOREST, sea)
Title: Re: SMACX Thinker Mod
Post by: Nexii on June 02, 2020, 10:34:48 PM
Yea seems Thinker mod fixed the bug where it relates to AI factions, I had misread the tech list of the test factions

It does apply to automated terraforming functions which is an aside
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on June 03, 2020, 12:51:17 AM
Ok I had modded for plant forest to take tech: Ecology (Centauri Ecology). Formers take Indust (Industrial Base) to make. The AI can plant forests before getting the tech Ecology. This should apply to all basic improvements - Farm, Solar, Mine, Sensor, Road. As well the automated terraforming functions circumvent technology requirements for human players.

Nevill reported seeing the opposite back when we were first porting his mod to work with Thinker. We had formers and basic improvements (farm, solar, mine, road) available from the start, with Centauri Ecology unlocking forests. However, this seemed to confuse the AI, which wouldn't learn Centauri Ecology and thus be unable to use forests. So we ended up swapping it around so that forests were also available from the start. This was with Thinker 1.0.

Started a new game with Thinker 2.0. The AI seems to be notably less aggressive this time around: nobody instantly declared war or tried to extort techs, and I'm sitting comfortably at the top of the rankings with a significant population advantage, when previously I would be a weakling for most of the early game until Human Player IngenuityTM caught up with the AI bonuses. I think some of the AIs had trouble dealing with all the fungus on this map. Do the faction personality settings (Pacifist, Erratic, Aggressive) still influence their building priorities?

Curiously, one of the AIs appears to have moved his HQ to take advantage of a nearby Uranium Flats. When the game is over I'll go back in the scenario editor to check if he did actually move it.

EDIT: Never mind, it seems I spoke too soon. My neighbour who was quite happy to pact with me for free before has now gotten uppity and sparked a global war over demanding tech. :(
Title: Re: SMACX Thinker Mod
Post by: Induktio on June 03, 2020, 09:28:23 PM
> Do the faction personality settings (Pacifist, Erratic, Aggressive) still influence their building priorities?

It does influence it, but the effect is somewhat subtle and shouldn't result in huge variations in development. Aggressive factions tend to build more units at an earlier date. And abundant fungus also slows down any AIs quite a lot.

> Curiously, one of the AIs appears to have moved his HQ to take advantage of a nearby Uranium Flats.

They should not spontaneously move the HQ unless the previous one was lost. With automatic relocate the game engine does it for them also.

Actually, thinking about that terraforming automation for player factions, it should be possible to implement it now when almost all variables relating to it are reversed. I'm not sure if it's strictly necessary but might be useful if some players don't want to micromanage formers all the time.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on June 10, 2020, 03:43:19 AM
1/3 global warming seems okay. A few factions are nearly to Advanced Spaceflight when it happened in my games so far. I might lower the world builder setting that lessens sea rise a little bit. So far I actually like that it is almost guaranteed if the AI is allowed to go nuts developing. It helps shake things up and puts into play a game mechanic that doesn't get much attention in the stock game.


I haven't seen any strange terraforming that's been described above.


AIs seem to go through a methodical seabase expansion phase, is that Thinker?
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on June 10, 2020, 04:59:27 AM
Things were a bit quiet here for a bit, figured I should share how my current game with Thinker 2.0 is going.

(https://i.imgur.com/rpzJ9qT.png)
I am Orange, surrounded by everyone else.

The tech rate feels like it's smoothed out a bit. I set it back to 100% for this game; it's now 2208 and we are only just breaking into level 4 and 5 techs. I personally find this a bit slow so I'm putting it back to 75% next game.

I'm really liking the new HQ markers. A small but very convenient feature.

After an initial troubled development due to fungus, several of the AIs have embarked on a massive military build-up. Lavender has a big stack of about a dozen Impact Rovers she's using to pillage Gold's bases, and Olive has an enormous army of 7r infantry, rovers, and artillery built up. The downside is that their bases are now clogged with support, although given their +30% bonuses and their love of Police State, that's less of a concern for them.

I was in the lead for some time, using my early Impact Rovers to wage some successful wars that netted me some 500 credits, very helpful for my early development. But now my lead has shrunk, and with many AIs filling their bases with 1-3t-1 defenders, overrunning them with Impact Rovers won't work anymore. I might have to actually use artillery and infantry to assault bases now.

Unsurprisingly, it's a lot easier to coerce AIs into surrendering when they don't have a zillion sea bases to fall back on after conquering them on land.

Annoyingly, once I had forced Gold to surrender, I wasn't able to get my pact partners to call off the vendetta against him, claiming they had "accepted payment for his destruction". Thus, I had to repeatedly expel their units from my territory to keep them from wrecking my new vassal... which stopped working when the sunspots occurred.

I will admit to being somewhat salty, as on the very turn that I planned to invade Olive and remove the threat he posed, the sunspots ended, Lavender renounced our pact and started attacking the "diplomatic envoys" I'd stationed in Gold's bases to keep her from attacking him.

Also, Gold is making distinctly sub-optimal SE choices, a capital offense to be sure. Specifically, he's running Police State + Free Market. These are the relevant stats:
Code: [Select]
Frontier,        None,
Police State,    DocLoy,  ++SUPPORT, ++POLICE,   --TALENT
Democratic,      EthCalc, ++EFFIC,   ++GROWTH,   --SUPPORT
Fundamentalist,  Brain,   ++PROBE,   +MORALE,    +INDUSTRY,  --RESEARCH     
Simple,          None,
Free Market,     IndEcon, ++ECONOMY, ----POLICE, --PLANET,   -INDUSTRY
Planned,         PlaNets, ++GROWTH,  +INDUSTRY,  --ECONOMY
Green,           CentEmp, ++EFFIC,   ++PLANET,   --GROWTH,   +TALENT
Code: [Select]
SE preference: Free Market

^+2 ECONOMY: {Free flow of capital}
^+2 SUPPORT: {Just-in-time supply chains}
^-1 MORALE: {Privatized military}
^-2 INDUSTRY: {Excessive contractor bloat}
^Immunity to negative POLICE: {Morally righteous}
^Extra DRONE for every four citizens: {Deregulation and austerity}
^50% hurry costs: {Angel investors}
^{May not use Power values.}

SUPPORT only goes up to +3, so adding +2 to +2 gives little advantage, especially when none of his bases are above 4 pop anyway. Likewise, immunity to POLICE means +2 combines with -4 to give -2, which gets clamped to 0 either way.

So while PS+FM would be viable for other factions, Gold doesn't get much benefit from combining these two options. Democracy is currently available, but Fundie is not.

I know there's code to handle immunity to SE effects, but I'm not quite sure how it works.

EDIT: I gifted him the tech for Fundamentalist and he promptly switched to it. I probably should have done that earlier...
Title: Re: SMACX Thinker Mod
Post by: lolada on June 10, 2020, 10:08:49 AM
Addition of those trance defenders is really nice - AI is having troubles with  worms a lot early so this change is quite cool. Also makes it harder for player to spam worms for example.

It would be improvement if AI could handle support better - they really can go overboars with - minerals. Its somewhat fixable with SE modding - AI with +support is way better than those with minus.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on June 10, 2020, 05:25:02 PM
Unsurprisingly, it's a lot easier to coerce AIs into surrendering when they don't have a zillion sea bases to fall back on after conquering them on land.

Annoyingly, once I had forced Gold to surrender, I wasn't able to get my pact partners to call off the vendetta against him, claiming they had "accepted payment for his destruction". Thus, I had to repeatedly expel their units from my territory to keep them from wrecking my new vassal... which stopped working when the sunspots occurred.


Sea exiles are very annoying because they will never be able to seriously threaten anybody again but they will spread out and get the AIs too caught up a chaotic naval war that's not worth the minerals.


I have a similar vendetta issue in my current game involving the thrice-relocated Peacekeepers and the Spartans. The Spartans told me that Lal pressed the vendetta and Lal also refused to sign a truce??? Neither were my submissives, though. I'm pretty sure I would have noticed if there was nerve gas involved.
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on June 11, 2020, 01:59:00 PM
In general the AI in Smac is too aggressive for its own good. It can provide some challenge for the player if he/she gets attacked early but it can also mean they get mired in long unproductive wars among each other. It's also a bit irksome how irrational their behavior is.
Title: Re: SMACX Thinker Mod
Post by: Induktio on June 11, 2020, 06:25:43 PM
Nice gameplay reports here. :D

> AIs seem to go through a methodical seabase expansion phase, is that Thinker?

Yeah, Thinker always decides where to build the new bases. Even though I reduced the tendency to build the sea bases on coastal squares, it's still kinda prevalent. Or did you have something else in mind?

> The tech rate feels like it's smoothed out a bit. I set it back to 100% for this game; it's now 2208 and we are only just breaking into level 4 and 5 techs.

I kinda designed it that way because many powerful economic techs become available on levels 4-5. It may feel like "tech stagnation lite" on the default settings but I suppose it's some variation to the vanilla formula. Let me know how it goes though.

> Also, Gold is making distinctly sub-optimal SE choices, a capital offense to be sure. Specifically, he's running Police State + Free Market.

Whoa, watch out here. Police State in the example utilizes TALENT modifier which unimplemented in the valuation metric. In this case the penalty would not be visible and social_ai thinks Police State has only positive variables. It's kind of an oversight because none of the vanilla choices utilize that variable.

> Likewise, immunity to POLICE means +2 combines with -4 to give -2, which gets clamped to 0 either way.

I'm not sure the way you worded it here is accurate. Immunity provides the ability to ignore negative values (they get set to 0) on one of the SE effects. Having Immunity for POLICE here would combine +2 and -4 (set to 0) modifiers to effective +2 POLICE rating for the faction.

IMPUNITY for Free Market here would provide the same effect for POLICE and also ignore the negative modifiers --PLANET, -INDUSTRY.

> In general the AI in Smac is too aggressive for its own good.

Yeah adjusting that is a planned feature for the diplomacy mod if I'll ever get around to implementing it. I think in general it would help the AIs a lot if they could delay the aggression for the first, say, 100 turns and concentrate on infrastructure building instead.

One of the reasons Gaians tend to be so strong in this mod is that they concentrate first on getting the economy boosting techs and building infrastructure while often neglecting Conquer techs in the beginning. If they survive the first 100 turns in relative isolation, soon the massive edge in economic development will show and they will tend to overtake the other factions.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on June 11, 2020, 08:37:24 PM
Yeah, Thinker always decides where to build the new bases. Even though I reduced the tendency to build the sea bases on coastal squares, it's still kinda prevalent. Or did you have something else in mind?

Why though? Land squares seem like a good complement in mineral yield for shelf bases.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on June 12, 2020, 01:32:45 AM
It is the year 2227. Level 6 techs are becoming available for research. Two AIs have gotten their hands on Air Power; but will they be able to hold off my hordes of 5-1-1 infantry and 7r-1-1 rovers? (Probably not :V)

Lavender has been evicted from the mainland to join the shamed ranks of sea exiles. It seems that losing one's entire army and being down to 5 sea bases is not seen as a good reason to surrender. In hindsight, maybe it would've been better to take her peace deal: I've no idea what to do with her bases now, and I could've used the commerce income.

> Whoa, watch out here. Police State in the example utilizes TALENT modifier which unimplemented in the valuation metric. In this case the penalty would not be visible and social_ai thinks Police State has only positive variables. It's kind of an oversight because none of the vanilla choices utilize that variable.

Yes, I remember, we've talked about this before. :P My contention is that even if PS did indeed have no penalty here, it would still be a sub-optimal choice.

> I'm not sure the way you worded it here is accurate. Immunity provides the ability to ignore negative values (they get set to 0) on one of the SE effects. Having Immunity for POLICE here would combine +2 and -4 (set to 0) modifiers to effective +2 POLICE rating for the faction.

That's not how I've seen it working in-game. You can see here that the result of combining PS+FM is a net of 0 POLICE - and if the POLICE rating was in fact being increased, you would see more drones being suppressed here.

(click to show/hide)

You can test this in the vanilla game by playing as the Hive and running Police State + Green. They will end up with a net of 0 EFFIC, rather than +2. It's the final SE rating that gets clamped to 0, not the individual choices.

Impunity does work in the way you described: the penalties for the specified SE choice simply aren't applied to the faction.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on June 12, 2020, 04:33:59 AM
Yeah, Thinker always decides where to build the new bases. Even though I reduced the tendency to build the sea bases on coastal squares, it's still kinda prevalent. Or did you have something else in mind?

There just appears to me a distinct and aggressive seabase expansion phase that happens after the AI decides to stop expanding by land. I can't tell if I'm imagining it or if it's deliberate. Factions that are doing well (bases near the size cap, have their vendettas under control, haven't had to deal with me trashing all their stuff) seem to do this.

Quote
Yeah adjusting that is a planned feature for the diplomacy mod if I'll ever get around to implementing it. I think in general it would help the AIs a lot if they could delay the aggression for the first, say, 100 turns and concentrate on infrastructure building instead.

One of the reasons Gaians tend to be so strong in this mod is that they concentrate first on getting the economy boosting techs and building infrastructure while often neglecting Conquer techs in the beginning. If they survive the first 100 turns in relative isolation, soon the massive edge in economic development will show and they will tend to overtake the other factions.

Mellowing out would help the Spartans a lot! They can be a real pain when they get the chance to build up a large body of crack troops. I wish the AI understood that they should build a coalition against a runaway superpower and be generally wary of the human player, too. I like how the top two factions hate each other to keep each other in check, but sometimes it's not even close.
Title: Re: SMACX Thinker Mod
Post by: Induktio on June 14, 2020, 11:59:12 AM
> There just appears to me a distinct and aggressive seabase expansion phase that happens after the AI decides to stop expanding by land.

Sure, there is some very specific code that deals with the choices regarding colony pod production. It is mostly decided in select_colony > has_base_sites functions. After many iterations I settled on that logic, so that it actually counts the available sea/land tiles and does some decision making based on it.

> That's not how I've seen it working in-game. You can see here that the result of combining PS+FM is a net of 0 POLICE - and if the POLICE rating was in fact being increased, you would see more drones being suppressed here.

Oh well, should not rely on those vague descriptions in Faction.txt and instead just look at the binary instead. So apparently there's two variables ROBUST and IMMUNITY that operate only the final SE effect value.

Quote
;   ROBUST      = Halves the intensity of minus effects in the named
;                 social area ("ROBUST, EFFIC" halves minus efficiency
;                 effects in social model).
;   IMMUNITY    = Immunity from minus effects in the named social
;                 area. ("IMMUNITY, ENERGY" prevents minus energy
;                 effects in social model).

The way it's worded here seems incorrect because "social models" are clearly one of the 16 individual choices in the documentation, not the final result that gets calculated for the 11 different effects values. It has to be noted that ROBUST is currently unimplemented in social_ai. I'm not sure if there was some reports on it being bugged in the engine.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on June 14, 2020, 12:20:43 PM
I can confirm that ROBUST does work in-game. No comment on whether it appears to affect AI decision-making.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on July 01, 2020, 07:46:21 AM
So a very amusing and niche situation arose in the PBEM game I'm currently playing, and while it's not strictly related to Thinker Mod, I feel like it might be of interest to you anyway.

When trading with pact partners, it is possible to sell techs to AIs for credits in excess of what they actually have. This causes them to go into negative credits, which causes facilities to explode to make up the deficit. It is possible for a faction to lose their Headquarters this way - and currently, the new auto-relocate-HQ mechanic introduced by Thinker 2.0 does not rebuild it. Thus the AIs will end up spending the game without a HQ.

While this situation is the result of an exploit, I feel like it still merits addressing.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 02, 2020, 06:02:56 PM
> It is possible for a faction to lose their Headquarters this way - and currently, the new auto-relocate-HQ mechanic introduced by Thinker 2.0 does not rebuild it. Thus the AIs will end up spending the game without a HQ.

Ah, the hunt for The One More Bug That Got Overlooked(tm) intensifies... In all seriousness, the auto-relocate only applies when the base in question is destroyed/captured. In this case, whenever the AI loses any other base, for any reason, auto-relocate checks for HQ again, but it may take a while.

Do you mean that the HQs may explode because of the generic situation of having energy reserve shortfall or is it directly related to diplomacy? I would rather patch that logic in the way that HQs are never destroyed because of energy shortfall, but not sure yet how easy it is to implement.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on July 03, 2020, 01:01:06 AM
> In this case, whenever the AI loses any other base, for any reason, auto-relocate checks for HQ again, but it may take a while.

Yes, Spartans eventually got a new HQ at some point, presumably they lost a base to worms or something and the auto-relocate triggered.

> Do you mean that the HQs may explode because of the generic situation of having energy reserve shortfall or is it directly related to diplomacy?

From testing in the scenario editor, I believe HQs explode just like other facilities whenever there is an energy shortfall. However, because HQs have a maintenance cost of zero (and are first in the list of that base's facilities?), they will never be destroyed under normal circumstances, as other facilities which actually do cost maintenance will be destroyed first. The situation of a HQ exploding only arises if the faction has a negative credit balance, which is only achievable through exploits such as making the AI overpay for techs.
Title: Re: SMACX Thinker Mod
Post by: Fibonacci on July 03, 2020, 09:07:35 AM
I've seen this too, not only the Headquarters, but free base facilities, such as the hive's perimeter defenses will be consumed if the AI faction begins a turn with a negative credit balance. Just tell them you're in urgent need of energy credits, offer them your tech for whatever amount they offer, and at least in the early game they'll probably have fewer than 25 energy and the game puts them in the negative until the following turn.
Title: Re: SMACX Thinker Mod
Post by: Nevill on July 05, 2020, 10:00:40 PM
I don't suppose this can be fixed in the diplomacy logic by putting a check on that? They do have a line where they say they don't have enough credits to spare.

This can be observed most often with Pact partners, although that may be because they are most inclined to trade.

Anyway, I wonder if this should go to WTP thread or here, since I am playing WTP but the AI behavior is taken from your mod, I believe?

AIs build an army and they sit on it without doing anything. Tayta can probably tell you best since he is the one that got affected most, but I've observed this situation as Pact Brother to both his PeaceKeepers and Spartans who waged war on him. Santiago had a lot of units which could wipe him three times over, but was content to send only occasional artillery to harass his terraforming. It got to the point where he became complacent and very surprised when she finally decided to invade... three decades later. I am not sure what changed... Tayta didn't have military either way.

Do you need the saves?

Another instance of questionable decisions by AI is having extremely weak units on defense duty. Zakharov is sitting in the jungles on powerhorse bases that produce up to 20 minerals with the help of crawlers (and those are WTP minerals and crawlers, so his bases are one of the best equipped in the game), yet all of his wealth is defended by single 1-2+-1 ECM troopers. He can build better ones, and he has the money to upgrade them... he just doesn't.

It is consistent with vanilla behavior, but it still irks me. A faction can be a tech and production leader, and even have the best military in the game on paper, but still crumple to dust in a matter of couple turns because all of that military is... elsewhere.

It is possible for AI to cripple its minerals supply by producing too many units, and it is something I see Believers currently doing, so I wonder if there can be a middle ground.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 08, 2020, 02:02:19 PM
> Santiago had a lot of units which could wipe him three times over, but was content to send only occasional artillery to harass his terraforming.

I think it would help looking at the saves here. It's like you're saying the behaviour in this case was not quite normal from the AIs. But I haven't decided anything about the next release.

Probably the most complex part of AI programming here is the unit movement, particularly in combat. There's just so many different strategies to consider each turn for each unit. Vanilla AI uses Goal structs to keep track of various AI objectives. These have been reversed and that's important because they would probably have to be integrated in any improvement for the combat movement AI.

If I were to rewrite this part, maybe the first thing to consider would be the allocation of units to offense/defense duty. AI could maybe rank bases on how threatened they are and assign more units to vulnerable border bases. Then the other part would be to come up with a better way of selecting priority attack targets, so that the other units don't just "sit" in the bases.

> Zakharov is sitting in the jungles on powerhorse bases that produce up to 20 minerals with the help of crawlers (and those are WTP minerals and crawlers, so his bases are one of the best equipped in the game)

Now this is something that very well could be affected by the WTP mod. It does change a lot of cost variables not to mention the AI code, so I'm not going to comment here unless this also happens in vanilla Thinker. If you come up with some kind of an improvement there, it could be merged in a pull request of course. Keep in mind upgrading units is not currently implemented for the AIs. Now that could be possible, but there's potential problems if the units in the field get upgraded mid-turn to something much more advanced, players would consider that strange.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on July 12, 2020, 02:04:30 AM
Does the AI know how to disband units?
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 12, 2020, 11:12:59 PM
> Does the AI know how to disband units?

I don't think it ever does that other than forced disband due to mineral shortfall.
Title: Re: SMACX Thinker Mod
Post by: temporicide on July 25, 2020, 02:30:13 AM
Hello!

I am new here, registered to report what seems to be a bug. I accidentally found out that AI factions have formers (perhaps other units as well?) that require no support because they have other factions' cities set as their home bases. I know this is supposed to be an old issue, but I think it only happened when the player set home base for a unit to be a base of a pact brother/sister. I only have the Thinker and the GUI mods installed and the GOG version of SMAX. I checked some of my old saves (no mods) and found no evidence of this bug.

Also, I would like to ask for advice regarding customized map generation. I like to play with 30-50% ocean and my problem is, I am tired with playing weak erosion maps and having to terraform-level all those rocks. If I change erosion to strong I get only about 30% land instead of the promised 50-70%. Is there a way to change that, perhaps by editing the alphax.txt?

Thank you for the mod!  :)
Title: Re: SMACX Thinker Mod
Post by: dino on July 25, 2020, 06:31:59 AM
Not only they are support free, but also despite not showing on the support list, they take away free support, or minerals, from the pact base, very annoying if it happens to you during early game.

This bug was fixed in Ytzii's patch, I remember since I've reported it to him, unfortunately Ytzii is not around to give easy pointers.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on July 25, 2020, 01:53:39 PM
I have corrected the reassignment condition in WTP.
Originally it reassigned to bases with mineral_surplus < 2. WTP patch reverses the condition so units are assigned to bases with enough minerals.

Other than than I didn't bother. This involves formers only and exclude human factions from reassignment. So no harm to human player.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 25, 2020, 02:47:08 PM
> I have corrected the reassignment condition in WTP.

So how did you correct, e.g. which commits deal with that issue? Do you think you can create a pull request out of those changes?

> If I change erosion to strong I get only about 30% land instead of the promised 50-70%. Is there a way to change that, perhaps by editing the alphax.txt?

When erosion is set to highest amount (least hilly), the amount of land is vastly reduced. This is a feature of the default terrain generation algorithm, and while I attempted to do some mitigations on it, this behaviour cannot be eliminated by alphax.txt editing alone.

Now it would be pretty interesting to rewrite the whole terrain generation process but it's not that fun trying to integrate that code into the game binary without glitches. Procedural content generation with fractal noise could achieve some impressive results in theory. Maybe a simpler way to mod it would be to influence how the terrain height is determined. Currently this project is on a kind of a hiatus but we'll see later when I'll get back to it.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on July 25, 2020, 03:34:37 PM
> I have corrected the reassignment condition in WTP.

So how did you correct, e.g. which commits deal with that issue? Do you think you can create a pull request out of those changes?

de0d4e807759830e8967c81b6af16a337ef9f304

How do I create PR to another repo?

Keep in mind that I didn't disable functionality completely. Just corrected the condition that seemed like an error. The functionality itself may help AI with support so I left it there.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on July 25, 2020, 06:30:09 PM

Also, I would like to ask for advice regarding customized map generation. I like to play with 30-50% ocean and my problem is, I am tired with playing weak erosion maps and having to terraform-level all those rocks. If I change erosion to strong I get only about 30% land instead of the promised 50-70%. Is there a way to change that, perhaps by editing the alphax.txt?

Thank you for the mod!  :)


Rather than go mad trying to figure out the world builder settings, I would just change the level terrain job to take 1 turn and play on the settings that work for you.
Title: Re: SMACX Thinker Mod
Post by: temporicide on July 26, 2020, 07:43:19 PM
Currently this project is on a kind of a hiatus but we'll see later when I'll get back to it.
Cool!

Rather than go mad trying to figure out the world builder settings, I would just change the level terrain job to take 1 turn and play on the settings that work for you.
Yes, that would solve that particular problem. But there are other problems with mountainous maps. They usually consist of large areas of rainy tiles  and large areas of arid ones. Flat terrain is more even.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on July 27, 2020, 02:51:59 AM
Yes, that would solve that particular problem. But there are other problems with mountainous maps. They usually consist of large areas of rainy tiles  and large areas of arid ones. Flat terrain is more even.


Lower the hill and peak values in alphax until you're satisfied.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on July 27, 2020, 06:49:12 AM
I think there is a bug with free formers. Progenitors and Planet Cult don't get them.
Title: Re: SMACX Thinker Mod
Post by: temporicide on July 28, 2020, 07:51:00 PM
Lower the hill and peak values in alphax until you're satisfied.

Yes, that worked. Thank you.
Title: Re: SMACX Thinker Mod
Post by: MercantileInterest on July 29, 2020, 06:09:53 PM
May be good to bring this up here as well:

When playing multiplayer some time ago (before your mod), my group noticed that transports and isles of the deep have a very high chance of fishing alien artifacts out of sea pods. Irritating little bug.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on September 17, 2020, 05:41:26 PM
Got a feature request idea while poking around the morale function: Any chance you can expose these turn thresholds for native lifecycle increases in thinker.ini?

https://github.com/b-casey/OpenSMACX/blob/master/src/veh.cpp#L113

It would be really cool to be able to tweak those since they don't seem to scale to difficulty or anything.
Title: Re: SMACX Thinker Mod
Post by: MisterPachanga on October 31, 2020, 12:52:15 AM
I am using the thinker mod v2.0 with PRACX v1.11 and can't automate the base governors.
Once a building is completed, they want to keep building the same thing.

What am I doing wrong?
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 31, 2020, 11:52:58 AM
Alrighty, I decided to get back with this development. There's a couple of things that could be added in or fixed from the previous release.

> I think there is a bug with free formers. Progenitors and Planet Cult don't get them.

This is probably caused by the fact they spawn a couple of turns late. Free units only get assigned on turn 1 in this implementation.

> Got a feature request idea while poking around the morale function: Any chance you can expose these turn thresholds for native lifecycle increases in thinker.ini?

> my group noticed that transports and isles of the deep have a very high chance of fishing alien artifacts out of sea pods. Irritating little bug.

Do you know if anything has been implemented about these on WTP?

I'm also considering if there's any bugfixes to import from WTP mod. I probably won't import any large game mechanics changes as usual to keep the scope of this project smaller. But smaller bugfix style improvements are certainly welcome. What would be the most important ones here?

> I am using the thinker mod v2.0 with PRACX v1.11 and can't automate the base governors.

Don't remember any bug reports about these. Are there any differences to the vanilla binary here?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on October 31, 2020, 12:44:56 PM
Alrighty, I decided to get back with this development. There's a couple of things that could be added in or fixed from the previous release.

> I think there is a bug with free formers. Progenitors and Planet Cult don't get them.

This is probably caused by the fact they spawn a couple of turns late. Free units only get assigned on turn 1 in this implementation.

If interested I've hooked this on setup_faction function instead of relying on turn count. This solved it for later appearing factions.

> Got a feature request idea while poking around the morale function: Any chance you can expose these turn thresholds for native lifecycle increases in thinker.ini?

> my group noticed that transports and isles of the deep have a very high chance of fishing alien artifacts out of sea pods. Irritating little bug.

Do you know if anything has been implemented about these on WTP?


Nope.

Title: Re: SMACX Thinker Mod
Post by: MisterPachanga on November 02, 2020, 07:18:53 AM


> I am using the thinker mod v2.0 with PRACX v1.11 and can't automate the base governors.

Don't remember any bug reports about these. Are there any differences to the vanilla binary here?

I am playing with the GOG Planetary Pack.
No changes to any file. Only when I am playing with the terranx_mod is when I see this behavior. The base governor works fine on unmodded SMAC and SMACX.

Sure I am doing something wrong, I just don't know what it is
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 02, 2020, 02:34:27 PM
Can anyone build up a reproducible test case with the save?
Induktio is back in business (as he mentioned on Riot) so he may look into it.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 03, 2020, 08:07:02 PM
Well, obviously I'm reading this thread too.

> No changes to any file. Only when I am playing with the terranx_mod is when I see this behavior. The base governor works fine on unmodded SMAC and SMACX.

It could be possible it's related to some fix in Scient's patch. Generally Thinker should just skip player-owned bases and not affect their behaviour. You could just try using build queues as a workaround in the meantime.
Title: Re: SMACX Thinker Mod
Post by: Marty651 on November 05, 2020, 02:08:34 PM
It could be possible it's related to some fix in Scient's patch. Generally Thinker should just skip player-owned bases and not affect their behaviour. You could just try using build queues as a workaround in the meantime.
Hi Induktio,
I can confirm this issue. You mean a reason could be a fix you added to Scient's patch? Because this doesn't happen with Scient V2.1.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 05, 2020, 10:31:35 PM
This mod just imports Scient's patch with no modifications.

Based on some testing it appears one of Thinker's functions interferes with governors on player-owned bases. Looks like this one is pretty simple to fix unless I missed something. Almost nobody seems to use governors since this wasn't reported before.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 08, 2020, 08:04:50 PM
Good news, v2.1 is now available from project website (https://github.com/induktio/thinker).

One of the most long awaited features is some kind of balance in combat between different reactors. I implemented a new patch called ignore_reactor_power for this purpose. It's still considered experimental but I encourage players to enable it. Many other minor fixes were also included in this release. Here's the rest of the changelog:

(click to show/hide)
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 09, 2020, 04:55:18 PM
Due to an apparent oversight, it looks like revised_tech_cost is not working in v2.1. It just defaults to the vanilla cost mechanics. This will be fixed in the next release. Other than that, haven't seen any big issues with the latest version though.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on November 18, 2020, 01:02:19 PM
Hell yeah, going to have to play again.
Title: Re: SMACX Thinker Mod
Post by: Marty651 on November 18, 2020, 02:19:03 PM
Hell yeah, going to have to play again.
Definitely! Especially since Induktio released V2.2 three days ago!
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 20, 2020, 10:21:20 PM
Hell yeah, going to have to play again.

Sure, tell us how the game went also. ;)

And another note... there were some features (like diplomacy changes) that I considered for this update, but those ultimately didn't make the final cut. I'm not sure if those would make a sufficient impact to be necessary for inclusion in the game.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on November 21, 2020, 06:03:27 PM
Speaking of diplomacy changes: I wonder if, and I haven't though this out at all, it would help the AIs if non-aquatic factions that lost all of their land bases would become heavily inclined to submit to their enemies. It would be much better for the victorious AI to not have to follow up a decisive victory on land with sea base whack a mole that can last a century. They could instead benefit from the commerce income and get to move on to their next enemy.


I'm actually not even sure if AIs sign submission pacts with each other.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 22, 2020, 02:40:37 PM
Well, I don't remember AIs ever signing pacts of surrender amongst themselves.

Anyway, I found a simple way to implement the cpu usage fix (config option cpu_idle_fix) on the mod. It should now significantly reduce cpu cycles while the game is idling. It's available for preview in develop build 20201122 (https://github.com/induktio/thinker).

Another small change in the build: factions with negative SE RESEARCH value will now start to accumulate labs from the first turn.
Title: Re: SMACX Thinker Mod
Post by: Casworon on December 05, 2020, 11:19:48 AM
Hey hey

I'm having some trouble with instillation and i'm not quite sure what i'm doing wrong.

I have Alpha Centauri planetary pack off GOG and I've extracted the files too my game directory

However i don't seem to have a 'terranx_mod.exe' only a 'terranx.exe' and when running it and checking Ctrl+F4 i dont see the mod version/build date in the game version menu. Just Version: 2.0 Date: December 1999
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 05, 2020, 08:03:10 PM
> I'm having some trouble with instillation and i'm not quite sure what i'm doing wrong.

You probably downloaded the develop build? It's okay since it has the cpu usage fix added. I don't include the exe file with every develop build since it doesn't change between releases. All of the changes are done with dll code. You can just use terranx_mod.exe from the previous release for all the develop builds. :)
Title: Re: SMACX Thinker Mod
Post by: Casworon on December 06, 2020, 05:08:04 PM
No idea what i've downloaded tbh, i dont have any experience with GitHub  ;lol

I saw on the right there are 8 releases, going all the way from v2.2 too v0.6. But again i cant seem to find a terranx_mod.exe in any of the releases.

I keep reading about compiling GitHub. Do i need to do any compiling of what i download or do i literally just unzip it into my game folder?

lol i'm sure theres something really obvious i'm just not seeing
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 06, 2020, 11:38:59 PM
Hmm, did you really just download the source packages? :)

Under the header called Download, you'll see the dropbox link (https://www.dropbox.com/sh/qsps5bhz8v020o9/AAAp6ioWxdo7vnG6Ity5W3o1a?dl=0&lst=) for releases. You most likely don't want to do any compiling.
Title: Re: SMACX Thinker Mod
Post by: Casworon on December 07, 2020, 05:14:46 AM
Yes i did just download the source code  ;lol oooops

Thanks for the link! I can see the terranx-mod.exe!!

Now time to immerse myself in some Alpha Centauri

Many thanks again
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 10, 2020, 08:40:31 PM
I now uploaded develop build 20201210 to the downloads page, there's some interesting changes coming for the next release.

* Smooth scrolling support imported from PRACX.
* CPU idle loop patched to significantly reduce usage.
* More resolution config options available in thinker.ini.
* Alt+T shortcut displays new statistics about units, bases and production amounts.
* Game engine now has a new crash handler that writes information to debug.txt if the game crashes for any reason, no matter which module caused it.
* AI will now attempt to plan much longer land bridge routes to other continents. This is maybe the first significant instance of long term planning that persist in the save games for Thinker.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 20, 2020, 10:54:24 PM
Good news for today... now we have develop build 20201220 available from downloads. See the changelog (https://github.com/induktio/thinker/blob/master/Changelog.md) for all the stuff pending for next release.

By far the biggest change has been updating Thinker to manage all of the combat units. This was a very tall order because of the complexity of this game.

Another entirely new addition is the capability for AI to conduct naval invasions over long distances. If the AI calculates the closest enemy is located on another continent, then naval invasions and ships are heavily prioritized. If you try to hide behind a large ocean, think again, the AI *will* come to get you. :)

Based on some testing, this stuff appears to mostly work but there might a few hiccups. Stuff that might need improvement:
* AI doesn't use drop pods ability at all
* Scouting or making contact with other factions might take a long time on huge maps
* Zones of control are very problematic for AI movement (game design issue too)
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on December 21, 2020, 12:08:33 AM
Very interesting changes. I've been kept occupied with multiplayer lately, but these changes definitely sound worth a look.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 21, 2020, 12:14:04 AM
Amazing AI work, man! Long anticipated. 😁

I didn't get it, though. Have you already released it or planning to? There are mixed signals.
Also do you have any readme where your changes described in more details with algorithms and examples, etc.?

I understand there are probably a lot of small changes in AI combat movement here and there so it is impossible to cover them all. Still it would be pretty interesting to learn them if you can describe as much as you can besides what is listed in Next Release changelog. Thank you.

Quote
AI garrisoning priorities are rewritten to move defending units to bases that are the most threatened.

Nice. I can retire my code on that!

Quote
Combat ships will now engage other targets with artillery much more often instead of always defaulting to normal direct attack.

Is it for ship-ship combat? Is it governed by enemy weapon-armor strength: direct attack against weaker armor and bombardment against weaker weapon?

Quote
All artillery units will use new targeting logic to place them in more useful positions and prioritize threats more accurately.

Would be nice to know more details on algorithm.

Quote
New option: clean_minerals sets the amount of minerals a base can produce before experiencing eco damage.
Fix engine bug where selecting bombardment on an empty square sometimes resulted in the attacking unit being destroyed.
Fix very rare issue where a faction might get eliminated even when they had active colony pods.

Are these same or similar changes as in WTP?
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 21, 2020, 12:44:04 PM
Those changes listed are already part of the develop build. Nothing ambigious about it.

> Are these same or similar changes as in WTP?

I think the implementation in that aspect is mostly similar to WTP.

> I understand there are probably a lot of small changes in AI combat movement here and there so it is impossible to cover them all.

Yeah there's lots of ideas I came up with while updating the AI here. More like it's a question of how much willing I would be to write a separate blog post about it when they're already in the code. I noticed that the vanilla AI stores all sorts of weird planning variables in the save game but basically all of them can be computed on the fly while the AI is doing its turn and not having to save them anywhere.

I think many game designers (even Soren Johnson) have stated getting the AI to do naval invasions is tricky because it requires coordination from so many units. I think that was a problem in many if not at all of the Civ games. Well, here it is then...

The pathfinding still has some search limits so might need to tweak it for Huge maps or larger. Actually I don't recommend playing on maps larger than Huge. And the AI might have to wait for longer so it has a bigger fleet available to launch one bigger landing, not many smaller ones.

And probably something else that might be found in testing. It's interesting to think about how Thinker plays the game for the most part without making any distinction if the opposing faction is human or AI. Currently none of the movement code makes any decisions based on that. So it doesn't garrison human borders more or make any distinction in that when choosing attack targets.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 21, 2020, 01:11:32 PM
Those changes listed are already part of the develop build. Nothing ambigious about it.

Not for you. However, I was confused seeing "Next Release" as release number. Is it installable? Is it finalized? Can I pull changes from it to my code already?

It's interesting to think about how Thinker plays the game for the most part without making any distinction if the opposing faction is human or AI. Currently none of the movement code makes any decisions based on that. So it doesn't garrison human borders more or make any distinction in that when choosing attack targets.

Why not? Human is definitely a better tactician than computer. Why shouldn't AI account for that and strengthen human borders more? It is already given enormous advantage against human everywhere in the game. At least placing more defenders on human border is not a cheat at they honestly produced and maintained.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 22, 2020, 12:10:45 PM
Would be more useful to think about what can be contributed here. I'm not sure what kind of code you wrote that deals with garrisoning priorities.

> Why shouldn't AI account for that and strengthen human borders more? It is already given enormous advantage against human everywhere in the game.

Does that mean we should implement some kind of "AIs team up against human player" mechanic. In the AI personality screen, there's already an option with that name but Thinker doesn't consider that option at the moment. It's not selectable in random map generator, so I think a more fitting option here would be "intense rivalry".

Actually it seems a good idea to add a few more twists on that game mode. Previously players said intense rivalry was not really meaningful as it made AIs irrationally aggressive. Did anybody play multiple games with it for comparison? It has some effects on diplomacy but this combat AI would be entirely separate from it.
Title: Re: SMACX Thinker Mod
Post by: dino on December 24, 2020, 09:49:00 AM
Mechanics changes is not a thinker focus, but I'd still love to at least have these changes added:

1) Adjustable repair rates ( implemented in WTP ): 10% per turn, 20% with Command Center, Nano Factory instead of completely healing in a single turn.

Helps AI with wearing down human defences with disorganised units stream, makes snowballing through AI with a small force impossible, because of necessary breaks for repairs.

2) Impact of reactor on unit cost, to keep the original cost formula I'd make a simple change:

There is 1/ (2*2^(n-1)) ( n reactor level ) component in the original cost formula, change it to 1/ (2*x^(n-1)) where x is adjustable in the ini.
With x=1,33 for example, each reactor level would give 25% unit cost discount, which is what I'd go for.
If you wanted to keep it simple for an average user, you could even just have a simple on/off for 25% discount instead of vanilla 50%.

Late game units are waaaay too cheap, lots of unnecessary micro with swarms of units and running into a unit limit issue.
This change would make R4 level units over 3x times more expensive, which would improve late game a lot imo.
Even without HP combat bonus, reactor techs double military production output with a single tech upgrade, 25% discount would put them more in line with other mil tech upgrades.

3) Monopole Magnets double roads speed instead of infinite moves ( implemented in WTP ).

Combined with 20% healing, it would be safe to let AI build them: less risk of snowballing, but a chance to retake lost bases before enemy can repair invading forces.

***
And a few ideas for AI improvements:

1) Unit Upgrades.

There is a huge AI vulnerability in an early midgame where most AI units are outdated if they didn't fought any wars. At the very least I'd give keeping half of units up to date a priority over facilities hurries and the same condition that makes threatened base switch production to military, should also trigger additional unit upgrades in a threatened base. In a peace time disbanding the most outdated units if the unit support takes too huge percentage of minerals, could be considered instead of upgrades.

2) Minimum military standing:

Since the early midgame, lets say after turn 50 at least 30% + ai_fight*10% should be consumed by military units, no matter how low the threat level is.
Or base it on the number of techs known, minimum military standing should increase from 30% in early midgame, to 60% at the end game.
You can also take a peak at WTP code regarding threat and military spending, a more naunced solution than simple rule I came up with above can be derived from it.

You can't make AI predict the time and angle of attack, but you can overcome some unnecessary unit support with cost_factor.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 24, 2020, 12:37:34 PM
I recently did some AI testing on Veteran's map (https://alphacentauri2.info/index.php?action=downloads;sa=view;down=24) . This is a multiplayer only focused map with a very heavy emphasis on naval invasion. I think it's also maybe the hardest map type for AI for this very same reason...

I placed there two identical Peacekeepers factions on opposite ends of the map locked in an eternal vendetta, LOL. One of them was Thinker running an updated combat AI and the other one was vanilla combat AI with Thinker. This exposed some flaws in the new AI but nevertheless, it managed to coordinate multiple transports to land an invasion force on the opposite end of the map. That kind of invasion doesn't work without air superiority however, and the old combat AI doesn't understand how to move the air units over that long of a distance. Anyways... this is probably the worst case for AI performance given the layout for the map. With continents spaced closer it would play out a lot differently I guess.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 24, 2020, 12:55:14 PM
> Mechanics changes is not a thinker focus, but I'd still love to at least have these changes added:

Some of these ideas seem quite useful. I would favor any patches over others where players don't suddenly get a feeling they're playing an entirely different game. But there's already so much stuff for new release I'm not sure if I'll try to jam pack any bigger changes in there though.

> 1) Adjustable repair rates

Yeah, healing in bases is maybe too fast.

> 2) Impact of reactor on unit cost

Could maybe make ignore_reactor_power=1 default in new release. Definitely non-vanilla but it's glaringly obvious vanilla was too OP.

> 3) Monopole Magnets double roads speed

Infinite movement is obviously OP for human playes too, when they can just plant some forests on the border and always rush defenders where they're needed. That's why vanilla tech tree is right to make magtubes only a late game tech.

> 1) Unit Upgrades.

Actually the AI could be made to upgrade its units in the inter-turn planning phase while it also has so many extra credits to spare. Does not require game mechanics changes per se.
Title: Re: SMACX Thinker Mod
Post by: dino on December 24, 2020, 01:35:28 PM
AI making competent long distance invasions is awesome, should add another missing dimmension to the game.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on December 24, 2020, 05:05:18 PM
You can also take a peak at WTP code regarding threat and military spending, a more naunced solution than simple rule I came up with above can be derived from it.

Unfortunately, this is still in development stage.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 24, 2020, 06:21:51 PM
I started a new test game on the same map with two Peacekeeper factions with identical resources. This time I just made the other one vanilla AI with no modifications, but I thought it would be fitting to give them the Firaxian faction graphics set. I also found a simple AI modification which enables Thinker to send aircraft towards an invasion point, which might be very important. Here's a screenshot from turn 170 (https://www.dropbox.com/s/7ato2342465d6gm/naval_invasion.png?dl=0).

It's played with tech stagnation on and Thinker took a really long time to discover some key techs. At the beginning it sent aggressively sea colony pods forward (new behaviour) to establish foothold in the middle but funnily enough, it couldn't defend most of them against vanilla AI probe team spam. Things changed after Thinker started to churn out Fusion Chaos Battleships in mass and quickly proceeded to sink the Firaxian navy. In the screenshot most of the forces are gathering towards an invasion point on the mainland enemy region. It has not been attacked yet, because skirmishes happened in the middle of the map.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 24, 2020, 10:13:45 PM
I did add these changes to the newest develop build 20201224 (https://github.com/induktio/thinker). Testing this kind of AI and then dealing with legacy code seems to be really developer time intensive.

The air units are now able to move really long distances to the invasion area but there seems to be something really flawed with vanilla airpower AI or it just doesn't attack nearby targets enough, even when it has a stack of units available. I may have to develop some kind of a fix for it too. But there's other new features:

* New option: rare_supply_pods will reduce the frequency of supply pods to around one third of previous levels and instead places bonus resources on random maps. This option is a lesser version of "no unity scattering".
* Changed territory_border_fix to increase the expansion of coastal base territory into ocean to an equal amount of actual sea bases.
* AI will occasionally use Drop Pods ability to deploy troops to other bases.
* Foil probe teams will now also attack coastal bases instead of only sea bases like previously.
Title: Re: SMACX Thinker Mod
Post by: Rocky on January 06, 2021, 06:44:58 PM
I just want to say thank you for all your hard work on this AI. I've been slowly getting back into SMACX and I'm really enjoying it with your AI mod. I especially like the customization and smoother tech progression. I was surprised to see the Gaians make use of fungus when terraforming. It really adds to the flavor.


Title: Re: SMACX Thinker Mod
Post by: Rocky on January 07, 2021, 04:51:28 PM
There were two things I noticed in my current game.

- The Hive has been eliminated by another faction but still can be contacted in the comm menu. (No Headquarters/no council votes)

- The Gaians and Morganites have terraformed most of their terrain into fungus. The Morganites switched from Green to Free Market and are now having tiles they're not using due to the resource penalty.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 08, 2021, 03:37:51 PM
> The Hive has been eliminated by another faction but still can be contacted in the comm menu. (No Headquarters/no council votes)

Did you actually get the popup that says a faction has been eliminated? Otherwise they might have a colony pod alive somewhere that prevents faction removal. Might need to look at the save.

> The Gaians and Morganites have terraformed most of their terrain into fungus.

That happens by design if fungus is more productive than forest tiles. What resource penalty are you referring to here?

Anyways... there are some areas that are somewhat unfinished in the new AI code. I might look into some game mechanics changes for these issues.

* Collateral damage rules are very destructive for the AIs. It is also very complex to plan the movement in such a way that the AI units won't end its turn next to enemy units and get obliterated due to collateral damage. It's especially noteworthy Civ 3 disabled stack damage altogether.
* Zones of control also cause issues in movement planning.
* Pathfinding needs some tweaking to recognize and avoid neutral territory when selecting attack paths.
* New pathfinding also needs some tweaking to work better on Huge or larger map sizes.
Title: Re: SMACX Thinker Mod
Post by: Rocky on January 08, 2021, 06:20:18 PM

Did you actually get the popup that says a faction has been eliminated? Otherwise they might have a colony pod alive somewhere that prevents faction removal. Might need to look at the save.

Stupid of me. I thought I made a save but I seem to have overwritten it. I then tried from an earlier save and ran different games under different scenarios but I was not able to recreate the problem. (Or find a colony pod from the Hive) Each time the Hive was eliminated a popup appeared as it should.

In summary:

1. Hive lost its capital. The only remaining Hive city "Manufacturing Warrens" became the new capital.
2. This last base was conquered by the Pirates next turn but the Hive was not eliminated.
3. A few turns later the University takes over Manufacturing Warrens from the Pirates. A pop-up appears that the Hive has been eliminated by the University.

EDIT: I did some more testing but I can't recreate it. Either it was just a one time bug or (more likely) I have overlooked a base or colony pod.

Quote
That happens by design if fungus is more productive than forest tiles. What resource penalty are you referring to here?

Under Green/Cybernetic fungus gave the Morganites 2 nutrient/1 mineral/2 energy. (Gaians got 3 nutrient instead of 2 due to their faction bonus)

Under Free Market/Cybernetic the Morganites get 1 nutrient/1 energy. They running lots of transcendi specialists and avoid using fungus tiles (unless necessary) but it hurts their production.
 
Title: Re: SMACX Thinker Mod
Post by: Rocky on January 14, 2021, 12:49:44 AM
After playing a few more games over the week the issues in my previous post never appeared again. Deirdre was the only one who consistently uses fungus and it works for her.

I'm very impressed with how the AI builds up its military. In one game I build up/upgraded an army of around 50 AAA Shard Shock Troops, 12 Shard Tanks, and around 20 AAA Shard Cruisers. I was planning to take on the Morganites (nearest neighbor) because he was running away with the game. (It turns out he had 3x times the technology income I had) I was shocked to find out he had double the amount of military units. Dozens of Elite Quantum Tanks, Elite Drop Quantum Shock Troops, Elite Quantum Rovers, a dozen Elite Shard Penetrators and around 12-15 Shard (Quantum) Battleships.

I was really glad I first infiltrated his Datalinks. I was so used with Vanilla AI to invade without much thought but I can't make that mistake with Thinker. If I had declared war it would have been very bad for me.

The Pirates are monsters in every game I played. They expand incredibly fast, and consistently colonize a nearby continent early on. This usually makes them the largest empire in a game. They were never a frontrunner in tech but they definitely were the undisputed rulers of the sea. In my last game they had at least 30-40 Fusion Cruisers/Shard Battleships and around two dozen Shard Choppers/Penetrators.

The Gaians are also impressive. They usually have relatively small empires but are almost always a techleader for a majority of the game.
 
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 14, 2021, 06:38:18 PM
It has to be noted, the last update mainly changed the unit movement. I didn't make many changes to production choices with some exceptions. V2.3 increased the priority given to faster land/sea units because I noticed the AI built way too few rovers in some test cases. AI should also build foil probe teams earlier and more often. That should help with scouting because one play tester reported, in the earlier versions, the AI took really long time to make contact with other factions.

Speaking of test games, I think the AI should now be an adequate opponent on Veteran's map. Combined land/sea operations are very hard for the AI but I think Thinker is getting there. It might be very interesting to setup some kind of a multiplayer style "always war" scenario on that map. In test games it took Thinker about 230 turns to completely conquer vanilla AI on the other side of the map, so there we have it. Tactically the AI might still make many errors that cost numerous units though.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on January 14, 2021, 06:52:07 PM
I'd be grateful -and this is aimed at all the other modders, too- if the mod, and future major updates, could be uploaded to our Downloads section, too.  AC2 benefits from hosting content, you can crosslink with GitHub -please!- it makes the mod easier for random SMACers on the net to find, AND it's something I can promote on Facebook and at CFC and other places.

You also get an autopost in the Chiron News Network subforum when you post to Downloads, which promotes your mod on our Front Page.

Everybody wins, thank you. :)
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 14, 2021, 09:26:42 PM
Definitely, man. I'd be glad to. Can you provide step by step instruction how to upload GitHub project there? This is not a single file and version changes all the time. So may be somewhat tricky.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on January 14, 2021, 09:51:23 PM
I believe Windows will generate a .zip folder of multiple files for you.  There's a lot of easy options for making .zips around.  Then go to this page http://alphacentauri2.info/index.php?action=downloads;cat=6 scroll down and find the Add a download button and upload the .zip - it's pretty intuitive.  Good idea to put some advance work into your description text, and if you have any images, even just a logo, to include, that would look better on the Front Page and be excellent for branding purposes and my own and other promotion of the mod.

-I'd be glad to make a dedicated category for whole game mods, or whatever you guys want to call it, or more than one to separate .txt and .exe - if y'all want such a thing.

[Note: our Downloads does suck for huge files, for reasons way above my tech grade to do anything about, but I can sometimes workaround by directly uploading to the server.  Work with me and I'll work with you.  Thanks.]
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 14, 2021, 10:06:12 PM
Oh. ZIP I can upload. In fact all of my releases are ZIPs. I just thought maybe you have some magical way to reference GitHub so I don't need to upload **every** release! 😁

Actually, never mind. I see that it accepts file OR URL. So I just pointed to my release page.

Can you correct the name of my download and remove parentheses from title? I didn't notice you have a base game field already.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 14, 2021, 10:34:09 PM
One flaw that I see with the current setup is that Dropbox doesn't show any download counters whatsoever. And neither does Github for the attached files. That would be an interesting stat to collect.

But unfortunately I don't see it as a viable choice to start hosting every file on this site. There's the question of maintainability and simplicity to consider. Maybe somebody wants to create a backup archive of them and it's okay, but there's not much point to promote multiple download sources to users. Newest changes are visible in the repo and it's not a given I would announce releases separately on the forums even though most of the time I did so.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on January 14, 2021, 11:27:30 PM
Oh. ZIP I can upload. In fact all of my releases are ZIPs. I just thought maybe you have some magical way to reference GitHub so I don't need to upload **every** release! 😁

Actually, never mind. I see that it accepts file OR URL. So I just pointed to my release page.

Can you correct the name of my download and remove parentheses from title? I didn't notice you have a base game field already.
I'll go have a look.

But yeah, no; I never even been to GitHub, and I'm no tech wiz.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on January 14, 2021, 11:34:43 PM
I removed (smacx mod) entirely - you can edit the CNN post yourself, to control what's displaying on the Front Page.
Title: Re: SMACX Thinker Mod
Post by: Rocky on January 15, 2021, 01:06:27 AM
It has to be noted, the last update mainly changed the unit movement. I didn't make many changes to production choices with some exceptions. V2.3 increased the priority given to faster land/sea units because I noticed the AI built way too few rovers in some test cases. AI should also build foil probe teams earlier and more often. That should help with scouting because one play tester reported, in the earlier versions, the AI took really long time to make contact with other factions.

Speaking of test games, I think the AI should now be an adequate opponent on Veteran's map. Combined land/sea operations are very hard for the AI but I think Thinker is getting there. It might be very interesting to setup some kind of a multiplayer style "always war" scenario on that map. In test games it took Thinker about 230 turns to completely conquer vanilla AI on the other side of the map, so there we have it. Tactically the AI might still make many errors that cost numerous units though.

I'm using 2.3 and I noticed how the Ai had no problems finding me. I often encounter early Foils and Transport ships. The AI also has a preference for fast units like you said. The ocean is swarming with Battle/Probe Cruisers, and Tanks/Rovers are the most numerous units on land. The AI is also crazy good in blitzing an opponent.

In my last game the Believers had around 25 bases on one continent. I think the Pirates captured most of them within 10 turns, with the University coming in from behind and getting the remaining few in 2-3 turns. Poor Miriam had one city left on the ocean, but a couple of Pirate ships were moving towards it. The Morganites made a landbridge to the island of the Gaians, and then invaded with around 25 Tachyon/Shard Tanks, taking all of their core cities.

It really adds to the immersion seeing factions actually trying to conquer each other with a large army.

I'm happy to hear about the land/sea combined invasions. Sounds awesome. Are you planning to introduce this for the next version?

Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 15, 2021, 05:26:28 PM
Oh. ZIP I can upload. In fact all of my releases are ZIPs. I just thought maybe you have some magical way to reference GitHub so I don't need to upload **every** release! 😁

Actually, never mind. I see that it accepts file OR URL. So I just pointed to my release page.

Can you correct the name of my download and remove parentheses from title? I didn't notice you have a base game field already.
I'll go have a look.

But yeah, no; I never even been to GitHub, and I'm no tech wiz.

You don't need to. It is a simple page with downloadable zip version links. Try to go by "Download" link in my mod that I have recently created and you'll see.

I am just asking if you can correct the title of the download **post** in download section that you advertised. Strangely, I cannot edit it even then I am an author.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on January 15, 2021, 05:32:58 PM
I'll go have another look - I thought I got that.

[edit to spare Induktio that much derail.]  I did get that, in Downloads.  You might want to get that on the ChironNN post, which is what's showing on the Front Page.  I assumed you'd rather have your name on the edit notice than mine, and thread- starters can edit their titles here.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 16, 2021, 03:03:15 AM
> I'm happy to hear about the land/sea combined invasions. Sounds awesome. Are you planning to introduce this for the next version?

Bro, it's already included in v2.3. :D

What I'm saying is that it might still need some further tweaks even though the basics are there. You might want to try tech stagnation also if the AI gets to advanced techs too fast.

I wanted to implement some real naval invasions for the AI and that wouldn't have been possible without rewriting unit movement almost entirely. Now it also has separate logic for planning the invasion route, e.g. stack up point on mainland base -> sea transport -> beach landing zone. Only one such route is active at one time and the AI also tries to use combat ships to cover the transports on the route.

For all units the AI is broken into big picture strategic thinking (where should this unit move?) and smaller scale tactical decision making (which unit to attack on the nearby tiles, if any). For air units the rebasing logic also works differently, it shouldn't move massive stacks of air units around with no reason anymore. Rebasing is sometimes bad when it wastes the turn. Though I have to note currently it doesn't handle Copters very well, so it's advised to disable that chassis anyway.
Title: Re: SMACX Thinker Mod
Post by: Rocky on January 21, 2021, 07:51:17 PM
Thanks for the detailed reply. I appreciate it. I've noticed Thinker does coastal invasions pretty well. I've seen several cases where the AI takes coastal bases and manages to keep them.

I'm playing my current game with slow tech. It took a while for me to get used to it but now in the second half it has really opened up the game. With normal tech once Thinker (Often Morganites) got Secrets of Alpha Centauri they rushed through the remaining techs but now there's much more time to enjoy all the new toys. Tech trading and research choices also feel more meaningful.

Do the settings in the scenario editor (Like research priorities or AI behavior) have an effect on Thinker AI or does it only work with Vanilla AI?
Title: Re: SMACX Thinker Mod
Post by: Rocky on January 24, 2021, 06:01:29 PM
Apologies for the double post but I wanted to add a few things I've noticed while playing. You're likely aware of them but I wanted to mention them just in case.

- I'm not sure if Thinker AI affects diplomacy between AI's but the AI's seem too aggressive in the sense that they don't want to make peace with each other. I've had several large-scale confrontations between powerful factions that became a stalemate with frontlines that barely changed. Some of these wars lasted over 150 years or never stopped. In some cases when the AI did make peace they declared war against each other within a few turns or sometimes even during the same turn.

Some of these wars work well when one of the AI's conquers the other in just a few decades, but in other cases they both spend the majority of their resources on building armies and their infrastructure suffers from it. They're still doing a good job keeping up in tech but the extended wars do feel like a detriment to them in the long run.

- The AI seems reluctant to build Habitation Domes. I noticed that even when bases are stable and have lots of food (Or the Cloning Vats) the AI doesn't give high priority to them. They get built eventually but it can take years before the AI gets to it.

- From what I've seen the AI doesn't build Planet Busters or Conventional Missiles.

- I haven't seen the AI build Flechette Defense Systems/Tachyon Fields/Geosynschronous Survey Pods. Although that may depend on certain conditions. It definitely does build Orbital Defense Pods.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on January 24, 2021, 06:08:09 PM
We just don't worry about multi-posting at all here.  Edits suck as a workaround.  Post moar when you have another thing to say, thanks.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 24, 2021, 08:14:58 PM
> Apologies for the double post but I wanted to add a few things I've noticed while playing. You're likely aware of them but I wanted to mention them just in case.

You might have to post a save game about some of this stuff. I don't know what other conditions or settings you might have affecting the game state in those instances.

> I'm not sure if Thinker AI affects diplomacy between AI's but the AI's seem too aggressive in the sense that they don't want to make peace with each other.

Currently it doesn't affect diplomacy directly. Those features are not implemented. Note: did the factions have antithetical ideologies? Then they might get stuck in long wars.

> From what I've seen the AI doesn't build Planet Busters or Conventional Missiles.

I haven't noticed problems in this regard. Did you repeal UN charter for the planet busters? Otherwise only aggressive AIs might build them.

> I've noticed Thinker does coastal invasions pretty well.

Did you happen to collect any screenshots about the invasions? ;)

> Do the settings in the scenario editor (Like research priorities or AI behavior) have an effect on Thinker AI or does it only work with Vanilla AI?

Research focus affects the AI behaviour a lot. They are referenced in code as AI_fight, AI_growth, AI_tech etc variables. Too numerous to start listing here. AI strategy choices in scenario editor like "Build lots of xyz" are ignored.
Title: Re: SMACX Thinker Mod
Post by: MercantileInterest on January 26, 2021, 05:35:39 AM
If you suffer the global warming warning and then vote to raise solar shade, does the shade combine the two values.

i.e. if GW threatened to raise sea levels 200m and the shade will lower sea levels 300m, will the final level be -100m lower than previously?
Title: Re: SMACX Thinker Mod
Post by: MercantileInterest on January 26, 2021, 09:04:48 PM
Another thought: anonymous probe teams.

If a probe isn't yours, you have no way of telling whose it is. As such, you're free to attack or expel at will. In addition, if enemy probe attacks one of yours, the game won't inform you which faction attacked.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on January 26, 2021, 09:11:45 PM
At will.  I like the heck out of that notion.  Intuitive for the story and illusion-sustaining.
Title: Re: SMACX Thinker Mod
Post by: Rocky on February 01, 2021, 09:31:34 PM
The AI is building Cruiser Probe Teams in landlocked cities.  It doesn't do it that often but it doesn't seem to make a distinction between land and sea cities. (version 2.3)
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 02, 2021, 08:01:29 PM
> If you suffer the global warming warning and then vote to raise solar shade, does the shade combine the two values.

I can't really remember, it's been some time since I looked at that code. Maybe Scient might know it.

> In addition, if enemy probe attacks one of yours, the game won't inform you which faction attacked.

It's possible that requires some major patching on the UI code, so not sure about that.

> The AI is building Cruiser Probe Teams in landlocked cities.

That's really strange. Is there any chance the land altitude around the base was changed after building that unit?
Title: Re: SMACX Thinker Mod
Post by: Rocky on February 02, 2021, 09:58:01 PM

> The AI is building Cruiser Probe Teams in landlocked cities.

That's really strange. Is there any chance the land altitude around the base was changed after building that unit?

I checked the save from the beginning. There were no changes in altitude. Around 4 land bases from the Pirates built these probe cruisers. I checked later saves and no further probe cruisers were built inside land cities. None of the other AI's did this so maybe it's a one-time thing. I'll try to keep an eye on it in future games. (I'll include the Pirates to see if they repeat it)

By the way, would Thinker be affected if I disabled some of the chassis in alphax.txt for my next game? (For example Choppers or Sky bases) Would Thinker use other units instead?
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 07, 2021, 02:30:09 PM
> I checked the save from the beginning. There were no changes in altitude. Around 4 land bases from the Pirates built these probe cruisers.

Another player sent me a savegame showing a similar issue and this bug has been identified. With some settings combinations, prototypes created by design_units feature can become corrupted in the savegame. This issue should be fixed in develop build 20210301 available from downloads (https://github.com/induktio/thinker/). When you open an old save in the patched version, the game just prunes the inccorrect prototypes and recreates some of them. After that, don't reload the save in an unpatched Thinker version because the bug might reappear.

> By the way, would Thinker be affected if I disabled some of the chassis in alphax.txt for my next game? (For example Choppers or Sky bases) Would Thinker use other units instead?

Disabling Choppers is actually recommended, Thinker just selects other types of chassis that are available.
Title: Re: SMACX Thinker Mod
Post by: Drinniol on March 08, 2021, 07:52:34 PM
Just made an account to say that this is a great mod!  Really amps up the game and is actually quite difficult on transcend if you use the standard 7 on the cost_factor.

I actually like helicopters, they are a great defensive unit but harder to use offensively.  They force your opponent to crawl in with defensive AAA units but they aren't unbeatable.  The big problem is that they should probably be more expensive and also should straight up die if they run out of fuel instead of just losing some HP.  If their default moves was 8 they'd probably be fine.   

Speaking of cost_factor, do you have any intention to further break that up?  Right now cost_factor affects minerals, nutrients, and tech together, but I'd kind of like to be able to control them separately. 

Also, on planetpearls, is it possible to have planetpearls on default native life and fungal towers but not on the eco/story triggered forced spawns?  I think the planetpearls are a fine reward for exploring early on and for actually clearing fungal towers out, but when you get thousands of free credits on eco pops turning what is supposed to be a nuisance into a huge payday that's a bit degenerate.  I've also never understood why you only get them offensively. 

Also, I notice that even with collateral_damage on 0, one successful attack kills a full 10 stack of forced pop mindworms.  Is there any way to change this?  Again, it makes those lategame eco spawns too easy to deal with when one empath song rover or tank can deal with like 30 mind worms in one turn. 
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 09, 2021, 01:56:15 AM
That could be bug in AI production selection. As far as I remember it is impossible to manually select sea unit without adjacent sea.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 10, 2021, 07:33:25 PM
Okay, just uploaded the new develop build 20210310. Changes in this update:

* Combat target selection logic for AI has been updated to take into account more factors.
* When using aircraft, AI tries to prioritize enemies that are close to friendly units.
* AI tries to avoid wasting Choppers because of fuel exhaustion.
* Config options for social_ai have been expanded.
* Added new config options for unit repair rates (9 options in total). This is the exact same implementation than in Will To Power. It's not yet tested for all possible cases but found no issues so far.

Bonus content: this might be a good soundtrack (https://www.youtube.com/watch?v=-dwmf-wx8VQ) for this mod. :)

> Speaking of cost_factor, do you have any intention to further break that up?

Hmm, dunno about that. Is that necessarily important?

> Also, I notice that even with collateral_damage on 0, one successful attack kills a full 10 stack of forced pop mindworms.

That behaviour also applies to probe team stacks. When one unit loses, the whole stack is destroyed. It's surely one of the weak spots for the AI because it tends to stack so many units in one square. I've been thinking of changing that for balance reasons.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 10, 2021, 08:27:39 PM
Awesome, man. The work is going on.

Bonus content: this might be a good soundtrack (https://www.youtube.com/watch?v=-dwmf-wx8VQ) for this mod. :)

That is one awesome soundtrack. Definitely make it a default! It seems that there are few similar but slightly distinct recording on this theme on youtube.
😎

> Also, I notice that even with collateral_damage on 0, one successful attack kills a full 10 stack of forced pop mindworms.

That behaviour also applies to probe team stacks. When one unit loses, the whole stack is destroyed. It's surely one of the weak spots for the AI because it tends to stack so many units in one square. I've been thinking of changing that for balance reasons.

That is inbuilt feature for probes and native worms. I don't think faction worms can be destroyed all at once.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 10, 2021, 10:04:59 PM
Or how about this song also (https://www.youtube.com/watch?v=FN3CR56xVas&t=338s). It could be titled "Thinker gathering naval invasion forces". Just too bad about the copyrights. :D
Title: Re: SMACX Thinker Mod
Post by: Rocky on March 10, 2021, 11:32:38 PM
How do I install the new develop build? I think I did something wrong because I'm getting an error that there's an unknown configuration option in Thinker.ini.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 11, 2021, 03:17:04 PM
> I think I did something wrong because I'm getting an error that there's an unknown configuration option in Thinker.ini.

Did you extract and replace using the files from the zip?
Title: Re: SMACX Thinker Mod
Post by: Rocky on March 11, 2021, 04:40:06 PM
> Did you extract and replace using the files from the zip?

I opened the zip and extracted all files into the Alpha Centauri folder and let it overwrite existing files.

After this I got the message, although as far as I can tell the Ai still works perfectly.

I also put the new thinker.ini from the zip file in the Alpha Centauri directory but I got the same message.



Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 11, 2021, 05:01:34 PM
You better paste message screenshot here. It may have an indication on specific line where the problem occurred. Although it may be not obvious at first glance.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 11, 2021, 05:04:31 PM
Using the opportunity I like to thank you, Induktio, for working in combat AI enhancement. That was the most time consuming task for me at a time and I never seriously dived into it. With your efforts, I feel I may never need to.
😁
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 11, 2021, 05:09:40 PM
> I also put the new thinker.ini from the zip file in the Alpha Centauri directory but I got the same message.

Well, I'm pretty sure thinker.ini bundled with 20210310 is the correct one for this dll version. Note the latest release date was *10 not *01.

So there's two chances now: a) thinker.ini loaded by the game is something else, b) thinker.dll is some other version. But this warning is useful for just this kind of issue. Either one of these files can be mismatched, so it's good the engine gives a warning about it.

> That was the most time consuming task for me at a time and I never seriously dived into it.

If you have examples of how this new AI performs in real world scenarios, feel free to post them. But yeah, this part of the codebase basically doubled the size of movement code...
Title: Re: SMACX Thinker Mod
Post by: Rocky on March 11, 2021, 05:24:45 PM
> Well, I'm pretty sure thinker.ini bundled with 20210310 is the correct one for this dll version. Note the latest release date was *10 not *01.

So there's two chances now: a) thinker.ini loaded by the game is something else, b) thinker.dll is some other version. But this warning is useful for just this kind of issue. Either one of these files can be mismatched, so it's good the engine gives a warning about it.


Thinker.dll in my directory is from 20210102? Is this the wrong version? All the files in the zip were from 20210310. (thinker-master)

The error message was "Unknown configuration option detected in thinker.ini. Game might not work as intended."
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 11, 2021, 05:28:35 PM
Rocky, do a clean install first when you face unresolvable problems. Download the game from GOG and apply mod on top of it.
Title: Re: SMACX Thinker Mod
Post by: Rocky on March 11, 2021, 05:32:48 PM
Rocky, do a clean install first when you face unresolvable problems. Download the game from GOG and apply mod on top of it.


I made a backup of a clean install beforehand. I'm going to try it from there.
Title: Re: SMACX Thinker Mod
Post by: Rocky on March 11, 2021, 06:28:10 PM
I've re-installed Alpha Centauri from GOG five times.

Extracted Thinker 2.3 binary files in AC directory. Game works. Version 2.3 in-game.

Extracted contents of thinker-master source.zip into AC directory. Game works.

Replaced thinker.ini with thinker.ini from "docs" map from thinker-master zip. Error message. Game still works.

Title: Re: SMACX Thinker Mod
Post by: Induktio on March 11, 2021, 09:50:22 PM
I suppose could create a new release soon enough because people just keep downloading the older stuff. Develop builds are located in this folder (https://www.dropbox.com/sh/qsps5bhz8v020o9/AADv-0D0-bPq22pgoAIcDRC3a/develop?dl=0&lst=l).

One may ask why have this dual versioning system. Develop versions are so called "nightly" builds that in some projects could be updated each day for whatever new changes are implemented. It's faster to do testing that way and then only update the docs when bundling the changes in a new release.
Title: Re: SMACX Thinker Mod
Post by: Rocky on March 12, 2021, 04:37:13 PM
Thanks for the link. I just downloaded the latest build and copied it into the directory.

The error message is gone. My apologies for the trouble.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 14, 2021, 10:12:34 PM
Version 2.4 is now available. See the changelog here. (https://github.com/induktio/thinker/blob/master/Changelog.md) There's some important bug fixes since last release.

Might have to still tweak the movement AI code, but it remains to be seen how notable these changes in the latest release are for players. There's one small undocumented feature also: if Intense Rivalry is selected, AI tries to prioritize attacking player factions. It works independent of the vanilla AI changes related to that option, but this implementation could maybe later be redefined to make it a more comprehensive extra difficulty option.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 28, 2021, 08:13:44 PM
Great work on combat AI. I would like to merge it to my mod but don't want to do it while you are still in the middle of the work.
How close is this to completion?
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 31, 2021, 03:41:00 PM
When is OpenRCT considered ready? When is OpenRA done? It's a silly question. Things don't work like that in open source game projects.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 01, 2021, 08:02:33 PM
Looking at your colony movement code

in colony_move
Code: [Select]
            debug("colony_move %d %d -> %d %d | %d %d | %d\n", veh->x, veh->y, tx, ty, faction, id, tscore);
            adjust_value(pm_former, tx, ty, 1, 1);


I understand pm_former is used to reduce formers converging on a single spot. Why do you want to discourage them working around the potential base placement site?

later on
in can_build_base
Code: [Select]
    if (!sq || y < 3 || y >= *map_axis_y-3 || (~sq->landmarks & LM_JUNGLE && [b]pm_former[x][y] > 0[/b]))
        return false;

The +1 that you previously set around target base placement site prevents colony to build base there when it reaches it in the same turn when its path was set in colony_move function. I have tested it and confirm that at least sea colony that moves fast exhibits this behavior. It reaches first desired spot and don't build colony there. Instead it continues on next journey.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 01, 2021, 11:21:00 PM
Yeah that is a fair point. One of the problems arises from pm_former being used for multiple purposes. Actually I was testing some tweaks there because that functionality will get partially rewritten. There's been some problems in ensuring that all the AI units will follow some particular orders and not lose them in the middle of the path.

And for some reason this site is loading awfully sloooowly...
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 03, 2021, 02:19:30 AM
Suggested change.

Code: [Select]
int mineral_cost(int faction, int prod) {
    if (prod >= 0) {
        return Units[prod].cost * cost_factor(faction, 1, -1);
    } else {
        return Facility[-prod].cost * cost_factor(faction, 1, -1);
    }

to more precise

Code: [Select]
/*
Calculates mineral cost for given faction, production item, and possibly base.
If base is not negative then its cost modifying facilities are taken into account: Skunkworks and Brood Pits.
*/
int mineral_cost(int baseId, int itemId)
{
BASE *base = &(tx_bases[baseId]);

return (itemId >= 0 ? tx_veh_cost(itemId, baseId, 0) : tx_facility[-itemId].cost) * tx_cost_factor(base->faction_id, 1, -1);

}
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 04, 2021, 12:47:36 AM
Do I understand correctly that this parameter restricts computer from building more satellites?
max_satellites=10

Does it make it too powerful otherwise? Is it possible to disable this limit?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 04, 2021, 12:51:30 AM
expansion_factor=100

Does it limit number of computer player bases? If so, 25 seems like a small number for normal map.
Overall it seems like a special artificial restriction to limit computer players expansion. Why is this needed? Are they going to become too powerful otherwise?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 04, 2021, 01:55:03 AM
Sorry. You copied this description from me and I put it wrong.

Code: [Select]
; Remove AQUATIC faction bonus minerals from sea mining platforms.

This actually disables AQUATIC +1 minerals bonus to each tile regardless of improvements.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 04, 2021, 03:29:24 AM
Checking your 2.4 ignore_reactor_power setting.

It correctly conducts combat. All units fight as if they have fission reactor. When a unit incurs 10 damage it is destroyed. So the 10 last unit HP are actually counts.

It doesn't work in other areas. Examples below

The display does not reflect this. Unit health bar is still computed with actual reactor.
Create singular scout and set its damage to 10. You'll see its health bar reduced by 1/4. If you fight any other unit it will be destroyed immediately as having max damage already.

The healing does not take this into account as well. Singular unit heals 4 point at a time as in vanilla while fission one heals 1. So from your modified combat perspective singular unit heals 4 times faster. At the same time unit outside of the base can heal only up to 80% which means 32 for singular. So in your combat version it actually gets 2 HP only.


I would suggest to revert to my type of fix which doesn't introduce any brand new logic but hijack the existing psi combat logic instead. In psi combat reactor is ignored by increasing firepower of attacker proportionally to defender reactor power. I.e. unit with high reactor looses their HP proportionally faster. This was heavily tested and seems to work perfectly fine.
Title: Re: SMACX Thinker Mod
Post by: dino on April 04, 2021, 07:35:51 AM
> max_satellites

I guess Inductio didn't wrote any logic determining how many satellites AI should build and set an adjustable hard limit instead.
I'd propose a dynamic limit as an average of 10 ( or 5 ) biggest bases size.

> ignore_reactor_power

Great catch, the implementation should be definitely changed to the one multiplying firepower by defender reactor.

> expansion_factor

It's a result of some people ( mostly bvanevery ) complaining about infinite base spam and also a way to prevent large map games from running into bases and units limits.
I play only standard size maps and just set it very high.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 04, 2021, 01:05:09 PM
I pushed some more refactoring changes to the repo. There's even more fixes coming to pathfinding but it's still in the testing phase. By the way, try not to paste code that is from obsolete version of Thinker. Variable naming in source code is subject to any changes at any time. It's not part of the user interface, so to say.

> I would suggest to revert to my type of fix which doesn't introduce any brand new logic but hijack the existing psi combat logic instead.

Can you be more specific here, which patch locations are strictly necessary to make your implementation work? I recall you had a lot more binary patching that involved writing new code segments on the binary, not just changing a couple of pointers. I would try to avoid that kind of patching because in the future some functions might get totally rewritten. Patching new code segments is just the worst option for maintainability.

Did you find any other bugs than those mentioned? If so, the healing could possibly be fixed from repair_phase function. That's one of the functions that could be rewritten in source code format. For example, see mod_bonus_at/mod_goody_at. In that case we can have both the original results or new features based on the config flags applied.

> Does it limit number of computer player bases? If so, 25 seems like a small number for normal map.

New version will have expansion_autoscale feature for this reason. It's already part of the pushed changes.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 04, 2021, 03:27:36 PM
By the way, try not to paste code that is from obsolete version of Thinker. Variable naming in source code is subject to any changes at any time. It's not part of the user interface, so to say.

I am trying to get them from your master branch on GitHub. Is it up to date?

> I would suggest to revert to my type of fix which doesn't introduce any brand new logic but hijack the existing psi combat logic instead.

Can you be more specific here, which patch locations are strictly necessary to make your implementation work? I recall you had a lot more binary patching that involved writing new code segments on the binary, not just changing a couple of pointers. I would try to avoid that kind of patching because in the future some functions might get totally rewritten. Patching new code segments is just the worst option for maintainability.

In my latest code check patch_ignore_reactor_power_in_combat_processing() function. Currently it patches 2 byte jumps in 4 places. Seems to be a minimal change possible. Don't remember if it was bigger than that before.

I agree with your view on patching and try to minimize impact on original code. Doesn't work every time, though. Let me know if you see some fragments in my code those can be rewritten more nicely.

Did you find any other bugs than those mentioned? If so, the healing could possibly be fixed from repair_phase function. That's one of the functions that could be rewritten in source code format. For example, see mod_bonus_at/mod_goody_at. In that case we can have both the original results or new features based on the config flags applied.

I am posting issues in your repo whenever I find anything like that.

Healing is not broken per se. It works as before. I just pointed out that if you want to actually reduce all unit HP to 10 you need to fix it everywhere else (like display and healing) and this is hell of a lot of places some of which we don't even know about. Would be a complete nightmare and a challenge to finish this work in lifetime.

> Does it limit number of computer player bases? If so, 25 seems like a small number for normal map.

New version will have expansion_autoscale feature for this reason. It's already part of the pushed changes.

Yea. I saw that. Still think this is very artificial and strange way to do things. Should be, at least off, by default.
Are you trying to satisfy some players in helping them to cripple AI? Beside of being a pretty strange way to do that it is absolutely contrary to your mod purpose. Is it not?
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 04, 2021, 03:53:38 PM
I don't have any other branches than master there, so yes, it's most recent public version.

> In my latest code check patch_ignore_reactor_power_in_combat_processing() function. Currently it patches 2 byte jumps in 4 places. Seems to be a minimal change possible. Don't remember if it was bigger than that before.

Yeah I have not had the time to look through all of those changes. Almost thought it required something more complicated than that. That's certainly a really simple implementation and could be imported. However, how do the odds look like in the confirmation dialog? Do they reflect the real odds as it is calculated by the vanilla formula? Are there any other side effects with this patch?

> Beside of being a pretty strange way to do that it is absolutely contrary to your mod purpose. Is it not?

Hmm. I don't think on the default settings it cripples the AI at all. If you set expansion_factor way below 100 then the AI expansion would become very limited but that is not case by default.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 04, 2021, 05:51:24 PM
> In my latest code check patch_ignore_reactor_power_in_combat_processing() function. Currently it patches 2 byte jumps in 4 places. Seems to be a minimal change possible. Don't remember if it was bigger than that before.

Yeah I have not had the time to look through all of those changes. Almost thought it required something more complicated than that. That's certainly a really simple implementation and could be imported. However, how do the odds look like in the confirmation dialog? Do they reflect the real odds as it is calculated by the vanilla formula? Are there any other side effects with this patch?

Odds display is a different story. Currently it patches a huge piece of code with custom computation added. This is because they are drastically different than in vanilla, though. First it computes winning odds, not round odds. Second, it converts ratio odds to percentage. You can settle for simple change if you feel it is too much for your mod. In any case vanilla odds are computed incorrectly. So they have to be fixed one way or another.

> Beside of being a pretty strange way to do that it is absolutely contrary to your mod purpose. Is it not?

Hmm. I don't think on the default settings it cripples the AI at all. If you set expansion_factor way below 100 then the AI expansion would become very limited but that is not case by default.

True. That is why I think you should make it optional. Many people don't bother reading through each and every configuration option. Your mod should not cripple AI by default. Even a little. Even potentially. This is pretty not intuitive/expected limit.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 04, 2021, 09:49:15 PM
> Odds display is a different story. Currently it patches a huge piece of code with custom computation added.

Well, uhh. That's a problem. I would consider incorrect odds display huge breaking change for the UI. It would result in many frustrating outcomes and many weird dialog boxes. But we can post more on that stuff on the github issues.

Anyway, I just uploaded develop build 20210404 and the rest of pathfinding tweaks. These changes allow the AI to spread the units to more tiles to avoid collateral damage, understand how to use or avoid chokepoint tiles that are occupied by a base, e.g. canals between two areas. Also AI satellite production is now automatically adjusted based on population counts and new config option player_free_units is added.

I was doing some 1vs1 test games on Veterans map and it really looks like Thinker AI now pounds the default AI into sand. It's as if there's some kind of natural flow into how the AI allocates troops to the front line and coordinates invasions. Remember on this map Thinker can launch a coordinated naval invasion into another continent over 40 tiles away.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 05, 2021, 12:29:20 AM
Combat changes sound amazing. I like to check them out. I am currently working on production tuning. Hope to get synergy on this
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 05, 2021, 03:40:29 PM
This could be better coordinated if you offered some kind of code to merge and then we could review the changes but you have not done so. There's still many ways that the coding style in WTP could be improved. I wouldn't want to merge redundant looking code if there's no clear reason for doing it. Just look at the code in smac-cpu-fix compared to the actual changes that were required to implement it in Thinker to get an idea of how much less code it was.

Actually I'm going to flat out say I don't recommend you to work on AI production planning if you don't want to merge the changes. That's one of the areas that is really core functionality of Thinker and I might implement some changes there anyway. Not really decided though. It's maybe best to open dissussions on github if you have changes in mind for some areas of this AI functionality.

> ; Remove AQUATIC faction bonus minerals from sea mining platforms.
> This actually disables AQUATIC +1 minerals bonus to each tile regardless of improvements.

Good catch, so in that case it sounds even more OP. Have to change that description.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 05, 2021, 06:07:25 PM
This could be better coordinated if you offered some kind of code to merge and then we could review the changes but you have not done so. There's still many ways that the coding style in WTP could be improved. I wouldn't want to merge redundant looking code if there's no clear reason for doing it. Just look at the code in smac-cpu-fix compared to the actual changes that were required to implement it in Thinker to get an idea of how much less code it was.

Actually I'm going to flat out say I don't recommend you to work on AI production planning if you don't want to merge the changes. That's one of the areas that is really core functionality of Thinker and I might implement some changes there anyway. Not really decided though. It's maybe best to open dissussions on github if you have changes in mind for some areas of this AI functionality.

I meant it is good that you are doing this so less stuff for me after merge. The backward merge is up to you, of course. Not insisting on that.

Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 07, 2021, 07:37:48 PM
Did you teach transports to move combat units across the water to where they are needed most?
Title: Re: SMACX Thinker Mod
Post by: dino on April 13, 2021, 08:40:11 AM
Recent exchange with AC Bear in the other thread about feasibility of disabling native stacks wipes after killing a single unit made me think about late game Eco Damage fungal popups armageddon.
Preventing late game suicide by Planet, should be a worthy goal, since reaching the end game before dominating the Planet and huge mineral output of AIs are now possible with thinker AI.

OK then, lets think what we should equip AI with to deal with eco damage:

(20 bases) * 3 (TF + HF + CP ) + 16 + 20 ( First pops are pretty mild ) = ~70 minerals before it become really problematic spiral of destruction.
There are two things that can rapidly shoot mineral output way above this treshold: satellites and +50% minerals facilities.

The second question is how many popups AI can manage: few super formers can rebuild any tile improvements in few turns and units can be repaired and reinforced also in few turns.
I'd say 10-20% Eco Damage should be manageable in the early game, since rapidly growing clean minerals will solve the issue by itself.
Late game 5-10% should be manageable if each base will be equipped with few Super Formers.

1) Check before building +50% facility, if building it would shoot Eco Damage above this treshold.
2) Sell +50% facility if Eco Damage is above 25%, or 15% late game.
3) Check if any of the 10 biggest bases is above the treshold before building a mining satellite.
4) Late game build Hybrid Forests and Centauri Preserves when available.
5) Keep at least one Super Former, or two Formers + 1 SF, or 2 F for each 5% of Eco damage.
6) Check if forces in a base are suffcient to deal with an estimated popup spawn size, if not move nearby forces there, or sell 50% facility.

Add thinker.ini adjustable multiplier for whatever late game ecodamage tresholds you hardcode.
So the player can adjust AIs balance between mineral output and probability of suicide by Planet / Global Warming speed.
Early game Eco Damage should be kept at 10-20% until certain amount of clean minerals is generated and popup spawns become dangerous.

If it's too much work, a simple cheat solution could be implemented: an adjustable Eco damage cap for AIs bases.

Title: Re: SMACX Thinker Mod
Post by: Induktio on April 13, 2021, 12:29:32 PM
Version 2.5 is out now, some new GUI improvements this time.

(https://i.redd.it/6tvyw9maols61.png)

> OK then, lets think what we should equip AI with to deal with eco damage

Also as a general rule, I'm not really keen on introducing mechanics that complicate the game further for the AI. Remember we also have eco_damage_fix which enables Tree Farms to start decreasing eco damage earlier than before.

I'd say the only thing that really interests me on those changes is to add additional checks before building mineral multiplier facilities. Base production code should get still some more changes.

Other thing that could be implemented as an option is to eliminate most of the prototyping costs. Maybe only keep significant costs for planet buster prototypes because they're like a secret project, but for other units, I don't see how it adds much to the game. We already have steep cost increases with revised_tech_cost so you can't just rush to some particular weapon techs before developing the economy a little bit. Maybe you can test those kind of changes with WTP first because it mods the other mechanics so much also..
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 13, 2021, 03:58:24 PM
1) Check before building +50% facility, if building it would shoot Eco Damage above this treshold.
2) Sell +50% facility if Eco Damage is above 25%, or 15% late game.
3) Check if any of the 10 biggest bases is above the treshold before building a mining satellite.
4) Late game build Hybrid Forests and Centauri Preserves when available.
5) Keep at least one Super Former, or two Formers + 1 SF, or 2 F for each 5% of Eco damage.
6) Check if forces in a base are suffcient to deal with an estimated popup spawn size, if not move nearby forces there, or sell 50% facility.

Good suggestions. Worth embedding into production selection routine.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 13, 2021, 04:13:49 PM
Version 2.5 is out now, some new GUI improvements this time.

How do you invoke this dialog???

Other thing that could be implemented as an option is to eliminate most of the prototyping costs. Maybe only keep significant costs for planet buster prototypes because they're like a secret project, but for other units, I don't see how it adds much to the game. We already have steep cost increases with revised_tech_cost so you can't just rush to some particular weapon techs before developing the economy a little bit. Maybe you can test those kind of changes with WTP first because it mods the other mechanics so much also..

Not sure how prototyping cost relates to eco damage. Is it just a separate topic?

Anyway, prototyping cost is a new thing introduced in SMAC that wasn't in previous Civ versions. The idea is to put both research power and production power check on producing new unit component. Technology is pretty easy to steal but prototyping cost will still be there unless one also steals the advanced unit. It seems pretty logical entry barrier that does not let military to be upgraded very quickly. Even upgrading units to not prototyped design cost enormous amount of money. There are special facilities removing prototyping cost. There are special faction traits nullifying prototyping cost. This all seems to be a very integral part of the game and is pretty well tied together by game designers. I don't see major flaws in it.
 
Talking about prototyping cost it does not feel that excessive either. 50% for a single first unit in exchange to extra morale supposing player will produce at least 10-20 of them especially in late game? Come on. It is not that big of investment. If anything, I'd say it is too low for entry barrier. That's why WTP raises it to 100%. Which is noticeable but not that much either.

Removing it would also hurt Spartans those don't have anything else besides rolling out modern units slightly earlier than others.
😢
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 13, 2021, 05:31:13 PM
> How do you invoke this dialog???

Literally the first line in changelog, ALT+T shortcut. :)

> Not sure how prototyping cost relates to eco damage. Is it just a separate topic?

It's a separate topic but it ties to the same idea which is implementing complex mechanics that require micromanagement around some specific penalties. Prototyping cost is not broken but it's not terribly important for the game either.

The default value that was intended for it was just 50%. At those levels it doesn't matter much if the AI builds Skunkworks or not, but anywhere way over 100% it becomes an artificial handicap unless someone specifically codes the AI to work around those limitations. People can just make the prototyping cost really high in alphax.txt for whatever balance reasons but what ends up happening it handicaps the AI production choices. And there's many more of these kind of mechanics.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 13, 2021, 08:04:24 PM
It's a separate topic but it ties to the same idea which is implementing complex mechanics that require micromanagement around some specific penalties. Prototyping cost is not broken but it's not terribly important for the game either.

This is a stretch. The game is a game. There is nothing terribly important in it by definition. At the same time micromanagement is the bread and butter of 4X games. Those despising it in general play single person games like race cars. People usually complain not about micromanagement but about excessive mouse clicks. The difference is that (micro or any other kind of management) is decision making. One make a decision that affect their future game progress in some way. The more layers in a game the more these decisions interlink and the more difficult to see them through. That is an essence of fun for those seeking intellectual challenge like I assume most of the SMACX players are. The mouse clicks are just extra actions need to be done not carrying any strategical decision making which is boring.
From that perspective, prototyping cost is a perfect strategical layer to the game. It calls some non trivial choices - whether produce old units or prototype new or build prototype free facility or play prototype free faction, etc. Plenty of interesting choices. And it does not require any excessive mouse clicks besides actually designing units as usual and building them as usual. All costs are automatically computed.

The default value that was intended for it was just 50%. At those levels it doesn't matter much if the AI builds Skunkworks or not, but anywhere way over 100% it becomes an artificial handicap unless someone specifically codes the AI to work around those limitations. People can just make the prototyping cost really high in alphax.txt for whatever balance reasons but what ends up happening it handicaps the AI production choices. And there's many more of these kind of mechanics.

I don't agree with that either. In WTP it is 100% just to not scare players used to 50%. However, nothing wrong with setting it to 200%, for example. Making it more pronounces and interesting aspect of the game to pay attention to.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 13, 2021, 10:10:02 PM
I'd say one of the first, maybe even genre-defining, games of this type was MOO1. If you've played it you probably notice the empire management is abstracted at a relatively high level and there is little to none micromanagement. So can't really say excessive micromanagement is necessary ingredient for these games. Later games in that series deviated from that formula and added a lot more micromanagement though. Anyways, I already explained why complex game mechanics can be a problem (in some circumstances).
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 13, 2021, 10:19:16 PM
MOO1 has less micromanagement on spying but overall I wouldn't say it is. Ship design and rotation required a lot of clicks. Every planet production tuning. Constant diplomacy check. And moving armadas of ships every turn?

For complex problem here we are trying to make things run smoother.
Title: Re: SMACX Thinker Mod
Post by: dino on April 15, 2021, 10:37:28 PM
Regarding Eco Damage again.

Please separate facilities generating clean minerals from the beginning and removing ai eco damage cheat.
If you don't want to clutter ini file, just make facilities fix a default and remove the setting from thinker.ini
eco_damage_fac_fix
eco_damage_ai_cheat

Vanilla ai eco damage cheat will go a long way in helping to manage this issue.

***
I've forgot that orbital and nanoreplicator minerals are clean.
Micromanaging minerals production through workforce reassigment and tiles respeccing is too complex to bother with, so it leaves only two things to consider on the AI front:

1) When to build 50% minerals facilities: GF, RAS.
Do not build if building it would cause unmanageable eco damage.

2) When to build clean minerals facilities: TF, HF, CP,  ToP.
At the beginning of the turn iterate through the bases and check:
- If there are 5 or more bases above clean minerals treshold, with high eco damage.
- If there are 3, or more bases that could build 50% minerals facility, but won't pass a check from point 1)

If yes, consider clean minerals facilities in any base that doesn't has anything more useful to build left.

3) Not directly related but late game bases should maintain few formers each, so they are equipped to rapidly rebuild destroyed by war, or fungal pops infrastructure.



Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 15, 2021, 10:45:15 PM
I honestly don't believe there is need for a cheat. If eco managing facilities are capable of keeping warming at bay - let AI just build them. If not - that is completely different subject of balancing eco damage magnitude.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 15, 2021, 11:02:51 PM
Not sure if this is the right topic for that but since we have started discussing eco damage ...

TF and HF reduce damage caused by terraforming and they do their job well. Just two of these facilities is enough to completely eliminate this portion of it.
Mineral related eco damage reducing facilities are not working that good, unfortunately. They do not reduce the mineral count factoring into damage but only the portion that is above threshold actually causing the damage. Therefore, they will never reduce existing damage to zero. Same way PLANET and other factors work.

I don't know if this is by design or they just programmed it this way but this causes the implication of constant damage presented at major producing bases. The amount can be minimized but will ever present. And the more bases there are on a planet the more damage occurs. Raising mineral threshold is the only way to fight ever increasing damage.

The strategical problem I see with that is all these means on reducing mineral caused damage are only good when the damage itself is quite large already. CP will cut 50 damage by 25 but 10 damage only by 5. The raising mineral threshold activities and reducing damage over threshold activities are competing with each other. There is no synergy. When threshold is high enough to make some base completely clean such facilities becomes useless. One can as well sell them out.

What I propose is to rework the formula and make them reduce not the amount of already generating damage but the mineral count before threshold is applied. This way they will work in synergy with threshold raising methods and will always be useful. The more minerals in base - the more positive impact they will do on ecology.

This may actually solve inevitable global warming problem for both player and AI as it will be possible to keep damage in check.
Title: Re: SMACX Thinker Mod
Post by: dino on April 15, 2021, 11:27:56 PM
50% are huge jumps that can either cause a serious issues for AI, or AI may not build them at all if we make it too careful.
Clean minerals facilities are generally very costly and pretty useless otherwise, it's hard to determine with a simple formule when they are worth it.
Finally carefull micromanagement of minerals output would be another complex issue to code.

It's one of the more complex issues on the facility production selection front and Inductio didn't seem to be very excited by a perspective of working on it, so cheat would do for now.
AI has many cheats, so it's no different than the cost factor for me for example and it's already there, all I ask is to separate it from clean facilities fix.
Cheat will make it easier to tackle with simplier code, if facility production choices side of AI will be capable of handling end game without cheats, it can always be disabled.

> If eco managing facilities are capable of keeping warming at bay - let AI just build them. If not - that is completely different subject of balancing eco damage magnitude.

Eco facilities are capable: there are 16 clean minerals + 20 mild early pops + lets say 20 - 30 bases * 4 facilities = 120 - 160 clean minerals, before you have to consider throttling minerals output in some way.
Title: Re: SMACX Thinker Mod
Post by: dino on April 15, 2021, 11:54:12 PM
They do not reduce the mineral count factoring into damage but only the portion that is above threshold actually causing the damage. Therefore, they will never reduce existing damage to zero. Same way PLANET and other factors work.

Is this formula incorrect ?

Eco-Damage = (DamageFactor * Perihelion * Techs * Life * Difficulty * Planet) / 300
DamageFactor = Int{ [Terraforming - Cleanmins1] + [(Minerals - Cleanmins2 + 5*Atrocities) / (1+Goodfacs)] }
Cleanmins = 16 + # Fungal Blooms + # Tree Farms, Hybrid Forests, Centauri Preserves and Temples of Planet
Cleanmins1 = Cleanmins or Terraforming, whichever is less. If Terraforming is negative, Cleanmins1 = 0.
Cleanmins2 = Cleanmins - Cleanmins1.

According to this formula you can bring damage factor to zero with clean minerals.
Goodfacs and Clean mineral facilities are different sets, the former provide clean minerals, the latter reduce ecodamage when it occurs.
Goodfacs = 1 each for the presence of Centauri Preserve, Temple of Planet and Nanoreplicator in this base, + 1 each for possessing the Pholus Mutagen and Singularity Inductor.
Clean minerals facs = 1 for each faction wide owned Tree Farm, Hybrid Forest, Centauri Preserve and Temple of Planet

It's been a while since I've reached end game, but I recall 100+ minerals bases with 0 ecodamage, or my memory plays tricks with me.
Clean minerals facilities were undocumented in datalinks and manual, maybe you've never sumbled into revised eco-damage formula ?
https://alphacentauri2.info/wiki/Ecology_(Revised)
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 16, 2021, 12:32:33 AM
Goodfacs and Clean mineral facilities are different sets, the former provide clean minerals, the latter reduce ecodamage when it occurs.

I probably put too much words in my post and lost you. The above is exactly what I am saying. With an emphasis on that Goodfacs clean minerals contribution is a major factor of their usefulness. Whereas Goodfacs damage reduction effect sucks completely by definition. Therefore, player will be actually building them for their +1 clean mineral bonus. Not for their reduction capability.

If you look at the formula, you'll see that terraforming ecodamage reduction happens before clean minerals apply. But mineral ecodamage reduction happens after.
Code: [Select]
(terraforming ecodamage - terraforming ecodamage reduction + industry ecodamage - clean minerals) / (1 + Goodfacs)
In this form CP/TP reduce the actual ecodamage resulting from both terraforming and industry. That is not what they say in their description: "Reduces effect of industry on Planet's ecology".

I propose both of these reductions happen before clean mineral apply so they work in a similar manner.
Code: [Select]
(terraforming ecodamage - terraforming ecodamage reduction + industry ecodamage / (1 + Goodfacs) - clean minerals)
In this form CP/TP reduce only the effect of industry on planet ecology. Exactly as it stated in their description and as it is designed by separation of responsibilities between terraforming and industry reduction facilities.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 16, 2021, 12:14:36 PM
Hmm, reading the earlier posts I was just wondering do you understand how the clean minerals formula works? It's a little bit counterintuitive, but yes, you can have 100+ mineral bases with zero eco damage even if you run negative Planet rating for example. If mineral_intake <= clean_minerals then eco damage should normally be zero. We already have this setting enabled by default in Thinker:

Quote
; In vanilla game mechanics, eco damage on AI bases is notably reduced from player levels.
; This patch increases AI eco damage to the same level than what the player bases have.
; In addition, constructing Tree Farms and similar facilities always increases the clean
; minerals limit even before the first fungal pop.
eco_damage_fix=1

There's some more changes coming for find_facility to enable the AI judge the cost effectiveness of different buildings better. Also AI_build, AI_power etc variables should have more influence on the build decisions.
Title: Re: SMACX Thinker Mod
Post by: dino on April 16, 2021, 01:24:22 PM
My point was that I'd like to keep clean minerals before fungal pop always.

But would like to experiment with vanilla AI ecodamage reduction in case it'll be running into serious issues with ecodamage in my games.
And this setting seems to be enabling/disabling both.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 16, 2021, 02:24:22 PM
Well, eco_damage_fix is also specifically targeted to help the AI because it can just start building Tree Farms right away to keep the eco damage in check. Somewhat similar benefits than with auto_relocate_hq so the AI doesn't have to strategize about HQ relocation. Personally I don't find it interesting to implement it in other ways if they're more complex than that for the AI. Unless you meant something else?
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 16, 2021, 07:02:15 PM
Uploaded a new develop build 20210416. This time no significant new features but many bugfixes and general improvements to production planner and movement AI.

AI now does more cost/benefit checks when deciding to build base facilities. This new build queue algorithm can reorder buildings to some degree if the benefits offered by them change. Regarding mineral multiplier facilities, 2 new choices are added to queue BUT they only get built under certain conditions.

AI will not build any more multipliers if the production is already very high (50-80 minerals). Most, but not all, excessive eco damage should be avoided by this condition which is always checked:
3*base->mineral_intake_2 > 2*(conf.clean_minerals + f->clean_minerals_modifier)

E.g. if the production after multipliers increases by 50%, will it push the base above clean minerals threshold?
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 21, 2021, 02:54:09 PM
As you might have noticed, Thinker v2.5 added new unique name generator for bases. Currently it just uses Greek alphabet in the "X Y Sector" formula. This could actually be extended to hold multiple arbitrarily large wordlists which could be combined to create new names. I'm not going to add any faction-specific names though because that would defeat the purpose. They should be generic enough to be used for multiple factions.

Any good ideas what kind of wordlists to use here? Possibly they could also be customized for the map location or have each faction in the savegame use separate subsets of the wordlists, so they could be distinguished more easily.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on April 21, 2021, 04:06:38 PM
-If you wanted to go that way, I could dig you up oodles of old name lists.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 21, 2021, 04:14:25 PM
That might be useful. Even 2x30 words is enough since it gets us to 900 combinations if choosing one from both lists. Assuming they just make sense grammatically. ;)
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on April 21, 2021, 04:23:58 PM
https://alphacentauri2.info/index.php?topic=2681.0

This thread, then - hundreds and hundreds of names, all factions covered, and links in the OP to other like threads all over the community.  ete's sinc.in compilation is still up; I checked.  I don't think he updated the last few pages' worth from the thread, though.
Title: Re: SMACX Thinker Mod
Post by: Rocky on April 25, 2021, 04:49:09 PM
I just want to say thank you for all your hard work on this mod. I'm loving the recent additions. They really add much to the game experience.

Having a strong AI, being able to set a number of bases (Love the option to let the AI adjust their numbers to match the player), setting the distance between factions or bases, customizing AI behavior, having adjustable settings for the map and much more.

Two things I especially like are that I can now pick which factions can be excluded in the random setup, and that you can disable some of the native life forms on Planet. (I was never really a fan of Fungal Towers and Spore Launchers)

There's something I'm wondering about the new AI military setting. In Thinker.ini it states that 100 is the default value. If I wanted a more peaceful builder game would setting it to 50 be a good value? Does it mean the AI will field an army about half their regular size? What would happen if I set it to 25 or 0? Would the AI still build defensive units?

Thank you again for all your hard work!



 
Title: Re: SMACX Thinker Mod
Post by: dino on April 25, 2021, 05:34:26 PM
White and yellow outlines for headquarters and golden age are cool, even if not really that useful, but it made me think of a real QoL feature in a simillar vein.

To play efficiently and prevent all obviously predictable riots, you have to check each base every turn, there is no thinking involved, it's just annoying busy work.
So I propose, red outlines for bases that are most likely going to riot next turn if nothing is changed, or are rioting currently.

drones > talents, or drones == talents for base that is going to grow and add a drone next turn

You could also simulate default resources allocation after pop growth, to remove false positves.
But even just pointing out potential riots with simple drones == talents check for bases that are about to grow and add a drone, would be very useful.

Other less useful ideas ( but probably no less useful than the ones you already have ):
Red outline could also be used for bases with negative mineral, or nutrient output, so red would be a general "something wrong with a base" indicator.
Green outlines for bases that are about to grow a pop,
Blue outlines for bases that reached pop limit if a relevant pop limit facility is available.

Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 25, 2021, 07:42:39 PM
So I propose, red outlines for bases that are most likely going to riot next turn if nothing is changed, or are rioting currently.

Is this with or without governor? I would say it is useful without governor. Otherwise, it makes sense to fix the governor so it does not let that happen ever.
Title: Re: SMACX Thinker Mod
Post by: dino on April 26, 2021, 05:21:48 AM
I love micro, I never use governor, I don't even use queues ;)
If such features were implemented, I see no reason for disabling them when governor is active.

As for improving Governor AI, even if you hooked regular AI code to it somehow, it would be still pointless, since on high difficulties you have to micro better than AI to win.
So governor is by definition most of the time useless for users of this mod and development effort spent on it could be allocated to something more useful.
This was also Inductio's stance on the governor last time he was asked about improving it.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 26, 2021, 12:03:56 PM
Quote
There's something I'm wondering about the new AI military setting. In Thinker.ini it states that 100 is the default value. If I wanted a more peaceful builder game would setting it to 50 be a good value? Does it mean the AI will field an army about half their regular size? What would happen if I set it to 25 or 0? Would the AI still build defensive units?

Interesting question and it goes back to the roots of how Thinker works. ;) The key decision that the AI always faces is whether to build more military or infrastructure/pods/formers. I solved this early on with a non-linear randomized choice based on some threat factors. By design the frequency for military stays usually in the 30-70% range. The value from config gets plugged into this formula:

double threat = 1 - (1 / (1 + max(0.0, threat_factors * conf.conquer_priority/100.0)));

if (minerals > reserve && random(100) < (int)(100 * threat)) { build_more_combat }

There's also separate code for producing garrison units and it's always forced if the base undefended. So you can tinker with this config variable and observe the results now.

Quote
To play efficiently and prevent all obviously predictable riots, you have to check each base every turn, there is no thinking involved, it's just annoying busy work.

I agree with this 200%. That MMing is really horrible. My preferred solution would be to rewrite the governor such that it always force allocates enough doctors to prevent rioting. It's really irrelevant for the most part if the food input is restricted if it just avoids the riots. This part of the game was kind of badly designed from playability perspective. The problem is rewriting that part of governor requires a lot more code to calculate the drone effects accurately and other stuff. But it would be nice to rewrite more of that base bookkeeping code in Thinker's source.
Title: Re: SMACX Thinker Mod
Post by: dino on April 26, 2021, 08:50:38 PM
I like micro, I don't like meaningless busywork micro.

Decision on what method to use to deal with drones is fun, checking out each turn on each base is not.
With a red outline indicator one look at the map would tell me which bases require my attention.
Much lower hanging fruit than governor ai and usefull for people who don't use it.

Of course improving AI workers allocation in general is a worthy goal on itself.
Title: Re: SMACX Thinker Mod
Post by: Induktio on April 28, 2021, 03:49:44 PM
Newest develop build now has a feature where world_map_labels will highlight bases that are about to drone riot next turn. It does not consider how the drone count would be affected by population increase but I guess it's still useful.

SMAC rendering engine redraws map in a lazy way so it often results in rendering glitches where some part does not get updated. It's kinda pointless on modern CPUs to be honest. So because of that I added there more map redraw calls after some user interface actions. Also as another feature the game now preserves autosaves from all turns and the filenames contain the actual turn year.
Title: Re: SMACX Thinker Mod
Post by: dino on April 28, 2021, 11:03:02 PM
I understand the decision to highlight only 100% certain riots, not potential ones, to not confuse players.
Will be very useful when adjusting SE settings.

In such case however, I'd definitely like to see green outlines for bases that are about to grow a pop next turn.
Pop growth is responsible for like half predictable riots, so it'd be a great help when combined with riot highlights.

We could prevent all predictable riots with only checking on red and green highlighted bases, instead of all of them.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on May 16, 2021, 05:35:10 AM
I noticed you took control over enemy probes and they now do not subvert units anymore.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on July 06, 2021, 09:19:09 AM
Probe team movement code in the last version seems to respect enemy ZoC, while probe teams should be exempted from this restriction.
Title: Re: SMACX Thinker Mod
Post by: fuzion2100 on July 06, 2021, 04:12:25 PM
hello, i have tried a few things to get thinker to work.  i download it and put it over my game files. but i am lost at that point.  could some one give me some step bystep to get it running please?
Title: Re: SMACX Thinker Mod
Post by: AcidJazz on July 07, 2021, 01:57:50 PM
Hi Folks, is there any other way to download the Thinker Mod?
Unfortunately I cannot download via the link provided on GitHub (Certificate issue with ore than a browser).

EDIT : Sorted Out :)
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 07, 2021, 04:22:06 PM
Project has been on a hiatus for a while, let's see...

> Probe team movement code in the last version seems to respect enemy ZoC, while probe teams should be exempted from this restriction.

Can you clarify this a little bit? Maybe some examples of movement paths that the AI doesn't take that it should use.

Also note that currently the AI doesn't use probes to mind control units, only bases. I have not yet investigated how to patch that functionality for the new AI.

> i download it and put it over my game files. but i am lost at that point.

Unzip to game folder and run terranx_mod.exe. Hmm?
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on July 08, 2021, 05:07:17 AM
Project has been on a hiatus for a while, let's see...

> Probe team movement code in the last version seems to respect enemy ZoC, while probe teams should be exempted from this restriction.

Can you clarify this a little bit? Maybe some examples of movement paths that the AI doesn't take that it should use.

Also note that currently the AI doesn't use probes to mind control units, only bases. I have not yet investigated how to patch that functionality for the new AI.
Probably, this turned out to be false alarm. Apparently, it's just coincidence that Morgan stopped (for a long time now) to infiltrate probe teams through his northern and north-western borders once I blocked it with border guard ZoCs.
Instead another glitch has shined: can't kick out of my lands probe teams at (63,17) and (59,17) (north of Pseudocode), because game considers them "not in our territory".
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 10, 2021, 12:45:24 PM
> Instead another glitch has shined: can't kick out of my lands probe teams at (63,17) and (59,17) (north of Pseudocode), because game considers them "not in our territory".

Yeah that's an interesting issue because it occurs with the vanilla binary as well. Although for the other probe team, vanilla asks for breaking the treaty before attacking it. For the other one both versions just say it's "not in our territory". It seems to have something to do with the fact that the tile has both player and AI bases in a 2-tile range (it's also base radius). Just goes to show again how vanilla is riddled with bugs. Sigh.

I noticed also that Satori does not have headquarters in that savegame. Did you play this game with auto_relocate_hq enabled?
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on July 10, 2021, 05:05:25 PM
I noticed also that Satori does not have headquarters in that savegame. Did you play this game with auto_relocate_hq enabled?
No.
Tried revised_tech_cost=1, was surprised by tier 1 techs costing 90 RP, tier 2 ~238 or 258 (standard random map, Librarian difficulty) - feel the Civ:BE vibe. Reverted to standard formula for now.
Tried eco_damage_fix=1, no one global warming in two games even with 1, 1 numerator/denominator for frequency in alphax.txt (AIs generated lots of fungal pops). Reverted for now.
territory_border_fix=1 is super-useful, both on land and in the sea.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 11, 2021, 12:14:31 PM
> Tried revised_tech_cost=1, was surprised by tier 1 techs costing 90 RP, tier 2 ~238 or 258 (standard random map, Librarian difficulty) - feel the Civ:BE vibe.

And what do you mean by Civ:BE vibe???

In earlier version we had a special discount factor for the first 10 techs but it was removed even though it somewhat approximates vanilla behaviour. It's better not to have mechanics that promote tech beelining or similar minmaxing techniques.

> Tried eco_damage_fix=1, no one global warming in two games even with 1, 1 numerator/denominator for frequency in alphax.txt

Just remember that vanilla gives AI bases a big reduction in eco damage. Also, eco_damage_fix removes a stupid mechanic where players have to wait for the first fungal pop before tree farms reduce eco damage. :)

These two things produce somewhat opposite results but it's possible that, on the aggregate, the new tree farm mechanic outweighs the increased base eco damage being generated by the AI bases.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on July 11, 2021, 07:33:59 PM
And what do you mean by Civ:BE vibe???
From playing Civ:BE I remember depressing feeling of first tier techs indicating tens of turns to reach. Fortunately, this is ameliorated (in Civ:BE) by research found in pods.

In earlier version we had a special discount factor for the first 10 techs but it was removed even though it somewhat approximates vanilla behaviour. It's better not to have mechanics that promote tech beelining or similar minmaxing techniques.
Too bad this wasn't made into an option for those who prefer vanilla early game behavior.

> Tried eco_damage_fix=1, no one global warming in two games even with 1, 1 numerator/denominator for frequency in alphax.txt

Just remember that vanilla gives AI bases a big reduction in eco damage. Also, eco_damage_fix removes a stupid mechanic where players have to wait for the first fungal pop before tree farms reduce eco damage. :)

These two things produce somewhat opposite results but it's possible that, on the aggregate, the new tree farm mechanic outweighs the increased base eco damage being generated by the AI bases.
I'm afraid some bug is hiding here. Do fungal pops with eco_damage_fix=1 contribute to global warming? Because I certainly seen many of them in AI lands, which means they weren't prevented by Tree Farms built earlier. Nonetheless, fix of indeed strange eco-facilities behavior could only be applauded.
Title: Re: SMACX Thinker Mod
Post by: vygov on July 22, 2021, 07:30:45 AM
Hey!
Do I need to additionally install patches Pracx_1.11 and Scient`s_2.1 or are they already included in the mod?
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 23, 2021, 01:00:21 PM
> Do I need to additionally install patches Pracx_1.11 and Scient`s_2.1 or are they already included in the mod?

Scient's patch v2.1 binaries are already included, I think this should be clear. The only reason you might want it installed separately is to run the vanilla binary patched with v2.1 without additional mods enabled (maybe to test something, dunno).

PRACX is not required for anything actually, but if you want those extra GUI features that are not yet merged in Thinker then you need to install it separately after you've unzipped Thinker files to the game folder.

> I'm afraid some bug is hiding here. Do fungal pops with eco_damage_fix=1 contribute to global warming?

In each case fungal pops should act to increase the clean minerals limit by one. So they will actually decrease the current eco damage amount. But separately from the current eco damage, sea level rise will be triggered after X amount of fungal pops. I don't remember the detailed formula for each sea level rise, but it should be mainly determined by the amount of fungal pops that have occurred across all factions so far. Not sure what kind of possible bug you are alluding to here.

> From playing Civ:BE I remember depressing feeling of first tier techs indicating tens of turns to reach. Fortunately, this is ameliorated (in Civ:BE) by research found in pods.

Maybe tech costs for tier 1 and (tier 2 partially) should be slightly decreased?
Title: Re: SMACX Thinker Mod
Post by: vygov on July 23, 2021, 01:05:44 PM
PRACX is not required for anything actually, but if you want those extra GUI features that are not yet merged in Thinker then you need to install it separately after you've unzipped Thinker files to the game folder.
Without the installed Praxc, the window mode does not work. A window that can be laid and move the mouse.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 23, 2021, 01:14:32 PM
> Without the installed Praxc, the window mode does not work. A window that can be laid and move the mouse.

In which way it doesn't work? The windowed mode implementation is different in Thinker and PRACX. Most importantly, Thinker doesn't do resolution scaling on the window because it slowed down render times significantly. Instead Thinker just provides a borderless window with a preset resolution. I recommend running Thinker using DirectDraw=0 option in any case. It should use the desktop resolution and it's possible to alt+tab out of the game window. Windowed option is not that necessary.
Title: Re: SMACX Thinker Mod
Post by: vygov on July 23, 2021, 01:22:11 PM
Yes, the window does not move, "glued" to the corner of the screen. Not too comfortable.
Title: Re: SMACX Thinker Mod
Post by: Induktio on July 23, 2021, 01:29:48 PM
Umm yeah, that's how it's currently implemented. I don't promise to look into it for the next version but maybe.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on July 24, 2021, 11:25:27 AM
> I'm afraid some bug is hiding here. Do fungal pops with eco_damage_fix=1 contribute to global warming?

... Not sure what kind of possible bug you are alluding to here.
Thanks for reminding the mechanic. The bug exactly as asked: could it be that eco_damage_fix=1 implementation erroneously missed the part "each fungal pop increases global warming counter"? Because in all my (though, not many) recent playthroughs I witness multiple fungal pops in AIs territory (plus 5-10 mine), but absolutely no warming (nor with 1/1, nor even 2/1 frequency ratio). I'll try to take more notice.

> From playing Civ:BE I remember depressing feeling of first tier techs indicating tens of turns to reach. Fortunately, this is ameliorated (in Civ:BE) by research found in pods.

Maybe tech costs for tier 1 and (tier 2 partially) should be slightly decreased?
It would be quite desirable. IMHO, not "slightly", but at least 2-3x.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on July 26, 2021, 08:21:54 AM
Maybe tech costs for tier 1 and (tier 2 partially) should be slightly decreased?
Let me explain my view on this. IMHO, elimination of one day existed discount for the first 10 techs was a mistake. As I understand, this was done to disable the last remaining possibility for beelining. But I fail to see the reason why beelining is bad, and isn't just another decision-making area to master. Beelining is already discouraged by tier-dependent costs, and not benefiting from diplomatic discount. Some wiggle space for the player could be left. Previously, Thinker Mod tried to teach AI to use overpowered techniques that humans [ab]use to win, rather than simply taking those techniques away from player (which widely practice bvanevery in his AI Growth mod and this, IMHO, is a dead-end road). Curiously enough, Thinker Mod even had implemented tech_balance=1 setting specifically for the right beelining. Not mentioning the original goal to not deviate too much from vanilla rules. That is why I think tech discount should be returned as an option, with or without some reduction of tier 1 and 2 tech costs.
Title: Re: SMACX Thinker Mod
Post by: ariete on July 27, 2021, 12:48:51 PM
hi PvtHudson, i just would understand which file or files ive to download from this link https://www.dropbox.com/sh/qsps5bhz8v020o9/AAAp6ioWxdo7vnG6Ity5W3o1a?dl=0&lst= to play with the last version ? just Thinker_v2.6.zip or all the previous  ;wait Thank you ;bow
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on July 28, 2021, 06:49:45 AM
Hi Ariete! If I understand correctly, the routine is like this: 1) fresh install SMAX (for example, from GOG.com); 2) download just Thinker_v2.6.zip, no need for previous; 3) extract all from said zip into game folder (where it was installed at step 1), overwriting alphax.txt (if you back it up, then later you can check differences to decide for yourself); 4) run terranx_mod.exe instead of terranx.exe each time (you may need to silence your antivirus); 5) if all is well, Ctrl+F4 in game shows "ThinkerMod version 2.6"; 6) if you played vanilla SMAX before, lower your usual difficulty by 2.
I also recommend setting revised_tech_cost=0 and ignore_reactor_power=0 (they're 1 by default) in Thinker.ini for more vanilla-like experience, but you should play once with =1 and decide for yourself. By the way, there are many other fancy options in that file.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on August 10, 2021, 11:48:24 AM
Seems, global warming isn't bugged. So far, on standard random map got 0-1 GW event with 3/1 ratio, and Noah's experience with 10/1 ratio. Apparently, depends heavily on difficulty and present factions. Probably, sea factions with their additional sea minerals and low need for Tree Farms are worst offenders.
Title: Re: SMACX Thinker Mod
Post by: Induktio on August 10, 2021, 01:48:17 PM
Anyways, you can file issues (https://github.com/induktio/thinker/issues) on Github if you find anything problematic. They can be discussion topics for balance issues too, not merely bugs.

Also remember that ALT+T activates Thinker's config menu and it works on the main screen too.

> So far, on standard random map got 0-1 GW event with 3/1 ratio, and Noah's experience with 10/1 ratio.

Which one is numerator/denominator here? Are they in the right order?
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on August 10, 2021, 02:15:28 PM
> So far, on standard random map got 0-1 GW event with 3/1 ratio, and Noah's experience with 10/1 ratio.

Which one is numerator/denominator here? Are they in the right order?
Yes, you read right, numerator is 3 or 10, and denominator 1.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 18, 2021, 05:45:52 PM
Here's a fun idea: should this mod be added an option for randomly expiring infiltration for other factions? How many would use it?

It's clearly somewhat of a game balance problem that infiltration is permanent and shows very detailed information. This might be changed. It seems PTW has a similar feature but I very much doubt Thinker would be using the same implementation.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 21, 2021, 03:44:34 PM
Here's a fun idea: should this mod be added an option for randomly expiring infiltration for other factions? How many would use it?

It's clearly somewhat of a game balance problem that infiltration is permanent and shows very detailed information. This might be changed. It seems PTW has a similar feature but I very much doubt Thinker would be using the same implementation.
On one hand, I find detailed infiltration info very handy at increasing situational awareness and decreasing WtF moments by allowing to see what's going on in the game at large. Comparing to other games, it's a good feature, heightens player's QoL by enforcing his perception as being in control. On the other hand, player becomes lazy.
I think, more challenge could be created by: 1) infiltration indeed does expire, but not randomly, rather according to Probe ratings of infiltrator/infiltrated; 2) techs could be stolen by probes only from bases with Network Nodes. For each option 3 choices - vanilla behavior, yes only for human player, fair yes for all players. I personally would be very eager to test and use this feature.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on October 22, 2021, 03:09:48 PM
1) infiltration indeed does expire, but not randomly, rather according to Probe ratings of infiltrator/infiltrated;

https://github.com/tnevolin/thinker-doer#infiltration-expiration
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 22, 2021, 05:21:41 PM
> I find detailed infiltration info very handy at increasing situational awareness and decreasing WtF moments by allowing to see what's going on in the game at large.

Btw, one of the reasons I included render_probe_labels because it lessens the chance of overlooking some AI probe team that would mind control your base on the next turn. So that's essentially QoL feature.

Infiltration feature has now config option counter_espionage. The implementation is somewhat different from WTP. It expires "randomly" but the result is always same when reloading the same save file. See details.md. Maybe there will be some more tweaks before release. Network Node feature sounds like it requires a bunch of GUI patching which is one reason I'm not going to attempt it for now.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on October 22, 2021, 06:07:44 PM
Network Node feature sounds like it requires a bunch of GUI patching which is one reason I'm not going to attempt it for now.
Not necessarily, just silently turn an attempt to steal tech into steal energy. But I agree, not the most urgent feature. By the way, will AI try to mind control enemy units as it used to do sometime ago?
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 22, 2021, 06:26:58 PM
> By the way, will AI try to mind control enemy units as it used to do sometime ago?

Not currently. The required patching method is not implemented to integrate it with the new AI. Maybe if someone investigates the method. Also I won't switch off new AI for probe teams because that would just mess up all the garrisoning priorities, naval invasion planning etc. Would not be good.
Title: Re: SMACX Thinker Mod
Post by: Induktio on October 23, 2021, 02:39:45 PM
Apparently there's a separate function for executing probe team tasks, including capturing other units.

Didn't check if this will deduct the energy credits also or what is that last parameter actually.

Code: [Select]
typedef int(__cdecl *Fprobe)(int veh_id1, int base_id, int veh_id2, int flag);
Fprobe probe = (Fprobe)0x59F120;

probe(veh_id1, -1, veh_id2, ?); // Capture some unit
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 05, 2021, 04:07:23 PM
It appears the game has an undocumented(?) feature with AI's nutrient and mineral cost factor. It seems if the player faction is ranked number one, AIs will get extra +1 bonus for industry and growth. So that's why you sometimes see AIs getting more production than Thinker's cost_factor option seem to suggest. This seems like somewhat of an unnecessary catch up mechanism set up for the AI, and it could be adjusted in a new Thinker version. Should this mechanic be removed and/or provide a separate config option for it?
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on November 06, 2021, 05:03:30 AM
Frankly, I see no pressing need to repair what isn't broken. Let the mechanic be, under the .ini option if not too much trouble.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on November 06, 2021, 01:52:59 PM
Extra +1 bonus after PC overtook everybody is not going to change anything. There is no player stopping at this point. Just makes it slightly longer to kill AI factions.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 06, 2021, 03:04:59 PM
Actually the bonus is broken into two parts, I described it in the docs somewhat incompletely.

The first bonus +1 is added if the player faction is ranked number one on power graph.
Then the second +1 bonus happens if the player faction is considered a threat as returned by great_satan function (https://github.com/b-casey/OpenSMACX/blob/58e36e0bc86a9e050c1cab2d737f7108834ba7c9/src/faction.cpp#L161).

So it's not necessarily broken but it's a game design question of how much we need to keep these catch-up mechanisms there. At some point these might just make the game drag on unnecessarily long if we pile up too many bonuses. It's already implemented as a config option, need just try to decide what should be the default.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 07, 2021, 09:30:45 PM
Recently played a long, very long game on Huge Map of Planet using Tayta's custom faction, The Edenist Republics. Here are the stats:

Quote
^+2 ECONOMY: {Free flow of capital}
^+2 SUPPORT: {Just-in-time supply chains}
^-1 MORALE: {Privatized military}
^-2 INDUSTRY: {Excessive contractor bloat}
^Immunity to negative POLICE: {Morally righteous}
^Extra DRONE for every four citizens: {Deregulation and austerity}
^50% hurry costs: {Angel investors}
^{May not use Power values.}

It's an amusing faction to play which also uses Morgan's graphics set. But the overall impression is that it's definitely overpowered.

Started north east of the Jungle which was first colonized by the Drones. They built up excellent infrastructure there during about the first 90 turns. However I first rushed to research the economic techs and then air power. This wasn't particularly difficult as this faction produces boat loads of extra energy.

At the first opportunity I ran demo + free market + wealth which produces a staggering bonus for commerce and extra +4 energy for each base. Using air power is not a problem at all in this case as this faction is immune to negative police. Early I found it useful not to max out the labs using demo+green but instead use the extra credits from free market to rush build nearly everything at super cheap prices.

It was relatively difficult to obtain Governor as the Peacekeepers were also in the game and booming like crazy but I was able to win it by narrow 4 vote margin on turn 101. Afterwards this faction just kept snowballing as I decided to forego infrastructure building on captured bases almost entirely and just built Punishment Sphere+Hab Complex there.

It also feels like Sphere is an overpowered facility. The -50% tech penalty is almost meaningless for captured bases because now you can spend almost zero on psych allocation and have everybody working with no problems.

During this game I actually stopped multiple times to develop features that would cut up the time spent on micromanagement. Drone management is one of the worst ones but Spheres will solve that quite nicely. For the others you can see the ideas from Details.md.

For some time I planned to win by transcending but then decided just to rush the rest of the non-allied bases and win by conquest victory. Revised tech cost scales as intended for the higher brackets where you can't just achieve that usual multiple techs per turn speed at the end. However due to the high base count and having a super science city I was able to keep almost 1 tech/turn speed.

The game ended at victory on turn 129 and the final stats (from Thinker's menu) were 212 bases, 2162 pop, 4516 mineral production and 7414 energy production. After multipliers this translated to around 16510 labs/turn. I didn't have the time to keep building much hab domes so the population would have grown to nearly 3000 if I kept researching the techs for transcending, but the game took already long enough.
Title: Re: SMACX Thinker Mod
Post by: Induktio on November 24, 2021, 05:19:26 PM
Thinker v2.8 is now available from the project website (https://github.com/induktio/thinker).

This version adds a rewritten map generator to replace the old game version. It was my long-standing goal to rewrite it and finally it seems to be doing what the game needs. Read the rest from details (https://github.com/induktio/thinker/blob/master/Details.md).
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on January 14, 2022, 09:38:34 PM
Quote
; Adjust how often the AIs should build new crawlers relative to the base count.
; Example: 100 = one crawler per base on average.
crawler_priority=100

how to have 5crawlers/base ? 500 ?


Quote
; Set AI cost factors for nutrient/mineral production for each difficulty level respectively.
; All other difficulty level modifiers remain unaffected by this setting.
; Example: 10 = 100% of human cost, 7 = 70% of human cost. Minimum value: 1.
cost_factor=12,11,10,9,8,7

so at 7 they get equivalent of +30% growth and industry ? but not as a matter of real +3 ind and growth ? so for example AI free drones on transcend on planned wealth will get +4 ind and with this bonus it means they get effective +70% industry cost cut ?

and with growth at dem/planned they still get +30%growth, but not pop boom as its not real +3growth ?

Quote
; Amount of minerals a base can produce before experiencing eco damage. This limit is also
; increased by one after each fungal pop or after building Tree Farms and similar facilities.
clean_minerals=16

each tree farm faction has gives +1 or only on city level ? so if i get 5 tree farms do i get +5 ?

Quote
; This replaces the default Monsoon Jungle landmark with multiple dispersed jungles on the map.
modified_landmarks=1
would be nice if u introduce param how many mini jungles should be created; now its like 3-5, id like to set it to 7

Quote
; Scale expansion_limit automatically to match the amount of bases by the human player.
expansion_autoscale=1
how this works ? that AI will build more bases than human but not many more ?; and in =0 would just ICS till limit ? asking cause =1 AI still makes more bases than human
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 17, 2022, 01:45:31 PM
Quote
; Set AI cost factors for nutrient/mineral production for each difficulty level respectively.
; All other difficulty level modifiers remain unaffected by this setting.
; Example: 10 = 100% of human cost, 7 = 70% of human cost. Minimum value: 1.
cost_factor=12,11,10,9,8,7

so at 7 they get equivalent of +30% growth and industry ? but not as a matter of real +3 ind and growth ? so for example AI free drones on transcend on planned wealth will get +4 ind and with this bonus it means they get effective +70% industry cost cut ?

and with growth at dem/planned they still get +30%growth, but not pop boom as its not real +3growth ?


These values are *initial* cost of growth and production. Meaning at 0 INDUSTRY their growth and production boxes are 7 bricks. Meaning they populate food and production boxes 30% faster. Now INDUSTRY effect is a multiplier on top of initial values. In your example with +4 INDUSTRY they get their box widths 40% narrower, not 4 bricks narrower! Which equates to: 7 bricks wide * 60% = 4.2 bricks wide. I don't remember rounding rules.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on January 23, 2022, 06:13:32 PM
topic: AI can't fight even when they are "on paper" strongest faction and initiate war

copy/paste from chat:
just played a game on dry map yesterday with hive, it was farily good , AIs were getting ahead of me with SPs
i played hive
was getting interesting as AIs gradually were breaking pacts with me
then strongest AI, morgan made sudden attack with like a 3-4 units in single turn
all good, but it sucks big time attacking :/
at this point i had 51 formers, while morgan 25, bug he overall was much stronger, bigger pop, 7 techs ahead + more crawlers
so I had only minimal army, like 2x 4-1-2 situated in the region
so it started all good, he even killed my probe + bought my city which meant i instantly lost like 6 formers (close to probed base)
i was excited i can lose this time :D
but of course I just switch 90% bases to 4-1-2
roll him over in the next 8 years, when he lost 8+ bases
and its gg for him
and at this point i even researched air power having like 8 boreholes

so AI was pretty good up until starting war with me
they should realize that war = total war for exhaustion
and not just "lets pick some fight here and there with few units" :D

attaching: 2171 - before war, morgan made sudden attack probably in 2172 ( but i see even in 2171 if u just move unit close to his base, but within my boarder he will attack too)
2179 - morgan lost war, his demise is just a matter of few more turns

game settings:
pirates AI replaced with my sea  faction: https://alphacentauri2.info/index.php?topic=21759.0 - they sucked despite huge boosts; I just added them to see if they will be good on land map since this map was 25% water

thinker.ini changes:
Quote
base_spacing=3

;base_nearby_limit=3

expansion_autoscale=0

expansion_limit=65

crawler_priority=300

simple_cost_factor=1

counter_espionage=0

territory_border_fix=0

world_sea_levels=25,45,70

crater=0
volcano=0
jungle=0
uranium=0
sargasso=0
ruins=0
dunes=0
fresh=0
mesa=0
canyon=0
geothermal=0
ridge=0
borehole=0
nexus=0
unity=0
fossil=0

nutrient_bonus=2

spawn_battle_ogres=0
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 23, 2022, 08:23:32 PM
> topic: AI can't fight even when they are "on paper" strongest faction and initiate war

Considering the type of games you're going for, it might be more suitable to play multiplayer. Those goals and small maps are more suited for it. Dry maps are generally worse for AI performance too. If you want more challenge, try also using blind research, otherwise with the default tech tree it might be too easy to rush some techs.

Generally the AIs might not have the time to build up during the first 80 turns if the game settings are unfavourable for them. You can try changing conquer_priority=150 or something so the AI will build more units. Sane values for that setting are somewhere in the range 50..250.

The AI already has some priorities which cause it to increase combat unit production if it loses bases, but it's probably not going to help much on smallest map sizes. About the changes I can envision here, maybe it would be a good idea to add needlejet/chopper techs to the prioritized list in tech_balance.

These values are *initial* cost of growth and production. Meaning at 0 INDUSTRY their growth and production boxes are 7 bricks. Meaning they populate food and production boxes 30% faster. Now INDUSTRY effect is a multiplier on top of initial values. In your example with +4 INDUSTRY they get their box widths 40% narrower, not 4 bricks narrower! Which equates to: 7 bricks wide * 60% = 4.2 bricks wide. I don't remember rounding rules.

The simplified version of this calculation is reversed in mod_cost_factor function. It should be otherwise the same than in vanilla game but it just removes the extra AI boost whenever the player faction is ranked #1.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 24, 2022, 03:55:17 AM
topic: AI can't fight even when they are "on paper" strongest faction and initiate war

Both Morgan and Hive have pretty small number of attacker units for that faction size. Obviously, neither is prepared for war. In such cases the one who immediately switch to war economy wins. Usually that is human who does and AI is notoriously inflexible in that.

I added some war economy adjustments in WTP. Would be interesting to compare if WTP AI faction can produce more units during war.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 24, 2022, 07:38:55 AM
> I added some war economy adjustments in WTP. Would be interesting to compare if WTP AI faction can produce more units during war.

What kind of changes specifically? Otherwise it's not going to be useful comparison unless you can isolate the production changes from the rest of the WTP code. There's too much uncontrolled variables in the test.

If the AI produces more units, there's also one indirect downside that must be considered. When AIs fight each other they are of equal skill level which makes the conflicts take a really long time. If they dedicate 100% of their resources for each war, they will neglect economy building and other factions will gain an advantage there. It would become more easy to just play AIs off against each other and watch them stagnate. Maybe it could be made such that it does this only when fighting player factions, but I'm not sure if that would become immersion breaking.
Title: Re: SMACX Thinker Mod
Post by: dino on January 24, 2022, 10:38:38 AM
I'll be boring, but I'm going to reiterate what I was already proposing.

It's unfeasible to make AI capable of predicting in advance when and where they'll need an army, or when they can afford a pure builder game.
So we have to change the current dynamic of an economy buildup followed by a military buildup, into a game of standing armies instead.

Outside of an early game ( around the first 30-50 turns depending on map size ), whenever a faction has a neigbour within feasible invasion range, it should always dedicate at least 50% of their economy to military production, unit upgrades and upkeep +/- depending on ai_fight value. If they get involved in war, or are planning an attack increase it to 75%, if they are loosing a war against stronger enemy go 100% war effort.

To prevent human player from getting ahead economically by playing a pure builder game, make AI relentlessly aggressive toward any neighbour that doesn't have a standing army of comparable strenght.

To prevent AI stalemates, you should teach AIs involved in war to agressively pursue geographically feasible alliances and make them really open to accepting an opportunity of backstabbing a neighbour that is already involved in war and seriously commit to the joint war effort. If their alliance has a clear upper hand over their enemy, go 100% war effort to finish the war as quickly as possible, otherwise stay at 50-75% to not stall their own economies completely, while they are stalling the enemy economy.


Title: Re: SMACX Thinker Mod
Post by: JoGr223 on January 24, 2022, 11:04:44 AM
I was observing different faction AIs and noticed hive can go tens of years with negative income - despite this they still build a ton of facilities; how is this possible ? it seems like some critical bug, as I'd expect their whole infrastructure should get demolished due to eco problems so that they can only keep what they can afford

eg attached game - hive is the strongest yet they have -154 income and dont seem to lose any facilities
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 24, 2022, 11:35:40 AM
> I was observing different faction AIs and noticed hive can go tens of years with negative income - despite this they still build a ton of facilities; how is this possible ?

What we have here is probably the previously undocumented AI maintenance bonus on transcend. It's not mentioned by vanilla documentation but I've added it on Details.md previously. AI pays only 1/3 maintenance on transcend and 2/3 on thinker. The values you see on economy screen are not(?) corrected for the bonus (and they couldn't be easily since it would require using fractions). So that's the way it is.

> So we have to change the current dynamic of an economy buildup followed by a military buildup, into a game of standing armies instead.

What you're describing in the post is not far from how it's implemented currently, but it doesn't use those fixed percentages for it. For example in most cases war with adjacent neighbors should result in the vast majority of production being used for combat units. It might be that the calibration is off on smaller map sizes. I haven't run additional testing on them in a while. I think I recall another player already commenting it built quite a lot of units, maybe too much, in their game.

> To prevent human player from getting ahead economically by playing a pure builder game, make AI relentlessly aggressive toward any neighbour that doesn't have a standing army of comparable strenght.

Note these diplomacy behaviours are still handled by the vanilla AI. To change them would probably require some rewrites of wants_to_attack, enemy_diplomacy and maybe other functions. And then more testing. So not sure when that would happen if it's going to happen.
Title: Re: SMACX Thinker Mod
Post by: dino on January 24, 2022, 11:51:24 AM
I wasn't advocating for fixed percentages, they were there to just give idea what imo should be the aim.

I didn't play the latest version yet, but the issue was not that they didn't build enough units when involved into drawn out war, in fact we should make it sure they won't go 100% war economy, unless they are on the brink of destruction/victory, to not stall their economic growth.

The issue was that when they happened to not get involved in war, they could build wast empires that remained practically undefended, free for the taking by a human player.
Solution imo is to maintain a significant standing army regardless of circumstances and force the human player to do the same, by attacking him if he is undefended.

In practical terms:

1) Either upgrade, or disband in a base obsolete useless units.
2) Maintaining an army consuming around 50% of mineral production is imo a minimum to withstand a surprise attack by a human player. If they are alone on their main continent they could go by with around 30%, since planes and ship transports make invasion force cost double.
3) Attack easy targets that try to play a pure builder game.
4) Do not go over 70% war economy, unless on the brink of destruction, or victory, to not stall growth during prolonged conflicts.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 24, 2022, 12:13:16 PM
> The issue was that when they happened to not get involved in war, they could build wast empires that remained practically undefended, free for the taking by a human player.

So I'm wondering if this is just speculation or have you actually encountered this stuff in an actual game with any recent version. It's not the same than some really old versions which maybe had the issue. They also have some priorities which increase military unit production after expansion phase so it should not ever be the case that defense buildup is neglected entirely. Maybe they could use more tuning, but again, it should not be overdone or else economy suffers. It's quite hard to come up with robust rules for all situations. But I agree they should have a standing army. Config file has conquer_priority value for additional tuning.
Title: Re: SMACX Thinker Mod
Post by: dino on January 24, 2022, 12:30:06 PM
It's based mostly on JoGr223's description of his game, when he could build up army from zero and conquer 8 bases in 8 turns.

Probably if they had bigger army but let it idle, they wouldn't be competitive economically, so it can't be done in isolation, it has to be coupled with agressive pursuit of weak targets, forcing everyone into at least a "cold war".
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 24, 2022, 03:59:26 PM
> I added some war economy adjustments in WTP. Would be interesting to compare if WTP AI faction can produce more units during war.

What kind of changes specifically? Otherwise it's not going to be useful comparison unless you can isolate the production changes from the rest of the WTP code. There's too much uncontrolled variables in the test.

If the AI produces more units, there's also one indirect downside that must be considered. When AIs fight each other they are of equal skill level which makes the conflicts take a really long time. If they dedicate 100% of their resources for each war, they will neglect economy building and other factions will gain an advantage there. It would become more easy to just play AIs off against each other and watch them stagnate. Maybe it could be made such that it does this only when fighting player factions, but I'm not sure if that would become immersion breaking.

First, you are absolutely right it is difficult to do a scientifically exact comparison as there are tons of other differences and issues at play. I am just curious and won't take the result of this experiment as some definitive answer.

Here is the change in nutshell. At the beginning of the faction turn AI computes "threat level" from other faction combat units combined. The computation is quite complex. It accounts for diplomatic status, unit strength, unit proximity to faction bases, ability to reach it (same or different continent), current defensive power, some cross unit type effectiveness, blah-blah. Many parameters. Then it uses this value to bump military production (combat units, probes, military facilities) priority over non-military.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 24, 2022, 04:06:47 PM
I'll be boring, but I'm going to reiterate what I was already proposing.

It's unfeasible to make AI capable of predicting in advance when and where they'll need an army, or when they can afford a pure builder game.
So we have to change the current dynamic of an economy buildup followed by a military buildup, into a game of standing armies instead.

Outside of an early game ( around the first 30-50 turns depending on map size ), whenever a faction has a neigbour within feasible invasion range, it should always dedicate at least 50% of their economy to military production, unit upgrades and upkeep +/- depending on ai_fight value. If they get involved in war, or are planning an attack increase it to 75%, if they are loosing a war against stronger enemy go 100% war effort.

To prevent human player from getting ahead economically by playing a pure builder game, make AI relentlessly aggressive toward any neighbour that doesn't have a standing army of comparable strenght.

To prevent AI stalemates, you should teach AIs involved in war to agressively pursue geographically feasible alliances and make them really open to accepting an opportunity of backstabbing a neighbour that is already involved in war and seriously commit to the joint war effort. If their alliance has a clear upper hand over their enemy, go 100% war effort to finish the war as quickly as possible, otherwise stay at 50-75% to not stall their own economies completely, while they are stalling the enemy economy.

I approached this slightly in WTP already by accounting for distance to neighbor and their army strength in continuous way, not just 50-75-100.

The diplomacy and war choices is a serious AI work, though.

With this in mind, it is theoretically possible to make AI play like a chess pro. However, the question is whether you want it to be that strong and stomp you every time. Wouldn't you want to eventually win?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 24, 2022, 04:12:35 PM
It's based mostly on JoGr223's description of his game, when he could build up army from zero and conquer 8 bases in 8 turns.

Probably if they had bigger army but let it idle, they wouldn't be competitive economically, so it can't be done in isolation, it has to be coupled with agressive pursuit of weak targets, forcing everyone into at least a "cold war".

WTP should build units to match opponent forces even when there is no war. The proportion is less for treaty and even less for pact but it exists. That is why I was curious to check this mechanics at play and whether it could prevent such failure. I am sure Thinker does something similar but the testing and tuning never ends.
Title: Re: SMACX Thinker Mod
Post by: dino on January 24, 2022, 10:39:21 PM
> However, the question is whether you want it to be that strong and stomp you every time. Wouldn't you want to eventually win?

I don't think you have to worry about making AI good enough to beat you on difficulty level without cheats. If you've managed to make an AI requiring drop to thinker difficulty from transcend, it would make for a much more satysfying experience, while transcend would remain as ultimate autistic challenge.

Unfortunately I'm too busy to play recently and only follow changelogs of thinker and WtP, I guess I should stop trying to provide feedback untill I have a chance to try your latest efforts.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on January 24, 2022, 11:59:46 PM
Don't worry about it! Plenty of people express their opinion without having an experience. That is completely natural.
😀

Besides, I am asking for your past experience and thoughts. Nothing specific to a certain version.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 25, 2022, 12:14:46 AM
Here is the change in nutshell. At the beginning of the faction turn AI computes "threat level" from other faction combat units combined. The computation is quite complex. It accounts for diplomatic status, unit strength, unit proximity to faction bases, ability to reach it (same or different continent), current defensive power, some cross unit type effectiveness, blah-blah. Many parameters. Then it uses this value to bump military production (combat units, probes, military facilities) priority over non-military.

It seems like you probably rewrote some ideas from Thinker's algorithm with different coefficients. And some parts are probably different. But it looks like there might be a lot of other issues in WTP. I'm not particularly motivated to spend time on analyzing WTP's version unless there's some evidence the solution works better.

There also isn't anything stopping from doing A/B testing with multiple versions of some code. Just have a couple of factions play against themselves and see if there's any notable differences.

Related to that, at one point I considered adding a new feature to the map generator which would produce maps with mirrored layouts, e.g. mirror along X/Y axis or both. Landmarks would cause some issues there because some of them would be messed up so it might require disabling them. Maybe that kind of feature should be added to the mod.

The diplomacy and war choices is a serious AI work, though.

With this in mind, it is theoretically possible to make AI play like a chess pro. However, the question is whether you want it to be that strong and stomp you every time. Wouldn't you want to eventually win?

The branching factor in chess is quite large but amenable for brute force search. In Go it's even larger and brute force approach starts to fail. These kind of strategy games have a way larger branching factor because of the large decision space. Also do you want to treat it as a perfect information game? Technically it isn't so, but sometimes the AIs are given help there. I would use some other comparison than "chess pro" because of these technicalities.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on January 29, 2022, 03:49:06 PM
I'm greatly impressed by the new world generator. I haven't even had time to sit and play yet, I've just been having fun quick starting over and over to see the results. I like what you've done with the equatorial jungle, too. Should be interesting.

There is a bug, at least while playing with SMAC-in-SMACX enabled. The Fossil Field Ridge fails to spawn correctly (and I don't think it is supposed to with the mod, anyway). There will be a landmark note on the map where it might have been, but no ridge.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on January 30, 2022, 12:44:05 AM
I played a bit today and I've actually had a lot of trouble getting the game to start properly. I made a desktop shortcut for the launcher and added the -smac flag. Sometimes the launcher does nothing (I get a cursor with an hourglass, then nothing happens), sometimes it'll launch in SMAX mode, and sometimes it'll correctly launch in SMAC mode.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 30, 2022, 09:16:50 AM
The map generator is my attempt at procedural content generation, it uses some fancy, newer algorithms. :)

> The Fossil Field Ridge fails to spawn correctly (and I don't think it is supposed to with the mod, anyway).

What do you mean? It spawns correctly on my tests. What map size are you using and which landmarks are enabled?

> I played a bit today and I've actually had a lot of trouble getting the game to start properly.

This issue would have to be reproducible before anything can be done about it. Need more information etc.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on January 30, 2022, 02:01:23 PM
Fossil Field Ridge: This is a fresh install with a default Thinker extracted on top. Like I said, I only have SMAC-in-SMACX enabled by the -smac flag which should stop it from spawning at all because it's expansion content. I started the game and clicked Quick Start over and over to get maps without making any changes beyond the flag. There will be a landmark marker on every map I've made, but there's no fossil terrain graphic and the underlying tiles don't have the "Fossil" or whatever attribute, it's just plain ocean. It's as though it's getting incompletely removed.

It spawns correctly in Crossfire games. When I disable it in thinker.ini, it correctly stops spawning. When I disable your map generator, it stops spawning. The Unity Wreckage terrain and marker (correctly) haven't appeared on any of the SMAC-in-SMACX maps, it's just the Fossil Field Ridge and just the marker.


Launcher woes: I'll look for a pattern, but it seems to be random. It could be a Windows 11 quirk. I'll try it on Windows 10 if I get the chance. I changed the install directory from the GOG installer's default, if that matters.
Title: Re: SMACX Thinker Mod
Post by: Induktio on January 30, 2022, 10:03:12 PM
> Fossil Field Ridge

Yeah that is an oversight, it should not be there because it's also disabled by the default world builder. Instead of Fossil Field Ridge the current version disabled Manifold Nexus and Unity Wreckage from smac-in-smacx.

I thought Manifold Nexus would be expansion content because the description references progenitor stuff, but now that I checked, vanilla SMAC binary seems to also spawn Manifold Nexus on the map for some reason. It's the latest official patch provided by GOG, so maybe it was added to vanilla in the patches? I'm not sure now. Seems a little odd. Hard to say if it should remain in smac-in-smacx mod.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on January 30, 2022, 11:38:13 PM
> Fossil Field Ridge

Yeah that is an oversight, it should not be there because it's also disabled by the default world builder. Instead of Fossil Field Ridge the current version disabled Manifold Nexus and Unity Wreckage from smac-in-smacx.

I thought Manifold Nexus would be expansion content because the description references progenitor stuff, but now that I checked, vanilla SMAC binary seems to also spawn Manifold Nexus on the map for some reason. It's the latest official patch provided by GOG, so maybe it was added to vanilla in the patches? I'm not sure now. Seems a little odd. Hard to say if it should remain in smac-in-smacx mod.

That's right, the Manifold Nexus and also the Borehole Cluster were both added by patch to SMAC to foreshadow the upcoming Alien Crossfire lore. Which is why I love your mod's ability to disable those, too. :) Fossil Field Ridge and the Unity Wreckage were the only ones added directly by the expansion.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on February 01, 2022, 07:05:38 AM
Seems, changes in diplomatic status do not cancel probe teams (including probe foils) orders. This leads to odd attacks: for example, mind controlling a base next turn after cease-fire, or tech steal immediately after signing alliance.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 01, 2022, 03:02:30 PM
AI does not save their plans over turn. Unit order recalculated every turn.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 01, 2022, 09:56:07 PM
> This leads to odd attacks: for example, mind controlling a base next turn after cease-fire, or tech steal immediately after signing alliance.

Hmm yeah, that might be another oversight. It is probably quite easy to reproduce it but if you have some save game that exhibits this problem, you can also send it to me.

> AI does not save their plans over turn. Unit order recalculated every turn.

That is not accurate with Thinker. Probe units will usually continue towards their assigned move target without checking if the treaty status changed in the meantime, which is the cause of this problem. And there are also some other plans that are preserved in the save game.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 01, 2022, 10:50:15 PM
> topic: AI can't fight even when they are "on paper" strongest faction and initiate war
..
Dry maps are generally worse for AI performance too. If you want more challenge, try also using blind research, otherwise with the default tech tree it might be too easy to rush some techs.
..
Generally the AIs might not have the time to build up during the first 80 turns if the game settings are unfavourable for them. You can try changing conquer_priority=150 or something so the AI will build more units. Sane values for that setting are somewhere in the range 50..250.
..
The AI already has some priorities which cause it to increase combat unit production if it loses bases, but it's probably not going to help much on smallest map sizes.

ok, so I took this info and based on that designed challenge with better developed AI  :) result of which I describe here:
2268: total war against 3x stronger AI with cloning vats
https://alphacentauri2.info/index.php?topic=21766.0

I comment on Thinker AI there too, it's too big to keep everything in this single thread here
Title: Re: SMACX Thinker Mod
Post by: dino on February 02, 2022, 02:57:09 AM
With the original ruleset it's impossible to make AI capable of defending against the player, just do the math:

The odds of attacking an armored defender in a base with perimeter defense are 1:1. To destroy 10 armored defenders, you need 15 attackers: you wil loose 5, 5 near death and 5 almost unscatched.
As an attacker you'll suffer half the loses of a defender if you have 50% advantage in a number of units brought to a base assault, ridiculous !!!
If you bring few more multi moves units to the battle you can also after destroying armored units wipe out with no loses as many low armor units as you have moves.

As a human player you can theoretically wipe out in the first few turns of war 3x the size of your army and take over 30-50% of bases.
In mid and end game if the player / ai would play properly, the war is simply won by the side that starts it, it's all there is to it, unless attacker is much smaller.

The *active* defense is even more ridiculous, between combat odds and collateral  damage, cheap rovers and copters can wipe 2-4x the amount of approaching units with no loses.
So the player can easily play builder game and and fend off few times stronger AI opponents with minimal army, then easily wipe them out in few turns mid game.

***
The combat rules in SMAC are fundamentally broken, no amount of AI improvements will change it, so there is no point in both playing and developping combat ai without addressing it:

1) Edit armor values in alphax.txt to change att/def ratio from 2:1, to around 3:2.
Now assault odds for a base with perimeter are 3:4, doesn't look like much change from 1:1, but with the way combat and health points work, to take out 10 armored defenders you'll need 20 units.
15 will be destroyed, 5 will have 50% health, so now as an attacker you'd need 100% numbers advantage and suffer 50% more losses then the defender, to conquer a base.

You won't be able to win a war against an opponent of comparable size in few turns and as long as AI bring enough units through it's disorganised stream of units to conquer even a single base and park some undamaged defenders in it. It'll be almost as effective as mass assault, since you'll have to loose as much resources to take it back as AI lost, at this point it's much more crucial who can replace units faster, then who attacked first.
This also changes the odds of defending in a rough terrain, or a base without perimeter to 1:1, much more sane than vanilla were the odds are in a favour of the attacker.

2) No instant healing with command center, only 20% per turn.
Further limits how many bases you can take out in a single turn, since if all your assault force will be damaged, it will be destroyed in a counter attack.
It both limits the advantage of initial mass assault and forces you into 2-3 turns break to repair your forces, giving AI time to counter attack.

3) Disable collateral damage from loosing a unit in a stack.
This change, combined with att/def ratio of 3:2, makes *active* defense with fast unarmored attackers no more effective than passive defence with armored units behind perimeter.
Which makes easy no loses defence against ai during early game impossible.

I'd make this configuration default in thinker, with vanilla rules either ai will be always defenseless, or player will be if you teach it to attack first with mass assault properly, playing both options is, or would be unfun and pointless. These changes, makes ability to make an initial mass assault advantegous, but the ability to produce units faster more crucial and between ai bonuses and thinker improvements AI is good at producing stuff. It should also make smaller maps more viable for AIs, since it shouldn't be possible to wipe anyone with 2-3 impact rovers even early.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 02, 2022, 03:16:02 AM
Launcher woes update: So I've had intermittent failures to launch with thinker.exe on two separate PCs, one on Windows 11 and another on Windows 10. What I've done on both was set up a desktop shortcut, added the -smac flag to the shortcut path, and used the shortcut. It will often not start anything, and when it does start the game it will not always respect the -smac flag. Am I the only one experiencing this?

What's really weird is if I run thinker.exe from a PowerShell prompt, the launcher almost always works, but it still doesn't consistently respect the -smac flag.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 02, 2022, 01:37:24 PM
combat rules in SMAC are fundamentally broken

you don't actually use convincing arguments to support this statement; I will just say: it works in MP -> its not broken; some things can be considered too strong/cheap/useful/too early e.g needlers,copters as they give "unfair advantage" compared to player/AI without these techs

basically you advocate to "nerf fighting" make attacking weaker; I think this would make game less "fun" actually; your main point is about attack/def ratio change to 3:2; I think you dont consider enough the fact attacker also have to move the units into enemy territory, while defender doesnt - this is huge cost for attacker; your propositions would likely make attacking entirely pointless

It seems like u kinda make contradictory points: once you say attacking is too strong, but then you say "but 1 copter can kill all enemy attacker" - ok but that doesnt prove combat is broken, it just shows dynamic completely changes while copters enter the game, you need to play land units completely different; I do think mind/machine tech appears too early, but the fact it also gives you drop pods is kinda good balance to support different role for land units once copters appear

Quote
With the original ruleset it's impossible to make AI capable of defending against the player, just do the math

math has nothing do to with it, AI just cant fight; what you advocate would just mean "dumb AI" is better at "dumber units" (more equal attacker/defender ratios == dumber, less specialized units), so I'm against that; of course it's possible to make better AI -> make it use more optimized strats like the ones I described in the 2268 game thread

Quote
with vanilla rules either ai will be always defenseless, or player will be if you teach it to attack first with mass assault properly

this is not logical statement - if AI is taught to fight properly then it makes it more equal in fighting to humans -> more fun challenge for humans; so it doesn't make human player defenseless; other factors like cheating by AI by having growth/ind/tech-speed bonuses then come into factor, but are adjusted with difficulty levels
Title: Re: SMACX Thinker Mod
Post by: dino on February 02, 2022, 02:42:11 PM
My balance proposal is simple: flat terrain favours attacker, rough terrain/base odds are even, perimeter/bunker favours defender.

I've explained my points well enough, there is no point repeating myself, to counter you. If you don't understand why defender inside defensive structure having an advantage is a staple of every serious strategy game and a real world experience, then we are not going to understand each other. Good luck writing an algorithm that can plan and synchronise units movements like an experienced player, to play the game of "I attack first, I win with little loses", regardles of whether it's actually a desired puzzle to have as a combat for a strategy game. This very conservative rebalance I've propsed only slightly changes the balance of importance of tactics vs strategy ( economy and planning ), there is still plenty of room for rewarding micro.

Sid Mayer's design philosophy for Civ series was to make rules, that make the experience easy and satysfying for a casual player of all ages, not to provide an interesting challenge for autists like us.
This is why you can efortlessly steamroll 3x stronger enemy, when you feel like it. I'm not bashing Sid here, it's just a paraphrased quote from an interview, we were never the main target audience for these games.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 02, 2022, 05:08:08 PM
I understand you are quite aware of both Thinker and WTP mods. Not to specifically advertise WTP one but everything you mentioned is implemented there for this exact purpose that you explained: to make defense viable. I'd like to clarify whether you advocate porting these changes to Thinker or just highlighting general vanilla war imbalances?

I 100% agree with what you said. Actually it is just repetition of all 2 year old discussion on war balance. However, I doubt Induktio will be porting this changes into Thinker as it is too far from its mod goal (AI improvement). I would also advise him not to as his mod is pretty much concise and complete in fulfilling declared goal.

With the original ruleset it's impossible to make AI capable of defending against the player, just do the math:

You are absolutely right here if you mean passive defense does not pay off against direct assault. Vanilla ruleset favors sneak attack and blitzkrieg. So to make your statement precise we should say that passive defense is not a viable strategy in vanilla. And that is what vanilla AI is doing.

It is, theoretically, possible to teach AI to do the same what player does - accumulate assault forces and launch sneak attack making AI a competitive opponent. However, the mere fact that one singe assaults wins the game is quite disturbing for 400 turns 4X strategical game concept. It makes all careful building and expanding planning obsolete and overall game not interesting. Therefore, I would advocate on fixing ruleset first as you proposed and then tuning up the AI toward that ruleset. As you can clearly understand that different rulesets lead to different optimal strategies and, subsequently, to different AI programming.

The combat rules in SMAC are fundamentally broken, no amount of AI improvements will change it, so there is no point in both playing and developping combat ai without addressing it:

Same thesis I just expressed above. Interestingly enough this is already implemented in WTP in almost the same way you described it. Again, this is not a self advertisement just a reference to some existing implementation and previous discussion to support the argument.

1) Edit armor values in alphax.txt to change att/def ratio from 2:1, to around 3:2.

Armor value is adjusted and lined up with weapon one. They are also synchronized in research tree to assure their more or less parallel progress so that contemporary armor is 1:1 to contemporary weapon. That gives defender default 2:1 advantage behind PD.

2) No instant healing with command center, only 20% per turn.

This is an exact value in WTP.

3) Disable collateral damage from loosing a unit in a stack.

That is too.

Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 02, 2022, 05:30:12 PM
Quote
with vanilla rules either ai will be always defenseless, or player will be if you teach it to attack first with mass assault properly

this is not logical statement - if AI is taught to fight properly then it makes it more equal in fighting to humans -> more fun challenge for humans; so it doesn't make human player defenseless; other factors like cheating by AI by having growth/ind/tech-speed bonuses then come into factor, but are adjusted with difficulty levels

I agree with you here as I stated before: it is theoretically possible to teach AI beat the human. Like they did in chess. And chess is a very good example of exceptionally imbalanced collection of pieces. It is so imbalanced one can lose at second turn! So no dumb algorithm using stupid pawn frontal assault will do. Chess is a pure combat game. The goal is to destroy opponent. SMACX is not. It is a combination of many elements and it is possible to win with cooperation and without destroying everybody else. So sure. Viable "blitzkrieg" strategy make war part of game more interesting but it diminishes other parts of the game like development, expansion, accent to transcendence. And that is the major complaints for this imbalance.

Total war (or total war oriented mindset) could work for multiplier games. After all most of the multipliers are about fight to the death between human participants when AI is just a fodder. However, it does not work for single player one where player may role-play or try to build and empire or develop, etc. Fighting human never get boring as both sides learn and present new and new challenges to each other. Fighting AI gets boring as AI does not learn. That is why there is no notion of *balance* in multiplayer but there is in single-player. The single-player *balance* is just a predefined finely tuned ruleset of the game that makes it last longer before it becomes completely boring. The one that prolongs player learning curve until they able to beat it every time.

I would turn your statement around by saying multiplayer is never broken. There is no point to measure the game by it. Single player mode is the biggest challenge.

Therefore I am with dino on it. 1) Ruleset need to be adjusted to make war not a single prevalent strategy and 2) AI should be continued to be tuned to present more challenge to player.
Keep in mind, though, neither dino nor me advocate for an absolutely impenetrable defense. It should be more economically effective in some cases but less in others, etc. Like base behind PD should be an ultimate sanctuary that is most difficult to destroy and it definitely should present more economical losses for attacker. Not if units fight in the open. So more powerful and/or skillful opponent should be able to win but they have to be more powerful and skillful for that! That is the only thing we promote. That translates to build/fight decision in multiplayer games too when immediate assault at the beginning of the game is easy to deflect and it may or may not be the best strategy! So player needs to weight their options more carefully.

And 3) yes, we are not an intended audience for games in general. That is why we are doing our own games (even if on a base of existing ones). 😁

There are not many of us. Let's get together and find good rational core in each others ideas to please ourselves and each other. Ability to converse with equally mindset people is precious!
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 02, 2022, 06:46:57 PM
Ruleset need to be adjusted to make war not a single prevalent strategy

do you mean prevalent as "most commonly deployed by AI" or as "the most effective strategy to win by human/AI" ? if the former then simply you can modify in each faction settings flags ai-fight to -1 and ai-power to 0 and everyone should behave like angel ? :)

since you nerfed attacking in your mod I assume you either mean both or the latter
if you think it's single best strategy to be warmonger then I don't agree, actually more likely the opposite is true: peaceful play is the most optimal for winning. This is true for most factions but with exceptions for a few war-minded faction like hive: basically often hive has to fight or blackmail to get techs, this is kinda their destiny, thats how they were designed. But since hive is a weak faction and freemarket factions are the best eg morgan,lal,univ and for these best factions peaceful play is optimal, therefore the conclusion is that peaceful play is overall the best

Here are the main arguments:
1) in 1v1 scenario whoever starts war usually is at disadvantage;  let's say we play peace morgan1 vs warmonger morgan2; this is because if peaceful opponent will play optimally he will make sure not to be surprised: so for example in typical scenario let's say our closest bases are 20 squares apart and war will be executed using 4-1-2 units. So with infiltration morgan1 realizes morgan2 is amassing army: he will make sure to have some contingency defence units in place and some scout units; since morgan2 is amassing army morgan1 will know he needs to prepare too; so now when morgan2 is making army units morgan1 is still making crawlers for a few more turns - morgan1 knows it takes at least 10 turns for enemy to arrive, and since he has a few scouts he will exactly know at least 5 years ahead before enemy can touch any of his base (scouts are on boarders); so even if u have two factions that are exactly the same , they have 20 bases each, then whoever starts war preparation will by necessity have smaller industry potential; even if it was just 1 crawler more per base x 20 bases then this is huge advantage for peaceful player; now consider also that warmonger can't run freemarket when he moves units outside his territory; this 1) statement is true whichever factions face each other if all else is equal (i mean random factors excluded); even for hive vs hive if tech-parity is given;in typical scenarios especially it is even true for lal vs hive or gaia vs lal etc
2) in global game aspect of 7 factions: whichever factions fight they just kill each other, while the rest benefits; this is always true and pure logic; fighting factions just change balance of power between themselves while bleeding; meanwhile others grow in every aspect; this is true whenever there are at least 3 factions in game of course: if 2 fight, the 3rd benefits

of course there are some limitations to this: first the territory - on tiny maps especially this will be less true as areas of growth are limited: if u cant expand vertically, then peaceful play is mostly either teching or vertical growth;
but even in this 2268 game i just played on standard map: if i was not attacked by hive and lal i could just make mass drop colony pods +sea colony pods and get 2x base count in 5 years; actually it would be interesting to see how much morgan there could gain in 10 years - this could be run as a challenge with diplomacy edit of permanent pacts with everyone except hive where permanent truce is set

the other limitation factor is tech: the more tech is already discovered by everyone the less is yet to be discovered so the teching will give less advantage; if everyone is at 100% tech then of course it is not a differentiator any more; so the lesser the differentiator it is the more it may make sense to just go war

to put it simply: peaceful play gives biggest ROI; ROI from conquering bases is much worse than for example just building crawlers 
Title: Re: SMACX Thinker Mod
Post by: dino on February 02, 2022, 07:08:39 PM
I understand you are quite aware of both Thinker and WTP mods. Not to specifically advertise WTP one but everything you mentioned is implemented there for this exact purpose that you explained: to make defense viable. I'd like to clarify whether you advocate porting these changes to Thinker or just highlighting general vanilla war imbalances?

We've already convinced Inducti0 to implement these in thinker as optional features, I'd personaly make it a default config, but I know it's unlikely that Inductio would go for it.
I was just trying to at least advertise these balance changes to players who are after some kind of a "vanilla plus" experience and wouldn't try WtP.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 02, 2022, 09:46:21 PM
Ruleset need to be adjusted to make war not a single prevalent strategy

do you mean prevalent as "most commonly deployed by AI" or as "the most effective strategy to win by human/AI" ? if the former then simply you can modify in each faction settings flags ai-fight to -1 and ai-power to 0 and everyone should behave like angel ? :)

Sorry, I didn't understand the difference. Prevalent strategy is the one that is computed best in most of the cases (95% for example). It is most effective strategy for both AI and human as it is the most effective strategy in general. The fact that AI does not use it does not make it less effective. It is just AI is missing on this opportunity.

if you think it's single best strategy to be warmonger then I don't agree, actually more likely the opposite is true: peaceful play is the most optimal for winning.
...

Don't tell me you didn't play this game for at least thousands times! Yes, mathematically, one can compute the point of just enough army to defend against aggression. However, this does not work in practice because of following thing.

The army effectiveness is insanely related to army size due to the attack over defense prevalence in vanilla. This is like cubic dependency of even more drastic. If two sides have same total army strength (adjusted for skill) they will destroy each other. However, if one side has just twice as stronger army they incur not 50% losses but 10-20% losses. And if they are triple sized then they most likely incur zero losses. When you are on the edge of mutual army destruction a slight increase in army count results in huge advantage.
Let's say, as in your example, a faction can match opponent forces and have 50% extra production capacity. Then if it spends this capacity for further development and neighbor attacks - both armies will be destroyed and both defenseless factions will be just taken by others. Game over.
Now if this faction uses its 50% extra capacity to double the army and launch preventive strike it'll destroy opponent's army in a matter of few turns, keep about 80% of theirs, and taking all enemy territory as a prize just as a side effect. Then conqueror switches to infrastructure improvement and production power increase, research army refinement, army reinforcement and cycle repeats until nobody can stop it.
Granted doubling territory does not immediately double the production power as these new bases need to be worked out on. But still the growth acceleration is incomparable to peaceful development. I personally saw the jump on power graph when I do that every time and all other players did and I am sure you observed it too. Why arguing that conquest is not the best development strategy?

Your shiny ivory tower mathematical computations are also broken by huge random variations in faction initial development. There are common case when faction is 2-3 time stronger than neighbor. According to your computation extra 20 turns of building army before the assault does not save weaker faction. Stronger one will just send waves and waves of triple reinforcements until its done. Unfortunate factions won't have any chance to survive at all. And that is another thing we are trying to prevent.

Let me reiterate it. The game is designed to last somewhere 300-400 turns. Everything is tuned to that: tech tree, research speed, chassis speed, road speed, map sizes, multipliers - everything! If this game would end every time at turn 100-150 it would omit large portion of its content. Which is what actually happens in vanilla! That is what we are fixing here.

Not sure if I got to you with this. Maybe it requires more detailed explanation.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 02, 2022, 10:45:37 PM
Alpha Centauri Bear
question: do you think if 2 players of same skill play multiplayer (let's say experts) and they play same faction on mirrored map, so no random factors interfere and let's say it's pure 1/1, no AIs in game  (again to eliminate random factors) - then do you think the one of them who will plan a war and attack first (aka warmonger player) will win the game ?

consequently the other player (peaceful defender) will lose ? note that in such scenario I assume peaceful defender can switch to total war once he is attacked and then proceed with total war for exhaustion - he is still considered peaceful player as he didn't start the war, so the war is "justice war" for him and he can righteously kill his opponent as he cant trust him anymore to switch to transcendence mode win (so this is diplomatic assumption for this scenario)

let's assume its standard, round map and they start both on the equator maximum distance away from each other

also interesting how other ppl answer this question

also please specify what would be the optimal moment of attack ? estimated year and with what kind of war technology (eg 4-1-2 or 14-1-12 or nukes or drops ?)
if u wanna answer "largely depends on faction played" then let's assume lal vs lal for brevity :) also would be interesting if u specify any other "war plan" eg how many attacker army, maybe army composition (how many different kind of units) etc

since this is Thinker thread assume Thinker 3.0 mod (it has a few rebalances)
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 03, 2022, 02:05:04 AM
Alpha Centauri Bear
question: do you think if 2 players of same skill play multiplayer (let's say experts) and they play same faction on mirrored map, so no random factors interfere and let's say it's pure 1/1, no AIs in game  (again to eliminate random factors) - then do you think the one of them who will plan a war and attack first (aka warmonger player) will win the game ?

consequently the other player (peaceful defender) will lose ? note that in such scenario I assume peaceful defender can switch to total war once he is attacked and then proceed with total war for exhaustion - he is still considered peaceful player as he didn't start the war, so the war is "justice war" for him and he can righteously kill his opponent as he cant trust him anymore to switch to transcendence mode win (so this is diplomatic assumption for this scenario)

let's assume its standard, round map and they start both on the equator maximum distance away from each other

I am not sure what mirrored map is and how can you switch off all randomness but let's assume you can.

Then the answer to your question is peaceful faction wins taken they are of same production power (an important condition). Your previous computation is absolutely irrefutably mathematically correct as I stated in my previous post. There is no argument about that and we can close this discussion.

This is not the question we are facing when choosing which way to go modding. The question is - what actually happens in the game most of the time and whether we like it and, if not, which way we go to make it more likable for us?

What I am leading at is that your proof is absolutely correct but it lays on top of very important and very rarely occurring condition that both sides are economically equal and no random event will tilt this equality besides player actions only. If you look at if from this point of view you'll realize that it never happens in game built on randomness foundation. So even if your conclusion is true it is not practically applicable to any game related discussion. Sorry, I didn't mean to diminish your logical efforts but we need to acknowledge that to move further. Let me know if you still think your result is applicable (not just true) to the game. That was my opinion only and I may be mistaken as anybody.

As a fun exercise I'll give another analogy. Chess. A completely deterministic game with an absolute ideal initial balance of power and perfectly symmetric position. Following your logic with such balance of power and lack of randomness two armies should destroy each other resulting in draw most of the time. Yet quite often people win and lose. Why is that? You will be surprised but, if you think about it, the answer is attack over defense prevalence!
😁
Indeed there is no defense in chess. Attacking piece wins 100% of times. The only way to counter opponent attack is to sacrifice cheaper piece and counter-attack. The active defense in its utmost form. When a player loses a piece they fall below in number of attacks and balance can never be restored (unless other side make mistakes too) just because number of attacks is the only resource that leads to local wins and even more imbalance in material and so on. Snowballing in action.

Once again. That does work perfectly for multiplayer but sucks in single player. You won't be playing thousand games against chess computer that loses every time, would you?


also please specify what would be the optimal moment of attack ? estimated year and with what kind of war technology (eg 4-1-2 or 14-1-12 or nukes or drops ?)
if u wanna answer "largely depends on faction played" then let's assume lal vs lal for brevity :) also would be interesting if u specify any other "war plan" eg how many attacker army, maybe army composition (how many different kind of units) etc

since this is Thinker thread assume Thinker 3.0 mod (it has a few rebalances)

It is largely depends on ruleset. Answer is different for vanilla - Thinker - WTP - AIGrowth, etc. And could be different for each version albeit slightly.
For vanilla it is certainly Fusion reactor + Needlejet. I don't remember if Thinker adopted WTP reactor modifications. If yes then is it not that straightforward. Ask bvanavery. He has good opinion on it. I would say for Thinker/WTP total war starts after satellites + magtubes + paratroopers.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 03, 2022, 02:20:04 AM
Couple more notes.

First strike does matter obviously but it is less relevant than sheer army size and/or production power. Three times smaller army probably still don't have chance even with the first strike.

I don't understand why people rank factions. Their differences are exceptionally minor comparing to other random factors. The one who lands on jungle wins. They are not only minor they are sanely balanced. You can play pretty much any tactics with any faction barred some exception like Yang should use PS and Miriam should mostly attack. Other than that it is pretty minor factor.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 03, 2022, 02:53:43 AM
I don't understand why people rank factions. Their differences are exceptionally minor comparing to other random factors. The one who lands on jungle wins. They are not only minor they are sanely balanced. You can play pretty much any tactics with any faction barred some exception like Yang should use PS and Miriam should mostly attack. Other than that it is pretty minor factor.

you lost me here  :) maybe cause I have some foundations in science methodology from years ago, which I barely remember, but which lead me to completely different conclusions; and also experience as player so i have very clear views on faction ranking (eg morgan wins vs yang ~90% of times)

you seem not to understand the need of constructing this kind of isolated experiments where randomness is controlled (minimized/eliminated)

another try to explain: let's say we play any faction vs same faction, same skill of players; eg angels vs angels; but 2nd angels is slightly boosted (let's say give them +100ec like morgan has) - given what you say above you consider it completely minor as you consider even bigger differences minor; OK, whatever; you can say other factors matter a lot like being in jungle - this is true; now play million such games with all the random factors; 2nd angels will win more than lose - we can't say now how often, roughly it will depend on number of games played, my estimates:
1) 100 games played - they win 60%
2) 1000 - 70%
3) 1000000 - 95%

maybe at million it will be just 75% - the point is the more such experiments you make the better your confidence about the level of difference between these 2 factions with just minor difference; another point - minor difference translates to major win/lose difference ; same as in sports - if one runner for 1000m distance is better just 2%, he will have seconds/miliseconds better times, but he will win 95% of time

the more you isolate randomness the less games you need to play to say which faction is really better

saying that factions differences are minor is quite bold statement, I will say mildly it's the strongest thing u said that alters my perception of your views on SMAC :)

mirrored map is when you have same, equal starting positions, completely symmetrical map, like for example in starcraft pro games

Quote
Chess. A completely deterministic game with an absolute ideal initial balance of power and perfectly symmetric position. Following your logic with such balance of power and lack of randomness two armies should destroy each other resulting in draw most of the time. Yet quite often people win and lose. Why is that? You will be surprised but, if you think about it, the answer is attack over defense prevalence!

this is not following my logic; "why is that" ? because ppl differ in skill obviously; also it has been researched that there is no perfect initial balance: white is slightly better than black, just because white always starts, IIRC on average white wins like ~52% of time or so; it's small difference, but it is
following my logic you could say if ppl of exact same skill play million games, results will be 50.0001% more wins for player A compared to B (because they also swap sides black/white); also this is actually relatively easy to test and im sure it has been done: by using top chess AI engines like stockfish
Title: Re: SMACX Thinker Mod
Post by: dino on February 03, 2022, 09:43:05 AM
Then the answer to your question is peaceful faction wins taken they are of same production power (an important condition). Your previous computation is absolutely irrefutably mathematically correct as I stated in my previous post. There is no argument about that and we can close this discussion.

Is it always the case with vanilla rules ? Because that is what the question was about and for me it's hard to believe.
I'll present two theorethical scenarios and please explain me how they are not the case in multiplayer.

1) Simplified ideal theoretical  scenario one:
Everything is connected with magtubes, the armies consist of equal number of units with att/def 2:1
In preparation for an assault aggressor neglecting development adds 20% to his units count, all cheap armorless assault units.

With 1:1 against perimeter, the base assault results for 10 defenders are: first 10 engagements 50% losses on both sides, remaining units are near death, three cheap rovers finish remaining defenders and take over a base without much further damage. In the first turn of combat you can wipe out 80% of enemy forces and bases, while suffering 40% military losses, you start on equal footing, you end the first turn with at least 3:1 advantage in bases and units, the war is practcically won before defender could even respond.

2) Scenario two, there are no tubes, no paratroopers, no planes, defender stations a lot of armorless rovers on the border, his bases are connected with roads:
Attacker in most cases can't approach and attack enemy within the same turn, so his forces will be striken down in the open by even 2x weaker defender with almost no loses on the defender side, since in this scenario aggressor doesn't get the first strike on a tactical level and in vanilla SMAC it's the only thing that matters. Successfull offensive against competent player is impossible in this stage of the game.

Both scenarios display how degenerate the ruleset is. With balance changes as outlined, neither side would be immediately victorious and in both cases and they would end up in an economically crippling stalemate instead, so a war against opponent of equal size is pointless unless it's the last two standing total war. Otherwise for a war to be worth it, you have to work out an advantage first: grow bigger, secure an alliance, backstab a faction already engaged in war, sculp and secure some geographically isolated opportunity target ( local advantage ), etc. Once you have an advantage, the offensive should be neither a cakewalk, nor impossible at any stage of the game.

Another accusation was that it would dumb down the tactical combat. I think it's completely untrue, in vanilla you can't play any kind of positional placement and teritory control outside of the bases, the assault consist entirelly out of hopping with fast units from base to base by roads, tubes, or air, it's a death sentence to end a turn with your units in the open. These changes should actually make a wider range of units and tactics viable at any stage of the game.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 03, 2022, 11:20:08 AM
Okay, let's comment on some things.

> 1) Edit armor values in alphax.txt to change att/def ratio from 2:1, to around 3:2.

Regarding this and other ideas, you can always publish a new alphax.txt version with your edits and then we can compare the player feedback. It's also possible to use Thinker's alphax.txt as a base for new modifications. Thinker-specific configuration is separated to its own config file, so there's nothing stopping from distributing new alphax.txt files separately. I would recommend creating a new repo on github for this purpose, so it's easier to monitor the changes.

> 2) No instant healing with command center, only 20% per turn.

Healing rate is already reduced in Thinker's config.

> 3) Disable collateral damage from loosing a unit in a stack.

Maybe? Also another consideration: probe stacks have implicit 100% collateral damage. It might be a good idea to provide a new config parameter for that.

> 1) in 1v1 scenario whoever starts war usually is at disadvantage;  let's say we play peace morgan1 vs warmonger morgan2; this is because if peaceful opponent will play optimally he will make sure not to be surprised

Ah, but this reasoning relies on gaining and having accurate infiltration info. In this respect the vanilla game is very unbalanced and unrealistic. In some other games the intel reports are incomplete or randomized to account for fog of war. I nerfed infiltation with counter_espionage option but maybe it could do more. Especially having exact unit composition/base production info seems a little too powerful.

> Let me reiterate it. The game is designed to last somewhere 300-400 turns.

But if you play using anywhere close to the optimal strategy, you should be transcending by 200 turns. So beyond that is not very relevant given the current game mechanics.

> I don't understand why people rank factions. Their differences are exceptionally minor comparing to other random factors.

Have to disagree here. Let's assume large map size and believers/morgan for example. There's no way believers could keep up on the early tech race if these factions start far away from each other. Maybe AI doesn't push all the advantages to the maximum but even then the differences are clearly seen.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 03, 2022, 12:36:19 PM
> 1) in 1v1 scenario whoever starts war usually is at disadvantage;  let's say we play peace morgan1 vs warmonger morgan2; this is because if peaceful opponent will play optimally he will make sure not to be surprised

Ah, but this reasoning relies on gaining and having accurate infiltration info. In this respect the vanilla game is very unbalanced and unrealistic. In some other games the intel reports are incomplete or randomized to account for fog of war. I nerfed infiltation with counter_espionage option but maybe it could do more. Especially having exact unit composition/base production info seems a little too powerful.

how is this unbalanced and unrealistic? "in some other games"  ;lol I'll say: in some actual realities like we actually live in you have excellent info about each other forces  :) just look at USA/Russia balance today: we see russia creeping on ukraine, we know very well how big are their forces on the boarder; not only intelligence and government forces know it, every citizen has this info available within few seconds of search :) I know peaceful treaties regarding nukes makes auditing process of each other to guarantee balance, idk but maybe similar stuff is for regular armies
when let's say past first half of 20th century there was a war where defended country said "omg i didnt know attacker has 2x bigger army than me" ?

I'd say for balance and "realistic" aspect it would be better if just having treaties meant by default you have infiltration: due to goods and boarder crossing of citizen it's much easier to sustain infiltration; also why in 22nd century specialized intelligence forces would be worse at infiltration ? do you think counter-intelligence measures will evolve in same pace ? short argument against it: complexity, more complexity=harder to cover all potential infiltration areas

also consider instead "very unbalanced and unrealistic." that it was done by design ? to make game actually more peaceful - this is great ! thats why i even turned off this "random infiltration losing" param in my games
if you have treaties currently AI will tell you "withdraw forces immediately" even when don't actually see your forces - i think its good

=======
this entire premise of dino and Alpha Centauri Bear's "change 2/1 to 3/2" is made on unfounded assumption - and this is main argument to "nerf fighitng, conquering is OP"

when exactly do you have 2/1 ? how about sensors +25% to defender ? base +25% defender (when attacked by rover) creche +12,5% to defender; AAA tracking +100% to defender vs air; ECMcomm jammer +50% defender bonus vs fast; specialized anti-speeder armour defender bonus
sensor alone make the entire argument pointless - it's super easy to insta-build, zero cost, v.strong

how about that if you going to war and focus on building army then ur opponent is still teching up ? so he might as well have better armour than you OR better weapon - so instead 2/1 like eg 8/4 which mean 8- vs -4 you may as well be 8- vs -5
OR even more likely 8- vs 10- -- the whole assumption attacker vs "defender's armour" is wrong because defender more likely will use weapons and not armour to defend, eg early game with speeder vs speeder or assult infantry vs speeder;
you guys dino and Alpha Centauri Bear don't talk these details - so i think u just dont know them  :) I asked about army composition of attacker and didnt get any answer
are you aware for example that in 4-1-2 vs 2-1-2 it maybe be more efficient to defend with 2-1-2 ?

where is 2/1 in air fight ? how about aerospace complex giving +100% air def ? so with AAA units u get 4x armour; so you dont have 2/1 ratio but 1/2 ratio + insanely good not to say OP sensor; sensor is so strong that u often actually need to destroy it first before fighting base
also in air fight are you aware that 14-1-12 unit can be killed instantly by 4-1-9sam unit ? and this sam defender is actually ~33% cheaper ! (im talking about scenario where sam unit attacks air to air, not as defender)

in late game what about tachylon ? give bonus both vs land and air; again breaks ur 2/1 ratio even further - but it doesn't even make sense to build it as ur better off defending with weapon-based units not armour based

drop pods: they are great, but get -50% penalty if the attack immediately; +they may get -20% health just for dropping

drop pods with space elevator - this might be OP, but its the ultimate game ender tech

this kind of nerfing of entire conquer aspect of game, and why because AI likes to fight ? this is 4x game not 3x game (removing conquer aspect); beside idk exactly how AI is coded but i know about these flags that make them want to proceed peacefully or warmongering; so its not like "AI is conquering a lot so it must be best strategy" - AI conquers cause thats their DNA

btw If we are not speaking of playing just vs AI, but doing some RPG, lets say human players only, then it would entirely make sense if lal-governor says "i have biggest eco potential and total infiltration and i decide this is peaceful game, I impose total ban on units with weapon >1; if you make single such weaponized unit it will be considered war mongering and act of war against the peaceful factions of the planet"  :)
will anyone dare to question that ? yes, if you make some allies "against peaceful order factions"
my point is if 2 factions are equal or 3/3 allies factions are equal in potential, then its just arbitraty decision if they like to go to war or they like to win peaceful - all output is decided mostly by eco+ind+tech potential anyway
Title: Re: SMACX Thinker Mod
Post by: dino on February 03, 2022, 12:59:20 PM
> but it doesn't even make sense to build [ Tachyon Field ] as ur better off defending with weapon-based units not armour based.

It's like the entire point of the whole issue summed up in a single sentence...

Our change doesn't make offensive combat impossible, it makes deffensive one viable on a tactical level.
Vanilla rules make offensive war impossible untill long range units and magtubes come into play, because defense with weapon based units strike in the open is unbeatable.

Our change makes offensive war challenging but manageable in every stage of the game, if you manage to work out some advantage first, ( although I think WtP went a bit too far with homeland security bonus ).
We consider that to be a more satysfying balance in general, that a more passive by nature AI would benefit from the change is only a bonus, but a crucial one as far as single player is concerned.
And yes, many tactics, unit types and strategies you are used to could stop being as effective and you'd have to conisder new ones previously unviable.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 03, 2022, 01:44:25 PM
> I'll say: in some actual realities like we actually live in you have excellent info about each other forces

Not really. In reality, you won't have constant awereness about opposing forces without spending a lot of effort on intelligence gathering. At least before the satellites arrive, and even then it's possible to disguise forces from surveillance (within limits). Before that, let's say WW2 era, recon was reliant on aerial surveillance flights and similar methods. Real life intelligence gathering is as much about weeding out the incorrect reports as much as it is about gathering new sources. You're going to have to deal with purposefully planted misinformation and faulty data. So the intel is always going to have some limits on the coverage. To me it seems you are clinging on this 100% infiltration mechanic because your strategy seems to be relying on it, and without it the players would have to spend a lot more resources to guard against sneak attacks.

> that it was done by design ? to make game actually more peaceful

I think the most likely explanation here is that they just chose to implement the simplest possible infiltration mechanic without considering how realistic or balanced it would be, e.g. 100% information about base production/unit counts without any chance of losing coverage.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 03, 2022, 01:51:11 PM
you lost me here  :) maybe cause I have some foundations in science methodology from years ago, which I barely remember, but which lead me to completely different conclusions; and also experience as player so i have very clear views on faction ranking (eg morgan wins vs yang ~90% of times)

you seem not to understand the need of constructing this kind of isolated experiments where randomness is controlled (minimized/eliminated)

I try not to use this language as not many people understand it. However, if you like I will gladly do so as I have learned scientific statistical methods in nuclear electronics to process Hugabytes of data from supercollider detectors.

Let's take your statement (morgan wins yang ~90% of times) as an example.
First of all we need to clarify conditions. Do you mean AI vs AI or two humans? Are they only factions in the game or all 7 present? What do you consider win? Is it complete extermination of other or their relative power compared at some point in time? In both cases do you consider draw if they did not kill each other or if they relative power is not too different?
Keep in mind that these two comparison methods are drastically different. Extermination may favor believers but total power may favor morgan, for example. I don't know - just speculating here.

If you are interested in my statement then here it is.
7 AI factions with randomized personalities play multiple times. Their relative power score measured at the end of the game (some faction wins or by end of game). If faction is eliminated its score is zero. Then this score is arithmetically averaged across multiple tries. I claim that each faction average score will be within -50% to +50% range of the total average score (1/7).
Another way of estimating that is to count number of wins each faction gets. This would require more tries to achieve statistical relevance as the win/loss is more discrete value than power score. But even in this case I claim each faction will not deviate more than 50% of 1/7 total wins average.

another point - minor difference translates to major win/lose difference ; same as in sports - if one runner for 1000m distance is better just 2%, he will have seconds/miliseconds better times, but he will win 95% of time

That is absolutely true for cases without randomness. I am exactly saying that it is not the case for 4X games and minor differences will not translate to major differences in win/loss.

the more you isolate randomness the less games you need to play to say which faction is really better

I don't understand why and how you want to isolate randomness while the whole game it just built on it??? The single world generation randomness is a humongous impact on a game. What is the point in isolating it? Let's say you compare faction in absence of any randomness whatsoever. Would that result be then relevant to actual game?
Imagine another random based game like poker, for example. If you play many games in one group you get a feeling player A is better in this game than player B. Now eliminate all randomness: deal everybody same cards. Would player A still be better? Most likely not as this will be a different game.

saying that factions differences are minor is quite bold statement, I will say mildly it's the strongest thing u said that alters my perception of your views on SMAC :)

There are two things people often mix up. Faction features (bonuses/penalties) and leaders personality. Former equally applies to AI and human play. But latter got mixed into AI play as well skewing the perception and test results.
I am talking about faction features only. And I can make this statement because people keep balancing faction features all the time on multitude of forum threads. And reading through these threads I got an impression that there is no clear method to understand which faction is clearly better. And in the years of balancing original factions they are still unchanged or very very close to vanilla which means they were pretty much balancer from the beginning.

mirrored map is when you have same, equal starting positions, completely symmetrical map, like for example in starcraft pro games

I would love to get a hold of one of these if you have it.

Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 03, 2022, 01:59:21 PM
1) Simplified ideal theoretical  scenario one:
Everything is connected with magtubes, the armies consist of equal number of units with att/def 2:1
In preparation for an assault aggressor neglecting development adds 20% to his units count, all cheap armorless assault units.

You are missing the key point of his statement same way as he is missing yours. You are talking about different things!

His key point is that 1) defender has full knowledge when enemy forces attack and 2) defender matches their forces exactly to be able to fend off aggressor without giving up a single base. I don't know how it is done. Maybe by preventive strike on approaching forces. Maybe by increasing number of defenders. Maybe both. The point is that he does not offer any practical example on how it is done just postulates that defender somehow has enough resources to build up counter-army capable to 100% defend the territory. On top of that they have extra time to evolve their economy while enemy forces approach.

As you and I showed already. This theoretical construct has little to do with real game. So do not try to counter it with real game example.
Title: Re: SMACX Thinker Mod
Post by: dino on February 03, 2022, 02:22:13 PM
You can't flood through magtube into a territory that holds only slightly less forces than you and deal an unrecoverably crippling blow in a single turn in real games ?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 03, 2022, 02:26:50 PM
> 1) Edit armor values in alphax.txt to change att/def ratio from 2:1, to around 3:2.

I think this one specifically is too arbitrary. There are 12 weapons and 8 armors. We need to tune complete list with their time of appearance to make a judgement.

Something like here: https://alphacentauri2.info/index.php?topic=21359.msg122437#msg122437

Excessive amount of playtesting is also needed to close up on right values.

Maybe? Also another consideration: probe stacks have implicit 100% collateral damage. It might be a good idea to provide a new config parameter for that.

Nobody yet complained on that. This feature specifically counter probe stacking to prevent multiprobe attacks.

> Let me reiterate it. The game is designed to last somewhere 300-400 turns.

But if you play using anywhere close to the optimal strategy, you should be transcending by 200 turns. So beyond that is not very relevant given the current game mechanics.

Err. That was exactly my point. Beyond that it is not very relevant. In vanilla. That's why some modders try to make it relevant.

> I don't understand why people rank factions. Their differences are exceptionally minor comparing to other random factors.

Have to disagree here. Let's assume large map size and believers/morgan for example. There's no way believers could keep up on the early tech race if these factions start far away from each other. Maybe AI doesn't push all the advantages to the maximum but even then the differences are clearly seen.

Why assume anything? They are, of course, different and suitable for certain conditions. That is how they are designed. Like if Morgan is separated from Miriam for the first half of the game he can gain economical power and then jump over ocean with all modern weaponry. Whereas if they are NOT separated Miriam steamroll him with the swarm of believers.

The question is, based on your assumption, do we need to make Miriam stronger to balance her faction? And the answer from multiple people on multiple forums is NO! Most people think she is strong enough already. Why is that I wonder?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 03, 2022, 02:44:21 PM
although I think WtP went a bit too far with homeland security bonus

This is removed in latest versions and replaced with more unit building and (hopefully) better defensive AI.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 03, 2022, 05:45:15 PM
Why assume anything? They are, of course, different and suitable for certain conditions. That is how they are designed. Like if Morgan is separated from Miriam for the first half of the game he can gain economical power and then jump over ocean with all modern weaponry. Whereas if they are NOT separated Miriam steamroll him with the swarm of believers.

Let's take your statement (morgan wins yang ~90% of times) as an example.
First of all we need to clarify conditions. Do you mean AI vs AI or two humans? Are they only factions in the game or all 7 present? What do you consider win? Is it complete extermination of other or their relative power compared at some point in time? In both cases do you consider draw if they did not kill each other or if they relative power is not too different?
Keep in mind that these two comparison methods are drastically different. Extermination may favor believers but total power may favor morgan, for example. I don't know - just speculating here.

Uhh... So which one it is? Try to decide.

The question is, based on your assumption, do we need to make Miriam stronger to balance her faction? And the answer from multiple people on multiple forums is NO! Most people think she is strong enough already. Why is that I wonder?

Thinker *does* provide one boost for Believers (and any faction with negative intrinsic research value). The 10 turn delay before they start accumulating labs has been removed. It removes some of that pretty serious start disadvantage vs. research factions. And I think Believers are really situational with the start conditions, e.g. 7-player SP game plays very differently compared to 1-vs-1 MP game.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 03, 2022, 06:29:56 PM
in this post i describe hive vs morgan and a bit about univ and faction ranking:

note I speak about vanilla smac/x and/or Thinker AI boost
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 03, 2022, 06:52:04 PM
Why assume anything? They are, of course, different and suitable for certain conditions. That is how they are designed. Like if Morgan is separated from Miriam for the first half of the game he can gain economical power and then jump over ocean with all modern weaponry. Whereas if they are NOT separated Miriam steamroll him with the swarm of believers.

Let's take your statement (morgan wins yang ~90% of times) as an example.
First of all we need to clarify conditions. Do you mean AI vs AI or two humans? Are they only factions in the game or all 7 present? What do you consider win? Is it complete extermination of other or their relative power compared at some point in time? In both cases do you consider draw if they did not kill each other or if they relative power is not too different?
Keep in mind that these two comparison methods are drastically different. Extermination may favor believers but total power may favor morgan, for example. I don't know - just speculating here.

Uhh... So which one it is? Try to decide.

These are from completely different context. I don't even understand why you want to compare them.

First is from faction bonuses discussion when author mention that Morgan is stronger than Miriam on large map when they are separated. I confirmed that this could be true but this does not equate in "Morgan > Miriam" for rest of the conditions. That is why I don't see a point in considering isolated conditions.

Second one is discussing specific conditions for statistical experiment. They are needed so we can actually have this experiment in foreseeable future and agree on outcome. This probably won't help deciding whether one faction is generally stronger but it may support further conversation on specific details.

The question is, based on your assumption, do we need to make Miriam stronger to balance her faction? And the answer from multiple people on multiple forums is NO! Most people think she is strong enough already. Why is that I wonder?

Thinker *does* provide one boost for Believers (and any faction with negative intrinsic research value). The 10 turn delay before they start accumulating labs has been removed. It removes some of that pretty serious start disadvantage vs. research factions. And I think Believers are really situational with the start conditions, e.g. 7-player SP game plays very differently compared to 1-vs-1 MP game.

Yes. People keep modifying faction bonuses based on author perception of their fairness. You do this, I do this, and every other modder. The fact that I drawing everybody's attention to is that these modifications are not uniform across the community. There is not even common agreement which faction need to be boosted/nerfed least about specific value of their bonuses. For example, many people think that 10 turn of no research for Believers is not that impactful and that they are perfectly capable of catching up pretty soon. They have very good reasoning behind that confirming it with their previous games, etc. Obviously, neither side can prove this to other as majority of arguments are subjective. However, the mere fact that there is no common community agreement shows that SMAC factions are more or less balanced. Whereas most community agree, for example, that Cyborgs and aliens SMAX factions are overpowered to the extent they are banned from multiplayer and that tells me something.

Yes. AI playing faction and human playing faction are quite different things. All factions are situational. Morgan is situational in NOT having Miriam next to him.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 03, 2022, 07:35:30 PM
To me it seems you are clinging on this 100% infiltration mechanic because your strategy seems to be relying on it
and to me the way you implemented it is just as lazy of a nerf as the original "infiltration is permanent"  :P

as you are aware im not a fan of randomness; and u don't even provide info how this feature exactly works, so i can't calculate my odds; just as i always play game setting "bellcurve:random event off" and "no supply pods" i turn off also this random event feature
this is actually a good idea ! make it that it's tied to bellcurve - if random events are on, then u have random expiration, if no random events, no random expiration of infiltration
and/or: setting up infiltration can work like other probe actions and have chance of failure
and/or: infiltration is set to some specific timing, that can be based on some critiria eg if it was setup in big/small city
eg: city lvl1-5 "we estimate our agents can safely operate for the next 30 years"
lvl =>6 "we estimate our agents will have to be evacuated in 15 years as city's counterintelligence forces are strong here"

i don't agree its imbalanced with permanent, where is ur argumentation ? imbalanced against what ?
it's also more fun to see what others are doing; imagine playing 20h game in multi with no infiltration, its so much less interesting; then it turns out one side is totally winning and other player reacts "omg so i just wasted last 5h because i didnt know i have no chance and should have resigned already back then"

generally also if ur then attacked by "sudden strike" its less interesting cause it can lead to "sudden death" and a lot of frustration
turn based "long" games are generally better imo with full information

Quote
because your strategy
do you actually think there is anyone's strategy or "any strategy" that is not relying on infiltration ?
if everyone plays no infiltration game, then it's just boring, you dont know whats happening around the world; its like you had no news and journalists, games feel much more "lonely" :)

also: if someone attacks let's say with 30 4-1-2 without infiltration ? pointless and he may be up to some real frustration when he realize enemy already has needlers
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 03, 2022, 08:41:31 PM
These are from completely different context. I don't even understand why you want to compare them.

First is from faction bonuses discussion when author mention that Morgan is stronger than Miriam on large map when they are separated. I confirmed that this could be true but this does not equate in "Morgan > Miriam" for rest of the conditions. That is why I don't see a point in considering isolated conditions.

Second one is discussing specific conditions for statistical experiment. They are needed so we can actually have this experiment in foreseeable future and agree on outcome. This probably won't help deciding whether one faction is generally stronger but it may support further conversation on specific details.

This was a direct response to your comment below. It provided a counter example to your point to illustrate how the faction properties are in some circumstances very essential in determining the likely winner for some game. Not just who happens to get the jungle or something similar.

I don't understand why people rank factions. Their differences are exceptionally minor comparing to other random factors. The one who lands on jungle wins. They are not only minor they are sanely balanced. You can play pretty much any tactics with any faction barred some exception like Yang should use PS and Miriam should mostly attack. Other than that it is pretty minor factor.

Yes. People keep modifying faction bonuses based on author perception of their fairness. You do this, I do this, and every other modder. The fact that I drawing everybody's attention to is that these modifications are not uniform across the community. There is not even common agreement which faction need to be boosted/nerfed least about specific value of their bonuses. For example, many people think that 10 turn of no research for Believers is not that impactful and that they are perfectly capable of catching up pretty soon. They have very good reasoning behind that confirming it with their previous games, etc. Obviously, neither side can prove this to other as majority of arguments are subjective. However, the mere fact that there is no common community agreement shows that SMAC factions are more or less balanced. Whereas most community agree, for example, that Cyborgs and aliens SMAX factions are overpowered to the extent they are banned from multiplayer and that tells me something.

I think you're conflating some concepts about how game theory works here. We're dealing with a finite, (in MP contexts usually) zero-sum, two-player game, for which there are certain strategies that will beat weaker strategies. There's nothing subjective about which strategy is better in competitive scenarios if we can compute these strategies to a sufficient detail. Or we could attempt to devise some strategy emulating Nash equilibrium such that no player could gain an advantage by deviating from said strategy. But certainly subjective is not a word I would use to describe the strength of gameplay strategies.

Most people probably agree expansion factions are more imbalanced than vanilla factions, but it does not follow vanilla factions are really balanced for MP gameplay. I think JoGr223 has already provided many arguments why University could beat other factions most of the time, so it's not that simple that expansion factions >> vanilla factions.

do you actually think there is anyone's strategy or "any strategy" that is not relying on infiltration ?
if everyone plays no infiltration game, then it's just boring, you dont know whats happening around the world; its like you had no news and journalists, games feel much more "lonely" :)

Having accurate real-time information makes it much easier to make decisions, unlike some situation where you have to deal with limited information, e.g. fog of war. I'm not advocating removing all infiltration information, just limiting its usefulness, because of the reasons I outlined in the earlier posts.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 04, 2022, 03:19:30 AM
Sorry. I probably was not clear on faction stuff. Or was not right.
Let me rephrase it this way. I agree that if we let 7 AI play game many times then we can statistically prove some faction wins more often on average. I would even agree that some faction ratings may differ by 2-3 times easily. So let's call it moderate factor, not minor.
My point is that the initial placement is huge factor that overwhelms faction bonuses and even "weakest" faction may win being placed right. That includes both geography and faction locations.
My second point is that faction bonuses do not always dictate single optimal strategy. Quite often reacting to current situation disregarding "normal" faction play style could be more optimal. Which again shows that faction features are not the most important game variable. I'd say they provide 20% input to player decision with 80% from the rest of the game.

About subjectivity. That is right that there won't be any more subjectivity if one can compute each and every aspect of the game but we are not there yet, are we? Until then all these statements cannot be mathematically proven and rely on people subjective opinion.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 04, 2022, 09:20:07 AM
My main point would be that even if we don't know exactly what the optimal strategy is in this game, theoretically it is still there, e.g. there's at least some Nash equilibrium optimal strategy. As an analogue, we can look into how other finite, zero-sum, two-player, imperfect information games like poker have been solved.

For example, there's a talk by Tuomas Sandholm New Results for Solving Imperfect-Information Games (https://vimeo.com/313942390) which describes this process. Or maybe this article (https://www.kdnuggets.com/2020/12/remembering-pluribus-facebook-master-difficult-poker-game.html) which explains how they extended the previous system to more than 2-player poker games.

On another note, I have to also mention this talk by Sid Meier (https://youtu.be/bY7aRJE-oOY?t=1100) where he explains how they designed the combat system in Civilization to adapt to player expectations. It's quite hilarious to listen to since he explains how players tend to perceive "big strength number vs. small number" battles as something where they're always supposed to win. It seems obvious some similar kind of reasoning was also used in the design of Alpha Centauri combat system.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 04, 2022, 10:13:22 AM
even if we don't know exactly what the optimal strategy is in this game, theoretically it is still there
you might not know it but I know it v.well :) its basically play FM faction and go FM->wealth->crawlers->PTS->ICS->race for top early eco SPs (HGP,WP,PEG,AV)->restrictions->boreholes->air->kill all with air
this is vs AI which is weak opponent

vs humans u wouldn't go "kill all" as u always lose by starting war vs equal opponents (Reasons i elaborated on in prev. post); so then if u play vs experts its more gradual boreholes->CV->CBA->satellites->pick ur victory choice (by this point its likely very uneven if one human has all these SPs it will likely reflect in 4x dominance in minerals and at least tech parity vs another top human)

so this is reflected in what I consider OP:
Simple 4 liner rebalance mod:
PTS cost 2x
crawlers cost +10%
Needlers chassis cost 4x
Copters chassis cost 6x

late game:
cloudbase academy cost 2x
cloning vats cost 2x, no pop boom, instead +3growth
   or move other benefits to SE choices elsewhere
space elevator 2x
cybor factory 1,5x

note this is not optimal proposition of rebalance, but quickest one for myself to implement; just things that need to be nerfed
more optimal especially in the air aspect is like:
move needler tech 3 levels up and copter 4-5lvls on tech tree, while hovertanks 3 levels down so they appear before air + move air superiority ability to earlier tech than air tech + then needler/copter chassis cost only ~1,5-2x
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 04, 2022, 10:30:12 AM
" New Results for Solving Imperfect-Information Games" doesn't work: is this video on vimeo only for logged in ?
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 04, 2022, 10:58:45 AM
"Add ability to generate mirrored maps along X/Y axis to guarantee balanced starting positions." that will be nice !
would it be also possible to create 7 position mirror ? this way you could really benchmark easily how strong AI performs with each faction

for island maps it's actually easy to do manually, but maps won't be very varied if u won't put much effort into it

Alpha Centauri Bear: you asked before - you can find mirrored 4 player map called veterans here:
https://alphacentauri2.info/index.php?action=downloads;sa=view;down=24

i wonder if it was made manually or maybe some program already was created for this map; if manually it looks liks 30h+ of work :)
Title: Re: SMACX Thinker Mod
Post by: dino on February 04, 2022, 11:10:27 AM
Air force is OP mostly because of att/def ratio that in all circumstances necessites to maximise the amount of engagements where you are attacker on a tactical level. Once you buff defense a bit and take away collateral, Air force becomes mobile allowing an easy mass strike within range, but economically suboptimal compared to slow land forces in terms of damage it can practically inflict compared to its mineral cost.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 04, 2022, 11:28:16 AM
Air force is OP mostly because of att/def ratio that in all circumstances necessites to maximise the amount of engagements where you are the attacker on a tactical level. Once you buff defense a bit and take away collateral, Air force becomes mobile allowing an easy mass strike within range, but economically suboptimal compared to slow land forces in terms of damage it can practically inflict compared to its mineral cost.
wrong, u can buff ur armour 3x or so, air is still op: i'll obliterate in few rounds every terraformed square you have in vicinity with the cheapest planes; and say goodbye to nearby formers and crawlers; also i'll use these cheapest planes on the same square where my land units are, so that my land units are immune (cause ur land units cant attack fields that are occupied by both enemy land and air units)
Title: Re: SMACX Thinker Mod
Post by: dino on February 04, 2022, 11:55:24 AM
You mean all enchancements within flying range ? Anyway with buffed defence and no collateral land force could not only flood territory and destroy enchancements, but also occupy the tiles permanently, if they wouldn't be capable of taking over the bases, while air superiority uints would make a short work of your defensive wall of suspended in the air jets.

You've just nailed down solution to the puzzle called unbalanced vanilla SMAC combat and don't want to consider possibility of something different.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 04, 2022, 12:16:57 PM
Okay, Feb 4 develop build  is now available from project website (https://github.com/induktio/thinker). This version changes the following things. Other changes have to wait for now.

* Remove Fossil Field Ridge from smac-in-smacx maps.
* Fix probe units and crawlers sometimes being given incorrect move orders.
* Add first version of X/Y map mirroring. This must be enabled separately from ALT+T menu.
* All landmarks will be disabled if the generated map is mirrored. It's somewhat hard to implement otherwise. Also faction placement doesn't mirror the start positions yet, haven't decided how to implement it yet.
* Another consideration: should the new map generator include some toggle to select if the map should have polar caps? Now they are always added, but in vanilla map generator it varies, maybe randomly.


even if we don't know exactly what the optimal strategy is in this game, theoretically it is still there
you might not know it but I know it v.well :) its basically play FM faction and go FM->wealth->crawlers->PTS->ICS->race for top early eco SPs (HGP,WP,PEG,AV)->restrictions->boreholes->air->kill all with air
this is vs AI which is weak opponent

I find this snarkiness really uncalled for. Furthermore I'm not sure if you understand the definitions I was using there. You can't assume any weak opponent with Nash equilibrium strategy because it by definition assumes only the strongest possible opponent and plays accordingly. When exploiting specifically weak opponents, it opens one's own play to counter-exploitation, and this diverges from Nash equilibrium. Something similar would be mentioned near the end of the vimeo talk I pasted. And no, you don't have to log in to view it, just use the download link to download the file instead.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 04, 2022, 12:57:48 PM
even if we don't know exactly what the optimal strategy is in this game, theoretically it is still there
you might not know it but I know it v.well :)

I find this snarkiness really uncalled for.

no snarkiness, I really think that; I'm handing u the best strategy on golden plate and you think it's snarkiness  ;lol


Quote
Furthermore I'm not sure if you understand the definitions I was using there. You can't assume any weak opponent with Nash equilibrium strategy because it by definition assumes only the strongest possible opponent and plays accordingly. When exploiting specifically weak opponents, it opens one's own play to counter-exploitation, and this diverges from Nash equilibrium. Something similar would be mentioned near the end of the vimeo talk I pasted.

why you focus on this line on "vs AI" that I said ? as just the next lines in my post I consider scenario of "strongest opponent"

Quote
You can't assume any weak opponent with Nash equilibrium strategy
obviously I don't; my post is not in anyway referring to what you said about Nash
Title: Re: SMACX Thinker Mod
Post by: dino on February 04, 2022, 01:08:40 PM
Aren't you bored with taking advantage of the same quirky exploits for years ?

This discussion made me only realise how much SMAC ruleset unbalance limits viable gameplay options.
In particullar many strategies that could provide a sense of versimilitude to the gameplay experience.
Title: Re: SMACX Thinker Mod
Post by: Buster's Uncle on February 04, 2022, 03:41:50 PM
I don't want to step on vigorous debate, but y'all try to show each other some respect, okay?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 04, 2022, 04:28:27 PM
My main point would be that even if we don't know exactly what the optimal strategy is in this game, theoretically it is still there, e.g. there's at least some Nash equilibrium optimal strategy. As an analogue, we can look into how other finite, zero-sum, two-player, imperfect information games like poker have been solved.

I know game theory that proves there always is a weighted strategy equilibrium in any competitive game. I don't think anyone is arguing about that. What good does it give us knowing it is there but know knowing the answer? How does it help us converse, support our opinions, propose modification to game features, etc.?
When we don't have exact knowledge we naturally fall back to inexact one or subjective - whatever you call it. It is still better to have that than nothing. All claimed in this forum are based on subjective knowledge. User poll may sound stupid from mathematical point of view but it the best tool we have in absence of exact mathematical knowledge.

On another note, I have to also mention this talk by Sid Meier (https://youtu.be/bY7aRJE-oOY?t=1100) where he explains how they designed the combat system in Civilization to adapt to player expectations. It's quite hilarious to listen to since he explains how players tend to perceive "big strength number vs. small number" battles as something where they're always supposed to win. It seems obvious some similar kind of reasoning was also used in the design of Alpha Centauri combat system.

That is known modern thread too but again, as someone already clearly pointed out before, we are not the major target audience for these games. That's why we are modifying them to our liking!!! There is no point to resort to what designer planned for it.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 04, 2022, 04:34:11 PM
note this is not optimal proposition of rebalance, but quickest one for myself to implement; just things that need to be nerfed
more optimal especially in the air aspect is like:
move needler tech 3 levels up and copter 4-5lvls on tech tree, while hovertanks 3 levels down so they appear before air + move air superiority ability to earlier tech than air tech + then needler/copter chassis cost only ~1,5-2x

Not to push or advertise my opinion on that but there are a lot of similar discussions in early-mid WTP forum. Other people expressing their view on similar OP issues. You may tons of useful input and reasoning for your thoughts as well.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 04, 2022, 04:43:56 PM
Air force is OP mostly because of att/def ratio that in all circumstances necessites to maximise the amount of engagements where you are the attacker on a tactical level. Once you buff defense a bit and take away collateral, Air force becomes mobile allowing an easy mass strike within range, but economically suboptimal compared to slow land forces in terms of damage it can practically inflict compared to its mineral cost.
wrong, u can buff ur armour 3x or so, air is still op: i'll obliterate in few rounds every terraformed square you have in vicinity with the cheapest planes; and say goodbye to nearby formers and crawlers; also i'll use these cheapest planes on the same square where my land units are, so that my land units are immune (cause ur land units cant attack fields that are occupied by both enemy land and air units)

Not if you equip formers and crawlers near front line with contemporary AAA armor. It does cost some to defender but it does cost more to attacker to wipe them out. Still defensive response is cheaper. Another option is to employ tons of interceptors protecting these workers. Interceptors are even more economically cheaper than air attackers. Either way proper defense is more effective than stupid frontal assault.

Not that it comes to mind of any human player as we all are spoiled with stupid AI incapable of defending against hordes of human player needlejets. When you start playing Thinker/WTP these different strategies do start coming to mind.



Here is dino saying about the same thing. Sorry, I didn't get to his answer until I responded to yours.

You mean all enchancements within flying range ? Anyway with buffed defence and no collateral land force could not only flood territory and destroy enchancements, but also occupy the tiles permanently, if they wouldn't be capable of taking over the bases, while air superiority uints would make a short work of your defensive wall of suspended in the air jets.

You've just nailed down solution to the puzzle called unbalanced vanilla SMAC combat and don't want to consider possibility of something different.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 04, 2022, 05:05:11 PM
I don't want to step on vigorous debate, but y'all try to show each other some respect, okay?

I don't think we yet crossed the line of disrespect. There is a lot of misunderstanding for sure but we are trying to understand each other to the best we can. At least I believe so.

Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 04, 2022, 07:17:53 PM
* Another consideration: should the new map generator include some toggle to select if the map should have polar caps? Now they are always added, but in vanilla map generator it varies, maybe randomly.

I think that'd be nice. It feels cheap that I can often continent-hop around the icecap if I don't restrain myself. No landmass on the canonical map touches the map edges, but the map generator seems to connect to them quite a bit.

Woo hoo on the landmark fix!

I humbly submit a feature request: Is it easy to add keyboard shortcuts to the UI? I've been using an AutoHotkey script to get around the total lack of build queue shortcuts for ages. I can send you the script if you're interested in what I'm doing.

By the way, I only just discovered how you set the partial hurry payment value to the correct amount minus 1 turn of mineral productions... Can't believe I've missed it for this long!
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on February 04, 2022, 07:56:24 PM
My main point would be that even if we don't know exactly what the optimal strategy is in this game, theoretically it is still there, e.g. there's at least some Nash equilibrium optimal strategy. As an analogue, we can look into how other finite, zero-sum, two-player, imperfect information games like poker have been solved.

What do you mean by a "Nash equilibrium optimal strategy"? Do you mean a dominant strategy (one that is best for you regardless of what your opponents choose to do)? Why do you think SMAC has such a strategy? Many games do not have a dominant strategy (e.g. Rock Paper Scissors has no dominant strategy because the best strategy depends on what your opponent does).
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 04, 2022, 11:27:53 PM
* Another consideration: should the new map generator include some toggle to select if the map should have polar caps? Now they are always added, but in vanilla map generator it varies, maybe randomly.

I think that'd be nice. It feels cheap that I can often continent-hop around the icecap if I don't restrain myself. No landmass on the canonical map touches the map edges, but the map generator seems to connect to them quite a bit.

I think continents should not connect by polar caps. Polar tile touches three not polar tiles and it should reflect the prevalent realm it touches (land/water). There should not be chain of polar land tiles connected just to each other. Same is true for water but I never saw it.

The game places region number on each tile to mark land/water mass. Stupidly enough all polar tiles on both sides have fixed constant polar region number even if they are touching other regions and even if they are themselves on the opposite poles! Ugh. Game design.

Even better option would be to not even take polar regions into account. Make consistent land polar caps all over the poles but make sure the do not connect any landmass. So that all landmasses are surrounded by water.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 05, 2022, 02:28:51 PM
running an AI benchmark on symmetrical map...

morgan made a very wise use of weather paradigm  :o
(https://i.imgur.com/ty0k9dG.png)

let's see if it will secure him a win, together with PTS :)
he is using 9 formers to raise land toward center + build roads + pushed colony pods in this direction; later i'm sure he will build mag tubes all over the place

this game univ is nerfed with -1ind and they still own ! they got HGP+VW so it's perfect SPs stack for them

AIs still make not perfect SP order: hive build CN in 2150 despite they could have build WP (it was available for them); CN was the first SP built on the planet
note this benchmark I added hive just to see how they will perform in such isolated environment where they cant get tech from others early; but this map has a lot of rivers and energy bonus so hive is not that crippled like they would normally be in less welcoming, but isolated land
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 05, 2022, 04:35:56 PM
> That is known modern thread too but again, as someone already clearly pointed out before, we are not the major target audience for these games.
> That's why we are modifying them to our liking!!! There is no point to resort to what designer planned for it.

Sometimes I bring up topics about original game design or similar if I feel like it.

> Not to push or advertise my opinion on that but there are a lot of similar discussions in early-mid WTP forum. Other people expressing their view on similar OP issues. You may tons of useful input and reasoning for your thoughts as well.

I would ask you to be more specific when referring to these discussions, either quote something or link directly to the posts. Saying "look at this thread and skim through 500+ posts" is a little too generic.

> This discussion made me only realise how much SMAC ruleset unbalance limits viable gameplay options.
> In particullar many strategies that could provide a sense of versimilitude to the gameplay experience.

Definitely I agree that simplifying the ruleset or fixing really unbalanced mechanics should take the priority over crafting some specific AI workarounds for each of the special cases. In some parts I've already done this. It is necessary considering the high time usage in this project also. We're now pretty close to the edge of feasibility when implementing something just by patching the game engine without source code.

> I humbly submit a feature request: Is it easy to add keyboard shortcuts to the UI? I've been using an AutoHotkey script to get around the total lack of build queue shortcuts for ages. I can send you the script if you're interested in what I'm doing.

Probably each of these shortcuts will have to be manually coded and patched in the mod. There's no shortcuts for this (pun intended, hehe). What kind of functions are we talking about here?

> running an AI benchmark on symmetrical map...
> morgan made a very wise use of weather paradigm 

Yeah it's a nice map for this. However, the middle island might interfere with some AI pathfinding because all the islands are connected there. It might be a good idea to just remove the fungused middle part. That way it breaks up the land mass into smaller chunks.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 05, 2022, 04:55:35 PM
How do you guys make AI play with each other without human involved at all? The best I can do it to have my faction build a base and don't produce anything there. So I can observe other AI playing until somebody captures my base, of course.

Also do you mind sharing this 4 AI on mirrored map scenario?
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 05, 2022, 10:26:48 PM
Technically it should be possible to run AI-vs-AI tests even if you don't have any active units and are not watching some AI faction directly. You can maybe eliminate the player faction but still keep the game active? It's also much faster to run through the turns when fog of war obscures the AI units.

Also, about this WTP fix for the "force-ending turn while a needlejet in flight has moves left" bug:

(click to show/hide)

So essentially that patch jumps over small piece of code in turn_upkeep that would have increased terraforming_turns variable for some unit and then immediately ended the function. Do you know what was the original purpose for this code or is it something entirely redundant? Does this fix have any side effects? The actual terraforming production calculation should be done in action_terraform function.
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 05, 2022, 10:26:54 PM
> running an AI benchmark on symmetrical map...
> morgan made a very wise use of weather paradigm 

Yeah it's a nice map for this. However, the middle island might interfere with some AI pathfinding because all the islands are connected there. It might be a good idea to just remove the fungused middle part. That way it breaks up the land mass into smaller chunks.
that wasnt a problem, especially given morgan's xenopathy roads :)

this pretty much concludes the game in year 2270...
(https://i.imgur.com/1MGo7KY.png)
other factions wisened up and made their own land corridors to the center... around 50 years later; so morgan got a free reign there and actually took all 4 center jungles; meanwhile he also build all the key late-game SPs with exception of HSA; so he got PEG,AV,CBA,CV,Manifold harmonics, telepatic matrix... on his way to transcendence with new tech every turn

lal and hive were fighting the most intensively... and they are the weakest; lal was "brave" enough to end pact with morgan, but only for a little while, then back to pact, not even fighting; univ and hive fought morgan for a while, maybe 30-40 years but now they are in treaty with him ! im surprised, normally they would fight to the death; maybe peaceful character of morgan alters their warmongering ? :) lal,hive and univ continue to have vendetta on each other tough  ;lol
there were some nice landing troops operations, eg transporting 6 units on someone's territory; other than that mostly ship fights and needlers; combined forces of AI are successfully taking over land bases through the ocean

1 thing a little surprising is that hive is stronger than lal; i think this is due to some quirkiness in fighting... at one point hive has 27 missle penetrators vs no air from lal; hive made air really early IIRC even before eco eng. ! surprised they didn't progress faster with air, as at one point early hive took over 3 of lal's sea bases near his land;nonetheless hive is occupying now lal's land bases; also it's just lal has bad luck with his position this time as he is attacked from both sides and he already lost also 2 big bases vs univ on his land + a lot on the sea

funny thing you can notice on south morgan is creeping with land toward hive  ;lol he made it to 1/3rd of the way; maybe that's why hive proposed peace ? :D

regarding satellites, they still dont prioritize them enough, but they build quite some this time; eg morgan 13/0/13; univ 0/0/7, rest just a few; somehow no nessus?
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 05, 2022, 10:53:21 PM
> funny thing you can notice on south morgan is creeping with land toward hive

It seems Morgan has the most skilled bridge building engineers.. j/k

On another test you could try to set factions_enabled=3 (e.g. only first three are Thinker) and see how long the vanilla AIs fare against Thinker. :) Biggest problem might be to ferry all those troops across the ocean. The ferry handling is very buggy in the game, but it's still doable for Thinker.

> regarding satellites, they still dont prioritize them enough, but they build quite some this time; eg morgan 13/0/13; univ 0/7, rest just a few; somehow no nessus?

How long did they have the various techs available? Were they also simultaneously at war with each other?
Title: Re: SMACX Thinker Mod
Post by: JoGr223 on February 05, 2022, 11:13:58 PM
> regarding satellites, they still dont prioritize them enough, but they build quite some this time; eg morgan 13/0/13; univ 0/7, rest just a few; somehow no nessus?

How long did they have the various techs available? Were they also simultaneously at war with each other?
i was checking if morgan build satellites, when he got tech he already had CBA IIRC and started with single orbital transmitter, then build another few turns later; later sky hydros here and there one; maybe 10+ years later he began building a few per turn; and that is at around 50 bases when he started his satellites; strangely he didn't build sky hydros at all at first
yes it might be that morgan was at war with hive and lal when he started with satellites; but that's not an excuse, he was still buildng a ton of facilities; and satellites are almost always the best facility when u got CBA; 2268 game in another thread Ais build no satellites at all
Title: Re: SMACX Thinker Mod
Post by: dino on February 05, 2022, 11:53:40 PM
Edit: I've deleted the content of this post with rebalance proposition for now, I need to put a bit more thought into it.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 06, 2022, 12:04:07 AM
Probably each of these shortcuts will have to be manually coded and patched in the mod. There's no shortcuts for this (pun intended, hehe). What kind of functions are we talking about here?

Hehe.

The game already provides the arrow keys for navigating the options and Enter for exiting the queue. I added shortcuts that open the queue from the base screen, add items by clicking Insert, and remove from the bottom by clicking Delete. I actually got a bit nutty and added a shortcut for Help, plus shortcuts to add or replace at every queue position but I don't really use them. It's easy enough to delete and re-add.

It's soooo nice in the early game to, say, build a base, hit C, change the first build order to a Former, hit Enter, hit my Queue shortcut, arrow over to a garrison unit, hit my Insert shortcut, arrow to a Colony Pod, hit my Insert shortcut, and hit Enter. Or to page through all my bases and enqueue some new facility at all of them when I get the tech. No mouse needed!
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 06, 2022, 03:43:07 AM
Technically it should be possible to run AI-vs-AI tests even if you don't have any active units and are not watching some AI faction directly. You can maybe eliminate the player faction but still keep the game active? It's also much faster to run through the turns when fog of war obscures the AI units.

What do you mean - should be possible? I see people posted their 4x4 AI game on mirrored map. Do I understand correctly that there is no human player there? If so - how it is done practically?

Also, about this WTP fix for the "force-ending turn while a needlejet in flight has moves left" bug:

So essentially that patch jumps over small piece of code in turn_upkeep that would have increased terraforming_turns variable for some unit and then immediately ended the function. Do you know what was the original purpose for this code or is it something entirely redundant? Does this fix have any side effects? The actual terraforming production calculation should be done in action_terraform function.

Correct. I tried to figure out what it does but failed. The condition triggers when vehicle has unspent turns and when terraforming_turns < chassis range - 1. So only when terraforming_turns == 0 and only for needlers (range == 2). I guess this is related to needler former starting terraforming in midair not spending its last moves? There is no documentation on how this feature should be used and I never heard anyone terraforming with needlers. So - hell with it.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 06, 2022, 03:53:06 AM
I added shortcuts that open the queue from the base screen

Is it by binary modification? Can you share it?
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 06, 2022, 01:19:19 PM
I added shortcuts that open the queue from the base screen

Is it by binary modification? Can you share it?

It's an AutoHotkey (https://www.autohotkey.com/) script so you'd need to install that, too. Try running the script as an administrator if it doesn't seem to be working. It relies on finding visual clues on the screen that the base or queue menu are active, then it mouse clicks where necessary. I tried to make it adjust automatically based on any resolution, but I can't promise it'll work with yours.

Alt+Q in the base screen opens the queue
Alt+Q in the queue screen adds items to the queue
Alt+D deletes from the bottom

Alt+1-8 inserts an item at that position in the queue
Ctrl+1-8 replaces an item at that position
Shift+1-8 deletes an item at that position
Alt+H opens the help

Use the arrow keys to navigate. Enter will exit with your changes, Esc will forget your changes. Those are all native shortcuts.
Title: Re: SMACX Thinker Mod
Post by: dino on February 06, 2022, 03:50:45 PM
Definitely I agree that simplifying the ruleset or fixing really unbalanced mechanics should take the priority over crafting some specific AI workarounds for each of the special cases. In some parts I've already done this. It is necessary considering the high time usage in this project also. We're now pretty close to the edge of feasibility when implementing something just by patching the game engine without source code.

If you'd be open to some rules changes I should have some free time to play SMAC 2-3 weeks from now and I'd be interested in playtesting some ideas I have.
For now I'd ask you implement in thinker vanilla function for unit cost that I could then modify and playtest on my own and maybe some optional base defense bonuses.

I'd start my experiments with:
1) Att/Def ratio I'd achieve by changing only weapons stats:
(click to show/hide)
Coupled with no collateral it'd allow AI units reach human bases, but it'd also make it more difficult to destroy units in them.

2) So I'd add an option to reduce Tachyon bonus to 50%, from what I remember it's a single bit value in the binary, which results in either 50%, or 100% bonus, it's implemented in WtP.

3) While we are at WtP features, vanilla artillery damage formula rounds down to integer value, WtP gives a random chance proportional to the fractional damage to deal an additional single HP damage. It doesn't matter much but it's a nice little detail, that fixes artillery dealing below 1HP damage being completely useless.

/*****/
It shouldn't be necessary and feel free to ignore these ideas if it's too much trouble for you, but in case if either AI would start to struggle with base conquering, or it was still way too easy to steamroll AI:
1) Sensor array bonus could be removed from the base defense, it would keep base assault odds at close to vanilla level, while robbing human player of an advantage provided by destroying sensors in preparation for a base assault. Lets say that local base population provides intel about enemy positions, so the advantage provided by sensor array intel is already included in the intrinsic base defense/ perimeter defense.

2) I'd consider an optional adjustable base defense bonus that also optionally could apply only to a base defending against human controlled unit. This setting would provide a game balance option for multiplayer, or an extra optional AI cheat for a singleplayer challenge without crippling AI. I'd set it at 25% to replace sensor array bonus removed from the base defense in the previous step. It would be meant to eventually be applied to AI too, once it'd be tought to not commit to a base assault until it gathers enough units, to be able to finish damaged defenders with a second strike in the same turn and not waste units on unfinished base assault.

/*****/
Unrelated to the Att/Def change, there is some stuff that annoys me about vanilla unit cost formula, so here is what I'd try given an opportunity:
1) Vanilla unit cost formula practically forces you into specialized att, or def units like in the Civ series. Universal infantry unit since midgame can be 3.5 to 4.5x more expensive, but these armorless offensive units require careful micro and some cicumstancial considerations about army composition, so they are an advantage for humans. The idea of glass cannon infantry men that can attack but can't defend themselves is also silly and immersion breaking. So just like minimum weapon cost for a "sentinel" unit is armor+chasis/2, I'd add a simillar rule to the unit cost formula and make minimum armor cost for an "invader" unit be weapon/3, then I'd add some kind of gradual cost reduction for universal units. I'd aim at universal infantry being 2x more expensive, for mobiles it would turn to be even slightly less.

Specialist would be still more effective but all differences would be toned down enough for AI to sustain maybe 40% of universal unists in a standing army mix during peace to have adaptability to unexpected situations, while in case of war I'd make it produce only cheaper specialists as additional reinforcements to throw into the meat grinder.

2) While getting rid of reactor hit points was crucial, cutting unit cost in half still provides three moments of an extreme advantage, so I'd add an option for reactor to reduce cost by 25% instead of 50%. It'd also be a quality of life change, since it'd increase the reactor 4 units cost over 3 times, there is no depth gained by moving around in late game 30 units instead of 10, the latter only mean less busy work, less AI turn processing time and less likely running into unit limit on large maps.

There is already an alternative cost formula in WtP, but while it works better than vanilla, it's also completely different, while for thinker some slight adjustements to the original formula that wouldn't invalidate players prior experience completely would be more suitable.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 06, 2022, 08:00:46 PM
It's an AutoHotkey (https://www.autohotkey.com/) script so you'd need to install that, too.

Ingenious cool stuff! Although I agree that it may be difficult to port between computers and even people as everyone may have their own automation preferences.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 06, 2022, 08:20:33 PM
Other options and thoughts.

1) Att/Def ratio I'd achieve by changing only weapons stats:

Keep in mind that item appearance time is equally important. For example, in vanilla the weapon:armor ration goes like 4:3 in the mid game. So sixth weapon is 8 and sixth armor is 6. That is not a big visual difference. However, due to their position on tech tree this 8-weapon got discovered when normally only 3-armor is available. That timing makes enormous difference.

1) Sensor array bonus could be removed from the base defense, it would keep base assault odds at close to vanilla level, while robbing human player of an advantage provided by destroying sensors in preparation for a base assault. Lets say that local base population provides intel about enemy positions, so the advantage provided by sensor array intel is already included in the intrinsic base defense/ perimeter defense.

Option: make them indistructible.

2) I'd consider an optional adjustable base defense bonus that also optionally could apply only to a base defending against human controlled unit. This setting would provide a game balance option for multiplayer, or an extra optional AI cheat for a singleplayer challenge without crippling AI. I'd set it at 25% to replace sensor array bonus removed from the base defense in the previous step. It would be meant to eventually be applied to AI too, once it'd be tought to not commit to a base assault until it gathers enough units, to be able to finish damaged defenders with a second strike in the same turn and not waste units on unfinished base assault.

If you want to add penalty for human attack/defense why not just add flat bonus everywhere? Not specifically for base attack only.

About same effect you can achieve by slowing down human research or speeding up AI research.
Extra AI production bonuses generate theoretically bigger AI army. Not the same exactly effect but could be comparable.

1) Vanilla unit cost formula practically forces you into specialized att, or def units like in the Civ series.

Optionally, mixed units may be slightly costlier than specialist ones. Like 6-1-1 = 1-6-1 and 6-6-1 would cost 50% more.

2) While getting rid of reactor hit points was crucial, cutting unit cost in half still provides three moments of an extreme advantage, so I'd add an option for reactor to reduce cost by 25% instead of 50%. It'd also be a quality of life change, since it'd increase the reactor 4 units cost over 3 times, there is no depth gained by moving around in late game 30 units instead of 10, the latter only mean less busy work, less AI turn processing time and less likely running into unit limit on large maps.

Good direction. I also implemented something like this reducing cost by 20% each reactor level totaling at 50% reduction with top level reactor. Should be noticeable without making top level units absolutely cheap.

There is already an alternative cost formula in WtP, but while it works better than vanilla, it's also completely different, while for thinker some slight adjustements to the original formula that wouldn't invalidate players prior experience completely would be more suitable.

I would dare to say there is no vanilla cost mechanics players remember by heart and used to build their strategy on that. Do you, for example, remember the cost of 1-10-1 infantry or 10-1-2 rover or even 10-10-6 cruiser or 16-1-8 needler? Do you remember cost progression? Do you ever involved it into your att-def discussion points, for example? Cost is an absolute integral point of balance. Yet, you omit its valuation when you try to balance weapon with armor. Not only you but other people too. Somehow they see attack and defense values but not the cost behind units.

WTP just streamlined this unit cost system so people do not actually need to think about it. They would naturally assume 6-1-1 unit cost same as 1-6-1 one and be done with it.

Just my opinion though. Experience of other people may vary.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 06, 2022, 10:13:27 PM
Ingenious cool stuff! Although I agree that it may be difficult to port between computers and even people as everyone may have their own automation preferences.

Thanks! It is possible to compile into a self-contained exe, I just haven't done that. It can do everything I want so I haven't worked on it for a while, but I thought it'd be nice to expand into adding shortcuts to the entire base screen. I like to check the Psych readout when planning pop booms and such. Maybe I'll revisit the code and see if others are interested in using it.
Title: Re: SMACX Thinker Mod
Post by: dino on February 07, 2022, 12:20:28 AM
> If you want to add penalty for human attack/defense why not just add flat bonus everywhere? Not specifically for base attack only.

I want a balance where attacker have an advantage on flat and 1:1 on rough terrain outside of a base and disadvantage on a base assault.

The question I'm uncertain about is how much base assault disadvantage is desireable and how much of it the current AI can handle well, maybe none of it is an issue and 3:2 ratio alone would work just fine.
I would consider possibility of an AI cheat helping with assaulting bases a temporary solution until ( if ever ) a proper base assault algorithm capable of handling a very unfavorable odds like player does is developped.

> Cost is an absolute integral point of balance. Yet, you omit its valuation when you try to balance weapon with armor. Not only you but other people too. Somehow they see attack and defense values but not the cost behind units.

I've realised it too, this is why I hope inductio will be kind enough to give us unit cost formula in the thinker source code to experiment with it too.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 07, 2022, 12:33:34 AM
> If you want to add penalty for human attack/defense why not just add flat bonus everywhere? Not specifically for base attack only.

I want a balance where attacker have an advantage on flat and 1:1 on rough terrain outside of a base and disadvantage on a base assault.

These are two independent configurations: balance attack/defense on different terrains and human vs. AI. I would urgently suggest not to mix them. Human bonus pertain to human per se. Not to get intermingled with any other conditions. This way you have it as an independent switch if you want to make human life harder in general.
Title: Re: SMACX Thinker Mod
Post by: dino on February 07, 2022, 01:27:32 AM
Unlike economy cheats AI playing combat by different rules would be too much in your face and annoying and it should be avoided in principle.

The idea was that battle odds while defending in the base would still be obviously in favour of defending player unit only slightly less, so it wouldn't be noticeable and wouldn't affect decision making, while this is an area of the biggest difference in performance between ai and player. Odds differences for territorial combat on the other hand would be small enough that the same cheat would change expectations about which unit will prevail and player tactcs as a result, so universal combat cheat receives a big no from me.

Anyway I suspect it's not necessary, I just thought it'd be an easy to add and cool option to have for an extra challenge.
I'd definitely want to playtest different base assault odds modifiers with and without AI cheat, I don't like that it'd a bit convoluted workaround for the lack of base assault plan algorithm.
At the same time it really shouldn't be noticeable and would improve AI conquest performance, before magtubes and airforce.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 07, 2022, 03:25:05 AM
I would also refrain from introducing any new mechanics. There is plenty (actually even more than even needed) already in place. There is tons of other dials to turn to tilt a balance.
Title: Re: SMACX Thinker Mod
Post by: dino on February 07, 2022, 08:48:16 AM
It'd be best to make perimeter and tachyon modifiers to adjustable with a float number, not only a choice between 50% and 100%.
No new modifier would be introduced, while eventual AI cheat is not something player in this particullar situation should be noticing, or have to consider for decision making.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 07, 2022, 03:18:20 PM
> It'd be best to make perimeter and tachyon modifiers to adjustable with a float number, not only a choice between 50% and 100%.

Probably the only way to make that work is to spend a huge amount of time rewriting all of the combat calculations to use floating point, and I'm not sure if anyone is willing to do that. But taking those base defense bonus parameters from WTP is really simple, and I'm going to include them in the next release in a slightly modified form though.

> For now I'd ask you implement in thinker vanilla function for unit cost that I could then modify and playtest on my own and maybe some optional base defense bonuses.

If you want to see how the prototype cost calculation works, you can look at OpenSMACX's reversed proto_cost function in veh.cpp and then decide what to do with it. WTP apparently has already patched some modified version in the game, so that should show how to implement it in the mod.

> If you'd be open to some rules changes I should have some free time to play SMAC 2-3 weeks from now and I'd be interested in playtesting some ideas I have.

It would be best to publish these changes in a new alphax.txt file and then gather feedback. I'd recommend using github for that. You can actually just create a new gist (https://gist.github.com/) for it since it's supposedly only one file that's required, and gists also have integrated version history there.

> It's soooo nice in the early game to, say, build a base, hit C, change the first build order to a Former, hit Enter, hit my Queue shortcut, arrow over to a garrison unit, hit my Insert shortcut, arrow to a Colony Pod, hit my Insert shortcut, and hit Enter.

Did you know that the mod copies items from Template 1 to all new bases? It's mentioned in Details.md. Might be helpful here.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 07, 2022, 03:49:44 PM
It'd be best to make perimeter and tachyon modifiers to adjustable with a float number, not only a choice between 50% and 100%.
No new modifier would be introduced, while eventual AI cheat is not something player in this particullar situation should be noticing, or have to consider for decision making.

Unfortunately it is how it is coded in original. Changing it would be an insane amount of jumping through hoops and also error prone.

What bigger granularity you need? The artillery can reduce units health by two in base and to nothing in the field. The mere fact who has artillery superiority is much more important than ±25% PD bonus. I always analyze base assault balance in assumption assailant has artillery superiority and already reduced base defenders health in half. If you omit this part then bringing enough artillery on conquest will make it a cakewalk the one you try to avoid.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 08, 2022, 04:12:41 PM
Did you know that the mod copies items from Template 1 to all new bases? It's mentioned in Details.md. Might be helpful here.

I did not! I've never used those templates, huh.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 08, 2022, 06:21:25 PM
Did you know that the mod copies items from Template 1 to all new bases? It's mentioned in Details.md. Might be helpful here.

Great feature. Does it save/copy the item at queue[0] too or only the rest of the queue so player need to choose first item themselves?

Would it be possible to extend it to distinct between land bases (template 1), coastal bases (template 2), ocean bases (template 3)? This would fulfill my needs completely as I use these three templates, correspondingly. Obviously, some items needed in land bases but not in ocean ones and vice versa.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 11, 2022, 08:11:01 PM
Alright, version 3.1 is now available from the project website (https://github.com/induktio/thinker). This release is a kind of "many smaller tweaks" instead of huge overhauls on any specific mechanics and it's good to get rid some of those bugs. To post feedback it's also possible to use discussions page (https://github.com/induktio/thinker/discussions) for the project.

> Would it be possible to extend it to distinct between land bases (template 1), coastal bases (template 2), ocean bases (template 3)?

I'm not sure there's a sufficiently clear use case for this and it might make the interface more confusing. Template names would almost have to be changed or people would forget which one did what.
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on February 12, 2022, 03:57:18 AM
Just wanted to pop in and say that it's really cool these mods are still being actively worked on, amazing stuff with all sorts of small but essential improvements to the game!

Maybe one day I'll actually try playing against the AI again :V
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 12, 2022, 05:15:24 PM
I've been having fun today with your tech tree visualizer. Every once in a while I try to write a general alphax or faction parser in Python for fun and Python practice but I end up slamming my head into the keyboard. I like your method of figuring out where sections are.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 12, 2022, 06:49:11 PM
Where is it? Is it in Thinker package?
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 12, 2022, 07:12:57 PM
https://github.com/induktio/thinker/blob/master/tools/techvisual.py

You'll need to install networkx and matplotlib from pip.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 13, 2022, 01:13:11 PM
Just wanted to pop in and say that it's really cool these mods are still being actively worked on, amazing stuff with all sorts of small but essential improvements to the game!

Maybe one day I'll actually try playing against the AI again :V

You mentioned elsewhere that the RPGCodex PBEM group plays WTP but most "Thinker/WTP" changes turned off. So what was the rationale for using WTP if most of the changes are turned off? What kind of changes were disabled then? Also do many players consider it important to slow down movement on magtubes since you mentioned this is enabled? Or also apply PLANET bonus for defense? :)
Title: Re: SMACX Thinker Mod
Post by: Tayta Malikai on February 13, 2022, 11:12:17 PM
You mentioned elsewhere that the RPGCodex PBEM group plays WTP but most "Thinker/WTP" changes turned off. So what was the rationale for using WTP if most of the changes are turned off? What kind of changes were disabled then? Also do many players consider it important to slow down movement on magtubes since you mentioned this is enabled? Or also apply PLANET bonus for defense? :)
Like I said there, the option for extra formers and colony pods at the start is actually a pretty big deal. It allows doing an accelerated start to power through the boring early game where not much happens, and helps to ameliorate the effects of getting a lousy start in the desert or wherever, ensuring players get a more equal opportunity to succeed.

PLANET bonus on defense is considered a good balance change, as it gives you a way to better defend against native life (instead of having the bonus only apply when attacking), and opens up the option to rely on psi defense (which can be helpful when nerve gas is being deployed left and right, as it neutralizes nerve gas).

Instant movement across magtubes exacerbates the issue where, past a certain tech level, wars are often won by performing a massive blitzkreig on your turn that obliterates the opponent's ability to resist before they can respond on their turn. They also reduce the value of tactical planning, since any unit can be instantly moved between bases as needed. So we agreed to nerf them to 1/6 of a standard move.

There are also the changes to the faction landing site distribution algorithm (which is overall more balanced than vanilla's), the ability to have 2 nutrient bonuses spawn at landing sites (helps with accelerated start mentioned above), the ability to play SMAC-in-SMAX (although we ended up moving to SMAX anyway to have more variety in the tech tree), and the various bug fixes included in the mod (the last mod, MercantileInterest's Binary Dawn using Yitzi's patch, was discontinued for being too unstable and crash-prone in late game). So there's plenty of reason to use the mod(s) even without many of the big-ticket items.
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on February 13, 2022, 11:24:21 PM
It fixes the exploits connectedwith fiddling with the Industry rating. That's a big one.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 14, 2022, 12:00:57 AM
Like I said there, the option for extra formers and colony pods at the start is actually a pretty big deal. It allows doing an accelerated start to power through the boring early game where not much happens, and helps to ameliorate the effects of getting a lousy start in the desert or wherever, ensuring players get a more equal opportunity to succeed.

Yeah originally I added it as optional AI bonus, it didn't include the option for player factions, but I guess somebody playing WTP or Tim figured out it would be a good bonus for player factions also. So I added that feature also in Thinker.

Magtubes are certainly OP at the late stages of the game and a very long time ago I considered a nerf on them, but it was not implemented as it was not that important considering the other priorities. Now I'm just wondering if this WTP's implementation causes side effects elsewhere in the game as it requires multiplying Rules->mov_rate_along_roads variable with the tube_movement_rate_multiplier config option. It's a global alphax rules variable and used by the vanilla game.

It also requires patching hex_cost function but that by itself should not be anything unusual. But at least changing the rules variable would make the game state inconsistent if a save is reloaded mid-turn, but that setting is not intended to be changed mid-game anyway.

It fixes the exploits connectedwith fiddling with the Industry rating. That's a big one.

Quote
; Mineral contribution from artifacts, disbanded units, hurrying will be adjusted to current INDUSTRY rating.
fix_mineral_contribution=1

I'm assuming you mean the above? That one also seems to require a bunch of binary blob patching. I've been trying to avoid including it too much as it tends to be not very maintainable, but have to think about it.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 14, 2022, 04:14:19 AM
Magtubes are certainly OP at the late stages of the game and a very long time ago I considered a nerf on them, but it was not implemented as it was not that important considering the other priorities. Now I'm just wondering if this WTP's implementation causes side effects elsewhere in the game as it requires multiplying Rules->mov_rate_along_roads variable with the tube_movement_rate_multiplier config option. It's a global alphax rules variable and used by the vanilla game.

It also requires patching hex_cost function but that by itself should not be anything unusual. But at least changing the rules variable would make the game state inconsistent if a save is reloaded mid-turn, but that setting is not intended to be changed mid-game anyway.

Yeah. It did require a lot of pathing here and there. I think I tied all the ends but, as always, any code analysis or play test comment on its stability is appreciated. Bvanavery caught a lot of bugs those got fixed. Nothing fresh in a long time.

I am changing this rule variable at game launch time. There is a function that actually reads them from alphax.txt. So I substitute it on the fly as if it had different value in config file. Should not disrupt any save/load.

Title: Re: SMACX Thinker Mod
Post by: Induktio on February 14, 2022, 05:46:58 PM
I am changing this rule variable at game launch time. There is a function that actually reads them from alphax.txt. So I substitute it on the fly as if it had different value in config file. Should not disrupt any save/load.

It is fairly trivial to change how the alphax file is parsed by patching the reader function. That is not the point here. I was referring to changing the meaning of the mov_rate_along_roads variable when dozens of pathfinding functions depend on it. The issue that I tried to highlight is that moved units store their spent movement points in road_moves_spent field and this directly relates to mov_rate_along_roads variable. At least in that case, save game state becomes inconsistent for one turn if this setting is changed mid-turn. But that is a minor issue, since the setting is not supposed to be changed mid-game. There might be some other, more subtle bugs that the change introduces in the existing code. Or there might not. Haven't checked them in detail yet.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 14, 2022, 06:28:53 PM
Does your new world builder use all of the values in the WORLDBUILDER section of alphax? I've been tinkering with some stuff, but I can't tell if it's making any difference. I'm doing so by editing alphax while the game is running and then running Quick Start. Does that matter?
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 14, 2022, 06:45:05 PM
To be on the safe side, always save the alphax.txt file before opening the game. I don't think the changes take effect if you reload some save file after adjusting alphax.txt.

This mentioned in Details.md still applies "Any WorldBuilder variable names starting with Land, Continent, Hills or Plateau are not currently used by the generator." We might also add Plains, Beach and Peaks variables to the unused list. Unless there's some subtle effect in vanilla code climate generation or similar that might potentially use these variables. The new map generator is so different it does not have a need for much of those variables.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 14, 2022, 07:57:16 PM
D'oh. Well what I was trying to do was discourage dry, flat land, particularly in the east. When continents get long longitudinally, particularly a Pangaea style one, the east doesn't get a lot of moisture and large deserts form when there aren't enough terrain level changes to catch the moisture. I had some success with the default one by playing with the plateau setting (foolishly deleted the alphax when I reinstalled for Thinker 3, oops). If I get the time maybe I'll make a study of it.

I was impressed, though, by a rather well executed surprise naval invasion by the Hive in my last game. Maybe I should relax my Pangaea supremacist views.
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on February 14, 2022, 09:56:05 PM
It fixes the exploits connectedwith fiddling with the Industry rating. That's a big one.

Quote
; Mineral contribution from artifacts, disbanded units, hurrying will be adjusted to current INDUSTRY rating.
fix_mineral_contribution=1

I'm assuming you mean the above? That one also seems to require a bunch of binary blob patching. I've been trying to avoid including it too much as it tends to be not very maintainable, but have to think about it.

The key change is that invested minerals get adjusted when you change industry rating. If you have 100 minerals invested in some SP and switch to Wealth (0 industry to +1) you only retain 90 of them. Tricks like switching to Power, disbanding units and then changing back to Wealth (with a refund no less) don't work anymre because of this mechanic.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 15, 2022, 01:30:26 AM
FYI, Induktio.

There are two vanilla functions: kill and veh_kill.
Former seems to be a wrapper for latter checking whether vehicle is a transport and deciding whether whole stack need to be killed.
So it seems as the most safe way to kill the vehicle. Although both are heavily used all over the program. Ugh.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 15, 2022, 05:46:54 PM
Thinker uses veh_kill in some really rare circumstances, like disbanding unused formers or colony pods, so in this case it probably won't run into problems because it shouldn't ever disband transport units. Maybe could change the function anyway? It's somewhat annoying some of these functions have really short, generic names that might also get easily confused with some library functions.

> I was impressed, though, by a rather well executed surprise naval invasion by the Hive in my last game. Maybe I should relax my Pangaea supremacist views.

Post some screenshots too if you have time. Sometimes the map generator biases a lot towards pangaea layout, it might still need some tweaks to produce more separated continents, although there's already some implemented. :)
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 15, 2022, 10:37:32 PM
I'm attaching some screenshots to illustrate why I wanted to tweak elevations. All my examples were generated with middle settings on everything.

Old 1 is an example by the original worldbuilder. Note the frequent, undulating elevation changes and how it helps trap at least some moisture in long east to west stretches of land so you don't get vast, barren expanses.

New 1-4 are some examples of your worldbuilder, which tends to make stretches of broad, flat land. The files with "added" have some elevation changes I manually plopped down here and there just to break things up. You can go back and forth and see how even very slightly changes in elevation had an enormous and beneficial effect.

The large dry plateau to the east in new4 is just the Unity wreckage so ignore that part.
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 16, 2022, 10:53:01 PM
Yeah I meant mostly screenshots about the naval invasions, but there's a point in those screenshots too. Selecting higher river amounts would help to alleviate the lack of moisture in some areas. The original engine is a little weird in the way it handles those elevation changes. Might have to think about some tweaks on the hill generation code, but overall the new world builder is the way to go.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 17, 2022, 12:40:04 AM
Ah, I'm afraid I saved over that game (he brought too many impact rovers and I ragequit). It does do continent shape very well. No more stringy noodle landmasses, and I don't see those stupid one tile islands that the original one puts everywhere. Can it be taught to put more peaks to break up flat plateaus? Perhaps easier said than done.
Title: Re: SMACX Thinker Mod
Post by: Rocky on February 18, 2022, 01:31:16 PM
Does Thinker take into account distance to other factions when declaring war or being in a war?

Sometimes the Ai picks targets while there are more rewarding targets nearby.

In a recent game the Spartans were in a war with the Peacekeepers on the other side of the map. While the Ai did a great job executing it (Early game and I spotted a fleet of 6 Missile/Impact Skimships and several transports with Impact Rovers─it even managed to take a few bases but wasn't able to hold on to them)

At the same time the Spartans had two easier targets at their borders. (Myself, I was ignoring military except for prototypes and the Gaians)

When an AI declares war does it look at what it can gain?

If an AI is declared war upon by someone some distance away would it still commit resources for a full invasion or would it be treated as less important?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 18, 2022, 02:55:16 PM
Maybe it does but keep in mind there are tons of other factors at play. They may just declare war on someone on the opposite side of the globe merely for not sharing their ideology disregarding everything else.
Title: Re: SMACX Thinker Mod
Post by: Rocky on February 18, 2022, 04:57:51 PM
Maybe it does but keep in mind there are tons of other factors at play. They may just declare war on someone on the opposite side of the globe merely for not sharing their ideology disregarding everything else.

True, and I do like the flavor about ideologies, but it feels like a bit of a waste to see the AI spend so much on a well executed invasion but then isn't able to hold on to it. I was curious if Thinker used some kind of distance-based ruleset to determine how much it should commit to a military assault.

I have to say Thinker AI already makes way more sense regarding conquests than the stock AI. Thinker is able to wage war and wrap things up.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 18, 2022, 06:13:46 PM
flavor = waste. It is disbalance by definition. You can have more or less of it. As far as I saw other opinions, people prefer flavor to cold blooded killer AI who can't be bargained with, can't be reasoned with, doesn't feel pity or remorse or fear, and absolutely will not stop ... EVER, until you are dead!!!!!
Title: Re: SMACX Thinker Mod
Post by: Rocky on February 18, 2022, 06:48:06 PM
flavor = waste. It is disbalance by definition. You can have more or less of it. As far as I saw other opinions, people prefer flavor to cold blooded killer AI who can't be bargained with, can't be reasoned with, doesn't feel pity or remorse or fear, and absolutely will not stop ... EVER, until you are dead!!!!!

One does not have to exclude the other though. I was only curious if distance plays a role in the decision making for Thinker to wage a war.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 22, 2022, 04:51:00 PM
Did you have stockpile exploit fixed in Thinker? I just tested it and it is there. I thought it should be included in scient patch.
https://alphacentauri2.info/index.php?topic=21359.msg133392#msg133392
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 22, 2022, 10:26:57 PM
> I was curious if Thinker used some kind of distance-based ruleset to determine how much it should commit to a military assault.

Almost every evaluation function in Thinker involves some kind of a distance or cost penalty. It's very important for prioritizing various things. So yes, usually the closest enemy is prioritized for invasion. AI-vs-AI wars tend to be very costly because the AIs are usually fighting each other on somewhat equal basis, which results in lots of attrition.

The actual decision for declaring vendetta is outside of Thinker code though, this is decided mostly in wants_to_attack function. It would be an interesting exercise to write a replacement for it, but so far I've decided to go with the vanilla version.

> Did you have stockpile exploit fixed in Thinker? I just tested it and it is there. I thought it should be included in scient patch.

Read the patchnotes carefully. If something is not listed in Details.md it should not be included in the actual patch code. Some earlier revisions of Scient patch included some notes about fixes that weren't actually there. I think it was me who noted Scient about it, and they were removed from the list and mentioned now in one of the commits (https://github.com/DrazharLn/scient-unofficial-smacx-patch/commit/c9a1ea6e582f7fe07ae3a2c206f696ced7341edf).
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 22, 2022, 11:14:42 PM
Right. It is marked as not fixed. So I fixed it in WTP.

[This list originally contained three more entries that were actually removed prior to public release. These are now below.]

[BUG] Fixed the CC/BP combat bonus bug.
[BUG][EXPLOIT] Fixed the AI base trading exploit. (credit to kyrub)
[EXPLOIT] Fixed the energy stockpile exploit. (credit to kyrub)
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 23, 2022, 12:16:13 AM
> Right. It is marked as not fixed. So I fixed it in WTP.

Can you explain how your patch actually works to fix the stockpile bug then? It's not obvious by looking at the code that the fix is a correct one. It doesn't seem to account for the effect by PEG that increases stockpile returns by 25% for example.

Depending on the return value supplied by base_production, base_ecology might or might not get run by base_upkeep function which calls both of them. So if a non-stockpile item is produced by a base on one turn, does it "correctly" prevent the accumulation of stockpile energy credits from queue at the same turn but otherwise keep the stockpile energy feature intact?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 23, 2022, 01:24:37 AM
Can you explain how your patch actually works to fix the stockpile bug then? It's not obvious by looking at the code that the fix is a correct one. It doesn't seem to account for the effect by PEG that increases stockpile returns by 25% for example.

Depending on the return value supplied by base_production, base_ecology might or might not get run by base_upkeep function which calls both of them. So if a non-stockpile item is produced by a base on one turn, does it "correctly" prevent the accumulation of stockpile energy credits from queue at the same turn but otherwise keep the stockpile energy feature intact?

I am not even sure my patch is the correct one. It was quick and sloppy fix. You are right that it should account for many other things. I'll probably rethink it. And I'll accept any hints and guidance.

I intercept base_ecology just to insert computation in the same branch where faction energy reserves get updated. And it is only one branch. So if base_ecology doesn't run faction credits won't be updated too.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 25, 2022, 08:19:57 PM
Question about this:


Code: [Select]
; Select if the planet should randomly spawn spore launchers and other expansion-only units.
; Factions can still build some of these units if they are not disabled from alphax.txt.
; Does not affect any starting units defined for the faction, e.g. Progenitors.
spawn_spore_launchers=1
spawn_sealurks=1
spawn_fungal_towers=1
spawn_battle_ogres=1


What does it mean by "randomly spawn" with regards to the battle ogre? If I disable that option, does that mean they just won't pop from Unity pods? Planet isn't going to send Planetmind-controlled ones at me, right??  ;eek
Title: Re: SMACX Thinker Mod
Post by: Induktio on February 26, 2022, 03:35:39 PM
> I intercept base_ecology just to insert computation in the same branch where faction energy reserves get updated. And it is only one branch. So if base_ecology doesn't run faction credits won't be updated too.

But they will be updated in some way because WTP's patch updates energy credits at two different points. Presumably all the other vanilla game logic works like before. Why is this the correct fix for the stockpile energy bug? How was it tested that this patch updates energy credits correctly with or without stockpile in the queue? Or was it tested at all?

My main point was not even about PGE bonus that was unaccounted for, rather the whole logic behind this patch because the way it works looks odd. I have not investigated yet what would be the best way to fix that bug, but I would presume the most logical way would be to just prevent the accumulation of stockpile energy if the base has already produced something on that turn.

> What does it mean by "randomly spawn" with regards to the battle ogre? If I disable that option, does that mean they just won't pop from Unity pods?

Yes.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 26, 2022, 05:30:21 PM
> I intercept base_ecology just to insert computation in the same branch where faction energy reserves get updated. And it is only one branch. So if base_ecology doesn't run faction credits won't be updated too.

But they will be updated in some way because WTP's patch updates energy credits at two different points. Presumably all the other vanilla game logic works like before. Why is this the correct fix for the stockpile energy bug? How was it tested that this patch updates energy credits correctly with or without stockpile in the queue? Or was it tested at all?

My main point was not even about PGE bonus that was unaccounted for, rather the whole logic behind this patch because the way it works looks odd. I have not investigated yet what would be the best way to fix that bug, but I would presume the most logical way would be to just prevent the accumulation of stockpile energy if the base has already produced something on that turn.

It is not clear whom you address it to. Let me reiterate it once more with caps: I am not 100% sure this is a completely airtight fix. This is a fix. The best one I could come up with at the moment. And, apparently, the first one in my whole known universe as scient didn't implement it and neither anybody else I know. So if you know existing solution/fix or have a very specific improvement proposal - share it by all means! I would be glad to borrow somebody's knowledge and not doing it myself.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on February 26, 2022, 06:20:37 PM
> What does it mean by "randomly spawn" with regards to the battle ogre? If I disable that option, does that mean they just won't pop from Unity pods?

Yes.

 :luv: ;danc :luv:
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on February 27, 2022, 02:50:26 AM
There are some class type functions in code with double underscore. They use registers to pass parameters. Were you able to hook any of such functions? I am just curious how to do it properly.

Never mind. Found this.

typedef int(__thiscall *FPath_find)(
    void* This, int x1, int y1, int x2, int y2, int unit_id, int faction, int flags, int unk1);
Title: Re: SMACX Thinker Mod
Post by: Neil on March 02, 2022, 11:16:48 PM
Hi, I am trying out this mod after not playing for a few years. Thanks for all your effort on this!
When I load the mod through the launcher shortcut, it seems random whether it works or not. I have SMAC mode enabled, and half the time it loads Alien Crossfire and half the time the original splash screen. Any ideas?
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on March 03, 2022, 03:05:41 PM
Hi, I am trying out this mod after not playing for a few years. Thanks for all your effort on this!
When I load the mod through the launcher shortcut, it seems random whether it works or not. I have SMAC mode enabled, and half the time it loads Alien Crossfire and half the time the original splash screen. Any ideas?

I also consistently have this issue across the two PCs I use.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 03, 2022, 09:28:51 PM
Hi, I am trying out this mod after not playing for a few years. Thanks for all your effort on this!
When I load the mod through the launcher shortcut, it seems random whether it works or not. I have SMAC mode enabled, and half the time it loads Alien Crossfire and half the time the original splash screen. Any ideas?
You're probably using Windows 10 or newer? There's some kind of incompatibility issue caused by these newer Windows versions, unfortunately I have not yet diagnosed it.

As a workaround you can use terranx_mod.exe from older releases and combine it with newer thinker.dll (and other txt files), so you should be able to start the mod without problems. For now terranx_mod.exe is still compatible with newer thinker.dll versions.
Title: Re: SMACX Thinker Mod
Post by: Neil on March 03, 2022, 10:01:46 PM
That's ok. I can just keep retrying it until it works..

I notice the AI is a lot smarter in some ways and builds a lot of supply crawlers and satellites. I also notice it designs some interesting unit designs, like armored probe teams. Very cool stuff! Well done!

However I notice the AI still doesn't build many facilities. Eg even after a long game, they had hardly any energy banks. I think once the AI gets into war, it spends most of its time building military units. Although this makes sense, it should still keep developing some of its bases. Warmongers don't even build many command centers.

I also found my neighbor (late game) defending large bases with only single rover units without armor, which made them easy to capture with a surprise attack. Well, I say surprise attack. I asked Lal to withdraw from my territory and he got mad!
;danc
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on March 03, 2022, 11:26:38 PM
Hi, I am trying out this mod after not playing for a few years. Thanks for all your effort on this!
When I load the mod through the launcher shortcut, it seems random whether it works or not. I have SMAC mode enabled, and half the time it loads Alien Crossfire and half the time the original splash screen. Any ideas?
You're probably using Windows 10 or newer? There's some kind of incompatibility issue caused by these newer Windows versions, unfortunately I have not yet diagnosed it.

As a workaround you can use terranx_mod.exe from older releases and combine it with newer thinker.dll (and other txt files), so you should be able to start the mod without problems. For now terranx_mod.exe is still compatible with newer thinker.dll versions.


Found an even easier temp fix: Set the terranx.exe compatibility mode to XP. Just toyed with that and got it to run with your launcher without fail 10 times in a row.

EDIT: On Windows 11. Also it started in 1024x768 resolution twice, haha.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on March 03, 2022, 11:59:20 PM
As promised, I think, I have two examples of decent amphibious assaults and one of a rather foolish one from my latest game.

Miriam Good was a pretty good Believer attack on University Island. The Believers took Zoloto-Gold with an Impact rover, then mind controlled Relativity School. Very destabilizing attack that put them on the wrong foot for a bit. Miriam went for Relativity School a handful of times, but I only noticed after the fact.

Yang Good was a nice outflanking maneuver around the huge Peacekeeper/Hive front line.

Unfortunately, though, neither was able to make good on their attacks.

Miriam Bad was an ill-advised attack on me, though particularly daring and unexpected by going through University territory. If the Believers had landed on the tiles directly next to The Flowers Preach I absolutely would have lost that base (only defender was a 1-1-1 cop) and it would have thrown me off balance. Landing that far off made it easy for me to contain that attack almost instantly.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on March 04, 2022, 12:00:22 AM
Oops, attached is Miriam Bad.
Title: Re: SMACX Thinker Mod
Post by: Neil on March 04, 2022, 06:16:40 AM
Does automatic fungus removal work with Thinker managed formers? I set some formers to this, and they are doing other improvements.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 12, 2022, 03:41:17 PM
> However I notice the AI still doesn't build many facilities. Eg even after a long game, they had hardly any energy banks.

Then some people say the AI doesn't build enough defenders or military units. So go figure. It's currently tuned to emphasize unit production more heavily. If they have many active wars, it's almost unavoidable. You can adjust this by choosing conquer_priority=50 or similar.

> If the Believers had landed on the tiles directly next to The Flowers Preach I absolutely would have lost that base

Often the landings are done on squares not directly adjacent to enemy units, so they can avoid immediate counter attacks from the enemy. Not saying it's the best choice here, but it has its own rationale.

> Does automatic fungus removal work with Thinker managed formers? I set some formers to this, and they are doing other improvements.

No, it's not implemented. All Thinker formers will follow the same strategy regardless of other option menus in the game.

> Found an even easier temp fix: Set the terranx.exe compatibility mode to XP.
> On Windows 11. Also it started in 1024x768 resolution twice, haha.

Good to know it can be fixed in that way. That's very useful. Did you find any way to make it start in the native desktop resolution (e.g. DirectDraw=0 in vanilla)?
Title: Re: SMACX Thinker Mod
Post by: Neil on March 12, 2022, 08:50:18 PM
Then some people say the AI doesn't build enough defenders or military units. So go figure. It's currently tuned to emphasize unit production more heavily. If they have many active wars, it's almost unavoidable. You can adjust this by choosing conquer_priority=50 or similar.

The AI was producing lots of military units but still defended key bases with only 1 unarmored rover. I tried changing the conquer_priority. But perhaps the AI can divide its bases between development and unit building in some way? A better economy helps unit production. A conquer AI should also build more command centers.
Title: Re: SMACX Thinker Mod
Post by: Neil on March 12, 2022, 09:34:42 PM
Regarding supply crawlers.
Not everyone's cup of tea. I tried to disable them, but they still seem to be available. How do I do that? I tried commenting out the module and preset unit in smac_mod\alphax.txt which is what I play, but they're still in the game.

Some techs say they allow supply crawlers to haul multiple resource types, yet I couldn't figure out how to make use of that ability?

I noticed the AI had some bases with all the tiles exploited due to high population and some tiles still being worked by supply crawlers. Surely it would be better to stop crawling those tiles, so the base pop can extract all 3 resources from there? And maybe send the crawler elsewhere.

Does the AI build sea crawlers?
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 12, 2022, 10:12:27 PM
Regarding supply crawlers.
Not everyone's cup of tea. I tried to disable them, but they still seem to be available. How do I do that? I tried commenting out the module and preset unit in smac_mod\alphax.txt which is what I play, but they're still in the game.

Code: [Select]
Supply Crawler,         Infantry, Supply,       Scout,     10, 0, 0, Disable, -1, 00000000000000000000000000

Do not comment out any predefined units in alphax.txt. They are hardcoded internally.

Some techs say they allow supply crawlers to haul multiple resource types, yet I couldn't figure out how to make use of that ability?

Seriously? Which one? Never knew crawler can harvest multi-resources.
Title: Re: SMACX Thinker Mod
Post by: Neil on March 12, 2022, 10:31:56 PM
Multiresource convoys ??
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 12, 2022, 10:55:43 PM
This is some modded version. Check what are you playing.

Title: Re: SMACX Thinker Mod
Post by: Neil on March 12, 2022, 11:31:40 PM
I am playing Thinker Mod with SMAC-in-SMACX.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on March 13, 2022, 04:08:54 AM
Have you been fiddling with other parts of the smac-in-smax alphax? That's a line for some unimplemented feature in the helpx file.


https://github.com/induktio/thinker/blob/master/docs/smac_mod/helpx.txt#L52


And if you don't want crawlers, you also have to Disable the crawler module, not just the predefined crawler unit. Thinker relies on crawlers, though, so you're handicapping the AI.
Title: Re: SMACX Thinker Mod
Post by: EmpathCrawler on March 13, 2022, 04:14:08 AM
Good to know it can be fixed in that way. That's very useful. Did you find any way to make it start in the native desktop resolution (e.g. DirectDraw=0 in vanilla)?


It will usually start in the native resolution, the 1024x768 start is sporadic. I wonder if that's related to the starting issues under Windows 10/11 or something else? If you have something you want me to try let me know.
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 13, 2022, 04:38:38 PM
> Some techs say they allow supply crawlers to haul multiple resource types, yet I couldn't figure out how to make use of that ability?
> https://github.com/induktio/thinker/blob/master/docs/smac_mod/helpx.txt#L52

Ugh. That documentation must be incorrect. Thinker Mod or the base game has never allowed multi-resource convoys for crawlers. That help file is probably imported straight from Yitzi's mod, then merged with Drazhar's smac-in-smacx repo, and then merged with Thinker. It's possible Yitzi's mod did something with that, but I've never tried to import those changes, as they were unmaintainable binary patches.

I'm almost thinking of just throwing out all changes from helpx.txt but there are also some useful additions among those 1900 lines. It's just a hassle to manually check all those changes. If there are any other mentions of new features or binary changes in the file, they are probably also incorrect as they refer to Yitzi's changes. If the changes in helpx.txt are not mentioned in my documentation, it's almost certainly not in the mod.

> It will usually start in the native resolution, the 1024x768 start is sporadic. I wonder if that's related to the starting issues under Windows 10/11 or something else?

If you can figure out what the determining factor for that changing behaviour is, that might be helpful.

> And if you don't want crawlers, you also have to Disable the crawler module, not just the predefined crawler unit.

Yeah, you need to set both the crawler weapon module and the predefined crawler unit tech prereq to "Disable" in order to correctly remote them from the game.
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on March 19, 2022, 10:54:25 AM
Hm, I installed Thinker over GoG version. Game is choppy also tech costs are 2.5 times what they should be. Did you mess with this or did something break while installing.
Title: Re: SMACX Thinker Mod
Post by: DrazharLn on March 19, 2022, 07:01:25 PM
Thinker does change the tech cost formulas. You can turn that off in thinker.ini or maybe even from the in-game menu, I think.
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on March 19, 2022, 08:09:51 PM
Didn't see it immediatly. Also what a weird design choice.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 19, 2022, 09:10:41 PM
Are you talking about tech cost change in general or switch?

Induktio, are you talking some of your thinkier.ini switches can be changed in game menus???
Title: Re: SMACX Thinker Mod
Post by: Neil on March 19, 2022, 09:20:12 PM
Didn't see it immediatly. Also what a weird design choice.

What is weird about it? You can read the new formula and the reasoning in the readme.

https://github.com/induktio/thinker/blob/master/Details.md#:~:text=double%20cost%20threshold.-,Revised%20tech%20costs,-In%20the%20original
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on March 19, 2022, 09:30:53 PM
Almost 60 research needed for Centauri Ecology on the huge planet map is baffling. Late game, higher tech costs makes sense. But not this.

Also, Alt + T hides bases and units intead of opening a menu. Maybe there is something wrong with the installation.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 20, 2022, 12:25:36 AM
I agree that direct proportionality to map square root is a vanilla remnant. Many people already pointed out that map size does not change the development speed at all. The only difference is that bigger map allows longer period of initial uninterrupted development. I.e. all progress tied parameters should grow about same speed on all maps and should account for expansion slow down at some point in the game. That moment appeared later on bigger maps.

Induktio formula is good. It actually inspired WTP formula that similarly uses cubic acceleration at initial stage. Subsequently, though, WTP curve transitions to linear growth simulating slower development after initial expansion. Obviously, this is not a perfect approximation either only next level iteration. Let me reiterate (😉) I clearly understand tuning tech speed is an enormous job and don't keep an illusion this formula is any way a final solution.

Here is the formula from the code.
Code: [Select]
Calculates tech cost.
cost grow accelerated from the beginning then linear.
a1 = 20                                     // constant (first tech cost)
b1 =-20 // linear coefficient
c1 = 40 // quadratic coefficient
b2 = 600 * <map size> // linear slope
x0 = (b2 - b1) / (2 * c1)                   // break point
a2 = a1 + b1 * x0 + c1 * x0 ^ 2 - b2 * x0   // linear intercept
x  = (<level> - 1)

correction = (number of tech discovered by anybody / total tech count) / (turn / 350)

cost = [S + (x < x0 ? C * x ^ 3 : A + B * x)] * scale * correction

And some sample graph for medium map attached.
As you can see I have tried different functions: cubic (damn, I misspelled it on a graph), quadratic, quadratic with linear component, exponent. Cubic one seems to work perfectly from implementation and expectation point of views. Quadratic grows too slow, exponential - too fast. So cubic is the one.
Interestingly that vanilla formula is also linear-quadratic acceleration transitioning to linear slope. You can clearly see it on magnified graph. The only distinction is that a bent at transition point (around level 4). Whereas new functions are constructed to have a smooth transition - also around level 4 you don't see a bent on other graphs.
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on March 20, 2022, 08:08:49 AM
Early vanilla tech costs work very well. If anything they could be a bit lower. The problem starts in midgame when development speed gets very high. Still quadratic growth is just fine, maybe quadratic initially and cubic later.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on March 20, 2022, 04:25:36 PM
There is a lot of guessing how exactly research accelerates. No one has statistical base to found this on. That's why I propose to include research statistic collection into mods to gather it and present to everybody. Currently I am thinking to add this to WTP.
https://alphacentauri2.info/index.php?topic=21359.msg133675#msg133675
Title: Re: SMACX Thinker Mod
Post by: Induktio on March 21, 2022, 09:33:27 AM
> Almost 60 research needed for Centauri Ecology on the huge planet map is baffling. Late game, higher tech costs makes sense. But not this.

You are playing a mod and this feature is very prominently explained in Details.md. It's recommended to take a look at the docs since the mod has some new game mechanics.

Previously the early tech cost was a little too much and I adjusted it by introducing the cheap_early_tech parameter. It results in around 50% diminishing discount for earliest techs. Vanilla early tech is very cheap and combined with directed research that enables a bunch of OP rush strategies. It's kinda important to nerf them in some way. You can also adjust the general tech discovery rate in alphax.txt if this feels too slow.

> Also, Alt + T hides bases and units intead of opening a menu. Maybe there is something wrong with the installation.

So far nobody has reported any problems with the keyboard shortcuts when just using the vanilla GOG installation. There might be some issues with shortcuts when using PRACX at the same time, but you didn't mention it, so I assume you're not using it. Make sure to check the game version menu (Ctrl+F4) that you're actually running Thinker with the game. Or else I would need some additional info to reproduce this issue.

> Induktio, are you talking some of your thinkier.ini switches can be changed in game menus???

Well, that should be kinda obvious looking at the docs and code. But the tech cost settings cannot be adjusted while in game.
Title: Re: SMACX Thinker Mod
Post by: Hagen0 on March 21, 2022, 07:33:19 PM
Ctrl + F4 works and tells me Thinker is running. Alt + T also worked when I started Thinker the first time. But after that it consistently produced the described effect. It is very baffling. Maybe a reinstall will fix it. So far I was too lazy to do that.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on April 17, 2022, 05:22:10 AM
Seems, AI sometimes bombards units of his enemy (your ally), stationed in your base. This qualifies as surprise attack on you. Is this a bug, or have the AI had enough of your collaboration? Also, I don't remember seeing a warning about rival's SP nearing a major breakthrough in a very long time.
Title: Re: SMACX Thinker Mod
Post by: Alpha Centauri Bear on April 17, 2022, 05:28:19 AM
Collocating pact units is an infinite source of bugs in this game. Bombardment affects all units in tile including yours. So yes, this is a surprise attack.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on April 20, 2022, 11:52:45 PM
Attached save demonstrates harmless, but pesky behavior - multiple identical diplomatic notifications during AI turn. End the turn to get about 20 "Gaians and Procyon have pledged blood truce" pop-ups. Also in late game sometimes occur series of about 4-5 empty requests from AI to initiate diplomatic negotiations - choosing "Switching to main viewscreen" option doesn't lead to diplomatic dialog, just closes request.
Title: Re: SMACX Thinker Mod
Post by: PvtHudson on April 24, 2022, 07:36:39 AM
It would be useful if tech_stagnate_rate parameter in Thinker.ini supported turn intervals. For example, tech_stagnate_rate=100,150:50,200:100,300:200 meaning 100% from the start of the game, 150% from turn 50, 200% from turn 100, 300% from turn 200 to the end of the game. This will allow casual player to adjust their preferred tech rate, not tangling with complicated matters of tech cost formula in the code.
Title: Re: SMACX Thinker Mod
Post by: willa1man on April 26, 2022, 12:47:05 PM
interesting information
Title: Re: SMACX Thinker Mod
Post by: Hans Lemurson on June 08, 2022, 02:03:17 PM
Playing with Thinker v3.1, I ran into a surprising behavior:

Surprise war taking Artifact in HQ

The Morganites had just contacted me to trade techs, and then immediately afterwards, they flew a Unity Copter over to my HQ and attacked it.  I had just vacated it to hunt down a pesky mindworm, and so a tasty Artifact was left as the only unit in the city.  The Unity Chopper captured the Artifact, and I now found myself in a very unexpected War against the Morganites.

Our relations weren't perfect, but the declaration wasn't followed up by any other invasions, so it sure didn't seem like the AI had actually declared that war intentionally.

My guess is that the "Grab free artifact" code kicked in, and ignored the fact that its target was in one of my bases.

I later recovered the Artifact from the fungus next to my HQ where it had sat unmoving ever since capture.
Title: Re: SMACX Thinker Mod
Post by: Neil on July 05, 2022, 04:53:49 AM
Artifacts exist to be consumed and consumed they will be, if not by this Unity Copter than by some other Unity Copter.
Title: Re: SMACX Thinker Mod
Post by: Kiousu on November 30, 2022, 04:56:03 AM
Hi, I'm trying to play thinker mod, but when I try to run thinker.exe I get an error message that states "Error while attempting to patch game binary. Game is unable to start." I've got a clean installation from GOG, I've put all the files from Thinker_v3.1.zip into the game directory(even the german folder, though I don't speak german), I've verified that the terranx.exe works and the game says it's patched to 2.0. Enabling XP compatibility on the terranx.exe file didn't help either. Everything else I can find on google seems to mention something about a terranx_mod.exe, which I don't think is used anymore because I don't see any mention of it in the most recent readme. Basically, I have no clue what I've done wrong, and any help would be appreciated.

In any event, thanks for the hard work Induktio, even the thought that the AI could build a satellite is enough to put me in awe. You rock.
Title: Re: SMACX Thinker Mod
Post by: Induktio on December 09, 2022, 05:06:04 PM
Bug reports should be redirected to Github discussions (https://github.com/induktio/thinker/issues). Minor issues can also be posted on existing threads. There's also a small update to the launcher that should fix some startup issues as reported by other users. Old launcher is still available as a separate download but there's no reason to use it unless there's issues with the new version.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 5: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default), Aeva.english (default).
Style sheets: 0: .
Files included: 36 - 1181KB. (show)
Queries used: 15.

[Show Queries]