Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Topic started by: Dio on December 21, 2015, 09:18:03 PM

Title: What do you, the other players, think? (Poll)
Post by: Dio on December 21, 2015, 09:18:03 PM
     I found a buried feature that appears complete except that the game negates the value it offers when it determines whether or not the AI provides a treaty with another faction. I can provide the complete set-up for the affected area. The feature it jumps over negates any influence from a few features that depend upon the number of bases that the faction which refuses or accepts the treaty offer (often a human player). The formula appears as follows: [(Faction that refuses or accepts treaty request (e.g. Human Player) might value (range: 1-99,999) + 1) * (4 - Fight Interest of Faction that requests treaty [e.g. AI]) * 2 / Faction Might Value of treaty proposer (e.g. AI) + 1]. If either faction that remains involved in this proposal are the Gaians, than add two towards the quotinent.
     If the factions have a truce active, than jump over the next step. Add 3 - Fight interest of Treaty proposer towards the quotinent from the first expression. If the faction that either accepts or refuses the treaty controls zero bases, than skip the three sentences that follow this sentence.  If the commerce rate of the treaty proposer remains lower than the commerce rate of the faction that refuses or accepts the treaty, than skip the two sentence that follow this sentence. If none the above conditions activate, than take the sum of energy surplus from all bases of the faction that refuses or accepts the treaty (Add +1 per base if the faction has the INTEREST, 0 Faction Bonus); divide it by the number of bases from this faction and add the whole number quotinent towards the value from either the first or second expression. If the commerce rate of the faction that proposes the treaty is above the commerce rate of the faction that accepts or rejects the treaty, than add + 1 towards the previous expression.
If a condition is not zero, than skip over the next four sentences. If the human player has a might rating equal to or below Sufficient, than jump over the next sentence. If the above condition is not met, than check if the AI Player has a might above Sufficient. If the factions meet either of the above conditions, add +1 towards this value. If the value in another memory address is zero, add +1 towards this value.
    This last section illustrates the coverup and question that this thread involves. The game then checks if the factions have a truce and replaces the value from the above procedures with either a 1 or 0. If the factions have a truce or are the Gaians, than the value always remains 1. If the factions do not have a truce, than the value is zero.
     This leads me to ask this question. What do you make of this sequence? What change might you suggest? I think the best course involves changing this procedure so it only employs the zero or 1 values while the game checks whether or not the factions have a truce.
Title: Re: What do you, the other players, think? (Poll)
Post by: Mart on December 21, 2015, 09:27:58 PM
Is this feature inactive?
Does this feature include 3 factions? or only 2? As I understand, it helps to sign Treaty?
Title: Re: What do you, the other players, think? (Poll)
Post by: Dio on December 21, 2015, 09:31:22 PM
This procedure only involves two factions: the faction that proposes the treaty (AI) and the faction that rejects or accepts the treaty proposal (Human).
Title: Re: What do you, the other players, think? (Poll)
Post by: Dio on December 21, 2015, 09:35:50 PM
Is this feature inactive?
Does this feature include 3 factions? or only 2? As I understand, it helps to sign Treaty?
This procedure partly determines the value that goes into a check that determines whether or not the scripts (Alientreaty, Factiontreaty, or Offertreaty scripts) for a treaty request appear. The section in question appears as the 0 or 1 overides the value that appears in the first three quarters of that paragraph.
Title: Re: What do you, the other players, think? (Poll)
Post by: Mart on December 21, 2015, 10:19:22 PM
is the value float type? or integer?
Title: Re: What do you, the other players, think? (Poll)
Post by: Dio on December 22, 2015, 01:48:07 AM
The first portion appears to operate as a floating value. The second portion simpy employs integer values. The floating point value originates from the values in the first section of that calculation.
Title: Re: What do you, the other players, think? (Poll)
Post by: Dio on December 22, 2015, 02:05:03 AM
The last section of this procedure before it enters the actual section for the script adds the result from the subtraction of the AI Faction Commerce Rate from the Human Commerce Rate. If the value falls below 0 or exceeds 100, than add 0 or 100 respectively. Otherwise, add the result to either 0 or 1. This value then sets a value in another register if it does not equal 0. The last section appears as 0 + Argument 2 (0 or 1 + difference between commerce rates) + 5. It compares this value against a faction's reputation values (0-99) + the number of bases that they continue to assimilate from the other faction (I think is the human reputation value + bases). The game jumps over the treaty scripts if the first expression is equal to or greater than the second expression. The last section checks if a faction has the I want revenge diplomatic status set. If they do not, than jump into the treaty script.
Title: Re: What do you, the other players, think? (Poll)
Post by: Mart on December 22, 2015, 12:33:05 PM
Looks like 0 and 100 operates as percentages, but values between 0 and 1 can do exactly the same intention. It all looks as quite complicated logic, I will have read that more and try to figure out what that actually means.
What would help, is realization what possible values it can take, but also, if it exceed some range, what range it is.

Integer values can be added/multiplied by, etc. with float and compiler would make implicit cast. How does it look in assembly, I do not know. If we deal with values between 0 and 1, and they represent percentages, then this may be the case. Also float would be necessary in this case.

What are your plans here? You said that part of the formula is inactive. Would you like to enable it?
Title: Re: What do you, the other players, think? (Poll)
Post by: Nexii on December 28, 2015, 06:59:26 AM
This is a bit hard to understand.  A flowchart of the AI decision tree might be easier for me to comment on.  Suffice to say the way the AI decides to war/treaty/truce is really erratic in game.
Title: Re: What do you, the other players, think? (Poll)
Post by: Dio on December 28, 2015, 11:39:12 PM
The hard portion about this whole procedure remains that it covers many different scripts. I mapped out a simplified decision tree as follows:
1. Check if the faction wants to "SwearaPact" script.
2. If the factions have a vendetta, than check for "RansomTreaty Script"
3. If not the ransomtreaty script, than check for various types of truce scripts (Energytruce, techtruce, and offertruce/Factiontruce).
4. Then check if the faction wants to surrender (TrucePlease).
5. If the faction does not meet the conditions of surrender or "More War", than enter into the section for the Faction treaty scripts.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 15.

[Show Queries]