Requesting opinions and suggestions

RenaissanceFan

Warlord
Joined
Mar 15, 2011
Messages
125
EDIT: Added resource-specific builidng list, separated these from 1st tier buildings.
EDIT: Added unique buildings for China (Silk Farm) and France (Cafe).
EDIT: Changed Mill requirements.
EDIT: Added 3rd tier building list, added Restaurant.
EDIT: Bonus values reduced for balance.

This time, I'm working on a mod to boost (and, if possible, overhaul) the economy part of the gameplay. So far I had the following ideas for buildings, each one requiring at least one resource, and extra resources boost their potentials. See...

Resource-Specific Buildings:
All of these give a standard +1:c5gold: +1:c5happy:.

1) Dyer: requires Dyes;
2) Tannery: requires Furs;
3) Silk Weaver: requires Silk, has an extra +1:c5culture:;
4) Silk Farm: unique for China and India, replaces Silk Weaver and gives doubled bonuses.
5) Winery: requires Wine.

1st Tier Buildings:

1) Textile Mill: requires Cotton or Sheep, gives +1:c5gold: for each, Cotton gives +1:c5culture:;
2) Jewellery: requires Gems/Gold/Silver/Pearls, gives +3:c5gold: +2:c5happy:, +1:c5gold: for Silver, +1:c5gold: for Pearls. This is the "jewel" of the mod. OBS: needs to implement a resource distribution grid like in Civ4
3) Mill: requires Sugar or Wheat, gives +2:c5gold: with Sugar, +3:c5food: with Wheat and needs Windmill in city.

For this tier, I'd like to see what you think about the above and I need suggestions for buildings that use Ivory, Whales, Marble, Incense.

2nd Tier Buildings:

1)Bakery: requires Wheat, gives +2:c5food: +1:c5happy: and needs Mill in city;
2)Grocer: this one I'm importing from Civ4, requires Fish or Bananas, gives +1:c5food: +1:c5gold: from each, extra +1.5:c5gold: from having Bakery in city.

For this one, same as above.

3rd Tier Buildings:

1) Restaurant: needs Bakery in city, gives +2:c5gold: +3:c5happy: +3:c5culture:, plus +0.5:c5gold: each for Spices, Sugar, Wine, +1:c5food: each for Fish, Bananas, Cattle and Deer.
2) Cafe: unique for France, replaces Restaurant and gives all bonus above, plus an extra +1:c5gold: +2 :c5culture:, and employs 3 Chef specialists (special artist specialist).

What do you think about these?
 
I like the sound of more buildings!
 
Unfortunately, the biggest problem you're going to have is that you simply can't do a lot of that. (This is a common refrain in modding.)

For instance:
> You just can't do the +1 Happiness per Cotton/Sheep you described in the Textile Mill. You can't even do it in Lua, because the ChangeHappinessFromBuildings function is broken and the SetHappiness function resets at the end of each turn (and so is useless). Happiness is not a yield, and so can't be treated this way in general.

> You can't give 2 culture for having both resources present for a Textile Mill (or the 8 for the Jeweler). You can give 2 culture per resource and then subtract 2 from the total, but the game wouldn't know the difference between one cotton and one sheep versus two cotton. (Admittedly, this one can be done in Lua, but I wouldn't want to try, because it'd be kinda messy.)

> Negative happiness, like you describe in the Tannery, isn't possible at all. (Seriously, try it. You can't give a negative value for Happiness to a building. Okay, you CAN give the negative value, but it won't do anything beyond showing "Happiness +-1" in the UI. You can't do it in Lua either. Believe me, I've tried.)

> Happiness can't be tied to a specific technology like other yields can. Neither can culture. Again, it's because Happiness and Culture aren't actual Yields and so can't use the same tables that food, production, gold, or science can. Happiness and Culture are hard-coded into specific schema entries, so if you don't see an explicit field with the word "Happiness" in it, then it's not possible.

I can go on, but you get the idea. There are a lot of great ideas that people have that are just utterly impossible to do in the current modding environment. So unfortunately, you need to learn what is and isn't possible before getting your hopes up on any specific design.
 
You just can't do the +1 Happiness per Cotton/Sheep you described in the Textile Mill.

Then how does the Colloseum or Theatre give happiness? I meant the BUILDING giving happiness. I won't change any plot yields.

Happiness and Culture aren't actual Yields

Okay, Happiness may not be, but Culture is, seeing as the Great Artist's Landmark improvement adds 5:c5culture: to the plot's yield. When inside your borders and assigned a citizen, it works like a plot yield.
 
Then how does the Colloseum or Theatre give happiness? I meant the BUILDING giving happiness. I won't change any plot yields.

It's a flat amount. You get +3, +5, whatever for having that building. You can't tie it to the resources themselves, which is what your "+1 happiness for each" stated.

The closest you can come for Happiness is to make a series of buildings. The first building would require A OR B, and give a certain amount of Happiness, while the second building would require A AND B, and give an additional amount. (Or just have the first building require only A and the second only B. Either way works for the 2-resource case.)

The only table that allows you to really adjust the effects of a building beyond just boosting the resource tile yields is the Building_ResourceYieldModifiers table, which lets you adjust the Food/Production/Gold/Research output of a city if it has a specific resource nearby. So you could make a building that requires X or Y to be nearby, and if X is nearby the city gets +50% production and if Y is nearby it gets +50% gold. But it's a percentage, and you can't tie it to Happiness or Culture.

Okay, Happiness may not be, but Culture is, seeing as the Great Artist's Landmark improvement adds 5:c5culture: to the plot's yield.

No, it isn't. (Seriously, why argue this if you've never heavily modded Civ5? It's not like we don't know how this works.) There's a specific hard-set <Culture> entry in the Improvement table that handles that Improvement separately, just like there's a similar one in the Buildings table for Wonders and one in the Specialists table for the Artist. That's what I was trying to explain; Culture and Happiness both use premade entries in the XML tables, instead of using all the various adjustable Yield tables. And if the XML table in question doesn't have an explicit Happiness or Culture entry, you just can't do it (without Lua modification). In fact, a few of the tables that DO have an explicit Culture entry (like <SpecialistExtraCulture>, in the Buildings table) are horribly broken and should not be used.

Culture is not a yield, and so there are a lot of things you can't do with it in XML. For instance, you can't make a Wonder that has all specialists give +1 culture (analogous to the Statue of Liberty). You can't make a conversion process like Wealth or Research that converts spare production into Culture. You can't have the culture output of an improvement increase at a specific tech (like how Farms' food production increases at Civil Service and Fertilizer). You can't make a building that gives a Library-style "+1 culture per 2 population". You can't have a resource add Culture to a tile directly (you have to go through a Monastery-style building to do this). I could go on, but I think you get the idea.

Some of these Culture things can be done through straightforward Lua functions, and someone's already come up with a way to create a fake Yield that does nothing, and then check its amount at the end of each turn and award the appropriate amount of Culture, which allows you to use a lot of the Yield tables for culture if you're willing to put up with the drawbacks of that method. (For instance, Culture generated this way isn't multiplied by a Broadcast Tower, Hermitage, or Sistine Chapel, unless you check for those manually.) Happiness SHOULD be able to be done similarly, but as I said, BOTH Happiness-altering Lua functions are broken at present. There are a couple workarounds you can do involving temporary buildings, hidden policies, and such, but these don't work well at all.
 
Okay, I got your point. But, if I put the requirements for the Textile Mill to be both Cotton AND Sheep, and then make it give +1:c5culture: for each just like the monastery?

(Anyway, it would be easier to just ignore the Culture bonus... FOR NOW.)
 
But, if I put the requirements for the Textile Mill to be both Cotton AND Sheep, and then make it give +1:c5culture: for each just like the monastery?

Yes, you can do that, just copy the Monastery logic and edit as needed. (Again, note that the culture for that is handled through a special XML table, different than the one used for, say, the Mint.)

As long as you're willing to make some changes to your concepts then a lot of things are possible. For instance, the Happiness thing absolutely MUST be changed, but it can simply be a flat +1 or +2 happiness for the building itself. So your Textile Mill could require Cotton or Sheep, give +3 gold and +1 culture per Cotton or Sheep, and give +1 Happiness. But if a city had three Cotton deposits, it'd generate +9 gold and +3 culture.
(By the way, I'm hoping you're intending to complete rebalance the economy in your mod, because adding that much gold to common resources is HORRIBLY unbalancing to the existing game.)

Now, the Tannery and Jeweler would require some heavy modification because you're trying to do something much more complex in terms of Happiness. You just can't do anything close to what you've described.
 
Finding cotton and sheep at the same city might be a bit difficult in most situations. Maybe either/or (like the Mint) as you suggested Spatzimaus.
 
(By the way, I'm hoping you're intending to complete rebalance the economy in your mod, because adding that much gold to common resources is HORRIBLY unbalancing to the existing game.)

I was aware of this, but it's in development. Take a look at the changes now.

Finding cotton and sheep at the same city might be a bit difficult in most situations.

As for that, is there a way (by LUA, of course) to distribute a resource in City A to Cities B, C, D, ect. just like in Civ4?
 
As for that, is there a way (by LUA, of course) to distribute a resource in City A to Cities B, C, D, ect. just like in Civ4?

Naturally. :) Just check if City A has a resource then give it to cities B, C and D. However doing it this way would completely ignore trade routes. You could however go more in depth with it and do a full-map scan of roads/harbors for trade routes and distribute the resource that way since I think trade routes are not exposed to Lua. Even if they were Civ 5 trade routes are somewhat worthless since they only check if they're connected to the capitol.
 
You could however go more in depth with it and do a full-map scan of roads/harbors for trade routes and distribute the resource that way since I think trade routes are not exposed to Lua.

Could you give me a step-by-step example of how do I do that? I have no experience with LUA except for some failed experiments with copies of the DLCs' scenarios' LUA files.

By the way, anyone has ideas for buildings that use Ivory, Marble, Incense? I'm open to all suggestions.
 
Maybe Marble and Ivory could be used by a "Luxuries Dealer", since it's a common use, maybe an "Art Dealer" also.

Not sure about Incense, though building a Temple already requires it, I think.

I'd also like to have a choice of using up a resource from the empire (it seems you want to go that route), and just needing a nearby source to build it (which I would prefer). That way your whole Civ gets the benefits from having the resource connected, and the nearby city would get extra bonus from the buildings.
 
2) Icons in sizes 256, 128, 80, 64, 45, plus unit flags (size 32) for the two naval units I made, a galleon and a flotilla. The galleon should show some gold in its icon, since I'm trying to make a script for it so that it has a chance to award gold every time it sinks an enemy ship. (Help with this script would also be welcome.)

Thanks in advance.

Also pretty easy if you know the correct callbacks, which I don't know all of them. After creating a lua file and connecting it to the mod content, check for the event EndCombatSim - this triggers after any and every combat type including bombarding and nuking but I'm not sure if it triggers with cities or AI. Anywho, after this triggers just check the unit type that was attacking and if it's a galleon then set off a function that rolls a virtual dice to decide if the attacking player gets extra gold or not.
 
Could you give me a step-by-step example of how do I do that? I have no experience with LUA except for some failed experiments with copies of the DLCs' scenarios' LUA files.

By the way, anyone has ideas for buildings that use Ivory, Marble, Incense? I'm open to all suggestions.

Erm, I can't just make a tut on it since the checks necessary would be rather complicated going back and forth, checking surrounding tiles for roads and open water ways. Best thing you can do is spend some brain power in drawing out all the functions in pseudocode or a flow chart until you can figure out some type of loop you can use that will get all connected cities. Next would to be looking up the different callbacks necessary to do such a thing, finally would be coding out the Lua.
 
I like the idea of more specific bonuses from different resources, otherwise they could just be numbers. I like the Monastery and thinks that more building should work like it.

The Monastery gives +2 culture for whine and incense, one time for each of them, but not not more if you have two wines, why coudn't that work if you want to add a extra culture bonus for certain resources?

Code:
<Building_LocalResourceOrs>		
		<Row>
			<BuildingType>BUILDING_MONASTERY</BuildingType>
			<ResourceType>RESOURCE_INCENSE</ResourceType>
		</Row>
		<Row>
			<BuildingType>BUILDING_MONASTERY</BuildingType>
			<ResourceType>RESOURCE_WINE</ResourceType>
		</Row>
	
	</Building_LocalResourceOrs>
 
Back
Top Bottom