Infixo / Civ6-Real-Strategy

Civ6 Real Strategy mod
8 stars 2 forks source link

Investigating PSEUDOYIELD_CITY #31

Closed Infixo closed 1 year ago

Infixo commented 1 year ago

Plot co far... PSEUDOYIELDCITY - City Valuation. Used in evaluation the operations. I determined that: Bias value is always a percentage and it is bottom-capped at -95%. BASE and ORIGINAL_CAPITAL - just plainly add the value modified by bias_percentage POPULATION formula: Value += floor(CityPop/5) (base (1+bias_percentage)) - notice that it changes every 5 pop DEFENSES - it subtracts the value depending on city's Defense Strength, Value -= base (city_defense+11)/37 * (1+bias_percentage) also, this applies only when city_def >25 if city has walls, and >20 if city has no walls; if def is less than that, a standard factor is applied which is not affected by pseudo value at all DEFENDING_UNITS - it subtracts the value depending on how many units are defending the city; I couldn't determined an exact formula for that, just hints: it seems to account for units within Range 3, garrisoned unit is treated differently the stronger the units, the more is subtracted basically 2-3 units around decrease the valuation quite signifcantly, 4-5 almost make it 0 I noticed that in later eras, due to huge increase in City's Defense, many cities have value simply 0. This could be one of reasons why wars disappear in time.

Infixo commented 1 year ago

So... not all can be 0 :) game crashes :) that was a quick one... let's see which one is used in division. Ok, the one that cannot be 0 is PSEUDOYIELD_CITY_DEFENSES. Checked twice. All others can be set to 0. Ok, co lets's see what it does first to minimize its impact.

Conclusions.

Phyrax1 commented 1 year ago

How does DEFENDING_UNITS work with vision? It might not play such a big role because the AI usually doesn't have good vision of enemy cities

Infixo commented 1 year ago

I have performed a lot tests, pretty exhausting. The findings are here.

Based on the above I will introduce the following changes.

  1. Make smaller cities more valuable, so AI will also try to conquer border cities. Border cities are usually the last ones founded, so they are smaller. The game scores them virtually as 0, because defenses are usually pretty high later and they are not advanced enough to compete with the cities founded earlier.
  2. Make only Military victory to focus on the capital. Others should even avoid conquering capital as this is usually a suicide for the AI. Also, this should help City-States as they are only capitals.
  3. Make city defenses less valuable in exchange for units. I.e. motivate AI and humans to use units to defend cities not passive defenses. When city is left undefended (one or none units) if should become a target.

Ad. 1. A counterintuitive change, but I want to try a negative value for population. Big cities are valuable enough, no need to add them even more value from population. But this should help smaller cities and City-States in early game. To balance that increase a bit CITY_BASE. Ad. 2. ORIGINAL_CAPITAL should be negative, and for Military Victory the effect removed by -100 favored item. Ad. 3. This needs some trial and error approach. Probably CITY_DEFENSES should be a bit higher, and DEFENDING_UNITS lower.

Infixo commented 1 year ago

Test results. Params are: BASE=750, DEFENSES=40, UNITS=100, CAPITAL=-200, POPULATION=0. Changing the values through time (i.e. using time strategies) is not very fruitful. Lots of work and new params to handle but very little extra gain. The POPULATION param is quirky. I've decided to NOT use it at all. The results are not sensitive, it needs really a big numbers plus it produces jumps every 5 pop. Test results are very good. These numbers a) produce much more positive valuations, b) the focus is moved to units from passive defenses