Resource icon

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

To Civinator. Yes, I believe the houseboat is triggered when the civilization with the "houseboat" takes their turn.

To Flintlock: I believe that settlers on land are eliminated when the last city of a civilization is taken. That SHOULD be what happens with a settler on a ship, but what doesn't happen.

To Virote: I play RARR, in that mod, the Pentagon unit allows the army to have more units embarked. This works as advertised.
 

Attachments

  • ArmyValueFlags.png
    ArmyValueFlags.png
    82.8 KB · Views: 57
I tested that RARR 1.6 save and found my houseboat fix prevents the crash there too, so I think it's safe to say it's a proper fix. I still don't know exactly what causes the bug. I tested my theory from yesterday (that the crash happens when the settler on a boat can't find a place to settle) in a scenario but the test didn't crash, instead the galley with the settler just stayed in place. It's annoying to me not knowing the details of the bug but I don't think it's worth any more time investigating.
 
Yes, thank you :) what I was thinking the other day: is it possible that there maybe some restrictions in the code one could disable to improve the performance, to example some limitations on how much RAM the program can use? And if so, could we somehow "boost" the performance with it?
 
Some thoughts about AI landartillery:

I start with the 'working part' of the AI landartillery routine, the so-called "defensive bombardment":

When a defending stack contains one (or more) artillery units, each unit can fire one shot during the attack against the attacking unit. This works well, even when the defending AI 'landartillery unit' has only a bombard range of zero. The astonishing fact is, that it is still working well, even when the defending AI 'artillery unit' has no AI artillery strategy activated, but only the attack or defense strategy.

Per example most 'artillery units' in CCM have only the AI attack strategy activated and an additional bombardment with a range of zero. Some 'artillery units' in CCM have the AI defensive strategy activated and the additional defensive bombardment settings, too.

Defensive Bombardment1.jpg


Defensive Bombardment2.jpg


Other situations when even AI units can bombard other units without the AI artillery strategy activated are:

- If the land unit has the ZOC setting (Zone of Control) or
- If the land unit is inside a fortress

The so-called 'defensive bombardment' for land units and the 'offensive bombardment' of units with the ZOC setting or inside a fortress have the limitation, that this kind of bombardment can take out maximal one hitpoint of the attacking or bypassing unit, regardless of the number of fire rate that this unit has.

Flintlock, it would still be a great progress for C3C, if the defensive bombardment of units can take out a maximum of hitpoints up to the rate of fire, that is set for this unit. In my eyes it is not necessairy, to enlarge the hitpoints up to the fire rate, that can be taken out from bypassing units by units in fortresses or with a ZOC setting.

...confirming that an inability to find escorts is the fundamental problem limiting the AI's artillery usage.

Here a speculation, based on my experiences by experimenting with C3C units:

What is, if the escort programming for AI landartillery is only based on units with the defensive AI strategy? I think this could be plausibel, as the landartillery units in Civ 3 have no defense value. In this case the offensive use of landartillery would only take place, if the escorting land units with the AI defensive strategy would leave their defensive positions, too - and the combination of both could become the "death of the AI landartillery routine" (especially if units with the combined attack/defense AI strategy as most of the later 'infantry' units would not count in these calculations) - but as posted: This is only a speculation.
 
Last edited:
Yes, thank you :) what I was thinking the other day: is it possible that there maybe some restrictions in the code one could disable to improve the performance, to example some limitations on how much RAM the program can use? And if so, could we somehow "boost" the performance with it?

If memory serves me right, there is a program written specifically for Civ 3 to increase the limit of how much ram is has access to. But I can't seem to find it through a few minutes of searching. However, you can find a generic large address aware patcher that is capable of patching any exe.

I don't know how successful this one is, as I haven't tried it myself. https://www.techpowerup.com/forums/threads/large-address-aware.112556/
 
Are the mechanism of the AI cruise missile and tactical nuke strat flags similar to the artillery one that it has to wait for escorts leave the city? Because these units are stuck in their cities as well.
 
is it possible that there maybe some restrictions in the code one could disable to improve the performance, to example some limitations on how much RAM the program can use? And if so, could we somehow "boost" the performance with it?
Not that I've seen. I expect improving performance to be difficult in general because the original devs have presumably already plucked all of the low hanging fruit. Another problem is that tools to analyze performance and guide optimization efforts assume that whoever's doing it has the source code available.
it would still be a great progress for C3C, if the defensive bombardment of units can take out a maximum of hitpoints up to the rate of fire
Added to the list. Like with most things, how difficult this would be to do depends on how the original code is structured, and I can't say anything about that right now b/c I haven't looked into it yet.
What is, if the escort programming for AI landartillery is only based on units with the defensive AI strategy? I think this could be plausibel, as the landartillery units in Civ 3 have no defense value. In this case the offensive use of landartillery would only take place, if the escorting land units with the AI defensive strategy would leave their defensive positions, too - and the combination of both could become the "death of the AI landartillery routine" (especially if units with the combined attack/defense AI strategy as most of the later 'infantry' units would not count in these calculations) - but as posted: This is only a speculation.
That's possible. I still haven't looked into how escorts are normally assigned so I too can only speculate as to why artillery aren't getting any. My guess would be that the AI won't change existing units to escort duty, instead it only assigns newly built units, but then it's always short on escorts because it rarely builds defensive units unless it needs city defenders. On the other hand the AI doesn't have trouble finding escorts for its settlers so they must have different logic from artillery.
If memory serves me right, there is a program written specifically for Civ 3 to increase the limit of how much ram is has access to. But I can't seem to find it through a few minutes of searching. However, you can find a generic large address aware patcher that is capable of patching any exe.
I had thought of having the installer set the LAA bit when it writes out a new EXE but I never made that happen because I forgot. I'll go ahead and do that now, it's a trivial change and I highly doubt having the LAA bit set will cause any problems. Though it won't improve performance. The only thing the LAA bit helps with is out-of-memory errors in 32-bit programs.
Are the mechanism of the AI cruise missile and tactical nuke strat flags similar to the artillery one that it has to wait for escorts leave the city? Because these units are stuck in their cities as well.
I haven't looked into the AI routines for those units so I can't say.
 
I had thought of having the installer set the LAA bit when it writes out a new EXE but I never made that happen because I forgot. I'll go ahead and do that now, it's a trivial change and I highly doubt having the LAA bit set will cause any problems. Though it won't improve performance. The only thing the LAA bit helps with is out-of-memory errors in 32-bit programs.

Yeah I think the LAA only helps in preventing crashes due to needing too much system memory. Though I'm not sure what would make the game spike to 2GB or more. Perhaps too much AI activity between turns?

Also, here's another idea for future consideration should you have the time or desire; re-enabling city-view button in custom scenarios. Civinator has this enabled for his mod but to do so requires mods be built in the main folder and not sub folders. I prefer sub folders due to making it more user-friendly.
 
Yeah I think the LAA only helps in preventing crashes due to needing too much system memory. Though I'm not sure what would make the game spike to 2GB or more. Perhaps too much AI activity between turns?
I don't know either. I can't recall encountering or even reading about an out-of-memory crash in Civ 3. Also I'll add the city view button for scenarios to the list. Hopefully that's just a matter of flipping a switch somewhere.



A little progress report after some more digging through the code: The cruise missile AI looks for a target within bombard range and attacks if it finds one or otherwise fortifies in place, so a cruise missile will never move on its own. An escorter might be able to move it. The tactical nuke AI is similar except it also has some additional code about naval transport after the target search.

I also looked into the AI for leader units. One of the first things it does, or rather tries to do, is check if the unit is in a city, can rush production, and if doing so would save at least 10 turns, then if all that's true it goes ahead and does the rush. There are two major bugs that I see, the first is that it calls a function to check if rushing is possible but ignores the result, which is why the AI can rush wonders with MGLs and would be able to rush units as well. The second is that it doesn't determine the time remaining on the city's current build but rather on some invalid build order containing garbage data, so it then gets some meaningless number of turns remaining and compares that with 10. Fixing these bugs would be easy enough but the underlying logic is still too basic so I'm thinking about replacing the leader AI entirely.
 
Also I'll add the city view button for scenarios to the list. Hopefully that's just a matter of flipping a switch somewhere.

Unfortunately it is more than a "switch". In C3C the former city view button in all mods and scenarios but the epic game, is used for showing strategic resources in a city, if a mod or scenario holds more strategic resources than the epic game.

Cityview-StratButton.jpg


Edited: Part about resources in city radius deleted, as it was wrong.

I also looked into the AI for leader units. One of the first things it does, or rather tries to do, is check if the unit is in a city, can rush production, and if doing so would save at least 10 turns, then if all that's true it goes ahead and does the rush. There are two major bugs that I see, the first is that it calls a function to check if rushing is possible but ignores the result, which is why the AI can rush wonders with MGLs and would be able to rush units as well. The second is that it doesn't determine the time remaining on the city's current build but rather on some invalid build order containing garbage data, so it then gets some meaningless number of turns remaining and compares that with 10. Fixing these bugs would be easy enough but the underlying logic is still too basic so I'm thinking about replacing the leader AI entirely.

Flintlock, thank you very much for providing us with more knowledge about the mechanics of C3C. :goodjob:
 
Last edited:
As speaking about strategic resources: At present, if the flag "resources needed in city radius" is set in the editor, these resources don´t need to be linked to the tradenet of the city, that is constructing that building, by a road or a railroad - what seems like a logical error and therefore to be a bug in C3C.

I don't see a problem unless I am missing your point... The Resources do have to have a road for use in a City and still be part of the Tradenet when the Resources are flagged in the Editor for use within a City Radius to build something. That Editor Flag simply also adds the ability to make a Resource specifically needed for a Build within a specific City. The Same Resource is still also used in the Tradenet and in any case, the Required Resources are still part of the limited 32 Strategic/Luxury Resources..
 
I don't see a problem unless I am missing your point... The Resources do have to have a road for use in a City and still be part of the Tradenet when the Resources are flagged in the Editor for use within a City Radius to build something. That Editor Flag simply also adds the ability to make a Resource specifically needed for a Build within a specific City. The Same Resource is still also used in the Tradenet and in any case, the Required Resources are still part of the limited 32 Strategic/Luxury Resources..

Vuldacon, you are right. Here I remembered something wrongly. I delete that part in my last post to avoid further irritations.
 
Unfortunately it is more than a "switch". In C3C the former city view button in all mods and scenarios but the epic game, is used for showing strategic resources in a city, if a mod or scenario holds more strategic resources than the epic game.
Well, hopefully that's not the same button but another one that only looks the same.
 
This is the part where @Ozymandias busts through the wall like the Kool-Aid man

:yup: Part of my idea, for an AI "emergent behavior" mega-mod would:
  1. Introduce the old-fashioned, paper and cardboard game notion of "Stacking" - how many units can occupy one tile at the same time. This could either be pre-set for scenario or, e.g., changed dynamically, via Tech.
  2. Each Civ at every point would have an "ideal" Stack. For a dust-up with Napoleon, the "ideal" might be 3 line infantry, one cavalry unit, and one field artillery unit. And that, for game play, would be n "Army" for purposes of building Great Wonders and generating Great Leaders :rockon:.
 
@Flintlock:

Unfortunately, I have to report that my version of Civ3Conquests is also incompatible with your patch. It was bought from GamersGate, and installed on my current machine in early 2015, prior to the update which enabled multiplayer on Steam. So I had hoped that it was the same (non-Steam-requiring) .exe as the one now offered by GOG, but apparently not: your installer doesn't recognise it.
 
Back
Top Bottom