Resource icon

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

This has probably already been requested, but if I have a wonder that effectively provides a barracks to every city, when I win a city by rebellion, the unit does not get the advantage of the barracks building. Sounds like an order of processing thing. In the process of transferring ownership, the unit is "gifted?" before the city is populated with the the appropriate unit as part of the city transfer process.
 
Personally I like it like this, except for the swords which are IMO a bit ugly. I'm going to keep them for now as I can't think of any other simple, clear way to indicate which units can attack.
I can't think of a better way to illustrate everything clearly, either. On principle I think swords is the right way to go. The challenge is making them clear, yet not too big, ugly or dominant. I've tried out several designs since R18 Preview 1 came out, and this (final version) is the best I could come up with. If you like it, feel free to use it. I've attached the PCX file at the end of this post.

Swords in menu:
R18 - Tiny grey swords.png



Closeup:
R18 - Tiny grey swords - Closeup.png

Compared to earlier versions, I made the sword smaller and thinner to match the size of the LED lamp. Together they look almost like a sword and shield combo. I changed the color from black (as in my last post), to a softer grey and brown which is easier on the eye, and moved them one pixel closer to the left edge. I also enhanced the colors of the LED lamps a little bit, just to make them clearer and stand out from the menu background more.
 

Attachments

Last edited:
Flintlock updated C3X with a new update entry:

Release 18

New in this version:
- Unit limits
- Expand AI two-city start to any number of cities
--- Config option has been renamed to ai_multi_city_start
- AI's starter cities in multi-city start can begin with improvements, inc. "extra palaces" which respawn like the real palace
- Right-click menu enhancements
--- Place icons next to units showing movement and combat status
--- Replace Wake/Activate with descriptions of what the units are doing
--- Gray out units if they have no remaining moves
---...

Read the rest of this update entry...
 
Here's what's changed in R18 from the preview version:
  • Expand AI two-city start to any number of cities -- The true-or-false enable_ai_two_city_start option is now called ai_multi_city_start. It takes an integer specifying how many cities the AIs are to start with.
  • AI's starter cities in multi-city start can begin with improvements, inc. "extra palaces" which respawn like the real palace -- It is now possible to specify a list of improvments that will be added to the AI's extra starter cities in a multi-city start. More interestingly, if any of those improvements are small wonders with the "reduces corruption" effect, they'll be considered "extra palaces" (EP) and automatically respawn like the palace does. That means, if the AI loses a city with an EP, that EP will reappear in another one of its cities. The target city will be chosen the same way the game would have chosen a city for the palace to be relocated to when lost. Similarly, if an AI does not have any of the EPs when it acquires a city, the first one it doesn't already have will be placed automatically in the new city.
  • Can set multiplier on AI research rate (replaces halve_ai_research_rate) -- This lets you multiply beaker production in all AI cities by any amount
  • Option to allow upgrades in any city -- This allows you to remove the requirement to have a barracks/harbor/airport in a city to upgrade units there.
  • Option to stop the map generator from placing volcanos
  • Fix crashes and strange behavior caused by use-after-free bug in config loader -- This is the same fix that's in R17C.
  • Fix crash when loading a second game due to improper creation of unit RCM icon sprites -- This is the crash at 2% loading that affects 18 Preview 1, specifically it occurs the second time you load a game. It was caused by some sloppy programming on my part. The game would crash when it tried to reload the unit right-click menu icons because the old set of icons wasn't being properly deinitialized.
  • Fix resource generation not always updated after an input was gained or lost due to city improv change -- Specifically what I fixed here was a tiny and very annoying mistake in some mod code that was supposed to put together a record of which resources are inputs to resource generating buildings. That record is then used in a few different places. One of them is to check, whenever a building is added or removed from a city, if that building was generating a local resource that's an input to another generator. In that case all resource access must be recomputed. That doesn't happen properly in R17 because the record of resource inputs is incorrect. What's annoying about it is the error is literally one character; I used the wrong index in a nested loop. Oh well, it happens.
  • Rework some code related to resource generation and trade to improve stability and efficiency -- This addresses the bug reported by Civinator. The above fix might also have fixed that bug but just to make sure I reworked the code that was crashing.
  • Allow grayed out units on the right-click menu to be clicked
  • Stop grouping automated and non-automated workers on the right-click menu


This has probably already been requested, but if I have a wonder that effectively provides a barracks to every city, when I win a city by rebellion, the unit does not get the advantage of the barracks building. Sounds like an order of processing thing. In the process of transferring ownership, the unit is "gifted?" before the city is populated with the the appropriate unit as part of the city transfer process.
I looked over the code for capturing cities to see what this would entail and, surprisingly, it's not a matter of the order things get processed. The issue is that the game simply never sets the experience level on the free defenders so they're left at the default level. It would be easy to insert a bit of code to set the new unit's exp level as if it were built in the city.

I can't think of a better way to illustrate everything clearly, either. On principle I think swords is the right way to go. The challenge is making them clear, yet not too big, ugly or dominant. I've tried out several designs since R18 Preview 1 came out, and this (final version) is the best I could come up with. If you like it, feel free to use it. I've attached the PCX file at the end of this post.
Thanks, but I had to call it on R18. No more last minute changes. One of the things I don't like about the swords is that for me, at a glance, they look more like downward pointing arrows. Yours and mine both. There are just not enough pixels available to make a nice looking sword icon. I made the blade two pixels wide so it could be tapered at the top to address that. I think it helps a bit, the taper makes it look less like an arrow, but the fact that it's tapered on only one side makes it look more like a knife than a sword.
 
Number of turns per game can be adjusted in the "Game Limits" in the "Choose-Your-Civ" screen. If you want a longer game than 540 turns, you can simply increase the total number of turns-in-game (up to a maximum of 1000, I think?), without modding anything else.

However, in order to preserve your accustomed tech-pace (i.e. relative to game-date), you would likely also need to go into the Editor and create a modified .biq file. There are at least 2 possible options that I can think of, which could probably also be combined to some extent.

The 'simpler' version would be to make some/ most/ all the techs untradeable, meaning that every player would have to spend longer to research everything themselves (or steal techs from rivals). This should substantially slow down the tech-pace, unless you also reduce some/all of the tech base-costs, making them cheaper/quicker to research (or steal? Not sure if that's related to tech-cost or not).

Another possibility would be to shorten the "years per turn" in the .biq's General Settings, but increase the total turns per duration proportionally to cover the same number of in-game years. If you want to have discoveries coming in at roughly the same tech-pace as in the base-game, you would then also need to increase all the base-costs for the techs (especially the Ancient–Medieval era techs), proportionally to the number of turns you're expecting to spend in those eras. This would likely take a lot more fine-tuning.

Bear in mind also that the "Wonder+Improvement-Culture-doubling" mechanic is hardcoded to trigger 1000 years after completion, according to the in-game date — so if you want to continue to have the 100K and 20K Culture victory conditions potentially happening at roughly the same end-dates, the Cultural values of buildings and Wonders may also need tweaking.
Great, thank you for the guidance, jds282. After some stumbling I was able to experiment with the various editors and get somewhat of a grasp of them. I haven't been able to yet identify the "years per turn" setting (I'm looking in Quintillius' editor), but have been able to change the cost per individual tech.

It's my pleasure! Glad you're enjoying it. It would be possible to edit the EXE to add some sort of marathon mode but it would be more natural to do that using the scenario editor. With the editor you can increase tech costs and reduce how many years pass per turn. If there's some specific change you'd like that's not possible in the editor, please share.
Thanks Flintlock. While acknowledging that I am still quite unfamiliar the editors (and scenarios in general; I've always played simply played the regular game), I'd like to offer a few subjective thoughts as to why I think marathon mode may be a better fit for C3X than via editor.
  1. As best I can tell, each tech base costs would need to be edited individually, rather than en masse. Doing so programmatically via C would seem to make more sense here than manually editing.
  2. My sense is that others would enjoy marathon mode as well. Having a feature in C3X for this lends itself to that, rather than everyone doing so themselves via the editors.
Again, these are just my 2 cents and beggars can't be choosers. However I think this would be a highly useful and appreciated feature.
 
  1. As best I can tell, each tech base costs would need to be edited individually, rather than en masse. Doing so programmatically via C would seem to make more sense here than manually editing.
  2. My sense is that others would enjoy marathon mode as well. Having a feature in C3X for this lends itself to that, rather than everyone doing so themselves via the editors.
It's not necessary to edit the base costs of each tech since the game already has a multiplier on all tech costs for each map size. It's called "Tech Rate", in the original Firaxis editor it's under Rules -> Edit -> World Sizes and in Quintillus' editor it's on the WSIZ tab. Also, to change the number of years that pass per turn, look under "Time Scale" in the Scenario Properties in the Firaxis editor. There's no single years per turn setting because the number varies over the course of the game.

Is there anything else you'd like marathon mode to do? I suppose it could work like an opposite of the game's existing accelerated production option. That would mean it slowed city growth and production as well as research, and maybe did some other things as well (I don't know exactly what accel. production does). That might be worth adding to the mod, but if marathon mode is just two changes already possible through the editor then I don't think it would be worth it.
 
Allow grayed out units on the right-click menu to be clicked
Does this allow units in armies to be clicked? They're grayed out by default so they can't be interacted with and taken out of the armies, whereas other transports allow the player to click on the units to wake them up and move them off the transports.
My sense is that others would enjoy marathon mode as well. Having a feature in C3X for this lends itself to that, rather than everyone doing so themselves via the editors.
This can also be achieved by releasing the edited .biq as a mod for others to download, so once again the Civ3 editor is the best for what you want.
 
Thanks for completing the very useful R18 in a short amount of time, Flintlock. But for some reason the unit order text replacements aren't working for me. I only get the standard Wake/Activate text.
 
Last edited:
I suppose it could work like an opposite of the game's existing accelerated production option. That would mean it slowed city growth and production as well as research, and maybe did some other things as well (I don't know exactly what accel. production does).
As far as I can tell, AP simply halves the capacity of every player's food- and shield-boxes, so they fill up in half the 'usual' time.

It doesn't alter e.g. base-Worker-turns to complete tile improvements (so a town may end up growing significantly faster than its tiles can be fully improved), or years-per-turn (i.e. in-game dates).

I don't think it alters tech-costs directly (i.e. the size of the virtual 'beaker-box'), but -- provided that roads can be built fast enough to keep up with growth, and happiness managed efficiently -- the doubled growth-rate should provide more commerce earlier, allowing research-times to be reduced accordingly.
 
It's not necessary to edit the base costs of each tech since the game already has a multiplier on all tech costs for each map size. It's called "Tech Rate", in the original Firaxis editor it's under Rules -> Edit -> World Sizes and in Quintillus' editor it's on the WSIZ tab. Also, to change the number of years that pass per turn, look under "Time Scale" in the Scenario Properties in the Firaxis editor. There's no single years per turn setting because the number varies over the course of the game.

Is there anything else you'd like marathon mode to do? I suppose it could work like an opposite of the game's existing accelerated production option. That would mean it slowed city growth and production as well as research, and maybe did some other things as well (I don't know exactly what accel. production does). That might be worth adding to the mod, but if marathon mode is just two changes already possible through the editor then I don't think it would be worth it.
Those are good points and yes, to your and tjs282's points, the only other consideration I can think of would be the rate of production, or more specifically tweaking the cost factor which would slow down city growth, production, research, etc. The Firaxis Editor suggests this is hard-coded at 10 for the human player (assuming I'm looking at the correct thing), and I haven't figured out how to modify that.

Also, thanks very much for pointing out the Tech Rate and Time Scale items in the Editor for me (and sorry to be a dope and needing guidance on that).

I can imagine having a C3X config setting which sets the Time Scale, Tech Rate, and Cost Factor linearly depending on preferred speed (eg from Civ 6, Quick, Standard, Epic, Marathon). However I do agree that if all of this can be done in the Editor alone perhaps it's not worth it.
 
Does this allow units in armies to be clicked? They're grayed out by default so they can't be interacted with and taken out of the armies, whereas other transports allow the player to click on the units to wake them up and move them off the transports.
Good question, I hadn't thought of this. Fortunately there's an additional check that prevents you from selecting units in armies so it's not an issue. I edited the code of the menu itself so it wouldn't reject clicks on disabled items if those items are for units. The additional check is part of the unit code in the method that actually does the selection.

Thanks for completing the very useful R18 in a short amount of time, Flintlock. But for some reason the unit order text replacements aren't working for me. I only get the standard Wake/Activate text.
🤦‍♂️ After all that work trying to avoid posting another bug fix version, I'm going to have to do it anyway. The problem here is because of the labels on the Steam version. The mod replaces "Wake" or "Activate" by taking the menu text produced by the game, searching for whichever of those words should be present, swapping it out if it's found, then passing the text along. It's a lot easier to do that than try to modify the code that produces the menu text in the first place. The mod doesn't search for the words "Wake" or "Activate" literally because that wouldn't work in all languages, rather it searches for the corresponding labels. Most of the labels in the Steam version are bumped one spot over so the mod searches for the wrong words and the replacement doesn't happen. I'll post an updated version soon. At least it's a trivial fix.

I can imagine having a C3X config setting which sets the Time Scale, Tech Rate, and Cost Factor linearly depending on preferred speed (eg from Civ 6, Quick, Standard, Epic, Marathon). However I do agree that if all of this can be done in the Editor alone perhaps it's not worth it.
This would be relatively easy, for what that's worth. The game has functions to get the costs of buildings, units, and techs for a given player. Modifying them to multiply their result by some amount would be easy. I don't know if there are similar functions for city food box sizes or worker job costs but presumably there are, and I don't know about modifying time scale but that couldn't be too complicated. One of the reasons I'm reluctant to do this though is that it wouldn't be as convenient to use as the game speed setting in future Civ versions. That's because I don't yet have a way to add data to save files. The game speed would have to be set in a scenario config (you wouldn't want it in the default config), so you'd have to create a scenario anyway.

Sorry - "Unit limits"? (and I would still love to see Unit limits per Tile :shifty: )
The limits can stop players from producing units of a given type once they reach a maximum amount. That amount can vary depending on the player's city count. More details here: https://forums.civfanatics.com/thre...d-and-much-more.666881/page-102#post-16606824. As for unit limits per tile, we'll see. It should be possible but no promises about when I'll get around to it.
 
🤦‍♂️ After all that work trying to avoid posting another bug fix version, I'm going to have to do it anyway. The problem here is because of the labels on the Steam version. The mod replaces "Wake" or "Activate" by taking the menu text produced by the game, searching for whichever of those words should be present, swapping it out if it's found, then passing the text along. It's a lot easier to do that than try to modify the code that produces the menu text in the first place. The mod doesn't search for the words "Wake" or "Activate" literally because that wouldn't work in all languages, rather it searches for the corresponding labels. Most of the labels in the Steam version are bumped one spot over so the mod searches for the wrong words and the replacement doesn't happen. I'll post an updated version soon. At least it's a trivial fix.
Many mods, including CCM3 and RARR, have a steam labels text patch to fix that annoying steam issue. When that patch is used, this steam problem should not appear. The GOG version of Civ 3 Complete (at present available for € 1,29 in the summer sale) doesn´t have this problem.
 
The problem here is not the mismatched texts, but the fact that the Steam version of the labels file has an extra line, messing up the patch from Flintlock since it's searching for specific lines, or something to that effect.
 
The problem here is not the mismatched texts, but the fact that the Steam version of the labels file has an extra line, messing up the patch from Flintlock since it's searching for specific lines, or something to that effect.
:yup: Yes, this is the fix of the steam labels text patch, per example in the mods CCM and RARR. Who plays these mods with the Civ 3 Complete version of steam must have installed that patch with the normal labels text lines, otherwise steam would play havoc with the text of the game in these mods by that additional line (81?) in the steam labels text file - and with the normal labels text lines this, in my eyes very minor, text problem in the Flintlock mod should not occure.

I hope that the 18B version of the Flintlock mod has no consequences to the R18 scenario.c3x_config file in CCM3, as I don´t like to do a third upload with explanations in a couple of days and to suggest the same to the more than 70 civers who have downloaded CCM 3 in the past days, if this is not absolutely necessary. I hope that players have no problem, if they play CCM3 in their succession game partly with the R18 and the R18B version, when the labels text file has the original number of lines in its file.
 
Last edited:
I hope that the 18B version of the Flintlock mod has no consequences to the R18 scenario.c3x_config file in CCM3, as I don´t like to do a third upload with explanations in a couple of days and to suggest the same to the more than 70 civers who have downloaded CCM 3 in the past days, if this is not absolutely necessary. I hope that players have no problem, if they play CCM3 in their succession game partly with the R18 and the R18B version, when the labels text file has the original number of lines in its file.
You don't have to update any config files for 18B, it's identical to version 18 except for a small change to fix the issue with the labels on the Steam version. It's up to you if it's worth posting a CCM update just for this. IMO it's a relatively minor issue that can wait. If R19 were coming soon, say in a week or two, I wouldn't have bothered with 18B. I would have just posted a workaround in this thread for those who care enough to come looking for a fix.

I've been thinking about trying to fix the Steam labels issue through C3X. The way that would work would be I'd insert some code that runs around when the labels get loaded and, if it's the Steam version and the number of labels loaded is one less than the number the Steam version expects, the mod would shift the misplaced labels forward one spot to compensate. That should work and it would allow players to use non-Steam labels file with the Steam executable. I'm not sure it's worth it to pile more complexity onto this issue, though. If the fix backfired somehow it could be very frustrating.
 
You don't have to update any config files for 18B, it's identical to version 18 except for a small change to fix the issue with the labels on the Steam version.
This is great, especially for the players of the CCM3 succession game. :)

I've been thinking about trying to fix the Steam labels issue through C3X. The way that would work would be I'd insert some code that runs around when the labels get loaded and, if it's the Steam version and the number of labels loaded is one less than the number the Steam version expects, the mod would shift the misplaced labels forward one spot to compensate. That should work and it would allow players to use non-Steam labels file with the Steam executable. I'm not sure it's worth it to pile more complexity onto this issue, though. If the fix backfired somehow it could be very frustrating.
As far as I know, the additional line Unknown was implanted in the steam labels text file to allow multiplayer games with the steam version of Civ 3 Complete. By compensating that problem of the additional line by shifting the misplaced labels forward one spot, I hope that this is not disturbing the multiplayer functionality of the steam version, as this is the only advantage the steam version has compared to the GOG version.
 
Back
Top Bottom