Resource icon

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

Yes, they have base 1 and get +1 for hills and +2 for mountains. :D I just wanted to point out that they do not have a base of 2 as your post sounded.
But of course and as always, more flexibility would be nice. 🤷‍♂️
 
I wonder how easy it would be to implement attack bonuses/maluses between different units. Something like listing a "unit type" in the config for particular a unit and maybe specifying a multiplier for combat between unit types.
The hardest part would be reading that stuff in from the config file. Applying a combat bonus based on unit type would be easy. I've found the function that determines combat odds per round of battle and modifying it to layer on a combat bonus would be straight forward.
Can it be possible to modify a land unit that can transport other land units that the AI can use? And maybe it uses naval transport AI as a template....
I would have to write a new unit AI for this, which is quite a bit of work due to all the various situations it would need to recognize and handle. I'm not even sure what a land transport is supposed to do exactly, just carry units to a city to attack? For reference the base game's naval transport AI decompiles to 1054 lines, so it's pretty complicated. Using it as a reference would help, but it would still need to be rewritten to work with land units.
Is it possible for you to edit the visibility range?
Also is it possible artillery units gain +1 range bombardment when located on hills and +2 when on mountain?
I don't know about editing visibility range, I've never looked at that part of the code. But if visibility range already varies in the base game, it should be possible to change how it varies. Expanding an artillery unit's range depending on its location would be very awkward and probably not practical. The problem there is that artillery range is a property of the unit type not the individual units. The code doesn't give me an opportunity to modify range for units because it looks up range only by type. I'd have to patch in some means of knowing which unit it was looking up range for. That sort of thing is practical as a one-off modification but this would need to be done in multiple locations.
It appears that war weariness is bugged. In single player a war between two AIs means that the AI later in the turn gets all the ww points that either of the 2 civs should get. In PBEM the same bug seems to apply to wars between 2 human players.
I've looked into this bug before, it's a tricky one. The problem is I'm not sure exactly when/where the bug appears or what the correct behavior is supposed to be. Based on how it's described, it sounds like two player objects, attacker and defender, are reversed somewhere in the code but I can't find where that would be. There are several places war weariness could be generated, for example from city captures and unit combat. Also there are two types of WW that the game tracks, recent and long term. I've looked over the code for these things but nothing stood out to be as being obviously bugged. I even created a scenario and inspected WW values as they were generated, but again nothing stood out to me. It would help if someone could give me a scenario where this bug clearly appears.
I am wondering the same! Since AIs sadly don't value prod +% at all it seems, a lot of perfume is necessary. It would be amazing if we could get some conditional scripting logic for unit/building choice values, such as [...] But that would of course be some immense work, probably unfeasible. :D
Probably unfeasible, but not necessarily so. I've been thinking about this sort of thing. The way to do it would be to call out to a Lua script that was created by the mod author or player. It's possible to embed a Lua interpreter in the executable, in fact I've already done it as a proof of concept about a year and a half ago. The hard part would be generating bindings between the Lua scripts and Civ 3's data & methods. Though that could probably be automated. Embedding Lua could change my job from implementing requested gameplay changes to implementing hooks so modders can make their own changes. Hopefully they actually would, one of the reasons I haven't gone down this path is I read that someone did something similar for Civ 2 but the Lua system was never used by anyone. Anyway it's fun to think about doing this. I could use Lua myself after all, it might be worth it just for config files.
Would it be possible to make ground AA use "operational range" to be able to cover more than its own square?
Can you add an option to stop agricultural from being exempt to the despotism penalty if the city has fresh water?
Not sure about AA operational range, that doesn't sound like it would be difficult but again it's not a part of the code I've looked at before so I can't say much. About the agricultural exemption from the despotism penalty, is that only on the city square or on all tiles in city radius? I've never heard of anything like that before. It shouldn't be hard to change, I'll add it to the list and hopefully get around to it soon.
Also was wondering if you had a progress with more than 4 culture groups?
Unfortunately I haven't gotten around to this. I'm not sure if removing these limits (culture groups and eras) will be feasible since I believe their data is stored in statically allocated areas. I'd have to investigate it before I could say anything for sure but I'm not optimistic.
 
@Flintlock
First of all, a very big compliment for your Patch/Mod/Game-Expansion! :thumbsup:
It really pushes Civ3 on a higher level of gameplay. I've been waiting for such like this for decades... :eek:

I have a (hopefully) small request (for now :lol:).
Is it possible to create a "switch" where we can turn the diplomatic penalty on or off, you get when using nukes, that causes all ai-players to declare war on you after using 2 or 3 nukes?
In vanilla game it's ok so far, but in a ww3 scenario for example it's really annoying.
Maybe it is also possible to implement this as a factor between 0 an 1 to just weaken the mechanism without deactivate it completly?
 
About the agricultural exemption from the despotism penalty, is that only on the city square or on all tiles in city radius? I've never heard of anything like that before. It shouldn't be hard to change, I'll add it to the list and hopefully get around to it soon.
Under all the non-penalised governments, Agri-Civs get 3 FPT from every town-tile.

Under the Despotism-penalty, Agri-Civs only get that third FPT in town-tiles directly adjacent to freshwater (river or lake); dry town-tiles get the standard 2 FPT until a better government is chosen.

If I understood correctly, @Alekseyev_ wants that third "freshwater" FPT also to be penalised away under Despotism, which would reduce the Agri-Civs' early growth/expansion rates to the same as the non-Agri Civs.
 
First of all, a very big compliment for your Patch/Mod/Game-Expansion! :thumbsup:
El_Constructor, Welcome to CFC! :band:[party]:cheers:

I'm not even sure what a land transport is supposed to do exactly, just carry units to a city to attack?

Well, humans use land transports primarily to speed-up invasions, to move-up slow units so they can attack the same turn. Same goes for artillery.
No idea how difficult this is to code, but it would make sense for an AI player to use land transports to ferry units around whenever possible.

And once again, Flintlock, you are the man. I wish we could help you more.
 
Last edited:
Well, humans use land transports primarily to speed-up invasions, to move-up slow units so they can attack the same turn. Same goes for artillery.
No idea how difficult this is to code, but it would make sense for an AI player to use land transports to ferry units around whenever possible.
... and Meteor Man, in your Star Wars space scenario on a "only land terrain" your spaceships could carry fighters, bombers, missiles, bombs, space torpedoes and landing crafts.
 
Under the Despotism-penalty, Agri-Civs only get that third FPT in town-tiles directly adjacent to freshwater (river or lake);
The despotism penalty on the third food in the city tiles does not apply if
1. The town has access to fresh water and does therefore need no aqueduct or
2. There is an aqueduct and city size has been reached.
The later may matter if a second anarchy period occurs somewhen way past aqueducts have become available.
 
First of all, a very big compliment for your Patch/Mod/Game-Expansion! :thumbsup:
Is it possible to create a "switch" where we can turn the diplomatic penalty on or off, you get when using nukes, that causes all ai-players to declare war on you after using 2 or 3 nukes?
Thanks! I'll have to look into the diplo penalty for nuking, though that sounds like something that would be possible. Simply bypassing behaviors like that is generally easy, once I've found where they're implemented in the code. Reducing the penalty is likely possible too, though it depends on how it's implemented.
Under all the non-penalised governments, Agri-Civs get 3 FPT from every town-tile.
Under the Despotism-penalty, Agri-Civs only get that third FPT in town-tiles directly adjacent to freshwater (river or lake); dry town-tiles get the standard 2 FPT until a better government is chosen.
The despotism penalty on the third food in the city tiles does not apply if
1. The town has access to fresh water and does therefore need no aqueduct or
2. There is an aqueduct and city size has been reached.
Wow, I can't believe I never noticed that. I thought the Agricultural bonus only applied to cities with fresh water. I must have never looked closely at food production beyond the early game while in Despotism. Looking at the code, that exception to the tile penalty is clearly apparent, and would be easy to remove.
Well, humans use land transports primarily to speed-up invasions, to move-up slow units so they can attack the same turn. Same goes for artillery.
No idea how difficult this is to code, but it would make sense for an AI player to use land transports to ferry units around whenever possible.
It would be pretty difficult. Coding an AI for a single unit acting on its own is hard enough, and this is worse since it would require multiple units to work together.
 
Probably unfeasible, but not necessarily so. I've been thinking about this sort of thing. The way to do it would be to call out to a Lua script that was created by the mod author or player. It's possible to embed a Lua interpreter in the executable, in fact I've already done it as a proof of concept about a year and a half ago. The hard part would be generating bindings between the Lua scripts and Civ 3's data & methods. Though that could probably be automated. Embedding Lua could change my job from implementing requested gameplay changes to implementing hooks so modders can make their own changes. Hopefully they actually would, one of the reasons I haven't gone down this path is I read that someone did something similar for Civ 2 but the Lua system was never used by anyone. Anyway it's fun to think about doing this. I could use Lua myself after all, it might be worth it just for config files.
I'd definitely love to see what you can come up with. I have never used Lua myself, but this sounds like a worthy cause to learn it for. :D
About the agricultural exemption from the despotism penalty, is that only on the city square or on all tiles in city radius? I've never heard of anything like that before. It shouldn't be hard to change, I'll add it to the list and hopefully get around to it soon.

Under all the non-penalised governments, Agri-Civs get 3 FPT from every town-tile.

Under the Despotism-penalty, Agri-Civs only get that third FPT in town-tiles directly adjacent to freshwater (river or lake); dry town-tiles get the standard 2 FPT until a better government is chosen.

If I understood correctly, @Alekseyev_ wants that third "freshwater" FPT also to be penalised away under Despotism, which would reduce the Agri-Civs' early growth/expansion rates to the same as the non-Agri Civs.

Wow, I can't believe I never noticed that. I thought the Agricultural bonus only applied to cities with fresh water. I must have never looked closely at food production beyond the early game while in Despotism. Looking at the code, that exception to the tile penalty is clearly apparent, and would be easy to remove.
It's a really strange exception that I do not understand why it was made the way it is - agricultural is the strongest trait by far due to this. If you could make this an option to "fix" the incosistency, it would be great. Also, settling on food resources deletes all the extra food, while settling on prod or money resources does not cause such a loss. If this could optionally be allowed to keep the bonus food, that would also be nice to have. :D Even though I think balance-wise it is good, otherwise settling on cattle could be really quite insane. But having the option could be nice. :D
 
It would be pretty difficult. Coding an AI for a single unit acting on its own is hard enough, and this is worse since it would require multiple units to work together.
What about simply allowing transport units to transport other transport units, or allowing a naval unit to transport other naval units?
 
El_Constructor, Welcome to CFC! :band:[party]:cheers:
@Meteor Man
Thank you! [party] :cheers:


Thanks! I'll have to look into the diplo penalty for nuking, though that sounds like something that would be possible. Simply bypassing behaviors like that is generally easy, once I've found where they're implemented in the code. Reducing the penalty is likely possible too, though it depends on how it's implemented.
@Flintlock
Sounds great!
Would be cool if that could be part of one of the upcoming versions.

Sticking with things that are probably technically possible:
Also, would it be possible to change the restriction on the additional production generated by the civil engineer in the original game so that it can also be used for unit production and not just for constructing buildings?
In scenarios it would then be possible to make the production of cities more dependent on the city size and not (only) on the type of surrounding terrain (e.g. through production-generating standard citizens).
 
I've just tested the charm bombard again and have found out if you give a land artillery piece the charm special order, it will have the same the same targeting behavior like regular artillery in Vanilla and PTW. That means it could target units, pop and improvements with equal chance. Units targeted and hit will have THE ENTIRE STACK's defense stats halved. This is the most problematic thing as it's insanely overpowered. If that can be altered to halving just 1 unit's defense we'd be able to incorporate another class of artillery into the game. Or if it's altered to reverting back to taking a hit point we could have Vanilla/PTW style artillery targeting again.
 
Last edited:
It would be great to have different types of Artillery. I miss the old PTW style where you just annihilate a city for revenge with Arty units.
 
I've just tested the charm bombard again and have found out if you give a land artillery piece the charm special order, it will have the same the same targeting behavior like regular artillery in Vanilla and PTW. That means it could target units, pop and improvements with equal chance. Units targeted and hit will have THE ENTIRE STACK's defense stats halved. This is the most problematic thing as it's insanely overpowered. If that can be altered to halving just 1 unit's defense we'd be able to incorporate another class of artillery into the game. Or if it's altered to reverting back to taking a hit point we could have Vanilla/PTW style artillery targeting again.
I've not had the time to follow this thread ( :worship: ) as closely as I'd have liked, so do forgive me if this is redundant info: tom2050's thread, Major Discoveries on Charm... CHARM WORKS
 
I've not had the time to follow this thread ( :worship: ) as closely as I'd have liked, so do forgive me if this is redundant info: tom2050's thread, Major Discoveries on Charm... CHARM WORKS
Too bad units with the cruise missile ability can't use the charm function. Otherwise you could have civ4 style suicide artillery for collateral dmg on the entire SOD. But I can't see how not being an expensive 1 time use weapon wouldn't be absolutely overpowered combined with conventional and lethal bombard options.
 
I'd definitely love to see what you can come up with. I have never used Lua myself, but this sounds like a worthy cause to learn it for. :D
Talking about it has gotten me interested in Lua again so I dusted off that old proof of concept I did and have been playing around with it for the past few days. Running Lua from inside Civ 3 is no problem, that's no surprise since the injected C code can do anything any normal C program could. As expected the hard part is getting Lua to interface with Civ 3's functions and data types. LuaJIT has an FFI library that's supposed to make that kind of thing easy, though I'm not sure how applicable it is to my needs here. One roadblock I've already run into is that it finds C function addresses automatically using the Win32 method GetProcAddress, which doesn't work for finding addresses in Civ3Conquests.exe since the EXE is not set up to export them. Similarly the mod's own injected functions aren't available that way. However, there is a solution, I can redirect the Lua DLL's calls to GetProcAddress to my own replacement function, as I've done for so many Civ 3 functions, that provides the addresses of Civ 3 functions when asked. That's one piece of the puzzle anyway.

This has been fun but I'm not sure how far I want to go down this road. Right now I'm planning to reimplement the disorder warning feature in Lua as a beefier proof of concept, since it's a relatively simple but not trivial feature. If people are interested in this I could continue working on it but if not I don't think it's worth the effort. I might post a separate thread about this to gauge interest.
It's a really strange exception that I do not understand why it was made the way it is - agricultural is the strongest trait by far due to this. If you could make this an option to "fix" the incosistency, it would be great. Also, settling on food resources deletes all the extra food, while settling on prod or money resources does not cause such a loss.
Sure, removing that exception to the tile penalty is a 10 minute job at most so I'll go ahead and do it for R14. About allowing bonus food from resources on city tiles, I doubt that's difficult but I'd have to look into it. Added to the list for now.
What about simply allowing transport units to transport other transport units, or allowing a naval unit to transport other naval units?
You'd still have the problem of getting units into some transport in the first place and figuring out where they're supposed to go. The base game unit AI doesn't do a great job of this. As far as I can tell, the way it works is that units load up for a naval invasion if they happen to find themselves in a city with a naval transport and have nothing better to do. There's no way for them to seek out a transport, which is why the AI often sends out transports that are only partially filled.
I wonder if in new mods there is that thing fixed with treasury cashed in capitol which is not working when you start a game from conquest folder?
I'm not sure what you're referring to, but I haven't touched anything related to that so no, sorry, it hasn't been fixed.
Also, would it be possible to change the restriction on the additional production generated by the civil engineer in the original game so that it can also be used for unit production and not just for constructing buildings?
Probably. It's been a while since I looked at that part of the code but as I recall the game just checks if the city's current build is an improvement or unit to determine whether shields from specialists can contribute, so that should be another case where the logic could be bypassed with a small edit.
I've just tested the charm bombard again and have found out if you give a land artillery piece the charm special order, it will have the same the same targeting behavior like regular artillery in Vanilla and PTW.
Interesting find. I looked over the bombard code again, and it does look like it would be possible to make charm bombard do normal damage against units. Basically the way the charm attack procedure works is that it rolls a damage kind (damaging buildings, population, or units) then calls a method to apply that to the city, and if the city didn't absorb the damage, then it goes on to apply charm status to units on the tile. I could intercept that method call to apply regular damage to units, depending on the damage kind, and avoid the rest of the charm bombard procedure. There's one catch in that cities aren't always vulnerable to charm attacks depending on what improvements are present. I'd have to bypass that code as well. Making it so that charm bombard applies normally but only to one unit is probably possible too but more difficult.
 
Hi Flintlock,
Thanks for all this exciting work! I am one of those interested in the Lua option.

Here's a bug-fix request for your giant wishlist; I think it should be a fairly quick fix given what you've done so far: Require that a keyboard shortcut can only be used for a unit if the unit has the corresponding button available. Currently, you can remove the GoTo option from a unit in the scenario editor, which disables the ability to click-&-drag-move the unit but still allows you to move the unit with arrow keys.

Why, one might ask, would one care about this bug? Here are two reasons: 1) We could make scenarios where the human player initially has only minimal control over their units and must hit "automate," thereby allowing the AI to run their units (To those who didn't know, this works if you check the "automate" worker action box in the scenario editor! The AI then seems to use whatever AI flags have been checked - not necessarily the worker AI. The AI controlled unit can still do the things that the human can't make the unit do, such as fortify or move.). Then, as the player's Civ learns more tech or builds more buildings they could be enabled to build units which they have more control over. 2) Units with the "immobile" flag cannot teleport. Units without the GoTo order can.
 
Hi Flintlock,
Has anyone requested a fix for the bug regarding the broken "immune to disease from flood plains" flag in the technology properties? Even if a tech has this flag checked, disease from flood plains still occurs (population is still lost) after discovering this tech.
 
Back
Top Bottom