Resource Refinement

Afforess

The White Wizard
Joined
Jul 31, 2007
Messages
12,239
Location
Austin, Texas
Resource Refinement

Sarkyn's Horse stud module inspired yet another idea. Cities should be able to refine the resources in the vicinity of their usable area (the cross-like section) to produce more. Especially since many resources that are valuable in Rise of Mankind are also rare. That way, if you have access to the only stone on the map, you can increase your stone production so you can trade it for other rare resources without losing access to it. This idea was made possible by the SDK changes in Shqype's Vicinity Mod.

Also note that this addon is only partially modular. It will overwrite the existing CvGameCore.dll.

For Modders:
Spoiler :

The SDK changes add the following lines the Civ4BuildingsInfo.xml file
Code:
<VicinityBonus>BONUS_XYZ</VicinityBonus>
This declares that Bonus XYZ is needed to construct the building
Code:
<PrereqVicinityBonuses>
<VicinityBonus>BONUS_XYZ</VicinityBonus>
<VicinityBonus>BONUS_YZX</VicinityBonus>
<VicinityBonus>BONUS_ZYX</VicinityBonus>
</PrereqVicinityBonuses>
This declares that Either Bonus XYZ, YZX OR ZYX is needed.

The SDK changes also add the following lines of code to the UnitInfos.xml file. I didn't use any of them, but will include an updated schema for them, in case others have ideas.

Code:
<VicinityBonus>BONUS_XYZ</VicinityBonus>
This declares that Bonus XYZ is needed to construct the building
Code:
<PrereqVicinityBonuses>
<VicinityBonus>BONUS_XYZ</VicinityBonus>
<VicinityBonus>BONUS_YZX</VicinityBonus>
<VicinityBonus>BONUS_ZYX</VicinityBonus>
</PrereqVicinityBonuses>
This declares that Either Bonus XYZ, YZX OR ZYX is needed.

They basically are the same code, but for units instead of buildings. That way, swordsman, theoritically could only be built in a city next to Iron. I don't use the modified UnitInfos code in this addon, but feel free to in yours. Just make sure to include the updated CvGameCore.dll I provide


These building are just like regular buildings, except that they can only be built if the required resource is in the city's vicinity.

New Buildings:

Bauxite Strip mine
  • Requires Bauxite in Vicinity
  • Produces 2 Bauxite Resource
  • +2 unhealthiness
  • +20% Maintenance
Coal Refinery
  • Requires Coal in Vicinity
  • Produces 2 Coal Resource
  • +2 unhealthiness
  • +20% Maintenance
Copper Pit Mine
  • Requires Copper in Vicinity
  • Produces 2 Copper Resource
  • +2 unhealthiness
  • +20% Maintenance
Iron Foundry
  • Requires Iron in Vicinity
  • Produces 2 Iron Resource
  • +2 unhealthiness
  • +20% Maintenance
Oil Refinery
  • Requires Oil in Vicinity
  • Produces 2 Oil Resource
  • +2 unhealthiness
  • +20% Maintenance
Stone Pit
  • Requires Stone in Vicinity
  • Produces 2 Stone Resource
  • +2 unhealthiness
  • +20% Maintenance
Uranium Purifier
  • Requires Uranium in Vicinity
  • Produces 2 Uranium Resource
  • +2 unhealthiness
  • +20% Maintenance
Marble Quarry
  • Requires Marble in Vicinity
  • Produces 2 Marble Resource
  • +2 unhealthiness
  • +20% Maintenance
Symeralds Factory
  • Requires Gems in Vicinity
  • Produces 1 Gems Resource
  • +1 unhealthiness
  • +30% Maintenance
Gold Purifier
  • Requires Gold in Vicinity
  • Produces 1 Gold Resource
  • +30% Maintenance
  • +2 Unhealthiness
Silver Processing Plant
  • Requires Silver in Vicinity
  • Produces 1 Silver Resource
  • +30% Maintenance
  • +2 Unhealthiness
Suger Cane Plantation
  • Requires Sugar in Vicinity
  • Produces 2 Sugar Resource
  • +30% Maintenance
  • +1 Unhappiness
Sulphur Distillery
  • Requires Sulphur in Vicinity
  • Produces 2 Sulpher Resource
  • +15% Maintenance
  • +3 Unhealthiness

Any other rare resources that should be included? Any other comments or suggestions?

Download Here
 
I guess I'm a bit nervous about allowing you to take one resource in a city's work radius and turn it into three or four. Maybe bring it back down to just adding a second instance of a given resource? I'm just seeing how this could potentially interact with things like corporations, and it can get pretty powerful very quickly.

Additionally, were you considering implementing these as one instance only national wonders, like the ironworks, or were these going to be normal buildings?
 
I guess I'm a bit nervous about allowing you to take one resource in a city's work radius and turn it into three or four. Maybe bring it back down to just adding a second instance of a given resource? I'm just seeing how this could potentially interact with things like corporations, and it can get pretty powerful very quickly.

I understand. I am only making buildings available for rarer resources. Common resources like corn or fish will not receive buildings, as I realize you could use these with corporations to your advantage. However, these buildings do come with some disadvantages, the health penalty, the increased costs , and the buildings will have a 100% conquer rate. Anyways, the more resources a corporation consumes, the more it costs, so I feel that it won't too detriment the game. The whole point of these was to make it so players could trade for/with the rare resources with other players/AI. If you haven't changed your bonus spawns basic resources like Stone will appear only once per continent or worse, on a small map, once per map.

Additionally, were you considering implementing these as one instance only national wonders, like the ironworks, or were these going to be normal buildings?

No, I did not want to use up more national wonder slots. They are regular buildings. However, their probably be only one (maybe two) cities that can build each one of these, so they will be as rare as national wonders.
 
To my thinking, this is an excellent idea.

There will be a balance to be found, of course. Maybe 2 resources, maybe 3. Maybe costs in other ways, as discussed (negative health is one, increased maintenance is another, unhappiness is another, pollution).

I like the core idea very much though, I'd use this.
 
Okay, I can understand these types of buildings being non-wonder, as you're already putting in a reasonable limiting factor of needing the resource present in the city already. The last concern, then is what happens if the improvement that provides the resource is destroyed? Does the building still provide the resource as normal? This would make razing improvements to cut off resource access during a war much less effective, as to truly cut off the resource from your opponent, you'd need to both remove the improvement, then cut off all routes to the city with the building in.
 
@Afforess, (spelling correct this time) I have been trying to get someone with SDK capabilities interested in adding this mod to RoM for awhile. Along with the resource affecting tech research mod which I see you are experimenting with.:goodjob:

@Nightguard, I can see a way of doing this in Python for any building that requires resources but it would further slow the game down and I wont be able to get to it until latter this year as I have made a breakthrough on bringing back the piracy stuff from Civ III and R&R which RoM is based on.
 
@Afforess, (spelling correct this time) I have been trying to get someone with SDK capabilities interested in adding this mod to RoM for awhile.

Completely self-taught SDK skills thus far. I only can thank Kael's DLL guides and others work. I haven't actually created anything, just expanded existing ideas.

Along with the resource affecting tech research mod which I see you are experimenting with.

I have great plans for that. A complete rewrite of the tech tree. I plan on making tech paths that encourage and discourage certain research paths. For example, researching several religious techs, all religious techs will be cheaper, but scientific techs will cost more. And Vice Versa. Also, similar ideas for defensive and offensive techs.
 
What I like about the effect of resources on tech research is that a civ with horses but no metals would naturally tend to study the horse related tech because they would be so cheap. Thus each civ could be really different :)
 
Trying it out , so far so good , seems like trade will liven up. Could you also include salt\coffee\incense\obsidian and maybe one of livestock (cow\sheep\pig) , maybe some water resource like crab\clam\shrimp\pearls ? Or just salt and incense :) , theres never enough of those. Well actually i would prefer to have one for each resource but the amount of building in the city bar..... probably too much clutter. Would be great if single building could double any resource in city vicinity but it doest seem like it would be possible with this code. Thx for the mod anyway ))


--------------
Small bug? (or could be me not handling it properly) on the city icons when they are grayed out under maintenance 20% text there is additional line - TXT_KEY_REQUIRES_VICINITY_BONUS , but when building icon is lit up it doesn't show up.
 
--------------
Small bug? (or could be me not handling it properly) on the city icons when they are grayed out under maintenance 20% text there is additional line - TXT_KEY_REQUIRES_VICINITY_BONUS , but when building icon is lit up it doesn't show up.

Good catch, It shouldn't affect gameplay; it's just that I forgot to include a text file. Silly me. I'll reupload in a second.
 
Could you also include salt\coffee\incense\obsidian and maybe one of livestock (cow\sheep\pig), maybe some water resource like crab\clam\shrimp\pearls ? Or just salt and incense :) , theres never enough of those.

I may add ones fro Salt and Incense. I originally planned to add an aquaculture plant, but limitations with the coding prevented it from working correctly. Also, I don't really want to add resource buildings for common resources.
 
I think this is a rather wonderful idea, however my only objection is the oil building. Since there is already a building that turns oil into petroleum that is needed to make units, this building would be rather redundant. On top of that, there's also the corporation that also turns rice, corn, etc. into petroleum. Plus the oil shortage that the US and China are bringing upon the earth, I think that it would rather make more sense if oil had a slightly higher chance of being used up.
 
I think this is a rather wonderful idea, however my only objection is the oil building. Since there is already a building that turns oil into petroleum that is needed to make units, this building would be rather redundant. On top of that, there's also the corporation that also turns rice, corn, etc. into petroleum. Plus the oil shortage that the US and China are bringing upon the earth, I think that it would rather make more sense if oil had a slightly higher chance of being used up.

After checking, I have to agree with you. In fact, I think there is already a building with the same name too. I'll remove it in the next version.
 
a building for add 1 salt and would be nice ... in some maps salt and incense are too rare
... but large amount of salt is a basic need for conserve meat.

about incense ,almost all religions and cults use aromatics . add a building that import some incense or add a new resource ( aromatic wood) that would work like incense.
 
about incense ,almost all religions and cults use aromatics . add a building that import some incense or add a new resource ( aromatic wood) that would work like incense.

Currently (2.71) the AI does not see any point in working incense. My Tea mod tried to fix that problem by making incense a optional requirement for bazars like pearls are, but it did not work completely. The AI now builds roads to incense but still does not work it. :( So a building which produced a resource like incense would probably not get built by the AI!
 
Currently (2.71) the AI does not see any point in working incense. My Tea mod tried to fix that problem by making incense a optional requirement for bazars like pearls are, but it did not work completely. The AI now builds roads to incense but still does not work it. :( So a building which produced a resource like incense would probably not get built by the AI!

I think the AI doesnt work incense because it is on dessert and therefore doesnt have either production or food. Try, for testing, giving it 1 production and 1 happiness
 
I think the AI doesnt work incense because it is on dessert and therefore doesnt have either production or food. Try, for testing, giving it 1 production and 1 happiness

In any other mod the AI does work it because it gives a +1 happiness whereas in RoM you only get benefit for the resource from buildings and the AI doesn't always "think" two steps ahead. RoM really needs a better AI ;)
 
so the easier way is give back +1 happy bonus to incense

and for geografic balance add aromatic wood (+1 happy)to appear in any forest terrais .
 
so the easier way is give back +1 happy bonus to incense

and for geografic balance add aromatic wood (+1 happy)to appear in any forest terrais .

But then you get back to the to much health/happiness problem. So you have to remove incense bonuses from all the religion buildings. However the AI will pay you more for them :)
 
Back
Top Bottom