Resource icon

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

On the topic of AI city spacing, the AI would perform better if it could be nudged to place its cities more tightly to make better use of real estate.
I was thinking of doing something like this back when I was looking at the AI's city location evaluator. It would be nice to be able to tweak the AI's preferences toward quantity or quality of cities. Under the standard game rules the AI would be better off packing more cities in closer together but in mods that restrict settler production (for example CCM where they're spawned from buildings), it would be better for the AI to grab the best available locations even if that means spreading out its cities more than it normally does. I remember thinking this sort of change would be relatively easy but I don't remember how I was planning to do it.

By the way, this reminds me I was going to post about the adjustable AI worker requirement in R17 P2. I'll have to get around to that.
 
Not sure what to do with this on Linux. What's the cl.exe referenced in the build file? Can I just run this through Proton?
cl.exe is MSVC. I would be surprised if it worked when run through Proton since it's normally run in a special environment set up for it, and in any case you would need windows.h to compile that file. It is possible to compile Windows programs on Linux using MinGW, which is based on GCC, but I've never tried that myself. If you have a Windows box you could install the Windows SDK then run that batch file from within the x64_x86 Cross Tools Command Prompt (not to be confused with the x86_x64 Cross Tools Command Prompt). That's what I do to compile it. If you'd like, I could simply upload the executable to GitHub.
 
I thought that The Hall of Fame started out before the Conquests expansion.
When I took over the HOF, Conquests had yet to be released. I was actually a beta tester based on my staff status, and HOF III only had 60 slots total.

I've created a specific discussion about the Flintlock mod for HOF III use here:
 
1) Would it be possible to modify the AI to better defend the fortress? To have more troops there?
The AI doesn't build them very often, but just for example in this game the Egyptians had two well-built fortresses and it's a shame that they were easy to capture.
fortress_01.png


2) Better artillery balance would help if there was a chance for capture, as it is I have 10 of my own guns and another 30-40 from enemies (who gradually captured them from their enemies).
A limit like 20% chance of capturing a unit would probably be better.

3) I guess it is not possible to limit construction of the railway, that it could not be built e.g. in 2-3 adjacent map tiles?
Thus, the AI/Player would build it from city to city. The city would be the only junction.

rail.png


Thank your for the mod, it's great.
 
Better artillery balance would help if there was a chance for capture, as it is I have 10 of my own guns and another 30-40 from enemies (who gradually captured them from their enemies).
A limit like 20% chance of capturing a unit would probably be better.

Isn't it funny how Flintlock trying to get the AIs to use artillery more effectively resulted in some people finding things easier since they then had more artillery type units that they can capture? Don't forget about what people learned from cathedrals and colosseums. Those may seem like bad things, since they cost shields for the human player, and they might do better to ignore them (though not necessarily for all map types or if playing for a 100k type game also). But, AIs pretty much need them.

Even with artillery changes making things easier maybe, I think having a different sort of AI makes for a good thing overall for civ III players. And the mod ends up good in many other respects also.
 
1) Would it be possible to modify the AI to better defend the fortress? To have more troops there?

2) Better artillery balance would help if there was a chance for capture, as it is I have 10 of my own guns and another 30-40 from enemies (who gradually captured them from their enemies). A limit like 20% chance of capturing a unit would probably be better.

3) I guess it is not possible to limit construction of the railway, that it could not be built e.g. in 2-3 adjacent map tiles?
Thus, the AI/Player would build it from city to city. The city would be the only junction.

View attachment 686373

Thank your for the mod, it's great.
  1. This would probably be possible but I don't know what it would involve. I don't understand the unit AI well enough to know exactly how it decides where to position its units. In this case there's presumably a condition that moves a defender to any ungarrisoned fortress and I could probably add more defenders by modifying the check for a garrison. The hard part would then be determining which fortresses deserve many defenders.
  2. This is something I've had in the back of my mind for a while. It wouldn't even be difficult since there's already a function call in the original logic that determines if a defeated artillery piece is captured or destroyed. (It's a call to Leader::can_build_unit, the game does not let you capture units you couldn't have built yourself.) I could modify that call to also destroy units on a failed dice roll.
  3. I think changing the rules like this should be doable. There's a function that checks if a worker can perform a given command and I could easily modify that to restrict the ability to build railroads based on what's in adjacent tiles. I'm not sure if that would work with the railroad-to or auto-build-trade-network commands, but if it doesn't I expect I could figure something out. The real problems here would be that the AI wouldn't understand the new rule and the human player could come up with ways to exploit it.
 
Flintlock here is a feedback about the option of the naval unit retreat in my current CCM test game with the R 17 preview 2 version of your brilliant mod.

1. In my current CCM test game I dimmed down the number of naval escort units and to balance this, I allowed naval units to retreat (so transport ships in an attacked convoy even have a chance to "survive in the PQ 17 style", if their smaller number of escorts are eliminated). This setting should also provide attacked submarines with a greater chance to survive an attack by diving away.

I assumed that the settings "sea_retreat_rules" is used for the retreat of the attacking ship and the setting "allow_defensive_retreat_on_water"
setting is used for the option of a retreat of the defending ship.

Naval Retreat.jpg


2. The new naval retreat options all in all are working very well, but there are some "specialities" to report:

a) In a one-against-one melee sea battle of ships with full health it is (nearly) impossible to sink a ship with one attack.

b) The naval retreat settings have a big negative graphical influence, as the ships in a melee battle loose their "rotate before attack" settings, meaning the ships with this flag fire graphically into the water and not against their opponents.

This problem was discussed for land units longer time ago, but with the retreat option for ships enabled, it seems to concern now naval units, too:

https://forums.civfanatics.com/threads/two-interest-unit-property-in-the-civ3conquestedit.350249/
https://forums.civfanatics.com/thre...evelopment-thread.620181/page-2#post-14885876
https://forums.civfanatics.com/thre...evelopment-thread.620181/page-2#post-14888053
https://forums.civfanatics.com/thre...evelopment-thread.620181/page-2#post-14888950

3. Conclusion: I think it could be a good idea to list the individual classes of ships that should be able to retreat in the scenario.c3x_config, so per example in CCM only transport ships and submarines can retreat from a melee battle (and for submarines the not working "rotate before attack flag" in a melee battle is no problem, as their attack graphics mostly show no broadside attack, but a straight-forward attack).
 
Last edited:
I'm afraid to report that the problem of the editor ticked charm flag bombardment not working as intended has persisted. The units target like they would in C3C, not PTW. And only when I manually added the unit Gun-Howitzer into the PTW targeting list it started to target like PTW.

Screenshot (1607).png


Screenshot (1610).png


My Gun-Howitzer unit has the charm flag ticked. But instead of targeting the city of Hispalis like PTW would it only struck the defending units with stack bombard. The stack then stopped after the units have been redlined. My Gun-Howitzer stack was only 12 units or so. With PTW targeting, the units would rarely been redlined and the city would be badly depopulated and its improvements badly destroyed. Hispalis was taken with everything intact.

So next turn I manually added the Gun-Howitzer unit into the PTW targeting list:

Screenshot (1612).png


And the Iro Gun-Howitzers pounded by cities and took out improvements. I'm not sure what the issue here is. Sometimes it works just find during WWII Pacific debug tests. But in my debug mode epic games it never does.

The Iros went on to destroy me despite fighting both the Persians and Mexicas. Thanks to the perfume the AI performance in industrial age and beyond has been greatly enhanced. They will build hospitals, factories and powerplants despite being constantly at war. I had to replay a save and clinch that game with a diplo victory.
 
I assumed that the settings "sea_retreat_rules" is used for the retreat of the attacking ship and the setting "allow_defensive_retreat_on_water"
setting is used for the option of a retreat of the defending ship.
That's right.

b) The naval retreat settings have a big negative graphical influence, as the ships in a melee battle loose their "rotate before attack" settings, meaning the ships with this flag fire graphically into the water and not against their opponents.

3. Conclusion: I think it could be a good idea to list the individual classes of ships that should be able to retreat in the scenario.c3x_config, so per example in CCM only transport ships and submarines can retreat from a melee battle (and for submarines the not working "rotate before attack flag" in a melee battle is no problem, as their attack graphics mostly show no broadside attack, but a straight-forward attack).
It's odd that allowing defensive retreat breaks rotate-before-attack. I'll have to look into why that happens and see if I can fix it. Limiting defensive retreat on water to a list of unit types would be pretty easy in any case.

I'm afraid to report that the problem of the editor ticked charm flag bombardment not working as intended has persisted. The units target like they would in C3C, not PTW. And only when I manually added the unit Gun-Howitzer into the PTW targeting list it started to target like PTW.

And the Iro Gun-Howitzers pounded by cities and took out improvements. I'm not sure what the issue here is. Sometimes it works just find during WWII Pacific debug tests. But in my debug mode epic games it never does.
Might you have a scenario config that's setting charm_flag_triggers_ptw_like_targeting to false? That would explain why it works in the WWII scenario but not outside of it. Otherwise it's hard for me to even guess why that option wouldn't work. Under the hood, it simply adds all unit types with the charm flag to the list of units using PTW targeting. I already double checked that it checks for the charm flag correctly using Quintillus' editor like you showed. If it's not a scenario config overriding the setting, could you try to create a minimal scenario that reproduces the bug?

Not sure what to do with this on Linux. What's the cl.exe referenced in the build file? Can I just run this through Proton?
Following up: I tried building sound_test.cpp with MinGW on Linux and it works fine. The only little issue was I had to pass --static to the compiler otherwise it would link against several DLLs that aren't present in Wine. I pushed a separate Linux build script to the C3X repo. I'm not sure if it will work for you since the MinGW 32-bit cross compiler might be named differently on your distro. I'm using OpenSUSE.

When the sound test is run in Wine, the sound repeats like in game. That's good to know but I was actually hoping it wouldn't repeat since that would indicate the problem was somewhere in Civ3Conquests.exe, which is something I can easily edit. Instead the problem is somewhere in sound.dll, Mss32.dll (which is Miles Sound System), or maybe even in Wine itself. More experimentation is necessary. The next thing I'm going to test is editing hawk.wav, for example load it into Audacity then export it back out, to see if I can determine what about that file in particular causes the looping.
 
It's odd that allowing defensive retreat breaks rotate-before-attack. I'll have to look into why that happens and see if I can fix it. Limiting defensive retreat on water to a list of unit types would be pretty easy in any case.
I added a fourth link to the discussion about the "rotate before attack" and "ranged attack" flags between Vuldacon and Bluemofia, where Bluemofia described the problem short and very precisely.
 
It's odd that allowing defensive retreat breaks rotate-before-attack. I'll have to look into why that happens and see if I can fix it. Limiting defensive retreat on water to a list of unit types would be pretty easy in any case.
I feel like this is at least in part done for the visual effect, where the attacker first goes in to attack, then retreats back to its square. It would be a lot more visually confusing if the unit just stood there and attacked, then just suddenly stopped attacking.
 
I made a very short test scenario in DEBUG mode about the naval "rotate before attack" problem combined with the default.c3x_config file for the R17 Preview 2 version of the Flintlock mod with the naval retreat options enabled. Simply put the biq in the C3C scenarios folder, rename the default.c3x_config file in the R17 Preview 2 folder to default.c3x_config-orig (or something like that) and than copy the attached to this post default.c3x_config file (where only both retreat settings were changed to allow naval retreat) into the R17 Preview 2 folder. No other files should be needed as the test scenario only uses the settings of the standard epic game.

The test scenario holds an American and a Japanese battleship. Both battleships have the "rotate before attack" and the "ranged attack" flags. Now when war is declared between both civs, the attacking battleship in the bombard attack rotates to fire on the other battleship (as it should be), but if the direct melee attack is used, the rotate flags of both battleships are not working.
 

Attachments

  • conquests-Naval Retreat.zip
    35.7 KB · Views: 5
  • default.c3x_config.zip
    9.9 KB · Views: 3
I made a very short test scenario in DEBUG mode about the naval "rotate before attack" problem combined with the default.c3x_config file for the R17 Preview 2 version of the Flintlock mod with the naval retreat options enabled.
Thanks for this. I see the problem and have also found the relevant code inside the EXE. I'm not sure what's the proper way to fix it though since I don't understand how all the little details of the combat animations are supposed to work. If I were to modify it so that retreat eligibility doesn't affect ranged vs melee animations for naval combat specifically, that shouldn't break anything... right?
 
If I were to modify it so that retreat eligibility doesn't affect ranged vs melee animations for naval combat specifically, that shouldn't break anything... right?
Normal logic would let me answer this question with yes, but I be cautious and answer, that we will see.

Today I had a question about an ETA for the next version of CCM. At present that version of CCM is running with the R17 preview 2 version of your great mod. Is it allowed to post a link to the download of the R17 preview 2 version in your GitHub forum, if the official R17 version is still needing a longer time?
 
Last edited:
This leads me to ask... is it just any wav file over a certain length?
Doesn't look like it. wolf1.wav is 6.49 sec long but doesn't loop versus Hawk.wav at 5.27 sec.

Edit: Length does seem related though. Importing Hawk.wav into Audacity then exporting it back out does not fix the looping, neither does cutting it down to 4 sec, but cutting it down to 2.5 sec does.

Today I had a question about an ETA for the next version of CCM. At present that version of CCM is running with the R17 preview 2 version of your great mod. Is it allowed to post a link to the download of the R17 preview 2 version in your GitHub forum, if the official R17 version is still needing a longer time?
You can go ahead and use the preview version if you want to. That should work fine, there are no serious bugs in that version that I know of. There is that little issue where the icons showing resource generation over buildings might be wrong since the mod uses the resource IDs to look up the icons instead of the resource's icon IDs. You can work around that by listing resources in the same order as their icon IDs.

I'm hoping to have a preview 3 version of R17 done soon. The last thing holding it up was the civ and leader name variations by era, but that's done now. I just have to put the finishing touches on it.
 
Last edited:
Doesn't look like it. wolf1.wav is 6.49 sec long but doesn't loop versus Hawk.wav at 5.27 sec.


You can go ahead and use the preview version if you want to. That should work fine, there are no serious bugs in that version that I know of. There is that little issue where the icons showing resource generation over buildings might be wrong since the mod uses the resource IDs to look up the icons instead of the resource's icon IDs. You can work around that by listing resources in the same order as their icon IDs.

I'm hoping to have a preview 3 version of R17 done soon. The last thing holding it up was the civ and leader name variations by era, but that's done now. I just have to put the finishing touches on it.
This is great. :) And I am especially interested in the preview 3 version with the different era specific civ and leader names. :bounce:
 
Hi Flintlock. :) I thought I would bring up an issue which is quite fundamental, as it applies to every mod that allows a cultural victory (including mine). It is the fact that the amount of culture points needed for a cultural victory doesn't scale with map size.

In the vanilla game, a culture victory can be achieved with between 60.000 (Tiny map) and 160.000 culture points (Huge map), depending on the number of tiles. This is not how it works for mods; mods are only allowed to have one fixed value. If you set it low enough to make culture victory achievable on smaller map sizes, victory will happen way to early on larger maps. And vice versa. I'm hoping that this won't be too hard to fix, since the human player is allowed to input this value manually on the last setup screen before starting the game. Maybe this could be intercepted and the correct value injected or something. As far as what that value should be, I believe the formula √(Width x Height) x 1000 should produce the same results as vanilla Civ 3 on standard map proportions, and a reasonable amount to win on non-standard maps.

EDIT: On second thought, maybe it would be better to let the modder provide a list of 5 values, one for each map size, since some mods generate more or less culture points than the standard game.
:thumbsup:
 
Last edited:
Top Bottom