Local City Resources Speed Wonder and Building Production

LeeS

Imperator
Joined
Jul 23, 2013
Messages
7,241
Location
Illinois, USA
City Local Resources Speed Production of Wonders and Buildings


Steam Download Page | CivFanatics Download Page


Basic Mod Description
  1. Cities that have local improved resources enjoy a positive "production speed modifier" when constructing many buildings and wonders.
  2. Marble no longer works in the "standard" way as regards Wonders. Copper now increases the production speed of the Colossus, for example, but Marble does not.
  3. The big change is that Buildings now enjoy a production speed enhancement when certain resources are available "local" to the city.
    • Any Unique Replacement Building added to the game by another mod will automatically be included into and accounted for by the code this mod runs.
  4. Coal, Stone, Marble, Iron, Aluminum, Uranium, and Copper all have a building or wonder production-speed effect.
  5. For mod-makers, the mod is expandable and adaptable for all other mods that add buildings or wonders into the game, and for all resources that occur on the main game map. Within someone else's mod, an entry in a new game table will be all the "hook-up" necessary to enable this mod's effect for a custom world wonder mod or a mod that adds new building-classes to the game.
    • Any Unique Replacement Building that fits into one of the Building-Classes this mod is affecting will automatically be included into the code this mod runs.
    • Any Resource, whether Strategic, Luxury, or Bonus will work with this mod so long as the Resource appears on the game map.
  6. The mod does not affect the ability to trade Strategic or Luxury Resources. It just looks to see if the resources are local on the main map to the city.
  7. The mod makes the adjustment to city production speed by adding a 'dummy' building to the city when the proper conditions are met.
    • There is a dummy building for World and National Wonders.
    • There is a second dummy building for Regular Buildings.
    • Both the dummy buildings will show in the city view to make it easier for you to know when the city is recieving the production boost. Both dummy buildings are using the Palace Icon.
    • No one city can ever have more than one of these two types of dummy buildings at the same time. The mod automatically removes the dummy buildings that are incorrect for the city when turn processing occurs.

---------------------------------------------------------------------------------------------------------------------------------------
For Players of Mods

Spoiler Library Civilopedia :
  • Note that this images shows the Library as being purchasable with Faith. That is coming from another mod I had running at the same time I took the screen capture. This mod has no such effect on the Library
Spoiler Effect On Library Construction :
The Modifier Building is shown in the upper-right corner of the city view:
Spoiler :

Tooltip for the Dummy Modifier Building:
Spoiler :

Tooltip for the city yields box:
Spoiler :

Spoiler Great Library with Nearby Stone :


Spoiler Marble on Oxford University :
  • Note that these screencaptures came from a custom map I made where I added lots of resources so I could more easily check the performance of the mod
Before I used IGE to add Marble next to the city:



After I used IGE to add Marble next to the city, and I improved the tile with a Quarry:






The following table specifies the current effects of Iron, Coal, Stone, Marble, Aluminum, Uranium, and Copper on Buildings and Wonders when an improved copy of the resource is local to the city:
Spoiler :

Structure Type Resource Modifier
Alhambra World Wonder Marble 15
Angkor Wat World Wonder Marble 15
Aqueduct* Building Stone 15
Arsenal* Building Stone 10
Brandenburg Gate World Wonder Marble 15
Borobudur World Wonder Marble 10
Borobudur World Wonder Stone 10
Broadcast Tower* Building Iron 10
Broadcast Tower* Building Aluminum 10
Castle* Building Stone 10
Chichen Itza World Wonder Stone 15
Circus Maximus National Wonder Marble 10
Circus Maximus National Wonder Stone 10
Colosseum* Building Stone 15
Colossus World Wonder Copper 15
Courthouse* Building Marble 10
Cristo Redentor World Wonder Stone 15
(East India Company) National Wonder Marble 15
Eiffel Tower World Wonder Iron 15
Factory* Building Iron 10
Factory* Building Coal 10
Grand Temple National Wonder Marble 15
Great Library World Wonder Marble 10
Great Library World Wonder Stone 10
Great Lighthouse World Wonder Marble 10
Great Lighthouse World Wonder Stone 10
Great wall World Wonder Stone 15
Harbor* Building Stone 10
Hermitage National Wonder Marble 15
Heroic Epic National Wonder Marble 15
Himeji Castle World Wonder Stone 15
Hydro Plant* Building Copper 10
Hydro Plant* Building Aluminum 10
Kremlin World Wonder Stone 15
Leaning Tower World Wonder Marble 15
Library* Building Stone 10
Lighthouse* Building Stone 10
Louvre World Wonder Marble 15
Machu Pichu World Wonder Stone 15
Mausoleum of Halicarnassus World Wonder Marble 15
Military Base* Building Stone 10
Monument* Building Stone 10
National Treasury National Wonder Marble 15
Notre Dame World Wonder Marble 15
Nuclear Plant* Building Copper 10
Nuclear Plant* Building Uranium 10
Observatory* Building Iron 10
Observatory* Building Stone 10
Oracle World Wonder Marble 15
Oxford University National Wonder Marble 15
Pentagon World Wonder Stone 15
Petra World Wonder Stone 15
Public School* Building Stone 10
Pyramids World Wonder Marble 10
Pyramids World Wonder Stone 10
Red Fort World Wonder Stone 10
Sistene Chapel World Wonder Marble 15
Spaceship Factory* Building Copper 10
Spaceship Factory* Building Aluminum 10
Spaceship Factory* Building Iron 10
Stadium* Building Iron 10
Stadium* Building Stone 10
Statue of Zues World Wonder Marble 15
Stonehenge World Wonder Stone 15
Taj Mahal World Wonder Marble 15
Temples* Building Marble 10
Temple of Artemis World Wonder Marble 15
Uffizi World Wonder Marble 15
Universities* Building Marble 10​

* Buildings listed include all unique replacements as well as the default building listed.
  • Buildings or Wonders that have more than one Resource listed will recieve the modifier amounts for all different types of Resources listed if the city has improved tiles nearby containing at least one copy of each Resource-Type listed. But having multiple copies of the same Resource is not additive, so having six copies of Iron around a city will still only count once towards having nearby Iron available.

  • Multiple copies of Iron, for example, near the same city do not stack. A city only gets the Iron benefit from one copy of Iron.
  • Buildings or Wonders that have two or more resources listed as 'modifier' resources will get the designated modifier for each type of resource listed. So if a coastal city has an improved tile with Marble and an improved tile with Stone, the total modifier will be + 20 %. In naturally-occuring game-maps this set of conditions would not occur very often.
  • Feedback and suggestions are both welcome and desired.
  • Tooltips are adjusted for each building or wonder that is effected by this mod, telling you which resources and by how much a production modifier is made.
    • If another mod you have running is also writing to these same tooltips, it will be a coin-toss as to which mod's adjustments you wiull see in-game, but such a condition will not affect the operation of this mod in its game-effects in any way.
  • The mod requires BNW.

Known Issues With How The Mod Functions

  1. The method I am using to add modifiers to a city runs when a player hits the NEXT TURN button. But the nature of the Game's lua-system is such that this does not occur until after production amounts, gold amounts, etc., for a player have been updated.
    • So if you have (as example) Marble improved near your city and you select The Great Lighthouse for that city to produce, there will not be any modification for that turn. The game will update that city and add a wonder production modifier building in that city after you press NEXT TURN.
    • I have added code to address this issue and "fix" the lost production. I believe it is working properly, but I am not as yet 100% sure.
  2. The method I am using to determine whether a resource is improved and local to a city will only return "yes" for one city when the resource is in an 'overlap area' within the borders of two of your cities, and one of those cities is working the tile.
    • If neither city is working the tile, the code will return "yes" for both cities. Whether you choose to exploit this "feature" of the code is up to you.

AI Issues

  1. I have attempted to jack-up the value an AI will give to improving copies of Stone, Iron, etc., that are being used by the mod.
  2. I have increased the FLAVOR_PRODUCTION flavoring of these resources.
  3. I cannot however say with any certainty that this has resulted in any change in the AI behavior toward trying to prioritize improving resources local to the city.

-------------------------------------------------------------------------------------------------------------------------------
For Mod-Makers
New Game XML table definition:
Code:
<Table name="Resource_BuildingClassProductionModifiers">
	<Column name="ResourceType" type="text" reference="Resources(Type)"/>
	<Column name="BuildingClassType" type="text" reference="BuildingClasses(Type)"/>
	<Column name="BuildingProductionModifier" type="integer" default="0"/>
	<Column name="WonderProductionModifier" type="integer" default="0"/>
</Table>
Note that I have used BuildingClassType instead of BuildingType. This allows me to scan through the <Buildings> table at game load and throw all valid buildings from within a class into the mod's lua tables.

I have seperated columns for WonderProductionModifier and BuildingProductionModifier. You should use the appropriate column to define the production modifier amount. If you throw a WonderProductionModifier into the table for a "regular" building, the lua will stick your building into the "Wonders" table, and will add a dummy building that has a WonderProductionModifier to a city that is not constructing a wonder, and there will be no production enhancement effect.

Mods That Add Unique Buildings Within Existing Building-Classes

If you have a mod that adds a custom version of a Library, your custom Library-Class Building will automatically be included into the effects of this mod. So for the Building-Classes already active in this mod there is nothing another mod-author needs to do: it will all happen automatically if both mods are enabled by a player. If my understanding of how the game functions is correct, mod load order should not be a problem, since the lua will be running after the SQL and XML changes are made to the DataBase.

Mods That Add Entirely New Building-Classes

For those with a new BuildingClassType, you will need:
  1. a reference within ModBuddy's "Properties" > "Associations" tab to this mod
  2. a <Row> entry within the new <Resource_BuildingClassProductionModifiers> table, done either in XML or SQL. You should do this in a "sandboxed" file with no other code in it.
This will be true whether the mod is a World Wonder mod or a mod that adds new buildings like Smelteries or Cisterns.
 
placeholder
 

Attachments

  • BasicCIV5ManualCover.jpg
    BasicCIV5ManualCover.jpg
    123.5 KB · Views: 2,142
  • GreatLibraryModifiedMarrakesch.jpg
    GreatLibraryModifiedMarrakesch.jpg
    359.6 KB · Views: 2,048
  • GreatLibraryModifiedMarrakesch2.jpg
    GreatLibraryModifiedMarrakesch2.jpg
    350.3 KB · Views: 1,981
  • Library_Civilopedia.jpg
    Library_Civilopedia.jpg
    275.7 KB · Views: 1,984
  • LibraryModifiedMarrakesch.jpg
    LibraryModifiedMarrakesch.jpg
    347 KB · Views: 2,009
  • LibraryModifiedMarrakesch2.jpg
    LibraryModifiedMarrakesch2.jpg
    366.4 KB · Views: 1,964
  • LibraryModifiedMarrakesch3.jpg
    LibraryModifiedMarrakesch3.jpg
    360.4 KB · Views: 1,959
  • OxfordBefore.jpg
    OxfordBefore.jpg
    374.5 KB · Views: 2,026
  • Oxford_After1.jpg
    Oxford_After1.jpg
    377.9 KB · Views: 1,994
  • Oxford_After2.jpg
    Oxford_After2.jpg
    390.8 KB · Views: 1,969
Good job, but I didn't think you could just add new tables to the game data without modifying the dll?

On the actual content, I would probably go with a more flat bonus and nothing more than 15 % at max. +20 % to Stonehenge and Great Wall would make Stone starts way too good imo. - particularly since I don't think you've added a strategic balance element like the original game has with Marble?
 
My comliments LeeS, really good work and really good idea! :goodjob:

Let resources speed up buildings and wonders is a great gameplay addition, I will surely use it.

Thank you for sharing this, keep up the good work!
 
Good job, but I didn't think you could just add new tables to the game data without modifying the dll?
Nope. Only requires the addition of the new table either in XML or SQL. SQL is necessary as I understand it to alter an existing table by adding a new column, for example. I've added new columns to existing tables using SQL. Both my Knights Templar world wonder mod and my Civ-Appropriate Great General and Admiral Names mod use SQL to add an extra column to an existing table.

But you have to have a minimum of an LUA program to tell the game what to do with the data you import into the SQL-Database. Otherwise it will just be text living in the database but not actually doing anything.
On the actual content, I would probably go with a more flat bonus and nothing more than 15 % at max. +20 % to Stonehenge and Great Wall would make Stone starts way too good imo. - particularly since I don't think you've added a strategic balance element like the original game has with Marble?
I'm not sure my scheme of modifier amounts is "right" either. At this point I was more interested in getting the LUA + XML method for creating the gameplay effect to work, and then trying to get some folks to use it and then tell me what they all think needs to be adjusted.

It may be necessary for me to tweak the occurance of resources that the mod is using in order to re-balance the whole gameplay mechanic, but again I'm hoping to get a few people to play-through a game or two with the mod active in order to get better feedback. I always struggle with issues of balance, it seems. I can generally tell when something is way too crazy off the borders just by "reading the code" as it were, but fine-tuning is something I seem not very good at.
My comliments LeeS, really good work and really good idea! :goodjob:

Let resources speed up buildings and wonders is a great gameplay addition, I will surely use it.

Thank you for sharing this, keep up the good work!
THX !
 
Mod Updated to V6 on 24July2015.

Changes were only in the Help Tool-tips for Wonders to keep the Help portion of the wonder-splash from having an ugly text bleed-over outside the wonder splash "box".
 
Top Bottom