Resource icon

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

There's a few things quality of life improvements that I'd love to see included in C3X if at all possible.

The biggest one would be a stack re-base button (for bombers, jet fighters, etc.). My hand gets very tired of pressing Shift + R so many times.

Another one that's minor, but it really adds up, is the game continually forgetting the view grid setting upon reloading a game. It would be such a nice little QOL change to have it remember that I had it turned on last time I was playing.

Another hopefully simple change would be if a unit no longer had any moves left that turn, that it would be grayed out in the context menu (similar to how units inside armies are grayed out). This would make scanning the list of units in a stack to see who has any more remaining moves so much easier!

This one seems like it would be much harder to do, but I find myself constantly wishing for it. In the city improvements list, it would be amazing if you could start typing the letter (or first few letters) of the name of the improvement and have the scroll position jump down to that item (just like how this works for most lists in Windows). This feature alone would save SO much scrolling down / using the mouse wheel by the later stages of the game.

And finally, would it be possible to modify the game to finally allow your score to be added to the Hall of Fame screen when playing with modded rules (i.e. anything other than the default conquests.biq), and just place an asterisk next to the score? (and then maybe at the bottom of the screen just have a small line of text that says something like: [* games marked with an asterisk were played using customized rules]. After all, it's our game, and the hall of fame is just for us. I mean, I can already put scores in there by editing the HighScores.cv3, but I'd rather not have to because it's so annoying.

Thanks @Flintlock for all your hard work!!
 
Last edited:
And finally, would it be possible to modify the game to finally allow your score to be added to the Hall of Fame screen when playing with modded rules (i.e. anything other than the default conquests.biq), and just place an asterisk next to the score? (and then maybe at the bottom of the screen just have a small line of text that says something like: [* games marked with an asterisk were played using customized rules]. After all, it's our game, and the hall of fame is just for us. I mean, I can already put scores in there by editing the HighScores.cv3, but I'd rather not have to because it's so annoying.

Thanks @Flintlock for all your hard work!!
I'd love this. Just to keep track. It's just for me. It isn't some kind of world ranking. Hell, I even miss the palace building mini-game sometimes.
 
@Flintlock May I make a feature request that is more or less in line with original C3X features? My recent ongoing game on Monstrosity map with hundreds of own units and total 28k of them between AIs in the world made me painfully aware of movement system/selection shortcomings.
It would be nice to see Stack Load/Unload added for units to get into/out of ships, etc. Currently the only way to mass load hundreds of units into a ship is by wasting a movement point to stack move to ship, and unfortunately stack move OUT of ship doesn't work - gotta wake all onboard units, turn on caps lock to skip movement animations and hold down numpad key for 2-5+ minutes of hundreds of units to disembark one by one. On top of wasting two turns, since Load/Unload doesn't waste unit movement if it's done inside cities, while getting them in/out of ship with move order does. Big OUCH.

Having a feature to select how many units of current type you'd like to move out of stack, like with a popup prompt to type in the amount. Technically it could be realized by simulating what player can do - fortify whole stack then right click it and shift+keep on clicking on the selected unit from the list for ages until desired number gets activated. Also even better if it would allow to select and separate out units of same type with different veterancy status.
Doing this in-game manually doesn't really work for large stack as for whatever reason the right click context menu takes several seconds to show up and between shift clicks past like 200 hundreds in a stack, and rapidly deteriorates as the number of units in a square increases, so having such feature would not just be a convience but actually a necessity for games with such large stacks.

Speaking of, if one moves a stack at least 2 squares it always goes properly, as single unit, but if one moves them only one square... game decides (everytime) that it will move all the units in the stack one by one, which even without movement animation, takes forever when its 200-400 sized stack. :lol: If you were able to fix it so they move as "one" that would be awesome.

One little and probably easiest feature to implement - could you add an option to disable revolt (from warweariness) for Democracy? Two fold reason: I'd like to set that govt to be still penalized with x2 higher/quicker ww than Rep gets, which is not possible right now, and without the stu...silly formula Firaxis came with - since on AI turn getting just attacked by one unit increaments WW by 1, regardless if you win or not the combat, that means getting hit by 50-75 AI units stack will cause Demo player to have an autorevolt :lol: At this specific maps even tiniest AI nations have 1000-2000 units sized armies so playing fair (not abusing tunnel-of-death combat tactics) means Demo govt is completely off the cards, I'd like to see that changed. :) If such setting could be added, with option to apply it to ongoing game (as far as I'm aware Monstrosity map doesn't utilize C3X configs?) via exe start parameter or whatever, it would be game changer for me, pun unintended.

BTW about someone mentioning WinXP issues - be aware that Microsoft on purpose broke XP compatibility for executables/dll's built using newer Visual Studios, so that could be it.
Selecting from build settings to make it XP compatible doesn't cut it - VS still stuffs built binaries with W10/11 winapi/C runtime calls, even if those calls are never used. The work around (albeit for older Visual Studio versions, like 2015-2018 editions), on top of selecting the compat mode, was to include the XP compatible dll's hidden somewhere in VS subfolders, with the built binaries so that they could be actually ran on XP - and nope, no relevant visual C runtime redist from Microsoft exist for that. Long story short - Microsoft doing evil things they are best at.

Cheers, hope you keep your great work going. :hug:
 
The biggest one would be a stack re-base button (for bombers, jet fighters, etc.). My hand gets very tired of pressing Shift + R so many times.
You have the two stack movement buttons. In my games they also worked for rebasing stacks of aircraft.
 
Last edited:
You have the two stack movement buttons. In my games they also worked for rebasing stacks of aircraft.
Yes, I realize that. However, the game practically corrals you into thinking the movement of aircraft units are fundamentally different than other units. The re-base button being one of the ways it does this (and the Shift+R hotkey). For a casual or newbie player, they may not realize that you can stack-move planes, and end up wasting lots of time and energy moving bomber doomstacks one by one using the prominent button on the UI or the hotkey. It would be so much better to simply enable a stack re-base button that effectively just calls the stack movement commands.
 
They also won't rework tiles. I fully believe programming them to rework tiles would have been more difficult. So, irrigating some grassland tiles in despotism perhaps works out better for them than if they mined and then couldn't grow cities once they get aqueducts or hospitals.
Yeah, I discovered this for myself a while back when I was trying to improve the behavior of AI workers. For one thing, if you allow AI workers to replace tile improvements they can easily get stuck in cycles of mining over irrigation then irrigating over the mine again and again on the same tile. For the human player that wouldn't be such a big deal, it's just a wasted worker. For the AI it's much worse since it has no workers to spare, it doesn't build enough to begin with. For a similar reason, if you "fix" the AI irrigating grassland in despotism it will end up working more unimproved tiles since mining all that grassland takes longer than irrigating it would have.

Is there a way to get precision strikes to work together with the cruise missile unit ability? Right now a cruise missile can perform precision strikes, but it just won't die afterwards.

Is there a way to have multiple config patches for different scenarios? I've been using only 1 patch for everything. I tried copy pasting that patch into the WWII Pacific scenario folder to see if the game will read from that but it doesn't seem to work. When I erased the original patch in my "C3X" folder, the game refuses to read the patch in the WWII Pacific folder.
(1) Probably. I'd have to test to make sure, but after browsing the code, it looks like it should be possible to despawn cruise missiles after they perform precision strikes. (2) It is possible to have different configs for different scenarios. If you place a config file named scenario.c3x_config.ini inside a scenario's folder, it will be loaded when that scenario is and the settings in that file will override the ones from the default config.

There's a few things quality of life improvements that I'd love to see included in C3X if at all possible.
Stack rebase should be easy. I remember someone requested that a long time ago just after I did stack bombard, but I didn't prioritize it since it's pretty much already in the game as Civinator mentioned. If it's something people want though, I could add it. That reminds me there were a few more stack commands I was going to add to complete the set. Stack sentry in particular I've gotten a few requests for.

I still haven't gotten around to working out a way to pack additional data into save files. The easiest thing here would probably be to make it so that the game honors the GridOn setting in conquests.ini when loading a save. Right now it looks like that setting only applies to new games, which is odd since it gets updated every time you toggle the grid.

That's a good idea to gray out units on the right click menu that have no remaining moves. I'll have to look into that. Hopefully the grayed out effect is easy to apply to right click menu items. I remember it was for technologies when I added the option to gray out untradable techs. In that case each menu item was a little object with a switch to gray it out.

You're right it would be difficult to add a search ability to the list of city buildings. Maybe some day...

It should be easy to record high scores for modded games. I'd have to figure out how it's determined whether or not a game is modded, though. That's another thing I've been thinking about for a while but haven't gotten around to yet, that and things like how BIQs are packed into save files.

@Flintlock May I make a feature request that is more or less in line with original C3X features? My recent ongoing game on Monstrosity map with hundreds of own units and total 28k of them between AIs in the world made me painfully aware of movement system/selection shortcomings.
Wow 28k units! Stack load & unload shouldn't be too hard. Maybe I should just finish up the rest of the stack commands for R18. That's something I've been thinking of doing for a while now.

Waking a specific inputted number of units would be difficult since I've never tried adding a popup like that before. Though maybe it would be easy and I don't know since I've never tried. I'm not sure if it would be possible to reuse the input gold amount popup for this. This issue reminds me of playing Master of Orion 3 many years ago. In order to load ships into fleets from (IIRC) some sort of empire-wide reserve, you had to double click them out of a list. So if a fleet lost 50 ships in a battle, you'd have to click 100 times to replace them. In the late game that sort of thing would happen every turn. Eventually I got so fed up with the clicking that I wrote a little C++ program that submitted click events automatically through Windows. So I'd mouse over the list of ships then press a key and wait while it clicked 100 times for me. MoO 3 I think had the worst interface I've ever seen in a video game.

I wonder why it is that the speed of populating the right click menu "deteriorates rapidly" as you said. I hope that's not because of C3X doing unit grouping.

I'll have to look into why the game moves stacks individually between adjacent tiles versus all at once over longer distances. Hopefully I can just edit an if statement somewhere to make it move all at once all the time. Although that might not be possible since, based on what I've seen of the movement code, moves between adjacent tiles follow a pretty different code path since they don't invoke the pathfinder.

Preventing WW revolts in democracy should be easy. That's probably just a matter of editing an if statement somewhere. The hard part would be finding it. Monstrosity doesn't have a search folder so there's no easy way to change the config for a save game just for that scenario. You'd just have to edit the default config.

BTW about someone mentioning WinXP issues - be aware that Microsoft on purpose broke XP compatibility for executables/dll's built using newer Visual Studios, so that could be it.
If TCC can't run on XP that would explain why the mod doesn't work. Both the batch files require TCC to work since the patcher component of the mod is written in C but run like a script using TCC. The build of TCC that's included with the mod is one I compiled myself a few years back (since the official builds were far obsolete even then). I didn't use VS but MSVC directly for that.
 
The easiest thing here would probably be to make it so that the game honors the GridOn setting in conquests.ini when loading a save. Right now it looks like that setting only applies to new games, which is odd since it gets updated every time you toggle the grid.
Yeah, it would great to just have an option that leaves the grid view how you last had it, regardless of the save file you were playing, since I tend to usually always have it on anyway. It would be easier to store that in the ini file than trying to figure out how to pack something into the .sav file. Right now I have to re-toggle the setting every time I start up a game, so it would be much nicer to have it remember.

You're right it would be difficult to add a search ability to the list of city buildings. Maybe some day...
And just to be clear, I didn't mean like a search box or anything like that.. I just meant how like in File Explorer for example, if you're looking at a list of filenames, you can just simply start typing the keys of the first few letters of the file name you'd like to jump down to and Windows will automatically move the selection focus down to that file. I imagine that's still not something simple to do with something like Civ3 that obviously isn't relying on native Win32 API ListView/ListBox calls to create the city improvement list, but I just wanted to make it clear that I didn't mean adding anything extra to the UI -- just simply using the keys on the keyboard to jump down to the item you were looking for, to save my poor fingers from scrolling down a hundred times during the late game, where the list of city improvements just seems to go on and on. But I understand that this could be a big ask. I was just trying to think of ways to do it as simply as possible, since this is a pretty significant source of grind / friction during the late stages of the game.
 
I second the requests for graying out spent units (or if that's difficult, at least reformatting the string) and remembering the grid setting!
Done! At least that first thing. Here's how it looks:
disabled_units_on_menu.png

Nothing wrong with that, the only problem is that to get this effect those menu items have to be disabled which makes it so that clicking them does nothing. You no longer get the "This unit has already moved" message after clicking them. The menu simply disappears. I'd like to restore those little messages though I'm not sure it's worth the effort.

This was a relatively easy change to make. It's similar to what I mentioned with the items on the trade screen in that it's basically a matter of flipping a switch (technically calling a method to disable each menu item). The only hard part was identifying the method, which took longer than it should have since it ended up being in the last place I checked. In the mean time I found out how to apply various other effects to the menu like making the text red and adding an image next to an item. I also discovered this:
checkboxes_on_menu.png

The game has a method for adding checkboxes to menu items. The checkboxes don't actually work. They're effectively just for show. Even shift-clicking on a checkbox doesn't toggle it, instead it selects that menu item like the box wasn't there. This makes me think the devs were originally planning to allow for multiple unit selection but that feature got cut before release.

And just to be clear, I didn't mean like a search box or anything like that.. I just meant how like in File Explorer for example, if you're looking at a list of filenames, you can just simply start typing the keys of the first few letters of the file name you'd like to jump down to and Windows will automatically move the selection focus down to that file. I imagine that's still not something simple to do with something like Civ3 that obviously isn't relying on native Win32 API ListView/ListBox calls to create the city improvement list, but I just wanted to make it clear that I didn't mean adding anything extra to the UI -- just simply using the keys on the keyboard to jump down to the item you were looking for
I feel like, if the interface is responding to multiple key presses, there should be some visual indication of which key presses have been recorded so far. I see File Explorer doesn't do that, but then again I didn't even know it was possible to jump to a file by typing its name until you mentioned it, so that's not good UI design in my opinion. Ideally I could add a text box that users could type in to filter the list of improvements. That would probably be pretty difficult but might not be. I've already been able to reuse one of the game's UI widgets (the mod info button on the preferences screen) and that wasn't too hard.
 
but then again I didn't even know it was possible to jump to a file by typing its name until you mentioned it, so that's not good UI design in my opinion.
I won't disagree with you there, it's very murky UI design :lol: ... However I just assumed it was semi-common knowledge about that little trick because it's been in every version of Windows since way back. Try it out, it works in all kinds of things. It'll work in pretty much any Windows app that uses a WinAPI ListView or ListBox (which is a LOT of software!). It saves a lot of time whenever you're working with a long list of any kind.
 
Idle thought:

Would it be possible to patch the game so that an unwanted Hospital and/or Aqueduct in any town can also be sold off (like all the other buildings) -- ideally with the proviso that the sale is only allowed if the town has <Pop13 and/or <Pop7, respectively (to prevent exploitation)?

(That is, any building with the "Allows Settlement Size 3" or "Allows Settlement Size 2" generic building-flags in the .biq could be sold, if the town is below the respective size-threshold)

I'm thinking particularly about towns captured during the late game, where you end up paying maintenance on these buildings even when it's just going to be a Pop5-6 beaker-farm (or you have to raze/ abandon the town).
 
Last edited:
Bug C3X v.16
There are two naval transports and two battleships. I move this ships in group (default button X). Battleships are moving in group but naval transports are moving by one.
In game without C3X v.16 all ships are moving in group.

Attached save and my C3X config.ini

Test.jpg
 

Attachments

  • Bug ships.SAV
    52.3 KB · Views: 3
  • default.c3x_config.zip
    7.9 KB · Views: 3
First of all thanks a lot for all the fixes, it's amazing!
I found a bug. When a unit in autoexplore finds a goody hut, and the gift is a philosophy, the free tech bonus is canceled.

There is an improvement I would like to see.
At certain stages in the game, there are a lot of units scattered on the map, and collecting them is a real headache... If it was possible to add the option to wake all the units of a certain type with one click, it would be very helpful
1713232082658.png

Sorry if I wrote unclearly, I use Google Translate
 
Last edited:
I hope that this does not make it more difficult to identify enemy HN units in your territory.
I'm not sure what you're referring to exactly but, now that you mention it, it wouldn't make sense to gray out units belonging to other civs anyway.

Would it be possible to patch the game so that an unwanted Hospital and/or Aqueduct in any town can also be sold off (like all the other buildings) -- ideally with the proviso that the sale is only allowed if the town has <Pop13 and/or <Pop7, respectively (to prevent exploitation)?
I'll look into this. This might be very easy if there's a function call (or several) that determines whether or not buildings are sellable. If all the logic is piled together in one large function, editing it would be significantly harder.

Bug C3X v.16
There are two naval transports and two battleships. I move this ships in group (default button X). Battleships are moving in group but naval transports are moving by one.
In game without C3X v.16 all ships are moving in group.
This is a weird one. It's caused by the max_ai_naval_escorts config option. Setting that to zero for some reason stops naval units from properly moving in groups. That option works by modifying the value returned from a function that evaluates how many escorters a unit needs. I thought that function only applied to the AI but evidently I was wrong. I don't know exactly what the issue is since I don't need to in order to fix it. There's a simple solution: just exclude units owned by a human player from that setting. It's a one line change so you could apply it to your own copy of the mod if you're so inclined. Just find the following line in injected_code.c (in patch_Unit_eval_escort_requirement):
Code:
if (ai_strat & (UTAI_Naval_Transport | UTAI_Naval_Carrier | UTAI_Naval_Missile_Transport))
Replace it with this:
Code:
if ((~*p_human_player_bits & 1<<this->Body.CivID) && (ai_strat & (UTAI_Naval_Transport | UTAI_Naval_Carrier | UTAI_Naval_Missile_Transport)))
Then reinstall the mod. That modifies an if statement that normally checks if a unit's AI strategy is one of naval transport, naval carrier, or naval missile transport, to additionally check if the unit is owned by an AI player.

Thanks for reporting this.

First of all thanks a lot for all the fixes, it's amazing!
I found a bug. When a unit in autoexplore finds a goody hut, and the gift is a philosophy, the free tech bonus is canceled.
My pleasure! I'll look into that bug. I wonder why autoexplore makes a difference there.
 
I think the work you've done with escorts has been excellent. I think the difficulty with escorts is partially the number required, and also which units are chosen by the computer. Since Naval Power covers all kinds of bases, the AI can't tell to use a destroyer for protection and a battleship to bombard. They really needed to make an escort and a combat AI strategy, essentially offense and defense strategies for sea.
 
This is a weird one. It's caused by the max_ai_naval_escorts config option. Setting that to zero for some reason stops naval units from properly moving in groups. That option works by modifying the value returned from a function that evaluates how many escorters a unit needs. I thought that function only applied to the AI but evidently I was wrong. I don't know exactly what the issue is since I don't need to in order to fix it. There's a simple solution: just exclude units owned by a human player from that setting. It's a one line change so you could apply it to your own copy of the mod if you're so inclined. Just find the following line in injected_code.c (in patch_Unit_eval_escort_requirement):
Code:
if (ai_strat & (UTAI_Naval_Transport | UTAI_Naval_Carrier | UTAI_Naval_Missile_Transport))
Replace it with this:
Code:
if ((~*p_human_player_bits & 1<<this->Body.CivID) && (ai_strat & (UTAI_Naval_Transport | UTAI_Naval_Carrier | UTAI_Naval_Missile_Transport)))
Then reinstall the mod. That modifies an if statement that normally checks if a unit's AI strategy is one of naval transport, naval carrier, or naval missile transport, to additionally check if the unit is owned by an AI player.

Thanks for reporting this.
I did it. Thank you
 
Done! At least that first thing. Here's how it looks:
View attachment 688910
Nothing wrong with that, the only problem is that to get this effect those menu items have to be disabled which makes it so that clicking them does nothing. You no longer get the "This unit has already moved" message after clicking them. The menu simply disappears. I'd like to restore those little messages though I'm not sure it's worth the effort.

This was a relatively easy change to make. It's similar to what I mentioned with the items on the trade screen in that it's basically a matter of flipping a switch (technically calling a method to disable each menu item). The only hard part was identifying the method, which took longer than it should have since it ended up being in the last place I checked. In the mean time I found out how to apply various other effects to the menu like making the text red and adding an image next to an item. I also discovered this:
View attachment 688911
The game has a method for adding checkboxes to menu items. The checkboxes don't actually work. They're effectively just for show. Even shift-clicking on a checkbox doesn't toggle it, instead it selects that menu item like the box wasn't there. This makes me think the devs were originally planning to allow for multiple unit selection but that feature got cut before release.


I feel like, if the interface is responding to multiple key presses, there should be some visual indication of which key presses have been recorded so far. I see File Explorer doesn't do that, but then again I didn't even know it was possible to jump to a file by typing its name until you mentioned it, so that's not good UI design in my opinion. Ideally I could add a text box that users could type in to filter the list of improvements. That would probably be pretty difficult but might not be. I've already been able to reuse one of the game's UI widgets (the mod info button on the preferences screen) and that wasn't too hard.
This discovery is gold.

Since you did the work, its easy for you to add the following functionality:

The grayout menu entry refers to units without any other move points, but the checkbox entry could refer the unit can attack this round.

When I attack a city, I first bombard the units inside the city and then, manually select my attack units to attack.

Many times I cannot identify easily what units I used for attack and as a result a few times I select a unit that has already attacked and as a result I get the error: This unit has already attacked (something like that)

So, when you have a stack of units attacking enemy you can easily identify what units you used for attacking so you can select a unit that has not attacked.
 
Many times I cannot identify easily what units I used for attack and as a result a few times I select a unit that has already attacked and as a result I get the error: This unit has already attacked (something like that)

You definitely have a good idea about bombarding units before you attack.

For units before tanks, if they can pillage, then they have not attacked. I had to check on this, but also, if a unit cannot pillage, that unit cannot attack. I mean, I had a unit pillage a road first, and then it couldn't attack even though it hadn't moved. The "X" button thus correlates to a unit having the ability to attack.

There does exist an exception in the Cossack, but you won't get the "this unit has already attacked" with them, nor with tanks or modern armor.

Also, bombard units, as well as your stack of doom, on AI roads I would think would help when you want to move them to the next target.
 
I'm thinking particularly about towns captured during the late game, where you end up paying maintenance on these buildings even when it's just going to be a Pop5-6 beaker-farm (or you have to raze/ abandon the town).

I don't understand why you would need to abandon/raze them. Why not just have them use specialists at size 7? 1 gold for an aqueduct gets offset by 2 more unit support, and thus gives you one more gold per turn potentially.

A size 7 city needs 14 food per turn. Given that the city center gives 2 food per turn, the city needs 12 food from other tiles, and thus 4 irrigated plains tiles for 3 specialists. At size 6, a city needs 12 food per turn, and thus 10 food per turn from tiles which are not the city center. But, 3 plains tiles only gives 9 food per turn. So, the same city at size 6 might only have the potential to produce 2 specialists.
 
Top Bottom