Advanced Civ

Re: Naval Invasions
I don't think I've changed anything about that. There's a BtS loading screen hint suggesting that the AI will target lightly defended coastal cities:
"Rival civilizations led by computer opponents now pose a more significant threat from the sea. Stronger fleets, amphibious invasions... Don't be caught unprepared! The more warlike leaders can be very sneaky with their attack plans, as they have learned to think beyond the sword."

I agree that this doesn't really happen. I did make some changes to get the AI to attack by ship sometimes even when there is a land connection. But that'll also only come up once in a blue moon.

I'm not sure if it would be fun to shift units back and forth along the coast to keep every angle covered. So the AI just trying to win through superior numbers seems fair enough, or almost. :) A bit of sneakiness would probably be a good thing, if only to make the AI appear more lifelike.

I think BetterAI addressed it at some point, but not sure.

I just had a game where the AI was shuttling 4 galleons full of Knights past about 8 of my coastal cities (all of which had a single archer) to drop them adjacent to my capital. Where they were shredded by LandsKnechts every time. He'd head back and get another load and drop them off at the same place, sailing right past those nearly-naked cities every time.
 
I think BetterAI addressed it at some point, but not sure.
Naval warfare is a focus of BBAI, but I doubt that karadoc or I have somehow broken the BBAI code for selecting destinations for naval landings; so I guess BBAI doesn’t address this particular issue or at least not thoroughly.
I just had a game where the AI was shuttling 4 galleons full of Knights past about 8 of my coastal cities (all of which had a single archer) to drop them adjacent to my capital. Where they were shredded by LandsKnechts every time. He'd head back and get another load and drop them off at the same place, sailing right past those nearly-naked cities every time.
There are similar problems with movement on land. City attack stacks will circle an empty city to avoid a river-crossing penalty. Still, with the ships, I'm not sure that the AI would gain that much by making opportunistic attacks on lightly defended cities; it doesn't sound like the AI could've held onto those cities in your game. I mean, better than getting "shredded by Landknechts" certainly, and the evident lack of flexibility makes the AI look bad.
I like the new revolt mechanic, but like @Elkad said, there needs to be some tool tip telling you the minimum number of garrison units of whatever era you're in to suppress revolts.
Done. Culture garrison strength is now equal to the current combat strength (i.e. damaged units have less strength) with the following modifiers:
* City defense (Archery units, Garrison promotions)
* Generic strength modifiers (Combat promotions)
* -50% for non-lethal units (Siege except Machine Gun).
So I've left out the Walls/Castle and fortify modifiers previously discussed.
I've added a small breakdown for the revolt probability, but it seems more distracting than helpful. So I'll only show how much more garrison strength is needed for 0% revolt chance, or, if it's already 0, how much strength could be safely removed. Screenshot attached.
 

Attachments

  • revolt-chance-breakdown.jpg
    revolt-chance-breakdown.jpg
    163.8 KB · Views: 87
Unless there is a real catch like Gems under Jungle. (I’ve changed the normalization step so that tiles with powerful resources can’t benefit from feature removal and terrain upgrade.) The found value function should be able to tell whether a starting site is too powerful. I haven’t looked at logs for the evaluation of (potential) starting sites yet; perhaps the commerce multiplier needs to be increased, but hopefully it’s not too far off the mark.

Currently, CvPlayer::findStartingPlot greedily picks the sites with highest found values. Or rather, it’s a mix of that and maximizing the distance to previously picked sites. To rule out double-Gold starts, the algorithm should probably not go for the highest found values; at least skip outliers. That said, it’s also problematic when a civ gets to place its second city at a site deemed too powerful to be a starting site …I was thinking of evaluating all possible assignments of n players to m>n potential starting sites. I guess that’s the binomial coefficient since we don’t care which player gets which location. So that’s not going to be feasible for 18 players. To maximize, as I wrote, the mutual distances, a greedy algorithm should actually work pretty well. The PerfectWorld script starts by computing distances between all potential sites (m square complexity – no problem) and picking the site with the highest average distance. The other sites are then selected to maximize the distance to all previously selected sites.
That's interesting to know. Maybe it's better to skip as many of the highest found value sites until all starting locations are within a certain deviation of each other? Although maybe some divergence in starting locations is desirable, and leaving those spots open could also advantage some players if they end up very closely.
 
Or keep picking the very best sites – where the emergence of a civilization is also the most plausible – and allow the normalization step to worsen sites by spreading bad features, bad terrain or removing a resource.

I’ll probably do an AI Auto Play experiment first: See if I can get an early runaway civ on a Fractal map, then reload the initial save and repeat the game a couple of times with different seeds to verify that the starting position really is decisive. If so, then I can try to gauge if it’s primarily the capital’s workable tiles that make the site powerful (and check if the AI found value is as high as it should be, i.e. significantly higher than that of the other starting sites) or if it’s a matter of space for expansion or both. I'm pretty sure that overpowered capitals can still occur in the mod, but they might actually be pretty rare. Lately, I wanted to see a single riverside Gold on decent terrain and had to regenerate the 8-player map half a dozen times until one player got it.
 
I’ll probably do an AI Auto Play experiment first: See if I can get an early runaway civ on a Fractal map, then reload the initial save and repeat the game a couple of times with different seeds to verify that the starting position really is decisive.

I'm always in favor of simulations, but with all the random factors involved, I doubt an effect of starting location can be observed using just say 10 repetitions. Maybe try to create a very strong starting location first to see whether this really leads to replicable runaways.
 
Another huge game.

I'm organized HRE and the uncapped city costs are still brutal. I'm at 30gpt number-of-cities maint on a sz1 city, (and another 5-15 for distance with 3 palaces well-spaced), and I'm just past 30% of land with 65 cities. A size15 city adds another 15gpt.
Sure, the rathaus fixes it still (reduces it to 10-15 anyway), but it's not playable on a normal civ. And I have vassals turned off, so no colony maint.

I'm still going to end up with cities that cost 100gpt until the courthouse is up. Which means Conquest (other than chasing your tail around burning everything as the AI resettles it all) isn't really possible, and Domination is darn hard. On a regular civ (without a 75% courthouse) and with colony maint on? It'd be over 100gpt WITH a courthouse.

You've effectively removed two victory conditions on a big map. Put the number-of-cities cost cap back please. Raise it from 8 to 16 if you want, but put it back.
 
Now that global warming removes forests, should the forest preserve provide protection from this mechanic (i.e. a forest improved with a forest preserve will not disappear)? This would also boost environmentalism as a late game civic, which it could probably use.
 
Now that global warming removes forests, should the forest preserve provide protection from this mechanic (i.e. a forest improved with a forest preserve will not disappear)? This would also boost environmentalism as a late game civic, which it could probably use.
Great idea. Also keeps your national park city from turning into a wasteland not long after you build it.
 
[...] You've effectively removed two victory conditions on a big map. Put the number-of-cities cost cap back please. Raise it from 8 to 16 if you want, but put it back.
As a short-term measure, setting a high-ish cap sounds good. I've looked at an Auto Play game state where, on turn 300, Emperor difficulty, Mansa Musa has 25 cities, three vassals with a total of 15 cities, 26% of the land area (51% required for victory) – vassal territory counts half for Domination and vassal cities count half for number-of-cities maintenance. Most of Musa's cities have 10-15 population and they pay about 15 gpt for number-of-city maintenance and 0 for distance maintenance because of State Property. If I switch out of that, distance maintenance is at worst 20 gpt – it's a pretty well-shaped empire with Forbidden Palace. The research slider for a balanced budget, even without State Property, is 70-80%, which is high, but perhaps fair enough for a Financial leader. (It means that Mint doesn't generate much gold, but, well, that's just the ill-conceived commerce system.)

So it seems that costs only start to skyrocket around 40 or 50 cities (Musa effectively has 32). I've tentatively set the cap to 36 on Huge maps, a bit lower on smaller maps, and made the cap configurable through GlobalDefines.

Just to be clear: It was karadoc's idea to remove the BtS city cap (changelog: "to weaken the power of huge civs"). I think the main point of number-of-cities maintenance, originally, was to slow down early-game expansion and, insofar, the limit of 4-8 (depending on difficulty level) made sense. Still, removing the cap was probably an improvement over the status quo ante all in all as it was too easy in BtS to max out the research slider. Anyway, I'd prefer to increase expenses in the midgame and late game through higher upkeep for civics in the Medium and (especially) the High category. And perhaps compute civics upkeep not just from the city count and total population but somehow measure how spread out the population is across cities, so that small cities that primarily claim resources aren't punished. On that note, distance maintenance should also be more sensitive to city population than it currently is. Trade route commerce ties in with all this and could also use work ...
Now that global warming removes forests, should the forest preserve provide protection from this mechanic (i.e. a forest improved with a forest preserve will not disappear)? This would also boost environmentalism as a late game civic, which it could probably use.
I've gone ahead and implemented that through an XML tag namend "GWFeatureProtection". It also protects the terrain from changing to Desert – but only because that would remove the (Forest or Jungle) feature. Other terrain changes, i.e. Snow -> Tundra- > Grassland -> Plains, remain possible.

In K-Mod it was Forest -> Jungle -> removal. I thought that turning Forest into Jungle was rather bizarre. I hadn't thought of Forest Preserves. I agree that they should at least not get hit extra hard by GW. Apart from that – I guess its plausible enough that preservation measures could rein in fires or invasive pests (not sure what the removal of a Forest through GW represents). I don't love giving Forest Preserve an additional ability, but, well, couldn't really leave it as it was.
I'm always in favor of simulations, but with all the random factors involved, I doubt an effect of starting location can be observed using just say 10 repetitions.
I suppose that the impact of starting locations can't be extremely high because I've never once seen Tokugawa win an all-AI game. Good uncontested territory – especially if it's at the expense of a peaceful neighbor that gets boxed in and turns into a sitting duck –, sure seems like a strong predictor. But that's mostly based on incidental observations, not any systematic experiments. I did one little experiment recently where I restarted a map where Huayna Capac had gotten ahead by the midgame with rather a lot of land to himself - and replaced him with Qin Shi Huang. Qin did OK, but didn't win.
Maybe try to create a very strong starting location first to see whether this really leads to replicable runaways.
Sounds interesting. Perhaps just give some leader that already has a pretty good start (but no Gold) a Gold source or two in addition ...

Edit: I think I've made all the tweaks that I really wanted to make for the v0.97 release. Now I just need to write some AI code for city trades (or decide that I need to table that; but I don't think it should be too difficult) and do my usual rudimentary testing.
 
Last edited:
In K-Mod it was Forest -> Jungle -> removal. I thought that turning Forest into Jungle was rather bizarre. I hadn't thought of Forest Preserves. I agree that they should at least not get hit extra hard by GW. Apart from that – I guess its plausible enough that preservation measures could rein in fires or invasive pests (not sure what the removal of a Forest through GW represents). I don't love giving Forest Preserve an additional ability, but, well, couldn't really leave it as it was.

Hey, good to see you posting! If you think the permanent protection is too strong an effect, maybe just make them more resistant to removal? In my mod and style of play, the game usually lasts until the modern or future era, with lots of hammers being produced. I will usually see 4 to 5 GW events per turn in the end game. This absolutely decimates remaining forests and there is no way to do anything about it.
 
So it seems that costs only start to skyrocket around 40 or 50 cities (Musa effectively has 32). I've tentatively set the cap to 36 on Huge maps, a bit lower on smaller maps, and made the cap configurable through GlobalDefines.

I for one am a fan of the uncapped city costs. It balanced the snowballing effect civs get if they grow too large pretty well, but could still maintain an advantage over smaller civs.

Good uncontested territory – especially if it's at the expense of a peaceful neighbor that gets boxed in and turns into a sitting duck –, sure seems like a strong predictor.

The Earth map I played with before was extremely sensitive to starts. The worst offender was Russia, giving them 1 more riverside plains wheat resulted in them dominating the game most of the time, when they used to be pretty obscure. It's a pretty different situation with all the civs in close proximity though.

Can't wait for 0.97!
 
I for one am a fan of the uncapped city costs. It balanced the snowballing effect civs get if they grow too large pretty well, but could still maintain an advantage over smaller civs.
I also consider uncapped city costs an unalloyed good. If it's disproportionately punishing on large maps, maybe it's a good idea to scale the city costs according to map size, or keep the costs for the first n cities the same and then reduce the cost of all cities after n based on map size, instead of cutting them off completely.
 
.Sounds interesting. Perhaps just give some leader that already has a pretty good start (but no Gold) a Gold source or two in addition

Just tried this on standard size, normal speed, noble. Used the same map 10 times with random leaders assigned to fixed starting locations (so that each run a different leader got the relevant location). Half of the runs I added two additional gold to the same (good, but not extremely good) starting location. Given that an effect of starting location should show up most clearly in early game, I recorded the score and rank after 100 turns for the leader starting on that particular location. The average score for the unaltered location was 360, the average rank 3. For the same location with +2 gold, the average score was 375 and the average rank 2.8.

So, basically, even adding two gold does not give that much of an advantage, at least not on the map and the location I used. Of course, 5 runs each might just be too few, there was quite a bit variability (+/-30 points)

Edit: As a side note, the more important factor seems to be sufficient room to expand; in each of the 10 games above the highest ranking civs started on one of two locations with much uncontested room. Could be that this is somewhat offset a bit later in game because of lack of trading partners.
 

Attachments

  • MCmap2.7z
    4.8 KB · Views: 51
  • mc.JPG
    mc.JPG
    332.4 KB · Views: 83
Last edited:
@xyx: That sounds very interesting. I'll take a closer look.
Hey, good to see you posting! If you think the permanent protection is too strong an effect, maybe just make them more resistant to removal? In my mod and style of play, the game usually lasts until the modern or future era, with lots of hammers being produced. I will usually see 4 to 5 GW events per turn in the end game. This absolutely decimates remaining forests and there is no way to do anything about it.
You people usually make good points, so coming up with a response beyond just acknowledging that can take a while. Though I realize that a quick response is better than none.

Too strong - not in the sense that it would make players much more likely to bee-line to Biology (the makeshift home of Forest Preserve). I guess the absolute protection could seem a bit strange when indeed every non-preserved Forest disappears. Actually, the tag I added works as a protection probability, like a saving throw. If the probability is 100, then the help text will just say "Gives vegetation a higher chance to spread and protects it from Global Warming". For non-trivial probabilities, the ability is shown on a separate line. So, to avoid complexity, which is really my main gripe with the new ability, I'd prefer to keep it at 100. Hm ...

Considering that there is already too much deforestation through chopping, perhaps GW should, for the time being, only hit Forest and Jungle on Plains. Then I could (arguably) disable the new ability again and treat buffing Forest Preserve as a separate issue. On that note, I wish the forest growth ability was easier to fix. Requiring tiles to be unimproved is just a nonstarter. And the Forest should appear after a constant number of turns, not randomly. A health ability for improvements (mirroring Forest Preserve's current happiness ability) is ready to go for v0.97. So I could replace the happiness bonus with a health bonus (which is my eventual plan) or make it +1 happiness, +0.5 health (i.e. 1 health on a Forest, 0.25 on Jungle) for now. Or leave it alone (for now).

I for one am a fan of the uncapped city costs. It balanced the snowballing effect civs get if they grow too large pretty well, but could still maintain an advantage over smaller civs.
I also consider uncapped city costs an unalloyed good. If it's disproportionately punishing on large maps, maybe it's a good idea to scale the city costs according to map size, or keep the costs for the first n cities the same and then reduce the cost of all cities after n based on map size, instead of cutting them off completely.
The map-size adjustment could probably be improved a bit; I'll lay out some formulas below. And the cap, if any, could also be soft cap. Not so simple conceptually, but then, maintenance costs aren't really transparent anyway. Or one could always take the city count to the power of, say, 0.9 and times a normalization factor to get from a growth rate of n^2 down to n^1.9.

For reference, the number-of-cities maintenance of a given city is computed as the product of:
* Owner's city count. Vassal cities also count (only half in K-Mod/AdvCiv).
* Population factor: (Population + 17) / 18, i.e. it starts at 1.0 and reaches 2.0 at size 19.
* Owner handicap factor: Between 40% (Settler) and 100% (Deity)
* World size factor: Originally between 45% (Duel) and 20% Huge. (40%/25% in AdvCiv because the mod assumes 16 players on Huge maps, not just 11.)

So, let's let k be the constant factor from handicap and world size, e.g. 0.9*0.25 on Emperor/ Huge, let n be the owner's city count and refer to the population size of city i as p_i. Then the owner's total expenses for number-of-cities maintenance are
k * n * ((p_1 + 17)/18 + (p_2 + 17)/18 + ... + (p_n + 17)/18)
Get rid of the divisors by redefining the constant to c:=k/18:
= c * n * ((p_1 + 17) + ... + (p_n + 17))
Let P be the total population:
= c * n * (17 * n + P)
Let m=P/n be the mean population per city:
= c * (17 + m) * n^2

What fundamentally bothers me about this is, first, that the population distribution doesn't matter; apart from Courthouses (which eventually will become worthwhile everywhere), it might as well be a national cost paid for the number of cities and total population (like civic upkeep). Secondly, n-square will at some point make additional cities strictly undesirable. One can argue that managing exploding costs should be part of the challenge of winning a military victory, but, if that means razing half of the conquered cities, then it's not a good challenge. And, intuitively, I don't like how n-square brings to mind communication costs, suggesting that every city interacts equally with every other city – as if there were no hierarchical organization.

As for the map-size adjustment, I'd say it should depend on how many cities a player (or specifically a human player) typically owns or is supposed to own. So it might be better to adjust not only to the map size, but also to the initial player count and sea level, i.e. the crowdedness of the map. But that won't solve the problem that typical city counts on Huge maps will differ greatly depending on the player's victory strategy. For Culture and Space, it might be typical to conquer one or two other civs (I don't think that depends much on the map size), which might mean owning less than 20% of the land area, whereas Domination always requires at least 51%. I'm pretty sure that Domination (or Conquest) isn't the easiest or safest way to win on Huge maps, but it can be the fastest, so it can't be treated as an aberration. Also, Diplo victory is arguably not all that difficult on Huge maps and will typically imply owning more than 20% of the world's cities. Currently, the maintenance multiplier on Huge maps is about 80% of the multiplier on Standard-size maps. In BtS, that ratio is 67%. (But BtS also has a default player count of only 11 and Huge maps are 8.6% larger than in AdvCiv.) Perhaps 80% is geared too much toward peaceful victories; maybe 75% would be a better baseline – to be adjusted to initial player count and sea level.
 
Considering that there is already too much deforestation through chopping, perhaps GW should, for the time being, only hit Forest and Jungle on Plains.
How about adding Burnt Forest/Jungle? So GW would remove Forest/Jungle in 2 steps but building a Forest Preserve would instantly restore them. Maybe there could be a chance too for Burnt F/J to heal if there are healthy F/J tiles next to it.
Just brainstorming.
 
@ Zeta: A new featue just to smoothen the interaction between GW and Forest Preserve (FP) would be a too high-visibility change for my taste. Making all vegetation with an FP immune to GW is mostly fine with me. Making all non-Plains vegetation immune sounds better, but I haven't really played much with GW, so I'm a little uncertain. GW on a Plains Forest should then remove the Forest (and, oh well, the FP), but not turn the terrain to Desert (only a subsequent GW event could do that).

If the burnt forest feature could replace the current forest growth ability, then it would be interesting to me, but I'd want the growth ability to also replenish Forests that had been chopped down. Or even to grow forests where (at least in 4000 BC) none had existed, allowing players to run some sort of utopian green economy.

My best idea is that FP shouldn't require Forest or Jungle to be present. If there's no terrain feature, FP will grow a Forest after a certain number of turns; akin to a Cottage except that the FP wouldn't have to be worked. The duration could depend on the number of adjacent Forests and Jungles. What's a bit tricky is that the happiness (or, in the future, perhaps health) ability shouldn't (fully) apply when there is no vegetation yet. Oh, and the AI code would be tricky.

I'd also like to move 1 FP commerce from Environmentalism to Railroad (tracks), but then Environmentalism will need to be revised as well and maybe National Park too.
 
I think it is not logical to try to preserve forest of GW, because in the real world, forest are nearly always be shop (or just destruct) before GW (and partially be a cause of it), so the normal gameplay of civ seem ok : all forests shopped, only a little part preserved. It forgot the fact that all civs have made not only a preservation trying but a real reforestation, which is impossible in vanilla's civ.
 
@LeBashar: Well, I've gone with the approach that lets Global Warming remove preserved and unpreserved Forests and Jungles from Plains, whereas Grassland gets turned into Plains without removing features. For Tundra, that's actually already how it works in K-Mod (gets turned into Grssland; no feature removal). But protection from Forest Preserves can be enabled through XML. Git commit

@keldath: Welcome back. Good question; surely not before the end of the month. Still haven't gotten started on AI code for city trades. Currently trying to figure out why my usual benchmark test has recently become a minute slower. Then I wanted to start a thread about a data type for fixed-point arithmetic (once I'm sure that this isn't what slows the mod down), perhaps to entice someone to add a logarithm function. :mischief: I also still have to compile a legible changelog from the Git commit history.
I don't know if it makes sense for you to cherrypick commits in the meantime. Based on your post from Dec 16, the commit "Fix animations lag caused by fly-out scoreboard" from Dec 25 would be the oldest one that might be relevant for you.
 
@xyx: Having looked at a few Auto Play games, your map indeed makes a pretty convincing case for Gold not being a major balance problem at least in all-AI games. Human players may benefit more, especially on difficulty levels with high expenses.
 
Top Bottom