Author Topic: The Secrets of Alpha Centauri's AI Social Effect Selection  (Read 2168 times)

0 Members and 1 Guest are viewing this topic.

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection
« on: April 25, 2020, 03:50:43 AM »
I have been working on the AI Social engineering modifiers. This list covers all the  modifiers in the code. I expect certain sections will benefit any modifier of the stock factions.

I will start with ECONOMY. ECONOMY remains the most complex of the AI choices and this selection remains the only model I am not certain about in a few areas of values. I note those areas. The calculations occurred in the order I list them in this list.

This unused tidbit of code appears before Economy:
Unused in Stock Game:
Any faction with a CONQUER mandate: Local 2 always equals at least 1.

ECONOMY:
Important Variables:
Modified EFFICIENCY Value * 4 + Sum of Inefficiency scores for each base the faction controls. Moved into local 6.

ECONOMY -1 or lower (Special section ignored any modifiers from ECONOMY +0 or higher):
Jump to the final section:
Set economy modifier to -1.
If local 2 equals zero: -1 X 2

Skip to next section on Fight values after the +0 to +4 economy section.

ECONOMY Score (+1):
Not exactly certain:
The game checks 96 units AI plan for non defense status, and then sets a value to 1 and checks against an unknown flag. The number of units in the first part remain dependent on values for the units in a base. Unknown???
The value of the numerator remains the sum of units successful checked for non defense AI Plan and placed in a base??? The divisor remains the value of the unit last checked (min. 1 - max 3???).

Economy Score (+0)
Not exactly certain
Same as Economy +1 except the value after checking the unknown memory locationVirt and multiplying the result, you multiply the product by ECONOMY + 1 and subtract the final product from the numerator value. The divisor for the next and final step remains Local 2 + 1

ECONOMY Score +2 to +4
(Sum of tiles worked at each base this faction controls + ECONOMY Score (min. 2 - max. 4) * 2 - 4) / (Local 2. [war status] + 1.
If quotient from economy Scores of +0, +1, and +2 or more Economy greater than 0 and value from local 6 greater than 0, then decrease value of local 6 until either the quotient equals 0 or the value of local 6 reaches zero and place the remaining quotient (even negative) or 0 into local 6 (critical for later efficiency calculations).

0 or 1:
If current faction fight value 0 or higher, set the value of ecx modifier to 0.
If current faction fight value -1 or lower, compare local 2 value to 2 and jump if local 2 equal to or higher than 2. Set value to 0. If 0 or 1, than economy modifier equals 1.

(((0 or 1) + Discover * 2) + Build + 1) * Quotient, (Quotient * 2 for local 2 = 0), -1 for ECONOMY -1 or lower, or -2 for local 2 = 0 and ECONOMY -1 or lower.

(Unused) Social Mandates in Default Game:
BUILD and/or DISCOVER: Value X 2
EXPLORE and/or CONQUER: Value X .5

Stock AI Mandate modifiers:
Build: X 2
Build and Conquer: X 1
Build and Explore: X 1
Build and Discover: X 2
Any combination of Build with any other emphasis equals X 1
Any other combination of emphasis without Build yields X 1
Maximum interest yielded from Build and Discover combination from special value.

Divide the final value by local 3 (1-3) based on technology values.

« Last Edit: April 25, 2020, 04:53:26 AM by Bearu »
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: SUPPORT
« Reply #1 on: April 25, 2020, 03:55:27 AM »
The support modifier employs the a virtual value where negative values remain considered only for the application of modifiers. Miriam possesses a high affinity for SUPPORT.

Load effective address: SUPPORT + 4: Value shown as 0 to 7 (-4 = 0 and +3 = 7)
x = Virtual SUPPORT value (0 to 7) * 4 + a memory segment that appears as zero I think (not 100% certain)

If actual SUPPORT value = -4:
3 * x = Virtual SUPPORT value (0 to 7) * 4 + a memory segment that appears as zero I think (not 100% certain) * 3
If local 2 = 0 skip the next section.
If local 2 = 1 or higher:
2 * x (max here of 6x) = Virtual SUPPORT value (0 to 7) * 4 + a memory segment that appears as zero I think (not 100% certain) * 2
If actual SUPPORT value > -3:
2 * x (maximum of 12 x here because -3 and -4 SUPPORT modifiers stack) or Virtual SUPPORT value (0 to 7) * 4 + a memory segment that appears as zero I think (not 100% certain) * 2
If actual SUPPORT value = to -1 OR -2 AND the faction ECONOMY score remains +1 or lower:
1.5 * x (max of 3x here because the previous modifiers besides the first after the check do not stack with this modifier)

Unused Faction Mandates in stock game: These values stack with each other (ie the Believers as a Conquer and Explore faction receive x * 6)
Conquer: x * 3
Explore: x * 2
Discover: x * .5

Stock game mandate modifiers: Modify x with the appropriate combination of Mandate combinations. (ie. Miriam receives a modifier of 4.5x)

Fight = 1: X 2

Explore: X 1.5
Discover: X .75
Build: X .5
Conquer: X 1.5
« Last Edit: April 25, 2020, 04:17:56 AM by Bearu »
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: MORALE
« Reply #2 on: April 25, 2020, 04:17:00 AM »
This section appears as the root cause of the AI's obsession for MORALE because the other modifiers work off these values. The other modifiers for MORALE remain a variable constant dependent on military power.
u = Sum for the # of bases this faction controls currently + the Faction military unit points (+1 for every military unit this faction controls and an additional +1 point for every Combat and Assault AI Plan military unit this faction controls in the current turn)
1. u * Local 2 (a value dependent on military unit calculated earlier) +1.
2. u * Local 2  * Faction "Fight" value + 2
3. u * Local 2  * Faction "Fight" value + 2 * modified MORALE value (Officially -6 to 6) 4. u * Local 2  * Faction "Fight" value + 2 * modified MORALE value (Officially -6 to 6)  * Local 3 (min. 1 - max. 3)
5. Then multiply by 9/8. I made an error in my previous valuation.
6. Multiply by stock mandate selection:
Fight 2 or higher (unused in stock game): X 2
Conquer: X 2
Conquer and Discover: X 2 (Spartans)
Conquer and Build: X 1 (Hive)
Conquer and Explore: X 1 (Believers)
Any other combination yields: X 1

Fight =< -1:
Conquer: X 1
Conquer and Explore: X 1
Conquer and Discover: X 1
Conquer and Build: X 1
Build and Explore: X .5 when the faction remains in a war mode
Discover: X.5 when the faction remains in a war mode.
Discover and Explore: X .5 when the faction remains in a war mode.
Discover and Build: X .5 when the faction remains in a war mode.
Explore ONLY: X1 (Gaians)
Conquer, Discover, Explore, and Build: X 1

Unused mandate modifiers: These modifiers stack with each other (ie. Miriam receives a modification of  u * 1.5 for Conquer = X 3 and Explore = X .5
CONQUER: X 3
EXPLORE and/or Build: X .5
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: EFFICIENCY
« Reply #3 on: April 25, 2020, 04:23:10 AM »
Local value 6: Modified EFFICIENCY Values + Sum of inefficiency values from each base the faction controls and potentially modified in ECONOMY section.
Modified base Efficiency ranges from 0 to 8 with -4 at 0 and +4 at 8.
1. -3 EFFICIENCY combinations: Modified EFFICIENCY value ( 1 ) X 2
2. -4 EFFICIENCY combinations: Modified EFFICIENCY value ( 0 ) X 4
3. If local 2 remains = 0: Local 6 Value * 2
3. Perform the Mandate checks described below:
Build: X 2 (The Morganites and the Drones)
Build and Conquer: X 1 (The Hive)
Build, Explore, and Conquer: X 1
Build, Discover, Explore, and Conquer: X 1
Conquer: X .5
Conquer and Explore: X .5 (The Believers)
Discover: X 2 (The University)
Discover and Conquer: X .5 (The Spartans)
Discover and Explore: X 1 (The Peacekeepers)
Discover and Build: X 2
Explore: X 1 (The Gaians)
Unused Alternate Mandate Check: These values stack
Discover: X 3
Conquer and/or Explore: X .5
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: GROWTH
« Reply #4 on: April 25, 2020, 04:26:31 AM »
Important Constants: Sum the surplus nutrients from each base the current faction controls (between 0-99 per base) in turn upkeep.
1. Insert (EXPLORE mandate value X 2 + 2)
2. Subtract Build Mandate Value: (EXPLORE mandate value X 2 + 2) - BUILD mandate
3. Sum of surplus nutrients from each base owned by the current faction (between 0-99 per base) in turn upkeep + Sum of differences between each faction bases' current population and base population goal (next hab facility + POPULATION) * ((EXPLORE mandate value X 2 + 2) - BUILD mandate)
4. Line 3 * Number of units with the Colonization AI plan the current faction controls + 1.
5. Line 4 * GROWTH value (no upper or lower limit) from Social engineering modifiers and faction modifiers
6. Line 5 * 2 / 3
7. Line 6 * 2 if the current faction possesses the most votes in a game with Diplomatic victory enabled and no cooperative victory enabled.
8. Multiply the value * .5 if the faction possesses tightened Habitation restrictions from the Faction bonuses and penalties (POPULATION > 0).
9. Proceed with the stock Mandate checks:
Multiple Line 7 or 8 * 2 for factions with EXPLORE and CONQUER mandates in stock game.
EXPLORE and Conquer: X 2

Alternate Mandate Checks (unused)
Explore and/or Build: X 2
Discover: X.5

Edit: Added  population goal difference for GROWTH calculations. I forgot this variable.
« Last Edit: April 26, 2020, 03:32:37 AM by Bearu »
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: POLICE
« Reply #5 on: April 25, 2020, 04:29:26 AM »
This value in the original game covers parts of TALENT. I plan on making the game calculate all ranges of POLICE instead of only -4 to 0.

POLICE Score Part 1:
1. POLICE Score (-4 to 0 calculated as -2 to 2)

2. (# of Assault AI Plan Units with an unknown check before it * 2 + 1) * Modified POLICE Score * # of bases the current faction controls.

3. Current Faction Technology Points equal or less than the second faction tech points (Check from specific location)
AND
Current Faction might score equal to or less than the second might score (7 = weakest to 1 = strongest).
Value * 2

4. Current Faction Technology Points equal or greater than the second faction tech points (Check from specific location)
AND
Current Faction might score equal to or greater than the second might score (7 = weakest to 1 = strongest).
Value * .5
5. Value / 2 - Current Faction "Fight" Score (Final value of 1-3)

Unused in Stock Game:
Explore AND/OR Conquer: X 2
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: TALENT/POLICE
« Reply #6 on: April 25, 2020, 04:32:33 AM »
TALENT/POLICE Score Part 2:

Talent Score (-4 to 3 calculated as 0 to 7)

Police Score (-5 to 3 calculated as 0 to 8 )

x = Modified TALENT Score + (Modified Faction TALENT Score * 8 ) + (Modified Faction Police Score)
 
u = x * 4 + Unknown constant data segment value (appears as 0)

If faction remains in a war mode (Local 2 > 0), then multiply number of bases a faction controls by the modified POLICE Score and add the value to u.
Bases * Modified Police + u
X = u + Modified Police Score * Current faction number of bases

Stock game Mandate modifiers:
Explore AND Discover: X * 2
Conquer AND Discover: X * .5
Conquer AND Build: X * .5
Any other combination X 1

Unused mandate modifiers:
Explore AND/OR Conquer mandates: X * 2 (Gaians, Peacekeepers, Hive, Spartans, and Believers all receive X 2)
Build and Discover without either Conquer or Explore: X * 1
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: PLANET
« Reply #7 on: April 25, 2020, 04:35:30 AM »
PLANET
Important variables for understanding Planet Calculations:
Sum of the all the Bases under a single Owner:
Base Ecodamage * 4 / 4 - PLANET (Min. 1 and max. of 99)

1. Start with 4 - Sum of PLANET Values for considered social models and inherent faction bonuses.
2. Multiply the difference from Line 1 by sum for all bases the current faction controls of (Base Ecodamage * 4 / (4 - PLANET (Min. 1 and max. of 99)))
3. Multiply the product of step #2 by 4.
4. Add 25% of line 3 to the final value.
5. Check if the faction possesses an inherent faction bonus for Planet. Jump if +1 or higher and add the number of combat units the faction controls to the total value for planet.
6. If the faction does not possess an inherent Planet bonus, then check the strongest weapon the faction discovered in the game against the value of PSI weapons for the faction. If the faction's strongest weapon discovered exceeds the modified PSI value, then jump into the social mandate controls. (Most factions strongest weapon values will exceed the faction's modified psi value)
7. If the above check succeeded, check if the local variable for faction technological check remains equal to or greater than 2. Jump if 1 or less. If 2 or more, then halve the PLANET value.
8. Perform the Mandate checks discussed below:
Non-Conquer and Explore (In this specific order):
Explore and Discover: X 1 (The Peacekeepers)
Explore: X 4 (The Gaians)

Non-Conquer and Non-Explore (In this specific order):
Build: X .5 (The Morganites)
Build and Discover: X.5
Discover: X .5 (The University)

Conquer and any other mandate (In the order below):
Conquer and Explore: X 1 (The Believers)
Conquer and Discover: X .25 (The Spartans)
Conquer and Build: X .25 (The Hive)
Conquer, Discover, and Build: X .25
Conquer, Explore, and Discover: X 1
Conquer, Build, Discover, and Explore: X 1

Unused Alternate Mandate modifiers:
Explore: X 2
Build: X .5
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: RESEARCH
« Reply #8 on: April 25, 2020, 04:37:42 AM »
The simplest of the Social Effect AI.
RESEARCH:
RESEARCH Score (-5 to 5) * Sum of Laboratory Output from faction's bases * 2/3 * 2 if the faction possesses non-war status (Local 2 = 0) * Mandate modifiers.

Mandate Modifiers: (Unused in Stock Game)
Discover Mandate: X 2
Conquer Mandate: X .5
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: INDUSTRY
« Reply #9 on: April 25, 2020, 04:43:44 AM »
Another simple AI appears in the INDUSTRY section.
INDUSTRY:
[Local 3.] (1-3): Technology lead variable
If less than 1, replace with 1.
If greater than 2, replace with value of 2 (Bug; should be 3).
If less than or equal to 2, replace with value of Local 2. (aka 1 or 2)

Final formula for calculating the value of an industry.
((Local 2 + Build) + (Local 2 + Build) + 1) * Sum of Current Faction's Base Populations * Local 3 (1-3) * INDUSTRY Score * 2/3 * Faction mandate scores

AI Mandates Modifiers: These stack with each other. Yang receives for example a X 3 modifier.

Conquer: X 2
Build: X 1.5
Discover: X .5

Fight < 0:
Any faction without a Build emphasis: X .5

No alternate mandate modifiers for the rest of the AI effects.
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: Upheaval Bonus
« Reply #10 on: April 25, 2020, 04:46:16 AM »
Who would have thought upheavals provided additional values for the AI? This formula affects all values except PROBE which occurs after this section.

AI Only:
+0 interest if no social model changes.
Otherwise:
Social Model Changes + 1 (min. 2 to max. 5)

x = ((Social Model Changes + 1 * Social Model Changes + 1) * Social Model Changes + 1) * 3 for human player or * Faction difficulty level for AI Player (1 = easiest difficulty to 5 = transcend)

If an Alien faction: X * .5

Multiply by *.5 and add to the interest local value.
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline Bearu

The Secrets of Alpha Centauri's AI Social Effect Selection: PROBE
« Reply #11 on: April 25, 2020, 04:51:05 AM »
The PROBE Modifiers feel like an after thought. I suspect the developers added PROBE late in the game's development.

PROBE:
Ignore for any social models or factions with 0 in PROBE.

+1 in ECX per cycle: Perform these checks for each faction beside the current faction.
Retain ECX values between checks.

Relationship modifiers:
Value X .5 for each pact with another faction
Ignore the modifiers until the faction base empahsis if the first faction "wants revenge" on the second faction.
Value X .5 for each treaty with another faction
Value X. 5 for each faction the current faction does not have a truce with
Value X .5 for each faction the current faction is not at war.

Move an unknown constant into the rountine (starts at 0 outside the rountine) + Add # of bases the current faction controls * PROBE modifier (-2 to 3) * (Modified Value of ECX from the Relationship flags check) * .5 * Mandate modifiers 

Mandate Modifier:
X2 for a faction with either BUILD or DISCOVER

This finishes the modifiers for important AI Social effects.
Picture: Beldam
"I am half sick of shadows, said the Lady of Shallot."

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: The Secrets of Alpha Centauri's AI Social Effect Selection: POLICE
« Reply #12 on: April 28, 2020, 05:19:15 AM »
I plan on making the game calculate all ranges of POLICE instead of only -4 to 0.

Good idea.  I made some predefined units with Non-Lethal Methods, and I was able to get the AI to use them.  I had to reduce my Democratic penalty for POLICE from -2 to -1, because the stock AI was too dumb to evaluate whether it should be using police units or not.  My compromise was to make the sum of all Politics and Economics choices be POLICE friendly, with only Democratic giving a -1 penalty.

I had already long since moved the POLICE penalties out of Free Market, which later I renamed to Capitalist.  The idea that a Free Market would be opposed to the use of police, is completely stupid IMO.  Look at the USA, ever heard of the Prison Industrial Complex?  Prisons are a profit center, we incarcerate more people per capita than any nation in the world.  Instead I moved the POLICE penalties to Democratic, Knowledge, and Cybernetic, so that a player can mix and match instead of having to swallow an egregious -5 POLICE for some SE choice.  Knowledge does make narrative sense, academics wanting to be free and freedom of information and all of that.

Not so sure about Cybernetic vs. Eudaimonic.  I just repeated the idea of POLICE being a RESEARCH restriction.  I'm not sure how I'd penalize Cyborgs if not with POLICE, as there are only so many play mechanics to choose from.  Not sure GROWTH makes any sense, as cyborgs could just replicate, or replicate substantial parts of a body.  I mean what's the Cyborg Factory for?

Offline Nexii

Re: The Secrets of Alpha Centauri's AI Social Effect Selection
« Reply #13 on: April 28, 2020, 04:52:15 PM »
I gave Cybernetic (AI Control) negative PROBE. Automated systems always end up getting hacked. Same with the faction negative PROBE.

Eudaimonic (Utopian) got the negative POLICE, usually utopian societies are depicted as peaceful and light on population control. MORALE I guess wasn't a bad penalty but thinking in the vein of like Star Trek, they still make impressive war ships and have strong military training.

Yea I also found -5 POLICE too extreme for the early game, tried that on Democracy. Now I have Demo and Knowledge each giving -2.

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: The Secrets of Alpha Centauri's AI Social Effect Selection
« Reply #14 on: April 29, 2020, 05:59:35 AM »
I gave the Cybernetic Consciousness +1 PROBE.  They are Borg.  They inject nanites into you.  Well not really, actually they just study attack and defense algorithms in kindergarten.  Funny how "automated systems" can mean any value to any person.  I mean if society gets far enough along, what's the real hack?  Touching things in real life, instead of doing it all through a virtual world?


 

* 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 sea is everything. It covers seven-tenths of the globe. Its breath is pure and healthy. It is an immense desert where a man is never alone, for he can feel life quivering all about him. The sea is only a receptacle for all the prodigious, supernatural things that exist inside it; it is only movement and love; it is the living infinite.
~Jules Verne ’20,000 Leagues Under The Sea’, Datalinks

* 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]