Unciv icon indicating copy to clipboard operation
Unciv copied to clipboard

"Avoid [terrain]" in some mods makes civ unusable.

Open Caballero-Arepa opened this issue 3 years ago • 3 comments

I have found out that in some mods, and most of the time, when a nation has "Avoid [tileFilter]" in "startBias", the game won't allow the creation of a game, saying "It looks like we can't make a map with the parameters requested", and even by changing map size, players and all, it won't allow 90% of the time to create a game. This happens in Latin American civs mod, Geografic Civs and probably others, altough not in all, as for example in Civ 5 Nations it works fine. I have made quick nations with the avoid start bias and it happens once again. And I remove the avoid, and it works normally.

Caballero-Arepa avatar Jun 03 '22 00:06 Caballero-Arepa

Okay, sounds like it's working fine to me, if you have e.g. a whole bunch of civs that don't want to go near coast and you have a lot of coasts you won't be able to fit them in, makes perfect sense

yairm210 avatar Jun 03 '22 08:06 yairm210

No no, default setting and all, it won't work. And, idk, but there are 3 people who have this same problem. https://youtu.be/nMmfHMYk9-0

Perhaps is a local build problem? Or am I starting to think that it's a problem of my mod (because it wasn't happening before)?

Caballero-Arepa avatar Jun 04 '22 00:06 Caballero-Arepa

I remember having some stale branch lying around dealing with startBias.. It is limited at the moment. Plus, I think it works a tad differently whether you play an edited map or a freshly generated one. Tldr: It depends on what you're trying to avoid. Land base and feature should work, Coast methinks not - the positive startBias:[Coast] is hardcoded, as it will not put you on coast.

Taken from said branch (untrue, as the goal of that branch is to allow start bias natural wonder, and I may have some fixes in there too) - as you can see the entry for how "avoid" works in the MapRegions code is missing, that branch is after all unfinished:

Attribute Type Optional? Notes
startBias List Default empty Zero or more of: terrainFilter or "Avoid [terrainFilter]". [^startBias]

[^startBias]: See [^nor] for normal starts with generated maps or [^edt] for starts on custom maps. [^nor]: Starts with a generated map use a "regional" algorithm to distribute starting locations. In that case, the terrainFilter can contain: A Natural Wonder plus zero or more terrains (a); or "Coastal" (b); or one or more terrains (c); or one or more "Avoid [terrain]" entries (d). Extra entries are ignored. Regions are formed from terrains that have a "A Region is formed" unique, by terrain counts, and the best determines Region type. One starting location per Region is chosen by best surrounding tile evaluation, which depends on the Region's type. Now, (a) looks for any Region containing the Wonder (b) looks for any Region type where the starting location has an adjacent Coast or (if unsuccessful) at least fresh water; (c) looks for Regions of any of the given types
[^edt]: In case an edited map is played and a Civilization needs a starting location not predefined on the map, then two or more will be logically "and"-ed, and if the filters result in no choices, the entire attribute is ignored (e.g. "startBias": ["Snow","Tundra"] will never work).

SomeTroglodyte avatar Jun 05 '22 10:06 SomeTroglodyte

Fixed with #9171

Mind you - it's still bound by the limits of the system Simon built, but when the wishes contradict (and mixing avoid and non-avoid prior to that PR was a contradiction reliably failing) your Civ will still get a random place. Also do note all civs with an "avoid" are treated later than those with only positive biases, so they may only get the leftovers.

SomeTroglodyte avatar Apr 17 '23 06:04 SomeTroglodyte