Start from Play Now testing phase

Playing as Greece one city only, Athens flips to Ottomans, causing unexpected defeat. Is it intended?
 

Attachments

  • Alexander AD-1280 Turn 384.CivBeyondSwordSave
    1 MB · Views: 19
Probably not related to this branch, as England I get a war declared on me by Vikings and Spain and get like 7 Crossbowmen and 6 Swordsmen to defend 3 cities, which is probably too much. A save is, unfortunately, a turn after war declaration.
 

Attachments

  • Elizabeth AD-1005 Turn 329.CivBeyondSwordSave
    525.5 KB · Views: 17
The same game, it seems that great people discoveries do not count towards English UHV. Great person in London gives geography, but the counter stays at 1.
 

Attachments

  • Elizabeth AD-1432 Turn 416.CivBeyondSwordSave
    944.2 KB · Views: 17
Greece, trying to conquer Phoenecia. No defenders left in Sur, unable to attack city with an idle hoplite.
On previous turn had to conquer workers/boats sitting in city, no defenders, still would not capture city.
 

Attachments

  • Pericles BC-0890 Turn 129.CivBeyondSwordSave
    268.5 KB · Views: 16
Is Phoenicia birth protected?
 
Declaring war on Greece as Rome soon after gives me 5 legionaries and 3 ballistas. Epic, Regent. Is player supposed to get such help?
 

Attachments

  • Julius Caesar Iron Age Turn 147.CivBeyondSwordSave
    301.9 KB · Views: 13
This has already been changed on the develop branch, it just hasn't made its way here yet.
 
I also appreciate you playing on this branch, it just means a couple of recent fixes are missing. I don't like working with two divergent branches, but I also did not want to neglect develop for too long.
 
New update: details below.

Reduced number of available player slots from 49 to 32

I have run a lot of test games (mostly Canadian autoplay) and collected extensive data on how many civilizations are simultaneously alive, how many of them are past their fall date, and how many of them are respawned. I mentioned my results from preliminary investigations a few months ago, but now it's pretty certain. Even on the 3000 BC scenario, where the most civilizations can be active at the same time (because a lot of civs never spawn in the later scenarios), the maximum number of active civilizations is around 32. This includes minor civilizations like independents, natives, and Celts (but not barbarians).

The more common number is usually around 30. I adjusted the number of slots accordingly. Like I discussed in the past, having an excessive number of slots slows down the game by quite a bit because a lot of code needs to iterate the existing slots (or often, every combination of two slots). Instead, slots can be used and reused when they are needed. A slot is chosen by these rules, in order of preference:
  1. A slot that already has the civilization (e.g. the civ collapsed earlier and the slot has not been reused yet)
  2. A slot that has never been assigned to any civilization
  3. A slot used by a different civilization that is currently not alive
Since usually there are never more than 32 concurrent civs, this almost always works out. However, sometimes it can occur that a 33rd civ needs to be created, either due to its birth or because of a respawn. The game prepares for that by checking each turn if all 32 slots are used. If that is the case, a civilization that either is currently collapsing, or is unstable and past their fall date, will be chosen and forced to collapse. My analysis has shown that when 32+ players are active, there are always a lot of civs past their fall date still active.

Still, it's possible that this is not the case. In this situation, and a new civilization is due to spawn without an available slot, the spawn will not occur at all. This has never actually occurred in all of my test games, but the code is prepared for it.

Civilization precedence

The above mechanism essentially kills an existing civilization to make space for an upcoming civilization. This can lead to counterintuitive outcomes, where e.g. China is removed from the game to make way for Congo. Considering that China, even if currently past their fall date, is more important for the overall game than Congo, that would be a counterproductive outcome. It's better to give up on Congo existing, than on China existing.

To deal with this situation, I introduced a new civilization attribute that captures its historical impact. The idea is that the game should prioritise civilizations that had a high impact on world history, and make sure that they definitely appear, as opposed to other civs with a lower impact. The impact levels are, from highest to lowest:
  1. Critical
  2. Significant
  3. Limited
  4. Marginal
The rule is that a civilization of higher impact will never be removed from the game to make space for a civilization of lower impact, and civilizations of lower impact will always be prioritised as the ones being removed from the game to make space.

The granularity of these levels is mostly theoretical right now, and most current civs are considered critical. Here's the full list, in case you are interested:
Spoiler :
Critical: Egypt, Babylonia, China, Greece, India, Phoenicia, Persia, Rome, Maya, Korea, Japan, Vikings, Turkestan, Arabia, Spain, France, England, Holy Rome, Russia, Portugal, Inca, Mongolia, Aztecs, Mughals, Turkey, Iran, Netherlands, Germany, America
Significant: Tamils, Ethiopia, Byzantium, Indonesia, Moors, Khmer, Mali, Italy, Thailand, Brazil
Limited: Harappa, Tibet, Poland, Congo, Argentina, Mexico, Colombia, Canada
Marginal: Polynesia

It does not make much of a difference right now, but becomes more important if I were to add additional civilizations to the mod, without having to raise the number of available slots. We would not have to worry that adding less "important" civilizations crowds out more interesting ones, for example, while still having them appear in games where they fit in.

This is further enhanced by a fifth impact level, named "Player". No civilization inherently has this impact level. Instead it is always the impact level of the civilization controlled by the player, as well as other civilizations considered "important" for that particular civilization's gameplay. Those usually include neighbouring civilizations as well as conquerors etc. that should be expected to be relevant for the game experience of that civilization. For example, America includes its neighbours Canada and Mexico, but also the colonising civilizations of England, France, and Netherlands. Since "Player" is considered higher than every other impact level, this virtually guarantees that these civilizations will always be in the game when you pick a certain civ to play.

I have also taken the impact into consideration elsewhere: civs of critical impact can never be prevented from spawning by having solid stability (this should prevent games where America never spawns) and civs of higher impact are prioritised when it comes to respawns.

Performance Impact and Autoplay Durations

I have also been keeping track of how long autoplay has been taking for every civilization, both with 49 and 32 slots. The results have been a little bit disappointing because I expected a greater improvement between the two. But it still reduced the Canadian autoplay time by 10-15 minutes, which is a significant improvement in my opinion.

I have updated all autoplay times based on the rough averages I have observed for each scenario. Obviously, that still only reflects the performance on my laptop, so it's still just a rough estimate. But nevertheless an improvement over the previous estimates.

My overall performance measurement observations are:
  • Number of players alive is still the most important determining factor, no matter what the number of slots is. Games where a few civs never spawned for a number of reasons had significantly shorter autoplay.
  • Changes I previously made already improved on the previous autoplay estimates, judging from my 49 slot runs.
  • The benefits are actually most pronounced in the early game, where there are few players alive. While this is not the part that most needed improvement, it's still good for the mod. It only takes about 10 minutes of autoplay to get from 3000 BC to 600 AD.
I also tried what would happen if slots are reduced further, and run a number of games with only 20 slots. This reduced the Canadian autoplay time by an additional ~10 minutes, but these results need to be taken with caution: with so few slots, some civs never end up spawning because no slots are available for them, even when trying to collapse existing civs (sometimes everyone is just stable). So a big part of the improvement comes from the lower number of active players, rather than just the lower number of slots.

Effect on gameplay

If I made no mistakes, you should not notice that any of this happened, beyond hopefully better performance. Maybe there are some Python errors, in that case, please report.

But: this change is not savegame compatible! Be aware that if you pull, you will not be able to continue your ongoing game.

Future features

There are a number of ways the concept of impact can be used to improve other aspects of the mod. You might have noticed that there is a lot of overlap between low impact civilizations and conditional/optional civs. I think it might make sense to have a game option to disable only marginal, or marginal and limited impact civs. Then they would only appear if chosen by the player, or if relevant to the player civ.
 
I plan to move on to addressing bug reports now, first on this branch, then on the develop branch.

To be clear, this is the last huge milestone I wanted to reach for this branch. Beyond bugs, there are only minor changes left to do to round things out.
 
That Congo exist and thus sell a lot of slaves is very critical to Brazil UHVs. I am sure there are many more like this.
I am not sure that ever blocking a new born civ is a good idea. But if you mean to block one of those with a lower priority for a respawn, I guess its fine.
 
Congo will be considered a relevant civ for the Portuguese and Brazilian games for this purpose. But like I stressed before, a civ spawn being canceled for lack of slots is a rare edge case.
 
How do you know its going to be a Brazilian game? The player might decide to switch to Brazil after first playing another civ.
I mean you can't make specific rules based on what civ the player choose.
I understand that this is a very rare case indeed that civ's get blocked from spawning due to the 32 limit.
But my point is that civs that want to spawn for the first time should get priority regardless.
Re-spawns should not get priority over a non-collapsing civ.
 
If someone decides to switch to a different civilization later, the game cannot know. Think of it inversely: if you do not communicate your intentions to the game, it cannot prepare conditions to provide the optimal experience. That's nothing new, if you play different civs from the 3000 BC start you can create wildly different situations that the game isn't really prepared to deal with either. If you do something to deviate from the normal game preparation process (including playing through history instead of autoplay), it is to be expected that the course of the game will deviate from history more strongly.

I think of it as an act of player agency, but that also means the player has to accept the consequences for their game. You either meet the game where it is or you don't, your choice. For example, I have also always recommended to play civilizations from the latest scenario start before their spawn, for similar reasons.

Something I have not mentioned in the above post (I honestly forgot about it), is that a respawn cannot occur if it would take up the last free slot. I think that addresses your concern: in other words, a respawn can never block a proper, original spawn.

Still, there are more than 32 civilizations, so after the first 28-29 of them have spawned (the difference being independents, natives, Celts), it is still possible for a proper spawn to be halted if all of these initial 28 civs have never collapsed, have never been collapsing while all 32 slots are taken, and have never been unstable and past their fall date while all other slots are taken. I think that is a very remote situation, and one that I never actually observed in the game.

Speaking of, I think that civilizations past their fall date (i.e. ancient/classical ones) often survive way too long in the 3000 BC scenario. I have often seen 6-8 civs past their fall date for a long time in those games. Maybe the stability penalty for exceeding the fall date should scale with the number of civs past their date, even if only limited to autoplay.
 
I think it's reasonable to consider that if you're going for the UHV the fairest option is always gonna be the scenario that most closely matches your spawn date, while 3000 BC games will have a chaotic element that can completely change your playthrough.

Still, taking this example, would it make sense for Congo to have better odds of respawning once the player switches to Brazil?
 
How do you deal with civs that changed their importance across time? For example, I understand that ancient Greece is fundamental to the game, but in modern times, Indonesia and Canada are far more important. I imagine that the rules for respawns are different (you refer to it in the post), but I didn't understand completely. Or what happens for example if (for whatever reason) ancient civs don't become unstable? Could you explain?

And for their visibility, what about adding a rule that when a civ doesn't spawn because the game is full, their cities nevertheless appear but as part of the independents? Even for Polynesia and all the cigs you listed as limited, I think this would be adequate.

Edit: Actually, I think it might be actually better (especially if you consider that last suggestion) if the independent slot was considered as "player", if that's meant to represent "everyone else" that didn't fit in the other 31 slots.
 
I think it's reasonable to consider that if you're going for the UHV the fairest option is always gonna be the scenario that most closely matches your spawn date, while 3000 BC games will have a chaotic element that can completely change your playthrough.

Still, taking this example, would it make sense for Congo to have better odds of respawning once the player switches to Brazil?
As soon as the player switches to Brazil, the game will treat Brazil as the player civ, and Congo will be treated as of highest importance for the game. Since impact controls respawn priorities as well, this will also help them respawn.

How do you deal with civs that changed their importance across time? For example, I understand that ancient Greece is fundamental to the game, but in modern times, Indonesia and Canada are far more important. I imagine that the rules for respawns are different (you refer to it in the post), but I didn't understand completely. Or what happens for example if (for whatever reason) ancient civs don't become unstable? Could you explain?
That's a fair point I didn't fully consider. The impact levels were mostly chosen with considerations for their actual birth in mind, where their whole impact during all of history comes into play. But it also influences collapse priorities (rarely: when vacating the last available slot) and respawn priorities. This might happen at a time where the historical importance was not as high as their original historical importance. Greece is a good example of this.

My first thought would be to assign a lower impact to civs that are already past their fall date, but that's not as easy either: China retains its impact for all of its history, others lose it somewhat, even others lose it entirely. I already recognised that the concept of a "fall date" may be too crude anyway, considering that it forces e.g. China to be considered "past its fall date" for all of its history. Maybe the correct solution to this problem is to have "fall/decline windows" that can begin and end, just like there are for respawns.

And for their visibility, what about adding a rule that when a civ doesn't spawn because the game is full, their cities nevertheless appear but as part of the independents? Even for Polynesia and all the cigs you listed as limited, I think this would be adequate.
Sure, it's better than nothing. It doesn't even need to be strictly conditional on a civ existing, because independents do not to appear if cities/culture already exist in the area. This is definitely going to be necessary in case less important civilizations are being added that are taking the place of some of the city spawns in this game.

Still, minor cities cannot replace a proper civilization, all things being equal. They cannot do some of the things you need them to do (such as create slaves, from the Congo example), and they are much easier to conquer and deal with.

Edit: Actually, I think it might be actually better (especially if you consider that last suggestion) if the independent slot was considered as "player", if that's meant to represent "everyone else" that didn't fit in the other 31 slots.
Oh, that is already the case. The two independent slots are essentially set in stone and exist outside of these rules. They are assigned when the game starts and will never be relinquished. Minors are also always considered alive.

This also applies to the Celts, who only use up a slot in the 3000 BC scenario. They currently also never relinquish it, which has the potential for a small optimisation.
 
Generally I kinda question the point of the Celtic civ vs. simply having them be Barbarians. If they're not playable I don't really see the point of having them as a seperate slot, at the moment it seems the point of the civ is to have Barbarians that functionally only attack Rome, but given that it hurts performance and the only other civ that could plausibly interact with the Celts is Greece, I think it might be better to just get rid of the Celts as a minor civ and just have it be Barbarians.
 
It's not a big deal, and it doesn't hurt performance. Anything that goes on before 1200 basically doesn't matter, because there are so few civilizations active and many parts of the map are unoccupied.
 
Top Bottom