Ryoga
King
- Joined
- Oct 12, 2010
- Messages
- 993
The fact that you can eradicate all aliens from the map and never see them going into red is quite odd in my opinion, so I made of few tests to try and understand how that works and why it is so hard to get the aliens angry.
Eventually I plan to make my own mod to fix that, but right now I thought I could share my findings for other modders and you might as well contribute to that if you have other data.
The relevant rows in the XML database are under "GlobalDefines.xml"
What do they mean?
ALIEN_REPRISAL_AGGRO_LOW This is the amount of "hate" you get for a low tier hostile action against aliens. Attacking an alien is confirmed to be one of such actions (not clear if there are others). By default it is set on "1" and it is subtracted from the "alien opinion" value.
ALIEN_REPRISAL_AGGRO_MEDIUM This is the "hate" value you get for a medium tier hostile action against aliens. I have yet to determine which action is considered "medium tier". By default it is set on "3" and it is subtracted from the "alien opinion" value.
ALIEN_REPRISAL_AGGRO_HIGH This is the "hate" value you get for a high tier hostile action against aliens. Razing a nest is confirmed to be one of such actions (not clear if there are others). By default it is set on "5" and it is subtracted from the "alien opinion" value.
ALIEN_NEST_FRIENDLY_WEIGHT This is the amount of positive points you get each turn per every alien nests in your borders (the more nests you have in your borders, the more points you get each turn). By default it is set on "0.25".
ALIEN_OPINION_FRIENDLY_THRESHOLD This is the amount of points the "alien opinion" must reach before aliens become friendly (blue) to you. By default it is set on "15".
ALIEN_OPINION_HOSTILE_THRESHOLD This is the amount of points the "alien opinion" must reach before aliens become hostile (orange) to you. By default it is set on "-15".
ALIEN_OPINION_VERY_HOSTILE_THRESHOLD This is the amount of points the "alien opinion" must reach before aliens become very hostile (red) to you. By default it is set on "-45".
NEGATIVE OPINION DECAY I wasn't able to find where this value is set in the XML, but my tests prove that a decay value definitely exists.
This value is not affected by Gamespeed. Tests on Marathon and on Quick both show that the decay value of negative "alien opinion" is exactly 0.25 per turn (it used to be 1 before the December 2014 patch).
Further testing on Sputnik difficulty, Apollo difficulty and frenzied aliens option did not show any difference in the "hate" decay or "hate" gain.
All the tests were done on early turns. But this game isn't supposed to use the "era" system of Civ V, so there shouldn't be any difference.
-Since only "attacking" is considered an hostile action and not "killing", passive killing does not cause any change in the "alien opinion". For example aliens that are killed by your units defending near a nest, do not cause any change in the "alien opinion".
-City attacks are not considered hostile actions at all, even when they kill aliens.
-Same as above, aerial attacks are not considered hostile actions.
-Any ranged attack that is launched from any hexes that aren't directly adjacent to the target do not affect the "alien opinion" (this is most likely a bug).
-The above is true for naval units, whether they attack surface aliens or sea aliens they only increase hostility if they attack from an adjacent tile.
NEW - LUA API
I have found the lua API that are related to the alien opinion.
Aliens.GetOpinionForPlayer( playerID )
Aliens.SetOpinionForPlayer( playerID, opinionID )
Examples:
This prints the alien opinion level for player 0 (the human player in single player games)
This sets the alien opinion level for player 0 to "1".
There are four existing level of opinions each corresponding to a precise ID.
- 0 = Neutral level (green)
- 1 = Friendly level (blue)
- 2 = Hostile level (orange)
- 3 = Very Hostile level (red)
These four levels can also be called from a specific table:
AIAlienOpinionTypes.ALIEN_OPINION_NEUTRAL is equal to "0"
AIAlienOpinionTypes.ALIEN_OPINION_FRIENDLY is equal to "1"
AIAlienOpinionTypes.ALIEN_OPINION_HOSTILE is equal to "2"
AIAlienOpinionTypes.ALIEN_OPINION_VERY_HOSTILE is equal to "3"
Aliens.SetOpinionValueForPlayer( playerID, opinionvalue )
This allows to set the precise value of the alien opinion for the specified player.
Example:
This sets the alien opinion value for player 0 to "-50".
On the default settings this means that the alien opinion will turn "very hostile" and it will remain so for quite a few turns until hate decays.
Regretfully there doesn't seem to be a GetOpinionValueForPlayer function.
Aliens.DoCityWormStrike(city, numWorms, strikeRange, strikeDuration)
This is the function used in the Worm Strike Covert Ops script.
Example:
This spawns 4 worms near the capital of player 0.
"strikeRange" seems to determine how closer to the city the worms will spawn. It seems however that they cannot spawn closer than 2 hexes away and they do not necessarily spawn at the specified distance.
It is unclear what "strikeDuration" exactly does. What is certain is that i does not determine how long the summoned worms will stay.
Rather it seems to determine how many turns the worms will stay still before moving after the summoning, but I'm not 100% positive about that.
Worms spawned this way are immune to the ultrasonic fence of the designated city, but not to ultrasonic fences from other cities.
Other API
Aliens.GetTotalSeaDamageDealt()
Aliens.GetTotalLandDamageDealt()
Aliens.GetTotalLandUnitsLost()
Aliens.GetTotalSeaDamageReceived()
Aliens.GetTotalPlayerUnitsKilled()
Aliens.GetTotalSeaUnitsLost()
Aliens.GetTotalLandDamageReceived()
These are all global values and do not require arguments. They are pretty straightforward as to what they do, but "Aliens.GetTotalSeaDamageDealt()" doesn't seem to work as it always reports "0".
Eventually I plan to make my own mod to fix that, but right now I thought I could share my findings for other modders and you might as well contribute to that if you have other data.
The relevant rows in the XML database are under "GlobalDefines.xml"
Code:
<Row Name="ALIEN_REPRISAL_AGGRO_HIGH">
<Value>5</Value>
</Row>
<Row Name="ALIEN_REPRISAL_AGGRO_MEDIUM">
<Value>3</Value>
</Row>
<Row Name="ALIEN_REPRISAL_AGGRO_LOW">
<Value>1</Value>
</Row>
<Row Name="ALIEN_NEST_FRIENDLY_WEIGHT">
<Value>0.25</Value>
</Row>
<Row Name="ALIEN_OPINION_FRIENDLY_THRESHOLD">
<Value>15</Value>
</Row>
<Row Name="ALIEN_OPINION_HOSTILE_THRESHOLD">
<Value>-15</Value>
</Row>
<Row Name="ALIEN_OPINION_VERY_HOSTILE_THRESHOLD">
<Value>-45</Value>
</Row>
What do they mean?
ALIEN_REPRISAL_AGGRO_LOW This is the amount of "hate" you get for a low tier hostile action against aliens. Attacking an alien is confirmed to be one of such actions (not clear if there are others). By default it is set on "1" and it is subtracted from the "alien opinion" value.
ALIEN_REPRISAL_AGGRO_MEDIUM This is the "hate" value you get for a medium tier hostile action against aliens. I have yet to determine which action is considered "medium tier". By default it is set on "3" and it is subtracted from the "alien opinion" value.
ALIEN_REPRISAL_AGGRO_HIGH This is the "hate" value you get for a high tier hostile action against aliens. Razing a nest is confirmed to be one of such actions (not clear if there are others). By default it is set on "5" and it is subtracted from the "alien opinion" value.
ALIEN_NEST_FRIENDLY_WEIGHT This is the amount of positive points you get each turn per every alien nests in your borders (the more nests you have in your borders, the more points you get each turn). By default it is set on "0.25".
ALIEN_OPINION_FRIENDLY_THRESHOLD This is the amount of points the "alien opinion" must reach before aliens become friendly (blue) to you. By default it is set on "15".
ALIEN_OPINION_HOSTILE_THRESHOLD This is the amount of points the "alien opinion" must reach before aliens become hostile (orange) to you. By default it is set on "-15".
ALIEN_OPINION_VERY_HOSTILE_THRESHOLD This is the amount of points the "alien opinion" must reach before aliens become very hostile (red) to you. By default it is set on "-45".
NEGATIVE OPINION DECAY I wasn't able to find where this value is set in the XML, but my tests prove that a decay value definitely exists.
This value is not affected by Gamespeed. Tests on Marathon and on Quick both show that the decay value of negative "alien opinion" is exactly 0.25 per turn (it used to be 1 before the December 2014 patch).
Further testing on Sputnik difficulty, Apollo difficulty and frenzied aliens option did not show any difference in the "hate" decay or "hate" gain.
All the tests were done on early turns. But this game isn't supposed to use the "era" system of Civ V, so there shouldn't be any difference.
-Since only "attacking" is considered an hostile action and not "killing", passive killing does not cause any change in the "alien opinion". For example aliens that are killed by your units defending near a nest, do not cause any change in the "alien opinion".
-City attacks are not considered hostile actions at all, even when they kill aliens.
-Same as above, aerial attacks are not considered hostile actions.
-Any ranged attack that is launched from any hexes that aren't directly adjacent to the target do not affect the "alien opinion" (this is most likely a bug).
-The above is true for naval units, whether they attack surface aliens or sea aliens they only increase hostility if they attack from an adjacent tile.
NEW - LUA API
I have found the lua API that are related to the alien opinion.
Aliens.GetOpinionForPlayer( playerID )
Aliens.SetOpinionForPlayer( playerID, opinionID )
Examples:
Code:
print ( Aliens.GetOpinionForPlayer( Players[0] ) )
Code:
Aliens.SetOpinionForPlayer( Players[0], 1 )
There are four existing level of opinions each corresponding to a precise ID.
- 0 = Neutral level (green)
- 1 = Friendly level (blue)
- 2 = Hostile level (orange)
- 3 = Very Hostile level (red)
These four levels can also be called from a specific table:
AIAlienOpinionTypes.ALIEN_OPINION_NEUTRAL is equal to "0"
AIAlienOpinionTypes.ALIEN_OPINION_FRIENDLY is equal to "1"
AIAlienOpinionTypes.ALIEN_OPINION_HOSTILE is equal to "2"
AIAlienOpinionTypes.ALIEN_OPINION_VERY_HOSTILE is equal to "3"
Aliens.SetOpinionValueForPlayer( playerID, opinionvalue )
This allows to set the precise value of the alien opinion for the specified player.
Example:
Code:
Aliens.SetOpinionValueForPlayer(Players[0], -50 )
This sets the alien opinion value for player 0 to "-50".
On the default settings this means that the alien opinion will turn "very hostile" and it will remain so for quite a few turns until hate decays.
Regretfully there doesn't seem to be a GetOpinionValueForPlayer function.
Aliens.DoCityWormStrike(city, numWorms, strikeRange, strikeDuration)
This is the function used in the Worm Strike Covert Ops script.
Example:
Code:
Aliens.DoCityWormStrike(Players[0]:GetCapitalCity(), 4, 1, 5)
This spawns 4 worms near the capital of player 0.
"strikeRange" seems to determine how closer to the city the worms will spawn. It seems however that they cannot spawn closer than 2 hexes away and they do not necessarily spawn at the specified distance.
It is unclear what "strikeDuration" exactly does. What is certain is that i does not determine how long the summoned worms will stay.
Rather it seems to determine how many turns the worms will stay still before moving after the summoning, but I'm not 100% positive about that.
Worms spawned this way are immune to the ultrasonic fence of the designated city, but not to ultrasonic fences from other cities.
Other API
Aliens.GetTotalSeaDamageDealt()
Aliens.GetTotalLandDamageDealt()
Aliens.GetTotalLandUnitsLost()
Aliens.GetTotalSeaDamageReceived()
Aliens.GetTotalPlayerUnitsKilled()
Aliens.GetTotalSeaUnitsLost()
Aliens.GetTotalLandDamageReceived()
These are all global values and do not require arguments. They are pretty straightforward as to what they do, but "Aliens.GetTotalSeaDamageDealt()" doesn't seem to work as it always reports "0".