View Full Version : A new terrain improvement system
moopoo Mar 04, 2008, 06:01 AM ok. This idea is based on the idea of excess goods, and city population limits.
Unless i am sorely mistaken:
People learnt to irrigate, then settled down. They would farm for the food they needed. Excess could be sold, thus generating profit. with lots of farming, they need more city to live in. thus the city expanded. When people mine, they too generate profit.
So my Idea. you build a farm. It generates food, which in turn generates population. It also generates commerce. Mines generate Hammers. they Also generate commerce. BUT. A city initially has a population limit of 3. To allow for more, one must build a cottage, which can hold an extra population point. as it upgrades it can hold more population, at which point you need to build another cottage. the cottage line would also generate a small amount of hammers, and a small amount of commerce.
The other less used improvements could build on this idea. but that's the basic of it.
I could probably mod this one myself. The only problem would be imposing population restrictions. Worth doing, do you guys reckon?
Popcornlord Mar 13, 2008, 04:19 PM Sounds cool, but might be sorta hard to program the population limit. I have no idea how to, so it probalby involves python or c++
Dom Pedro II Mar 13, 2008, 06:48 PM This would in fact not be terribly difficult. Earlier civ games had hard population limits that could be raised with the construction of Aqueducts and Sewer Systems. I think though that the reason they removed this, however, was due to the fact that people were unhappy that additional food was essentially going to waste if you reached the population cap. There's a lot of things that they removed like that because they deemed them to be "unfun" like Corruption resulting in a loss of hammers, civil disorder rendering a city essentially useless, etc.
So that's something to take into consideration for the future.
moopoo Mar 14, 2008, 03:32 AM true. could the food perhaps be funnelled into something else? the excess could be converted into production or commerce. Both of these would make sense, as either having the food sold, or a kind of slavery, where people get killed to make stuff/people used to train units.
I don't think this population limiter would be annoying, especially if the above is done, as I for one have often found myself with cities expanding to quickly and creating unhappiness and unhealthiness. Which is never nice :)
Edgecrusher Mar 14, 2008, 10:29 AM I am not sure if this is what you had in mind, but I wish there was a system to "trade" food between your cities.
For Example:
City A Has 8 Surplus food (say its in the middle of grasslands with all farms and a couple resources).
City B, built on a Tundra to harvest Iron, Marble, or another resource, the city has a problem producing food.
Instead of having the city A grow and grow, and City B struggle, I wish you could "Send" say 2 (or 4)... of the surplus food. Obviously with an option to cancel the exchange, or what have you.
Dom Pedro II Mar 14, 2008, 10:37 AM I've been looking into create such a system, Edgecrusher, but unfortunately, to create it, I would need an interface for the player which is not my expertise. I have very few python skills eventhough I code the SDK portion of this.
Edgecrusher Mar 14, 2008, 10:58 AM I am useless when it comes to the SDK or Python, although I recently starting treaching myself some of the SDK stuff.
I always wanted to teach myself these things and work out some kind of a "commodites mod" where the resources would be just "Raw" and the buildings produced different commodities. The commodities being the things that provided happiness/health/extra production/commerce/etc...
Basically a system where the Resources got consumed in different ways, at the option of the user.
For Example the Cow resourse:
Build a Butcher: Turn 1 Cow into "Meat" or "Steaks"
Build a Tannery: Turn 1 Cow into "Leather"
Build a Dairy Farm: Produce 1 "Dairy" or "Milk" with cow (since in this instance the Cow isnt "consumed"
So at the players option/need he could either have Meat/Leather or "Dairy" (or with 2 Cow resources) all 3.
I just never understood how 1 Iron or 1 Cow was capable of supplying an entire Empire with enough resources to fuel the empires need.
Dom Pedro II Mar 14, 2008, 11:24 AM Edge, now you're getting into Quantitative Resources, and I refer you to Gaius Octavius's thread on this topic... which has proven to have immense difficulties in achieving because of how Civ is designed. Possible? Yes, but even I basically removed myself from the project because it was just too much.
moopoo Mar 14, 2008, 07:36 PM Lol. Thread theft!
Refering to your first post, Edgecrusher, that isn't what I had in mind =D While i think that would be a good idea in terms of realism, I think that would add a level of micromanagement that Civ4 tries desperately to avoid (as you would have to go into the city screen and set specific amounts for specific cities). My idea is more a different way of dealing with improvements.
MurdockTheCrazy Mar 14, 2008, 11:25 PM I like this idea... Would go well if added to quantitative resoruces.
moopoo Mar 17, 2008, 03:15 AM Cool. Anyone got any suggestions on how to go about limiting population?
GoodGame Mar 19, 2008, 07:16 PM D'ooooh! Duplicate post
GoodGame Mar 19, 2008, 07:17 PM I reckon that that flies in the face of what Civ has been from the beginning, which was micromanaging plots to get the ideal combination of food and hammers. :lol: The main advantage of lumping hammers, food etc into one improvement type would be less micro-managing though. I could see it working if there were a successive stream of improvement types, each better than the next, and logically tech dependent.
Actually on your history, there is a concept of Pastoralism as being a reason for people to settle down. Basically think of it as proto-farming. After that they gradually developed kind of science of farming and husbandry.
I think the gist of what you want has already been done in other mods. For instance the FFH mod has an Aristocracy civic that causes all farms to make 1 food less, but some also some commerce. So you could accomplish similar things just by changing civics, rather than having to design a brand new improvement system. Perhaps create a brand new civic category called Production, solely civics that modify what the output of the improvement tiles are.
ok. This idea is based on the idea of excess goods, and city population limits.
Unless i am sorely mistaken:
People learnt to irrigate, then settled down. They would farm for the food they needed. Excess could be sold, thus generating profit. with lots of farming, they need more city to live in. thus the city expanded. When people mine, they too generate profit.
So my Idea. you build a farm. It generates food, which in turn generates population.
moopoo Mar 20, 2008, 09:50 PM I wouldn't say it flies in the face of civ. My first civ game was Civ 3, where you put road on every tile to generate money, and you just choose between farms or mines.
The aim of this system is to balance between allowing for population, and how that population is used, as by building a cottage on a square, you are blocking that square from using a different improvement. also, there is a choice between building several cottages and getting the pop up quick, or waiting for your cottages to expand.
Gaius Octavius Mar 20, 2008, 10:28 PM Edge, now you're getting into Quantitative Resources, and I refer you to Gaius Octavius's thread on this topic... which has proven to have immense difficulties in achieving because of how Civ is designed. Possible? Yes, but even I basically removed myself from the project because it was just too much.
Actually, it ultimately won't. :D I have since developed an interesting work-around solution that will not involve having to completely redo the resource part of the SDK... unfortunately, my biggest enemy at present (aside from time) is my lack of experience in C++. However, I am going to attempt this soon, beginning with the oil counter.
[offtopic] :D
moopoo Mar 21, 2008, 06:19 AM how did you guys learn C++?
black baron Mar 24, 2008, 08:50 PM i had civ 3 too as my first civ, one way you could limit pop. is by (as someone stated before) units "kill" population like in civ 3 a settler would consume one pop. so you'd have to wait before expanding.
secondly, the micromanaging could be fixed with an interface where a "governor" (the computer) takes care of the micromanaging so you wouldn't, this of course could be optional so some of the control freaks might be interested
primordial stew Mar 24, 2008, 11:54 PM Ignoring the AI for the time being.. how about just have a new set of buildings that do resource conversion? Consider a city having cow/sheep/deer.. in the city radius. That city could build could build from a mutex list:
1. tannery - provides leather for military units, so +15% ground unit production (obsolete with gunpowder)
2. butcher - provides meat for this city, so +1 extra food (+2 food if the city is on ice or tundra)
with salt (or some tech which implies salt), +2 additional food, and +1 trade routes
Meat is more complex since it spoils very easy. Others foods are simpler.
Any kind of grain (enables a granary to be built):
1. bakery: provides bread for this city, so +2 food
2. grain shipments: no local bonus, instead gives the city +3gpt and +1 trade routes
3. tavern: provides +3 gold
4. distillery: provides +1 gold, and +1 trade routes
And for cities without said resource within it's radius, the trade routes are taken away.
1. import grain: +2 food, and -1 trade routes
2. import meat: +2 food, and -1 trade routes
Trade routes handle all of the coin transfer. The mod comp would only need to handle the building mutex condition, trade route updates, and food updates. Buildings would be cheap, 10 hammers maybe.
As for how many cities can build "import grain"? Ummm... well this is just a start. The keys are checking for local (ie within the city radius) resources, and then the manipulation of the number of trade routes. Pretty sure that most of this (if not all) can be done in python.
This is a mix of the civ4 + civ3 ways in that if a city wants to it will consume resource locally and grow, or it can export those resources for extra gold.
black baron Mar 25, 2008, 01:18 AM drifting off subject but that would be cool
moopoo Mar 25, 2008, 01:38 AM Lol yeah i was thinking the same thing.
Again on a slightly different topic: I've been thinking about how to trade food/hammers between cities. I've come up with an idea that would be very difficult to code, and even harder to teach to the ai. Aren't they all :)
What about having a button, in the city screen, in the trade routes section, saying 'create route'. Here you could pick the city you're trading the food/hammers off to, and choose between food or hammers. these trade routes would cost commerce, based on city distance, which would also be taken into consideration.
Whatcha think?
primordial stew Mar 25, 2008, 03:09 AM 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.
black baron Mar 25, 2008, 06:19 PM 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)
moopoo Mar 26, 2008, 04:40 AM 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.
black baron Mar 27, 2008, 03:05 AM i figure it'll be like xml, confusing at first, then it seems like basic knowledge
moopoo Mar 29, 2008, 09:18 PM 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 :)
black baron Mar 29, 2008, 09:51 PM :lol: I'd say I'm about on par with you for the xml
moopoo Mar 29, 2008, 10:28 PM :D Is ANYONE interested in this python-experienced? or not even experienced, but has done a python mod before?
black baron Mar 29, 2008, 10:58 PM shvrhsvrhsvrhrhsvrshrhhsrhvrrvrvrvrvrvsh!(gibberis h 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!
moopoo Mar 30, 2008, 01:40 AM 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.
moopoo Mar 30, 2008, 01:42 AM 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? :)
black baron Mar 30, 2008, 06:50 PM 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:
moopoo Mar 31, 2008, 04:07 AM 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?
black baron Mar 31, 2008, 04:54 PM ok, yes and i think the mines should make at least 2 :commerce:
moopoo Mar 31, 2008, 07:23 PM awesome. starting it now. I'm first making changes to the XML.
black baron Apr 01, 2008, 07:22 PM 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?
moopoo Apr 02, 2008, 02:30 AM 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.
black baron Apr 02, 2008, 08:34 PM 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.
moopoo Apr 03, 2008, 03:17 AM 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
black baron Apr 03, 2008, 01:32 PM 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
moopoo Apr 03, 2008, 06:55 PM 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.
Grey Fox Apr 04, 2008, 12:57 PM This is basically what I did with my Interstellar Colonization mod before I canceled it. I basically added a new yield type which I called PopCap, which limited population limited. (It was reseted each turn unlike food)
And you could add it to everything which you can add the other yields to, terrain, improvements, buildings, etc.
So I could definitely program this. But maybe through something other than a new yieldtype. (you just cant get new yield types to show up on the map, but maybe that's not needed)
Can't say I got time atm though, got lots of other stuff to mod first. (But I might cram it in somewhere sometime cause this shouldn't take too long)
moopoo Apr 04, 2008, 09:52 PM Actually grey fox, i was hoping to code this one myself as my first ever project. thankyou for the support and interest tho :)
Grey Fox Apr 04, 2008, 10:35 PM Fair enough. I don't really have time anyways. Good luck! :)
(Remember, programming can be frustrating, but don't give up and you'll get your reward!)
moopoo Apr 06, 2008, 02:10 AM cheers. I'll really hafta keep that in the forefront of my mind :D :lol:
pdonettes Jun 17, 2008, 07:34 PM I know I'm late to this whole thing, but I really like original ideas and I wanted to help out with this one too. Why not (again) use the code from the space mod and have it that you can build housing on multiple spaces, but not OCCUPY the whole space. I mean, 3 cities can span a continent. That isn't realistic. The cities in Civ are HUGE if you think about it. I have thought for a while though that there needed to be something like this. either sky scrapers or something. Cottages and towns and all are great too, but realistically, you get what you said, food means people and money, ETC... So I would suggest that you just change the space code to say that you need to build certain structures to earn a growth in population. Housing on each area or whatever. Maybe I'm not making sense. oh well.
black baron Jun 18, 2008, 12:13 AM ... hmmm .... um .... o.k. the problem isn't that 3 cities can span a contenint its that maps are too small to emulate the earth thats my guess
pdonettes Jun 19, 2008, 03:42 AM well, yeah, but you have to work with what you have. Even on the blue marble map, which is supposed to be as good as it gets, the us can only handle a few cities,
moopoo Jun 19, 2008, 08:27 AM blue marble is purely aesthetic - it doesn't affect map size.
black baron Jun 20, 2008, 02:21 AM maybe while this mod is being made it can be combined with another mod that makes the map much, much, bigger.
kevinman4404 Apr 07, 2009, 01:48 AM Can you explain to me your line of thinking for the cottages etc. producing a surplus? I kind of think of it the other way around- farms allowing a higher population cap and towns/cottages etc only producing demand/food (and commerce and production). So although I agree with having them produce food to boost the city's demand to grow, I picture the farm boosting the population cap. Then again, I have heard this somewhere before, so please explain it to me again
and I definitely agree with being able to put quarries anywhere. It is ridiculous that civs should have to be severely limited because of an unlucky lack of stone, which really you can get almost anymore, even if not all stone is the same. There should be a high chance of discovery of rock or clay, and maybe a low chance of marble, though I think that tends to be around volcanoes, so maybe I should leave that out. Anyways this part obviously doesn't require its own mod
Kevin
moopoo Apr 10, 2009, 03:57 AM Farms produce food. With excess food and money produced for food and whatever, the population of a city increases. This extra population needs somewhere to live. Instead of making the city house all the population, the cottage and it's upgrade line would hold population.
Say you have built a city. This city can hold a maximum 4 population. If you have enough food coming in to support more, population is capped at 4 until you build a cottage. having a cottage in the city radius increases the population limit to 5. if that cottage upgrades to a hamlet, 6. So the cottage line increase pop limit in terms of city infrastructure.
Farms (and any other resource producing things, like mines/quarries) would produce money as well as their given resource (as in, food/hammers).
pully30 May 02, 2009, 06:07 PM one thing you could do is to use supply and demand so that when you produce food it also produces money but sticking with your idea about improving cottages is that as they start to produce more food they will start to not make as much money until they have improved their cottages but if they don't improve their cottages and just keep improveing their farming it will start to cost them money and could even cause unhappiness and then revolts
moopoo May 03, 2009, 09:33 AM yeah. that's pretty much the idea except without the game imposing changes upon you. to make the most out of the farms and mines, you need more cottages, or else they won't be used to their potential
|
|