Resource icon

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

And thus, I conjecture that the AIs in Flintlock's mod usually, if not almost always, have to pay more in unit support than classic AIs do. If the AIs pay more in unit support, that suggests there doesn't exist as much gold per turn that the human player can obtain by selling technology, AND there's often less gold per turn that an AI can use to purchase technology from another AI.
It might be less often than you might expect. At demigod AI gets additional 3 free unit support per settlement and 12 additional free unit support outright. If the AI has 8 towns and 8 cities that is as a republic total of 8x1+8x3+16x3+12=92 units AI can have prior to paying any unit support. I would guess that prior to the industrial era chances are that AI stays within free unit support. In the late game the picture may change.
 
Set "ai_build_artillery_ratio =" to "false" if you want stock game artillery building behavior.

Thanks. I'm finding "ai_build_artillery_ratio =" in two files though. The injected_code.c file has it; " = ival", and so does ep.c file; " = 20". Do I need to change both? Or just the ep.c file?

That's why it's a patch first and only a mod if you want it to be.

If one just downloads the latest version and installs it properly, both sets of changes happen at the same time. So, I don't see how it's a patch first and a mod second from a hypothetical objective end user's point of view. It's also conceivable that someone would download it and watch AIs play in debug mode first before playing. That might even make for a better approach to experimenting with mods than anything else, if it's already not customarily followed by many. The AIs building artillery and using artillery type units happens before an army has spawned when I've watched them. Both at Regent and Sid level. So, from an AIs point of view, it seems reasonable to think that they might just claim it a mod first and a patch second, if they could think and speak.

Historically speaking it is a patch first, and a mod second, as the history of this thread shows.

Also, I don't think I can play Flintlock's version with stock game mechanics. I mean, I understand Flintlock's version as whatever the game is just by downloading and installing his mod. That isn't stock game mechanics as you have acknowledged, by suggesting that I change that code.
 

Thanks. I'm finding "ai_build_artillery_ratio =" in two files though. The injected_code.c file has it; " = ival", and so does ep.c file; " = 20". Do I need to change both? Or just the ep.c file?
Neither nor. The settings are simply configurated by writing in the default.c3x_config file with a text editor. Please read the readme file with the proper instructions how to handle Flintlock´s work.
 
It might be less often than you might expect.

Yea. On the other hand, I did for a short bit have the AIs go at it in debug mode on Regent level with having a capital in some corner of the map. I saw a war breakout with one AI at least using catapults. I don't recall how many though.
 
My first full C3X game is still going strong. I'm repping the patch on Discord.

I would just like to second (or +1) the request to enable retreating from any slower unit. If it's not too much for one function override, it would be ideal to configure it to allow any one of the following behaviors:
Default, 2+ can retreat from 1
Any faster unit can retreat from a slower unit
Any faster unit has its retreat chance multiplied by the difference in MP
Same, but only considering remaining MP
Any unit can retreat
 
Agree that retreat patch/fix would be nice, only mov2+ from mov1 retreat makes not much sense especially if you want to play with increased movement points for all units, fast vs any slower would work much better, with chance based on MP or unit experience. Also option to enable chance to retreat from unit with the same (not faster) speed would be nice, as it's realistic and also changes combat to require faster units to pursue the enemy, not just have slow and powerful units to crash it.
I also was thinking in the past about possibility to make enemy unit stack "routed", so if unit on top is defeated, some other units in the stack receive small damage and retreat from this spot, but this is probably far beyond the scope of this patch and would also require too much AI work to make it understand the change.
 
My first full C3X game is still going strong. I'm repping the patch on Discord.

I would just like to second (or +1) the request to enable retreating from any slower unit. If it's not too much for one function override, it would be ideal to configure it to allow any one of the following behaviors:
Default, 2+ can retreat from 1
Any faster unit can retreat from a slower unit
Any faster unit has its retreat chance multiplied by the difference in MP
Same, but only considering remaining MP
Any unit can retreat
I agree that this would be a nice option. :) I would add an option for units, that they always have a configurable chance to retreat - even in fights with units that have more movement points in their settings. This could be especially interesting for submarines and units that have the setting to move always on roads (the last ones in standard C3C can move up to three tiles on the map in a turn, but have only 1 MV point, so "in the result" are faster than a 2 MV unit).
 
Also, I don't think I can play Flintlock's version with stock game mechanics. I mean, I understand Flintlock's version as whatever the game is just by downloading and installing his mod. That isn't stock game mechanics as you have acknowledged, by suggesting that I change that code.
Do this:
use_offensive_artillery_ai = false
ai_build_artillery_ratio = false
ai_artillery_value_damage_percent = 0

Tick "never build artillery" for all civs in the editor.

And you have yourself the good ole stock game AI, except better (It still builds useless cruise missiles and tactical nukes though). Nothing is hardcoded. Everything is optional. Can't say the same about C3C's ******** naval behavior and bombard targeting.
 
Tick "never build artillery" for all civs in the editor.

??? They do build artillery in the stock game though.

I thought about leaving some artillery in. I feel it more overdone than anything else. As you and others have suggested, why make your own after the first war? Well, the answer might be that you might not have gold for upgrading, but still, I feel that Flintlock's version has too many. But then I remembered the AIs landing a single unaccompanied trebuchet near my capital when playing for 20k, and I think I saw that once or twice in my Emperor, unfinished, AW game also.

I'm not clear about the fighter/bomber ratio shift. Flintlock's comment in the default.c3x_config.ini says:

"Like the artillery ratio, shifts the AI's build priority from fighters to bombers to keep around this many bombers per 100 fighters."

I'm guessing that '0' allows the program to run like the classic game. But artillery aren't bombers, so I might be assuming too much, I suppose.
 
??? They do build artillery in the stock game though.

I thought about leaving some artillery in. I feel it more overdone than anything else. As you and others have suggested, why make your own after the first war? Well, the answer might be that you might not have gold for upgrading, but still, I feel that Flintlock's version has too many. But then I remembered the AIs landing a single unaccompanied trebuchet near my capital when playing for 20k, and I think I saw that once or twice in my Emperor, unfinished, AW game also.

I'm not clear about the fighter/bomber ratio shift. Flintlock's comment in the default.c3x_config.ini says:

"Like the artillery ratio, shifts the AI's build priority from fighters to bombers to keep around this many bombers per 100 fighters."

I'm guessing that '0' allows the program to run like the classic game. But artillery aren't bombers, so I might be assuming too much, I suppose.

You don't have to do anything in the editor if you still want the AI to make stock game amount of artillery. Though you should know that they waste shields doing so. These will only serve as defensive bombard and as a prize for you to capture if you don't enable the AI to use them offensively.

By giving the AI the ability to use offensive artillery but disabling the build choices modification you could have the AI build the same amount of artillery as they do in stock game, but be able to use them to siege your cities. Is that the happy balance you're looking for?

"false" or "<= 0" will leave the AI building choices unaffected, giving you stock game mechanics. So you could do the same to set the bomber-fighter ratio back to stock game level.

Flintlock, correct me if I'm wrong.
 
Though you should know that they waste shields doing so.
I know that you think that the AIs waste shields doing so. But, when at war, I view the purpose of enemy AIs being there lying in having an opponent to conquer. A city with 3 pikemen and a trebuchet is more difficult to conquer than a city with 3 pikemen. AIs leaving an artillery type unit in it's city thus has an advantage. The AIs are not there to try to win. They are there for us to have an enjoyable experience while we win or get a clear understanding of why we lost.

By giving the AI the ability to use offensive artillery but disabling the build choices modification you could have the AI build the same amount of artillery as they do in stock game, but be able to use them to siege your cities.

That's only if they get close enough to my cities. If I see them coming, and kill escorts on say flatland, or abandon a cities or give a cities away to an ally (both of which I might do if a sizeable stack were near one of my cities with an attacker), they won't bombard my cities. And yes, I even mean giving away a city to an ally. I did that on Sid in a histographic game a long time ago in classic civ III, and it worked rather well in the end to help divide up a rather large Persian stack of units, without suffering from war weariness from that city getting captured. Also with artillery type units out of their cities, I'll probably end up killing more units of theirs out without city bonuses like being at size 7 or city walls, or the fortification bonus even. And that difference I think I've already experienced in games I've played with the Flintlock mod so far.

The happy balance I'm looking for doesn't seem satisfiable to me by having the AIs use artillery offensively, since unaccompanied artillery type units will land next to one's cities. If you have a bunch of artillery type units near your capital where the sole enemy AI will land it's units (or multiple enemies though the positioning of artillery type units and offensive units then gets more complicated), and you get a single artillery type unit landing only, it can easily be less beneficial than a unit landing there. The unit landing there enables attacking of an enemy unit for an attempt at promotion or to attempt to spawn a military great leader, and in a convenient location. I suppose if I modded The Heroic Epic and Military Academy to not require a victorious army to build, I might feel a little differently about that. But, then how does the training of military leaders occur without ever having had a military great leader?
 
I know that you think that the AIs waste shields doing so. But, when at war, I view the purpose of enemy AIs being there lying in having an opponent to conquer. A city with 3 pikemen and a trebuchet is more difficult to conquer than a city with 3 pikemen. AIs leaving an artillery type unit in it's city thus has an advantage. The AIs are not there to try to win. They are there for us to have an enjoyable experience while we win or get a clear understanding of why we lost.



That's only if they get close enough to my cities. If I see them coming, and kill escorts on say flatland, or abandon a cities or give a cities away to an ally (both of which I might do if a sizeable stack were near one of my cities with an attacker), they won't bombard my cities. And yes, I even mean giving away a city to an ally. I did that on Sid in a histographic game a long time ago in classic civ III, and it worked rather well in the end to help divide up a rather large Persian stack of units, without suffering from war weariness from that city getting captured. Also with artillery type units out of their cities, I'll probably end up killing more units of theirs out without city bonuses like being at size 7 or city walls, or the fortification bonus even. And that difference I think I've already experienced in games I've played with the Flintlock mod so far.

The happy balance I'm looking for doesn't seem satisfiable to me by having the AIs use artillery offensively, since unaccompanied artillery type units will land next to one's cities. If you have a bunch of artillery type units near your capital where the sole enemy AI will land it's units (or multiple enemies though the positioning of artillery type units and offensive units then gets more complicated), and you get a single artillery type unit landing only, it can easily be less beneficial than a unit landing there. The unit landing there enables attacking of an enemy unit for an attempt at promotion or to attempt to spawn a military great leader, and in a convenient location. I suppose if I modded The Heroic Epic and Military Academy to not require a victorious army to build, I might feel a little differently about that. But, then how does the training of military leaders occur without ever having had a military great leader?
That extra 30 shields gone into a useless treb would have either gone into another pike or a med inf, leaving you without a treb to capture. I guess since I always assault cities with artillery support a single treb in there makes zero difference. Defensive bombard only works once for each unit per turn. And I welcome my arty stack being enlarged with booty afterwards.

I disagree with the AI just being there as punching bags. Civ3's AI is said to be one of the more actively trying to win ones of the series. Run away AIs striving for domination is what I often see. That's one of the few strength the game has over its siblings. As for fun, it's subjective. For me, the AI not being able to make use of most of the game's added features feels so half-baked. It's one of the main reason civ3 is often considered the worst out of the series. Lots of added stuff over its predecessor without the proper coding for the AI to make use of it.

I've never seen the AI land unescorted artillery. This must have been the result of the escort being disbanded due to support cost. Killing escorts without your own artillery support would result in quite heavy casualties. Them sitting passively in cities doesn't concern me since I always attack with an artillery stack large enough to redline everything. I'd be far more concerned if they meet me in the field inside their territory.

In my mod artillery is not capturable. And armies are vastly nerfed. Being to leader fish on AI artillery is thus rather balanced.

I do agree that will stock game capturable artillery the human player can abuse the AI's piece meal use. It seems like Firaxis didn't think things through properly when they changed many things from Civ2. Civ4 addressed a lot of that. Now we have the chance to do that for Civ3.
 
Last edited:
Civ3's AI is said to be one of the more actively trying to win ones of the series.
By whom? And have they tried to go to development source of the games and what they intended?

Again, Soren Johnson, who designed civ III's AI, gave his talk with the tile Playing to Lose, and he was in part, referring to civ III AI. He also distinguished between "good AI" and "fun AI". In that talk, from about 24:00 to 27:00 he says things like:

"We want the player to feel like they are playing against seven distinct personalities, not seven optimal AIs".
His notes say:
"We want players to win, or at least, understand why they lost."
He says:
"And you know, it's o.k. for the AI to fall for certain types of traps."
And more along those lines, emphasizing that they want the human player to win, with the ideal situation that they always win on the last few turns of the game (that's for everyone who plays the game... not just the veterans also).
In my mod artillery is not capturable. And armies are vastly nerfed. Being to leader fish on AI artillery is thus rather balanced.
??? One can only get a military great leader in the classic game by an elite defeating a unit with defense value. Leader fishing on AI artillery is impossible.

Artillery getting dropped off next to my coastal capital in 20k games means later leader fishing. Later leader fishing means that the Heroic Epic isn't available as early. And there would be no benefit of the artillery being there with artillery as not being able to get captured.

Your mod combined with Flintlock's version sounds strictly like a nerf. It doesn't sound balanced at all to me overall, because I think it would mean more people losing in situations where they wouldn't have a high level understanding why they lost or what they could have done differently to win. Can you explain how your mod would either make it more likely that people would win more often, or how they would have a high level understanding in more cases of why they lost?

I do agree that will stock game capturable artillery the human player can abuse the AI's piece meal use.
??? Where did I assert that? I don't think that AIs are abuse-able in the first place.
 
By whom? And have they tried to go to development source of the games and what they intended?

Again, Soren Johnson, who designed civ III's AI, gave his talk with the tile Playing to Lose, and he was in part, referring to civ III AI. He also distinguished between "good AI" and "fun AI". In that talk, from about 24:00 to 27:00 he says things like:

"We want the player to feel like they are playing against seven distinct personalities, not seven optimal AIs".
His notes say:
"We want players to win, or at least, understand why they lost."
He says:
"And you know, it's o.k. for the AI to fall for certain types of traps."
And more along those lines, emphasizing that they want the human player to win, with the ideal situation that they always win on the last few turns of the game (that's for everyone who plays the game... not just the veterans also).

??? One can only get a military great leader in the classic game by an elite defeating a unit with defense value. Leader fishing on AI artillery is impossible.

Artillery getting dropped off next to my coastal capital in 20k games means later leader fishing. Later leader fishing means that the Heroic Epic isn't available as early. And there would be no benefit of the artillery being there with artillery as not being able to get captured.

Your mod combined with Flintlock's version sounds strictly like a nerf. It doesn't sound balanced at all to me overall, because I think it would mean more people losing in situations where they wouldn't have a high level understanding why they lost or what they could have done differently to win. Can you explain how your mod would either make it more likely that people would win more often, or how they would have a high level understanding in more cases of why they lost?


??? Where did I assert that? I don't think that AIs are abuse-able in the first place.


Yes, my artillery have token defense value and -4 HP.

My mod is to make me lose more often without old tools to abuse the AI and the AI having more tools. No longer can pillage unpunished with armies before bombers. The army sent to pillage is probably on a suicide mission. No longer can I summon large armies with disconnect+mass upgrade. Fail to remove their artillery from your city doorsteps and you will be sieged down (easier said than done when they outnumber you).

So far when ever I've lost I know exactly why since it's on debug (but it's always been that way in stock game). The my failure to keep all AI's on a same level and let one run away, having gobbled up 1-2 others and then kept going . If they're all just happy to be there and mostly mind their borders my victory is guaranteed. With the ability to siege cities with artillery and using armies, they AI that is lucky enough to have armies could go 1 v 2 and is very likely to run away. Even a coalition could sometimes not be enough. So the reason is : AI artillery and Army use makes offensive war so much more rewarding and threatening instead of being a bloody stalemate like in stock game.

We're 20 years into this game. Most of us are bored with the "fun AI" and just find them to be abusable idiots. Even back then people were trying to optimize the AI performance with the AU patch/mod.
 
Last edited:
I would just like to second (or +1) the request to enable retreating from any slower unit. If it's not too much for one function override, it would be ideal to configure it to allow any one of the following behaviors:
I finally looked into this after getting quite a few requests to change the retreat rules. It's interesting reading the unit combat code since I recently implemented the same thing in C7. The original game has a variable equivalent to the one I created called defenderEligibleToRetreat, and another one for the attacker too. Both those variables, among others, are set in a separate combat initialization function, so I can easily edit them by intercepting the return from that function. I tested that editing those variables can completely prevent retreating or enable it for all units. So a retreat-if-faster rule is totally doable and probably will be in the next version of C3X.

Altering the retreat chances is trickier. There's no separate function that computes the chance, unfortunately, instead the logic is integrated into the main unit combat method. But I could work around that by redirecting its call to the RNG to a custom function that also pulls in the logic for computing the retreat chance, rolls randomly, and returns a value that it knows will or won't allow a retreat based on its internal roll. That way the retreat chance logic can be whatever custom thing people want. This is one of those cases where it would be nice to have Lua integrated into the mod so I could call out to Lua to compute the probability then anyone who wants to alter it can do so on their own.

The way retreat rolls work specifically in the original game is that the unit trying to retreat rolls a number between 0 and its opponent's retreat bonus + 50 and in order to retreat that roll must come up less than its own retreat bonus. So the code I wrote for this for C7 isn't quite right, I didn't know that the opponent's retreat bonus was factored in. Also I didn't see anywhere in the original code that units are prevented from retreating if they start the battle with 1 HP remaining, but when playing the game I can't recall ever seeing that happening. Are all these rules documented anywhere? Maybe for the Civ 3 combat simulator?
 
The way retreat rolls work specifically in the original game is that the unit trying to retreat rolls a number between 0 and its opponent's retreat bonus + 50 and in order to retreat that roll must come up less than its own retreat bonus. So the code I wrote for this for C7 isn't quite right, I didn't know that the opponent's retreat bonus was factored in. Also I didn't see anywhere in the original code that units are prevented from retreating if they start the battle with 1 HP remaining, but when playing the game I can't recall ever seeing that happening. Are all these rules documented anywhere? Maybe for the Civ 3 combat simulator?

I always thought that the retreat roll didn't start until after at least one round of combat, which was why 1 hp units didn't retreat. Or is it that they only retreated if they suffered damage in the previous round, which would disqualify a 1 hp unit?
 
Last edited:
I have never seen a unit with only one healthpoint retreat. Regardless of wheather it's HP got bombarded down to one, or it started the turn with one healthpoint, the unit doesn't retreat. At least I have never seen it.
I believed that the outcome of a battle were determined (rolled) even before combat were started. Because: If you check the box for "Preserve random seed" during game setup, reloading a gamesave will not alter the outcome of any battles (or - I'm guessing - espionage missions). I have no documentation of this whatsoever - it's just my own observations and gut feeling through years of Civ-playing.
Come to think of it - could this mean that the game calculates all possible combats and predetermine the outcome each turn before the control is handed over to the player? Or (maybe more likely) is a randomly generated number (seed) sufficient to pre-determine the outcome of all possible battles? Such a pity that the source code is unavailable...
 
I never have seen a 1hp retreat. I played countless games of AW, many with oversized maps of 250x250, with a few hundred combats in a single turn. So I have had enough battles to meet a reasonable statistically valid sample.
 
Back
Top Bottom