Resource icon

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

Thanks for the update! I have a question about the new bankruptcy penalization feature: In what order does it choose units to disband? Based on some preliminary testing on my part, it seems like it deletes units in order from first in the scenario's unit list to last, but I'm not sure if that's correct. Anyways, it's a great feature and will work well with a new scenario idea I've had; thanks!
Glad to hear you like it. To answer your question, the mod relies on a function from the base game to determine which units to disband, so I don't know 100% how it works. Skimming the code for that function, I can see that units are disbanded in the same order they appear in the game's internal list, but only if they are ranked the same. There's a surprisingly complicated ranking process where the game judges units based on their AI strategy settings, experience level, what other units/cities are nearby, whether they have a custom name (!?), what continent they're on, and their stats like attack strength and population cost. The game tries to pick the least valuable unit to disband. It also avoids disbanding units you'd expect to be exempt, including captured (maintenance-free) units, king units, and armies.
Does this patch/change work with the standard CD Civilization programs, or does it only work with the Steam Download?
The mod currently supports three executables. It's supported the GOG and Steam versions since the start, and a few months ago I added support for the PCGames.de version as well. That third version is what you'll want to use if you don't want to rebuy the game. There's more info about it in this thread: https://forums.civfanatics.com/threads/civ-3-windows-update-kb3086255-safedisc.552308, basically it's a DRM-free EXE that Firaxis gave to PCGames.de and should work with CD versions of the game. I can't add support for most CD versions directly due to interference by DRM.
 
The mod currently supports three executables. It's supported the GOG and Steam versions since the start, and a few months ago I added support for the PCGames.de version as well. That third version is what you'll want to use if you don't want to rebuy the game. There's more info about it in this thread: https://forums.civfanatics.com/threads/civ-3-windows-update-kb3086255-safedisc.552308, basically it's a DRM-free EXE that Firaxis gave to PCGames.de and should work with CD versions of the game. I can't add support for most CD versions directly due to interference by DRM.
Thank you for your response. I still will not try the modification. I tend to be very cautious about adding things to any computer. Also, what do you mean by DRM?
 
DRM is "Digital Rights Management", in general it's software that prevents unauthorized use of something. For Civ 3 specifically, it's there to try to prevent you from playing the game without owning the CD. I looked into porting the mod to a CD version of Civ 3 Complete and found it wasn't feasible because the DRM (SecuROM, I believe) encrypts the contents of the game's executable inside the EXE file, to be decrypted with a key stored on the CD. That obstructs the mod from editing the executable. At least that one, I'm not sure if all CD versions use DRM or what kind.
 
Flintlock, two more suggestions about improving your great mod:

1: The "local no-tech-req" resources are working fantastically well. :worship: They are working so well, that for my mods (CCM 2.6 and RARR) with thousands of units in it, they are the much better option compared to the option, that a unit for its production needs a special building in a city. Creating a "special resource", that is available only in a city with a special building and setting this resource as a prerequisite for several hundreds of units in the editor needs much less space (and work) in the default.c3x_config file, than to list hundreds of units that need a special building in that file. With the fix of the ghost resources bug in your mod (not yet tested by me), this seems to be the much better modding option for mods with lots of units in it.

A small problem with the "local no-tech-req" resources seems to be, that I was not able to create working "special resources" with two or more words for the resource. Per example at present it seems, that this option in your mod is not accepting a resource named "Electric Power", but it works when that special resource is named Electricity. For resources with two or more words (like Electric Power) even to set them in quotation marks was not helpful. If there is a special resource with two or more words in the list of the default.c3x_config file, the complete list for that option was ignored, even without giving a warning about a not appropriate naming of those resources.

2. The icons for veteran aircraft and veteran ships:

AirandHarb.jpg


The AirandHarb icons in the Civ 3 city folder are connected to the in my eyes not so important tradenet functions of buildings. Both the harbor and the airport, have double functions for producing veteran air- or seaunits and opening sea- or airtrade.
Spoiler :
Harbor.jpg

Airport.jpg


In my eyes it would be much better, if those icons could be used for the veteran flags of those buildings for producing and upgrading sea- and airunits, as in the game, at least for me, it is much more important to see where I can heal my ships and my planes in one turn and upgrade them, than to know if this is a location in the tradenet, especially as in many scenarios there are deep cuts done in that tradenet and therefor here the use of these icons is mostly wasted.
 
Last edited:
Hi, Flintlock, and thank you for your continued work on this project. I had a question about the possibility of "either/or" buildings. Would it be possible to have a choice between two (or possibly) more buildings, where once one was the built the others would be unavailable? I think especially in terms of small wonders this would open up all kinds of possibilities for city specialization. I don't know if if this would have to be related to the power plant options (replace buildings with this flag), although ideally it wouldn't be since that would give only one option per city, and then we could still use the replace flag for other things.

For example, in the Total War series they may have an option to create either a swordsmith or an armorer, and then individually upgrade from there. With this option, we could create mutually exclusive building chains. And if this extended to small wonders, we could do things such as choosing a state religion or other far reaching options. Thank you and I look forward to testing your newest update.
 
where once one was the built the others would be unavailable
So one available building would block another available building in the same city. The "replace-flag" for powerplants only replaces an available building with another available building, but it doesn´t block the other available building.
 
Yes, this is why if possible, it would be nice to have this feature of mutually exclusive buildings separate from the existing "replace-flag". As you know, I use this flag in my game currently and would like to continue using it. But I do not know what is possible in future versions of the Flintlock patch.
 
Just as units can be limited to certain Civs, I would like to have the approach available to both Govs and Improvements.

I know that these can done by manipulating Tech Trees, but just consider that the original game editor could have been built without that ability to assign Units to Civs - and then we'd be using the exact, same workarounds for Units, as we now do for Govs and Improvements
 
1: The "local no-tech-req" resources are working fantastically well. :worship:
Great!
A small problem with the "local no-tech-req" resources seems to be, that I was not able to create working "special resources" with two or more words for the resource.
[...]
In my eyes it would be much better, if those icons could be used for the veteran flags of those buildings for producing and upgrading sea- and airunits, as in the game, at least for me, it is much more important to see where I can heal my ships and my planes in one turn and upgrade them, than to know if this is a location in the tradenet, especially as in many scenarios there are deep cuts done in that tradenet and therefor here the use of these icons is mostly wasted.
I don't know why you're having trouble with resources with spaces in their names. I did a quick test of that, and it worked properly for me. Are you sure that the only thing you changed between the working and non-working version is the resource name? I believe, if the mod is working as intended, the only way it could ignore resource generation settings without an error message is if the settings got overridden. You mentioned you had this set in the default config, keep in mind that will be overridden by the scenario config. Of course, it's possible the mod is not working as intended here, and there is a bug in how the settings are read in. It wouldn't be the first one. If you could put together a minimal scenario that shows the issue, that would help a lot.

About changing the criteria for those little city icons, that should be a small simple modification. I'll try to get around to it before the next version.
Hi, Flintlock, and thank you for your continued work on this project. I had a question about the possibility of "either/or" buildings. Would it be possible to have a choice between two (or possibly) more buildings, where once one was the built the others would be unavailable?
Hello. What you describe should be possible, and in fact not too difficult. The game relies on one function to determine whether or not any given building is available to build in any given city. It would be relatively easy to modify it to exclude buildings when there's another one already present in the city from the same category. The hardest part would be reading in those categories from the config file. By the way, making the "replaces others" flag work within those categories should also be possible, though trickier. I looked into that briefly before. One of the problems I noticed is that the AI is hard coded to treat the "replaces others" flag as if it's only applied to power plants when deciding what to build. So if a building has that flag, the AI will only consider replacing it on the basis of production bonus, pollution generation, and things like that.
Just as units can be limited to certain Civs, I would like to have the approach available to both Govs and Improvements.
I know that these can done by manipulating Tech Trees, but just consider that the original game editor could have been built without that ability to assign Units to Civs - and then we'd be using the exact, same workarounds for Units, as we now do for Govs and Improvements
It would be relatively easy to limit city improvements to particular civs for the reasons I gave above. It should be possible to limit governments, too, I could probably intercept the point at which the game checks tech requirements to make that work. However those limits might not be easier for modders to use than the tech work around, since you'd have to set them up by editing a text file instead of using the editor.
 
Hello. What you describe should be possible, and in fact not too difficult. The game relies on one function to determine whether or not any given building is available to build in any given city. It would be relatively easy to modify it to exclude buildings when there's another one already present in the city from the same category. The hardest part would be reading in those categories from the config file. By the way, making the "replaces others" flag work within those categories should also be possible, though trickier. I looked into that briefly before. One of the problems I noticed is that the AI is hard coded to treat the "replaces others" flag as if it's only applied to power plants when deciding what to build. So if a building has that flag, the AI will only consider replacing it on the basis of production bonus, pollution generation, and things like that.

Thank you for looking into it. This would be a big one for me alongside some you have already done such as building prerequisites and armies. For my purposes, I would be content with the "replaces others" flag as it stands now. As you said, the AI seems to value it mostly on the basis of the production bonus which is easily modded. And honestly, it doesn't bother me if the dimwit AI overbuilds its power plants occasionally, as we've come to expect such behavior.

With mutually exclusive buildings, building prerequisites for units, and building resources, that's like two solid years of modding for me with tons of possibilities. Once again, many thanks!
 
If you could put together a minimal scenario that shows the issue, that would help a lot.
Flintlock, attached to this post are the files for such a "minimal scenario". It is the standard conquests biq to speed up things for you in Debug mode. The plants and the resources coal and uranium are available from start. Each should produce a special resource in the city, in one biq called Electric Power (not working) and in the other called Electricity (working). The special resources are linked to a tech that is not available in the game. The attached config files with the different naming of the resources must each be renamed to default.c3x_config for that test.

To speed up the test even more, a settler can be placed over a coal or an uranium resource by Shift + F1 and the different buildings can be produced in the cityscreen of a city by pressing b and marking the building in the appearing list.

The "minimal scenario" also holds another special resource Faith, that is also available at the start of the game. It is provided by some buildings at the end of the building list, renamed to different religious names. When such a building is placed in a city it automatically triggers the connected special resource with the Electricity-files, but not with the Electric Power files.

At least with the R14 settings a warning message (screenshot in the zipped files included) appears with the "Electric Power" settings. May be I had not noticed that in my R13 settings.

I don´t know, why Electricity is working, but Electric Power not. May be the term Electric Power contains too much letters ?
 

Attachments

Flintlock, attached to this post are the files for such a "minimal scenario".
Thanks for this, but you must have gotten the files mixed up somehow, probably back at the beginning. In the attached file default.c3x_config-Electric Power.ini, there are no quotation marks around Electric Power. Loading the test BIQ like that causes the error you screenshot, as expected, but editing in the missing quotation marks causes the scenario to load without error and seemingly work properly.
 
Thank you a lot for the update Flintlock! :)

During testing I observed that when you investigate an AI city and repeatedly press P and close the window, you will get different numbers every time. Is this the result of a RNG element being recalculated every time? A "useless" building in AI eyes that gets its entire rating via perfume (a resource producing building in this case) does not have such variance and sticks to the perfume-set score.

I have one thing to chime in on the earlier obsoleting of improvements discussion: What if an obsolete building would simply cease incurring maintenance costs? I.e. when its functionality is stopped, the maintenance is waived as well. That would allow to keep a culture-producing yet obsolete building (for example a monastery as in Civ 4) around for its culture after it has lost its main use, without continuously paying for it (and causing the AI unavoidable costs).

Edit: oh and on the other topic, that AnthonyBoscia mentioned:
Would it be possible to have a "simple" exclusion list for buildings that prevent others from being constructed when they already exist?
Example:
["Shakespeare's Theater": "Hospital"]
["Hydro Plant": "Solar Plant", "Coal Plant"]
Meaning that the GW theater will prevent hospital construction and that a hydro plant will precent both coal and solar.
 
Last edited:
It would be relatively easy to limit city improvements to particular civs for the reasons I gave above. It should be possible to limit governments, too, I could probably intercept the point at which the game checks tech requirements to make that work. However those limits might not be easier for modders to use than the tech work around, since you'd have to set them up by editing a text file instead of using the editor.
Yes, but it could be worth it. One example (among many) would be to (reasonably, I would suggest) have a R/W global mod, partially set in the 1930s. A Tech "Radio Broadcasting" would enable "Stalinism," "Fascism,""Modern Direct "Democracy" (FDR's "Fireside Chats") and, "Modern Parliamentary Democracy" (Churchill.)

I'll take a text file for that, rather than four different Techs, any day.
 
One recurring oddity I noticed is that while the AI will jump to research any useless, non-next-age-required tech that doesn't do anything, they basically never go for sanitation on their own. Is something broken with the AI evaluation factor of "removes disease from flood plains"? (Which I have read is broken in its own right and doesn't do what it says). Or does the "value" of the building also impact the technology? Because it seems the AI really doesn't like building hospitals all that much even in cities at the cap that are just overflowing with food.
 
One recurring oddity I noticed is that while the AI will jump to research any useless, non-next-age-required tech that doesn't do anything, they basically never go for sanitation on their own. Is something broken with the AI evaluation factor of "removes disease from flood plains"? (Which I have read is broken in its own right and doesn't do what it says). Or does the "value" of the building also impact the technology? Because it seems the AI really doesn't like building hospitals all that much even in cities at the cap that are just overflowing with food.

I tried assigning dummy resources to Sanitation and that too wasn't enough. With Nationalism offering drafting and mobilization as well as a unit, it's simply to alluring for the AI. Steam Power reveals a strat resource and allows for new terrain improvement. So they will both be researched before that. Unfortunately, since the AI overvalues governments it means that once they've gotten Nationalism, they will go for both Communism and Fascism long before Steam Power, let alone Sanitation. To add insult to injury, the human player often doesn't even need hospitals for his/her cities are spaced to max out at 12 pop while for the AI hospitals give them at least 50% more pop.

So with a heavy heart I removed Sanitation as a tech and moved hospitals to Medicine. The AI simply needs hospitals too badly. Many other optional Industrial techs were removed/made compulsory as well as they serve no other purpose other than sabotaging the AI or just being useless. Why would I need Adv. Flight when I can get Mech Inf with Computers instead?
 
More AI observations: Using Sima Qian's MP tool it is possible to investigate all the players in an ongoing single player game by turning them into playable hotseat players. I noticed that the AI (difficulty: monarch) tends to bankrupt itself all the time, continuously causing buildings and units to be disbanded all over the place. I noticed that the AIs really liked getting into insane GPT deals with other civs, often receiving hundreds of gold per turn and spending equally much. In some cases, this causes incredible deficits even at 0% science/lux spending. I experimented with turning the AI-to-AI trade factor down to 100 (even chieftain has 110!), this however slowed down the technological progress a lot for the AIs. Interestingly, in a scenario with unevenly distributed players (using Rhye's of Civilisation; Earth map), this puts the more isolated AIs at a much better footing compared to normal games where the clumped AIs in europe have better technological progress (well, those who can still expand a bit like Vikings, England, other civs such as the Dutch or Germans face a lot of settling problems). With such a slowed research speed, the AIs instead amass massive numbers of military units, which - again - drain their money really quickly. I really struggle to understand AI building priorities and why the aztecs prefer to make their 45th offensive unit (while at peace) rather than a barracks or a marketplace.

With the tool, it is also possible to remove all human-controlled players. This will cause you to spectate the last selected civ, which will then be fully under AI control (including moving units and ending turns), but this causes a lot of popups: Many times when the AI wants to move a unit, you get the "this move will declare war :o " advisor popup, but regardless of what option is selected, no war will be declared. This also relates to the civs around you, so I think the AI is evaluating pathing through other units nearby. Furthermore, you get lots of popups about rushing buildings, it seems like the AI tries to rush anything wherever and regardless of possibility, with lots of "umm we'd need 236 gold to do that" and so on popping up every turn. This also means that the AI really burns through all gold or population, both of which is usually a bad idea. It is not rare to see a 6 pop city with 4 entertainers despite lots of happy buildings, just because there is so much amassed whipping unhappiness.

Do you think it is possible to make the AI's behaviour a little more reasonable in terms of rushing and gold-management?
 
Thanks for this, but you must have gotten the files mixed up somehow, probably back at the beginning. In the attached file default.c3x_config-Electric Power.ini, there are no quotation marks around Electric Power. Loading the test BIQ like that causes the error you screenshot, as expected, but editing in the missing quotation marks causes the scenario to load without error and seemingly work properly.
Flintlock, I am very sorry for wasting your time with such a stupid mistake I have done. :blush: I couldn´t find the CCM testfile among my many dozens of config files, where I set the two worded resources in quotation marks (and some more such two worded resources in it), but after having done a new test file with a special focus, that even all two worded resources are set in quotation marks, all was working well (as you posted).

May be it could a good idea to add to the examples in the c3x_config file an example with a two worded building producing a two worded resource, like:
"Hydro Plant": local no-tech-req "Electric Power".
 
I just put quotation marks around every single name regardless of whether it is single- or multi-worded, to prevent any sort of accidentally missing ones (and also to keep it visually consistent) :D
 
Back
Top Bottom