• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.
Resource icon

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

Think of the command prompt like a less pretty version of windows explorer. The current directory is your system folder, but you want it to be your civ 3 folder. There's a nice little shortcut to do that which I use all the time.

Open the civ 3 folder that has install.bat in it. Click on the white "address bar" at the top of the window. Delete what's in it and type "cmd" then press enter.

This will start command prompt in the right directory. Now type install.bat, press enter and see what it does
 
Okay, I did this and it said something about a potential virus. My laptop came with 1 month free subscription of McAfee, so I put the Install.bat file on the exclusion list so could run it.

The new message says the temp.exe file is being run by another process.

Could this still be McAfee trying to stop me from playing C3X? :(
 

Attachments

  • IMG_2333.jpeg
    IMG_2333.jpeg
    1.5 MB · Views: 20
  • IMG_2340.jpeg
    IMG_2340.jpeg
    1.6 MB · Views: 20
Last edited:
Hello,

First off, thank you for creating this! The QoL improvements really make this old game even better to play!

However, I seem to have run into a problem. I don't know if it is related to C3X or not. So I'm looking for advice on how to diagnose the problem.

Some basic info:
OS: XP SP4 v3.1b
CPU: Pentium Dual-Core E6800 @ 3.33GHz
RAM: 2GB
Civ3Conquests.exe v1.22 3,517KB (size as patched by C3X) noCD
C3X R22

C3X did not install on the noCD .exe I had been using in the past, so I used the info in the thread to find the noCD .exe that C3X liked. It seemed to patch the file just fine, and no problems at all until 304 turns into the game. I do own the Civilization III Complete gold box set.

This is the first game I have played with C3X, and it has been perfect until turn 304-305. I end turn 304 and when it seems it is close to or at the end of the AI turns, near the point where turn 305 should start, it crashes. Is there any debug mode that can be activated to produce logging/dump data to be examined? I have tried going back a few saves and just hitting the next turn button but it still crashes at the same point. I tried turning off all animations and sound, same result. Completely rebooted the computer several times. If I play through previous turns there is no problem until I end turn 304.

The .biq is not bog standard Conquests, the changed settings are:
World Size: 160x160
Width: 160
Height: 160
Number of Civs: 25
Distance Between Civs: 24
Optimal Number of Cities: 36
Tech Rate: 460

Of course I can provide save files, .biq, the patched Civ3Conquests.exe, and the Windows crash report file if that would help. Just tell me where to post/send the files.

My custom.c3x_config.ini contains:
dont_pause_for_love_the_king_messages = false
suppress_hypertext_links_exceeded_popup = false
warn_when_chosen_building_would_replace_another = true
do_not_unassign_workers_from_polluted_tiles = true
patch_disease_stopping_tech_flag_bug = true
intercept_recon_missions = true
charge_one_move_for_recon_and_interception = true
enable_city_capture_by_barbarians = true
show_total_city_count = true

I've never had a crash with Conquests before, and I've been playing it on XP for many years now. But of course it could be just a coincidence that this crash is happening the first time I tried C3X.

Thanks!
 
Hi, first time I have logged back into this site in possibly 10 years since 2020, just so I can ask one or two stupid questions.

If I turn up the workable tiles will the AI alter how they place cities?

and

If I limit the number of units per tile including in cities will the AI stack some of its defenders outside of its cities to keep them safe?
(Would be cool if the AI learned how to use fortress and barricades as well, but I have never seen that at all)


Also as a separate request could you pretty please create a setting that adjusts how much the AI spreads our or how fast. The way my family likes to play it is incredibly annoying that the AI gobbles up all the land.

Or, maybe a setting on how much they are willing to settle right next.
(They even love to land on a nearly fully occupied island just to eat a few tiles. I even saw settles do this in a war zone, sneaking in when a city was razed.)

I'm assuming the answer to both of my questions and my request is no, but I had to ask anyway. Thanks for the mod and all the work, I look forward to checking it out more.
 
The mod currently has a building_prereqs_for_units as a strict rule. Is it possible to soften it so that an improvement changes production by a variable percentage for the listed units (similar to Civ 4)? For example, instead of a strict harbor prerequisite for triremes, their production will be accelerated by 25-50-75-100% if there is a harbor in the city, or vice versa - slowed down if there is no one. This would be both more realistic and easier for AI behavior. I would even prefer the second one (to slow down), because there will be no need to change the cost of units.

This idea can be extended to some resources, such as stone. If there is no stone in the city radius, then the speed of stone-tying improvements production is halved.
 
Last edited:
Of course I can provide save files, .biq, the patched Civ3Conquests.exe, and the Windows crash report file if that would help. Just tell me where to post/send the files.
...
I've never had a crash with Conquests before, and I've been playing it on XP for many years now. But of course it could be just a coincidence that this crash is happening the first time I tried C3X.
Please post the save file. By far the easiest way to figure out what's causing a crash is to run the game with a debugger attached then let it crash and inspect what it was doing when that happened. You can post it in this thread or PM it to me if you prefer. Honestly, this crash is probably caused by C3X, if only because I've already fixed the well known crashes in the base game.

If I turn up the workable tiles will the AI alter how they place cities?
The city work radius doesn't, or at least it isn't supposed to, affect how the AI places its cities. I've actually gone back and forth on this. At first, expanding the work radius caused the AI to spread its cities out because I patched every work area loop in the game, and that included some logic in the AI's city location evaluator that steered it away from locations with overlapping work areas. However, that caused the AI to spread its cities out too much in my opinion and in the end I decided it made more sense for the work radius not to be tangled with AI city placement. If you want the AI to spread its cities out, you can force it to do so by increasing the minimum_city_separation setting. Of course, that applies to any human players too. I've been thinking of adding a config option that controls how densely the AI tends to found cities, mostly because I don't think it founds densely enough under the standard rules, but that's not easy to do.

If I limit the number of units per tile including in cities will the AI stack some of its defenders outside of its cities to keep them safe?
(Would be cool if the AI learned how to use fortress and barricades as well, but I have never seen that at all)
Both of those things would require relatively elaborate changes to the unit AI.

Also as a separate request could you pretty please create a setting that adjusts how much the AI spreads our or how fast. The way my family likes to play it is incredibly annoying that the AI gobbles up all the land.
I'm not sure what would be the best way to do this. There are no knobs inside the AI that control how quickly it expands other than its preference for producing settlers. Negative perfume could reduce that preference but could also backfire by pushing settlers below other build options in all cases. Probably the simplest solution is to apply temporary negative perfume to settlers for AI players each time they found a city. That way they'd have a "cooling off" period where they're discourages from training settlers after founding a city. That would be easy to implement.

The mod currently has a building_prereqs_for_units as a strict rule. Is it possible to soften it so that an improvement changes production by a variable percentage for the listed units (similar to Civ 4)?
This is unfortunately pretty awkward. What you're asking for would be very exploitable since players can switch production midway. One way to solve that would be to track how many bonus shields have been accumulated on the current build and remove them if the player switches to something else. Another way would be to follow what the base game already does with trait bonuses, which is to reduce the cost of a build instead of granting bonus shields. The issue with doing that is that unit and building costs are internally properties of the player not the city. I.e., the function to determine the cost of something is given a building or unit ID and a player, and it does not know which city the build might be for. I'd have to pass that information in through a side channel, which is possible but it's an annoyingly large amount of work.
 
This is unfortunately pretty awkward. What you're asking for would be very exploitable since players can switch production midway. One way to solve that would be to track how many bonus shields have been accumulated on the current build and remove them if the player switches to something else. Another way would be to follow what the base game already does with trait bonuses, which is to reduce the cost of a build instead of granting bonus shields. The issue with doing that is that unit and building costs are internally properties of the player not the city. I.e., the function to determine the cost of something is given a building or unit ID and a player, and it does not know which city the build might be for. I'd have to pass that information in through a side channel, which is possible but it's an annoyingly large amount of work.
Okay, but what if to add the inverse building_prereqs_for_units, so that the presence of some improvement in the city prohibits the production of listed units? Then we could create two versions of one unit in the editor (expensive and cheap), the first would be for production in a city without the necessary improvement, and the second - for a city with the necessary improvement. The inverted function is only needed to remove the more expensive unit from the production options after the improvement is built, so that it doesn't disturb both the player and the AI. I'm not sure that this implementation will please everyone, but if it is very easy to implement, for example, by simply inverting building_prereqs_for_units, then the efficiency of this small addition will be not bad.
 
Hello, I downloaded the C3X mod and have tried following the instructions for getting it to work on mac. I have used Kegworks and the built in wine of porting kit. I get the attached error message every time i try to run the install.bat.
Any help would be appreciated.
I even found 'are_tiles_adjacent' in the injected code file, but my coding skills are very limited.
Screenshot 2025-06-04 at 17.55.11.png
 
I'm not sure what would be the best way to do this. There are no knobs inside the AI that control how quickly it expands other than its preference for producing settlers. Negative perfume could reduce that preference but could also backfire by pushing settlers below other build options in all cases. Probably the simplest solution is to apply temporary negative perfume to settlers for AI players each time they found a city. That way they'd have a "cooling off" period where they're discourages from training settlers after founding a city. That would be easy to implement.
To be entirely honest, civ 3 is built entirely upon the fast expand - if the AI expanded any slower, I don't think it would be able to pose any challenge.
The mod currently has a building_prereqs_for_units as a strict rule. Is it possible to soften it so that an improvement changes production by a variable percentage for the listed units (similar to Civ 4)? For example, instead of a strict harbor prerequisite for triremes, their production will be accelerated by 25-50-75-100% if there is a harbor in the city, or vice versa - slowed down if there is no one. This would be both more realistic and easier for AI behavior. I would even prefer the second one (to slow down), because there will be no need to change the cost of units.

This idea can be extended to some resources, such as stone. If there is no stone in the city radius, then the speed of stone-tying improvements production is halved.
Easiest way of implementing that on a biq side would be using unit upgrades, I guess - having better or cheaper versions which need local resources.
 
Easiest way of implementing that on a biq side would be using unit upgrades, I guess - having better or cheaper versions which need local resources.
This method is no different in efficiency than building_prereqs_for_units, because units that take longer to product will remain available for production. My idea is that cheaper analogues would replace more expensive ones.
 
Here it is. Thanks for looking into it!
And thank you for providing details about this bug. As it turns out, it's not a bug in C3X, it's a issue in the base game which must be pretty rare. The crash is caused by a division by zero in the AI's logic to consider whether to sign a military alliance. As part of assigning a cost/value to the alliance, it determines the distance from its capital to the nearest city belonging to the target of the alliance, then computes 64 divided by that distance. Somehow the distance ends up being zero.

I'm not sure how that happens exactly. What I observed is that the human player is involved somehow because the closest city it finds is Berlin, which means it must have been searching for the city closest to Berlin's tile, but I don't know why it would do that. The fact that the crash always happens between turns 304 and 305 suggests that it's a renegotiation of an alliance signed 20 turns before that. I noticed that you don't have preserve random seed turned on. Also, I tried signing peace in your two ongoing wars and found that that solves the crash, which again confirms it's something to do with a military alliance with the human player. That's one way to fix the crash, though I didn't check whether that ruins your trade rep.

A total fix is easy too. All I have to do is insert a bit of logic that runs after the game determines the closest city distance, checks if it's zero, and if so sets it to one instead. That will be in R23 Preview 2, which I hope to post on Saturday. I'm trying to get these preview versions out more quickly.

Okay, but what if to add the inverse building_prereqs_for_units, so that the presence of some improvement in the city prohibits the production of listed units?
That wouldn't be hard as it's mostly the same logic as the existing building prereqs. I really wish I had Lua for this sort of thing. However, I don't see why using upgrades for this wouldn't work as AA mentioned. You'd have an expensive unit that upgrades to a cheap alternative that requires a building and has the same stats. Having the upgrade available would remove the expensive unit as a build option, like how connecting iron for swordsmen annoyingly makes warriors unbuildable. Even with building anti-prereqs, you'd want the cheap & expensive variations to be on the same upgrade chain anyway, no?

Hello, I downloaded the C3X mod and have tried following the instructions for getting it to work on mac. I have used Kegworks and the built in wine of porting kit. I get the attached error message every time i try to run the install.bat.
Any help would be appreciated.
I even found 'are_tiles_adjacent' in the injected code file, but my coding skills are very limited.
That's very odd. There's nothing wrong with are_tiles_adjacent per se, of course because it compiles correctly on other systems. It looks like the bool type is somehow not defined. That doesn't make sense since injected_code.c includes C3X.h, which also uses the bool type, so I'd expect this error to appear there if anywhere. You could try manually defining the bool type at the top of injected_code.c like so:
C:
typedef char bool;
#define true 1
#define false 0
Though I doubt that would work. Even if it solves this particular error, there will likely be others coming from whatever the underlying problem is.
 
And thank you for providing details about this bug. As it turns out, it's not a bug in C3X, it's a issue in the base game which must be pretty rare.
That was fast!

I noticed that you don't have preserve random seed turned on.
Should I have that turned on normally?

Also, I tried signing peace in your two ongoing wars and found that that solves the crash, which again confirms it's something to do with a military alliance with the human player. That's one way to fix the crash, though I didn't check whether that ruins your trade rep.
I think my trade rep got ruined about 10-20 turns back despite being very cautious to protect it because since then all the AIs refuse all my GPT offers. I am glad to hear I can get around the bug and continue my game.

A total fix is easy too. All I have to do is insert a bit of logic that runs after the game determines the closest city distance, checks if it's zero, and if so sets it to one instead. That will be in R23 Preview 2, which I hope to post on Saturday. I'm trying to get these preview versions out more quickly.
Great to hear this can be fixed so that nobody else will run into it even though it's apparently rare. I love Civ3 games on a grand scale and the QoL features in C3X make it a lot less tedious to play like that. Disorder warning, the trade screen improvements, the stack unit commands, and the AI enhancements like using armies and artillery all really fix the biggest complaints I had about the game.

Thanks!
 
So, speaking of ruined trade reputation: is there any chance to add a feature where you get a pop-up telling you that your trade rep got trashed by something that just happened? A lot of times I think there is a sizable gap in turns between the event and my noticing of it. So I think it would help me learn better from my mistakes if there was immediate feedback.

Best regards!
 
I would like to add the following to my post #2,759:

6. Flag units. The following situation arose in the game. I attacked an enemy transport ship that had several units. Among them was a unit with a captured flag unit (red). As a result of the attack, the transport ship was not sunk (as usually happens), but captured along with this unit. I cannot build such a unit or upgrade it to another unit. But it belongs to my civilization and requires money for maintenance. The transport ship has a different nationality and is displayed in the captured units window (when pressing F3).
Has anyone encountered a similar situation?
Civ-III_Flag Unit.jpg

7. I noticed that the Army (without loaded units) moves along the railways without restrictions. If you load at least one unit into the army, everything works fine, with restrictions.
Can this be fixed?
C3X settings:
limit_railroad_movement = 12
limited_railroads_work_like_fast_roads = false
Civ-III_Army.jpg

8. When AI detects barbarians in its territory, it starts a "crowd party".
For example, a barbarian appears in the south. Even if there is an AI unit next to it that can attack it, all AI units start moving south. The unit that is next to the barbarian only attacks when it gets to its turn. If the barbarian appears in the north on the next turn, everything is repeated in reverse. This increases the turn time, especially in DEBUG mode.
Is there a way to fix this?
 
7. I noticed that the Army (without loaded units) moves along the railways without restrictions. If you load at least one unit into the army, everything works fine, with restrictions.
Can this be fixed?
I've noticed that too. Movement restrictions don't seem to apply to empty Armies, at present.

I encountered a similar (opposite) issue with an early version of my 2021 EXPANSION mod. Whenever you set the road movement multiplier to 1, then all Armies will have zero movement (start each move with a red lamp) and be permanently stuck where they are created, unless they are loaded with other units. This won't happen if the road multiplier is higher than 1, and it doesn't matter whether the Army is on a road or not. Don't know why, it's not logical to me.
 
I've noticed that too. Movement restrictions don't seem to apply to empty Armies, at present.

I encountered a similar (opposite) issue with an early version of my 2021 EXPANSION mod. Whenever you set the road movement multiplier to 1, then all Armies will have zero movement (start each move with a red lamp) and be permanently stuck where they are created, unless they are loaded with other units. This won't happen if the road multiplier is higher than 1, and it doesn't matter whether the Army is on a road or not. Don't know why, it's not logical to me.
In this mod:
- normal road movement = 6;
- railway multiplier = 2.
 
Back
Top Bottom