Resource icon

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

is there any way to limit a Unit's movement to RR Tiles? - For armored trains & the like.
Ozy, the Flintlock mod since a longer time allows to limit railroad movement in general (not for individual units):

railroad movement.jpg


The argument is, that when transported by a train, all units have the same movement of the train.
 
Ozy, the Flintlock mod since a longer time allows to limit railroad movement in general (not for individual units):
What he means is, make it so certain units can only move along railroads. Like 'Wheeled', but all terrain is impassable.

It's a nifty idea, though I have no clue if the AI will be able to handle it. :p
 
What he means is, make it so certain units can only move along railroads. Like 'Wheeled', but all terrain is impassable.

It's a nifty idea, though I have no clue if the AI will be able to handle it. :p
:yup: Yes, I think you are right. In theory it is possible to set all terrain to "impassable for units with the wheeled" flag and to rename roads to railroads (as I did it in the SOE scenario). In that case units with the wheeled flag can only move on tiles with a road (named railroad).
 
Ozy, the Flintlock mod since a longer time allows to limit railroad movement in general (not for individual units):

View attachment 680087

The argument is, that when transported by a train, all units have the same movement of the train.
Yes, but I'd still like armored trains :)
 
Yes, but I'd still like armored trains :)
The Germans in World War 2 used flak trains in Russia and Eastern Europe to quickly move anti-aircraft assets along the front and to protect lines of communication. They typically carried quad 20mm mounts, 37mm anti-aircraft guns, and sometimes a battery of 88mm guns.
 
The Germans in World War 2 used flak trains in Russia and Eastern Europe to quickly move anti-aircraft assets along the front and to protect lines of communication. They typically carried quad 20mm mounts, 37mm anti-aircraft guns, and sometimes a battery of 88mm guns.
:thumbsup: They also used them extensively used for anti-partisan activities in WW2, and they were also used during the Russo-Polish war, 1920-21.

ADDENDUM - How could I have possibly forgotten to mention the huge WW2 RR guns like the Dora? ( :hammer2:)
 
Last edited:
Update on generated resources adding yields: I'm still not done testing that it all works under the hood, but I did take the time to modify the interface both to show yields and resources. Here's what it looks like now:
generated_resources_displayed_opt.png

The yields are displayed in the same place that commerce from tourism is. If a resource generating building also generates tourism, that commerce would appear alongside the resource yields. There's not much space there but it looks okay as long as the yields are not too large. The "W" building produces incense with yields, so 2 extra commerce, and the "A" building produces cattle with yields, so 2 food & 1 shield. Those look okay. I also added the "C" building to see how bad it can get with a lot of generated resources. That one generates iron, coal, and oil all with yields. It looks pretty bad but there's not much I can do about that since there's so little space on the city screen for buildings.

I put icons for the generated resources over top of the building icons like I mentioned previously. That too looks okay for one, maybe two, generated resources, but with three or more it quickly becomes a mess. Again there's not much I can do about that because there's just no room. Also notice the cattle resource doesn't appear, that's because it's a bonus resource and by hiding it you can ignore the resource and pretend like "A" is a building that just generates 2 food & 1 shield. I'll probably add an option to show generated bonus resources since it might be useful and would be trivial to do.

Here's another example of what it looks like, where a bunch of base game buildings are configured to produce horses:
all_generating_horses.png

The temple looks okay like this but the library doesn't, you really have to squint and look close to see what's going on there. Ideally modders who are setting up resource generation from buildings would design the building & resource icons so they look good together. On that note, the mod grabs resource icons from resources.pcx. Specifically it takes the 33x33 center pixels from a resource, scales it down to 24x24, and draws that over top of the improvement icon, starting in the top right and going downward in case of multiple resources. To really make it look perfect, the thing to do would be to rely on a dedicated sprite sheet of scaled down resource icons, similar to luxuryicons_small.pcx for luxuries. However it's easier for everyone to do it this way, and I think it looks good enough.



So it is the question, if these save files are of any use for you without the main files of that tested prototype version of the next CCM.
I would need to be able to run the saves between turns to measure where the game is spending its time processing. The save files alone are of no use to me. It's fine since this isn't something I'm planning to do soon anyway, in a few months maybe. Do you know when the next version of CCM will be ready?

Question for Mr. Flintlock: Is there way to help you search for things? Like is there a simple text file we can read through to try to spot something of interest?
Please keep in mind I know absolutely nothing about coding, so I could be pretty useless, but just wondering.
Unfortunately not, there's not much I need from the text files. Almost all the searching I do is inside the EXE.

I'm guessing not, but is there any way to limit a Unit's movement to RR Tiles? - For armored trains & the like.
Limiting movement is relatively easy on its own. I've already done a similar thing to limit trespassing. The hard part is dealing with the various potential side effects of that change. For example limiting trespassing created a situation similar to the disembark immobile bug that could freeze the game. Limiting certain units to railroads could cause problems with the AI, or maybe not, it could be an easy little change. It's impossible to say without trying.
 
Looking good. With regards to the yields, how does it work in relation to an improvement/wonder becoming obsolete? Would that also remove the resources from them?
 
I put icons for the generated resources over top of the building icons like I mentioned previously. That too looks okay for one, maybe two, generated resources, but with three or more it quickly becomes a mess.
I think, this is an interesting solution. :) As there are 256 buildings available, there is no real need, that a single building has to provide 3 (or more) different additional resources. In my eyes even the combination of the library and the horse icon looks acceptable.
Do you know when the next version of CCM will be ready?
Normally my internal deadline for my epic mods is Christmas - what will be in two days. :) In this special case it will last somewhat longer. So my last test game with the next version of CCM was very promising and interesting, it showed, that an additional tech should be included in the CCM techtree of era 2 for the time between the Napoleonic Age and Railroads and some of those techs should be set to higher research costs, to fit better with the time scale. There must also be included an additional SW to provide settlers in the Industrial Age as normal settler production now only starts with era 4 and the upgrade chain for commercial raiders will change from submarines to WW1 destroyers - and of course tons of civilopedia text work must still be done.

The last test game was played with the R17-Preview1 version of your great mod. All settings of your mod concerning the game play in CCM worked well. May be it could be a good idea to upload a R17-Preview2 version, that includes the interesting icon solution for resource providing buildings, so that interested modders can test that option too, and you have not to test this all alone.

Some general observations from my CCM test games with the R17-Preview1 version (concerning not only the additions of that preview version):

- The combination to set the escort for ship convoys to only two ships and that all ships can retreat, seems to work very well.

- The option, that special resources can only be provided by a building to a city and not to the trade net of a civ, in my eyes is much more preferable to
the option, that a special unit needs a special building in that city.

Example: In the next version of CCM a special strategic resource (Capital ships) is needed for the production of pre-dreadnoughts, dreadnoughts and
battleships in coastal cities. If you need a special building in the city as a prerequisite for the production of a special unit, there must be written
hundreds of entries in the config file for each battleship, dreadnought and pre-dreadnought, that is included in a mod. With the resource solution, the
same effect can be achieved with a simple click in the editor for each of these ships and the config file can be set much smaller, only to deal with that
resource.

- The hyperlink bug is still in C3C, even with the Flintlock mod. The limit of links until the bug occurs with the Flintlock mod seems to be much higher (I
had not the time to look for the definite number of links), but when that limit is reached, the game will freeze.

- In my test games the performance of the AI with real land artillery was much better, when the real land artillery appeared much later in the game (may
be because the AI than had much more units for escort duties), so the setting for land artillery in the next version of CCM at present is a combination of the existing CCM settings for land artillery and later in the game appearing siege artillery (real land artillery).

- Stack bombardment by ships sometimes showed bombarding only the water, when the last ship in the bombarded stack of ships was sunk some
rounds before.
 
Last edited:
Update on generated resources adding yields: I'm still not done testing that it all works under the hood, but I did take the time to modify the interface both to show yields and resources.
Resources can also generate negative values. Have you tested the functionality of such a case and will they display similarly to corrupted production and commerce or consumed food?

There's another related issue that I'm not sure has been mentioned. Happy faces and positive culture are displayed correctly in the city screen for buildings, but buildings giving unhappy faces or negative culture are not. Is it possible to resolve this since you are already addressing a similar display issue?
 
Looking good. With regards to the yields, how does it work in relation to an improvement/wonder becoming obsolete? Would that also remove the resources from them?
Obsolete buildings aren't supposed to produce resources but I don't think that's properly updated right now, in other words they'll continue producing until something else triggers a recomputation of resource access. I'll fix this soon.

The last test game was played with the R17-Preview1 version of your great mod. All settings of your mod concerning the game play in CCM worked well. May be it could be a good idea to upload a R17-Preview2 version, that includes the interesting icon solution for resource providing buildings, so that interested modders can test that option too, and you have not to test this all alone.
Glad to hear it. I'm planning to post a second preview version of R17 hopefully before Christmas but maybe shortly afterward. I've been wanting to do that for weeks but Christmas really snuck up on me this year. And yeah, you're right that I shouldn't worry so much about testing the preview versions. The original idea was that they would be posted frequently with only basic testing but I still tend to think of them like full versions.

Some general observations from my CCM test games with the R17-Preview1 version (concerning not only the additions of that preview version):
The hyperlink bug is a tough one. Right now C3X simply suppresses the popup messages about the hyperlink limit but it doesn't fix the crash that occurs when you have too many hyperlinks. Fixing the crash would be relatively difficult. This is yet another case where the game uses a statically allocated array, and this time for no good reason that I can see. Some of the other arrays you could argue are for performance, but in this case it's part of the interface logic so the performance impact of dynamically allocated an array would be completely irrelevant. Anyway, last time I looked into this I didn't see any easy way to change it, which is not to say it would be impossible, just difficult.

I'm not sure what you mean by "real" land artillery. The AI is supposed to change how eager it is to build artillery depending on how strong the artillery it can build is compared to its strongest non-arty land unit option. The intention is that the AI would be very eager to build artillery in the industrial era when its best attack units are infantry and cavalry, but it would not be eager to build catapults over swordsmen. I hope that design is working well, it's honestly something I threw in there and barely tested.

Thanks for the bug report about stack bombard, I'll look into that. Can you say any more about the circumstances there? Is it possible the stack bombard was trying to attack a submarine and couldn't?

Resources can also generate negative values. Have you tested the functionality of such a case and will they display similarly to corrupted production and commerce or consumed food?

There's another related issue that I'm not sure has been mentioned. Happy faces and positive culture are displayed correctly in the city screen for buildings, but buildings giving unhappy faces or negative culture are not. Is it possible to resolve this since you are already addressing a similar display issue?
Thanks for mentioning negative resource yields, I hadn't thought about that. Handling negative yields would be easy in terms of code, the trouble (admittedly a minor trouble) is that there are no icons already for them. I would have to make some. To show resource yields on buildings, I'm using the small food & shield icons from "Art\city screen\CityIcons.pcx". There is a small negative commerce icon used to indicate maintenance but there are no small negative shield or food icons, and of course no negative culture icon. Modifying the code to show unhappy faces and negative culture should be easy. I'll try to get this stuff done soon but maybe not in time for R17 Preview 2.
 
Even though it's Christmas eve, I managed to steal away enough time to finish off the next preview version. It's available on GitHub like the others, here: https://github.com/maxpetul/C3X/releases/tag/Release_17_Preview_2.
Here's the full list of additions:
  • Enable resource generating buildings to add the resource's yields to their city
  • Display icons for generated resources on top of the generating building
  • Option to allow airdrops without airports
  • Can increase unit maintenance costs based on their build costs
  • Adjustable AI worker requirement
  • Option to pack the list of luxuries more tightly into the box on the city screen
  • Fix freezes caused by undisembarkable escorting unit
    • Covered by the disembark immobile bug fix option, which has been renamed
  • Improve turn timer
    • No longer count time spent on city screen
    • Fix possible double-counting of time spent on popups
I'll share more details about the changes to the AI worker builds later when I have time. Merry Christmas everyone! :xmas:
 
I'm not sure what you mean by "real" land artillery.
Real land artillery is the normal land artillery with the artillery strategy. In comparison to the units with the artillery strategy is the setting of artillery units in CCM in a combination of normal attack, stealth attack, special movement settings with an offensive strategy setting instead of an artillery strategy setting - and these units are autoproduced by a building. The advantage is, that the AI civs seem to build up more units with an offensive strategy and these offensive units can do the decisive attack to finish a weakened enemy stack by bombardment (if you don´t want to give the normal artillery the lethal bombardment flag). What is the sense if the AI is bombarding dozens of units in a stack until they are red-lined, if there are no normal attackers to take out all these red-lined units in the game ?

Sometimes I am wondering, if it wouldn´t be better, if the real land artillery would be escorted by offensive units (and modders could give these offensive units even acceptable defensive values, too), or if the normal land artillery wouldn´t need any escort and the modders add the defensive value of the escorting unit to the defense value of the normal land artillery.
Thanks for the bug report about stack bombard, I'll look into that. Can you say any more about the circumstances there? Is it possible the stack bombard was trying to attack a submarine and couldn't?
These were sea battles by bigger stacks of CCM Commerce Raiders (HN units, can enslave, lethal sea bombardment) against smaller stacks of enemy ships (no submarines in it). When the stack of the Commerce Raiders had sunk all ships of the enemy stack by lethal bombardment, the stack of the Commerce Raiders continued the stack bombardment in that battle by firing salvo after salvo into the now empty sea tile. At the end of the battle all Commerce Raiders in the stack had lost their bombardment potential, so many of them only fired into the empty sea.
 
Right now the AI will always stick a defender to the Artillery strat unit. That means even if you have lethal bombardment on your artillery pieces, the AI wouldn't capture the empty city with the escorting defenders. You still need the AI to have offensive units around to do that. The solution is to have cruise missile ability units with the Artillery strat flag. That would free up AI defenders.

We also have the problem of the AI thinking if an artillery unit has lost its original defender, it would be exposed and needs to retreat regardless of the remaining units on the tile. So if you kill off a defender in an AI SOD you will see an artillery unit exposing itself from the big stack to retreat the next turn, making it easy picking for 3 movers or lethal bombard.
 
We also have the problem of the AI thinking if an artillery unit has lost its original defender, it would be exposed and needs to retreat regardless of the remaining units on the tile. So if you kill off a defender in an AI SOD you will see an artillery unit exposing itself from the big stack to retreat the next turn, making it easy picking for 3 movers or lethal bombard.

I absolutely love this as it has saved me quite a few times. I've had cities on the very cusp of being wiped out due to AI arty stacks of doom. When there are no counterbattery type units to silence those enemy guns I like being able to damage or kill off a few of those arty defenders. If this causes the AI to foolishly retreat an artillery piece or two I'll take it.
 
Sometimes I am wondering, if it wouldn´t be better, if the real land artillery would be escorted by offensive units (and modders could give these offensive units even acceptable defensive values, too), or if the normal land artillery wouldn´t need any escort and the modders add the defensive value of the escorting unit to the defense value of the normal land artillery.
I could try removing the escort requirement from artillery units. It might be very easy but I'm not sure the simple change I have in mind would work. It does work for naval transports, so that's promising. But looking at the logic for offensive & defensive units I think they might try to escort artillery units anyway. Of course I could also modify that too. It would just take more work.

These were sea battles by bigger stacks of CCM Commerce Raiders (HN units, can enslave, lethal sea bombardment) against smaller stacks of enemy ships (no submarines in it). When the stack of the Commerce Raiders had sunk all ships of the enemy stack by lethal bombardment, the stack of the Commerce Raiders continued the stack bombardment in that battle by firing salvo after salvo into the now empty sea tile. At the end of the battle all Commerce Raiders in the stack had lost their bombardment potential, so many of them only fired into the empty sea.
I wasn't able to reproduce this bug but I think I know what happened. When attacking units, the stack bombard logic first assembles a list of targets on the chosen tile, then it continues bombarding until none of the targets can be damaged either because they're dead or redlined without lethal bombard. The list stores unit IDs which works assuming that no units are created during the stack bombard operation. If units get destroyed, that's fine since their IDs will refer to nothing and the mod checks for that. However if a unit is created during SB then it might get assigned the same ID as a previously destroyed one, and then the SB logic will continue attacking the tile trying to damage it. So the problem is the unusual combination of lethal bombard and the enslave ability. It's an easy fix, just need to check that the targets are on the tile being attacked.
 
Real land artillery is the normal land artillery with the artillery strategy. In comparison to the units with the artillery strategy is the setting of artillery units in CCM in a combination of normal attack, stealth attack, special movement settings with an offensive strategy setting instead of an artillery strategy setting - and these units are autoproduced by a building. The advantage is, that the AI civs seem to build up more units with an offensive strategy and these offensive units can do the decisive attack to finish a weakened enemy stack by bombardment (if you don´t want to give the normal artillery the lethal bombardment flag). What is the sense if the AI is bombarding dozens of units in a stack until they are red-lined, if there are no normal attackers to take out all these red-lined units in the game ?

Sometimes I am wondering, if it wouldn´t be better, if the real land artillery would be escorted by offensive units (and modders could give these offensive units even acceptable defensive values, too), or if the normal land artillery wouldn´t need any escort and the modders add the defensive value of the escorting unit to the defense value of the normal land artillery.
I could try removing the escort requirement from artillery units. It might be very easy but I'm not sure the simple change I have in mind would work. It does work for naval transports, so that's promising. But looking at the logic for offensive & defensive units I think they might try to escort artillery units anyway. Of course I could also modify that too. It would just take more work.
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.
 
Back
Top Bottom