Resource icon

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

Speaking of naval air defense is it possible modify the game so we can two have two different sets animation or more for ships AA attack? Currently I like the AA flak for WWI-WW2 and the missile aa for Cold War but we have mods that span both eras so it would nice to be able to use both depending on the Era the player is in. Or even better use an animation file from the unit itself?
 
Is there a possibility to mod the AD value mechanism to extend with a unit's bombard/operation range? Then we can have medium/long range AA units that may shoot down air units coming into that range without the aircrafts being able to retaliate.
 
Good everyone (here in my latitude it's good morning ;))

For general documentation I want to report a minor bug with deadly ZOC.
When attacking the last unit on a tile and the attacker wins with just one HP left, it may happen, that the attacking unit will be destroyed by a deadly ZOC-bombardment of an neighbored unit, when the attacking unit enters the tile of the defeated defender (everything ok up to this point).
But due to the order of the function calls in civ3, capturable units (worker, artillery) on this tile were captured before the attacking unit starts moving.
When attacking a city it leads to the funny situation, that the units in the city are captured and belongs to the attacking civ while the city itself stays with the defending civ.
If the attacker is a human player it's just a bit strange, but not a big problem, because you are able to continue your attack with another unit and take the city or move the captured units away (possibly you raise your opponents city production unintended when disbanding the captured units).
But I'm not sure, that the ai can handle this situation without a gamecrash in all cases...
 
Can't remember if this was already asked, but is there any possibility that units drafted from a town with a Barracks-type improvement ("Allows Vet units" building-flag) could also be given the extra 1HP, i.e. be Regulars rather than Conscripts?
 
Last edited:
Do air units use their attack value or bombard value for ZOC?
They use their bombard value. The way it works is units only have the option of using their attack value for ZoC if they're in the same class as the unit they're targeting. So land units can use their attack strength vs other land units and sea units can vs other sea units, but otherwise ZoC can only be done using bombard strength.

Speaking of naval air defense is it possible modify the game so we can two have two different sets animation or more for ships AA attack? Currently I like the AA flak for WWI-WW2 and the missile aa for Cold War but we have mods that span both eras so it would nice to be able to use both depending on the Era the player is in. Or even better use an animation file from the unit itself?
This is probably doable. I know how the game triggers animations to play, for simple ones it's just one function call, so swapping out the AA animation depending on the player's era would be easy. I'd have to load an extra animation file there too but that should be easy. I'm not so sure about using an animation associated with the unit since I don't know how the game handles those.

Is there a possibility to mod the AD value mechanism to extend with a unit's bombard/operation range? Then we can have medium/long range AA units that may shoot down air units coming into that range without the aircrafts being able to retaliate.
It's possible. I could append that to the existing intercept logic. The game has a method that I named try_flying_over_tile that makes air units run the gauntlet of enemy air defenses on a particular tile. It's called, for example, whenever a unit bombs a tile and then only if the method reports that the unit was not intercepted, it goes on to deal damage by bombing. I could modify that method to first run its regular logic then if that didn't shoot down the plane, additionally subject it to AA from units on surrounding tiles.

For general documentation I want to report a minor bug with deadly ZOC.
Thanks for reporting this. I'm not sure what's the best fix here. Ideally I could stop the units from being captured until after the invading unit has survived its move into the city but that might be difficult. Probably the simplest solution is to carve out an exception to lethal ZoC for the unusual case of a redlined unit entering an enemy city. I'll have to look into it.

Can't remember if this was already asked, but is there any possibility that units drafted from a town with a Barracks-type improvement ("Allows Vet units" building-flag) could also be given the extra 1HP, i.e. be Regulars rather than Conscripts?
Sure. This is simply a matter of inserting a bit of logic into the method that does drafting, and I already know where that is. Would you be interested in other changes to the rules, for example drafting regulars but only with a barracks?
 
Carriers: Since the start of me modding Civ 3, I have a problem in scenarios with the AI loading units into other units at the start of a scenario, especially aircraft into carriers. Sometimes the AI loads the aircraft placed in the same tile as the carrier into that carrier and sometimes the carrier moves out of that tile, leaving the aircraft placed in the water. All flags are set properly, so the placed planes and the placed carrier could be operated well by the AI, but frequently here the AI is really not operating well.

The second part of my AI carrier problem is, that when the AI was successful in loading a preplaced plane into a preplaced carrier, that plane mostly immediately rebases on land (if there is an opportunity for rebasing) and next to never comes back to the carrier. Therefore a setting that planes based on a carrier have to stay on that carrier in my eyes would be nice. Even better would be, if planes, that are suited to operate from carriers would try to rebase from land to a carrier every time when this is possible (but this sounds like a not possible dream).
 
Just found this amazing mod. Any chance custom tile improvements/terrain types are going to be possible?

Being able to see defense bonuses at least when attacking would also be great (even colonization had that already)
 
Carriers: Since the start of me modding Civ 3, I have a problem in scenarios with the AI loading units into other units at the start of a scenario, especially aircraft into carriers. Sometimes the AI loads the aircraft placed in the same tile as the carrier into that carrier and sometimes the carrier moves out of that tile, leaving the aircraft placed in the water. All flags are set properly, so the placed planes and the placed carrier could be operated well by the AI, but frequently here the AI is really not operating well.

The second part of my AI carrier problem is, that when the AI was successful in loading a preplaced plane into a preplaced carrier, that plane mostly immediately rebases on land (if there is an opportunity for rebasing) and next to never comes back to the carrier. Therefore a setting that planes based on a carrier have to stay on that carrier in my eyes would be nice. Even better would be, if planes, that are suited to operate from carriers would try to rebase from land to a carrier every time when this is possible (but this sounds like a not possible dream).
Adding Flags like "Cruise Missile" doesn't help?
 
Adding Flags like "Cruise Missile" doesn't help?
Unfortunately this doesn´t help here. Starting scenarios with loaded units into other units by AI civs is a general problem of Civ 3. Adding flags like "Cruise Missile" etc. prevents to load units into other units. Here the opposite is needed to make sure, that a carrier moves and operates with the preplaced planes on board or an army operates with the preplaced land units loaded into that army.
 
The AI will load offensive and defensive flag units into sea transport flag units but will never bombard even if they could with the tactical missile ability.

The AI will load air bombard and air defense flag units into sea carrier flag units and will bombard and intercept from there. So if you want cruise missiles to be fired make them air power flag and the ships carrying them carrier flag. Unfortunately, like Civinator said, they will often not load them or simply rebase away. When I had lots of carriers and aircrafts auto produced by the Americans in the WW2 Pacific scenario, the carriers moved out towards the Philippines while the aircrafts stayed behind in the East Coast. Only a few were loaded initially. I was expecting constant rebasing of aircrafts. But those range 6 fighters were stuck. The AI had better success with Heavy Bombers with much better range. But note that once the carriers have moved towards the enemy position (they would do so regardless of carrying any aircrafts or not), they would never come back to pick up more aircrafts that were too far away to rebase to them. Instead, they would just loiter off the enemy coastline forever.

The AI will load tactical missile flag units into missile transport strat units. And if they have the tactical missile ability and bombard range the AI will bombard with them from the ships. Unfortunately, regardless of having the nuclear ability or not, the AI treats all tactical missile flag units as nukes and will only use them to bombard if nuclear war has started. If Flintlock could remove this mechanism somehow, you could have carrier-based strike aircrafts flagged as tactical missile and carriers flagged as missile transport provide the AI navy with lasting airpower. I've tested this and the results were quite satisfactory. These carriers are flagged as missile transports however, can't carry units flagged as air defense and thus don't have interceptors. And since I've disabled naval escorts, my own aircrafts could snipe them pretty easily.
 
One question regarding buildings generating resources:
I have found these lines in your code, which make it sound like a building generating a resource should also generate the resource's yields:
// Used for displaying yields from generated resources on the city screen int tourism_icon_counter; // Incremented each time a tourism yield icon (normally commerce) is drawn. Reset between improvs. int convert_displayed_tourism_to_food, convert_displayed_tourism_to_shields; // Number of commerce tourism icons to convert to food, shields

I tried to test it and I get the resource, but no bonus yield. Am I misunderstanding something, or is this not (yet) implemented?
Edit: I figured out I was looking at the R17 Alpha 2, which i found on github
 
Last edited:
Flintlock, the new option you are working on for your mod to "check era name keys against civ names", will this allow to give a civ different names in different eras of the game and could it even allow to give the civ different names for its leader in the different eras (what would be great for CCM, as here the different leaders at present all must be named ruler)?

Edit:

Civ-eras.jpg


:bounce::dance::thumbsup:
 
Last edited:
Carriers: Since the start of me modding Civ 3, I have a problem in scenarios with the AI loading units into other units at the start of a scenario, especially aircraft into carriers. Sometimes the AI loads the aircraft placed in the same tile as the carrier into that carrier and sometimes the carrier moves out of that tile, leaving the aircraft placed in the water. All flags are set properly, so the placed planes and the placed carrier could be operated well by the AI, but frequently here the AI is really not operating well.

The second part of my AI carrier problem is, that when the AI was successful in loading a preplaced plane into a preplaced carrier, that plane mostly immediately rebases on land (if there is an opportunity for rebasing) and next to never comes back to the carrier. Therefore a setting that planes based on a carrier have to stay on that carrier in my eyes would be nice. Even better would be, if planes, that are suited to operate from carriers would try to rebase from land to a carrier every time when this is possible (but this sounds like a not possible dream).
It should be easy to modify the game to load aircraft into carriers at the start of a scenario before the AI has a chance to move its carriers away from underneath them. As for keeping AI carriers stocked with aircraft, I'd have to look at the unit AI before saying anything. Right off hand I have no idea how the AI chooses where to put its air units. The problem with tying certain air units to carriers is I wouldn't have any way of storing that relationship into save files. The easiest fix is probably to prioritize carriers over cities for aircraft placement.

Just found this amazing mod. Any chance custom tile improvements/terrain types are going to be possible?

Being able to see defense bonuses at least when attacking would also be great (even colonization had that already)
Adding tile improvement or terrain types would be pretty difficult, unfortunately. Terrain types would be relatively easier since I could build off of the existing landmark types. For example I could modify the map generator to produce them and maybe also modify them in other ways to make them more like new terrain types. Adding a tile improvement would be more difficult since the existing improvements are baked into the code so deeply. For example there's a function that the AI uses to decide which basic improvement to build on any given tile. It returns only true or false, if true the tile will be irrigated and otherwise it will be mined. So there's no simple way to modify that logic to include more basic tile improvements.

I've been thinking about adding info panels that appear on mouse hover like in Civ 4. Specifically one that would show combat odds and another in the city screen to show all the details of each build option. I think I understand the interface well enough to do something like that. One little catch is that the exact combat odds in Civ 3 are not always knowable. In particular, you can't see all the units in enemy cities so you wouldn't know if there's defensive bombard until you attack. So showing the combat odds would either reveal something you couldn't normally know or be wrong.

I tried to test it and I get the resource, but no bonus yield. Am I misunderstanding something, or is this not (yet) implemented?
Buildings that generate resources only add the resource's yields if they're set to do so in the config file. You have to add the "yields" setting to the resource.

Flintlock, the new option you are working on for your mod to "check era name keys against civ names", will this allow to give a civ different names in different eras of the game and could it even allow to give the civ different names for its leader in the different eras (what would be great for CCM, as here the different leaders at present all must be named ruler)?
Do you mean replacing leader titles by era? If so, that would be easy, it's the same thing as renaming the civ. Although I'm not sure that would matter, doesn't the game usually use the ruler title from players' government? Replacing the actual leader names by era would be more complicated since it would be necessary to replace their genders too.
 
I've been thinking about adding info panels that appear on mouse hover like in Civ 4. Specifically one that would show combat odds and another in the city screen to show all the details of each build option. I think I understand the interface well enough to do something like that.
I like that idea!
One little catch is that the exact combat odds in Civ 3 are not always knowable. In particular, you can't see all the units in enemy cities so you wouldn't know if there's defensive bombard until you attack. So showing the combat odds would either reveal something you couldn't normally know or be wrong.
I don't think any unknowable information should be given away. It would still be very helpful to know all the bonuses that come into play, and the modified strength of the top defender (maybe the victory odds too). One just have to take into account that there may be some unknown factors like defensive fire, which would happen anyway, without any info.
 
The easiest fix is probably to prioritize carriers over cities for aircraft placement.
This seems to be another clever solution! :thumbsup:
Replacing the actual leader names by era would be more complicated since it would be necessary to replace their genders too.
Yes I mean the leader names of a civ. Civ 3 with its 4 different era leader graphics slots is suited very well to assign four different leaders during a game to each civ. I wrote a tutorial about it some years ago, that can be found here: https://forums.civfanatics.com/threads/the-multiple-leader-system-of-ccm.543630/

Now, with all the great new options in your mod, that even SWs can provide special buildings to a civ and additional virtual resource yields can be given to a civ, this allows to give at least some of these different leaders of a civ a different personality. Per example Napoleon in his era can provide a civ like France other bonuses than Vercingetorix in era 1 can give to Gaul.

In my oldest attempts I used the title and leader name entries of the editor to write in 3 different leader names of a civ as can be seen in a screenshot in that tutorial. The space available by using the title and leadername slots was limited by the number of letters that were allowed to write into those slots. The optical appearance in the diplomacy screen was mediocre and even this appearance sometimes could only be achieved by some tricks like setting points between parts of the name. The main problem was, that in diplomacy texts all those names were listed one after the other in diplomatic talks.

Later I named all 4 different leaders in a game ruler. This shortened the text in diplomatic talks massively, but it caused some other problems, per example when the original diplomacy text would have been "Bismarck, ruler of the Germans" a text "I, Ruler, ruler of the Germans" would sound somewhat strange. So I cut out for CCM all diplomacy texts, that could cause such a problem.

diplomacy-text.jpg


As an election ruler against ruler would have caused some irritation whom to elect, I later in CCM entered abreviations of a civ behind the word ruler, per example Ruler (Sp) for the Spanish rulers, and so on, so the diplomatic victory could have been reintroduced to that mod again, as now the vote would be bewteen individualised leaders again, per example Ruler (Sp) vs. Ruler (UK).

With the different ruler names for the different rulers in the four eras of a civ game the original diplomacy texts could be reactivated, so per example in era 1 the text in the diplomacy talk would be "I, Barbarossa, Ruler of the Germans, greet you and in era 2 the text would be "I, Frederik the II., Ruler of the Germans..." and so on.

The problem with different genders in those texts for me was no problem (at least as far as I remember), as the diplomacy texts seem to avoid this problem.
 
Last edited:
Terrain types would be relatively easier since I could build off of the existing landmark types. For example I could modify the map generator to produce them and maybe also modify them in other ways to make them more like new terrain types.

This would be very exciting! -- especially if it can be combined with the terraforming worker actions: Plant Forest, Clear Forest, Clear Wetlands, and Clear Jungle.

The LM terrain and default terrain use different graphics, which means that even if the only feature was that we could have the map generator produce LM Forests wherever it would normally put Forests, then the "Plant Forest" action could be rebranded as a new kind of tile improvement (e.g. "build castle", or "build windmill").

One of the coolest re-brands could be "build wall," where forests are impassible to wheeled units and the auto-generated LM forest allows roads whereas the worker-planted wall ("forest") does not.

There would be infinitely many more possibilities if C3X allowed us to choose the terrain type produced when you clear a forest, clear wetlands, etc. Right now those actions always produce the "base terrain type" (i.e. the underlying grassland, plains, etc.).
 
Would it be possible to provide information on how the city improvement you are building would change the productivity of the city. That is, adding a wind mill will increase shields production from 7 to 9, or adding a market place will increase gold production from 22 to 26 or a courthouse will decrease corruption by 15%.
 
I don't think any unknowable information should be given away. It would still be very helpful to know all the bonuses that come into play, and the modified strength of the top defender (maybe the victory odds too). One just have to take into account that there may be some unknown factors like defensive fire, which would happen anyway, without any info.
Yeah, I was probably over thinking it. The simplest thing would be to present the odds assuming no defensive bombard and then have a little note below showing the odds assuming defensive bombard hits. The true combat odds would be somewhere in between those two, and left as an exercise for the player.

Yes I mean the leader names of a civ. Civ 3 with its 4 different era leader graphics slots is suited very well to assign four different leaders during a game to each civ. I wrote a tutorial about it some years ago, that can be found here: https://forums.civfanatics.com/threads/the-multiple-leader-system-of-ccm.543630/
...
The problem with different genders in those texts for me was no problem (at least as far as I remember), as the diplomacy texts seem to avoid this problem.
Interesting. I was thinking it wouldn't make sense to change leaders by era since you couldn't change their traits, but if you can make them unique using special buildings it's probably worth doing. The gender issue isn't a big deal, it's just a little annoyance that prevents me from simply copy-pasting the code I already wrote to swap out civ names.

This would be very exciting! -- especially if it can be combined with the terraforming worker actions: Plant Forest, Clear Forest, Clear Wetlands, and Clear Jungle.

The LM terrain and default terrain use different graphics, which means that even if the only feature was that we could have the map generator produce LM Forests wherever it would normally put Forests, then the "Plant Forest" action could be rebranded as a new kind of tile improvement (e.g. "build castle", or "build windmill").

One of the coolest re-brands could be "build wall," where forests are impassible to wheeled units and the auto-generated LM forest allows roads whereas the worker-planted wall ("forest") does not.

There would be infinitely many more possibilities if C3X allowed us to choose the terrain type produced when you clear a forest, clear wetlands, etc. Right now those actions always produce the "base terrain type" (i.e. the underlying grassland, plains, etc.).
I'll have to look into this since it seems like there's a lot of low hanging fruit here. It should be easy to insert a bit of code that replaces all forests with LM forests after the map generator has finished, and shouldn't be much more difficult to replace any given terrain type with its LM version. Not sure about modifying how clear forest & wetlands work but that can't be too complicated. I believe the game has a method that lets you change the terrain on any tile but I've never tried using it.

Would it be possible to provide information on how the city improvement you are building would change the productivity of the city. That is, adding a wind mill will increase shields production from 7 to 9, or adding a market place will increase gold production from 22 to 26 or a courthouse will decrease corruption by 15%.
It would surely be possible but might require a lot of work. Showing combat odds would be relatively easy since I've already found the game function that computes the odds to win each round. All the mod would have to do is run that function, do a bit of math to find the total odds, and display that on the screen somewhere. I don't know of any convenient way to figure out how much reducing corruption by 15% is actually worth. The only way to do that might be to replicate the game logic in mod code, which is laborious and error prone.
 
This would be very exciting! -- especially if it can be combined with the terraforming worker actions: Plant Forest, Clear Forest, Clear Wetlands, and Clear Jungle.

The LM terrain and default terrain use different graphics, which means that even if the only feature was that we could have the map generator produce LM Forests wherever it would normally put Forests, then the "Plant Forest" action could be rebranded as a new kind of tile improvement (e.g. "build castle", or "build windmill").

One of the coolest re-brands could be "build wall," where forests are impassible to wheeled units and the auto-generated LM forest allows roads whereas the worker-planted wall ("forest") does not.

There would be infinitely many more possibilities if C3X allowed us to choose the terrain type produced when you clear a forest, clear wetlands, etc. Right now those actions always produce the "base terrain type" (i.e. the underlying grassland, plains, etc.).
This was explores by Colonel Kraken long ago in "2 Types of Farms: Yes, it can be done!" I think you'll find it interested, as it touches upon some of your ideas.
 
Thanks for the consideration, it was just a thought I had when I saw the combat odds thread.
 
Top Bottom