Resource icon

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

Flintlock, thank you very much for taking the time to work on the resource-generating buildings and making the preview version available. This has been modding dream of mine for longer than I can remember. I'm sure it will take some tweaking and nudging to get the AI to utilize it properly, but together with the options for local and shared resources, there are now huge possibilities for the game. Much appreciated.
 
I wanted to see, if a building-produced strategic resource, that is only available for the city but not for the trade net of a civ, will appear twice in the city screen and therefore I made the following test with the R17 Preview 2 version of your mod in Debug Mode:

The steam engine and the power plant both need coal to provide the virtual strat. resource Electric Power (that is not normally available in the game) to that city and I set this resource to give 3 shields to that city. The increase in production for the steam engine is 25 %, the increase for the power plant is 50 %.

Flintlock resources.jpg


The resource Electric Power appeared only one time in the city screen (what is good), but the shield bonus was added twice. Interesting is, that in this case no letters appeared for the transformation from coal to electric energy (what in my eyes is good, too, as the shields behind both buildings are enough to show the special characteristics of those buildings).

On the other side the screenshot shows, how quick an avalanche in production capacity here can be created. A solution for the replaces-all-other-buildings-with this-flag slingshot would be really good.

Another understanding of this test was, that a building with one of the "virtual" resources in its prerequisites (at least when not available for the trade net) and a setting, that the resources must be in city radius, could never been built, even when the city is directly located on the tile with the resource, that is transformed to that virtual resource and all other prerequisites are full filled. It seems that, if one of the needed resources for a building is a virtual resource, the flag "must-be-in-city-radius" should not be used, as such a building can not be constructed.
 
Last edited:
Would it be possible to let modders decide whether an individual unit needs an escort or not, by strictly enforcing the flag in the Editor? So you can turn off escort requirements for some units, but leave it on for others? There's a flag called "Requires Escort" under the Unit Abilities list on every unit page. If "Requires Escort" were enabled for a unit, the AI should try to protect it, with a number of escorters as set by the current rules. If the flag was left untouched (off), no attempt would be made to escort that particular unit, regardless of what type of unit it happens to be. As if the number of escorters were set to zero. But of course, artillery units would need to be "brave" enough to move out on their own if they did not require any escorts.
Yes and no. It's relatively easy to remove the escort requirement from units but it would be quite a bit more difficult to add the requirement. The problem is that it's hard-coded in the executable which unit types require escort. I haven't seen the requires escort flag used anywhere in the unit AI. That flag may be completely unused, I can't say for sure since I haven't checked the logic for king units, but at least for artillery I don't see it used anywhere. Removing the escort requirement is much easier since I can modify the functions that check the state of a unit's escort to basically return "OK" if the flag isn't set on the unit's type. That would involve modifying three functions, so it's not as easy as it could be, but still relatively easy. So instead of strictly enforcing the flag for all units, I'll add an option to remove the escort requirement from artillery units if they don't have the "requires escort" flag.

Is it possible to change the name of a Civ between Eras? (e.g., "Kievan Rus" to Russia.)
This is another case where the hardest part would be reading in the requested changes from the config file. Implementing the change would be easy since the game has functions to retrieve each civ's name, adjective, etc. as needed that I could modify. BTW, the reason there are functions for that is so the game can check whether that player has a custom name set or whether or use the names from the scenario data.

The resource Electric Power appeared only one time in the city screen (what is good), but the shield bonus was added twice. Interesting is, that in this case no letters appeared for the transformation from coal to electric energy (what in my eyes is good, too, as the shields behind both buildings are enough to show the special characteristics of those buildings).
If Electric Power is a strategic resource, it should appear over the building icons when it's being generated. I wonder why it's not.

On the other side the screenshot shows, how quick an avalanche in production capacity here can be created. A solution for the replaces-all-other-buildings-with this-flag slingshot would be really good.
I looked into that flag a while back and was left with the impression that it would be rather difficult to modify. Just something about how it's programmed makes that awkward. I might take a second look though.

Now that I'm actually playing with r17p1, it doesn't show any AI moves despite all unit options being toggled on. I only see the messages where they attack.
If you have the turn timer on, the mod turns off animations during the interturn so they don't contribute to the time.
 
If Electric Power is a strategic resource, it should appear over the building icons when it's being generated. I wonder why it's not.
I am wondering, too - but I don´t miss that icon, as the added shields behind the building in my eyes are hint enough. May be the icon over the building is not appearing, when the resource is linked to a tech, that no civ can have.
 
If you have the turn timer on, the mod turns off animations during the interturn so they don't contribute to the time.
Ah of course. I missed that in the notes. Great debug feature! Then audio glitches are my only remaining obstacle on Linux. Do you think that's an area C3X could potentially address, or is it more likely a platform issue?
 
It's relatively easy to remove the escort requirement from units but it would be quite a bit more difficult to add the requirement. The problem is that it's hard-coded in the executable which unit types require escort. I haven't seen the requires escort flag used anywhere in the unit AI. That flag may be completely unused, I can't say for sure since I haven't checked the logic for king units, but at least for artillery I don't see it used anywhere. Removing the escort requirement is much easier since I can modify the functions that check the state of a unit's escort to basically return "OK" if the flag isn't set on the unit's type. That would involve modifying three functions, so it's not as easy as it could be, but still relatively easy. So instead of strictly enforcing the flag for all units, I'll add an option to remove the escort requirement from artillery units if they don't have the "requires escort" flag.
Could you at least have the option to remove escort requirements from any type of unit that would otherwise require some? Not just artillery. Personally, I would be most interested in using that option for wooden sailing ships with transport ability, like Galleons. I don't think they need to be escorted in my mod, as they can hold their own, and don't transport many units. But Transports and Carriers would need at least 1 or 2 escorts. In the vanilla game, these are the only two units with the "Requires Escorts" flag checked. I don't know if that actually makes any difference.
 
Could you at least have the option to remove escort requirements from any type of unit that would otherwise require some? Not just artillery. Personally, I would be most interested in using that option for wooden sailing ships with transport ability, like Galleons. I don't think they need to be escorted in my mod, as they can hold their own, and don't transport many units. But Transports and Carriers would need at least 1 or 2 escorts. In the vanilla game, these are the only two units with the "Requires Escorts" flag checked. I don't know if that actually makes any difference.
For all naval ships, this is already implemented in the latest version. I think it’s been there for a while actually.

And man, the enemy Navy is a lot more fierce!
 
I am wondering, too - but I don´t miss that icon, as the added shields behind the building in my eyes are hint enough. May be the icon over the building is not appearing, when the resource is linked to a tech, that no civ can have.
Techs wouldn't matter for drawing the icon, only determining whether the resource is being generated. If it is, the mod simply grabs the icon from resources.pcx to draw it, whether or not the resource is revealed by a tech would have nothing to do with it. This is probably a bug in how the mod looks up the location of the icon on the PCX image. I'll have to investigate more. Since you'd prefer the resource icon not to appear, I'll add an option for that. It's trivial to do, literally like a 3 minute job.

Ah of course. I missed that in the notes. Great debug feature! Then audio glitches are my only remaining obstacle on Linux. Do you think that's an area C3X could potentially address, or is it more likely a platform issue?
I have no idea what's causing the audio glitches but I think it's fixable since not all sound files are affected. When I played a couple of hours on Wine, I noticed there was one sound effect in particular, some kind of background bird chirping, that always got stuck in a loop whenever it randomly played. That at least gives me a starting point to investigate the issue.

Could you at least have the option to remove escort requirements from any type of unit that would otherwise require some? Not just artillery. Personally, I would be most interested in using that option for wooden sailing ships with transport ability, like Galleons. I don't think they need to be escorted in my mod, as they can hold their own, and don't transport many units. But Transports and Carriers would need at least 1 or 2 escorts. In the vanilla game, these are the only two units with the "Requires Escorts" flag checked. I don't know if that actually makes any difference.
Sure, that shouldn't be any more difficult than removing the requirement from only artillery units. I think the logic that determines the state of a unit's escort is common to all types.
 
I have no idea what's causing the audio glitches but I think it's fixable since not all sound files are affected. When I played a couple of hours on Wine, I noticed there was one sound effect in particular, some kind of background bird chirping, that always got stuck in a loop whenever it randomly played. That at least gives me a starting point to investigate the issue.
I'll have to listen more closely but I thought it could happen to any ambience sfx. If we can replace them with dummy files that's good enough for me. I also get a sharp clicking in low-frequency sounds like unit footsteps, but maybe that's just me.
 
Just a comment on the icons not showing in the buildings icon, I had an issue with that too. It was actually showing the wrong resource icon in there. In my case the culprit turned out to be my "Phantom Resource Bug" fixes I made all those years ago in the resource id order in the .biq file with Quintillus editor. When I reordered the resources to correspond to the image order in the resource.pcx file the right icons showed up.
 
I'll have to listen more closely but I thought it could happen to any ambience sfx. If we can replace them with dummy files that's good enough for me. I also get a sharp clicking in low-frequency sounds like unit footsteps, but maybe that's just me.
Ideally we could figure out what's wrong with them and then have C3X fix the files as they're loaded. Surely the audio data itself is not the problem but rather it's something to do with the metadata, like the files are malformed in a way that Windows compensates for but Wine doesn't. I didn't hear any clicks on unit footstep sounds but that may because I didn't trigger any.

If I were to investigate this, I would start by creating a little C++ program that loads sound.dll and uses it to play the game's sound effect files. Hopefully that reproduces the errors when run on Wine. It's as close as we could get to a minimal reproduction of the bug without the source code. It shouldn't be too difficult either, I believe you can do that with only three function calls, one to initialize the sound module, another to load a file, and the third one to play it.

Just a comment on the icons not showing in the buildings icon, I had an issue with that too. It was actually showing the wrong resource icon in there. In my case the culprit turned out to be my "Phantom Resource Bug" fixes I made all those years ago in the resource id order in the .biq file with Quintillus editor. When I reordered the resources to correspond to the image order in the resource.pcx file the right icons showed up.
There it is. The problem is the mod looks up resource icons based on the index of the resource itself instead of the index of the resource's icon. I totally forgot that you can change the icon for each resource in the editor and only tested against base game resources where the resource indices and icon indices match. At least it's an easy fix.
 
Does the "aerial" zone for the control use the air unit's operational range and bombard value to bombard a unit moving past that radius? Or does it work the same as regular zone of control? I'm asking because to have aerial ZOC you need to have bombard value and operational range greater than 0.

And does that aerial ZOC affect immobile air units bombing or reconning into range? Or is it just movement?
 
C3X's new ZOC for air units didn't exist back then.
Understood, but (personally) I like knowing the "original" of what the Grand Master is working from, for e.g., errors/conflicts/The Unexpected which might arise.
 
Does the "aerial" zone for the control use the air unit's operational range and bombard value to bombard a unit moving past that radius? Or does it work the same as regular zone of control? I'm asking because to have aerial ZOC you need to have bombard value and operational range greater than 0.
And does that aerial ZOC affect immobile air units bombing or reconning into range? Or is it just movement?
Aerial zone of control works the same way as regular ZoC, so it only hits units moving between adjacent tiles. I don't remember why I limited it to air units with operational range > 0. That limit might be totally arbitrary.
 
Back
Top Bottom