Resource icon

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

The config file for the (engl.) CCM 2.50 biq now in a test is working. It seems there was a conflict in the many starting shortcuts for this version on my pc. I hope it will also work, when not only the few test units are added, but hundreds of units, all needing the same prerequisite building.

Different is the situation for the German version. While the R10B version with German explanations in the config-file was working without any error message, it seems German explanations in that file now generally are problematic. R11 with the English config file is working properly, even when using German unit or building names with the exception of names having special letters (Umlaute: ä,ü,ö) in their names. Here an old German substitution for these special letters (ae, ue, oe) could be used, but this would mean a change of these names in the editor, too.

Astonishing is, that, even when the new parts of R11 are added in English language to the text with German explanations for the R10 config file, the error message is appearing now and the new features are not working, even if there are no names with special German letters in the added parts.
 
Also, when you say the building prereqs work for the English BIQ but not the German one, that's probably a problem with text encodings. Can you try using the German BIQ but without the "Schwertkämpfer" in the building prereqs list? I suspect that "ä" character is causing the problem since it would be encoded differently in Civ 3, which uses the Windows-1252 encoding, compared to the config INI, which you've presumably saved as UTF-8. One way to solve this properly would be to save the config INI as Windows-1252, but unfortunately Notepad doesn't have that option. Another way would be for the modded EXE to convert the config INI text from UTF-8 to Windows-1252 on its own. I'll look into that, it's probably/hopefully not difficult.
Notepad++ allows to change the encoding as needed. (And it is a really good text editor anyway.) Here's how to do it in the German version:

1658938755038.png


My understanding is that the code I edited to fix the bug applies to both sea and land units. So I figured the bug fix would work for land units, although I never tested it. I'll have to put together another scenario to investigate that.
It has definitely happened to me multiple times since posting - I can give you a save game from before the turn it happened, but it was in Plotinus' "The Desert and the Mountain" scenario and would need its files to be loaded.
Sure. I had a quick look at the code that assembles the stealth attack popup, and that would be an easy change to insert.
Thank you, very cool! :)
 
This is just a small cosmetic difference, but is it at all possible to edit the EXE to change how population is calculated? It would just be nice for ancient (or other) scenarios where a 1 pop city is actually 1,000 instead of 10,000 (or if the numbers get larger with each era progression, but that seems even less possible)
This is surely possible. My first thought was that it would be easy, but after having a look at the code that draws that part of the city screen, I don't see any readily available opportunity to replace that calculation. There's another way, though it's more involved. I could intercept the point where the game draws that "Population: ..." text onto the screen, redo the calculation there, and replace the text. Including era in the new calculation would not be a problem.
Astonishing is, that, even when the new parts of R11 are added in English language to the text with German explanations for the R10 config file, the error message is appearing now and the new features are not working, even if there are no names with special German letters in the added parts.
And this is still the same error message about "warn_about_unrecognized_perfume_target"? That is indeed astonishing. It must still be picking up a config file from an earlier version because that bit of text does not appear anywhere in R11.
It has definitely happened to me multiple times since posting - I can give you a save game from before the turn it happened, but it was in Plotinus' "The Desert and the Mountain" scenario and would need its files to be loaded.
A save game would be helpful, thanks.



About the text encoding issue: Today I added some code that will convert config files from UTF-8 to Windows-1252 automatically as they're loaded by the modded EXE. So starting in version R12 the config INIs will need to be UTF-8. Unfortunately this adds yet another potential compatibility problem for config INIs between mod versions but I think it's for the best in the long run. I'm also planning to make it so that accented Latin characters (ä, ë, ö, etc., basically everything after 0xC0 in the Windows-1252 encoding) are not considered word separators. That way you won't need quotation marks around names that include them. This is much easier to do after the config files have been given a simple, fixed encoding.
 
Not sure about improvements, but defences for citizens and buildings are separate values set via editor (both default to 16)
You're right, poorly worded question. Tile improvements are what I'm interested in (see below). The question came up of whether it used the same value as one of the others.
Palace with Quintillus' editor and Flintlock's mod can give a free building. :) But that can't have a maintenance cost, since those are waived for free buildings.
Ah, of course. So that method is out.
I think you can already do that in the editor by only having a disappearance chance but no ratio per player.
I haven't heard of this before, can anyone confirm? The appearance ratio works as expected for positive numbers (1 is known to yield 1 per map), but 0 seems to yield more- maybe 1 per 2 civs. As far as I know each time one disappears a new one is created so that the total stays constant.
  • It might not be practical to make fine-grained changes to bombard defense, depending on what you want to do. The bombard code is inflexible in that it rolls first to determine a target then rolls for damage. IIRC when bombarding a city there's a simple even chance of hitting the garrison, buildings, or population. So it's not practical to make a building that shields the population from damage. Differing defense values per building type might be doable, though.
All I want to do is change the defense/odds of tiles vs destroying improvements and making craters. It came up as side effect of increasing unit stats across the board.
  • Maintenance costs from cities themselves should be easy to implement. The hardest part would be finding a natural place to list the maintenance cost on the city screen.
Could you draw it to the right of "improvements" so it's near the other maintenance costs, and count it in the "maintenance" line item on the advisor screen? Come to think of it, maintenance per city size (town/city/metro) would make more sense than per government, if not both- analogous to unit support.
  • I've never looked at the relevant code for AI settler building, but my experience observing it play is that it assumes it can build settlers at any time. Often I've seen its cities stuck with a full shield box for a settler build that can't complete because the city needs to grow.
It was just something I heard somewhere, but if that's the case all the more reason to fix it :)
 
Notepad++ allows to change the encoding as needed. (And it is a really good text editor anyway.) Here's how to do it in the German version
Alekseyev_ thank you very much for your detailed instructions. :) Unfortunately when the file is changed with my older version of Notepad++ to these settings and additionally taken care, that in the column "Sprachen" (languages?) it is set to INI, the encoding in that file after saving and reopening it with notepad++ is changed from Windows-1252 to ANSI and it is not working for German special letters (Umlaute).
 
About the text encoding issue: Today I added some code that will convert config files from UTF-8 to Windows-1252 automatically as they're loaded by the modded EXE. So starting in version R12 the config INIs will need to be UTF-8. Unfortunately this adds yet another potential compatibility problem for config INIs between mod versions but I think it's for the best in the long run. I'm also planning to make it so that accented Latin characters (ä, ë, ö, etc., basically everything after 0xC0 in the Windows-1252 encoding) are not considered word separators. That way you won't need quotation marks around names that include them. This is much easier to do after the config files have been given a simple, fixed encoding.
Flintlock, thank you very much for all your efforts with that issue. Attached is a biq of the C3C epic game in Debug mode with the German names for units and buildings. Unfortunately there are many special letters, especially in the unit names (Schwertkämpfer, Bogenschütze, Zerstörer and so on). As this biq uses the English civilopedia keys (PRTO_, BLDG_ and so on) it should run without problems for you and you have an easy proof, if your added code is working.

I also attache a config file with hints in German language of R9, updated to R10 and added the R11 features (the last ones still with the English original entries), that is triggering the error message shown in my screenshot some posts ago.

May be the easiest solution to the encoding issue would be, to give German civers, who want to use the new features of R11, a hint, that they must change the names of units and buildings that contain special letters in the editor to the German substitutes of these letters, per example Schwertkämpfer to Schwertkaempfer.
 

Attachments

I haven't heard of this before, can anyone confirm? The appearance ratio works as expected for positive numbers (1 is known to yield 1 per map), but 0 seems to yield more- maybe 1 per 2 civs. As far as I know each time one disappears a new one is created so that the total stays constant.
According to the Civ3ConquestsEdit setting this value to zero means the resource will be distributed randomly.

AppearanceZero.jpg
 
I'm sorry, I was thinking of pre-placed resources in a scenario, not a random map. My bad! (And even there, I am not really sure if it wouldn't still cause at least 1 to always be present)
 
I have also observed a thing regarding the AI building priorities: It seems to value culture a lot, which in itself is fine. However, it seems to almost completely disregard production increases (factories etc.) until a city has about every other building (and even then they often prefer to make units). This causes a large disparity in shield output in the later stage of the game. Could you maybe take a look at this? For now, I have perfumed all the production buildings, but it seems like more of a structural issue. Alternatively, it could be the case that the AI fears pollution more than it should, but it can often be observed making research labs and iron works (both of which come with culture) without hesitation, so I believe that the production bonus simply isn't valued remotely enough.

_____________________________
Here is the save for the sub-bug on land. Observe the "spy" to the east, near the Adal city. If you don't move it, you get a war dec from Adal the next turn. I then moved it to the mountain 1 tile east, where it was 20-some turns later ran into by a worker. Same happened to me with spies in the Alwah lands (brown, to west) later, but I did not keep the autosaves at that point. :/
Edit: I noticed the mod's main download link is no longer active. This is the current one: https://forums.civfanatics.com/thre...untain-empires-of-africa.139163/post-16310005
 

Attachments

Ive been in and out of civ 3 for years but this mod has really got me back into it!

If I had to make one request for a new features would be to replicate the two flags 'impassable for wheeled units' and 'replaces all improvements with this flag checked', to allow multiple instances of both. Hope this is doable!

Also this is probably known but limiting movement along railway will often completely break click and drag unit orders for the player, I haven't seen if its the case for the ai as well.
EDIT This railway issue appears to have been fixed
 
Last edited:
Assuming the sub bug is fixed for land units, would it be possible to limit "detect invisible" to only apply to the same class (sea/air/land) of units? That would avoid the awkwardness of submarines and eg. special forces seeing each other.
Yeah that's a really good idea! For scenarios, destroyers (or similar) detecting invisible units can be a bit strange when it also uncovers land units. Or alternatively, a way to set what detects what :D

And I would like to repeat the request of a production science carryover after production/research. That would be really nice to have, to not feel like you have to optimise each city for least-overflow unit production.:run: Sorry for posting so many things lately!
 
All I want to do is change the defense/odds of tiles vs destroying improvements and making craters. It came up as side effect of increasing unit stats across the board.
Ah, ok. I can't imagine that would be difficult, although I haven't actually seen the logic for damaging tiles by bombardment. Even looking again just now, I only see logic for damaging cities and units, so I'll have to do some digging to find it.
Could you draw it to the right of "improvements" so it's near the other maintenance costs, and count it in the "maintenance" line item on the advisor screen? Come to think of it, maintenance per city size (town/city/metro) would make more sense than per government, if not both- analogous to unit support.
I could stuff it in the top right of the improvements panel but I don't think there's enough room for for a label there. I might be able to compress the improvements list downward a bit, like I did for the shields box to fit the detailed production info, so there's room for a label at the top of that panel. I hope I can include city maintenance on the display in the domestic advisor, and can't imagine that would be too difficult, though again I haven't looked into it.
I also attache a config file with hints in German language of R9, updated to R10 and added the R11 features (the last ones still with the English original entries), that is triggering the error message shown in my screenshot some posts ago.
Thanks for the German BIQ, I'll be sure to test against that. About your error message, the problem is that you still have the warn_about_unrecognized_perfume_target option listed in that config file, but it has been removed from R11. The R11-modded executable doesn't even recognize it. That config option is now covered by warn_about_unrecognized_names, which is the only one that should be included. The reason I changed it is that the option now covers warnings for things other than perfume targets, in particular the building & unit names for resource production & building prereqs.

By the way, simple text files like INIs don't store their own encodings anywhere. So when you load a file that you previously saved as Windows-1252, the editor doesn't know to use that encoding. The best it could do is guess. You'd need to tell it which encoding to use again. This is another reason to use UTF-8 instead, since most editors (at least all the ones I've dealt with) will default to that encoding so you wouldn't have to set anything. All these encoding problems should be solved with UTF-8 config files in R12.
If I had to make one request for a new features would be to replicate the two flags 'impassable for wheeled units' and 'replaces all improvements with this flag checked', to allow multiple instances of both. Hope this is doable!
Hard to say. The gameplay changes here would be simple enough to program, but it's potentially challenging in that these flags might be used from multiple locations in the game logic and I'd need to hunt all of them down.
Assuming the sub bug is fixed for land units, would it be possible to limit "detect invisible" to only apply to the same class (sea/air/land) of units? That would avoid the awkwardness of submarines and eg. special forces seeing each other.
Again, hard to say. I've located the relevant function, Unit::is_visible_to_civ, but I haven't looked into it in detail. I don't know how detector units are implemented internally, for example if the detected area is cached or not.
 
Hello there people!
Is there any chance that there will be some kind of Draw Buffer extension to improve Unit Limit CTD/Bug/Freeze ?
In original game .exe if there are too many types of different units with their own different models the game will give FATAL ERROR, Draw Buffer Error or just freezes.
 
Hello there people!
Is there any chance that there will be some kind of Draw Buffer extension to improve Unit Limit CTD/Bug/Freeze ?
In original game .exe if there are too many types of different units with their own different models the game will give FATAL ERROR, Draw Buffer Error or just freezes.
Hello. I've never even heard of that error before, so it's hard to say if it's possible to resolve it. Can you share the exact error message? I searched the binaries for error messages containing the word "buffer" and found two in jgl.dll: "buffer error" and "Unable to allocate draw-buffer", and none in Civ3Conquests.exe itself. The fact that these errors come from jgl.dll complicates things since C3X isn't set up to modify that DLL, only the EXE. However if the error is caused by the program running out of memory then the solution might be as simple as setting the LAA bit on the EXE, which C3X already does when installing since version 5 or so.
 
Hello. I've never even heard of that error before, so it's hard to say if it's possible to resolve it. Can you share the exact error message?

Here you go. I've never seen this error outside of Anthony Boscia's WW3 scenario, but in this particular scenario it is really obnoxious (probably due to vast number of units)

Снимок экрана (196).png


However, surprisingly I don't recall seeing this error in modded civ, so it can be pretty much resolved already.

By the way: is it possible to use this mod to patch CD exe? Some of Civ3 utilities (Sima Qian multiplayer tool, for example) don't seem to be working with Steam version of the game, so to use them I have to switch to unpatched CD version. This can be tricky - for example, already mentioned WW3 scenario simply cannot be saved in unpatched exe.
 
Here you go. I've never seen this error outside of Anthony Boscia's WW3 scenario, but in this particular scenario it is really obnoxious (probably due to vast number of units)

However, surprisingly I don't recall seeing this error in modded civ, so it can be pretty much resolved already.

By the way: is it possible to use this mod to patch CD exe? Some of Civ3 utilities (Sima Qian multiplayer tool, for example) don't seem to be working with Steam version of the game, so to use them I have to switch to unpatched CD version. This can be tricky - for example, already mentioned WW3 scenario simply cannot be saved in unpatched exe.
Yes, exactly!
I've added a tonns of custom units to scenario over the years, and now there are kind of 750 pre-placed and spawned units on a start. Almost 500 of them are of unique model.
 
Here you go. I've never seen this error outside of Anthony Boscia's WW3 scenario, but in this particular scenario it is really obnoxious (probably due to vast number of units)
However, surprisingly I don't recall seeing this error in modded civ, so it can be pretty much resolved already.
By the way: is it possible to use this mod to patch CD exe? Some of Civ3 utilities (Sima Qian multiplayer tool, for example) don't seem to be working with Steam version of the game, so to use them I have to switch to unpatched CD version. This can be tricky - for example, already mentioned WW3 scenario simply cannot be saved in unpatched exe.
Thanks. I can see in the code that that specific error comes from a failure of the Win32 method CreateDIBSection. So it looks like the game isn't imposing its own limit on draw-buffers, it's just running out of memory. Hopefully setting the LAA bit solves this, otherwise I doubt there's anything I could do.

The problem with supporting the CD EXEs, other than the work involved, is that most of them have SecuROM DRM. DRM raises major technical and legal issues for the mod, so it will never support those versions of the game. It would be easier to instead update Sima Qian's tool for the current versions of Civ 3. The source code is available and I looked over it briefly a few months ago, but never followed up on updating it. Also I am going to add support for a new executable in R12, the DRM-free one available through PCGames.de. I'm not sure that will help you though, as I don't know if Sima Qian's tool is compatible with that version.
Yes, exactly!
I've added a tonns of custom units to scenario over the years, and now there are kind of 750 pre-placed and spawned units on a start. Almost 500 of them are of unique model.
Have you ever gotten that error with the C3X-modded executable?
 
Back
Top Bottom