Resource icon

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

Nice. Make sure to send me a link once the German translation is done so I can put it in the C3X readme. By the way I'm planning to post C3X R9 this week some time, the big changes are AI stuff (the city location view like I showed earlier and a full implementation of perfuming) plus a few small things.

In this case may be it is better to wait for C3XR9 before releasing the German version. :)
 
Is there any clue why this doesn't work with the CD version of Civ3? I'd love to try it but my Civ is so heavily modded that I dread to reinstall it...
 
Is there any clue why this doesn't work with the CD version of Civ3?
IIUC, it's because Flintlock built the patch framework based on the noCD-version of the conquests.exe supplied with the GOG(/Steam) installation of Civ3Complete — which unfortunately does not contain exactly the same code as the executable supplied on most CD-versions. So even though the patch-installer can find the CD-based executable, it can't modify it.

One option to get round this is to buy the GOG-version (€5 or less), install it in a new location on your HDD, copy the executable from there to your primary (CD-based) installation, and then patch it (or patch it in the secondary-installation, and then copy the patched .exe plus the associated .../CX8 directory to your primary).

(Either way, don't forget to rename/backup the original .exe first, blah yada faseln...)

That's how I got the CX8 patch also working on our no-longer-internet-capable WinXP laptop (on which I'd previously installed the also-not-patchable GamersGate version of C3C), just a couple of weeks ago.
 
Last edited:
Is there any clue why this doesn't work with the CD version of Civ3? I'd love to try it but my Civ is so heavily modded that I dread to reinstall it...

Ares, the patched exe can work with a CD version of Civ 3 Complete, if the pc is still able to run it without the patched exe. At least it does with my CD Chronicles version of Civ 3 Complete. The problem seems to be, that the Flintlock patch cannot find the normal CD C3C exe for boosting it with the new code. So -as tjs282 posted - you need a (separate) installing of the GOG version of Civ 3 Complete (in the GOG sale every some weeks for € 1,29). It is possible to install several versions of Civ 3 Complete on the same pc (but this is not necessary for this operation). Per example, for modding reasons, I have on my win 10, 64 bit pc, three independent operable versions of Civ 3 Complete: One version in the C/GOG directory, one in the Programme (x86) directory (the CD version) and one in the C/Programme directory.

Now boost the exe of the GOG Civ3 Complete version with the flintlock patch. Rename the Civ3Conquests exe in your CD version to Civ3Conquests-orig (or something like that) and than copy the Civ3Conquests exe, boosted with the Flintlock patch, to your CD installation. It is important that the other parts of the flintlock patch are copied to the C3C mainfolder of your Civ 3 Complete CD version, too, otherwise the boosted exe will not work. I was able to draw even different shortcut links from my Civ Chronicles CD version exes of Civ 3 Complete to the desktop for starting those different exes.

I cannot say if this procedure will work with CD versions of C3C older than Civ 3 Complete, but in this case you should have at least a working separate installing of the GOG version, patched with the Flintlock path. I was able to transfer my CCM 2.50 mod (more than 6 GB) without any problems to the GOG installation, too, but of course - as always - before doing these operations, please make a safety copy of your mod on a separate hard disk. :)
 
C3X Release 9
Changes:
  • Perfume can be applied to multiple improvements or unit types
    • Perfuming is now a polished feature, in R8 it was more of an experiment. Now it can be applied to units as well as improvements and you can specify a list of perfume targets and amounts instead of just one. Also the perfume amount will now be added accurately, before it was added in the middle of the AI computation and might have gotten multiplied later in the process, now it's added at the very end. Lastly there's now a warning in case of misspelled perfume targets.
  • Corruption can be completely removed with "OFF" government setting
  • Press P in city screen to see AI point value for each available build
  • Press L on map to see how desirable the AI finds each tile as a city location
    • The display is like I showed earlier in the thread. Pressing L opens a popup where you can select the player from whose perspective you want to see the valuations, or turn them off. The values are pretty similar for all players (but I only learned that by implementing this feature). See attached screenshots.
  • AI naval invasion forces can include artillery (with offensive artillery AI enabled)
  • Option to disable worker automation
  • Disallow land settlers from founding on water
    • Useful for modders who want to allow founding cities on water but don't want settlers on boats to be able to do it.
  • Fix tile coords replacing resource name in the info box on the Steam version
  • Proper movement check for replacement army inclusion criteria
Link: https://forums.civfanatics.com/resources/c3x.28759/

For the next version I'm planning to work on the AI some more, that's why so much of this release is about revealing what the AI is "thinking". I'd like to look into improving the AI's city placement, production choices especially about naval units, and naval invasions. The first two are definitely doable but the third might not be, we'll have to see. I have no idea when R10 will be done, to be honest work on C3X has slowed during the past weeks and especially recently as I've been spending time on the Civ 3 recreation project instead. Again we'll have to see, and in the mean time, enjoy the update!
 

Attachments

  • highlight_popup.png
    highlight_popup.png
    1.7 MB · Views: 75
  • after_highlight_popup.png
    after_highlight_popup.png
    1.6 MB · Views: 81
Flintlock, one more time thank you very much! :thanx:

While waiting for the C3X Release 9, I made another testgame with your version 8 and the upcoming German C3C version (the translated standard C3C with updated graphics). Now I cannot stop this game as it is very interesting. :woohoo: The offensive artillery in version 8 is a real game play changer. Here is a screenshot of an offensive Iroquois stuck in era 4, containing 34 artillery (bombard range 2), 67 infantry and 1 flak. Absolutely devastating!

I don´t know, why the Iroquois artillery has two "rows" with the same stats in that stack.
Edit: May be artillery with own nationality and captured artillery?

Spoiler :
Monster-Arty-Stack.jpg
 
Last edited:
I don´t know, why the Iroquois artillery has two "rows" with the same stats in that stack.
Edit: May be artillery with own nationality and captured artillery?
I think it's the experience-levels? Because C3X separates stacks of similar units by "remaining/total" HP (as illustrated in your screenie by the separation of the Infantry units into 3 separate stacks: 3/4, 4/4 and 3/3 HP).

So I would guess that some of those Artillery units are technically "veterans" and the others are only "regulars" — but units with A/D-values = 0 don't show health-bars (or HP-counts in the right-click unit-list).
 
I think it's the experience-levels?
It is. I noticed this same thing with workers when I was playing a game a few weeks ago and made a mental note to change it, but then it slipped my mind. I'll write it down this time so I remember to do it for the next version.
 
It is. I noticed this same thing with workers when I was playing a game a few weeks ago and made a mental note to change it, but then it slipped my mind. I'll write it down this time so I remember to do it for the next version.
I actually don't mind the separation by HP-levels, because it means that when everyone's fortified, I can find and selectively wake only the healthy units.

But I've noticed that it seems glitchy sometimes, because in the game I finished last night (Tides of Crimson v.2.87; Orcs rool OK!), I frequently saw similar units with the same HP-level, getting split into 2 groups (does CX3 v.8 maybe also split by remaining movement-points?).

With respect to worker-units (and to a lesser extent, bombard-units), it would certainly helpful to have a split between natives and foreigners, but unless these units also have non-zero A/D values (as do many in ToC) I agree that splitting by 'virtual' HP is meaningless.
 
does CX3 v.8 maybe also split by remaining movement-points?
It does. Here's the full criteria, two units will be grouped together if all of the following is true:
  • they have the same type and that type's transport capacity is zero
  • they've taken the same amount of damage
  • they've used up the same number of movement points
  • their statuses match (status includes things like whether or not the unit has attacked yet that turn)
  • their states match (includes things like fortification and ongoing worker actions)
  • they have the same experience level
  • they are both not contained in any unit or they are both contained in the same unit
With respect to worker-units (and to a lesser extent, bombard-units), it would certainly helpful to have a split between natives and foreigners
Noted.
 
It looks like I may have chosen the wrong year to dial down my Civ involvement! Just reading the Release 9 new features, and Civinator's post about offensive artillery, it sounds like I've been missing out on a good amount. I might have to put some other things on the back burner and play another 540 turns...
 
Hi all,

I've been watching this thread with some interest over the last few months and when Steam recently offered a Civ3 sale, I couldn't help myself. 20 years on, Civ3 is ruining my life. Again!

Like many others, I'd like to thank Flintlock and all the giants of whose shoulders he stands upon for this great work. It really adds so much wonderful enjoyment and value to this already great game!

C3X GitHub page: https://github.com/maxpetul/C3X
I added current versions of my Ghidra project folders to the repo, they're inside the "Decompilation" folder. There are two archives, one for the GOG version of Civ 3 Complete and another for the Steam version. The GOG version is much more fleshed out, it's where I do all of my reverse engineering work. On the Steam version I do only as much as I need to to port the mod over. I'll try to keep these archives reasonably up to date going forward.

I'm intrigued to learn a little bit more about how Flintlock has done this, the technology used, and the Civ3 game code. Beware that I'm very much a novice with just a little bit of visual basic coding under my belt.

I've downloaded the GOG version above, extracted it, but really have no clue what to do with the files in it now. Do I need to open those up through some specific software? If so, which software?

I'll add the barb diagonal attack bug to the list. It sounds to me like the kind of bug that will be difficult to track down due to distance between the flawed code and its observable effects, but who knows, maybe it's easy. Unfortunately the fact that Firaxis already solved this bug doesn't help. Even if I had EXEs with and without the patch it would be quite a bit of effort to analyze them. And I don't even have them, I don't even have the disc version of PTW, and even if I did, the original disc versions don't even work with Windows 10.

Can I help? If I was able to source the relevant EXEs, I think I'd be prepared to try to analyse these. I probably don't have the skillset to do this, but if I don't try, I'll never know.

I have the CD version of this game from 20 years ago and an Win XP virtual machine. So I think I have the EXEs. How would I decompile them to get them to a stage where I can analyse?

Keep up the great work Flintlock et al!

BlueSox14
 
Special thanks Flintlock for the disable auto worker, yahoo. Not such a big issue with 20-50 workers, huge issue with 400. Can't help but hit that automate once in a while.
 
I have been playing a custom map and it is very large (unit types). In a game like that players likely do not know the units and have to use the pedia.

You run into the issue that scrolling to a given unit and selecting to read about ends up putting you back to the start, when you close that entry.

Now you have to scroll all the way out to that point to continue looking at units.

Is it possible to have it save the pointer and return to it, when you close that item's detail? If I want to look a several units, often just give up on a list with 20 or more entries.

Anyway massive kudo's, you made this game so much better.
 
Like many others, I'd like to thank Flintlock and all the giants of whose shoulders he stands upon for this great work. It really adds so much wonderful enjoyment and value to this already great game!
Glad to hear you're enjoying it.
I'm intrigued to learn a little bit more about how Flintlock has done this, the technology used, and the Civ3 game code. Beware that I'm very much a novice with just a little bit of visual basic coding under my belt.
I've downloaded the GOG version above, extracted it, but really have no clue what to do with the files in it now. Do I need to open those up through some specific software? If so, which software?
The software you need is Ghidra: https://ghidra-sre.org/. By the way, if you downloaded the 7-zip archives from months ago you should instead use the GAR files I uploaded a few weeks ago. They're more recent so have more stuff decoded and they're proper Ghidra archives unlike the 7Z files where I just zipped up my project folder because I didn't know Ghidra had an archive feature. Though Ghidra's own compression is much worse than 7-zip.

About how the mod works, I've been thinking about writing up a nice, comprehensive technical explanation since I've been asked that several times, but I never got around to it. It's not very technical but here's something I wrote back in April about it:
me said:
The mod works based mostly on function interception/patching/replacement or whatever you want to call it, I haven't been consistent myself. I think people are intimidated by EXE patching because they imagine it involves writing machine code by hand, but I do almost none of that. Instead I write C code and inject it into the executable. The injection process, which is fully automated at this point, works by replacing functions with custom versions in a manner that preserves the original function so that it can be called by its replacement. I wrote about how it's implemented in respose to Tsubasanut here: https://forums.civfanatics.com/thre...es-in-exe-modding.666881/page-3#post-16049068. This technique is very useful, clearly it can intercept function calls and modify them, but in addition it can:
- intercept function returns by replacing a function, calling the original first thing, then running some code afterward
- track changes in state by replacing every function that potentially modifies some state and check its value after versus before calling the original (for example this is how the disorder warning code detects that the player has signaled an intention to end the turn)
- pass info through a side channel (f.e. if you want function B to get some info from its caller A, intercept A and set a global variable then read it in B)
- alter a single function call by intercepting the callee then running different code depending on the return address
All of this depends on knowledge gained by reverse engineering the executable, naturally you can't replace a function without first figuring out what it does and you can't read or write the game's memory without knowing what's kept where and how.
Also around the same time I posted an example of how the mod can be used to modify the game rules, specifically the minimum distance between cities. I included it in the C3X GitHub repo in the "Min City Sep Demo" folder (link to text: https://raw.githubusercontent.com/maxpetul/C3X/master/Min City Sep Demo/writeup). Note that demo dates back to April so it mentions civ_prog_objects.h which has now become a CSV file, but the process is still fundamentally the same.
Can I help? If I was able to source the relevant EXEs, I think I'd be prepared to try to analyse these. I probably don't have the skillset to do this, but if I don't try, I'll never know.
I have the CD version of this game from 20 years ago and an Win XP virtual machine. So I think I have the EXEs. How would I decompile them to get them to a stage where I can analyse?
Sure. If you're interested in this stuff, go ahead and jump in. That's what I did, I already knew C and basic x86 assembler but I had no experience with reverse engineering software before I started working on C3X almost a year ago.

The thing with the old PTW EXEs is that if you want to study them you'll be faced with the enormous chore of porting over the reverse engineering work from the newer ones. I would instead start by studying the relevant functions in the newer (GOG Complete) EXE to try to figure out why the bug occurs, and only if I really couldn't figure it out would I look to the earlier ones. Most of the bugs I've fixed so far were not super subtle. The relevant functions, where I would start searching, are Unit::ai_move_barbarian and maybe secondarily Leader::update_preproduction. Those are the locations of the barbarian AI that I've found so far.
Now you have to scroll all the way out to that point to continue looking at units.
Is it possible to have it save the pointer and return to it, when you close that item's detail?
I doubt it would be difficult, added to the list.
 
Flintlock,
In certain mods, like RaR, there are many added specialists. When the player wants to change to a different one, you might accidentally click past the one you want and then have to click thru all of the specialists again. Would it be possible to click on a specialist and bring up a little mini-list and just move the mouse pointer to the specialist you want?

Thanks for all your work!!:)
 
You fixed the sub bug...
YOU FIXED THE SUB BUG!?!

Just been thinking about playing Civ3 again, one of the things been putting me off from it was the use of submarines, the sub bug, Ai tripping over my subs and suddenly I’m at war with a friendly.
Been trying the other Civs, but 3 has the allure!
Plus a whole lot of other stuff fixed, houseboat, Ai armies stocked and I guess no more AI hoarding artillery to high heaven in their cities!
 
In certain mods, like RaR, there are many added specialists. When the player wants to change to a different one, you might accidentally click past the one you want and then have to click thru all of the specialists again. Would it be possible to click on a specialist and bring up a little mini-list and just move the mouse pointer to the specialist you want?
Added to the list. A little popup selector sounds difficult to do, the easier but almost as good solution to this problem is probably making right click scroll backwards through possible specialists, but I'll see if it's practical to do better than that. Come to think of it, doesn't right click open the civilopedia? In that case it'll have to be shift+click or something.
 
It is. I noticed this same thing with workers when I was playing a game a few weeks ago and made a mental note to change it, but then it slipped my mind. I'll write it down this time so I remember to do it for the next version.

Maybe it should not be changed. In case of the korean UU you may want to know if a unit is elite and could therefore generate a MGL via lethal bombardment.

In a modded game it may also occur that units without HP may be updated to units with HP.
 
Back
Top Bottom