Resource icon

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

Like for every 100 shields a unit costs to build, it costs an additional unit's worth of maintenance?
I think the idea isn't bad, but if there were a way to have it entirely separate that would be best. Then you could enable stuff such as ships being easy to make (helping the AI), but expensive to maintain, or mercenaries that likewise are easily made, but cost a lot to keep. (I'm sure there are also examples for the other way around.)
That is possible and should be relatively easy. I recently discovered that the game already maintains a count of how many units of each type each player has in production, so that simplifies things. I'd probably have the limits defined by a list of pairs of unit types and numbers, for example [Missionary: 3, Spy: 3, "Corporate Executive": 5]. That should be the easiest way unless you want many unit types to have the same limit.
What about the case where you might want a unit limited to 3 upgrade to another unit limited to 3? I think with a basic implementation you might end up having 3 of each, when the intention could be to limit to 3 of that unit-line in total. Do you think a logic such as [Missionary, Spy: 3; "Corporate Executive": 5] that would limit you to 3 in total of (Missionary + Spy) together could work?

And re: paratroopers: I think they are pretty fine as they are right now, the abuse potential is low. You'd need rails or jump right into other airport-containing cities to keep jumping, which means you control your area fairly well anyway.
 
Firstly I would like to tip my hat to Flintlock, your work is stunning and absolutely ground breaking, for which we all owe you an undying debt of gratitude. But as it happens, with choice comes taste, so I'd like to throw out a few ideas. For me, the biggest painful limitation at the moment is the maximum number of buildable improvements in cities, so my ideas are mostly focused on gimmicky solutions that would free up at least a few buildable slots. I apologize if my ideas are not original and have already been answered or if they are stupid, impractical or impossible to implement.
1) More additional settings for buildings_generating_resources:
- hidden (an invisible resource, not visible in the trade advisor, not visible when looking at resources in the city, for game mechanics only);
- untradeable (added to the trade network, but untradeable with other civilizations);
- Government type;
Example: buildings_generating_resources = [
Palace: GOVT_Absolute_Monarchy "Monarchism (SR)",
Palace: GOVT_Constitutional_Monarchy "Monarchism (SR)",
Palace: hidden GOVT_Republic "Republicanism (SR)",
Palace: hidden GOVT_Democracy "Democracy (SR)",
Palace: untradeable GOVT_Democracy "Democracy (Lux)"]
- Golden Age;
- Mobilization (War-Time/Normalcy);
- Start with a specific technology/era;
- End with a specific technology/era;
Example: buildings_generating_resources = [
Palace: hidden GOVT_Absolute_Monarchy start(ERA-2) end(TECH_French_Revolution) "Absolutism (SR)",
Palace: untradeable GOVT_Absolute_Monarchy golden-age end(TECH_French_Revolution) "Absolutism (Lux)"]
- Minimum/maximum city size;
- Minimum/maximum number/percentage of happy/unhappy/resistant citizens in the city;
- Minimum/maximum number/percentage of known/all civilizations with which the player's civilization is at peace/war;
Example: buildings_generating_resources = [
Barracks: local GOVT_Fascism size(min(7)) size(max(12)) resistant(max(0)) unhappy(max(35%)) "Totalitarianism (SR)",
Barracks: local GOVT_Fascism size(min(2)) size(max(6)) resistant(max(0)) unhappy(max(20%)) "Totalitarianism (SR)",
Barracks: local GOVT_Fascism size(1) resistant(0) unhappy(0) "Totalitarianism (SR)"]
2) Have a list of improvements that will only need access to one of the required two resources to build them.
Example: Let's have a bank requiring the strategic materials Gold and Silver in order to be built. Once the bank is included in the list specified in the INI, it would be sufficient to have at least one of these two materials.
Note: Is it possible, when all resources are cut off, for the bank to stop adding +50% tax output?
3) Change directly the properties of improvements (name, cost, maintenance, culture, production, pollution, happiness, and so on) by inventing a certain technology/entering a certain era.
Note: Achieving this would be almost miraculous, so I assume it's virtually impossible. Being able to use improvements that will become obsolete in the future, modifying the name and redirecting to the correct information from the civilopedia, would be dreamy.
4) Forced sale of an improvement after reaching a certain technology.
5) Slider (similar to the improvement slider) for luxuries in city if we have access to more than 8 luxuries.
6) Ability to allow laying resources more densely when generating a map, without a separating radius of 1. The random map generator currently never places, for example, iron and coal on adjacent squares.
7) Also, the ability to easily increase the total amount of all natural resources that are spread across the map when generating (for example, doubling or tripling the normal count, so that instead of 12 fish on the smallest map, the result will be 24 or 36).
8) As for the current problem with coastal fortresses, wouldn't it be possible to double the operational range (expand the zone of control) with a certain invention, thus being able to fire on more distant passing ships?
9) Extra maintenance: It would be great if all captured/enslaved units also have their own maintenance ratio depending on the shield cost.
10) Immunity to enslavement. Adjusting the odds of enslavement.
11) Optional factor applied to the calculation for selecting a target to attack, which would make the AI prefer proximity over weakness. Simply put, make the AI try harder to attack nearby stronger targets than weaker targets far deeper behind enemy lines.
12) Adjusting the odds of successfully bombing terrain (enemy roads, mines, etc.).
 
Here is a feedback for speeding up the interturn time in R17 preview:

Interturn time.jpg


In a CCM 2.6 test game with 31 civs plus barbarians on a 250 x 250 continental map, the interturn time in era 3 was a little more than 7 minutes (what still is somewhat long).
 
I have never seen AI using paratroopers in stock game, but in scenarios sometimes, for example WW2 scenario. I wonder if AI paratroopers would move after airdrop.
BTW, how they work when dropping on enemy cities? They always fail?
AI paratroopers should be able to move after airdropping. As far as I know, the unit AI continues running, searching for things for the unit to do, until the unit exhausts all its moves, fortifies itself, or dies. As for dropping onto an enemy city, I believe you can capture it if it's undefended. In any case, that would be easy to test.

What about the case where you might want a unit limited to 3 upgrade to another unit limited to 3? I think with a basic implementation you might end up having 3 of each, when the intention could be to limit to 3 of that unit-line in total. Do you think a logic such as [Missionary, Spy: 3; "Corporate Executive": 5] that would limit you to 3 in total of (Missionary + Spy) together could work?
I'm sure this could be made to work with enough effort, though it definitely complicates things. For example, I'd have to deal with the case where the same unit is listed multiple times in different groups, like [Missionary, Spy: 5; Spy: 3]. The hard part there isn't even the logic, it's just the bookkeeping. The mod is written in C so keeping track of this sort of thing is a pain, not to mention reading it all in from a text file.

Firstly I would like to tip my hat to Flintlock, your work is stunning and absolutely ground breaking, for which we all owe you an undying debt of gratitude. But as it happens, with choice comes taste, so I'd like to throw out a few ideas. For me, the biggest painful limitation at the moment is the maximum number of buildable improvements in cities, so my ideas are mostly focused on gimmicky solutions that would free up at least a few buildable slots. I apologize if my ideas are not original and have already been answered or if they are stupid, impractical or impossible to implement.
Thank you very much for the appreciation. The limit on the number of city improvements is something I haven't thought about much until now. Looking at the code, it might be possible to remove it. The challenge is that internally the game stores a fixed size array per city of 256 bits, one for each possible improvement, recording which improvs are physically present in a city (as opposed to being granted by a wonder). Because that array is embedded in the city object it's not possible to expand it. On the other hand, if the array is always accessed through a function, which it looks like it is, I could modify that function to store additional data elsewhere. There's again the problem of storing that data into the save file, which is probably doable but not something I've done yet. Assuming this works, it would be easier than morphing one improvement into another one depending on a technology.

Some more random thoughts about your list:
2. I could modify the build logic to allow an improvement to be built if any of its required resources are present. Anything else that depends on the resources being present wouldn't work, though, unless I modify that too. Unfortunately there's no single point in the game logic that decides whether or not a building's resource requirement is satisfied. About turning off a bank's gold bonus when it's missing a required resource, I could try that but I'm not sure it would work. There may be ways a city could lose access to a resource that I don't know about.
4. Force selling improvements once they become obsolete would be easy. This was requested before as a way of saving the AI from paying maintenance on obsolete improvs, but it turns out obsolete improvs costing maintenance was a bug that I've since fixed.
5. Sadly working with the interface can be a real pain. It can be difficult to know when to create/destroy UI objects, when to draw them, and how to tie them together (e.g. attach a scroll bar to a window). There's a lot of UI code in the EXE and it's mostly an over-complicated mess. But who knows, maybe this would be easy?
6 & 7. These should be simple changes but I'd have to analyze the map generator first. It's not something I've looked into in depth yet. Can't you increase the rate at which resources appear using the editor? Is that not good enough for some reason?
11. I wish I knew how the AI selected targets. I've looked into that before for some other changes I wanted to make but it's not obvious. I'm sure I could figure it out with enough effort, maybe some day.

Here is a feedback for speeding up the interturn time in R17 preview:
Have you tried without Trade Net X? I'm curious what proportion of the turn time was taken up by the trade net calculations before the optimization.
 
Have you tried without Trade Net X? I'm curious what proportion of the turn time was taken up by the trade net calculations before the optimization.
The same turn with trade_net_x disabled and only the time measuring message in R17_preview enabled lasted 9,21 minutes (compared to the 7,04 minutes with trade_net_x enabled).

Interturn 1868-no tradeX.jpg


Trade_net_x disabled.jpg


At that time a big war with no battle animations visible rages between the two largest civs at the neighbouring continent (with multiple protection pacts). Some turns later, when peace was established between those civs, the interturn time with trade_net_x enabled, was back to 231,218 sec (3,85 minutes)

Interturntime 1871.jpg


It seems, there are other very time consuming factors in the interturn phase of C3C.
 
Big update time. R17 Preview 1 is finally ready, download it from GitHub here. What was holding it up was that I was tinkering with the code for calculating trade networks, and ended up replacing most of it from the base game. I had a feeling that the base game's implementation was way too slow, that calculating the trade network is not that complicated, and especially that it shouldn't have to blow up in the late game. My feeling was right! I was able to get my reimplementation of the trade network to run ~35x faster than the original in an extreme test case. It's enough to make maps like Monstrosity playable all the way to the end.

My extreme test case is a late industrial era Monstrosity game with many wars going on. Previously (*) trade net calculations between turns would take 894 sec out of a total turn time of 958 sec. My custom trade net code runs in only 24.9 sec, reducing the total turn time to 93.4 sec. This is an extreme case since ~90% of the turn time is spent computing trade networks, usually it's less than that. I also measured times on an earlier save from that same game, in the early industrial era without many wars. In that more typical case, trade net calculations previously took 86 sec of an overall 153 sec turn. The custom code reduces that to just 3.85 sec, bringing the overall turn time down to 74 sec.

(*) Aside: "previously" here means with C3X R16, so including the improvement loop optimization. Out of curiosity, I turned that off and found it increased the trade net time to 943 sec and overall turn time to 1008 sec. So optimizing the improv. loops is worth about 5% in that case. That is not surprising since the Monstrosity scenario doesn't add any city improvements and the trade net calculations take so long they dwarf everything else. Optimizing the trade net makes the improv. loop optimization look better. With the trade net optimized and the improv. loops not, the trade net takes 50.0 sec of an overall 117 sec turn time, so the improv. loop optimization further reduces that by about 20%.

As for what the optimizations entail, by far the biggest improvement comes from preserving pathfinding info across jobs. Basically, when computing sea trade, the game loops over all pairs of cities with harbors that are not already connected by roads and tries to find a path between them. It processes the pairs independently, clearing the pathfinder's internal state before each search. That's extremely wasteful. For example, trying to path from city A to city B is done by crawling outward from A building up a set of reachable tiles in the direction of B (Wikipedia has a good illustration). Either you eventually reach B, and so there is a path, or you run out of reachable tiles, and can conclude no path exists. If next you want to check for a path between cities A and C, you can get a big head start by reusing the results from the search from A to B, since those results already include many tiles reachable from A. In the extreme case where there is no path from A to B, you've already done the work of searching for a path from A to C. That's because the only way to conclude there is no path is to visit every tile reachable from A, so either you've already visited C and there is a path A->C or you haven't and there isn't.

In fact, you can do even better than that. Imagine you've searched for paths connecting A->B, A->C, A->D, etc., building up a set of reachable tiles along the way. Next you're asked if there's a path B->C. If B is in the set of tiles reachable from A, you can again reuse the pathfinder state since A and B are in the same set of reachable tiles.

Reusing the pathfinder state is not the only optimization I've done. Since I reimplemented the pathfinder logic for the trade network entirely I had the opportunity to make many improvements. Two more notable ones:
  1. The game's data structures make very poor use of the CPU cache. The game was written in a typical unoptimized object-oriented fashion meaning all the data that makes up a tile has been piled into a tile object and then the game map is an array of tile objects. The problem with that is when the CPU checks, for example, the terrain of a tile, it pulls into its cache many unrelated parts of the tile object which it will not use. That stuff gets pulled in simply because it's what close in memory. If soon after the CPU needs to check the terrain of the surrounding tiles, as it does while pathfinding, that data will probably not already be in the cache. It would be faster to store the terrain data separately and arrange it so that data for nearby tiles is kept nearby in memory. The replacement logic can't replace the original tile or map layout but what it can do is stash the relevant tile data in a cache-efficient structure after it's accessed once, so all later accesses to the same tile's data are done in a cache-efficient manner.
  2. The logic for checking sea trade accessibility at a tile level has been simplified so it only runs once per tile. The base game is inefficient here in that it checks accessibility between tiles, not per-tile, even though when you boil down the rules they only matter per-tile. For example, say you want to know if a sea route can pass between tiles T and U, and then later between tiles T and V. The base game will make four checks here, two for tiles T & U, and another for tiles T & V. However, you only need to make three checks here, one for each tile, since a sea route can pass between any two adjacent accessible tiles.

    By the way, you might be wondering if that's really true, if any two adjacent, passable sea tiles can have a sea trade route passed between them. What about tiles separated by an isthmus? For example, imagine four tiles in a diamond shape, where the left and right tiles are land and the top and bottom are water. In that case, you can't pass naval units between the top and bottom tiles (unless you've activated the C3X land-sea intersections option) but you actually can pass a sea trade route between them. That's an odd little aspect of the game rules, and I'm not sure why the game is programmed that way. It may have been done for performance reasons, or maybe the devs simply never thought of it.
In terms of final performance, it's the reusing of the pathfinder's state that's responsible for almost all of the speed up. The above two improvements I mentioned only speed up trade net calculations by about 30%. I also replaced the calculation of the road network and managed to speed that up by about 2x. That sounds good but it really doesn't matter since road network computations take up 0.1% or less of the overall turn time.

To get reliable numbers for the turn times, I added the ability to measure them in-game, the option is named measure_turn_times (duh). If activated, you'll get a popup at the end of every interturn reporting how long it took, including specifically how long it took to recalculate the trade networks. Some of you might find this interesting, for example if you have a very slow save and want to know how much of the slowdown is due to the trade network.

There's a lot more in R17 Preview 1 than that. It also contains many extensions to zone of control and defensive bombard. Thanks to Vaughn for commissioning those. Here's the full list of changes:
  • Optimize computation of trade networks
    • For details, see the info text file in the Trade Net X folder
  • Option to measure turn times
  • Zone of control changes
    • Allow land-to-sea and sea-to-land attacks, only using bombard stat
    • May be lethal
    • May be exerted by air units
    • Show attack animation even when attacker is not at the top of its stack
  • Defensive bombard changes
    • May be lethal
    • May be performed by air units
    • Invisible, undetected units may be made immune
    • May be performed multiple times per turn with blitz
    • Naval units in a city may perform defensive bombard vs land attackers
  • Allow precision strikes to target tile improvements
  • Option not to end a unit's turn after it bombards a barricade
  • Option to allow bombardment of other improvements on a tile with an occupied airfield
  • Option to boost OCN increase from forbidden palaces in non-communal governments
  • Fix graphical issues when running on Wine
  • Option to allow defensive retreat on water tiles
  • Overhaul implementation of shared visibility for simplicity and correctness
  • Display total city count (disabled by default, appears on demographics screen)
Here's a little preview of what defensive bombard and zone of control can now do. I could have posted this version a day sooner if I hadn't taken the time to make these, so be sure to appreciate them:

View attachment 677787
Land units can exert ZoC over passing sea units & vice versa.

View attachment 677788
Air units can exert ZoC.

View attachment 677789
And they can perform defensive bombardment as well.

View attachment 677790
Defensive bombard & ZoC can be made lethal.

That's it! Please report any bugs if you find them. I'm 99% sure that my reimplementation of the trade network calculations will give exactly the same results as the original game, but it's always possible I missed something.
If these units have a fighter protecting them, would the fighter one-shot these bombers?

This could make for really cool combined-arms battles, but this could also be a really cheesy way to get one's bombers automatically sapped away 😅 Would it be possible to simply fail the bombing run with some health damage? (And maybe not defend if the health is too low)

(Also, I could have sworn there was a screenshot here of someone successfully having 3 upgrades of barbarians in their game. Tried searching everywhere. I'm not crazy...yet)
 
Last edited:
I believe you can capture it if it's undefended. In any case, that would be easy to test.
AFAIK, in the unmodded stock game, dropping a Paratrooper directly on an enemy city kills the unit, regardless of whether the city is garrisoned or not.
 
Last edited:
Flintlock,
Have you run across any of the logic that tells the AI whether to keep a deal it has made or to backstab another civ?

Or the parameters on what it takes to bribe the AI and to make that harder or easier?
 
The same turn with trade_net_x disabled and only the time measuring message in R17_preview enabled lasted 9,21 minutes (compared to the 7,04 minutes with trade_net_x enabled).
It seems, there are other very time consuming factors in the interturn phase of C3C.
Interesting, thanks for collecting this data. In this case the trade network calculations account for only about 15% of the turn time so even reducing them to almost nothing doesn't dramatically speed up turns overall. That's a bit surprising, I would have expected the trade network to be a bigger expense on such a large map. The Monstrosity must be a worst case scenario for trade calculations since on that map I observed them taking at least half of the turn time once most civs got navigation.

There is more I could do toward optimizing the game. One example, there are inefficient tech loops similar to the improvement loops. E.g., to determine the movement cost of a unit passing over a river, the game must determine whether the owning civ has the tech for bridges. To do that, it loops over every technology in the game searching for the one that grants bridges, and then checks if the civ has it. It would be more efficient to pick out that one tech (or possibly a small number of techs) ahead of time then check only those. I'm not sure how much that would actually improve performance, though it should matter more on mods like CCM that add a lot of technologies.

If these units have a fighter protecting them, would the fighter one-shot these bombers?
This could make for really cool combined-arms battles, but this could also be a really cheesy way to get one's bombers automatically sapped away 😅 Would it be possible to simply fail the bombing run with some health damage? (And maybe not defend if the health is too low)
It's not necessarily a one-shot. The bombers can be intercepted but it works like normal air combat, so they face the same risk as if they were bombing the tile the attacker or passing unit is on. You could bait out enemy bombers that way. I don't see any easy way to fix that. The bomber would have to know how likely it is to be intercepted before doing DB or ZoC, and as far as I know there is no function already in the game that does that. Maybe somewhere in the unit AI.

AFAIK, in the unmodded stock game, dropping a Paratrooper directly on an enemy city kills the unit, regardless of whether the city is garrisoned or not.
You're right. I tested it and found you can't airdrop into an enemy city even if it's undefended. You also can't airdrop onto an enemy worker.

Flintlock,
Have you run across any of the logic that tells the AI whether to keep a deal it has made or to backstab another civ?
Or the parameters on what it takes to bribe the AI and to make that harder or easier?
I still know almost nothing about the AI's diplomatic logic. I looked into it briefly when I was planning to change how the AI makes offers to the human player, to stop it from always trying to rip you off. But in the end I gave up because it was too complicated and not worth the effort.
 
Thank you very much for the appreciation. The limit on the number of city improvements is something I haven't thought about much until now. Looking at the code, it might be possible to remove it. The challenge is that internally the game stores a fixed size array per city of 256 bits, one for each possible improvement, recording which improvs are physically present in a city (as opposed to being granted by a wonder). Because that array is embedded in the city object it's not possible to expand it. On the other hand, if the array is always accessed through a function, which it looks like it is, I could modify that function to store additional data elsewhere. There's again the problem of storing that data into the save file, which is probably doable but not something I've done yet. Assuming this works, it would be easier than morphing one improvement into another one depending on a technology.
:worship::worship::worship: Good Lord that would be an amazing feat


Some more random thoughts about your list:
2. I could modify the build logic to allow an improvement to be built if any of its required resources are present. Anything else that depends on the resources being present wouldn't work, though, unless I modify that too. Unfortunately there's no single point in the game logic that decides whether or not a building's resource requirement is satisfied. About turning off a bank's gold bonus when it's missing a required resource, I could try that but I'm not sure it would work. There may be ways a city could lose access to a resource that I don't know about.
Just tossing a few ideas around, I think the game checks whether a civ is in x/y/z "Required Government" for the building to be operational, would it not also be able to check for its resource requirements at the same time? Or does it simply make this check upon changing governments?

What other changes could potentially be made to building (and possibly unit) requirements? For example:
-Could the "Requires Resources in Radius" flag be restricted to one of the resources needed in the radius instead of both? Perhaps a specific one if that would make the checks easier?
-Could single-choice requirements be overruled for multiple choice Either/Or requirements, for example if I gave the Arabian civs a Bazaar improvement instead of the Marketplace, would the Bank improvement be able to require [Marketplace OR Bazaar] instead of having to make two different Banks and then two different Stock Exchanges and then two different Wall Streets?

5. Sadly working with the interface can be a real pain. It can be difficult to know when to create/destroy UI objects, when to draw them, and how to tie them together (e.g. attach a scroll bar to a window). There's a lot of UI code in the EXE and it's mostly an over-complicated mess. But who knows, maybe this would be easy?
Strategic resources already have a UI method of dealing this - when it hits too many to display, it instead gives a little icon that you can click on for a pop-up list (pictures attached to give an example). Perhaps this function can simply be duplicated for luxuries once a city has access to more than 8 types?


6 & 7. These should be simple changes but I'd have to analyze the map generator first. It's not something I've looked into in depth yet. Can't you increase the rate at which resources appear using the editor? Is that not good enough for some reason?

Afraid there's no option to do this on the map setup screen nor in the editor.
 

Attachments

  • TooManyResources2.png
    TooManyResources2.png
    573.1 KB · Views: 35
  • TooManyResources.png
    TooManyResources.png
    151.4 KB · Views: 40
I'm sure this could be made to work with enough effort, though it definitely complicates things. For example, I'd have to deal with the case where the same unit is listed multiple times in different groups, like [Missionary, Spy: 5; Spy: 3]. The hard part there isn't even the logic, it's just the bookkeeping. The mod is written in C so keeping track of this sort of thing is a pain, not to mention reading it all in from a text file.
No worries, it was just a small remark - if it's much work (no matter what kind), don't spend your precious time on that tiny thing :D
Can't you increase the rate at which resources appear using the editor? Is that not good enough for some reason?
You can for strategic ones, but not for bonus resources.
You also can't airdrop onto an enemy worker.
I believe not on top of radio towers, outposts or airbases either - basically not on top of anything "owned".
-Could single-choice requirements be overruled for multiple choice Either/Or requirements, for example if I gave the Arabian civs a Bazaar improvement instead of the Marketplace, would the Bank improvement be able to require [Marketplace OR Bazaar] instead of having to make two different Banks and then two different Stock Exchanges and then two different Wall Streets?
You can have a workaround via local-only resources provided by the prerequisite buildings, that's what Civinator is doing to make a variety of religious flavour temples all be a valid prerequisite to a later holy center building.
 
A new behavior from the AI, they pillage tiles that were adjacent to my land. I had only notice pillaging of my tiles in the past. I counted on tiles not mine to be left alone. Not sure why they would do that nor if it is even a good idea.
In some cases it made sense as the tile would eventually be in my border, but other times the tile was next both of our lands.

Another new experience for me, having Egypt show up with 5 cav armies and next turn Persia with 3. They seem to not know about using the Pentagon as only 3 units were in the armies. Still a big improvement from the days of either no army or one with either 1 unit or a mixture of units. They all pillage as they went, once near my towns. They did not get a chance to attack units or towns, so I do not know, if they would.



Egypt has 90 cities, so they may have more armies around. I wonder what makes them use cavs as opposed to infantry? Both have the same attack and on has a much greater defense. The 3 moves, is the best choice, but
I would rather not face a army of infantry. Some of the armies were undoubtably made, before they had infantry.
 
You can for strategic ones, but not for bonus resources.

I think the total number of resources on the map stays more or less the same though - having more strategic resources with higher likelihoods just makes less bonus resources appear on the map. If you make all resources either strategic or luxury, then there'll be a chance that some resources won't appear on the map at all, at least on smaller maps.
 
Strategic r
I think the total number of resources on the map stays more or less the same though - having more strategic resources with higher likelihoods just makes less bonus resources appear on the map. If you make all resources either strategic or luxury, then there'll be a chance that some resources won't appear on the map at all, at least on smaller maps.
Strategic resources are tied to the number of players in the scenario. A *.*biq file setup for 8 players will have half as many resources as one setup for 16 players. I forget the vanilla editor's internal ratio to edit the numbers on the resources page (I lost the help file when I switched from CD to Steam). You can manipulate the numbers of resources by changing the player count in the scenario properties to create either a surplus or deficit of resources available -- make a map with all 31 civs but only enough resources for 8 of them.
 
Strategic r

Strategic resources are tied to the number of players in the scenario. A *.*biq file setup for 8 players will have half as many resources as one setup for 16 players. I forget the vanilla editor's internal ratio to edit the numbers on the resources page (I lost the help file when I switched from CD to Steam). You can manipulate the numbers of resources by changing the player count in the scenario properties to create either a surplus or deficit of resources available -- make a map with all 31 civs but only enough resources for 8 of them.
Yeah, but it makes up the differences through the number of bonus resources it places - in your example, bonus resources would be very plentiful. For more information, read here and here.
 
Splitting up the different features of the barracks building could be an interesting addition to this great mod. In my eyes the barracks building with its three combined features to produce veteran units, heal damaged units in one turn and allowing the upgrading of units is the most overpowered building in Civ 3.

This is why, per example in the CCM mod, in my eyes it makes a lot of sense to limit the use of this building. On the other side a building, that only provides the upgrade function and could be given by a small wonder (per example the palace) to every city of a civ, could make a lot of sense, as it eliminates the micromanagement of ordering many units to march to a city with an upgrade facility and also reduces the chance to meet big monster stacks full of "era 1 trash units" in the later phases of the game, as now the AI can upgrade units in every city - while the option to produce veteran units and to heal all land units in one turn stays the exception and not becomes the rule, as it is, when a small wonder would provide barracks to every city of a civ.
 
Interesting, thanks for collecting this data. In this case the trade network calculations account for only about 15% of the turn time so even reducing them to almost nothing doesn't dramatically speed up turns overall. That's a bit surprising, I would have expected the trade network to be a bigger expense on such a large map.
The shortening of the interturn time even in the rounds with a big war raging on the neighboring continent in my eyes is a big improvement. I now also made a comparison between the interturn times when that big war has ended (year 1871). Without the trade_net_X enabled, the following turn time did occur:

Interturn time peace.jpg


This means in that turn on the 250 x 250 map, the interturn time by the use of trade_net_X was reduced from 400,015 seconds to only 231,218 seconds (see the screenshot in post 1684) - and this is really a lot. :)

On the other side this shows, that there can be other factors that are dominating the interturn time compared to the trade net, but an optimized trade net is still a great step forward in playing Civ 3.

There is more I could do toward optimizing the game. One example, there are inefficient tech loops similar to the improvement loops. E.g., to determine the movement cost of a unit passing over a river, the game must determine whether the owning civ has the tech for bridges. To do that, it loops over every technology in the game searching for the one that grants bridges, and then checks if the civ has it. It would be more efficient to pick out that one tech (or possibly a small number of techs) ahead of time then check only those. I'm not sure how much that would actually improve performance, though it should matter more on mods like CCM that add a lot of technologies.
As these examples show, in my eyes it would be worth these efforts toward optimizing the game. In any case, Flintlock, here you have created another great improvement for C3C. :thumbsup:
 
Last edited:
I had an idea for what I expect would be a simple change:

When mods have custom music lists, the game always starts with the first song on the list and continues from there. This means that if you play for short or moderate periods of time, you miss a lot of the mod's music. It would be nice if, when the game loads a mod with a custom music list, it picked a random start position in the list rather than always starting at the top.
 
Splitting up the different features of the barracks building could be an interesting addition to this great mod. In my eyes the barracks building with its three combined features to produce veteran units, heal damaged units in one turn and allowing the upgrading of units is the most overpowered building in Civ 3.

...
I second the idea that this would be a great feature.
 
Top Bottom