Resource icon

C3X: EXE Mod including Bug Fixes, Stack Bombard, and Much More Release 24

Therefore, I wondered: is it possible to at least double this value? For example, from 512 to 1024 points.
If it's possible to increase the city limit at all, doubling it will not be a problem. In fact, if I can, I'll quadruple it to 2048 just to be sure. That should allow for more than enough cities without consuming much memory, which is the limiting factor. The table of city connection info requires 4 bytes for each pair of cities up to the limit, so a limit of 2048 would consume 4*2048^2 = 16.8 MB, which is insignificant with 3 GB available. But increasing the limit to something crazy like 10k cities would consume 400 MB.

By the way, the reason the game reserves 4 bytes = 32 bits per city pair is that it's reserving space for connection info for each civ potentially on the map. In other words, the game doesn't simply determine if each pair of cities is connected, it determines if they're connected through a route that's available to each civ in the game. The game evaluates city connections for each civ independently, which I think is one of the reasons it's so slow. It would be better if it could notice that two cities are connected by a route that's not obstructed by any units, because that's usually the case, and conclude that there's a route that's available to all civs in the game. Instead it rechecks for every one.
Ok I've got a weird bug with the new Buildings Prereqs for Units:
It's nice to see someone's putting this feature through its paces, too bad about the bug though. Thanks for reporting it. I thought I tested this for AI players but I'll have another look. Right off hand I have no idea what might be causing the bug, as far as I know the logic for which cities are allowed to build which units is the same for both the human and AI players.
Testing the 'Buildings Produce Resources' feature: found that if a building produces a resource that is not yet available, that building will not put the resource into your trade network until you research the corresponding technology for that resource. Works well so far.
I deliberately programmed it so that buildings won't generate a resource that is still hidden behind a technology requirement. I'm curious, is that how you expected/want it to work? Because I could change it if most modders would prefer that buildings can generate resources before they're revealed by tech. I recall that's what @Civinator preferred, at least at first, when we discussed this back when I was first working on it. I added the tech restriction because in all the examples I could think of, it made sense for a resource to be harvested/mined first before it could be generated artificially.
 
I deliberately programmed it so that buildings won't generate a resource that is still hidden behind a technology requirement. I'm curious, is that how you expected/want it to work? Because I could change it if most modders would prefer that buildings can generate resources before they're revealed by tech. I recall that's what @Civinator preferred, at least at first, when we discussed this back when I was first working on it. I added the tech restriction because in all the examples I could think of, it made sense for a resource to be harvested/mined first before it could be generated artificially.

This works for my purposes and I think it makes most logical sense this way. Though more optionality is always welcome, perhaps a toggle for the tech requirement.
 
I deliberately programmed it so that buildings won't generate a resource that is still hidden behind a technology requirement. I'm curious, is that how you expected/want it to work? Because I could change it if most modders would prefer that buildings can generate resources before they're revealed by tech. I recall that's what @Civinator preferred, at least at first, when we discussed this back when I was first working on it. I added the tech restriction because in all the examples I could think of, it made sense for a resource to be harvested/mined first before it could be generated artificially.
Yes, I would still strongly prefer that those buildings also can produce resources, that are still hidden behind a technology requirement, or to say it more directly, that never can be achieved by any player in normal ways, as this includes the present settings, too and therefore offers more options. With this setting a player can receive precious resources not being receivable otherwise. Per example a hydroplant could produce the resource electric energy, needed to produce other buildings and units in the territory of that civ and not available on the map for any player. Trading those "artificial resources" would only be possible if the other player has access to the technology that allows that resource, meaning an artificial resource that is connected to a tech that no player can receive (in CCM 2.50 tech Hidden Reserve) cannot be traded. With the setting I favor, the modder still can decide, if the new resource can be traded or not.

On the other side I also can live with the current conception, as I can set these "artificial resources" as resources only for sea terrain, so they cannot be connected otherwise to the trade net, but than these resources can be always traded if the other player has the technology for it and there will be a collision in concepts when it is possible to build "sea-workers", that are accepted by the AI.
 
Well, thirdly: a game on tiny maps, perhaps convenient for playing on the network. In fact, no one will play through the Internet or home network for weeks and months long. But if you play a single game, then huge maps are preferable, since they have where to turn around your "ambitions" or your AI opponents.
Personally i prefer not so huge maps even for single player games. More than 100x100 is just more effort for the same amount of fun. I could have twice the amount of fun for the same amount of effort. But of course this is highly subjective.

If it's possible to increase the city limit at all, doubling it will not be a problem. In fact, if I can, I'll quadruple it to 2048 just to be sure. That should allow for more than enough cities without consuming much memory, which is the limiting factor. The table of city connection info requires 4 bytes for each pair of cities up to the limit, so a limit of 2048 would consume 4*2048^2 = 16.8 MB, which is insignificant with 3 GB available. But increasing the limit to something crazy like 10k cities would consume 400 MB.
16 MB is in the range of modern CPU L3-Cache. So there is a good chance that it matters for performance. 1 MB for 512 as the limit should work well for most systems.
 
Yes, I would still strongly prefer that those buildings also can produce resources, that are still hidden behind a technology requirement, or to say it more directly, that never can be achieved by any player in normal ways, as this includes the present settings, too and therefore offers more options. With this setting a player can receive precious resources not being receivable otherwise. Per example a hydroplant could produce the resource electric energy, needed to produce other buildings and units in the territory of that civ and not available on the map for any player.
Couldn't you achieve the same thing by making those resources not appear on any terrain type?
 
Couldn't you achieve the same thing by making those resources not appear on any terrain type?
Yes, but with this setting the resource stays able for trade if it is connected to a normal tech. The question is what happens, if such an artificial resource is linked to a civspecific era-none tech. Even up to 31 civspecific buildings for producing up to 31 different resources in my eyes is a bad solution for resources, that per example symbolize pure functionality or some special products that are needing a special infrastructure. In the case of electric energy (and other forms of energy) one could argue, that in reality electric energy can be traded - but even in this case a special infrastructure is needed for such a trade and in C3C it can be traded without such a needed infrastructure.
 
Last edited:
@Meteor Man If you remove the building prereqs for those units, are they then listed twice as available build options for the AI? I think the issue is that the game is creating duplicate entries for some unit types in its internal list (I have no idea why, I only just discovered this) and then the mod only applies the restriction to the first entry. In R13 I'll change how the mod works so that it applies the building prereq to all units with the same name, which will include the duplicates and should solve your issue.
Yes, I would still strongly prefer that those buildings also can produce resources, that are still hidden behind a technology requirement, or to say it more directly, that never can be achieved by any player in normal ways, as this includes the present settings, too and therefore offers more options. With this setting a player can receive precious resources not being receivable otherwise. Per example a hydroplant could produce the resource electric energy, needed to produce other buildings and units in the territory of that civ and not available on the map for any player. Trading those "artificial resources" would only be possible if the other player has access to the technology that allows that resource, meaning an artificial resource that is connected to a tech that no player can receive (in CCM 2.50 tech Hidden Reserve) cannot be traded. With the setting I favor, the modder still can decide, if the new resource can be traded or not.
I didn't know you wanted to use the tech requirement to prevent trading of generated resources. It's not difficult to add an option to avoid the requirement so I'll go ahead and do that for R13. I could even do it on a per-resource basis, though I don't like how complicated the config file format is becoming.
 
I could even do it on a per-resource basis, though I don't like how complicated the config file format is becoming.
Flintlock, in my eyes this is not necessary.It is sufficient, if the resource produced by the building appears for the civ that owns that building, even if the tech that the resource is linked to, is not available for that civ (per example because the tech will only be researched in the future of the game or never) .
 
@Meteor Man If you remove the building prereqs for those units, are they then listed twice as available build options for the AI? I think the issue is that the game is creating duplicate entries for some unit types in its internal list (I have no idea why, I only just discovered this) and then the mod only applies the restriction to the first entry. In R13 I'll change how the mod works so that it applies the building prereq to all units with the same name, which will include the duplicates and should solve your issue.

Aha, I should have thought of this, that is a familiar bug that has been with me for years. That's likely the problem. :thumbsup:

Flintlock, in my eyes this is not necessary.It is sufficient, if the resource produced by the building appears for the civ that owns that building, even if the tech that the resource is linked to, is not available for that civ (per example because the tech will only be researched in the future of the game or never) .

I'll have to say that I prefer it the other way around - eg. I have a building 'Electronics Factory' available with the tech Electronics that produces Sonar upon researching the Sonar tech. So it would be good to have the option.

I am wondering if buildings can produce multiple resources? I have not tested this. If yes it would be great to be able to set this on a per-resource basis.
 
Last edited:
Flintlock, in my eyes this is not necessary.It is sufficient, if the resource produced by the building appears for the civ that owns that building, even if the tech that the resource is linked to, is not available for that civ (per example because the tech will only be researched in the future of the game or never) .
I'll have to say that I prefer it the other way around
I'm not surprised to see disagreement here since both ways are useful. With the tech requirement, you can design buildings that only start generating resources later once a tech is researched. Without the requirement, you can have buildings that give early access to resources that haven't appeared on the map yet, which is not so useful, but can also give access to untradeable resources with an unresearchable technology, which is useful. It's easy to implement this and make it optional per-resource, so I did just that. In R13 there will be a second setting "no-tech-req" that you can apply to resource generation, like "local". It causes the generation to happen even for players who haven't researched the tech that reveals the generated resource. Here's the new example in the README:
Code:
["Steel Mill": Steel, "Coal Liquefaction": local Oil, Supercollider: local no-tech-req Antimatter]



I am wondering if buildings can produce multiple resources?
They can, yes. You'd list the same building multiple times paired with different resources.
 
I hope this isn't too off topic. But is the resource in city radius requirement in the editor mean that the resources have to be connected to that city by roads? I'd like to make the offshore platform generate stock game oil if it has an "offshore oil" in its radius. This "offshore oil" shall be a strat res spawning water terrain.
 
But is the resource in city radius requirement in the editor mean that the resources have to be connected to that city by roads? I
Yes and no! If you have an instance of a resource within more than one BFC, only one of them needs to be connected to your trade net. Provided that the second city, with the unhooked resource, can still get that resource from the first city via your trade net, the unhooked resource will fulfill the "within radius" requirement to build the resource-requiring improvement in the second city as well.
I'd like to make the offshore platform generate stock game oil if it has an "offshore oil" in its radius. This "offshore oil" shall be a strat res spawning water terrain.
I tried exactly this once, to limit where Offshore Platforms could be built.

But this idea will only work if you also mod in a "Worker-boat" which can build a road from the town to the offshore oil -- because (as noted above) at least one instance of a resource must be connected to your trade-net, for that resource to be usable. And as @Civinator has previously noted, the AI does not know what to do with "Naval Worker units" (it disbands them), so this setup would only be usable by the human player(s).
 
Last edited:
Flintlock updated C3X with a new update entry:

Release 13

New in this version:
- AI two-city start
- Remove cap on turn limit
- Option to strengthen forbidden palace decorruption effect to match the palace's
- Option to allow military great leaders to hurry wonders
- Option to reduce AI research rate by half
- Resource generation from buildings can be set to ignore revealing tech
- Address some issues with text encoding
--- Includes fix for encoding error on Windows 8.1
- Apply building prereqs to all unit types with the same name
--- Fixes prereq...

Read the rest of this update entry...



Edit with some more info about what's new:
  • AI two-city start
    • In addition to their normal capitals, AIs will start the game with secondary capitals at random locations scattered around the map. The secondary capitals will immediately receive a free forbidden palace each. This feature works well with the forbidden palace decorruption strengthening, which makes the secondary capitals & surrounding areas as productive as the first. The AI's starting units will be split between the two capitals.
  • Remove cap on turn limit
    • The game turn limit can be set beyond 1000 turns, up to a new maximum of one million turns.
  • Option to strengthen forbidden palace decorruption effect to match the palace's
    • The way this works is that the game computes the corruption rate twice for each city. First normally with the capital in its actual location, and second, pretending as if the capital is located in the forbidden palace city. The final corruption rate for each city is the lower of the two rates. This makes it so that the forbidden palace acts as a "full" palace for purposes of reducing corruption.
Thanks again to @Vaughn for commissioning many of the features in this release.
 
Last edited:
Could there be a way to duplicate the "replace others with this flag" code for other improvements besides powerplants?
Probably. I can see where the game removes other flagged improvements from a city when a flagged improvement is added. I could, at least, modify how that works so improvements are only removed if they're both in some category specified in the config file. That would cover the basic case of building a flagged improvement removing another one, but to do a proper job I'd also have to modify the AI so it's aware of the categories. I don't know how difficult that would be. Also, I don't know how the replacement flag interacts with free improvements from wonders. That might require another modification somewhere.
 
Another improvement! Could there be a way to duplicate the "replace others with this flag" code for other improvements besides powerplants? It would be nice to have multiple of these lines for things like city fortifications.
The Flag can be used for any improvements: what you're looking for (and I heartily second) would be to have the ability to have multiple "Replaces ..." options - which I sadly suspect is most deeply embedded in the Heart Of Darkness which is the Civ 3 code; otherwise, to quote @Civinator: "I do not like that flag." (To which I agree.)
 
The Flag can be used for any improvements: what you're looking for (and I heartily second) would be to have the ability to have multiple "Replaces ..." options - which I sadly suspect is most deeply embedded in the Heart Of Darkness which is the Civ 3 code; otherwise, to quote @Civinator: "I do not like that flag." (To which I agree.)

Speaking of that replace flag and perfumed powerplants. Has anyone tested how the AI would behave with 2 powerplants heavily perfumed? I'm afraid they'd be trapped in a circle of rebuilding them over and over.
 
Speaking of that replace flag and perfumed powerplants. Has anyone tested how the AI would behave with 2 powerplants heavily perfumed? I'm afraid they'd be trapped in a circle of rebuilding them over and over.
I'm not sure how perfume might affect this. Regardless of which improvements you use this Flag for, unless one becomes obsolete, then - "Hey! And around and around you go."
 
Great stuff! With regards to adding new attributes to Improvements (and Wonders), how tedious would it be to add e.g. "Increases Shields in Land Tiles" (+1 shields on land), "+1 Food in Every Food Producing Tile", etc. just to add a bit more variation to the improvement and wonder attributes? These could then be added via the config files. I guess these should be defined what we actually want, but at least as a starting point, having a shield, food, trade permutation on each of the existing attributes in the game with some additions. For example:

"Increases Shields/Food/Trade in Land Tiles" (basically +1 on these tiles)
"+1 Food/Shield in Every Food/Shield Producing Tile" (Trade already exists)
"+1 Food/Shield/Trade in Each Tile"

If these values could be dynamic, that would make it even better. E.g. "+2 Food in Each Tile", and so on.
 
Another suggestion to help modding city defenses would be to change the hardcoding making improvements with land bombard value disappear when the town becomes a city. This way, you can have "walls" that have land bombard values and absorb bombardments until hit and destroyed and "citadels" like the stock game Civil Defense that will only be targeted first by artillery after all the defenders have been redlined.
 
Back
Top Bottom