Way to remove 3-hex city distance for cities on different landmasses?

Joined
Apr 11, 2015
Messages
438
The minimum distance between cities in Civ V is four hexes (a gap of three hexes). However, if the cities are on different landmasses the distance is reduced to three hexes (a gap of two hexes).

Is there any way to remove this different landmass rule so all cities have to be four hexes from each other?

In the GlobalDefines.xml file there is the following:

<Row Name="MIN_CITY_RANGE">
<Value>3</Value>
</Row>

I can't find anything that might remove the different landmass rule, though.

So is it possible to make it that the four-hex rule is applied universally? If so, maybe someone has made a mod for this already, but I haven't been able to locate one.
 
Correct me if I'm wrong, but wouldn't changing that number to four solve it? That should be the universal minimum city distance.
I assume that number must represent the number of hexes in between cities, as cities can only be founded four hexes from other cities (on same landmass). So changing it to four would presumably mean cities would have to be built five hexes away. Hence, not addressing the landmass issue.
 
I think that number actually means the minimum distance overall. Thus changing it to four would make the minimum overall distance four. I say this mainly because in YNAEMP, the same value is changed to 2, and cities can be founded within two tiles of each other.
 
I think that number actually means the minimum distance overall. Thus changing it to four would make the minimum overall distance four. I say this mainly because in YNAEMP, the same value is changed to 2, and cities can be founded within two tiles of each other.
Okay. I was thinking the MIN_CITY_RANGE value was the default distance between cities. I'll have to test it out to see whether it will solve the landmass issue.

I only noticed the landmass quirk recently in a game. I googled around and it is apparently set that way so small islands off the coast can be settled. I'm not really keen on this idea. It's gone a stage further in my current game where another civ has founded a city three hexes away and we're on different continents. I'll probably use the in-game editor to move the interloping city a hex further away. I'd prefer to prevent such issues from arising in the first place, though.
 
Correct me if I'm wrong, but wouldn't changing that number to four solve it? That should be the universal minimum city distance.
I tested it and it didn't work. It made it so that cities needed to be five hexes from each other (gap of four hexes). Distances between cities on different landmasses also increased by one (four hexes or a gap of three hexes).

So the MIN_CITY_RANGE code is the default distance between cities value. The coding related to the different landmass rule must be elsewhere. Anyone know where it might be...?
 
If I recall the different landmasses thing is not exposed in the xml.

And without changes to the dll, MIN_CITY_RANGE is the number of tiles that must be between cities, not the distance in tiles from city-plot-A to city-plot-B. In other words, neither of the plots the two cities locations will-be-on/are-on are counted.
 
If I recall the different landmasses thing is not exposed in the xml.
Thanks. If that's the case then I don't suppose it can be easily modified. Beyond my modding capabilities, anyway. I guess I'll have to live with it, then, and step in with the IGE to manually move a city if its location particularly irks me (as in the different continents case I described above).
 
If I recall the different landmasses thing is not exposed in the xml.

And without changes to the dll, MIN_CITY_RANGE is the number of tiles that must be between cities, not the distance in tiles from city-plot-A to city-plot-B. In other words, neither of the plots the two cities locations will-be-on/are-on are counted.

This is the easiest way to think of it.

The coding related to the different landmass rule must be elsewhere. Anyone know where it might be...?

This is hard-coded in the .DLL algorithm, within
Code:
bool CvCitySiteEvaluator::CanFound(CvPlot* pPlot, const CvPlayer* pPlayer, bool bTestVisible) const

near the near the end of the function:

Code:
// look at same land mass
		iRange = GC.getMIN_CITY_RANGE();

		for(iDX = -(iRange); iDX <= iRange; iDX++)
		{
			for(iDY = -(iRange); iDY <= iRange; iDY++)
			{
				pLoopPlot = plotXYWithRangeCheck(pPlot->getX(), pPlot->getY(), iDX, iDY, iRange);

				if(pLoopPlot != NULL)
				{
					if(pLoopPlot->isCity())
					{
						if(pLoopPlot->getLandmass() == pPlot->getLandmass())
						{
							return false;
						}
						[I][B]else if(hexDistance(iDX, iDY) < iRange)  // one less for off shore
						{
							return false;
						}[/B][/I]
					}
				}
			}
		}
 
This is the easiest way to think of it.



This is hard-coded in the .DLL algorithm, within
Code:
bool CvCitySiteEvaluator::CanFound(CvPlot* pPlot, const CvPlayer* pPlayer, bool bTestVisible) const

near the near the end of the function:

Code:
// look at same land mass
		iRange = GC.getMIN_CITY_RANGE();

		for(iDX = -(iRange); iDX <= iRange; iDX++)
		{
			for(iDY = -(iRange); iDY <= iRange; iDY++)
			{
				pLoopPlot = plotXYWithRangeCheck(pPlot->getX(), pPlot->getY(), iDX, iDY, iRange);

				if(pLoopPlot != NULL)
				{
					if(pLoopPlot->isCity())
					{
						if(pLoopPlot->getLandmass() == pPlot->getLandmass())
						{
							return false;
						}
						[I][B]else if(hexDistance(iDX, iDY) < iRange)  // one less for off shore
						{
							return false;
						}[/B][/I]
					}
				}
			}
		}
Thanks. I'm a bit out of my depth now!

1) Which .dll file?
2) I can open and modify a .dll file with Notepad?
3) What would the coding of the relevant .dll need to be modified to?

It would be good to remove the different landmass rule. As well as being annoying and creating a messy-looking map, I noticed in a previous game that it can lead to the AI civs founding some rather pointless cities, which no doubt affected their civ's overall efficiency and effectiveness.
 
Thanks. I'm a bit out of my depth now!

1) Which .dll file?
2) I can open and modify a .dll file with Notepad?
3) What would the coding of the relevant .dll need to be modified to?

It would be good to remove the different landmass rule. As well as being annoying and creating a messy-looking map, I noticed in a previous game that it can lead to the AI civs founding some rather pointless cities, which no doubt affected their civ's overall efficiency and effectiveness.


1) CvCitySiteEvaluator.cpp
2) Visual studio is best, since you will need it to re-compile it. Please follow this guide for steps on downloading and compiling the .DLL source files.
3) Depends on how you want to implement your specific solution, for whatever your needs may be.
 
1) CvCitySiteEvaluator.cpp
2) Visual studio is best, since you will need it to re-compile it. Please follow this guide for steps on downloading and compiling the .DLL source files.
3) Depends on how you want to implement your specific solution, for whatever your needs may be.
Many thanks. I'll have a look.
 
Top Bottom