Quantitative Resources

Well, since this is my first post: Greetings Everyone.

I have been carrying around this idea about 'Quantitative Resources' myself for quite a while now.
Luckily I found this thread before I tried modding this myself.
I have some C++ experience, so I would like to offer my help with this.

Some random ideas I had: (im not thinking about AI implementation yet)

- a resource market: one can sell his surplus resources to a local (early in the game) / global (late in the game) market. Everyone can bye from that market. the price is calculated by how many there is from that resource in the world and available on the market. So getting a monopoly on one resource and stockpiling it drives prices up.

-certain techs increase the amount of resources gatherd/used up per turn.

-buildings affect the consumption of resources. e.g. a forge gives bonus to production but uses up the iron faster. Or a market which gives +1 happiness for fur, ivory and so on also uses up these ressources faster.

-a tile improovement that gathers resources (e.g. a mine) can have workers attached to it. putting a worker to work in a mine gives more resources per turn. (max number of workers per improovement)

-i think its necessary to be able to control a city's access to individual resources. So when running short on a specific resource one can cut unimportant city's from that resource.

For me it just cant get complex enough, of course random events, spy missions and resolutions could have to do with this aswell.

Cheers, Ri-Hatz
 
Just found this thread and I have too thought of a system like Quantitative Resources. To strip it down:
Think Settlers 4. The whole goods tranformation process was pretty good. Add a local/global market system and add a new category of buildings in the city menu that given the right resources they make other goods (e.g steel factory, car factory, aeroplane factory,cloth factory... industry in general, or manufacture if we're in older times). Make all those tranformation units more agile. E.g a car factory can produce cars+tanks, a steel factory steel+ammunition...A local automated market isnt as hard as it sounds.

To make it a little more clear: You have iron in city A? Coal in city B? Good you can make steel (new kind of resource) in city C through a specific type of factory that you've build there. The factory consumes a little resources and produces another kind of good. For each good there is a market. In this market 2 variables determine the good's price: offer and demand. Demand is determined by your population in local market, and by your population+the other's nations population in global market. Offer is determined by your production. To make more realistic the whole system add a production cost variable for each good depending only on the resources available and the type of factory--resource exploitation facility. If the local or global price offered for the good doesn't surpass it then production reduces until prices rise enough to cover it. That production cost is added to the city's revenue.

The last step and very ambitious one -yea like the others weren't :)- is to enclose each good in one (or more if that is not hard enough) enterprise shells, each with a different name. If the economic system is communism, we have one "enterprise" called State.

The system that i just described is pretty much how real economy works. If we want to be even more realistic, we can add other details too, like prices of a certain factory are affected by the minimum distance of the resources the factory uses.

I dont even dare to think how much computer resources such gameplay would require. With my limited knowledge of Java, even more limited C and a little greater than zero Python I dont think I can help the project. As for now as I'm really excited, I'm going to make a naive Java implementation to see where it gets me (probably nowhere).

Have a nice day.
 
No rush man.. this looks like an awesome mod(comp??) to imlement in civ 4. if u guys are able to finish it.. civ would be a whole new experience.. i

s there a timeline for this project?
 
Noooo its not going to be completed .. as i feared ... man do you people need a motivational speech... i am more than prepared to give one.
 
Noooo its not going to be completed .. as i feared ... man do you people need a motivational speech... i am more than prepared to give one.

Hey, it couldn't hurt, and I'm interested to hear it. ;)
 
The real issue at this point is what to do about production chains... Stockpiles and resource prereqs are fairly easy to code, and I have had those done for about two months now, but creating a system that allows for multiple resource outputs and inputs is another matter entirely.

Say you have two buildings that use iron to produce two distinct resources. Each takes in 10 iron per turn, but you are only producing 12 iron per turn. One of them will have to be shut down when your stockpile hits zero, if only temporarily, but which one? Enabling the player to control it requires integration with a Python interface, not to mention AI coding so the game can know when to turn buildings off and on. The logic behind that is difficult to code.

I have been tempted to bypass the issue by avoiding multiple production chains that utilize the same resource altogether, but it's a non-trivial matter. Coal is used to make iron and steel as well as to produce power. Oil can be refined into fuel or used to power houses. Same thing with uranium. I've been hoping that the Colonization source code would shed some light here, so I've held off on venturing into that area for now. However, the basic QR system is already done.

Come to think of it, the original Colonization did not have multiple production chains, did it?
 
The real issue at this point is what to do about production chains... Stockpiles and resource prereqs are fairly easy to code, and I have had those done for about two months now, but creating a system that allows for multiple resource outputs and inputs is another matter entirely.

Say you have two buildings that use iron to produce two distinct resources. Each takes in 10 iron per turn, but you are only producing 12 iron per turn. One of them will have to be shut down when your stockpile hits zero, if only temporarily, but which one? Enabling the player to control it requires integration with a Python interface, not to mention AI coding so the game can know when to turn buildings off and on. The logic behind that is difficult to code.

I have been tempted to bypass the issue by avoiding multiple production chains that utilize the same resource altogether, but it's a non-trivial matter. Coal is used to make iron and steel as well as to produce power. Oil can be refined into fuel or used to power houses. Same thing with uranium. I've been hoping that the Colonization source code would shed some light here, so I've held off on venturing into that area for now. However, the basic QR system is already done.

Come to think of it, the original Colonization did not have multiple production chains, did it?

Pardon me if im ignorant... since i have no knowledge whatsoever of python sdk or xml but isnt it possible to
a) not allow construction of the building when insuffiencent supply of resources per tern is available
b)automatically divide the supply of rpt to building s that need it therfore reducing the yield of the end product
c) This might complicate the whole system but elaborate on it to improve.... introduce a grade b grade and c grade strategic resources - what i have in mind is iron... all will be added to the same iron stockpile.. however each yields a different amount of hammers - i.e a grade iron will add 4 production to a tile with a mine... b grade 2 production and c grade 1 production this will ensure the civ has a constant supply of abundant resources...

Depending on grade an iron mine could contribute different amounts of ipt to the stockpile i.e 10 per turn for a a grade and 4 for a C grade

Lower grade mines could deplete faster perhaps?


Everyone keep the ideas churning in... we need to help gaius octavius..
can someone start a thread to direct people to this slightly obscure location .. perhaps on ideas and suggstions and general forums... this would help attract more modders( do you need any more gaius) and more support for your project..

Good Luck o patrician... us plebs will give yer moral support
 
Pardon me if im ignorant... since i have no knowledge whatsoever of python sdk or xml but isnt it possible to
a) not allow construction of the building when insuffiencent supply of resources per tern is available
b)automatically divide the supply of rpt to building s that need it therfore reducing the yield of the end product

Indeed, it is. The trouble there is that it's not directly tied into a building's resource production - it only affects whether you can create the building. (I was referring to buildings that put out resources which you can't get from the terrain, like Hollywood does with Movies.) Let me use another concrete example.

Imagine there are two buildings, a forge and a factory. The forge takes in 1 iron and 1 coal per turn, and puts out 1 steel per turn. The factory also takes in 1 coal and 1 iron per turn, but it creates a different product (cars maybe - it doesn't matter). Therefore, in sum, you are using 2 coal and 2 iron per turn.

Now imagine you go to war and your enemy bombs all your coal mines. You manage to import one coal per turn from a neighbor, but that's all you can get. So you are now getting +1 coal per turn. That means you have a net loss of 1 coal per turn, since you're using 2. Once your stockpiles of coal run out, you're left with a problem: you only have enough per turn coal to run either the factory or the forge, but not both at the same time. Which one do you pick? Obviously, you pick whichever one is needed more to maintain your power - if you have lots of steel, you'd probably run the factory. If you have no steel, you'd probably run the forge. You could also alternate. So although you can't make any new factories or forges (due to the shortage), the ones that are already there will still be a problem.

This gets more complicated with every additional building and resource chain. We have to teach the AI to pick the more logical choice based on its current state. It also has to take into account the buildings and units that will soon become available with technologies, so it can begin stockpiling as needed.

c) This might complicate the whole system but elaborate on it to improve.... introduce a grade b grade and c grade strategic resources - what i have in mind is iron... all will be added to the same iron stockpile.. however each yields a different amount of hammers - i.e a grade iron will add 4 production to a tile with a mine... b grade 2 production and c grade 1 production this will ensure the civ has a constant supply of abundant resources...

Depending on grade an iron mine could contribute different amounts of ipt to the stockpile i.e 10 per turn for a a grade and 4 for a C grade

Lower grade mines could deplete faster perhaps?

Yes, this is a good idea. It's a long time in coming, but I've wanted to see it done also.


Everyone keep the ideas churning in... we need to help gaius octavius..
can someone start a thread to direct people to this slightly obscure location .. perhaps on ideas and suggstions and general forums... this would help attract more modders( do you need any more gaius) and more support for your project..

Good Luck o patrician... us plebs will give yer moral support

I got to admit, that last line made me laugh! :goodjob:
 
Two rather simple solutions pop to mind.

The easyest way, coding wise, would be to just go through a loop of the BuildingInfos and parse out the resourses as you go. When you no longer have resources to give, no more buildings get them.

A slightly more complex, and in my opinion slightly better, idea is to get a list of the buildings in a city that need resource X and randomly picking one and giving it its resources unitl no buildings or no resources are left. This would simulate the fact that governments don't hand out resources to the places they want them to go. They provide them and then the "market" or whatever other fluff disperses them.
 
Hey Gaius Octavius. I was wondering if you have put up the source for your QR project yet i want to learn how it works so i can add one QR to my game. (that and it would help me learn Cpp better)

Probably not much will come of it but i would like to try and learn.

If it is already on the site could you direct me to it, and if you haven't put it up could you possibly email me it?? pretty please??

I have the sdk all working but i am at a loss as were to begin. I am not to shabby w/ python either:p but I havn't a clue how Cpp and python work together.

my email is mikejep@gmail.com

thanks!
 
Well here is an idea (I should mention that I got this from the Space Invasion game at BigPoint.com, I just adapted it to civ). Why don't you make it so that 1 resource is broken down into sub units maybe 100. Now every building turns so many sub points into so may sub points of another kind, but it doesn't produce a resource until it has enough sub points to equal a complete resource. So if you did this it wouldn't stop production, it would just slow down. So using your example above, instead of 1 building shutting down both buildings would drop to 50% out put since you have 50% of the required resources. Now you could even allow players to set the percent of out put to give more flexibility. It doesn't entirely remove the AI programming if you use the counters but it's a little easier then trying to figure out which building they need more, instead you have to figure out how much of X resource they need a turn.
 
That adds more precision, but doesn't change the underlying problem. You still have to have lots of GUI code so the player can set priorities, and lots of AI code so the AI can set priorities.
 
So any progress?
Yes, sort of, though not necessarily here ;-).
I added a basic implementation for quantitative resources as part of the World of Civilization mod. As a first test case, I'll use this to add the possibility of making units require certain amounts of resources for training them.

Basic meaning exactly:
- Bonus resources can be limited or regenerative.
- If they're set as limited, they get assigned a random capacity value between a minimum and a maximum amount that can be set per bonus type.
- Both limited and regenerative resources produce a certain random quantity of output per turn, which also can be specified per bonus type.
- The output per turn is stock-piled into the city that works the plot having the resource.

Let's see what I can do from there...

Regards,
Fabian Aichele
 
Faichele has already started adding something to in WoC where you convert resources as well into another in a city. And hoping to add something for maintenance in a city. But not as yields like Colonization anyway as resources instead. But I don't everything specifically he is the SDK guy. They are going to be quantified though anyway.
 
cool johnny! I was looking into some code and figure it would be easy to implement but i don't have the SDK compilable write now.

I basically wanted to add the corporation feature that lets you produce x number of hammers etc per resource to buildings. Right now building only give x regardless of the number of resources you add. i also want the code to add it to specialists.

I have all the code lines in this thread:

http://forums.civfanatics.com/showthread.php?t=292564

it might be a nice touch for woC

thanks in adavnce.
 
Top Bottom