A new terrain improvement system

Yeah, it's an expansion of what Edgecrusher started rather than the original post which is only about capping growth. Exporting excess is the next step though. If iMaxPlayerInstances can be changed in python then I'm pretty sure it can all be done in python. The hard part is the mutex buildings since there's no native support in XML, but if choices are limited by techs (mutex techs could be handled in python), then a working system can be created.

Limiting city size is almost trivial, just override onCityGrowth to set pop = pop -1 if ( pop > maxPop). Where maxPop = 3 + functionCallWhichFindsCottagesEtcInCityRadius(). This will likely stall the AI, but maybe giving a very high GROWTH flavor for cottages would be enough?

I suppose we'd have to check every turn in case the cottage/etc.. got destroyed (and the people were living there), so it would go into onBeginPlayerTurn maybe instead of just checking on growth.
 
well i barely caught any thing you just said but maybe you could make it so that when a cottage is destroyed some are killed and some move to another cottage (if available)
 
LOL actually the original post was about a more realistic system of improvements, where resources (as in food and hammers) produce money, rather than people (especially as it isn't even people, just the infrastructure for people). This rendered cottages useless, so i added that in as a kind of extra :D

Moreover, I believe related topics are useful and sometimes necessary to discuss when thinking about a new concept :)

About setting population: It might be trivial to you, but i know no python or C++. If it really is that easy, I would much appreciate you writing up just that bit. I can work well enough with XML to do the rest - It would give me my first "thing" to offer to the Civ community (with credit to you of course :)), and a chunk of coding that i can look at, and hopefully learn from.
 
yeah. but. I started with Civ 4 not knowing anything about XML, python or C++. After a couple months i got the hang of XML, and now i'm fairly confident with it. after a year trying to teach myself python, i'm not much further than making myself a basic calculator :rolleyes:, and the Hello world script in C++ scares me :)
 
shvrhsvrhsvrhrhsvrshrhhsrhvrrvrvrvrvrvsh!(gibberish chant to get something to work (it got a car with 2/4 cylinders to work))
i found a python mod tutorial post!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

its Let's learn how to mod in civIV... Today!
 
LOL I've been reading the civfanatic tutes for the last year :)

I think that ones a general tute introducing python. from there I'd move to the Sample Python snippets (except some of them are a bit big) and the many small python modcomps that the lopez produces (one of them in particular, about civics, is great to look at). There's also TGA's python Tutorial, which is also quite awesome at introducing concepts.
 
I reckon I might be able to cobble this one together though. Like Primordial Stew said, at first glance it looks doable. No doubt i'll run into a bit of trouble :D but yeah. Gimme a coupla weeks tho :D:D:D I'll post progress here.

Because the cottage line won't be producing money anymore, how much do you reckon the other improvements should change, and which ones, and in what way? :)
 
Because the cottage line won't be producing money anymore, how much do you reckon the other improvements should change, and which ones, and in what way? :)

what do you mean:confused:
 
well cottages and that won't be creating :commerce: anymore. So to make up for that the other improvements will need to create more :commerce:. As in, A farm might make +2 :food: and +1 :commerce:, instead of just the food. geddit? my question is, how much should that commerce increase be, and for what improvements?

Also, seeing as we're changing improvements, i'll ask this here as well. Does anyone else find it strange that the windmill improvement in the modern era changes to a wind-power-plant, but it still produces food? should that be changed?
 
wells and offshore platforms should have a chance of revealing oil and quarries should have a chance of revealing stone or marble don't ya think?
 
At the moment you can only build offshore platforms when there is already oil, and a quarry when there is stone or marble. we could change it so that a quarry can be built anywhere (and maybe a quarry would create more :hammer: and less :commerce: than a mine). I don't think that would be applicable for an offshore platform though.
 
i just had another idea. you know how farms share irrigation? well maybe you could make it so that saw mills could share access to a river if connected by roads or whatever.
 
do you mean lumbermills? I wasn't aware that lumbermills got a bonus from being on the river.

Also, i posted this as a seperate thread in the sdk/python forum but it didn't get any responses (although it's only been a day):

Ok so here's the deal:

I'm attempting a modcomp where the cottage-hamlet-village-town improvement line is actually housing infrastructure for population. That is, there is an initial limit of 3 pop in each city. every cottage in the city square adds 1 pop, every hamlet, 2 pop, and so on.

SO.

I went and had a look at Zebra 9's Python API for BTS. I found, in CyCity() class:

void setHighestPopulation (int iNewValue)
void (iNewValue)

So. a couple of questions

How would the code look in an actual python file if i were to, say, set a universal max pop of 5? My initial reaction from having looked at other python codes around the place is:


Code:
CyCity.setHighestPopulation (5)and putting that into a python file would make it work. Am i right?

Also, any suggestions for getting the number of cottages, hamlets, etc. in a given cities fat cross? I had a quick look through the api but couldn't find anything.

Any help would be much appreciated
 
do you mean lumbermills? I wasn't aware that lumbermills got a bonus from being on the river.

lumber mills get 1:commerce: for being on the river
 
Oh ok. hmmm. that's an interesting idea. We'll see how stuff balances out and how difficult it would be to code, but that's definitely worth keeping in mind. I never build them in my games, I always chop the wood then build a mine/cottage/farm.

I'd really appreciate if someone could give a bit of advice regarding my previous post tho.
 
Back
Top Bottom