C3X Districts

Probably. Can you give me a use case or two so I can understand the rationale?

I don't quite follow this one. This is probably a simple question but want to make sure I understand it correctly, maybe with an example.

That's a good idea. I'll try to implement that.
Sure.

For the first one, I'm interested in using these resource-generating districts to allow civs to choose which agricultural resources to produce where. I'd like to make it possible, for example, to built districts on grasslands that produce rice as a bonus resource or cotton as a luxury resource, but not if another resource is already on that grassland tile. I don't want to layer these district-generated resources on top of an existing horses resource, for instance, but rather let civs pick how their agricultural lands will specialize. Eventually I'd like to simulate the geographical spread of agricultural resources by requiring access to wheat to allow the construction of wheat-producing districts, for example, access to cattle to allow the construction of cattle-producing districts, etc.

For the second one, if a district produces the wheat resource, does that tile receive the extra food that the wheat generates? If the district produces the coal resource, does the tile receive the production bonus that coal generates? And if not, would there be a way to toggle it so that it does?

Thanks again!
 
Maybe something like this?

Grassland (1 food) - used for animal farms:
- animal farm building = small food bonus (+1 food) -> processing building = small food/money bonus (+1 food/money);
- with Cows/Pigs bonus (+3 food) -> farm = large food bonus (+3 food) -> processing building = large food/money bonus (+3 food/money);
- with goats/sheep bonus (+2 food) -> farm = medium production bonus (+2 food) -> processing building = medium food/money bonus (+2 food/money);
etc.

Grassland(1 food) - used for grain field:
- grain farm = small food bonus (+1 food) -> grain processing building = small food/money bonus (+1 food/money);
- with grain bonus (+ 3 food) -> agricultural farm = large bonus (+ 3 food) -> grain processing building = large bonus (+ 3 food/money);
etc.

Plains, Hills etc. Various resources/bonuses/luxuries etc.
...it's just an idea...

Edit:
Another idea would be that plains could be favorable for Agriculture Farms , Grassland for Animal Farms, hills for Vineyards and Fruit Farms etc. each with different food/money bonuses, for example, it would be better to have Animal Farms if you have grassland around or Agricultural Farms if you have plains around or orchards/vineyards if you have hills etc. or combined if you have several landforms, each with its own advantage!
... and if you build the Agriculture Farm on Grassland, there should be a penalty, for example -1 food, if you build the Animal Farm on plains, there should also be a penalty, and so on!

Thanks for your attention!
 
Last edited:
met this situation while playing today, I simply cannot understand why the AI doesn't bulid the holy site on the vacant grassland adjacent to the resources. :( Additionally, I've noticed that despite setting the city radius to 3 tiles, the AI does not appear to take this factor into account when bulid district.
... just one(two :)) question... In the future, maybe there will be a setting to not build over - resources, bonuses, etc.? If it will be done, can it be optional? Thanks!
Third, do custom districts that produce resources show the resource they produce on the map?

Alright gang, here's what I'm thinking. How about:
  • Allowing districts on tiles with resources
    • For the AI: if a given district type doesn't require a resource be on a tile, the AI is forbidden from ever building a district on it. Keeps things simple, though AI cities may suffer if they don't have enough tiles to otherwise build districts on.
    • For humans: no restriction, player can do whatever.
  • Showing resource icons
    • If district generates a new resource, the resource will be shown on the map over the district
    • If a district already has a resource, the new and old one will be shown side-by-side on the tile (no guarantees I can do this, but I'll take a look, may be simple). Regardless, hopefully this will be rare.
For the first one, I'm interested in using these resource-generating districts to allow civs to choose which agricultural resources to produce where. I'd like to make it possible, for example, to built districts on grasslands that produce rice as a bonus resource or cotton as a luxury resource, but not if another resource is already on that grassland tile. I don't want to layer these district-generated resources on top of an existing horses resource, for instance, but rather let civs pick how their agricultural lands will specialize. Eventually I'd like to simulate the geographical spread of agricultural resources by requiring access to wheat to allow the construction of wheat-producing districts, for example, access to cattle to allow the construction of cattle-producing districts, etc.
This makes sense and sounds really cool. What I need your help with thinking about is how the AI would decide to build these.

Basically, if (1) a district has dependent buildings, those are the hook that drives the AI to build the district. It'll do so only once, as after that it can make the dependent buildings.

For (2) districts that have no dependent buildings (in essence, special tile improvements), the logic in the new version I'm working on is quite dumb: each city tries to build each district type only once, when it meets the prereqs. I just haven't thought through this enough to be able to craft better logic. How would your case fit into this, and what should drive the AI?

(all are welcome to jump in here with ideas, of course :thumbsup: )

For the second one, if a district produces the wheat resource, does that tile receive the extra food that the wheat generates? If the district produces the coal resource, does the tile receive the production bonus that coal generates? And if not, would there be a way to toggle it so that it does?
I can probably implement something to accomplish this, but couldn't the food & production bonuses be added in directly via the district itself? e.g., the rice farm district always yields +4 food, etc., in addition to the rice resource itself.

The only downside I can see is that this would apply to all rice farm districts, as opposed to one on fertile grasslands yielding more food than one on some other tile. Is that how you're thinking about this?

WOW! It's beyond words...
Just getting started :thumbsup:
 
Alright gang, here's what I'm thinking. How about:
  • Allowing districts on tiles with resources
    • For the AI: if a given district type doesn't require a resource be on a tile, the AI is forbidden from ever building a district on it. Keeps things simple, though AI cities may suffer if they don't have enough tiles to otherwise build districts on.
    • For humans: no restriction, player can do whatever.
  • Showing resource icons
    • If district generates a new resource, the resource will be shown on the map over the district
    • If a district already has a resource, the new and old one will be shown side-by-side on the tile (no guarantees I can do this, but I'll take a look, may be simple). Regardless, hopefully this will be rare.

This makes sense and sounds really cool. What I need your help with thinking about is how the AI would decide to build these.

Basically, if (1) a district has dependent buildings, those are the hook that drives the AI to build the district. It'll do so only once, as after that it can make the dependent buildings.

For (2) districts that have no dependent buildings (in essence, special tile improvements), the logic in the new version I'm working on is quite dumb: each city tries to build each district type only once, when it meets the prereqs. I just haven't thought through this enough to be able to craft better logic. How would your case fit into this, and what should drive the AI?

(all are welcome to jump in here with ideas, of course :thumbsup: )


I can probably implement something to accomplish this, but couldn't the food & production bonuses be added in directly via the district itself? e.g., the rice farm district always yields +4 food, etc., in addition to the rice resource itself.

The only downside I can see is that this would apply to all rice farm districts, as opposed to one on fertile grasslands yielding more food than one on some other tile. Is that how you're thinking about this?


Just getting started :thumbsup:
Those approaches to the AI sound reasonable, and yes, it makes sense to add the resource bonus via the district itself. And I'm comfortable with Rice or Wheat or whatever providing the same bonus everywhere, with the tile's fertility being expressed in the terrain type's base food production.

And since these district types mainly exist to provide bonuses, would it make sense or be possible to just have the AI use something similar to the script that tells them where to build roads, mines, and irrigation?

A few more questions:

Do districts replace irrigation and mines? Can they be made to require irrigation or mines?

And can bonus resources be used as district requirements, or only strat resources and luxuries?
 
Those approaches to the AI sound reasonable, and yes, it makes sense to add the resource bonus via the district itself. And I'm comfortable with Rice or Wheat or whatever providing the same bonus everywhere, with the tile's fertility being expressed in the terrain type's base food production.
Great.
And since these district types mainly exist to provide bonuses, would it make sense or be possible to just have the AI use something similar to the script that tells them where to build roads, mines, and irrigation?
That'd be nice, but districts are potentially more complicated, as there may be many more of them. If memory serves, for mines & irrigation, the AI looks at surrounding tiles, determines which may give the largest benefits, and does a check whether one or the other would have a larger yield. If equal, it does a coin toss.

In your scenario, this is complicated as there may be multiple district types it could build on a tile. Would you be ok with your districts basically replacing every single tile with irrigation/mines on it? Or how should the AI decide which is better? If none of these districts have dependent buildings and it's all about yields, I suppose we could just sum up potential yields for each district type and choose the largest one. But if the AI also needs to consider what resource types it doesn't have enough of, this would get trickier.

I'm wondering if it would be good to have an optional field, ai_build_strategy, in a district config. district would be the default, but maybe tile_improvement could be for this kind of situation.

Each AI city would, for all ai_build_strategy = tile_improvement districts it can build, look at each available tile and determine what would give the highest yields, with a boost for district types which generate resources the city doesn't already have.

Something like that? Let me know if this makes sense.

Do districts replace irrigation and mines? Can they be made to require irrigation or mines?
They replace them, yes. With a little elbow grease, yes, I can probably have them alternatively require those. Though the irrigation/mine would disappear when the district is built. Can you walk me through what you're thinking on this? (just curious)

This is how Park districts work (in new version), incidentally. They require a forest, and the forest technically disappears when the Park is built.

And can bonus resources be used as district requirements, or only strat resources and luxuries?
Yep, any and all. My code doesn't even distinguish them, currently.
 
Last edited:
Great.

That'd be nice, but districts are potentially more complicated, as there may be many more of them. If memory serves, for mines & irrigation, the AI looks at surrounding tiles, determines which may give the largest benefits, and does a check whether one or the other would have a larger yield. If equal, it does a coin toss.

In your scenario, this is complicated as there may be multiple district types it could build on a tile. Would you be ok with your districts basically replacing every single tile with irrigation/mines on it? Or how should the AI decide which is better? If none of these districts have dependent buildings and it's all about yields, I suppose we could just sum up potential yields for each district type and choose the largest one. But if the AI also needs to consider what resource types it doesn't have enough of, this would get trickier.

I'm wondering if it would be good to have an optional field, ai_build_strategy, in a district config. district would be the default, but maybe tile_improvement could be for this kind of situation.

Each AI city would, for all ai_build_strategy = tile_improvement districts it can build, look at each available tile and determine what would give the highest yields, with a boost for district types which generate resources the city doesn't already have.

Something like that? Let me know if this makes sense.


They replace them, yes. With a little elbow grease, yes, I can probably have them alternatively require those. Though the irrigation/mine would disappear when the district is built. Can you walk me through what you're thinking on this? (just curious)

This is how Park districts work (in new version), incidentally. They require a forest, and the forest technically disappears when the Park is built.


Yep, any and all. My code doesn't even distinguish them, currently.
I think it makes sense to have the AI calculate what would have the largest yield, as it does with mines and irrigation, and also compare these tiles' output to those with tiles and irrigation. It also makes sense to have a "tile_improvement" field to regulate AI strategy.

I was thinking of potentially making certain of these districts producing cereals like maize, wheat, or rice require irrigation to be built. But it would be a problem if it replaced all mines and irrigated tiles. Is there any way to make a district require irrigation and also allow irrigation in adjacent tiles, the way irrigation does now? That way if you built a farm (producing maize, wheat, rice, whatever) that was irrigated, it wouldn't cut the irrigation off.
 
I was thinking of potentially making certain of these districts producing cereals like maize, wheat, or rice require irrigation to be built. But it would be a problem if it replaced all mines and irrigated tiles. Is there any way to make a district require irrigation and also allow irrigation in adjacent tiles, the way irrigation does now? That way if you built a farm (producing maize, wheat, rice, whatever) that was irrigated, it wouldn't cut the irrigation off.
Ah, makes sense. I'll carve out an exception so that if buildable_on = mine or buildable_on = irrigation, those are technically left on the tile (I think this will work, but need to confirm). I'll prevent them from rendering, so you'll see the district drawn instead, but from the game's perspective irrigation should still be there, so chaining farms shouldn't be a problem.
 
Ah, makes sense. I'll carve out an exception so that if buildable_on = mine or buildable_on = irrigation, those are technically left on the tile (I think this will work, but need to confirm). I'll prevent them from rendering, so you'll see the district drawn instead, but from the game's perspective irrigation should still be there, so chaining farms shouldn't be a problem.
This is perfect, thank you! Later today I'll describe the whole system I'm envisioning. It'd be great to hear what you think.
 
This is perfect, thank you! Later today I'll describe the whole system I'm envisioning. It'd be great to hear what you think.
1) "Cereal crops" like wheat, maize, and rice are strategic resources that will be placed on suitable terrain when the world map is generated. Their districts (e.g., Wheat Fields, Corn Fields, Rice Paddies) must be placed on a specific terrain type and require irrigation as well as access to the relevant cereal crop strategic resource. They produce a high food bonus as well as the strategic resource itself. So for example, "Wheat Field" requires placement on Plains or Grassland, requires access to the "Wheat" strategic resource, produces 3 food, and generates another Wheat resource; "Rice Paddy" requires placement on Marsh or Grassland, requires access to the "Rice" strategic resource, produces 3 food, and generates another Rice resource. With this system, access to cereals should diffuse across the world as civs import them then begin creating their own supplies to export.
2) "Domesticated animals" like horses, cattle, and camels are also strategic resources that will be placed on suitable terrain when the world map is generated. Their districts (e.g., Horse Pasture, Cattle Pasture, Camel Pasture) must be placed on a specific terrain type and require access to the relevant farm animal strategic resource, but not irrigation. They produce a moderate food and other bonuses, as well as the strategic resource itself. So for example, "Cattle Pasture" requires placement on Plains or Grassland, requires access to the "Cattle" strategic resource, produces 2 food and 1 production, and generates another Cattle resource; "Camel Pasture" requires placement on Plains or Desert, requires access to the "Camels" strategic resource, produces 1 food and 2 trade, and generates another Camel resource. Access to domesticated animals should diffuse across the world in the same way that cereal crops do.
3) "Supplement crops" like potatoes and squash are strategic resources that will be placed on suitable terrain when the world map is generated. Their districts (e.g., Potato Farm) must be placed on a specific terrain type and require access to the relevant supplement crop strategic resource, but not irrigation. So for example, "Potato Farm" requires placement on Hills, requires access to the "Potatoes" strategic resource, produces 1 food, and generates another Potatoes resource. Supplement crops allow civs to farm more marginal lands without irrigation. Access to supplement crops should diffuse across the world in the same way that cereal crops and domesticated animals do.
4) "Luxury crops" like wine, cotton, and coffee are luxury resources that will be placed on suitable terrain when the world map is generated. Their districts (e.g., Vineyard, Cotton Field, Coffee Plantation) require access to the relevant luxury resource, and can only be built on tiles that include a specific bonus resource that stands in for good conditions for that luxury resource. So for example, a Hills tile might contain the bonus resource "Grows coffee," meaning that a civ can build a Coffee Plantation on it, assuming they have an existing supply of coffee, either domestic or imported. A neighboring Hills tile might contain the bonus resource "Grows wine," meaning that a civ can build a Vineyard on it, assuming they have an existing supply of wine, either domestic or imported. A nearby Grassland tile might contain the bonus resource "Grows cotton," meaning that a civ can build a Cotton Plantation on it, assuming they have an existing supply of cotton, either domestic or imported. In all cases, this would mean replacing existing agricultural districts (for example, two Potato Farms on the Hills tiles, and a Wheat Field on the Grassland).

This system will produce a few outcomes. Players will have to make choices about what agricultural resources to place where. Civs will start with access only to certain domesticated plants and animals, but these will gradually diffuse across the world as civs contact each other. As this diffusion takes place, civs will be able to increase their overall yields as new agricultural resources make new terrain types improveable (e.g., Potatoes will open up Hills, Rice will open up Marshes, etc.). Since domesticated animals won't require irrigation, two civ trajectories will emerge: more crop-dependent agricultural civs with access to fresh water in river valleys and near lakes, and more animal-dependent civs in arid terrain. Because cereal crops provide more food, crop-dependent civs will have bigger pops; because domesticated animals provide other bonuses, animal-dependent civs will compensate for lower pops with additional production and trade. Luxury resources will remain relatively localized in areas that are specifically suited to their cultivation, and these areas will be prizes in colonial competition.

Here are a few more stray thoughts that could expand this system:

5) Any or all of these districts could allow city improvements that amplify the bonus they provide. For example, "Cattle Pasture" could eventually allow "Industrial Slaughterhouse" once a tech like Electricity or Refrigeration is discovered, and this would produce an additional food bonus in the city via the C3X bonus resource generation system. The downside of this is that you could hypothetically build three cities around a single cattle pasture and get that same bonus in all three cities, but that strikes me as a design philosophy question, and different people could choose whether or not to implement this particular aspect.
5a) If there's any way you could make it so that certain improvements increase the food/prod/trade yield of specific districts in the city radius, that might solve the above problem. For example, an "Industrial Slaughterhouse" in one city would add 2 food to every "Cattle Pasture" in that city's radius. In this case, if a single Cattle Pasture was surrounded by three cities, it would only make sense for one of those cities to build an Industrial Slaughterhouse, because the relevant bonus would only apply once. The same could also be done for non-agricultural resources (Foundries for Iron, Refineries for Oil, etc.).
6) Non-agricultural resources could be altered to require districts to produce resources. For example, strategic resources like iron, coal, and oil could be replaced by bonus resources (e.g., Iron Ore, Coal Deposit, Crude Oil). A processing district that requires the presence of these bonus resources (Iron Mine, Coal Mine, Oil Field) would then need to be built to render them into a useable and tradeable form (Iron, Coal, Oil), and would provide an appropriate production and trade bonus.

Let me know if you have any thoughts or questions.
 
Last edited:
Later today I'll describe the whole system I'm envisioning.
Hello!
Just an opinion:
- should I understand that if a country has e.g. rice and exports it, then the importer can cultivate rice fields?
- when the "contract" ends, what happens to the rice fields, do they disappear?
- how do you export the surplus rice production - since you do not own the respective resource?
- if you no longer have the imported resource, does your rice export also fall, to a third party - assuming this kind of trade can be done?
- if rice can be cultivated in a swamp, are diseases caused by the swamp canceled?

Perhaps with such a wealth of resources that will significantly improve the lives of the population, there will be no need for any more armed confrontation, at least not for resources... :)

I propose something else (as I said in the previous post - 123) maybe somehow closer to your plan:
If you have a resource of Agriculture, Animals, Mining, etc., you can build a District Agriculture, District Domestic Animals, maybe Hunting District, District Mining, District Luxury, etc. but which can only be built on that specific resource, with a large bonus - which will increase anyway when you add irrigation and road/railway - and which allows you to build farms of the same type with the same resource, but only in the case of Agriculture/Domestic Animals, but with a bonus depending on the resource you have! Adjacent to be able to create a Processing Building for each resource, or maybe a General Processing Center, which would bring another bonus – or to build Bakeries, Dairies, Cheese/Butter/Yogurt Factory, Butchers, Sausages, Hamburgers etc, if someone wants – but it seems like the game has a limit on the number of buildings…
Maybe it would be beneficial to periodically upgrade these facilities, so that we take up less space… let's say Farm level 1-> 2 -> 3, Mine level 1-> 2 -> 3 etc.

Edit::
- Irrigation only for Agriculture.

Probably the maximum number of citizens in a city will also need to be unlocked… Maybe with the current District system, will need more Population/Production, more Food/Money and more Army to defend the districts too! It will probably be a bit harder for older PC Systems…


Thank you for your attention!
 
Last edited:
Hello!
Just an opinion:
- should I understand that if a country has e.g. rice and exports it, then the importer can cultivate rice fields?
- when the "contract" ends, what happens to the rice fields, do they disappear?
- how do you export the surplus rice production - since you do not own the respective resource?
- if you no longer have the imported resource, does your rice export also fall, to a third party - assuming this kind of trade can be done?
- if rice can be cultivated in a swamp, are diseases caused by the swamp canceled?

Perhaps with such a wealth of resources that will significantly improve the lives of the population, there will be no need for any more armed confrontation, at least not for resources... :)

I propose something else (as I said in the previous post - 123) maybe somehow closer to your plan:
If you have a resource of Agriculture, Animals, Mining, etc., you can build a District Agriculture, District Domestic Animals, maybe Hunting District, District Mining, District Luxury, etc. but which can only be built on that specific resource, with a large bonus - which will increase anyway when you add irrigation and road/railway - and which allows you to build farms of the same type with the same resource, but only in the case of Agriculture/Domestic Animals, but with a bonus depending on the resource you have! Adjacent to be able to create a Processing Building for each resource, or maybe a General Processing Center, which would bring another bonus – or to build Bakeries, Dairies, Cheese/Butter/Yogurt Factory, Butchers, Sausages, Hamburgers etc, if someone wants – but it seems like the game has a limit on the number of buildings…
Maybe it would be beneficial to periodically upgrade these facilities, so that we take up less space… let's say Farm level 1-> 2 -> 3, Mine level 1-> 2 -> 3 etc.

Probably the maximum number of citizens in a city will also need to be unlocked… Maybe with the current District system, will need more Population/Production, more Food/Money and more Army to defend the districts too! It will probably be a bit harder for older PC Systems…

Thank you for your attention!
I think a lot of approaches could work, but what I'm hoping is that by adding the functionality that I'm proposing, you could build a system where civs have more control over what resources their land produces, where resources can spread across the map, and where processing improvements can be built in a way that doesn't allow you to produce multiple processed resources from a single raw resource. What other modders decide to do with those capabilities would be up to them.

Thanks for hearing me out, instafluff.
 
This system will produce a few outcomes. Players will have to make choices about what agricultural resources to place where. Civs will start with access only to certain domesticated plants and animals, but these will gradually diffuse across the world as civs contact each other. As this diffusion takes place, civs will be able to increase their overall yields as new agricultural resources make new terrain types improveable (e.g., Potatoes will open up Hills, Rice will open up Marshes, etc.). Since domesticated animals won't require irrigation, two civ trajectories will emerge: more crop-dependent agricultural civs with access to fresh water in river valleys and near lakes, and more animal-dependent civs in arid terrain. Because cereal crops provide more food, crop-dependent civs will have bigger pops; because domesticated animals provide other bonuses, animal-dependent civs will compensate for lower pops with additional production and trade. Luxury resources will remain relatively localized in areas that are specifically suited to their cultivation, and these areas will be prizes in colonial competition.
This sounds amazing. I love it! Thanks for the detailed explanation; this makes sense to me and I think will be doable.

And so "Wheat", "Rice" and so on would be placed in a small number of places during map generation, and thus this system would hinge on a few civs having access to these as strategic resources without having to initially build "Wheat Field", etc., right?

5) Any or all of these districts could allow city improvements that amplify the bonus they provide. For example, "Cattle Pasture" could eventually allow "Industrial Slaughterhouse" once a tech like Electricity or Refrigeration is discovered, and this would produce an additional food bonus in the city via the C3X bonus resource generation system. The downside of this is that you could hypothetically build three cities around a single cattle pasture and get that same bonus in all three cities, but that strikes me as a design philosophy question, and different people could choose whether or not to implement this particular aspect.
Just to make sure I understand correctly, "Industrial Slaughterhouse" in this example is an improvement in a city, and would be dependent on a city having "Cattle Pasture" within its work radius. I'm a bit unclear on the downside in this case - do you mean it would be odd for all 3 cities to benefit from the "Cattle Pasture" district while they each individually need to build an "Industrial Slaughterhouse" to get the additional food benefit? Or something else? Sorry if I'm misunderstanding this.

5a) If there's any way you could make it so that certain improvements increase the food/prod/trade yield of specific districts in the city radius, that might solve the above problem. For example, an "Industrial Slaughterhouse" in one city would add 2 food to every "Cattle Pasture" in that city's radius. In this case, if a single Cattle Pasture was surrounded by three cities, it would only make sense for one of those cities to build an Industrial Slaughterhouse, because the relevant bonus would only apply once. The same could also be done for non-agricultural resources (Foundries for Iron, Refineries for Oil, etc.).
Right, yeah there are at least 2 ways we could approach this. One is that if city A builds "Industrial Slaughterhouse" and cities_with_mutual_district_receive_buildings = true, then cities B & C would also receive the building and all 3 could get the extra food from "Industrial Slaughterhouse" (if configured to receive the food from the building w/ C3X).

Alternatively, the extra food bonus could come from the district, rather than the improvement. I could update the district config for bonuses to be a bit more sophisticated and increase based on buildings present, like

Code:
#District
name           = Cattle Pasture
...
food_bonus     = 3, "Industrial Slaughterhouse": 2
...

...where 3 would be the base food bonus, and if any nearby city has an "Industrial Slaughterhouse", the district food_bonus would increase to 5 (+2; each <building>: <number> would signify an addition to the bonus if present).

Let me know which you'd prefer and if this makes sense.

6) Non-agricultural resources could be altered to require districts to produce resources. For example, strategic resources like iron, coal, and oil could be replaced by bonus resources (e.g., Iron Ore, Coal Deposit, Crude Oil). A processing district that requires the presence of these bonus resources (Iron Mine, Coal Mine, Oil Field) would then need to be built to render them into a useable and tradeable form (Iron, Coal, Oil), and would provide an appropriate production and trade bonus.
Definitely, I love this idea. Very intuitive.
 
Last edited:
And so "Wheat", "Rice" and so on would be placed in a small number of places during map generation, and thus this system would hinge on a few civs having access to these as strategic resources without having to initially build "Wheat Field", etc., right?
Yes exactly, they'd start out as strategic resources placed on the map as in a normal game, and these initial resources would allow the first civs to start building "Wheat Fields," "Rice Paddies," etc.

Just to make sure I understand correctly, "Industrial Slaughterhouse" in this example is an improvement in a city, and would be dependent on a city having "Cattle Pasture" within its work radius. I'm a bit unclear on the downside in this case - do you mean it would be odd for all 3 cities to benefit from the "Cattle Pasture" district while they each individually need to build an "Industrial Slaughterhouse" to get the additional food benefit? Or something else? Sorry if I'm misunderstanding this.

Right, yeah there are at least 2 ways we could approach this. One is that if city A builds "Industrial Slaughterhouse" and cities_with_mutual_district_receive_buildings = true, then cities B & C would also receive the building and all 3 could get the extra food from "Industrial Slaughterhouse" (if configured to receive the food from the building w/ C3X).

Alternatively, the extra food bonus could come from the district, rather than the improvement. I could update the district config for bonuses to be a bit more sophisticated and increase based on buildings present, like

Code:
#District
name           = Cattle Pasture
...
food_bonus     = 3, "Industrial Slaughterhouse": 2
...

...where 3 would be the base food bonus, and if any nearby city has an "Industrial Slaughterhouse", the district food_bonus would increase to 5 (+2; each <building>: <number> would signify an addition to the bonus if present).
Yes, I'm thinking of things like "Industrial Slaughterhouse" as city improvements.

But what I'd like to do (if possible) is ensure that only one "Industrial Slaughterhouse" can be built per "Cattle Pasture." Is there a way to do that, either by placing the bonus in the city C3X-style, or by placing it in the district, as you suggested?

If not, no worries, but I think including the kind of code you proposed to add bonuses to districts with city improvements would allow a lot of flexibility for myself and other modders.
 
But what I'd like to do (if possible) is ensure that only one "Industrial Slaughterhouse" can be built per "Cattle Pasture." Is there a way to do that, either by placing the bonus in the city C3X-style, or by placing it in the district, as you suggested?
Ok, cities_with_mutual_district_receive_buildings = true will effectively do this - not by explicitly enforcing it, but in most situations the buildings will be copied over from City A to Cities B & C with the same district, so result is the same. If you use this approach, placing the bonus in the city via "Industrial Slaughterhouse" and C3X config should work just fine.

Also though, at the district level, I just implemented the flexible bonus system I outlined above in dev and it seems to work just fine. I did this for all *_bonus district config fields (food, shield, gold, science, happiness, culture), and this includes support for specifying "extra" bonuses by tile type as well as buildings.

So you'll be able to configure something like, for example:

Code:
#District
...
food_bonus = 3, "Industrial Slaughterhouse": 2, grassland: 2, plains: 1

All "Cattle Pastures" would thus have a base food bonus of 3, and a Cattle Pasture with an Industrial Slaughterhouse in at least 1 city (+2) and on a grassland (+2) would have a total food bonus of 7 for all 3 cities with the Cattle Pasture in their work radius. Thus super flexible and what you'd need, hopefully. (the Industrial Slaughterhouse bonus would count only once; multiple cities having it built would have no effect)

You'll thus be able to use either as a mechanism to get the "Industrial Slaughterhouse" food bonus for all surrounding cities.

And thinking about this a bit more, maybe it's a good idea to use both, together, as cities_with_mutual_district_receive_buildings = true will prevent the AI from building duplicative buildings (and save the human player from seeing unnecessary ones), and using the district-based approach to actually provide the bonus would give you a lot of flexibility and probably would be easier to maintain, as you could define all relevant bonuses for "Cattle Pasture" in one place.
 
Last edited:
Ok, cities_with_mutual_district_receive_buildings = true will effectively do this - not by explicitly enforcing it, but in most situations the buildings will be copied over from City A to Cities B & C with the same district, so result is the same. If you use this approach, placing the bonus in the city via "Industrial Slaughterhouse" and C3X config should work just fine.

Also though, at the district level, I just implemented the flexible bonus system I outlined above in dev and it seems to work just fine. I did this for all *_bonus district config fields (food, shield, gold, science, happiness, culture), and this includes support for specifying "extra" bonuses by tile type as well as buildings.

So you'll be able to configure something like, for example:

Code:
#District
...
food_bonus = 3, "Industrial Slaughterhouse": 2, grassland: 2, plains: 1

All "Cattle Pastures" would thus have a base food bonus of 3, and a Cattle Pasture with an Industrial Slaughterhouse in at least 1 city (+2) and on a grassland (+2) would have a total food bonus of 7 for all 3 cities with the Cattle Pasture in their work radius. Thus super flexible and what you'd need, hopefully. (the Industrial Slaughterhouse bonus would count only once; multiple cities having it built would have no effect)

You'll thus be able to use either as a mechanism to get the "Industrial Slaughterhouse" food bonus for all surrounding cities.

And thinking about this a bit more, maybe it's a good idea to use both, together, as cities_with_mutual_district_receive_buildings = true will prevent the AI from building duplicative buildings (and save the human player from seeing unnecessary ones), and using the district-based approach to actually provide the bonus would give you a lot of flexibility and probably would be easier to maintain, as you could define all relevant bonuses for "Cattle Pasture" in one place.
This is great, I really appreciate you implementing all this, hopefully other people will find it useful too. I'll try to implement this just as soon as you release the next build, and will share the results as soon as I can. And if you decide to test out some designs of your own along these lines, I'll look forward to seeing what you come up with.
 
This is great, I really appreciate you implementing all this, hopefully other people will find it useful too. I'll try to implement this just as soon as you release the next build, and will share the results as soon as I can. And if you decide to test out some designs of your own along these lines, I'll look forward to seeing what you come up with.
My pleasure and that sounds good. Looking at how much value this may add in terms of flexibility for modders, it seems like a no-brainer. Thanks for outlining the use case.
 
Huh. Spot anything interesting? :think:

1768440379111.png
 
Very nice. Any way to limit canal and bridge length? Or are they both unlimited?
I was thinking of the same thing. In the normal game, if a city is built on a single tile surrounded by more than one body of water, it effectively is a canal. But in order to do that it would have to be in that exact same tile. Also, coastlines two or more tiles thick would not have the ability to have canals in the original game. The canal system is a great addon, but there probably should be a limit. As for bridges, this would not be possible in the original game, probably not even if sea cities were enables (but I doubt even that would work). Bridges would be a perfect addon for the game, as long as they are limited to one or two tiles.

By any chance does C3X have any support for sea cities (cities placed on sea tiles rather than land tiles)? In the original game, they can't even build naval units (tested it before).
 
Back
Top Bottom