Increasing Number of Workable City Plots

Thanks man. I'll see if our head guy wants to put this together. This is super.
 
It all looks very nice. But the function plotDistance finds the distance between two plots, so it will end up messing the entire game, such as unit movement etc. What is need is a plotDistance function seperate of the orignal, and use the modified version in the doCulture. But anyway, Great Work!
 
NikG said:
It all looks very nice. But the function plotDistance finds the distance between two plots, so it will end up messing the entire game, such as unit movement etc. What is need is a plotDistance function seperate of the orignal, and use the modified version in the doCulture. But anyway, Great Work!

Well I just went in game to see if what you were saying is true, and honestly, I can't tell if there is any difference in the unit movement or not. It seems the same to me. ;)
 
Sorry about throwing up that faulty code. Maybe I should check first before I toss something up like that, but I had a different algorithm up there for awhile before I stumbled across that one. It was a quick edit and I must of left one of the extra brackets in there. Woops. Looks like you got it to work though, great.

@NikG - This is what calculates movement:
Code:
// 3 | 3 | 3 | 3 | 3 | 3 | 3
// -------------------------
// 3 | 2 | 2 | 2 | 2 | 2 | 3
// -------------------------
// 3 | 2 | 1 | 1 | 1 | 2 | 3
// -------------------------
// 3 | 2 | 1 | 0 | 1 | 2 | 3
// -------------------------
// 3 | 2 | 1 | 1 | 1 | 2 | 3
// -------------------------
// 3 | 2 | 2 | 2 | 2 | 2 | 3
// -------------------------
// 3 | 3 | 3 | 3 | 3 | 3 | 3
//
// Returns the distance between plots according to the pattern above...
inline int stepDistance(int iX1, int iY1, int iX2, int iY2)
{
	return max(xDistance(iX1, iX2), yDistance(iY1, iY2));
}
 
It doesn't look like it would be too hard to program in true (or at least root(2) = 1.5) diagonal movement from that. Pathfinder would probably be able to handle it as well.

The trouble would be that units tend to have 1 or 2 movement points, and so 1.5 moves would be the same as 2 in alot of cases.

As for the brackets - it's amazingly easy to get them wrong when you're used to a program that counts them for you :p
 
I've discovered a secondary issue with this culture border code. What happens now is the AI builds their cities 2 plots away, and builds them in line either North to south or East to West. This makes their cities not grow to their upmost potential as each city is fighting over the tiles.

Seems like an odd occurance though... I would have figured it was only for the cultural borders.
 
NikG said:
Haha :D I said it would have repercussions to edit this function...

Well yeah sometimes C++ can be like that.. lol but I think it is still possible... however, it might take additional code to ensure the AI still builds their cites as they should. ;)
 
Well, my knowledge of C++ is sort of non-existant...

Even if you told me where I should go that wouldn't help... I'd need the coding as well.
 
You know, I just thought of a possible way to fix this little problem...

I was thinking if I were to change the MIN_CITY_RANGE to 4 from 2 in the GlobalDefines.xml, then it will force the AI to build their cities at least 4 plots away. It might not be the best idea, but it will certainly do the job. ;)
 
Hey all!!!

After reading the great posts by Strand and RogerBacon (and others), I have created a new dll that allows a city with radius of three (3). I know others have done this, nothing new; but I could not get them to work. This will be the first mod for me, and the second will be a mod to this one (a mod for a mod).

What I want to do is have the user specify what the radius is an XML config file (GameOptionsInfo most likely), then have the code determine how to initialize cities etc based upon this setting. It sucks that this is hard coded, should be able to specify this in a config file. I have the infrastructure in place to create either a 2 or 3 radius, working 4+, but I have used #ifdef for compile-time determine of which to create. When I learn how to get it from a config file it will be better.

If ne1 out there knows what class/methods to call to be able to do this, i.e. give me a push, I would appreciate any help ...

Here is the link (http://forums.civfanatics.com/uploads/107817/CvGameCoreDLL.zip) to download it.

be safe all

dwfa
 
Back
Top Bottom