Post a (tough) Deity map for me to play

My experience is the same as Fippy's. That doesn't guarantee that it 100% works like that of course. :)
 
Found it interesting and made a test :)
Edited enuf fogbusters in for a whole (big) continent, and gazillions of juicy resis and areas.

Start:
Spoiler :
start-jpg.553021
..and after 70 turns:
Spoiler :
end-jpg.553022
No barb cities in this test.
 

Attachments

IIRC the continent needs more (3?) non-barb cities in order for barb cities to spawn.

edit: hmm, maybe I'm just confusing it to when the barbs start to enter human/AI culture...
 
In a time where i played many Iso maps, i have never seen a barb city pop up after i had everything fogbusted & cleared off barbs (but ofc without vision on all tiles, which is usually impossible on larger islands).
Maybe it's possible, but i cannot remember even 1 case.

Yes, I posted that reference mainly out of curiosity for the game mechanics, in case anybody reading it has a definitive answer.
But for my actual play your experience from so many games will indeed be more valuable and certainly reason enough to drop the habit of fogbusting important settling sites in addition to spawnbusting them.
 
Thanks for test @Fippy . I am not sure, but isn’t it something about a certain average size of cities on the map they can appear?
Could you care to take last test with your cities at size 3?
 
@Lain - first post in 9 years on CivFanatics to say that I think that in your latest Justinian Deity game didn't Qin found Mining Inc? If so, that's probably why he wouldn't trade Silver

Thanks for all the Civ IV Deity game streams - you got me back into Civ IV and I started streaming it over on Twitch
 
On the next page DanF said
Although MIN_BARBARIAN_CITY_STARTING_DISTANCE = MIN_BARBARIAN_STARTING_DISTANCE = 2, the rules are different. Barb cities can definitely spawn in a units BFS as long as no non-barb player has active vision for that tile. (That's also why the AI sends there GUARD_CITY units out to the chosen city sites.) It has happened to me before.
When do barbarian units enter cultural borders

Edit: it is not clear what he meant by "AI sends there GUARD_CITY units out to the chosen city sites". Probably that within 2 tiles of any players units barb cities can't spawn unless guard is already in place?
 
Last edited:
@Lain - first post in 9 years on CivFanatics to say that I think that in your latest Justinian Deity game didn't Qin found Mining Inc? If so, that's probably why he wouldn't trade Silver

Thanks for all the Civ IV Deity game streams - you got me back into Civ IV and I started streaming it over on Twitch

I had the same reaction for Qin not wanting to trade silver :goodjob:
 
Did Lain stream last weekend or was it postponed? On youtube it says that we're still waiting for Lain Civ 4 Deity :sad:
 
Ok no worries, now I'll just have to work today instead of watching youtube. My boss will be delighted
 
Re. barb cities, maybe it could be checked by waiting till a barb city founds, then reloading to the turn before and looking what units are on the tile. In the code, the IBT sequence spawns barb cities immediately before it spawns barb units, so it couldn't create a unit, then have that unit create a city, on the same turn.

Here's a rough reading of the code. Couldn't see anything about existing barb units on the tile. The only thing that seems to look at units was the spawnbusting test. It is complicated though so definitely possible to miss something. Also there might be something in the Python which rejects cities unless there's a barb unit there.
Spoiler :

Each turn (CvGame::doTurn())
  • Do all sorts of game admin
  • Including barb city spawning (CvGame::createBarbarianCities()), which goes something like:
Do nothing if
  • "getMaxCityElimination" game option is >0 (not sure what that is)
  • No barbs game option
  • Some Python function "createBarbarianCities" ==1 (don't know what that is)
  • The game has entered an era with no barb city creation
  • The game difficulty has barb city density set to 0
  • Average # cities for non barb players left in the game is < 2
  • A RNG-based and game-speed-based test on how long since the last barb city was created
  • A RNG-based test against difficulty setting for barb city creation probability
Some high level tests on potential tiles:
  • Not water
  • Not currently visible to any non-barb team
  • Barb cities on the landmass should not already be above a difficulty-defined threshold of barb cities per unowned tile
  • (If the barbs have a whole landmass to themselves it seems to loosen that test so it can pack even more in. Not sure about that.)
Then for each tile that passes those tests, it assesses the suitability in more detail using a function (CvPlayerAI::AI_foundValue) which is also called by normal AI city founding.
First a couple of red lines
  • Can a city even be founded here (peaks, water, closeness to other cities etc).
  • Is there a unit of any other team inside a square around the plot of size MIN_BARBARIAN_CITY_STARTING_DISTANCE (XML parameter: 2). If there is, then no barb city (spawnbusted!)
  • Would the BFC contain less than 14 usable tiles not owned by other civs. If not, then no barb city.
Fine-tune suitability based on
  • Number of "bad tiles", and "good tiles" on currently unowned tiles.
    • Resources etc. It *does* take account of whether the AI/barbs have the reveal tech.
  • Looks like it outright rejects sites with no unowned BFC bonuses to claim
  • Tile yields
    • Terrain features like freshwater, coast, hills (very strongly desirable!)
    • Distance other cities (barb: quite undesirable to be near, other player: very undesirable to be near)
    • It somehow takes into account where tiles are shared with other cities of the same team. Don't quite follow that bit.
Then it founds a city on the best available site it looked at, if there were any that weren't rejected.
 
Not a code diver, but I'm pretty confident in the conventional wisdom here..... barb cities require a barb unit to be present and don't follow the normal spawn/fog busting rules that barb units do. Meaning a city can spawn in a tile that's 2 tiles away from a unit if it's not visible, and if a barb is present. That syncs up with my anecdotal experience, of sometimes a barb city spawning even in an area that's spawn busted, and also from crying out at "bad luck" that a barb city spawned the turn i moved my unit away. In reality I'm overstating how unlucky I am, since I probably moved my unit away because it was chased by a strong barb, and then that matches conditions for barb city creation for possibly the first time. It also matches with my experience like Fippy said, that in isolation games, where I often have much of the island unsettled for 100+ turns, there's no breaches with barb cities once I've spawn busted all possible barb units, even though I'm certainly not maintaining vision on all tiles. It even syncs up with the hellish Charlie game. The reason it's so very likely that a barb city spawns above your capital, is because a barb unit will spawn there very quickly. It's connected by land to the continent with an impassable mountain, so that unit can't ever leave. Since that unit is stuck there, a barb city is inevitable in fairly short order.
 
Yeah I guess no reason barb cities can't spawn where a barbarian is. Especially in the case of human areas if the player is deliberately fogbusting large numbers of tiles without settling them. The barb city spawn code is attracted by the number of unowned tiles - AI areas will have more AI cities, so fewer unowned tiles.

Edit:
Spoiler :

Check this out! A reliable way to prevent barb cities, other than ofc spawnbusting everywhere, could be to pay attention to the number of unowned tiles on the landmass. If we can settle a city, or force a border pop, to bring it below 80, no barb cities should spawn at all. If <160 unowned tiles and there's already 1 barb city, no more should spawn. Etc. I guess at the risk of overthinking it you could even leave an undesirable area fogged to tempt the barbs to settle it, using up their quota of cities on your continent.

Edit2. 80 is quite a lot of tiles - I mean in iso you might only have that amount of tiles for your whole island, and this would suggest you're immune to barb cities then. I feel sure I can remember getting barb cities in small unused areas in iso - plus I usually play immortal where the threshold is 90 tiles, not 80. Will have to keep an eye on this in future games - memory can be a funny thing can't it! Just one quick try-out now: clicked through 200 turns in iso on a ~80 tile island with just one city and no fogbusters. 0 barb cities for me. Shaka got an early one on his bigger island before he'd filled it out much, and the main continent ended up getting 3. Open verdict :crazyeye:
Code:
    for (iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
    {
        pLoopPlot = GC.getMapINLINE().plotByIndexINLINE(iI);

        if (!(pLoopPlot->isWater()))
        {
            //Only spawn city on non-visible tiles
            if (!(pLoopPlot->isVisibleToCivTeam()))
            {
                //I think this means landmass - e.g. say 79 tiles
                iTargetCities = pLoopPlot->area()->getNumUnownedTiles();

                //Barb-only continents?
                if (pLoopPlot->area()->getNumCities() == pLoopPlot->area()->getCitiesPerPlayer(BARBARIAN_PLAYER))
                {
                    //Increase desired density of barb cities
                    iTargetCities *= 3;
                }

                //On deity this is 80 (settler 160). So if 79 unowned tiles, target is 0
                iTargetCities /= GC.getHandicapInfo(getHandicapType()).getUnownedTilesPerBarbarianCity();

                //Only proceed if existing count of barb cities in area (landmass?) is not at the target
                if (pLoopPlot->area()->getCitiesPerPlayer(BARBARIAN_PLAYER) < iTargetCities)
                {
                    iValue = GET_PLAYER(BARBARIAN_PLAYER).AI_foundValue(pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE(), GC.getDefineINT("MIN_BARBARIAN_CITY_STARTING_DISTANCE"));

                    iValue += (100 + getSorenRandNum(50, "Barb City Found"));
                    iValue /= 100;

                    if (iValue > iBestValue)
                    {
                        iBestValue = iValue;
                        pBestPlot = pLoopPlot;
                    }
                }
            }
        }
    }
A couple of other interesting things from watching spawns in worldbuilder just now on some deity fractal maps. One is the non-barb cities on continent thing can't be true, because we often see barb cities on their own continent. Another surprising thing was barb units do not appear to spawn bust each other - I guess that explains why we are sometimes attacked by groups from the same direction.
 
Last edited:
Hello @Lain I would love to see you try again AW someday on the Live-Stream. I don't know if it is possible at all to win there on Deity (you might have done it offline).... Immortal would be perfectly fine, maybe some extra challenges like a peaceful leader, pangea map, raging barbs, whatever you think would make it more difficult, because you have already beaten IMMAw with tech trading on...
 
It's possible but not with an aggressive (Qs) approach if facing several AIs,
need something like Mansa's Skirmishers.
Another option would be Praets, but needs unrestricted leaders.
 
Back
Top Bottom