Resource icon

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

So I have to ask ... is this part of the base-game / respawn logic — or is this part of the houseboat-bug fix in C3X?
It's not related to the houseboat bug fix, which is a small thing that applies to the unit AI. Basically, the bug was that some logic in the naval transport unit AI was trying to determine what continent the player's capital was on. (What it uses that for, I don't know.) The logic never considered that the player may not have any capital, so it crashes when it tries to access the nonexistent city. The fix edits that piece of the logic to handle that possibility.

What you're seeing is actually base game behavior. AI players receive their set of free units from difficulty level whenever they found their "first" city, and the game defines "first" as "this player doesn't have any other cities". The way the code works is seriously just: after creating a city, if the owner is an AI and their city count now equals 1, spawn in the free units. So AIs get an extra set of free units from difficulty when they manage to found a city after all their previous cities were destroyed.
 
AI was trying to determine what continent the player's capital was on. (What it uses that for, I don't know.)
It is needed for the check if the eliminated civ can be restarted. For respawning that civ, one of the prerequisites for the respawn is, that the other conditions must be fullfilled on the same continent where that civ was destroyed - and that last city also is the city holding the capital, as the palace is "wandering" into that last city if it was not holding the palace before (the other prerequisites are: Only one respawn of each civ in a game, a tile without culture on that continent where a city can be founded and no unit or border of another civ in a radius of 5 tiles).
 
Last edited:
Kind of a random question, but is there any way to buff forts? I know back in the day, lots of people wanted to give them greater Zone of Control, or something similar, or (even better!) enable them to heal units faster/in enemy territory, or something like that. Are any of those possibilities? Or is it all just a pipe-dream, haha?
 
Last edited:
I know it has been mentioned before but is there any way we can look into air defense value having range beyond the tile the unit is on and cruise missile ability units self destructing after conducting precision strikes?
 
Kind of a random question, but is there any way to buff forts? I know back in the day, lots of people wanted to give them greater Zone of Control, or something similar, or (even better!) enable them to heal units faster/in enemy territory, or something like that. Are any of those possibilities? Or is it all just a pipe-dream, haha?
I don't know about zone of control but enhancing healing rate on forts should be easy. As I recall the game has one function that determines the healing rate of any given unit, so it should be easy to modify that to add a bit of logic that gives +1 HP if the unit is on a fort.

I know it has been mentioned before but is there any way we can look into air defense value having range beyond the tile the unit is on and cruise missile ability units self destructing after conducting precision strikes?
I expect it would be possible to enable air defense units to defend neighboring tiles but that wouldn't be a small change, it would require some work. About cruise missiles, not only is that possible, I've actually already done it! Just haven't posted it yet. I really ought to get around to posting version 20 since it's been long enough since the preview version. Since the preview I've fixed up cruise missiles so they despawn after doing precision strikes, play the proper animations when doing prec strikes, and can do stealth bombard, and also I've added an option to pack the strategic resources in tighter on the city screen.
 
I don't know about zone of control but enhancing healing rate on forts should be easy. As I recall the game has one function that determines the healing rate of any given unit, so it should be easy to modify that to add a bit of logic that gives +1 HP if the unit is on a fort.
Oh, that would be amazing! Could it be set to work inside enemy territory, too? Either way, boosting the "oomph" of the fortress mechanic could actually make them very useful.
 
If I remember correctly, a maximum of 32 players is an insurmountable limit, but I think there was some discussion that the number of civilizations from which those 32 players would be selected could possibly be greater than 32. With the current milestone of breaking the improvement limit, what are the prospects for breaking the maximum number of civilizations?

That should be feasible, with enough effort anyway. Completely removing the era limit is not really practical, so instead I'd do things like that, emulating more eras in the ways people care about.
As for the previous mention of emulating more scientific eras, I hope I'm not the only one who would find such a feature useful. I very much enjoy mods with a lot of technology (RARR, for example), whose authors would also, in my opinion, greatly welcome such a feature to give them some much-needed fresh space to flesh out their technology trees.

Lastly, I'd like to ask about the formula by which AI decides which government type to select and possible implementation of a similar perfume system (maybe a bit more complex based on civilization) as for units or improvements?
 
Oh, that would be amazing! Could it be set to work inside enemy territory, too? Either way, boosting the "oomph" of the fortress mechanic could actually make them very useful.
Sure, there's no reason why it couldn't work in enemy territory.

If I remember correctly, a maximum of 32 players is an insurmountable limit, but I think there was some discussion that the number of civilizations from which those 32 players would be selected could possibly be greater than 32. With the current milestone of breaking the improvement limit, what are the prospects for breaking the maximum number of civilizations?
It should be possible to allow for more than 32 civ choices but making that happen would require a lot of work. The biggest problem is that the BIQ format itself only supports up to 32 civs, so you'd have to work around that issue somehow. I think the best way would be to combine multiple BIQ files, so you'd have one main scenario file then a secondary one with duplicated rules except with a different set of civs. Then the modded game could make all the civs available at game creation time, but after a game is created, it would assemble scenario data with only the civs that were selected for that game. That data then is what would get included in the save game. It's complex but it should be doable. Another challenge is that you'd want an editor that's aware of the whole arrangement since maintaining the two BIQ files manually would be very tedious and error prone.

Lastly, I'd like to ask about the formula by which AI decides which government type to select and possible implementation of a similar perfume system (maybe a bit more complex based on civilization) as for units or improvements?
Perfume values for governments would be doable and actually easier than perfume for buildings & units since there's a separate function that calculates a point value for any given gov't for the AI. (For perfuming the other things, there's not a separate function. I had to awkwardly edit two places in the middle of the AI's city production chooser function to add the perfume.) The gov't evaluator function is relatively simple too so I'll try to translate it into a formula soon-ish.
 
Is there a way to look into the defense bonus that coastal fortresses give? Stock game has them at 50% in the editor. But test so far have not shown what it does. Also, code wise, do is there a way to check that all amphibious attacks receive a 25% bonus?
 
Is there a way to look into the defense bonus that coastal fortresses give? Stock game has them at 50% in the editor. But test so far have not shown what it does. Also, code wise, do is there a way to check that all amphibious attacks receive a 25% bonus?
How about a way to improve coastal fortresses so that they are useful? Outside of having them auto produce battery cannons, they are pitiful.
 
How about a way to improve coastal fortresses so that they are useful? Outside of having them auto produce battery cannons, they are pitiful.
Maybe if Flintlock can extend the range of their ZOC. Right now it's very easy to avoid. And if you have PTW targeting on the coastal fortress doesn't even shield your improvements. That's why I created multiple coastal fortification improvements. The more cheap coastal fortifications improvements with high naval bombard defense value you have, the less likely PTW targeting will hit your other improvements.
 
While I love the building pre-req option, as I mentioned a while back, I do not like how it can cause units that should be obsolete to still be in the build queue. Combined with the ability to have addition maintenance cost based on shield value, I wanted modern man made military units (tanks, ships, etc.) to require infrastructure (factories) to build. However, this causes obsoleted units to still be in the queue. For example, if I set Cavalry to be obsoleted by Early Tanks (and Early Tanks require a Factory), then Cavalry will be in the queue in all cities that don't have a Factory even though you reach the tech (Combustion) that allows Early Tanks. Initially I had the idea of having the Stables produce a resource called "Horsemanship" which is required for all mounted units besides the chariot (to symbolize improvements in horse breeding) and set the stables to obsolete at Combustion. That fixed the problem with Cavalry, but then Chariots were still in the queue because they upgrade to Horse Archers. After Stables are obsoleted, and Horse Archers are no longer buildable, it breaks the upgrade chain and Chariots show back up in the build queue in the Industrial Era. Doh!

Long story short, would it be possible to obsolete a unit by tech instead of by unit? For example, Cavalry would be obsoleted by Combustion instead of Early Tanks.
 
The biggest problem is that the BIQ format itself only supports up to 32 civs, so you'd have to work around that issue somehow. I think the best way would be to combine multiple BIQ files, so you'd have one main scenario file then a secondary one with duplicated rules except with a different set of civs. Then the modded game could make all the civs available at game creation time, but after a game is created, it would assemble scenario data with only the civs that were selected for that game. That data then is what would get included in the save game.
My immediate thought when uncapping civs was first proposed is how this would mesh with diplomacy text: Civ-specific replies map in the order the civs are defined in the rules, with an option to offset their index position from the default. If civ definitions will have to be split between separate .biqs, and the final player roster is stitched together to fit the base 32, there will need to be a function that adjusts the civs' diploindex to avoid mismatched text.
 
Is there a way to look into the defense bonus that coastal fortresses give? Stock game has them at 50% in the editor. But test so far have not shown what it does. Also, code wise, do is there a way to check that all amphibious attacks receive a 25% bonus?
Sure, I could look into specifically what coastal fortress do. I don't know when I'll get around to it but I'll note it down for now. Amphibious attacks definitely do get a 25% bonus. I remember seeing that in the code a while back when I was looking into how the combat odds get calculated.

Long story short, would it be possible to obsolete a unit by tech instead of by unit? For example, Cavalry would be obsoleted by Combustion instead of Early Tanks.
That would be possible. As you could probably guess, it would work similarly to the building prereqs, only instead of a bit of logic disallowing production unless all buildings from a list are present, it would disallow production unless any of a list of techs have been researched. It's a bit harder since the rule ought to apply to the entire upgrade chain before the obsoleted unit, but that could be handled by automatically copying the rule for each unit in the chain.

My immediate thought when uncapping civs was first proposed is how this would mesh with diplomacy text: Civ-specific replies map in the order the civs are defined in the rules, with an option to offset their index position from the default. If civ definitions will have to be split between separate .biqs, and the final player roster is stitched together to fit the base 32, there will need to be a function that adjusts the civs' diploindex to avoid mismatched text.
That's a good point, I hadn't thought about the text files at all. I wonder if it would work to have a diplo text index greater than 31. Probably not based on what I've seen elsewhere in the code, the original devs really didn't ever plan for more than 32 civs.
 
That would be possible. As you could probably guess, it would work similarly to the building prereqs, only instead of a bit of logic disallowing production unless all buildings from a list are present, it would disallow production unless any of a list of techs have been researched. It's a bit harder since the rule ought to apply to the entire upgrade chain before the obsoleted unit, but that could be handled by automatically copying the rule for each unit in the chain.
That would be most excellent. It was one of the major hiccups I am having at the moment. I am trying to jury rig resources and improvements that obsolete to make it work at the moment. The only downside is that if a civ doesn't have the resources to build tanks, yet Cavalry becomes obsolete by a tech, they are SOL for a mobile unit. But that is a better "problem" then having obsolete units still in the build queue long after they should be gone.
 
Thank you for looking into the code. Also, does the code also show how much value having a buildable unit have to a tech to the AI? I tend to add lots of different units whose purpose doing the same thing as a main unit line but being weaker and cheaper and occupying different shield costs so that I can avoid wasting shields without having to micro too much. But I have the feeling this badly inflates the cost of techs and strategic resources. Speaking of techs, could there be a way to perfume up or down?
 
This should be an easy request since it is already possible with Hospitals. How about making to so certain improvements can only be made by cities of a certain size? For example, a Barracks can only be built in size 2 city or a Factory only in a size 3 city.
 
Maybe if Flintlock can extend the range of their ZOC. Right now it's very easy to avoid. And if you have PTW targeting on the coastal fortress doesn't even shield your improvements. That's why I created multiple coastal fortification improvements. The more cheap coastal fortifications improvements with high naval bombard defense value you have, the less likely PTW targeting will hit your other improvements.
Extended ZoC could be useful. I just thought of something I might try. Have the Coastal Fortress auto-produce coastal batteries, but make them invisible with their own ZoC. I'd remove the ability from the CF itself so maybe the AI ships won'y avoid like they do now and can be hit by the batteries?
 
How about making to so certain improvements can only be made by cities of a certain size? For example, a Barracks can only be built in size 2 city or a Factory only in a size 3 city.
Size2 being a prereq for e.g. Markets and Collosseums, and Size3 for expensive Tier-3 buildings like StockExes or ResLabs, would certainly be useful, and would likely also help the AI.

But there is already a very simple way to limit buildings to be buildable only in Size3 metros, which is to set the Hospital (i.e. the "Allows settlement Size3" flagged building) as a prereq (or a prereq to the prereq!). I already did that for the MassTransit improvement, to remove it from build-lists in towns where it will never be needed.
 
Top Bottom