Resource icon

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

I'm thinking about making an urban combat tactical sim from C3X, and it seems like the following features would be useful for that but also for other purposes:
  • Hide ability that toggles invisibility but prevents movement
  • Setting to block bombard range with terrain in the same way line of sight can be blocked by terrain
  • Setting to turn off unit healing outside of cities, fortresses
 
Last edited:
Flintlock updated C3X with a new update entry:

Release 26



Read the rest of this update entry...
Hi Flintkock, a big thank you for your work.
Civ3 is my favorite game and if If I still play it with pleasure, it's thanks to your work !

However, since the introduction of the districts, there are some bugs.

Some are difficult to reproduce so it would not go much to say "the game has crashed".
But here's one that I can clearly report:

- The button "move unit of the same type in stack" doesn't work anymore.
Instead, it does stranges things.
For exemple, when I use this button on workers, they're starting to build a natural wonder. 🙃
 

Attachments

  • Capture d’écran 2025-12-18 à 01.28.17.png
    Capture d’écran 2025-12-18 à 01.28.17.png
    508.4 KB · Views: 79
So, in conclusion, RAM speed doesn't matter, only raw cpu power?

Have you ever tried to tie CL to 14 or even 13? I wonder how much difference could it make?
Reducing RAM speed while keeping same CL acts as increasing delay time between CPU<->RAM access. CL16 at 3200 is best this kit can do (afaik it's one of the best possible speeds, 3200 CL14 kits did exist but they were rare and expensive - RAM sticks makers had to test by hand the RAM chips to find those). It is already running at worse secondary timings than the ones it has provided by manufacturer in its XMP on-chip profile (namely tRC, from the previous post), and running it at low frequency like 1600MHz + setting CL to 8 would basically make its access speed equal to that of 3200MHz with CL32, because CL is just Clock Latency - how many Hz out of those 3200MHz it has to wait before it can be accessed/do any operations. Making it run at half the frenquency with halved clock latency makes the delay exactly the same in its time length.
Yeah there isn't much to further improve RAM speed for testing. I've tried in the past to see if this RAM can do better timings but it wouldn't be stable even with bump up to it's, and the CPUs memory controller, voltages. But it was a really cheap end-of-the-production kit so I've got no personal complaints - 65$ for 32GB, that was basically a steal back then judging by todays grim prices.

Yup it seems that RAM speed doesn't matter much in this case, only the CPU clocks do. Now we need someone with older Intel platform that had separate clocks for CPU and cache to test and compare how much of speed loss was due to CPU, and how much due to cache speed. :lol:

Apart from that, 2 minute wait worst case scenario is not bad, but you miss the fun when city number raised to 1200+.
I will experience it soon enough, in about 30~40 turns time I'm gonna bump the limit from 512 to 1536 and let the AIs flood the world!
Thank you for your awesome map by the way.

btw how do I update the C3X to R26?
should I delete previous file and download new one?
Delete current modified Civ3Conquests.exe, rename Civ3Conquests-Unmodded.exe to Civ3Conquests.exe, then unpack the new C3X version overwritting old files + run install.bat again.
IF you have done any changes to the default.c3x_config.ini then remember to write them down and re-input them, as you will be overwritting this file with fresh one from newer version.
 
Hi Flintlock, a big thank you for your work.
Civ3 is my favorite game and if If I still play it with pleasure, it's thanks to your work !

However, since the introduction of the districts, there are some bugs.

Some are difficult to reproduce so it would not go much to say "the game has crashed".
But here's one that I can clearly report:

- The button "move unit of the same type in stack" doesn't work anymore.
Instead, it does stranges things.
For exemple, when I use this button on workers, they're starting to build a natural wonder. 🙃
What version of C3X R26 are you running? And I assume you intentionally have districts enabled? If yes, did you have the same issues when you started your game?

On that note, have you either

1. Changed the version of C3X after starting a game, or
2. Changed your districts configuration after starting a game

?

This looks like a case of the district IDs changing mid-game due to (2), I would guess. R26 preview 2 onwards will warn you when you load a saved game if the districts configuration you have loaded is different than when you saved. If you're not getting that warning, I'm guessing perhaps you are on R26 preview 1? Also, regarding any other bugs, I'd suggest checking the changelogs, as there is a good chance others have reported them and they've been fixed. If not let me know.

The new districts seem to be a great expansion to conquests 3. But we didn't get it to work in multiplayer. The worker buttons to built the districts don't appear.
And the day/night-cycle seems also not to work in multiplayer.
Is that true, or did we just miss some switch or so?
Great! Regarding multiplayer, both districts & day/night-cycle check whether it's a multiplayer game and if it is, auto-disable themselves. This was mostly just a precaution as I saw that pattern used in the stack bombard and stack worker buttons, and assumed C3X modifications in multiplayer mode may have issues I wasn't aware of. I'll have to defer to @Flintlock on this one. If that's not the case and it'd be feasible to enable those in multiplayer, I'd be happy to do so.
 
What version of C3X R26 are you running?
The last one released a few hours ago. C3X R26 final version.

And I assume you intentionally have districts enabled?
Yes, District and Natural Wonders. 👍

If yes, did you have the same issues when you started your game?
Yes. the Button "move units of the same type in stack" doesn't work since the begining of the game.
Sometime, it doesn't works at all, sometime it does strange things.

The button "move unit in stack" works. (see the animated gif)

On that note, have you either

1. Changed the version of C3X after starting a game, or
2. Changed your districts configuration after starting a game

?
No, fresh game with the same district configuration file since the begining.

I use Rhye's of Civilization world map with Natural Wonders added with "Cross-Platform Civ3 Editor - Districts Edition v1.61".

edit:
- I just tried without any mod, a fresh game and district enabled -> Same problem.
- without the district enabled in the configuration file, everything works.
 

Attachments

  • ezgif-20bccb31b05e969c.gif
    ezgif-20bccb31b05e969c.gif
    5.2 MB · Views: 67
Last edited:
I finally got around to benchmarking that save, got delayed by my left ctrl+win button dying on my mechanical keyboard, had to disassembly it fully clean it out with 99.99% isopropanol, drying it out and in the end the key are still dead :(
The key broke out of nowhere? That's annoying. Many years ago I had a mechanical keyboard that I almost ruined by spilling something on it. I tried taking it apart as much as I could and cleaning it out gently with Q-tips and isopropyl alcohol but that didn't help. I figured it was done for so as a last ditch effort, I drenched it with a full bottle of the alcohol in a trash bag then left it sealed in there to soak for two weeks. That actually did it, all the keys worked after that. At least the important ones, there was a pad of special function keys off to the side that never worked again. I wouldn't recommend that though, as it dissolved the glue under the stickers and discolored the plastic so the keyboard looked terrible after that. But I used it for years after.

My benchmarking procedure was to have as little things as possible running in the background + run 3 save game passes and in between close the civ3...
Here are the results
Thanks for doing this. The results are surprising, to me at least. The game's performance scales almost exactly proportional to CPU frequency meanwhile RAM bandwidth and latency makes only a tiny difference. It looks like X3D would barely help performance after all. I guess what's happening is that the game just overall needs so little memory for game data that it fits alright in a modern CPU's L3 cache. It doesn't matter much that the code is not written in a way that makes efficient use of CPU cache.

I was curious how your system compares to mine so I reran that test myself and got 108 seconds turn time with 26.7 seconds for recomputing city connections across 264 calls. Very strange that the call count is off by one, I have no idea why that would be. I thought that test took about three minutes on my system but I must have been confusing it with a later save from that same game. Your system is about 61% faster than mine using a CPU that's 11 years newer, which suggests that CPUs are improving 4.4% per year on Civ 3 specifically. That's pretty underwhelming, though it's not a totally fair comparison as my i5-2500k cost $216 MSRP back in 2011, which equals $284 in 2022 when your Ryzen 5 5600 was released for $199. So the newer CPU is 61% stronger and considerably cheaper as well.

But does the AI know how to use the land transport though?
It does not. As far as I know, it will never use a land transport.

Could it be possible that this defensive naval retreat option can be combined with a function, where the ships that are allowed to retreat defensivly, can be named in brackets, as it is possible in some other features of C3X [Submarine] ? Even better would be a flag where submarines can escape from beeing attacked
Sure, a list of naval unit types that can retreat defensively would be possible and not especially difficult. I'll try to get that done soon(-ish). Allowing them to retreat before combat even starts would of course be more difficult because that's a new behavior that would have to be programmed in.

  • Hide ability that toggles invisibility but prevents movement
  • Setting to block bombard range with terrain in the same way line of sight can be blocked by terrain
  • Setting to turn off unit healing outside of cities, fortresses
I'll make note of these. The first and third should be simple enough and are things I'd like to make possible through Lua. Not sure about the second, I don't know how line of sight in handled in the game right now. I have a feeling it's very simple and designed only for sight up to two tiles away.

This was mostly just a precaution as I saw that pattern used in the stack bombard and stack worker buttons, and assumed C3X modifications in multiplayer mode may have issues I wasn't aware of. I'll have to defer to @Flintlock on this one. If that's not the case and it'd be feasible to enable those in multiplayer, I'd be happy to do so.
The issue with multiplayer is that player actions have to be synchronized among all players and I've only scratched the surface so far about how the game does that. (I'm referring to the mp_* functions in Ghidra. I think I've stumbled on the method that receives messages from other players but didn't verify what it does or name it.) I don't see any reason the day/night cycle would cause problems in multiplayer, after all it's only cosmetic, right? For districts, you would have to synchronize when players choose to build one, at least. I don't know how to do that though I'd guess it's not that difficult to figure out by imitating methods like mp_despawn.
 
The last one released a few hours ago. C3X R26 final version.
Yes, District and Natural Wonders. 👍
Yes. the Button "move units of the same type in stack" doesn't work since the begining of the game.
Sometime, it doesn't works at all, sometime it does strange things.
No, fresh game with the same district configuration file since the begining.

I use Rhye's of Civilization world map with Natural Wonders added with "Cross-Platform Civ3 Editor - Districts Edition v1.61".

edit:
- I just tried without any mod, a fresh game and district enabled -> Same problem.
- without the district enabled in the configuration file, everything works.
Got it, thank you. I'm able to reproduce the "move-units-of-the-same-type-button-does-weird-stuff" bug. And wow, this is a strange one.
I personally always use the equivalent keyboard command (Ctrl+X), which as far as I can tell works fine. Same with X (move all units).

But you're right, sure enough, if I have a worker and click "Move Units of the Same Type", the worker "builds" a natural wonder. Very odd. This should be a straightforward fix but for right now I'd suggest just using the keyboard commands, assuming they work for you.

You mentioned bugs, plural. Anything else you can report that hasn't been fixed by R26?

The issue with multiplayer is that player actions have to be synchronized among all players and I've only scratched the surface so far about how the game does that. (I'm referring to the mp_* functions in Ghidra. I think I've stumbled on the method that receives messages from other players but didn't verify what it does or name it.) I don't see any reason the day/night cycle would cause problems in multiplayer, after all it's only cosmetic, right? For districts, you would have to synchronize when players choose to build one, at least. I don't know how to do that though I'd guess it's not that difficult to figure out by imitating methods like mp_despawn.
Ok thanks, and right, day/night cycle is cosmetic, so I'll plan to enable that for multiplayer as well in the next release. I'll take a look at the mp_* methods and see if I can decipher how player-player synchronization works as well.
 
Last edited:
The key broke out of nowhere? That's annoying.
Yeah and unfortunately I will be stuck with it for quite some time as I need n-key rollover and firmware-level key rebinds, none of the cheap office keyboards support that and I can't afford to drop 100$ on a same model I've got or anything similar to it. It's a full length mechanical keyboard, DM Dreamkey with kailh box gen1 switches. Those keyboards are out of production already and from looking on online sale platforms they seem to be notorious for failing keys - I found 0 listings for brand new models, but about 8+ for companies selling some units as damaged with some dead keys/entire rows. Weirdly enough DM still has new units in stock on their company website shop.
Even worse the keys are soldered down so no easy possibility of swapping dead ones out, it's basically trash at that point.

That's pretty underwhelming, though it's not a totally fair comparison as my i5-2500k cost $216 MSRP back in 2011, which equals $284 in 2022 when your Ryzen 5 5600 was released for $199.
216$ MSRP was very low considering that Intel was competing against itself, while Ryzens were very aggressively priced to gain userbase/sales volume, keyword were because 5000 series was already 25% more expensive than 3000 on launch, and 7000 went again 30% up compared to 5000. It's a good reminder to the people that big corporations aren't their friends, as soon as there is no strong competition they up the prices. I remember when during Pentium 4/Pentium D era AMD did charge 800$+ and 1000$+ for their top of the line Athlon 64 x2 and FX models - that just a bit over a year later, when Core2Duo arrived, had their prices very quickly slashed down to 120$ and 180$ respectively.

I was curious how your system compares to mine so I reran that test myself and got 108 seconds turn time with 26.7 seconds for recomputing city connections across 264 calls.
Maybe due different C3X version? I'm on R25. Or maybe one of the AIs doesn't declare embargo on you - there's that funny thing where some x86 computation (and RNG) instructions give different output between AMD and Intel CPUs, maybe it affects AIs diceroll on whenever to embargo you or something. :dunno:
 
The unload units from army feature is a big tactical advantage to the player and gives a unique way to manage your units in a very efficient (and fun) way.

I attack a stack of enemy units using my armies. At the end of the turn my armies are low in health.

Next turn I unload all units and load fresh and full of health units and continue the battle.

That way I cut the fight time by half (since no healing is required for the armies) and eliminate my loses because using armies are much more difficult to lose instead of plain units, especially when you use your artillery efficiently.

The bonus of the fight is I get some elite units since after all fighting, some units from the armies got promoted to elite status. How cool is that?

This functionality is a bit unfair for AI, but when giving some other bonuses to the AI, that advantage got even.

I did not expected another tactical weapon for my war strategies.

Kudos to the magician.
 
Got it, thank you. I'm able to reproduce the "move-units-of-the-same-type-button-does-weird-stuff" bug. And wow, this is a strange one.
I personally always use the equivalent keyboard command (Ctrl+X), which as far as I can tell works fine. Same with X (move all units).
Fine, thank you for your work 👍☺️

But you're right, sure enough, if I have a worker and click "Move Units of the Same Type", the worker "builds" a natural wonder. Very odd. This should be a straightforward fix but for right now I'd suggest just using the keyboard commands, assuming they work for you.
I will use the keyboard shortcut while waiting for the next release.

You mentioned bugs, plural. Anything else you can report that hasn't been fixed by R26?
I played the r26 with district enabled for 5 or 6 hours and I had 2 crashes:
Both random. The first one was after to sign a peace treaty, the screen freeze and I had to kill the app in the application manager.
The second one was a crash after a trade negociation.
I've never had these crashes with the pre-r26 versions.

I know that you need more information to investigate but I can't say anything else. 🤷🏻‍♂️
As soon as I see an easily reproducible bug or if I have more information, I will make a detailed bug report 👍

Keep you good work !
 
Fine, thank you for your work 👍☺️
My pleasure!

I played the r26 with district enabled for 5 or 6 hours and I had 2 crashes:
Both random. The first one was after to sign a peace treaty, the screen freeze and I had to kill the app in the application manager.
The second one was a crash after a trade negociation.
I've never had these crashes with the pre-r26 versions.

I know that you need more information to investigate but I can't say anything else. 🤷🏻‍♂️
As soon as I see an easily reproducible bug or if I have more information, I will make a detailed bug report 👍
Got it, thanks again for letting me know and I'm sorry to hear about the crashes. I can only speculate as to the reason, but I know that can ruin the fun.

If you run into them again, please feel free to share a save file from the previous turn and I will fix it.
 
Is there a way to keep the vanilla AI behaviour on founding cities, essentially letting the AI rapidly expand (as would I). I notice that they settle 3-5 large cities and leave wide gaps between other civs, and much of the world is unused. I made "disallow_founding_next_to_foreign_city = false", which increased the AI founding a couple more cities, but still there's unused space. I also read that a rule "ai_settler_perfume_on_founding" exists, but I can't find it in any config file.

Other than that, really love the mod and QOL changes it makes!
 
Maybe due different C3X version? I'm on R25. Or maybe one of the AIs doesn't declare embargo on you - there's that funny thing where some x86 computation (and RNG) instructions give different output between AMD and Intel CPUs, maybe it affects AIs diceroll on whenever to embargo you or something. :dunno:
Good idea, I testing with R26. But surprisingly that's not it, when I test again with R25 I still get 264 calls. Very odd. Have you changed anything in the C3X config? For my tests, I've only set measure_turn_times and convert_some_popups_into_online_mp_messages to true. I highly doubt it's related to RNG since I've never seen the game use any of the x86 RNG instructions. Its main, and probably only, random number generator is a basic linear congruential generator, so each number is generated by a couple of basic integer operations.

This talk about performance got me curious about what the breakdown of CPU time looks like after optimizing sea trade calculations, so I ran the same Monstrosity test again with Intel VTune attached for profiling. I'd done that before Trade Net X and found that the game was spending 90% of its time on sea trade so didn't look at much beyond that. Here are the results for the top 20 functions with names inserted by me:
sea_trade_torture_test_profile_after_tnx.PNG

(This is for three turns and loading the game was included in the profile too.) The trade network calculations are still at the top of the chart but I already knew that from the basic C3X turn timer. This save is such a torture test for sea trade that even after fixing the fact that the calculations were wasting ~97% of their efforts, those trade calculations are still a large chunk of the overall turn time. However, on all other saves I've seen, the trade network is 5% or less of turn time so I don't think it's worth it to hammer further on that.

Sadly I don't see any more low hanging fruit for optimization here. Map::get_tile has a needless middleman array that could be optimized away, as I've mentioned before, and neighbor_index_to_diff could be replaced with a lookup table, but those together are at most 10% of the turn time (again, the times above are diluted by loading time). Unit::no_other_action_targeting and Leader::count_workers_assigned_to_tile are slow because they loop over every unit in the game. Tile::impl_m42_Get_Overlays, Map::wrap_horiz, and Tile::has_city are very simple functions that do almost nothing, they appear high on the list because they're called from everywhere. One funny one is Leader::give_map_knowledge which transfers revealed tiles from one player to another after maps have been traded. Over three turns, I had to wait over 6 full seconds for the AIs to trade maps among themselves as they love to do. Leader::impl_m23 is some kind of diplomacy function. City::has_improvement is up there because the game's hash table implementation is terrible.

I'll take a look at the mp_* methods and see if I can decipher how player-player synchronization works as well.
Please do, if you can decode how online sync works, that would be very helpful. That's something I've been wanting to do for years but never got around to. It's probably not even hard, if past experience holds. For years I thought adding additional data to save games might be difficult but it turned out to be no problem. Even lifting the city limit was something I feared would have all sorts of unforeseen issues but the straightforward approach I took worked just fine.

Is there a way to keep the vanilla AI behaviour on founding cities, essentially letting the AI rapidly expand (as would I). I notice that they settle 3-5 large cities and leave wide gaps between other civs, and much of the world is unused.
The mod shouldn't change how quickly the AI founds cities or how many it founds except by the AI settler perfume option you mentioned. That option was added in version 23 and is definitely normally there in the default config INI. It's intended to be used to slow AI expansion though you could use it the other way around. That would create a feedback loop, however, as the AI founding cities would trigger it to build more settlers and having more settlers would cause it to found more cities. I've never tried that so I don't know how bad it would be in practice. Worst case scenario is every AI builds nothing but settlers until the map is full.

Did you notice the AI settling change after you altered one of the mod options, or do you think it was simply running the mod that caused that?
 
The mod shouldn't change how quickly the AI founds cities or how many it founds except by the AI settler perfume option you mentioned. That option was added in version 23 and is definitely normally there in the default config INI. It's intended to be used to slow AI expansion though you could use it the other way around. That would create a feedback loop, however, as the AI founding cities would trigger it to build more settlers and having more settlers would cause it to found more cities. I've never tried that so I don't know how bad it would be in practice. Worst case scenario is every AI builds nothing but settlers until the map is full.

Did you notice the AI settling change after you altered one of the mod options, or do you think it was simply running the mod that caused that?
I tried again after uninstalling the mod and verifying the game files on Steam, both with and without C3X. The AI builds between 147-150 cities (the F11 option is very useful to track this) on both modded and unmodded versions; before, it was probably 50-60 cities with the mod, and they would not settle on islands either.

That said, there still are a couple small gaps in the map, maybe in areas the AI deems as not-so-strategic (though, there was one area with a bunch of bonus resources, and the AI simply let their borders expand far and beyond the production limits of the nearest city).I'm wondering, are there any options that change how the AI decides where to build cities? Ultimately, I think the major problem has been fixed with a reinstall, and what I'm noticing now is likely dependent on the seed and terrain of the particular map. So now I'm just curious of whether there's any options I can control for AI settling/founding rules.

If I want to alter the perfume option, do I simply add it to the config I'm using? I also redownloaded the mod, and it seems I must have had an older config file; now I see the options in there.
 
Last edited:
Good idea, I testing with R26. But surprisingly that's not it, when I test again with R25 I still get 264 calls. Very odd. Have you changed anything in the C3X config? For my tests, I've only set measure_turn_times and convert_some_popups_into_online_mp_messages to true. I highly doubt it's related to RNG since I've never seen the game use any of the x86 RNG instructions. Its main, and probably only, random number generator is a basic linear congruential generator, so each number is generated by a couple of basic integer operations.
Nope, I only have measure_turn_times enabled for that game.
Just re-ran the test on Win10 to rule out differences between Windows supplied C function dll's, since that is a very known troublemaker as M$ made plenty of compatibility-breaking changes in W10/11 there, but the call count turned out 265 as well (with slightly worse total times compared to W7).
If the game does integer->float->integer conversions for any percentage values without rounding them back up then this could be the cause - AMD and Intel CPUs (even Intel CPUs vs Intel CPUs from different architectural generations) do produce different results due to floating point inherent inaccuracy. If the game uses full length of the floating point number to make any calculations regarding peace/war/embargo calculations then different CPU platforms will produce different outcomes there.
At least I think the 1 less call is due to that - I can see messages during the turn popping in when nations embargo you and then some cancel their embargo + some AIs embargo other AIs or something.

Edit: Since the post got mod-approval lock due to me fixing a typo I might as well use that as opportunity to showcase how "funny" floating point inaccuracies can be.
Here you have modern Intel and AMD float discrepancy, that PS3 emulator developers ran into:

And here a huge difference that even a compiler picking older vs newer instruction does, with TF2 Windows servers off by one in their calculations compared to TF2 Linux servers:

For less knowledgeable readers
, this is what always happens when floating point operations are involved :lol:
 

Attachments

  • Civ3Conquests_20251219_080244.png
    Civ3Conquests_20251219_080244.png
    2.1 MB · Views: 61
Last edited:
Question on Day/Night Cycle; Attached are the images from the WWII Conquest Scenario. I added an Airfield and some Outpost in the Philippines as part of this test. See Editor and then Game images.
The Art/Terrain folder for this conquest only has two .pcx files for the airfields and nothing else. I guess the question is, where is it getting these craters from? Or how can I get it to just use the base graphics for this scenario?
 

Attachments

  • Day-Night Editor.jpg
    Day-Night Editor.jpg
    533.6 KB · Views: 43
  • Day-Night Game.jpg
    Day-Night Game.jpg
    488.1 KB · Views: 44
Question on Day/Night Cycle; Attached are the images from the WWII Conquest Scenario. I added an Airfield and some Outpost in the Philippines as part of this test. See Editor and then Game images.
The Art/Terrain folder for this conquest only has two .pcx files for the airfields and nothing else. I guess the question is, where is it getting these craters from? Or how can I get it to just use the base graphics for this scenario?
Those look like the craters that you get when you bombard a tile. You might want to check the Art Folder and make sure that there are not problems there.
 
Ive thought of a way to make specialists that the ai can use with current in-game mechanics but it redefines what a specialist is making them a "building", and redefining corruption (optional) to manipulate outputs between a bldg that needs a specialist and specialists themselves.

I tried to make my request as simple as possible. Can we get an option for a building to consume 1 population after being built? Otherwise specialists seem to be free not coming from city population.
 
Not sure if these have been mentioned but the ability to adjust the SDI defense's percent change to intercept nukes.

The ability to reduce the collateral damage of nukes to a single tile or INCREASE IT and or turn off its unit collateral damage.

Then the ability to take the nukes collateral damage flag and apply it to other units giving them the ability to damage units in a stack would all be great features.
 
Back
Top Bottom