[Vote] (6-44) Balance (or Equalize % Chance Of) City-State Traits

Approval Vote (select all options you'd be okay with)


  • Total voters
    78
  • Poll closed .
Status
Not open for further replies.

Recursive

Already Looping
Moderator
Supporter
Joined
Dec 19, 2017
Messages
6,257
Location
Antarctica
VP Congress: Session 6, Proposal 44
Discussion Thread: (6-44) Balance City-State Traits
Proposer: @Recursive
Sponsor(s): @Recursive

Proposal Details
Currently, the type of each City-State is determined randomly using an uneven distribution. There are 8 Militaristic and 8 Religious City-States, and 14 of the other three types. If custom City-States are added via mods, they can further imbalance the pool of City-States.

Until recently, it was not known how to override the random selection of civs and City-States within the DLL. Thanks to IanE9, a solution was discovered that makes this possible.

Now that it is possible, I propose that we balance the types of City-States evenly in VP games, following a 1 / 1 / 1 / 1 / 1 ratio. For example, 15 City-States would result in 3 of each kind. 16 City-States would result in 3 of each kind, except for one random kind which would have 4. This would make games where you never encounter a given type of City-State not a thing anymore, except on the tiniest of maps, and provide for more consistent strategic options.

The placement of the chosen City-States on the map remains the same. You could spawn next to 4 religious City-States if you're very lucky, or you could spawn next to 3 Maritime City-States and 1 Mercantile City-State, or 1 of each kind.

Note that if there isn't enough room on the map for all City-States to spawn, the ratio could be uneven.

Also, with the addition of the MajorBlocksMinor table (with which this option is compatible), it is now possible to add civs' cities as City-States when they are not present. Attila's Court could be a City-State if the Huns are not ingame. Someone such as @Hinin or @adan_eslavo might be interested in making a proposal for that, and increasing the pool/variety of City-States. With this proposal passing, it doesn't matter how many additional City-States are added, or whether a few of them are blocked, the ratio will still be maintained.

I have already coded, tested, and implemented this feature for the next version (as of writing this), so it's a matter of changing BALANCE_CITY_STATE_TRAITS from a 0 to a 1.



VP Congress: Session 6, Proposal 44a
Discussion Thread: (6-44a) Equalize City-State Traits
Proposer: @Rekk
Sponsor(s): @Recursive

Proposal Details
Currently, the game chooses a completely random assortment of city-states from the pool. Because the number of city-states with each trait is uneven, games are biases into having more of one type then others (militaristic and religious are almost half as likely to appear as the others).

Proposal:
All city-state types are equally likely to appear, but are not forced into a 1-1-1-1-1 spread.

Rationale:
There is no need to be so zealous in removing input randomness from VP. The main problem with the current system is that militaristic and religious city states are very infrequent all the time. I think that it's okay for a type to be infrequent some of the time.
 
Last edited:
Dark clouds I can see...

What does it mean:
Code:
All city-state types are equally likely to appear, but are not forced into a 1-1-1-1-1 spread.
Does it mean current algorithm has different chances for some CSs to appear? If so, I cannot see that. I got games without Maritime or Cultured city-states with plenty of Religious and Militaristic ones.
 
Dark clouds I can see...

What does it mean:
Code:
All city-state types are equally likely to appear, but are not forced into a 1-1-1-1-1 spread.
Does it mean current algorithm has different chances for some CSs to appear? If so, I cannot see that. I got games without Maritime or Cultured city-states with plenty of Religious and Militaristic ones.
Currently there are 8 Militaristic and 8 Religious CS, compared to 14 of the other types. When selecting a City-State, the game randomly picks one out of the pool, so two types are less likely than others to be selected.

Rekk's proposal aims to make each type of City-State have a 20% chance of being selected regardless of how many City-States are in that category.

My proposal is for City-States to be picked from each category in a 1-1-1-1-1 ratio, guaranteeing their appearance if the mapscript is cooperative.
 
Currently there are 8 Militaristic and 8 Religious CS, compared to 14 of the other types. When selecting a City-State, the game randomly picks one out of the pool, so two types are less likely than others to be selected.

Rekk's proposal aims to make each type of City-State have a 20% chance of being selected regardless of how many City-States are in that category.

My proposal is for City-States to be picked from each category in a 1-1-1-1-1 ratio, guaranteeing their appearance if the mapscript is cooperative.
So it still allows for deviations and even lack of particular trait in edge case situations.

We will see... If it will be bad, I have an idea how to correct it, but I must think more carefully of the numbers.
 
It'll be uncommon to lack one type in standard settings. ~14% of the time.
 
It'll be uncommon to lack one type in standard settings. ~14% of the time.
Do you mean currently?

With my counterproposal, one type missing only happens in (4/5)^16 = 2.8% of games with 16 City-States.
 
I guess they mean that with 2.8% of one specific type missing, you get up to 14% to any type (2.8% * 5 types).
 
Looks likely that Rekk's proposal will pass.

The good news is for anyone who does prefer my proposal, it'll be easy to code them in a compatible way (Rekk's behavior will be the default, and changing the CustomModOption will force the 1-1-1-1-1 ratio).
 
I guess they mean that with 2.8% of one specific type missing, you get up to 14% to any type (2.8% * 5 types).
It's slightly less than x5 (because the ~2.8% already contains lacking 2+ types), but yes.
 
Interestingly, the current chance for at least one type not to be picked is:
1699293138042.png


under my proposal, it would be:
1699293151649.png

It's actually less than this, because there are only a finite number of city states, so after, for example all 14 Cultural states are picked, then the selection pool changes from 1/5 to 1/4. This criteria is quite a bit harder to calculate, and would happen extremely infrequently, given we would have to pick Cultural 14 times in our first 14 or 15 picks. It's slightly more likely for the sets of 8, but not really.

What is surprising to me is that I don't recall seeing a complete lack of any given city state in any of my games, but I could have just been rolling under 86.4% each time.


If this is still a problem, a minimum 1 of each type is not too difficult to add. We would take the type that have none, and replace one of the type that has the most with it (and repeat for each missing type).
 
Last edited:
One of the solution I thought, and early stage, would be a slight modification of your proposal.
You suggested steady 20% chance for each trait to be chosen.
  • What I thought would be exactly the same at the beginning, but... when you choose let's say Maritime trait, its chance in next iteration will be lowered by 2%, while all other traits gain 0.5% buff, so the chances would be: 18%/20.5%/20.5%/20.5%/20.5%.
  • Now assume that Mercantile is picked up in next round. Chance become: 18.5%/18.5%/21%/21%/21%. And so on.
  • If next round we would have let's say 3 strait picks for Religious, chances would be: 20%/20%/22.5%/22.5%/15%.
This way we would lower the chances of 0 picks for some traits to a minimum.
As I said, -2% penalty is my first assumption.
 
One of the solution I thought, and early stage, would be a slight modification of your proposal.
You suggested steady 20% chance for each trait to be chosen.
  • What I thought would be exactly the same at the beginning, but... when you choose let's say Maritime trait, its chance in next iteration will be lowered by 2%, while all other traits gain 0.5% buff, so the chances would be: 18%/20.5%/20.5%/20.5%/20.5%.
  • Now assume that Mercantile is picked up in next round. Chance become: 18.5%/18.5%/21%/21%/21%. And so on.
  • If next round we would have let's say 3 strait picks for Religious, chances would be: 20%/20%/22.5%/22.5%/15%.
This way we would lower the chances of 0 picks for some traits to a minimum.
As I said, -2% penalty is my first assumption.
How much would that actually change, mathematically? Especially compared to a floor of 1?
 
I didn't count that, but logically it would increase the chances of spawning traits that have not been spawned yet. It would not be even distribution like in 1-1-1-1-1 version, but something closer. Using bigger factor, so f.e. 4% instead of 2% will bring it even closer to that.
 
I didn't count that, but logically it would increase the chances of spawning traits that have not been spawned yet. It would not be even distribution like in 1-1-1-1-1 version, but something closer. Using bigger factor, so f.e. 4% instead of 2% will bring it even closer to that.
at 4%, a city state can only be picked 5 times, so even more complications need to be set for non-standard CS numbers (eg larger map sizes).
 
at 4%, a city state can only be picked 5 times, so even more complications need to be set for non-standard CS numbers (eg larger map sizes).
Yes, but remember the chances for it again increase if another type is picked up. So after 4 other pickups it would again have 4%.

It's only an idea, but it could be recalculated how it would impact the chances.
 
If the spawn rates are equalized by type, but the pool of religious CS is much smaller than, say cultural CS, doesn’t that mean we are going to be seeing the same 8 or so city-states every single game? That just seems like a new problem, and not any better than what you set out to fix.

You could just add more religious and militaristic CS into VP and keep the spawns random by ID. I think that accomplishes the same thing in a better way, because you would still have some variability in what % of types spawn each game
 
Last edited:
This new system adapt to potential new CS mods which add more CS to the game, independently from which type they add (in the event they are not balanced).
 
If the spawn rates are equalized by type, but the pool of religious CS is much smaller than, say cultural CS, doesn’t that mean we are going to be seeing the same 8 or so city-states every single game? That just seems like a new problem, and not any better than what you set out to fix.

You could just add more religious and militaristic CS into VP and keep the spawns random by ID. I think that accomplishes the same thing in a better way, because you would still have some variability in what % of types spawn each game
Assuming no city states get added, and Recursive's proposal passes, then you will choose 4 out of 8 religious city states every game. That's 70 different combinations.

With my proposal, it's not guaranteed that you will get 4 religious city states every game, so there's more variance.

If we just add 6 new religious city states and 6 new militaristic city states but don't force anything, then the likelihood of a game without all CS types is:
1699370556234.png

in this case, the increase of an additional 12 city states to the pool does a huge amount for equalizing. It's actually super interesting and I'm surprised that it's so much lower. I would have expected this version to be more similar to my 20% chance version. It makes me think I did the calculation incorrectly for my proposal.
 
Last edited:
I don’t look at the combination of the city states, I only consider them by themselves. “Oh, it’s the Vatican again”

16 CS on standard of 5 types, that’s 3.2 city states per type every game. With 8 different religious and military CS, each of those 2 types of CS will have a 40% chance of appearing in every game vs the current 28% chance of seeing them (16/58)

With @hinin’s proposal to add more city-states specifically in a mix that makes all types have equal numbers in their respective pools, I really don’t know what this proposal accomplishes. I guess what it does is establish some guardrails and constrain variability in each game.

I don’t know why I should want that. Both proposals, to varying degrees, are going to make 1 game look more like another w.r.t. The city-states involved. I would much rather equalize the pools and let the variance from game to game remain high.
 
16 CS on standard of 5 types, that’s 3.2 city states per type every game. With 8 different religious and military CS, each of those 2 types of CS will have a 40% chance of appearing in every game vs the current 28% chance of seeing them (16/58)
Maybe I don't understand what you're trying to say here, but yes, the entire point is that we want to see at least one religious CS and at least one military CS per game, so increasing the likelihood of seeing each of those two types is desirable.
 
Status
Not open for further replies.
Back
Top Bottom