Resource icon

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

Can you guys move this discussion elsewhere? It's really strayed far from the topic of this thread.
I prefer not to discuss it at all. But to have him claim it's a "mod" and complain about having features forced on him when that's not the case does irk me. But yeah, there's a readme. If he can't be bothered by now neither should I.
 
I always thought that the retreat roll didn't start until after at least one round of combat, which was why 1 hp units didn't retreat. Or is it that they only retreated if they suffered damage in the previous round, which would disqualify a 1 hp unit?

A unit can only retreat when being knocked down to its last hp, which is what disqualifies 1hp units from retreating.
 
I always thought that the retreat roll didn't start until after at least one round of combat, which was why 1 hp units didn't retreat. Or is it that they only retreated if they suffered damage in the previous round, which would disqualify a 1 hp unit?
It must be something like that, though I still can't find it in the code. I looked again for variables counting combat rounds or damage done but didn't see any. Oh well, it's not worth worrying about. I ran a little experiment to verify that 1 HP units really can't retreat, attacking 40 infantry with 40 1-HP horsemen. None of them retreated, 39 died, 1 won.
Or (maybe more likely) is a randomly generated number (seed) sufficient to pre-determine the outcome of all possible battles? Such a pity that the source code is unavailable...
The seed determines the stream of random numbers that you'll get. It's sufficient to determine the outcome of all battles, provided you fight all the same battles in the same order. You can cheese the preserve random seed option by reloading and doing something to pull some random numbers off the stream, then everything that happens after will get different random numbers from later in the stream. Example, you don't like a galley sinking in ocean, so you reload and bombard some of your own tiles with a catapult, then the galley will get a different random roll and potentially not sink.
 
Moderator Action: If you'd like to continue the "is it a mod or a patch?" or "what did Firaxis intend with the AI?" sub-threads, we can move them to a separate thread. One of the participants can report one of those posts if they'd like to have the relevant posts extracted. Let's try to keep this one focused on C3X and ideas for C3X.

More broadly, C3X is now in widespread enough use that it would seem appropriate to open threads for your own modpacks/scenarios that require/heavily encourage using C3X, so that discussion about the scenario-specific changes can take places in those threads.

-----

Unrelated question for Flintlock, do you want C3X to be added to the thread title? I see you mention the name right at the start of the first post, and in the Downloads Database entry. I can update the title to what is most appropriate nowadays if you'd prefer.
 
The seed determines the stream of random numbers that you'll get. It's sufficient to determine the outcome of all battles, provided you fight all the same battles in the same order. You can cheese the preserve random seed option by reloading and doing something to pull some random numbers off the stream, then everything that happens after will get different random numbers from later in the stream. Example, you don't like a galley sinking in ocean, so you reload and bombard some of your own tiles with a catapult, then the galley will get a different random roll and potentially not sink.
This makes sense. Impressive de-compiling skills!:worship:
Regarding the retreat-function: I would prefer that a 1HP unit still is unable to retreat.
Again: Thanks a lot for brilliant work on investigating and improving the code!:thumbsup::hatsoff:
 
Unrelated question for Flintlock, do you want C3X to be added to the thread title? I see you mention the name right at the start of the first post, and in the Downloads Database entry. I can update the title to what is most appropriate nowadays if you'd prefer.
That's a good idea. I'd like the thread title to be updated to "C3X: EXE Mod including Bug Fixes, Stack Bombard, and Much More". Thanks!
 
A unit can only retreat when being knocked down to its last hp, which is what disqualifies 1hp units from retreating.
I can confirm this :)
Units retreat upon reaching 1HP, which can't happen anymore if they start at that.

This makes sense. Impressive de-compiling skills!:worship:
Regarding the retreat-function: I would prefer that a 1HP unit still is unable to retreat.
Again: Thanks a lot for brilliant work on investigating and improving the code!:thumbsup::hatsoff:
While don't have a need for it myself, I think that if he works on it anyway, it could be nice to make that a configrable option.
 
More broadly, C3X is now in widespread enough use that it would seem appropriate to open threads for your own modpacks/scenarios that require/heavily encourage using C3X, so that discussion about the scenario-specific changes can take places in those threads.
Not that I have the time, but I've just about decided to resume my own mod, Legacy, redesigned (again) for C3X.
 
I have a fix request: When using a government with a sciene % cap (only in mods, not vanilla civ3), if you set your science slider to <30%, it will pop back to 30% again every turn. Makes things like zero-research periods quite annoying. If you could take a look at this, that would be amazing. :D
 
A few more suggestions, as I'm hashing out ideas:

Adjust the "defense" (odds of being destroyed in bombardment/collateral damage) of tile improvements, buildings, citizens? Are those all the same value?

A flat "administrative" (maintenance) cost of a city (per goverment type)? In other words could there be a base maintenance cost without buildings? This would be a way to counter ICS and slow early growth. Alternatively, is there (already) a way to provide a free building in all cities that can't sold or destroyed? Maybe an effect of the palace somehow using a third party editor?

Disable exhausted resources from respawning? I imagine this would be pretty simple, but you'd probably want to configure it per resource.

Is it true that the AI assumes it can build settlers at size 3, and if so can that be fixed?
 
I have a fix request: When using a government with a sciene % cap (only in mods, not vanilla civ3), if you set your science slider to <30%, it will pop back to 30% again every turn. Makes things like zero-research periods quite annoying. If you could take a look at this, that would be amazing. :D
I think the explanation for this was: The rate cap affects both science and tax. If you set it at 50%, none of them (science or tax) can be higher than 50%. You will be able to draw the slider below 50% science, but not above. However, if you draw it down to - for instance 30% science, it will force the tax rate to 70%. The game then automatically resets the slider to 50% at the start of a new turn (but after science and tax income are processed). I read a thread about this many years ago, but I'm afraid I cannot remember where...

A fix would mean to either ignore the rate cap for the tax rate setting, or add a new slider - so there would be one for science and one for tax. The latter option is probably difficult and complex to implement. Maybe an idea for the team working on C7?
 
Alternatively, is there (already) a way to provide a free building in all cities that can't sold or destroyed? Maybe an effect of the palace somehow using a third party editor?
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.
Disable exhausted resources from respawning? I imagine this would be pretty simple, but you'd probably want to configure it per resource.
I think you can already do that in the editor by only having a disappearance chance but no ratio per player.
I think the explanation for this was: The rate cap affects both science and tax. If you set it at 50%, none of them (science or tax) can be higher than 50%. You will be able to draw the slider below 50% science, but not above. However, if you draw it down to - for instance 30% science, it will force the tax rate to 70%. The game then automatically resets the slider to 50% at the start of a new turn (but after science and tax income are processed). I read a thread about this many years ago, but I'm afraid I cannot remember where...

A fix would mean to either ignore the rate cap for the tax rate setting, or add a new slider - so there would be one for science and one for tax. The latter option is probably difficult and complex to implement. Maybe an idea for the team working on C7?
That's interesting! Then the editor info is a little bit misleading on this. :D
 
Having played a bit more using the arty function, I am on the side that says it hurts the AI more than helps. Though it is more interesting. The new function means the AI is just giving bombardment units to the human. At least the old way the attackers had to risk some loses attacking towns that had bombardment units to help defend.

It is true that you could get hit in the open and a small stack of your units could get killed, where they otherwise would not even be attacked. Not sure how to weight that, but you can just
not have small stacks near towns and not have that problem. In the open the AI will not be able to surprise you with cat/cannons etc.
 
I think the submarine bug still exists on land. Had an AI declare war on my by moving a unit on the same tile as an invisible land unit of mine. I reloaded the autosave, moved that unit away, and no war-dec happened.
But what really confirmed it for me was that the AI later repeated the same thing, declaring war on me by moving a worker on an invisible unit (suiciding it in the process).
Both times it happened out of the blue mid-AI-turn, without them being called into the war or having any sort of stack near my border. Good relations, too.


And finally, yet another feature idea: For stealth attacks, would it be possible to display the unit HP behind the name? Like "Transport (1/4)", "Transport (4/4)", "Destroyer (4/4)", "Cruiser (3/5)". Otherwise it is really hard to figure out which unit to stealth attack in a stack of multiple units of the same type.
 
Flintlock, unfortunately I have problems with integrating the feature of buildings as prerequisites for units into my mods.

All my tries were done with Debug versions of the C3C main-biq.

1. When using the original english C3C main-biq in a Debug version, all the examples in your default.C3x_config file are working as they should.
2. When using the english expanded CCM 2.50 main-biq, I receive an error message when starting the game and the units still can been built without the buildings.
3. When using a Debug version of the German main biq, I also receive that error message and the building prerequisite is still ignored in the game.

Here is a screenshot of the German setting of the config file:

Configfile.jpg

Fabrik = factory, Kaserne = barracks, Flughafen = airport, Panzer = tank, Mechanisierte Infanterie = Mech Infantry, Schwertkämpfer = swordsman, Kavallerie = Cavalry, Bomber = bomber ; all terms are the original terms used by Firaxis for the German version of C3C.

When reading the error message at the start of the game the question arises, what name is needed for the key and what name is needed for the value in this feature of your mod?

If the key here should be the name of the building, does your mod need the English name instead of the German name and is it the name of the building in the editor or the name in the BLDG_entry in the editor ? Both frequently are very different in CCM 2.50 and in the German biq the English BLDG_ and PRTO_entries are used for the buildings and units with German names. The same is true for the value, if the value here is the name of the unit, that needs that building as prerequisite. Is it the name of that unit in the editor or the PRTO_entry for that unit in the editor ?

Warning German unit names.jpg
 
Last edited:
A few more suggestions, as I'm hashing out ideas:
  • 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.
  • 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.
  • 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.
I think the submarine bug still exists on land.
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.
And finally, yet another feature idea: For stealth attacks, would it be possible to display the unit HP behind the name?
Sure. I had a quick look at the code that assembles the stealth attack popup, and that would be an easy change to insert.
Flintlock, unfortunately I have problems with integrating the feature of buildings as prerequisites for units into my mods.
That error you're seeing that mentions "warn_about_unrecognized_perfume_target" must be because you're using a config INI from an older mod version. The config INIs are not always compatible across mod versions, for example in this case I renamed that option to "warn_about_unrecognized_names" for R11 so it's complaining that it doesn't recognize the old name for that key. When that error message refers to "keys" and "values" it's referring to the config options themselves, which I consider to be "key = value" pairs. I see how calling them that is confusing so I'll reword that error message. The names of buildings, units, etc. in the config INI must match the regular names in the editor that appear on the interface in-game, not the civilopedia keys.

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.
 
That error you're seeing that mentions "warn_about_unrecognized_perfume_target" must be because you're using a config INI from an older mod version. The config INIs are not always compatible across mod versions, for example in this case I renamed that option to "warn_about_unrecognized_names" for R11 so it's complaining that it doesn't recognize the old name for that key. When that error message refers to "keys" and "values" it's referring to the config options themselves, which I consider to be "key = value" pairs. I see how calling them that is confusing so I'll reword that error message. The names of buildings, units, etc. in the config INI must match the regular names in the editor that appear on the interface in-game, not the civilopedia keys.

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.
Flintlock, thank you very much for your quick reply. :)

About the "ä" in Schwertkämpfer I had the same thought and made tests without that unit in the config.ini, but for the lasting units it didn´t work either.

I used the config.ini of R11 and the strange thing is that it worked for the english original biq, where only one change was done (the setting in Debug mode), but the same R11 config.ini didn´t work for the (english) CCM 2.50 biq. I had a look into the virtual store of my pc, but there was no old file of a pre-R11 config.ini file in it, that could have overwritten the R11 file.

I will now delete the older versions of your mod (up to R10B) and see if then something is changing and have another look on the text of the error message, or if this message now is dissapearing.
 
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)
 
Top Bottom