SDK Request - New building effects based on number of bonuses

Deliverator

Graphical Hackificator
Joined
Feb 12, 2008
Messages
4,813
Location
London, UK
With 1.5.1 david added a new XML tag PowerCommerceModifiers to buildings. This allows us to add percentage Commerce type changes to buildings based on whether or not the city the is connected to at least one instance of a resource. Currently this is used for a building that gives +25% Research with Thinking Machines.

This is cool, but I would like to add to the abilities of buildings in another way.
It would be brilliant if someone could mod the SDK to allow normal buildings to work in the same way as Corporation branches in vanilla, providing changes to Yield or Commerce types that scale with the number of resources you have connected.

For reference, Yield Types are:
Food (Water in this mod)
Production
Commerce

Commerce Types are:
Research
Culture
Gold
Espionage

Some examples of buildings that we could have with this change.

Water Shipper (Building) +2 water per Polar Ice consumed *
New Spice Building +1/2 Commerce/Gold per Spice consumed **
Guild Research Facility (Wonder) +3 Research per Spice consumed
Prescience Chamber (Wonder) +3 Espionage per Spice consumed

* At the moment having more than one Polar Ice resource offers no additional benefit.
I'd like the player who controls more than one Polar Ice to be rewarded, and monopolizing the pole to be a strategy for big cities.
** Ahriman posted some ideas (which I can't find) on boosting the Pro-Spice civic using such buildings.

I'd love to have a set of XML tags, say iYieldProducedPerBonus and iCommerceProducedPerBonus that allows us to very simply add buildings like this.

Considering, we are getting to a point where we can be adding UBs and Wonders, this change would really extend the scope of what is possible and make for much more interesting buildings in my opinion.

So, anyone up for making this change? Otherwise, I can request on the SDK/Python subforum.

The idea was also raised here in a thread on modding corporations, so I'm sure others would appreciate this modcomp:
http://forums.civfanatics.com/showthread.php?t=254584
 
I agree that this would be a *fantastic* change. I bet other mods would use it too. I know some Dwarves and Skaven that would like to have some affinity for gold/silver/gems and warpstone resources....
 
I agree this is a great idea. Let's discuss exactly how it should work. I don't think you want it to work the same way as corporations. Suppose city A has NA number of these resources in its BFC, city B has NB resources in its BFC, and you have NC connected resources inside cultural borders but outside any BFC. You might also have ND connected resources outside your cultural borders due to an improvement with the flag to allow building this.

The yield of a corporation in A is NA+NB+NC, and the yield of a corporation in B is also NA+NB+NC. (ND is ignored, probably because the modcomp developer forgot about corporations.) This double-counting leads to huge yields.

We could easily define that only city A should get the NA resources. The game provides a mechanic to select what happens if two city BFC overlap on a resource; only one city can work it. But, how to allocate the NC resources?
 
I think that trying to split up the NA, NB and NC resources would be very confusing.
Suppose that NA=3, NB=2 and NC=6.

The standard corp would give 11X bonuses.

If A only got NA + NC, then the city would have 11 resources in its box, but would only be getting bonuses based on 9 of them. This would be very confusing for players.

I see no problem with just using the standard corp effect: a bonus based on NA+NB+NC. The trick is just in choosing the X value appropriately.
So for example, a spice building could give +0.1 gold per spice resource; so if you have 30 spice resource it gives +3 gold.
The water shipper could give +1 water, and +1 water per polar ice resource.
The Guild research facility could give +1 beaker per spice resource, and the prescience chamber could give +2 espionage per spice resource.

A city already gets an advantage from resources in its BFC; it gets the tile yield bonuses.

I don't understand why you would want the local presence to matter separately from this for the corporation yields.

Also, if you want to give local advantages, you can do that directly based on the improvement on the bonus. For example, if you wanted spice to matter locally, you could give the building 1 free specialist for each harvester within the city BFC.

I think the issue we are likely to run into that is most problematic is that if resources are "consumed", what happens if you have multiple buildings that use the same resource.
With corporations, they are designed so that they compete with each other, so they can't be present in the same city.
We could have something similarly exclusive; you can only have 1 think per city that consumes spice, either your house spice HQ, the Landsraad religion shrine, a new spice building, or one of your new spice wonders.
 
Personally, I don't mind that it is based on NA+NB+NC. You can always tune the effect scaling accordingly, using fractional values 0.25, 0.5, etc.

Edit: I see Ahriman has just made the same point.

Also, something slightly different - I was thinking of a Tuek's Sietch / Smuggler's Hideout type wonder that gives a bonus based on the number of *different+ offworld bonuses (Slig, Caladanian Wine, etc) that are connected.
 
I see no problem with just using the standard corp effect: a bonus based on NA+NB+NC. The trick is just in choosing the X value appropriately.

Really? We just had this whole discussion about spreading the existing spice corp to multiple cities, and I thought you were against.

If A only got NA + NC, then the city would have 11 resources in its box, but would only be getting bonuses based on 9 of them. This would be very confusing for players.

One slightly more obvious way is to have each resource outside any BFC contribute to the one city it's closest to, and resolve ties by picking one randomly. The player would not control that, but at least if you have a total NA+NB+NC, you would be able to see that the right total income was happening.

We could have something similarly exclusive; you can only have 1 think per city that consumes spice, either your house spice HQ, the Landsraad religion shrine, a new spice building, or one of your new spice wonders.

That is an interesting idea. There is an XML tag that building 1 can require building 2 (eg, forbidden palace requires courthouse, etc). We could add an XML tag which prevents another building. So building 1 would prevent building 2 or 3.

One drawback is how to highlight this choice to the player; it would be easy to put into the pedia. But when the icon for building 2 is greyed out in the city window, the hover help would also need to say something specific like, "Prevented by Building 1".

Another drawback is that there is no way to destroy a building. So if you built the wrong one, or your goals change, or you capture a city with the wrong one, there would be no way to destroy it and put the one you did want. I guess this is like national wonders -- if you build one in a city, then decide later you want it in a different city, you are stuck.

It would certainly be easier to implement if all such buildings in a city got the benefit.
 
The thing that makes this quite different from spreading corporations is that there is no additional compound-able headquarters income or additional maintenance going on.

I support the exclusivity of these buildings via an XML tag - I think it would have to be a list of buildings that prevent construction though.

Another thing that would nice is if the list of resources powering the building was a list in the XML. This is also just like Corporations where Sid's Sushi is powered by Fish, Clam, Crab or Rice resources. That would be handy if we wanted to have a building powered by plantation crops say.
 
Really? We just had this whole discussion about spreading the existing spice corp to multiple cities, and I thought you were against.

Yes, I am strongly against having the existing spice corp spread to multiple cities. But the existing spice corp gives ~+5 commerce per spice resource. So spreading that that to multiple cities would give far too much income.

But we're not talking about spreading the corp; we could have a separate building in each city that added only +0.1 or +0.15 gold per spice resource, and counted every spice resource you controlled.

The design goal is to have:
a) Most of your spice income be invariant to the number of cities you control, and depend only on the number of spice resources you control
b) A small increase in spice income from the number of cities you control and the number of resources you control.

So we can get a) from the existing spice corp mechanic, and then b) from having a building that can be constructed in every city that gives say +0.15 gold per spice resource.
One slightly more obvious way is to have each resource outside any BFC contribute to the one city it's closest to, and resolve ties by picking one randomly. The player would not control that, but at least if you have a total NA+NB+NC, you would be able to see that the right total income was happening.

This still seems confusing to me. If every spice resource can only be used once, in a single city, then you may as well just stick with the existing spice hq.
In my design, every spice resource can be used once *per city*.
Now, that use may be very valuable (from your house spice corp, or from the landsraad shrine, or wonders) or it may be of minor value (from a building contructible in every city).

Another drawback is that there is no way to destroy a building. So if you built the wrong one, or your goals change, or you capture a city with the wrong one, there would be no way to destroy it and put the one you did want. I guess this is like national wonders -- if you build one in a city, then decide later you want it in a different city, you are stuck.

I don't see this as a major problem.
Possibly we could manage with a spice building coexisting with ONE of [the house spice corp, or the shrine, or the research booster or the espionage booster].
You could also have the buildings be destroyed on city capture.
 
If every spice resource can only be used once, in a single city, then you may as well just stick with the existing spice hq.

Good point. But, if every city can use every resource, then the benefit from this grows exponentially (N^2) during the game. In the early game you have say one city and one resource, so you get one benefit total. In the mid game if you have 5 cities and 5 resources, you get a 25x larger benefit. In the late game with 10 cities and 20 resources, now you get 200x the benefit, 8x what you had in the midgame. It is hard to balance this. Of course you can make the constant a tiny number, but then it isn't even visible in the early/mid game.

Possibly we could manage with a spice building coexisting with ONE of [the house spice corp, or the shrine, or the research booster or the espionage booster].
You could also have the buildings be destroyed on city capture.

Managing "any two out of three" is even harder to show in the help and have the player understand.
 
But, if every city can use every resource, then the benefit from this grows exponentially (N^2) during the game.

This is why we have two mechanics, my a) and b) above, not 1.
The spice corp spread expands linearly as you increase spice resources, and is invariant to the number of cities you have.

The spice building expands exponentially as you say, but it isn't available until the midgame, and isn't worth very much until you have a decent number of spice resources, and still has a hammer cost for each extra city you wish to build it in.

And in the midgame territorial expansion (and thus new cities and new spice) tends to slow anyway.

So I think this could be balanced. For example: +1 gold, and +0.15 gold per spice resource, and 200 hammer building cost, and requires off-world trade tech.

The game is built around a number of exponential growth factors anyway, like all the +% buildings.

Managing "any two out of three" is even harder to show in the help and have the player understand.

Not what I meant. I meant that the spice building would be unrestricted, you could have it anywhere, and then one of the others.
 
Another problem with assigning bonuses so that they 'belong' to a particular city is what to do about bonuses obtained via trade. I think these should certainly count towards the effect like the do with corporations, but which city would you assign them to? I think it may be simpler to just go with the total number of resources connected approach.
 
Good point. This means that a typical result will be to see this bonus grow by a factor of 200 during the game (1 city 1 resource => 10 cities 20 resources). So the constant had better be tiny. So the effect will be unnoticeable in the early game.
 
So the constant had better be tiny. So the effect will be unnoticeable in the early game.

Agreed. 20 spice resources*0.15 = +3 gold per city. This is much less than a market or bank building gives, though the bonus stacks with them.
 
It looks like he's trying to expand the realm of what bonuses you can give with particular resources, rather than give benefits that depend on the *number* of resources that you have.
 
Bumping this idea so that it doesn't get buried.
 
my 5 cents - i like Deliverator's idea very much
 
i like it :D

especially this:

I agree that this would be a *fantastic* change. I bet other mods would use it too. I know some Dwarves and Skaven that would like to have some affinity for gold/silver/gems and warpstone resources....
 
We will definitely have a use for this in Warhammer, so hopefully this change will be easily transferrable once coded, or at least we could make a desperate play for assistance in tying it into our Warhammer sdk.

We plan for the Ogre faction to have a building which gives +0.5 food for each extra cow, sheep, pig, deer and horse resource, and many of the Ogre units will be expensive but will build with food. Eternal gluttons...
 
Back
Top Bottom