Real Strategy (AI)

Real Strategy (AI) 2.3.1

Not really. (Magils) Natural wonders do enable a player with lots of special things, like having +2 gold for each unique luxury resource you own or ability to ignore movement penalties in forests. THe precondition is that you must own a tile of the natural wonder. If AI is aware of those features, it shall seek to own the tiles of a natural wonder. THe same logic for world wonders - if AI is aware of the specifics of the bonus world wonder gives, it shall aspire to build the wonder if possible.

In the standard game natural wonders are ignored when choosing a settle spot, except if they provide extra production or food to tiles around. Only FEATURE_DEAD_SEA is scored +2. That is the only natural wonder treated specially.
Movement bonus, etc. - forget about it, it doesn't influence AI decision, not a bit.
Hence my question - did Magil add any special code to change AI behavior in that regards.

So, in case of natural wonders, since I know what you are asking about now. In RST I redesigned the settle plot scoring params, e.g. added extra support for natural wonders, in general. Each natural wonder tile is scored +3 points. I also added points for science, faith and culture as those yields are pretty important early game. From my observations, the AIs with RST do settle natural wonders quite fast.

In case of WWs - like I said - you can only set the specific wonder as Favored, for e.g. a specific leader or civ, or strategy. The game engine scores Wonders internally using all preferences and settings from strategies, etc. You can't tweak a scoring for a specific Wonder (except Favored flag, which boosts the scoring by 50%).
 
In autoplay what diff. level does the human player play when on auto:
prince or the level that is set for the game?
 
Great! :)

Infixo, can you put in FT stat the number of wonders built by the players?
There is no direct function for that in Lua, you have to go through all buildings and check if player has it.
What would be the purpose for that? The number itself is not important in RST as each Wonder has its own individual flavors. Each affects scoring in a different way.
 
So, in case of natural wonders, since I know what you are asking about now. In RST I redesigned the settle plot scoring params, e.g. added extra support for natural wonders, in general. Each natural wonder tile is scored +3 points. I also added points for science, faith and culture as those yields are pretty important early game. From my observations, the AIs with RST do settle natural wonders quite fast.
How will this interact with Terra Mirabilis's change to NATURAL_WONDER_ADJACENT_FERTILITY in GlobalParameters, if at all? (i.e. value changed to 2 from 1) I'm assuming you used AiFavoredItems for this, so I imagine the AI's desire would be further amplified, correct?
 
In autoplay what diff. level does the human player play when on auto: prince or the level that is set for the game?
Well, that is something I am not 100%, but I think its the default one. I usually run test games on Emperor and Player0 is always performing much worse.
 
How will this interact with Terra Mirabilis's change to NATURAL_WONDER_ADJACENT_FERTILITY in GlobalParameters, if at all? (i.e. value changed to 2 from 1) I'm assuming you used AiFavoredItems for this, so I imagine the AI's desire would be further amplified, correct?
I don't know that parameter. What does it do?
 
It's my understanding that it's a fertility "weight that contributes toward importance of settling near NWs for the AI".
There is nothing like that in the PlotEvaluations system. Maybe it is some internal thing, calculated by the engine regardless. In any case, nothing related to that is in RST.
 
In any case, nothing related to that is in RST.
Isn't the fertility of a plot used by the AI to score the value of that plot for settling? If the plot fertility value is increased adjacent to a NW and you've added additional scoring to AiFavoredItems toward NWs my concern is that the AI will go far out of its way to settle near a NW when a closer settlement would be more beneficial (i.e. for loyalty and defense).
 
Isn't the fertility of a plot used by the AI to score the value of that plot for settling? If the plot fertility value is increased adjacent to a NW and you've added additional scoring to AiFavoredItems toward NWs my concern is that the AI will go far out of its way to settle near a NW when a closer settlement would be more beneficial (i.e. for loyalty and defense).
AI will rarely settle further than 3 tiles from another of their cities and usually only if there are no closer locations available. This is because distance from nearest city is heavily weighted (as well as positive loyalty that cities generate), much more so than tile yields from natural wonders. Only certain civs (based on civ specific PlotEvals) and AI strategies (Expansion) will attempt to settle further away.
 
Isn't the fertility of a plot used by the AI to score the value of that plot for settling? If the plot fertility value is increased adjacent to a NW and you've added additional scoring to AiFavoredItems toward NWs my concern is that the AI will go far out of its way to settle near a NW when a closer settlement would be more beneficial (i.e. for loyalty and defense).

PlotEvaluations
This system is used to score plots for settlement purposes. It is possible the see the scoring (there is a Lua function for that) for 3 plots that the game "recommends". This allows for testing.
Important. This system ignores Favored flag. I changed that flag for different params and the scoring was always the same. Also, fractions don't work. XML and SQL allows for fractions, but only integer is used for calculations.
Parameters.
- Foreign Continent - adds Value to the scoring if the plot is on the foreign continent.
- Coastal - adds Value to the scoring if the plot is on the coast.
- Fresh Water – adds Value when spot has fresh water (river or lake).
- Inner Ring Yield - adds Value * yield for a specified YieldType; Inner Ring is 6 tiles around the spot, the central plot is not counted.
- Total Yield - adds Value * yield for a specified YieldType counting Rings 1-3; please note that it overlaps with Inner Ring!
- Resource Class - adds Value for each Resource of the specified class within Rings 1-3. Important. AI doesn't cheat here - it counts only revealed resources.
- New Resources - adds Value for each copy of the new resource in Ring 1. Important. Improved resources are not counted and the tech to improve the resource is not required. I.e. it will count tea even if you don't have Irrigation.
- Specific Resource - adds Value for each copy of the specific resource within Rings 1-3. No cheating, only revealed are counted.
- Specific Feature - adds Value for each tile of the specified Feature within Rings 1-3.
- Nearest Friendly City - key parameter that controls how far away from our city a new one is settled. It adds Value * Distance to the score. Notice however that Value is negative (-10 by default), so it means that 1 tile is worth 10 points. Since there has to be at least 3 tiles, so by default the score gets a -30 hit. This explains (mostly) why most of the AI cities are 4 tiles away from each other.
- Cultural Pressure - parameter added in Rise & Fall. I think it was supposed to work in a way that Favored=0 adds your pressure (closer to your cities) and Favored=1 subtracts pressure from others (so, away from others). Well, imho Favored=1 doesn't work (Favored is ignored in the entire system). Thus only Favored=0 gives an effect and it adds Value * (20+Pressure). This partially explains why sometimes AI settles cities in the pressure zone - because even with pressure -10, it still adds Value * 10 to the score. If the 2nd parameter would work, AI would never settle a city in a pressure higher than -10 (-60 hit), even -5 would be very unlikely (unless a crazy good spot).
Additional info.
There is no support for Terrain. So, hills and mountains are ignored and hills influence settling only via production yield.
 
Is there any way to make this mod work together with Combat and Stacking Overhaul? In the current state, some features of CSO stop working after switching RST on.
I made a version of that mod by deleting stuff from it so that 2UPT remained... it works... shall I put it up here?
 
Is there any way to make this mod work together with Combat and Stacking Overhaul? In the current state, some features of CSO stop working after switching RST on.
It's because both mods define planes as Ranged units.
Code:
INSERT INTO UnitAiInfos
(   UnitType,                AiType) VALUES
(   'UNIT_AMERICAN_P51',    'UNITTYPE_RANGED'),
(   'UNIT_BIPLANE',        'UNITTYPE_RANGED'),
(   'UNIT_BOMBER',            'UNITTYPE_RANGED'),
(   'UNIT_FIGHTER',        'UNITTYPE_RANGED'),
(   'UNIT_JET_BOMBER',        'UNITTYPE_RANGED'),
(   'UNIT_JET_FIGHTER',    'UNITTYPE_RANGED');
That is what @V. Soma probably removed.

Edit. Change it into "INSERT OR REPLACE" here and in RST and it should work.
 
It could be a coincidence, but aside from many nuclear steam leaks, I am also getting many nuclear power plant leaks when I only have a factory. So far, I'm up to seven nuclear steam leaks and four nuclear power plant leaks in about twenty turns.
 
THE MOST AMAZING THING HAPPENED in my last playthrough. I had just placed down a new city and sent about half of my military force to protect it. Apparently that wasn't enough because the Khmer attacked me soon after, outnumbering me about 4 to 1. The Khmer took my new city and just as they were approaching my capital, I noticed Egypt (who I had been silently plotting against for quite some time) had started attacking their units. I quickly formed a military alliance with Egypt and they helped me defend my capital. Egypt absolutely destroyed the Khmer after and even liberated my conquered city. I have never seen the AI do this... I'm so happy and I feel so bad for trying to loyalty flip Cleopatra's cities.
 
Back
Top Bottom