Limiting cultural border size by tech

lth

Chieftain
Joined
Jul 29, 2007
Messages
13
Hi,

I'm new to civ4 modding, and could do with a couple of pointers as to how to fiddle with the SDK to create the following effect. Any help would be appreciated!

Basically, I'd like for a city's cultural border radius to be limited by a combination of civics and techs. Adding a "imaxborderradiusmodifier" into the XML schemas and adjusting the C++ to pick them out should be no bother, but how do I actually use the limit to affect the plots in the game?

For example, everyone starts off with max radius 1. With the monarchy civic, you get +1, so you should then be able to control the usual 21-plot civ city radius. Then with the "nationalism" tech you get +2, so you should then be able to project borders (whilst under monarchy) a total of radius 4.

I'm guessing that I should be modifying something to do with how each plot calculates who owns it, but being new to the SDK, I'm not really sure where to look.

Cheers,

lth
 
Limit cultural levels?

That might me a great idea in combination with Larger City Radius Mod with 10 culture levels fix:



culture level --- tiles ---delta
------------------------------
POOR ---------- 9 ----- build city
FLEDGLING ----- 13 ---- +4
DEVELOPING ---- 21 ---- +8
ELEGANT ------- 29 ---- +8
REFINED -------- 37 ---- +8
DISTINGUISHED - 45 ---- +8
INFLUENTIAL ---- 57 --- +12
EXTRAVAGANT--- 69 --- +12
ICONIC ---------- 81 --- +12
LEGENDARY ------ 97 --- +16
 
CvCity.cpp -> CvCity::doTurn() -> CvCity::doCulture() -> CvCity::changeCultureTimes100() -> CvCity::setCultureTimes100 -> CvCity::updateCultureLevel()

I think you just need to change CvCity::updateCultureLevel() so eCultureLevel will not be higher than the limit set by a Civic. Don't forget to call CvCity::updateCultureLevel() for every city when you change civics (in CvPlayer::setCivics()) and a new civic changes a culture level limit.

I think everything else should work just fine as usual.
 
Yes. I'm actually now attempting something more complicated - that cities should be culturally swayed to their normal distance, though your borders may be capped sooner.

Find attached my cvcity.cpp file. The magic happens in the setCultureLevel method.

It's probably not very good, and it certainly doesn't do what I want quite yet, but it will limit a city's border radius based on your current civics and tech.
 

Attachments

It's easy when building a fort to grant ownership to all adjacent tiles in the python, but the C++ seems to make a mess of things when it recalculates the cultural borders for cities, reclaiming the ownerships. I've seen a hack that uses python at the end of every turn to scan for forts and reassign the ownership again correctly, but that's hardly the ideal solution.
 
Back
Top Bottom