Resource icon

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

I don't know if anybody already mentioned it, but it would be cool to investigate how the AI chooses to build units and if there is a chance to put some kind of ratio to it. For example, if I had 3 WW2 bombers on the same tech, the AI would usually only build the unit with the greatest range - which is pretty lame. It would be interesting if there was some kind of RNG to it, for example if there are multiple unit choices on one tech, the AI could build its preferred unit to - let's say - 75 %, but otherwise would pick one of the other choices. This would enable more diverse armies, as they have been in RL.

In SOE (fixed map) this is achieved by microzones and autoproduction and in mods with random maps by normal production and autoproduction.
 
In SOE (fixed map) this is achieved by microzones and autoproduction and in mods with random maps by normal production and autoproduction.

I know, and it's great for WW2 mods. But I would be running out of buildings in my Epic mod ;)

Of course, I plan to make the mod as configurable as possible.

I'll look into this at some point.

Thank you!
 
... running out of buildings...

Here is a list of limitations in C3C that modders would like to be overcome, if this is possible:

1. Only 256 allowed buildings in C3C

2. Only 8192 allowed units on the map (MUA) in C3C: This was overcome in the "No unit limits components" done by knuckles and Tsubasanut.

3. Only 512 cities on the map: This was tried by knuckles and Tsubasanut, but run into severe memory problems and was not used by the AI. I for my part don´t need more than 512 cities on the map, as the micromanagement for even up to 512 cities can become cruel in my eyes.

You can only build a maximum of 556 cities (compared to 512 cities in standard C3C) with the current NCL patches, but starting with city 543, some menues in the game are not working any longer and cities 513 - 556 can only be founded by the human player.

https://forums.civfanatics.com/threads/ccm2-epic-mod.625812/page-15#post-15441099
https://forums.civfanatics.com/threads/ccm2-epic-mod.625812/page-15#post-15444062
https://forums.civfanatics.com/threads/city-limits.327919/page-10#post-14700334
https://forums.civfanatics.com/threads/city-limits.327919/page-10#post-15735119

4. Only 256 allowed types of resources (lux./strat./bonus in total). I run into this limitation while creating a worldmap for my CCM mod with preplaced locations for the 512 cities and the correct names for these cities in nearby located resources.

5. Only 5 culture groups and possible sets of different city graphics.

6. Limitations with barbarians:

a) Only 2 kind of land Barbarian units and only 1 kind of Barbarian ships (allowed in the general settings of the C3C biqs)

b) AI Barbarians can not build settlers and found cities. Human players playing the Barbarians (possible with the multiplayer tool) can found cities, but nothing can be produced in these cities by Barbarians: https://forums.civfanatics.com/threads/barbarian-cities-in-civ-3.646253/

c) Barbarians cannot enslave

7. No working 'land carriers'.

a) Landunits cannot carry aircraft when moving (especially useful in space mods based only on land terrain) and
b) AI landunits cannot carry other landunits with them (exception armies, but here a working 'unload' option is missing and a workaround in upgrading armies to normal landunits, "spitting out" the carried other landunits is no relevant substitution in the game.

8. Messed up artificial routine for landartillery (for many modders this is problem number one of C3C to be fixed). The AI is retreating landartillery mostly into cities and is using them nearly never for offensive duties. As the Civ 2 flag for units to ignore the bonus of city walls was not used in Civ 3 due to the landartillery, this special AI problem became a big exploit for the human player, especially in combination with unlimited railroad movement.

Astonishing, that the offensive bombardment routine for naval units is handled well by the AI.

I think to overcome the problem with the messed up artificial routine for landartillery could be very difficult. I created a kind of a workaround for landartillery in my CCM mods and the SOE scenario with a combination of stealth attack settings, big attack values, a retreat option when attacking MV 1 units and handicapping the 2 MV of landartillery for the retreat option to 1 tile by not giving landartillery a movement bonus in any landterrain and enlarging the movement costs for any landterrain, so CCM landartillery in every terrain is "moving up a mountain".

Here an additional flag to ignore city walls, as it was in Civ 2, would be very useful.

Some modders reported, that the AI is using captured landartillery from other civs or barbarians in the offensive, as it should be in Civ 3. May be a clue for using the problem with the messed up artificial routine for landartillery could be a setting, that landartillery units can be produced with a different nationality, considering these reports (but this is only my speculation). The captured worker units in C3C show, that each unit can carry a nationality different from the civ it is belonging to.

9. A helicopter setting, as it was in Civ 2, is missing. So planes in Civ 3 could be set to be mobile, they are always killed, when a landunit is attacking a mobile airunit. The additional small damage for helicopters in each turn that this unit is not based in a city or a carrier (and is healed when based there) in Civ 2 was nice, too.

10. An event system as it was in Civ 2 and was improved in a much better form by TNO in Civ2TOTPP with lua scripting. I think this could be very, very difficult. In Civ 2 and Civ 2 TOT an event system was still existing in the game. Where should such a system be "docked" at in C3C ?
 
Last edited:
A fix for the Ghost/Phantom Resource Bug is much-needed, as well.

I remember reading fairly recently that it's caused by cities not connected to the main trade network (i.e. the capital) using only a 32-bit sequence to determine which resources that city has access to, though I can't find the posts in question right now.
 
Also, I don't want to inundate you with requests, but how feasible would it be to change the following Improvement/Wonder requirements:

1) Change single-choice requirements (e.g. required government, required improvement in the city) to a multiple-choice EITHER/OR requirement?

2) Change the "Requires Goods Must Be Within City Radius" flag to operate on a per-resource basis, e.g. a to build a Cannon Works wonder a city may require a source of Iron within the city radius but it can ship in Saltpeter from elsewhere.

3) Allow units to have build requirements which are currently restricted to Improvements/Wonders. Especially: Resources in Radius, Improvements/Wonders in the city, Governments.


All three of these together would expand diversification and specialisation in build choices while not requiring a fixed map and enabling more flexibility with the amount of improvements/wonders a mod needs.
 
Flintlock... I am wondering if setting Bonus Resources where they can be used to build Units and Improvements would be possible... that would seriously help the limit of 32 Strategic and Luxury Resources used to build with. Perhaps this could offer another 32 ?

... I will say that with all of the posted requests that will certainly continue, You absolutely have "Job Security" :lol:

... but seriously, don't become overwhelmed. After the many years of needing and wanting so many abilities to allow what is needed for New and more realistic Game Play factors, what you have already been able to do has excited Members because what they need and want may be possible.
 
I really like unlimited rail movement. It is the key for humans to wrap up the late game.

If you are going to play around with limited rail movement, it MUST scale with map. 12 tiles on a small map if a much bigger % of the map, then 12 tiles on a huge map.
 
Spoken as someone who just found this thread and has done nothing with it, I have two questions.

How does the limiting of rail movement work when combined with non-rail movement? Often, I have a situation where I am moving new units up to the end of the railway and then moving from there, usually to attack. Defining how much movement the unit has left after leaving the rail, or how much movement it has when joining the rail after moving some.

Secondly, sadly, I am limited to steam, will this work with steam or is it a lost cause?
 
2. Only 8192 allowed units on the map (MUA) in C3C: This was overcome in the "No unit limits components" done by knuckles and Tsubasanut.
And soon by Flintlock too.
Some modders reported, that the AI is using captured landartillery from other civs or barbarians in the offensive, as it should be in Civ 3.
The fact that the AI already knows how to use captured artillery makes me think it won't be too difficult to make it use arty properly. I imagine I just need to find out where the AI decides how to use its arty, specifically where it considers the unit's captured status, then make it so it treats all of its arty as if they've been captured. And even if that doesn't work there are other tricks I could do like any time an AI builds an arty, flag it as captured from the barbs. I already know how the game spawns units and I think I know how it stores captured status.
10. An event system as it was in Civ 2 and was improved in a much better form by TNO in Civ2TOTPP with lua scripting. I think this could be very, very difficult. In Civ 2 and Civ 2 TOT an event system was still existing in the game. Where should such a system be "docked" at in C3C ?
I've been keeping Lua in mind. The mod is written in C and Lua works well with C so in theory it shouldn't be too hard to get Lua running inside the EXE through the injected code. The hard part would be getting Lua to interoperate properly with the existing functions and types in the EXE. I haven't tried anything like this yet because it's another layer of complication that I wanted to put off until all the basic mod infrastructure was in place. And yeah, any event triggers would have to be inserted manually because there is no existing event system.
I remember reading fairly recently that it's caused by cities not connected to the main trade network (i.e. the capital) using only a 32-bit sequence to determine which resources that city has access to
This is true. I've already found the function that says whether a city has access to a particular resource. How difficult fixing the bug is depends on how that 32-bit field is set, and I haven't found the code for that yet (it would be easy to find using a debugger I just haven't done it).
Also, I don't want to inundate you with requests, but how feasible would it be to change the following Improvement/Wonder requirements:
Just now I went digging through the code and found a function that determines whether a city can produce a type of unit or not. I guessing there's another function for buildings so this sort of thing shouldn't be too difficult, I could just replace those functions. In general it's easier to add restrictions than remove them.
Flintlock... I am wondering if setting Bonus Resources where they can be used to build Units and Improvements would be possible... that would seriously help the limit of 32 Strategic and Luxury Resources used to build with. Perhaps this could offer another 32 ?
That's doable but the catch is that bonus resources are also subject to the phantom resource bug, you just don't notice since they don't appear in the interface.
... I will say that with all of the posted requests that will certainly continue, You absolutely have "Job Security" :lol:
Changing railroad movement seems to have opened the flood gates. I started this mod as a bug fix & convenience mod for the vanilla game and now it's becoming an overhaul for modders. I don't mind the feature creep, I'm going to keeping working on the mod as long as I find it entertaining.
If you are going to play around with limited rail movement, it MUST scale with map. 12 tiles on a small map if a much bigger % of the map, then 12 tiles on a huge map.
Movement in the base game doesn't scale with map size but if it's something people want I can do that. Until then the changes are configurable so you'll be able to adjust railroad movement to whatever map size you're playing on or just set it back to infinite.
How does the limiting of rail movement work when combined with non-rail movement?
Railroads act like fast roads except that the cost of moving along them scales with a unit's total moves. So for example if you have railroad movement set to 15 tiles and road movement set to 3, moving 5 tiles along a railroad is like moving 1 tile along a road for a unit with 1 movement point, but for a unit with 3 MP, moving 5 tiles on a RR is like moving 3 tiles along a road.
Secondly, sadly, I am limited to steam, will this work with steam or is it a lost cause?
Yes... err... no it's not a lost cause, the mod officially supports the Steam and GOG versions of Civ 3 Complete.
 
Flintlock, your popup message - as anounced - saved me a round of anarchy in my capital during a testgame with your mod while busy triggering the button for the next turn.

Very nice ! :)

Neue Warnung.jpg
 
I'll add a couple more points.

5. Only 5 culture groups and possible sets of different city graphics.

It would also be good to overcome the four-epoch limit. For epic mods, the "Future" era would be good.

6. Limitations with barbarians:
a) Only 2 kind of land Barbarian units and only 1 kind of Barbarian ships (allowed in the general settings of the C3C biqs)

I would like to change the barbarian units to stronger ones, depending on the number of past turns or focusing on the era of the human player (or the nearest civilization). In the XX century, men with swords and spears, and not rebels and partisans, look somewhat strange.
 
Speaking of barbarians, is the diagonal attack preference bug is still a thing?
 
Speaking of barbarians, is the diagonal attack preference bug is still a thing?
Yes. Getting that bug (located and) fixed would be great as well.

@Flintlock:

If you're not familiar with this one, this thread has a lot of discussion, and a conjecture about a solution (which may or may not be helpful/correct!):

https://forums.civfanatics.com/threads/fix-for-the-barbarians-sort-of.100704/

TLDR:

in Vanilla (and PtW?), Barb land-units would "scan" for 'civilised' units in all directions (within a fixed radius: 12-14 tiles?), and relentlessly chase down any stray units in their vicinity. But in Conquests, the barb-units acquired tunnel-vision: they now only appear to scan for halted prey along their NW–SE axis — and if nothing's visible, they'll just fortify in place. Even after the line "NoAIPatrol=0" has been inserted in the conquests.ini file (which should make all AI-controlled units move around a bit more), Barbs are still a lot less dangerous than they used to be.

(@Lanzelot once suggested that the code-base used for the C3C executable was likely forked off an earlier, still-bugged PtW-version, instead of the final patch — which would explain why a lot of fixed PtW-bugs got resurrected in C3C; but might also provide an avenue for exploring where/what causes those bugs)
 
Here is a screenshot about the stack bombardment button in the game:

Stack Bombardment.jpg
 
It would also be good to overcome the four-epoch limit. For epic mods, the "Future" era would be good.
I'll look into the era limit at some point. Based on that I've seen so far, the limit is not baked into the EXE at all, the array of era objects can be made to be any arbitrary size. I wonder if the limitation is just part of the BIQ format.
Yes. Getting that bug (located and) fixed would be great as well.
...
(@Lanzelot once suggested that the code-base used for the C3C executable was likely forked off an earlier, still-bugged PtW-version, instead of the final patch — which would explain why a lot of fixed PtW-bugs got resurrected in C3C; but might also provide an avenue for exploring where/what causes those bugs)
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.



Progress report: I found where the unit limit is enforced and patched it out, though I haven't tested the patch. Also I found the function that determines what the AI chooses to build in a city (it's at 0x42C8A0 in the GOG EXE). The bad news is that it's pretty complex, it's the largest function I've seen so far at about 3000 lines decompiled. Rather than try to alter how it works, it would be much easier to intercept its return value and alter that. For example, I've seen complaints that the AI only builds the one type of unit that it thinks is best for each role so a simple work around for that would be to implement a rule like if the AI chooses to build unit X, there's a certain chance to change its decision to some unit Y.
 
Having a way to control AI's settler diarrhea early in the game (apart from autobuilding method) would be great!
Another annoying bug/thing from my experience with CCM was fighting with invisible land units, maybe there could be a way to make units engaged in combat always visible, regardless of their visibility status?
 
Having a way to control AI's settler diarrhea early in the game (apart from autobuilding method) would be great!
Another annoying bug/thing from my experience with CCM was fighting with invisible land units, maybe there could be a way to make units engaged in combat always visible, regardless of their visibility status?

Shmelkin, this is no bug in CCM but completely intended, as dealing with it, needs a much better tactical use of the surrounding terrain and the movement handicaps and bonuses of the different units. If this setting is too demanding for you, you can simply remove the invisible flag from these units in the editor.
 
Shmelkin, this is no bug in CCM but completely intended, as dealing with it, needs a much better tactical use of the surrounding terrain and the movement handicaps and bonuses of the different units. If this setting is too demanding for you, you can simply remove the invisible flag from these units in the editor.
I'm afraid there's some misunderstanding here. I wasn't complaining about existence of invisible units in the game but the fact that when you fight invisible unit you cannot see it which looks stupid.
I never said it was a bug in your mod but a bug/oversight from game developers.
 
Progress report: I found where the unit limit is enforced and patched it out, though I haven't tested the patch.

Hi if you wish I can run tests for the executable. I'm available.
 
Back
Top Bottom