Quantitative Resources

Joined
Jul 5, 2004
Messages
23,562
Location
Canberra, Australia
This is a big project requiring the effort of many modders so don't expect it all at once.

I intend to release it as a modmod to start with if that is possible. Then after sufficient testing a decision on its inclusion in C2C can happen.

Platyping has written a Manufactured Resources mod. This is a great basis from which to build a C2C quantitative resource system. His mod
- uses a new resource type consumables which can't be traded.
- for each map resource you can define a conversion rate to the consumable resource
- each turn for each improved and connected map resource the number of consumable resources are added to the capital city
- every time you build a unit unit the required amount of consumable resources are removed from the capital. If you don't have enough resources the unit will be delayed and you can't queue any more. (It is a bit more complicated but that is the basics.)
- consumable resources can't be traded. Which means that they don't show up in the resource box of the city window among other things.​

Some problems with this as far as C2C is concerned
1) this is a national system and all consumables are available anywhere in the nation. C2C needs both local and national stores; local for early in the game and national for when transport allows the goods to be moved quickly between cities. I think this is fairly simple to implement with reservations.
- how do we know which city gets the resources
- what about those resources outside the work area of a city​

2) C2C has buildings that convert one resource to another. This would still work. We may even find it useful to change some of the current manufactured resources into these consumables.

3) how will this fit with the Equipment System we have been talking about?


More to come but I really need some coffee - start further discussion without me:D
 
Why shouldn't these consumables be tradeable? You could buy 20 Copper so you can make 20 Spearmen and don't need to buy Copper and wait that each turn a new consumeable copper appears from the copper you import... (Ok this is a bit different because we have copper ore, ingot and wares, but it works equally when you change all "copper" to "horse".

Will every map resource have a value itself? So that Iron Deposites can spawn with either a fix values of ore (iE 5424, 65439, 432, 32494...) or a certain size (small = 1.000, medium = 15.000, large = 50.000)? Deer for example could have that too and add +5 every turn so when you over hunt it, it will die out.

Can you change the production with the type of improvement? So a mine produces 1, a Shaft Mine 2, a Modern Mine 4.... And maybe Techs as well?

When you make it so that consumables are tracked city by city, will this work excactly the same as it is now with trade routes or can we change it a bit so that your mine only produces Iron in your 3 nearest cities?

Can consumption of goods be linked to city size?

Can units consume goods? If so, we could have military supply buildings that gives - %:food: in the city but makes X Food Supply goods for your armies every turn.

Can units store goods? This would be a cool feature in the beginning: Even without a route you can transport your Iron from a Mine to a city with a Trade Caravan. Later, with Paved Roads it will be transported automatically, so you don't have that annying micro management when you have too many cities. But in the early game it would be fun!
 
@DH

So to fit the system within a quantatives system should the "good" producing buildings work like this?

Huts (Prehistoric/Ancient/Classical) = 1 Product
Workshops (Medieval/Renaissance) = 2 Products
Factories (Industrial/Modern) = 3 Products

Or some other increasing values such as 1:5:10 or 1:10:100, etc.
 
Why shouldn't these consumables be tradeable? You could buy 20 Copper so you can make 20 Spearmen and don't need to buy Copper and wait that each turn a new consumeable copper appears from the copper you import... (Ok this is a bit different because we have copper ore, ingot and wares, but it works equally when you change all "copper" to "horse".

Adding code to allow trade would probably take a year of effort.

Will every map resource have a value itself? So that Iron Deposites can spawn with either a fix values of ore (iE 5424, 65439, 432, 32494...) or a certain size (small = 1.000, medium = 15.000, large = 50.000)? Deer for example could have that too and add +5 every turn so when you over hunt it, it will die out.

No. Again this would require a lot of effort and currently can't be done in Python - at least not until we find out why Event Signs are not working and fix it. They are stored in the same area that other Python is stored and they are getting lost somehow.

Can you change the production with the type of improvement? So a mine produces 1, a Shaft Mine 2, a Modern Mine 4.... And maybe Techs as well?

Not in the original but I would expect we would want that in C2C.

When you make it so that consumables are tracked city by city, will this work excactly the same as it is now with trade routes or can we change it a bit so that your mine only produces Iron in your 3 nearest cities?

No.

Firstly there is what to do about mines etc which are not being worked or outside the workable area. The original just says they produce as much as those being worked and it goes into the national store.

If we have local then only the city working the plot will get the resources. Not sure where the others will go. The national store is just the store in the capital. When you get the ability to transport the particular good all the local stores will be moved to the capital.

Can consumption of goods be linked to city size?

No, but if we are going to add buildings that make consumable resources from other resources then I don't see why we can't have buildings that consume resources and produce nothing. The problem is what order do things happen in.

Can units consume goods? If so, we could have military supply buildings that gives - %:food: in the city but makes X Food Supply goods for your armies every turn.

No. Only when built.

Can units store goods? This would be a cool feature in the beginning: Even without a route you can transport your Iron from a Mine to a city with a Trade Caravan. Later, with Paved Roads it will be transported automatically, so you don't have that annying micro management when you have too many cities. But in the early game it would be fun!

This would be possible but teaching the AI would be a problem. Lets face it we have had food merchants available for quite awhile but not the ai to use them.

@DH

So to fit the system within a quantatives system should the "good" producing buildings work like this?

Huts (Prehistoric/Ancient/Classical) = 1 Product
Workshops (Medieval/Renaissance) = 2 Products
Factories (Industrial/Modern) = 3 Products

Or some other increasing values such as 1:5:10 or 1:10:100, etc.

It will probably take awhile to figure out what the balance is. If it is just units then 1:2:3 is probably fine but if we start having buildings like housing consume resources also then it may need to be 1:10:100.

It may just depend on the resource and its use. It may also depend on the resource tree. We may leave each herd and hunter building produce one carcass but have the butcher be able to turn 10 carcass into 150 raw meat and so on.

It will need to be discussed for each map resource that we want to do this with. Some we wont want to convert to this system others only partially.
 
This is a big project requiring the effort of many modders so don't expect it all at once.

I intend to release it as a modmod to start with if that is possible. Then after sufficient testing a decision on its inclusion in C2C can happen.

Platyping has written a Manufactured Resources mod. This is a great basis from which to build a C2C quantitative resource system. His mod
- uses a new resource type consumables which can't be traded.
- for each map resource you can define a conversion rate to the consumable resource
- each turn for each improved and connected map resource the number of consumable resources are added to the capital city
- every time you build a unit unit the required amount of consumable resources are removed from the capital. If you don't have enough resources the unit will be delayed and you can't queue any more. (It is a bit more complicated but that is the basics.)
- consumable resources can't be traded. Which means that they don't show up in the resource box of the city window among other things.​

Consumable resources are still resources.
They can be traded so long as you set them to be tradable via XML tags.
It is just that 99.999% you cannot trade them because BTS set it such that you cannot buy resources that you already have, unless there is a corporation making use of it.
 
Some time ago I have idea to link resources with National Unit limits. For example
- if you have 1 horse you can build only 10 horse archers.
- if you have 1 horse and 1 iron you can build 10 light cavalry units.
- if you have 2 horses you can build 20 horse
- if you have 2 horses and 1 iron you can build 20 horse archers or 10 horse archers and 10 light cavalry units.

Also:
- if you have 1 horse and 1 iron you can build 10 light cavalry units (need iron and horse) + 10 light swordsmans (need only iron)
 
I will comment more on this tomorrow. My initial thoughts on equipment though is that it certainly would have some benefits for the equipment system BUT I've got a lot of concerns and things I think we should consider into the final design and method by which it becomes implemented.

And... most importantly... are we ready for such a project right now? I'm looking at a list three miles long of projects I'd love to get to and many have been waiting for years for development. And a list nearly as long of things to fix. I certainly don't mind us drawing out plans at this point and giving consideration to how to best implement overall and I know we've talked about this before and had some general consensus that it was something we'd want to do but the enormity of it... whew.

A while back a similar mod concept was developed out to a fair degree by a newer programmer. I'll try to figure out which mod that was again and report it here. I THINK he may have made a lot of good headway on the situation in code terms already. And it may well be that Platyping's brilliance is a good 75% of what the project will call for in terms of setting things up at the core but I foresee an eventual need to incorporate much of these methods currently implemented in python into the dll so we have more ways to easily tag into and manipulate things there.

Anyhow... will discuss more soon.
 
Consumable resources are still resources.
They can be traded so long as you set them to be tradable via XML tags.
It is just that 99.999% you cannot trade them because BTS set it such that you cannot buy resources that you already have, unless there is a corporation making use of it.

Did you get this idea from some of the Colonization mods, RaR comes to mind 1st. And Ray Stuttgart (sp) is very protective of his coding.

JosEPh
 
This kind of idea is from dunno how many years ago, when people keep asking for consumable resources, and the only one that came close to completion died off in progress halfway.

Keldath requested for it, so I simply make a simple one.

P.S.
The last time when I have to study codes of others was way back when I started making wonders and traits :D
 
You Are a wunderkind! No doubt! And I personally am happy to see you still around the forum.

Which mod of keldath's was he going to use it in? Speaking of keldath I need to give him a Barsoom report.

JosEPh
 
No idea, it isn't in a complete format that he wanted.
The current system will always consume just one of each resource defined, while he wanted X resources for different units, say Swordsman requires 10 iron while ironclad requires 100 iron.

Not possible to do so without a hardcoded list using python callback, so I lazy to implement.
 
And... most importantly... are we ready for such a project right now?

As much as I like the concept my vote is no. There are so many other projects we have to work on and this just seems like it may break more than it adds at the moment. Ir would like to see more work on other projects like the Outbreak Disease system, Combat Mod (Moral/Equipment/Afflictions), Nomadic Start and the mother of them all Multimaps. Each of those are huge undretakings, not to all the smaller stuff people are working on.

In short its fine to discuss this but lets come back to this later after some more projects are finished.
 
I think we can start implementing it step by step starting from tile improvements. Example
Mine +1 resource
Shaft mine +2 resource
Modern Mine +3 resource

It will not break anything and will add some realism to tile improvements even when system will be not fully implemented
 
I think we can start implementing it step by step starting from tile improvements. Example
Mine +1 resource
Shaft mine +2 resource
Modern Mine +3 resource

It will not break anything and will add some realism to tile improvements even when system will be not fully implemented

It would greatly impact the corporation mechanism - VERY heavily. Furthermore, this cannot be done by mere xml alone and I've got too much else to concern myself with at the moment.
 
Some time ago I have idea to link resources with National Unit limits. For example
- if you have 1 horse you can build only 10 horse archers.
- if you have 1 horse and 1 iron you can build 10 light cavalry units.
- if you have 2 horses you can build 20 horse
- if you have 2 horses and 1 iron you can build 20 horse archers or 10 horse archers and 10 light cavalry units.

Also:
- if you have 1 horse and 1 iron you can build 10 light cavalry units (need iron and horse) + 10 light swordsmans (need only iron)
that is very Civ V and artificial to me:D. It is the same as the mine stopping production after you build the unit. in which case the yelds should go too.

I think we can start implementing it step by step starting from tile improvements. Example
Mine +1 resource
Shaft mine +2 resource
Modern Mine +3 resource

It will not break anything and will add some realism to tile improvements even when system will be not fully implemented

It would greatly impact the corporation mechanism - VERY heavily. Furthermore, this cannot be done by mere xml alone and I've got too much else to concern myself with at the moment.

The resource and the consumable resource are two different things. They need to be for it to work. Which means it has no effect on corporations. If corporations used the consumable resources you would not be able to build units.

Currently the improvement on the resource does not change the consumable yield. Also free bonuses from things like Horse Herd do not count. Only map bonuses with the correct improvement(s) and route on the plot count.

If we were going to use this we would need to look at one resource, probably a strategic one to start with, and then work through the consequences for that resource, any buildings and units. Then we would know if it was even workable in C2C.
 
OK, I think we are about ready to try this out but only as a proof of concept to start with.

First thing I need to do is to g through all the units and replace all
Code:
			<TrainCondition>
				<And>
					<Has>
						<GOMType>GOM_BONUS</GOMType>
						<ID>BONUS_XXXX</ID>
					</Has>
					<Has>
						<GOMType>GOM_BONUS</GOMType>
						<ID>BONUS_YYYY</ID>
					</Has>
				</And>
			</TrainCondition>
with
Code:
			<PrereqBonuses>
				<BonusType>BONUS_XXXX</BonusType>
				<BonusType>BONUS_YYYY</BonusType>
			</PrereqBonuses>
they are the same as far as I can tell but the pedia and python don't have access to the information in TrainCondition.

edit dang that is an OR condition not an AND condition.

Oh well doesn't look like we can do this since some of the resources eg horses which was the one I was going to start with are in the Bonus, some in the PrereqBonus and some in the TrainCondition :(

We need to be able to access bonuses from the TrainCondition for this to work. Or make new PrereqAndBonus with similar exposed functions to the Or ones.

Eventually we would need to look at these Bonus tags and the BonusProductionModifier tags. Changing them to use the quantity bonuses and having a number on how many are consumed.

edit 2 I may still ba able to fudge something since I will need to change the BONUS name to the consumable bonus name anyway. It just means using ForcedOverwrite, but then this was never going on the SVN anyway.
 
Interesting. If I wasn't so engaged in other projects I'd do more here to assist. And yeah, it's the OR aspect of that tag that forces use of the train condition in many cases. Sure, an AND tag could be made but then again if its for this purpose, it begs that an integer representing the amount of the bonus to be needed be implemented alongside the tag, which is a little more complex. Then that would also mean integers for the AND tag and for the initial prereqisite... now it becomes a true project on a major scale.

See what you can work out of course. But I do see potential 'issues' from what you've expressed so far.
 
Preliminary tests show it is working fine. It is counting all sources of horse.

I tried it with horses each horse bonus making a Warhorse every turn. Horse units cost one Warhorse to build. I only included war units in my test, ignoring tamed horses and healers.

edit I am thinking of setting it to
  • every 5 turns Mammoth bonus produces 1 Mammoth Mount bonus

  • every 4 turns Deer and Bison produce 1 Mount each

  • every 3 turns horses and camels produce 2 Mount each

  • Every 2 turns elephants produce 1 Mount each

  • Zebra, bear and giraffe don't have bonuses at the moment so will be ignored.

Remember these accumulate until used.

When I have it working I put up how to install, but it wont be going on the SVN as it is only a proof of concept.
 
What exactly is the warhorse counted as? A resource itself? Or something else?

They are sill bonuses. You get x per turn and they accumulate. When a unit is built one in removed from your current total. It uses the normal city bonus feature (python version) that we already use to add a bonus to a city when you build a building that provides the bonus. Currently they are BONUSCLASS_QUANTITY.

I think we need to better classify our bonuses. Currently they are all over the place. The class is used for determining importance in placing map resources and I think in trade also.

edit I think you should only get Bison etc it you have the wonder.

edit 2 It gives you the quantity bonus long before it should. It gives it from when you first get the map bonus which is earlier than when you should be able to start producing the quantity resource. Eg Horses become available at scavenging but I feel it is not right to produce the Horse (Quantity) until you have domesticated them.
 
Back
Top Bottom