Distance between cities - question

Furin

Warlord
Joined
Feb 17, 2006
Messages
147
I noticed that the AI will always build the next city as close as possible to the last one, ignoring unique features, bonuses or access to the sea. If the example city would have been build one tile more away it would have been better for the AI in the long run.

So I was wondering if the mechanics for the pirate cove could be easily modded into the game, just cities/settlers being the target, aka a city can only be build outside the fat cross of another city. If the AI wants to ruin the fun for the 1k slums or the Kuriotates I wouldn't really care.

Would it be so easy as to change a value in an XML file or do I need to dig deeper?
 
No, right now only the inner ring of the BFC is prevented from overlapping. He's looking for a way to prevent a city from settling if any portion of its BFC would overlap the BFC of a current city.

I'm not really sure that's such a good idea, though. It would ensure that AI to always have a full BFC to use, but there are many times when claiming a resource or controlling an area makes overlapping BFC's acceptable. Also, the AI isn't smart enough to plan ahead where it will place the next 10 cities, and so it will likely end up in situations where it drops a city down in the "best" place and in doing so blocks itself from several other possible city sites.
 
ah, what he said was misleading, it thought he wanted it to be impossible to settle inside the BFC of another city. I agree with Emptiness that it is an unnecessary and ultimately bad restriction.
 
Edit: nevermind im wrong

Anyway, the AI city placement is fairly odd. They seem to make cities with a bunch of overlap, yet still have random squares and edges that can't be worked by any city.
 
I believe the distance required between cities is set in GlobalDefines.xml, and could be changed for this mod in GlobalDefinedAlt.xml

Code:
	<Define>
		<DefineName>MIN_CITY_RANGE</DefineName>
		<iDefineIntVal>2</iDefineIntVal>
	</Define>
is the default. You could set it to 3 to insure at least that Kuriotates cities don't overlap their BFCs, or 0 to allow every tile on the map to be a city. (Not that I'd necessarily recommend either...) Of course, this is a limitation that applies to humans as much as to the AI, and it would mean that stupid AI city placements would be even moe annoying as they could block good spots from further away.
 
Thank you very much MC, I'll try that asap and see how it works. I didn't mean I want to have it changed in general, just wanted to check it out myself and see how it plays.

I could even put in very high values and get the effect of "city states", less cities on a continent with barbarian lands in between, but then i must put the creation time of barb cities upwards so they don't block the civs from settling.

About the "fat cross" I thought it is the cross shaped thing around the city, not the inner ring? Is the "fat cross" just the 8 inner tiles around a city?
 
Barbarian cities have to follow the same rules as other cities. In other words, if you set the value high enough for there to be "empty" space between cities, there still won't be room between them to put a barbarian city.

The fat cross is the city, plus the 8 tiles around that, plus 12 tiles around that (3 in each cardinal direction). Right now, the inner 8 tiles are not allowed to overlap, but the outer 12 tiles can overlap anything. If you raise the distance limit by one then the outer tiles will only be allowed to overlap each other, but not allowed to overlap the inner tiles. Raise the distance limit one more and the outer tiles won't be allowed to overlap. All that is for two cities N-S or E-W of each other; I'm not sure how it handles diagonals, so there may still be some overlap possible at the corners for those values.
 
Allright, I have tried to set the distance modifier to 3 (instead of 2) and as Emptiness predicted there is still a possible overlapping of cities in the outer parts of the fat cross (the ne,sw,se and nw border tile). The AI will still mostly build the cities as close as possible to each other, making use of that 4 possible overlapping tiles, but its general expansion or development is not hindered. Instead by turn 230 there are similar size empires to a normal game (on emperor level) but the AI cities are larger(duh).

Let's take a look at turn 230, me playing elves. This is a part of how Perpentach expanded. The closest cities to the capitol share tiles, but the other ones are farther away from each other and have grown pretty well. If you look at the minimap you can see that the other civs have build their cities in a more "feasonable" distance too.

 
I find this very interesting. Thank you for testing it out. I may make the same changes myself.

I hate having to destroy every other AI city as I take over their area due to it being WAY over crowded
 
Same here, that's why I was asking :) A great thing, which is beyond my abilities, would be to change the variable during a game with a script, so you would have a few big metropoles and in between a lot of small cities. But then the AI would maybe ruin the metropoles during the times you allow closer placement.

Anyhow, if you make the changes, be sure to make them in the BTS root folder globaldefines xml and not the alt globaldefines in the modfolder. Simply adding the lines there didn't do the trick, I had to change them in the original BTS file.
 
I'm wondering if you didn't make a typo, because I just tried changing it in the GlobalDefinesAlt and it worked liked a charm.
 
Hmm, I copied it from MC's post, I'll check again. I was suprised it didn't work in the first place. I have been playing with the different setting for the whole evening and i must say i really like it.
 
I'm wondering if you didn't make a typo, because I just tried changing it in the GlobalDefinesAlt and it worked liked a charm.

Changing it in the GlobalDefines will change it for every mod I play?
 
If you change it in the BtS GlobalDefines.xml it will change it in every mod that doesn't overwrite it for itself. Usually that owuld be through its GlobalDefinesAlt.xml file, but some mods just include the whole GlobalDefines.xml file in the mod folder.
 
Keep in mind that if you build cities without overlap you are wasting space. For almost all of the game cities will be at a size lower then 20, and even then there will be a few specialists. Add up all the tiles that aren't being worked and it would probly be enough for another city.
 
Furin, try opening your GlobalDefines and copy/pasting from there into the GlobalDefinesAlt. I'm not saying MC made a typo, but I've had my share of issues copy/pasting from browsers.
 
Keep in mind that if you build cities without overlap you are wasting space. For almost all of the game cities will be at a size lower then 20, and even then there will be a few specialists. Add up all the tiles that aren't being worked and it would probly be enough for another city.

While I can't speak for you... If my city doesn't hit size 20, then the unworked tiles are not worth working. Adding another city would simply make more workers trying to work the same worthwhile tiles. IE instead of one size 14 city I would end up with two size 8 or 9.

The better answer, for me, is to use workers to improve those unused spaces and get both cities up to size 15+
 
Furin, try opening your GlobalDefines and copy/pasting from there into the GlobalDefinesAlt. I'm not saying MC made a typo, but I've had my share of issues copy/pasting from browsers.

You are prolly right about that, it's not so much an issue for me as I only play FFH. Up to this day I haven't played a single game of BTS or any other mod, but for anyone else playing multiple mods your solution is alot better and highly recommendable :goodjob:
 
I settle my cities using the standard method: we sacrifice to Sucellus, listen to the Leaf Priests, convene the High Council, the High Lords make a recommendation to the King taking into account the needs of the nation and of the noble Houses. If it happens to maximize population, worked tiles, etc., praise to the Fallen God.
 
Top Bottom