Resource icon

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

Interestingly enough, this scheme would mimic Civ4 by forcing attackers to engage their hard counter(s) over and above other units.
Not exactly in my eyes - and this is good so. Stealth Attack can be used in C3C to pick out a unit by attacking that unit and this can have offensive and defensive consequences. So a unit by stealth attack in C3C can be forced to attack special units in a stack to the disadvantage of the attacking unit, that target unit - different to Civ 4 - is not "the hard counter" of only the stealth attacking unit, but the "hard counter" of every attacking unit. Civ 3 has no variable defense setting by the Rock-Paper-Scissors method, but an absolute value for the defense of a unit (and this avoids the Stack of Doom dilemma of Civ 4). So for only forcing a unit to fight against the absolutely best defensive unit in a stack you don´t need any stealth attack setting. It is the normal setting of Civ 3.

But such a defensive use of stealth attack can make a lot of sense to protect other units in a stack, per example sea transports from submarine attacks (if the transports are no stealth attack targets themselves). In a normal combat here the transport ship would become the defending unit of the stack when the other units have received enough damage. With the stealth attack setting posted above, these defending ships in the stack must be sunken before the transport ship can be attacked. Here is the ASW-setting of the CCM mod against submarine attacks (that with the Flintlock mod is also working against bombardment attacks by submarines):

ASW.jpg


Btw.: Cause of the mechanics of stealth attack in C3C posted above, tank destroyers in CCM have an offensiv stealth attack setting (picking out the tanks) and no defensive stealth attack setting (being the prime targets for the tanks), as it makes not so much sense, that the tank destroyer must be destroyed itself, before any other unit in the stack can be attacked by those tanks.
 
Last edited:
But such a defensive use of stealth attack can make a lot of sense to protect other units in a stack, per example sea transports from submarine attacks (if the transports are no stealth attack targets themselves).
I suppose I should have said "designated hard counter". That's what I meant: flipping the script so that Stealth Attack works as a screening mechanism, rather than sniping.
 
I have witnessed some weird behaviour with units escorting land artillery. These units (usually defensive) when inside other player's territory tend to abandon the artillery and attack nearest city at will having little chance to win and sparking the war.
 
Theov already has a brewery in his mod, located here. https://forums.civfanatics.com/threads/expanding-civ3-a-theov-mod.559222/

I have set it to require wheat to be built, and once built it produces 2 Happy Faces and +50% tax income. If you could set it to produce a resource like Beer, you would get quite a lot of use from it. The wheat does not need to be located within the city radius. Theov also has a winery which does require Wines to be in the city radius. It you wanted you could set those to produce Brandy as a luxury resource.

Yes, there are many possibilities to explore, such as those you mentioned like Brandy and Beer. Although we must also be careful not to flood the market with too much cash and too many luxuries, or the gameplay will start breaking down later in the game. Creators are only going to be limited by their imagination.
 
Yes, there are many possibilities to explore, such as those you mentioned like Brandy and Beer. Although we must also be careful not to flood the market with too much cash and too many luxuries, or the gameplay will start breaking down later in the game. Creators are only going to be limited by their imagination.
I forgot to add that for a brewery to be built, the city needs a river within its radius. The winery and brewery only benefit the city that they are in, and do not produce luxuries. The river requirement does limit the number of breweries.
 
:clap::thumbsup: Of course this will cause a fourth (or fifth) rework of the CCM 2.6 buildings and resources. :)
:king: Thanks! This turns out to be rather tricky so I hope it's worth it. I thought there was a single function that gathered tile yields for cities but it turns out there isn't. (There may have been one in the original source code that got inlined in several places, it's hard to say). So I have to do plan B, which is modify the tile yields to include the extra amounts on city center tiles. Fortunately, I can modify only the tile yield computations that contribute to the city's totals so the additional yields don't affect anything else, including not appearing on the map.

The really tricky part though is finding all the cases where it's necessary to recompute city yields because the gain or loss of a resource might have activated or deactivated a building that's producing yields. I'm still working on that. I have things basically working but haven't yet tested against all the ways I can think of to add or remove a resource. I mentioned before that the hard part about making a bank's function dependent on a resource would be figuring out all the ways a city might gain or lose a resource, and now that's the problem I have to solve. Actually it's even worse since resource generating buildings can feed into one another.

It's not much to see but here's what it looks like at the moment:
generated_incense.png

Notice the city gets 3 commerce per turn but there's only one on the map. "W (Horses -> Y Incense)" is a building that requires horses and generates incense with yields, so it adds an additional 2 commerce. I'd still like to put some visual indications on buildings that are generating resources so it's clear what's happening. I imagine a lot of players would look at cities like above and think the additional commerce is a bug. My current plan is to add the yields in where commerce from tourism normally appears. There's not much room there but it's not like there's space anywhere else. I also wanted to add an icon showing which resource is being generated but I can't see anywhere to put that except over top of the improvement icon.

I have witnessed some weird behaviour with units escorting land artillery. These units (usually defensive) when inside other player's territory tend to abandon the artillery and attack nearest city at will having little chance to win and sparking the war.
Can you post a save where this clearly happens? Otherwise I don't have much to go on as I've never seen this myself.
 
Can't speak for anyone else but it will definitely be worth it for me. Roads, harbor, airport, civ trades, and now CXE buildings generating resources, it will be tricky. Although one total calculation a turn is all that matters for yields in a normal turn sequence, right? It looks awesome to see it on screen. I'm guessing that there is a way to differentiate between building resources that generate yields and the resources that only connect resources to the network? As for the visual indications, even if you can't find a spot, we can always create build_sm icons to show the yield, or even include it in the name as you did there.
 
Although one total calculation a turn is all that matters for yields in a normal turn sequence, right? It looks awesome to see it on screen. I'm guessing that there is a way to differentiate between building resources that generate yields and the resources that only connect resources to the network? As for the visual indications, even if you can't find a spot, we can always create build_sm icons to show the yield, or even include it in the name as you did there.
During the AI players' turns you could get away with only recalculating building resource production once. But during the human players turn I think it's natural for resource production to take effect immediately when things change. For example if you connect or import a source of iron you can immediately build swordsmen, railroads, etc., so it makes sense that any generators that take iron as an input also activate immediately. The economic logic is common to all players so it's easiest to make that happen for all of them if it happens at all.

As an aside, I toyed with a similar idea when I was working on optimizing the trade network. The AI triggers surprisingly many recomputations of the network, on average about 5 per AI player per turn in my test game. I was considering limiting that to once per AI per turn since I highly doubt any human players would notice the difference anyway. In the end I didn't do it since I was able to make trade net recalculation fast enough that I don't feel it's necessary. Also I like being able to say that the optimized code doesn't cut corners anywhere, it does exactly the same thing as the original game only faster.

It will be possible to control whether or not generated resource yields are added with a "yields" setting in the config file, like the current "local" and "no-tech-req" settings.
 
:king: Thanks! This turns out to be rather tricky so I hope it's worth it. I thought there was a single function that gathered tile yields for cities but it turns out there isn't. (There may have been one in the original source code that got inlined in several places, it's hard to say). So I have to do plan B, which is modify the tile yields to include the extra amounts on city center tiles. Fortunately, I can modify only the tile yield computations that contribute to the city's totals so the additional yields don't affect anything else, including not appearing on the map.

The really tricky part though is finding all the cases where it's necessary to recompute city yields because the gain or loss of a resource might have activated or deactivated a building that's producing yields. I'm still working on that. I have things basically working but haven't yet tested against all the ways I can think of to add or remove a resource. I mentioned before that the hard part about making a bank's function dependent on a resource would be figuring out all the ways a city might gain or lose a resource, and now that's the problem I have to solve. Actually it's even worse since resource generating buildings can feed into one another.

It's not much to see but here's what it looks like at the moment:
View attachment 679418
Notice the city gets 3 commerce per turn but there's only one on the map. "W (Horses -> Y Incense)" is a building that requires horses and generates incense with yields, so it adds an additional 2 commerce. I'd still like to put some visual indications on buildings that are generating resources so it's clear what's happening. I imagine a lot of players would look at cities like above and think the additional commerce is a bug. My current plan is to add the yields in where commerce from tourism normally appears. There's not much room there but it's not like there's space anywhere else. I also wanted to add an icon showing which resource is being generated but I can't see anywhere to put that except over top of the improvement icon.


Can you post a save where this clearly happens? Otherwise I don't have much to go on as I've never seen this myself.
The save relies on the files for my scenario that is in progress. You won't be able to debug using the save file only, would you?
 
Just like Civ4! :cool:
As someone who regularly plays both Civ3 and Civ4 a lot, there are great features, concepts and ideas in both games that the other game could benefit from.

Notice the city gets 3 commerce per turn but there's only one on the map. "W (Horses -> Y Incense)" is a building that requires horses and generates incense with yields, so it adds an additional 2 commerce.
Do you think it would also be possible to have a building add yields without associated resources? E.g. have a lumberjack that gives +2 production, but nothing else, or oil wells, that require oil in the area and give +5 commerce, but nothing else. Random examples, again. :D
 
The save relies on the files for my scenario that is in progress. You won't be able to debug using the save file only, would you?
Unfortunately not. I was thinking I could find the point at which the AI escorts abandon their artillery using a debugger or inserting a bit of code, then locate that within the overall unit AI, then by inspecting the code leading up to that I might be able to figure out why it's happening. But I would have to be able to run the save file to do that.

Do you think it would also be possible to have a building add yields without associated resources? E.g. have a lumberjack that gives +2 production, but nothing else, or oil wells, that require oil in the area and give +5 commerce, but nothing else. Random examples, again. :D
Sure. My current plan is to only show generated strategic or luxury resources, not bonus, so if you set a building to generate a bonus resource with yields it will look as if the building were simply adding food/shields/commerce. It might be worth it to include an option to show the bonus resource too since that resource might be an input to another generator. Otherwise I don't think it would ever matter. The base game never shows bonus resources on the city screen since there's not much you can do with them anyway. They can't be traded and in fact aren't even propagated through trade networks.
 
Sure. My current plan is to only show generated strategic or luxury resources, not bonus, so if you set a building to generate a bonus resource with yields it will look as if the building were simply adding food/shields/commerce. It might be worth it to include an option to show the bonus resource too since that resource might be an input to another generator. Otherwise I don't think it would ever matter. The base game never shows bonus resources on the city screen since there's not much you can do with them anyway. They can't be traded and in fact aren't even propagated through trade networks.
Sounds interesting indeed, this would add a new way of giving improvements and wonders some fresh features! I recall from the past that you mentioned that adding new "traditional" attributes as such for the improvements/wonders (for example, "Increases Shields in Land Tiles" (+1 shields on land), "+1 Food in Every Food Producing Tile", etc.) might be tricky, so this sounds like an alternative way of doing something similar, if not entirely the same.
 
Sounds interesting indeed, this would add a new way of giving improvements and wonders some fresh features! I recall from the past that you mentioned that adding new "traditional" attributes as such for the improvements/wonders (for example, "Increases Shields in Land Tiles" (+1 shields on land), "+1 Food in Every Food Producing Tile", etc.) might be tricky, so this sounds like an alternative way of doing something similar, if not entirely the same.
It (two types of farming) can already be done, albeit with a workaround:
https://forums.civfanatics.com/threads/2-types-of-farms-yes-it-can-be-done.115394/
 
Wow, okay!

So this is a game turn on an older abandoned save file (due to long turn times) that in R16 was still around 5 minutes (and 15 minutes + prior to that)

Screenshot (298).png


Also achieved this on the subsequent turn, not sure what it means though. But basically, turns are about instantaneous, I spend more time choosing city build queues and skipping through diplomacy notifications now. Incredible work, thank you!

Screenshot (299).png
 
... and some more feedback about the optimization of the trade net:

One of the longest interturn times in my test game on a 250 x 250 map. It occurred when several AI civs became access to Mutual Protection Pacts:

Record Interturn.jpg


One of the shortest interturn messages in that game with positive account (here I also was pleased, that the change to half-year turns in the interface, starting with WW2, worked very well):

Short Interturn time.jpg


I also received two turns with negative accounts from the "interturn tool", as seen in the post above.
Edit: Another turn with a negative account:

Negative Account.jpg
 
Last edited:
It (two types of farming) can already be done, albeit with a workaround:
https://forums.civfanatics.com/threads/2-types-of-farms-yes-it-can-be-done.115394/
Yes indeed, I was more referring to this conversation from last year wrt new attributes for improvements and wonders. This change above will open some new possibilites with those, even if not entirely the same thing:

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.
 
Wow, okay!

So this is a game turn on an older abandoned save file (due to long turn times) that in R16 was still around 5 minutes (and 15 minutes + prior to that)

Also achieved this on the subsequent turn, not sure what it means though. But basically, turns are about instantaneous, I spend more time choosing city build queues and skipping through diplomacy notifications now. Incredible work, thank you!
Very nice. I'm glad to see it's working well. Or at least the actual optimization is, the turn timer needs work.

... and some more feedback about the optimization of the trade net:

One of the longest interturn times in my test game on a 250 x 250 map. It occurred when several AI civs became access to Mutual Protection Pacts:
I wonder what would cause the overall turn time to be so long while so little time is spent recomputing trade networks. If I had that save file I could run it through a profiler to figure out where the game is spending its time. Someday I'd like to do that for a bunch of really slow saves to get an idea for what causes long turns in a variety of scenarios. Also that time might not be accurate. The turn timer can be wrong in both directions.



The turn timer is not a polished feature yet, it's still just a quick and dirty thing I threw in there for my own use. To get an accurate measurement of the time, you should try to do as little as possible during the turn processing. So don't visit your cities or advisors, etc. The timer does deduct time spent on popups, on the diplo screen, and by those little map messages ("pollution strikes [city]", etc.), since all of those are things you can't control. I didn't bother deducting things you can control like opening the city screen. The negative numbers must be caused by something getting deducted twice, for example if you get a popup and trigger another popup before the first one closes then the time for the second popup will get deducted twice because it overlaps with the first. I did try to account for that when programming the timer but now looking at it again, I can see I made a mistake. I'll fix up the timer in the future.
 
I wonder what would cause the overall turn time to be so long while so little time is spent recomputing trade networks. If I had that save file I could run it through a profiler to figure out where the game is spending its time. Someday I'd like to do that for a bunch of really slow saves to get an idea for what causes long turns in a variety of scenarios.

I still have the save files for each of those turns in the current test game of the next version of CCM and can pick out and post the saves belonging to the posted screenshots (and others, too). The problem is, that these are saves of a prototype of the next version of CCM and there are huge differences in the settings of CCM 2.5 and the next version of CCM. So it is the question, if these save files are of any use for you without the main files of that tested prototype version of the next CCM.
Also that time might not be accurate. The turn timer can be wrong in both directions.
I only activated the timer to provide you with some feedback about your great work. Normally I don´t will use it.
The turn timer is not a polished feature yet, it's still just a quick and dirty thing I threw in there for my own use. To get an accurate measurement of the time, you should try to do as little as possible during the turn processing.
As it is a test game for the next version of my mod, I visited all of my cities every turn when they have produced something to see if all runs well and what can be improved in this mod.

May be AI diplomacy can trigger long interturn times, too.
 
Question for Mr. Flintlock: Is there way to help you search for things? Like is there a simple text file we can read through to try to spot something of interest?
Please keep in mind I know absolutely nothing about coding, so I could be pretty useless, but just wondering.
 
Top Bottom