Author Topic: SMACX Thinker Mod  (Read 155906 times)

0 Members and 8 Guests are viewing this topic.

Offline Rocky

Re: SMACX Thinker Mod
« Reply #885 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?

Re: SMACX Thinker Mod
« Reply #886 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.

Offline Rocky

Re: SMACX Thinker Mod
« Reply #887 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.

Re: SMACX Thinker Mod
« Reply #888 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!!!!!

Offline Rocky

Re: SMACX Thinker Mod
« Reply #889 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.

Re: SMACX Thinker Mod
« Reply #890 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

Offline Induktio

Re: SMACX Thinker Mod
« Reply #891 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.

Re: SMACX Thinker Mod
« Reply #892 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)

Offline Induktio

Re: SMACX Thinker Mod
« Reply #893 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?

Re: SMACX Thinker Mod
« Reply #894 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.

Offline EmpathCrawler

Re: SMACX Thinker Mod
« Reply #895 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

Offline Induktio

Re: SMACX Thinker Mod
« Reply #896 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.

Re: SMACX Thinker Mod
« Reply #897 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.
« Last Edit: February 26, 2022, 05:56:15 PM by Alpha Centauri Bear »

Offline EmpathCrawler

Re: SMACX Thinker Mod
« Reply #898 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:

Re: SMACX Thinker Mod
« Reply #899 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);

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

The Isle of the Deep is really not a single creature but a colony of thousands of individual tubules, an aquatic vector of the Mind Worm which terrorizes Planet's continents. Over its lifetime certain tubules secrete a tough, gluelike substance which hardens to form the characteristic shell that floats the colony and creates the appearance of a rogue island.
~Lady Deirdre Skye 'A Comparative Biology of Planet'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 37.

[Show Queries]