Resource icon

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

@Flintlock
I have played with specialists for a while in the editor and I wish there were MORE options. I really liked civ4's concept of unique people specialists that joined the city as a super specialist. I'm not trying to copy civ4 but as a ruler it would feel more engaging if your servants could do more that just be there and could enforce your will in a more meaningful way.

Could anything be done to specialists to give them more depth such as:

Requirements:
-Require a resource available to the city to become available for hire.
-Require a building built in the city to become available for hire.
-Require a certain government to become available for hire.
-Require a certain unit to join the city to become available for hire.
-Require a certain specialist to be hired in the city to allow a unique unobtainable specialist.

Enhancements:
-Ability for specialist to provide food (1-?).
-Ability for specialist to provide or remove pollution (1-?).
-Ability for specialist to provide culture (1-?).
-Ability for specialist to provide a resource (1-?).
-Ability for specialist to upgrade to another specialist via research (Disabling the old one).
-Ability for a certain specialist to be consumed when a certain unit or building is built.
-Ability for AI to use vanilla specialists and modded ones as a result.


Limits:
-Limit how many of each kind can be hired per city (1-?).
-Limit how many of each kind can be hired per city based on resource amount (1 resource per specialist).
-Make specialists locked to their specialty.

With even a fraction of these options available one can accomplish so much through configuration!
 
Last edited:
ZergMazter, to your list about specialists the most important must be added:

The AI civs must be able to handle those additional specialists.

RAR has a handful of additional specialists, but the AI is in no case able to use them. So they are only a very big advantage and therefore a cheat for the human player. This is the reason why I had to cut them out in RARR.
 
ZergMazter, to your list about specialists the most important must be added:

The AI civs must be able to handle those additional specialists.

RAR has a handful of additional specialists, but the AI is in no case able to use them. So they are only a very big advantage and therefore a cheat for the human player. This is the reason why I had to cut them out in RARR.
Wait so if you create a "Better Entertainer" that produces 2 happy faces instead of 1 like the regular "Entertainer" the AI doesnt realize it's better? And Yes I'm gonna add that!
 
Wait so if you create a "Better Entertainer" that produces 2 happy faces instead of 1 like the regular "Entertainer" the AI doesnt realize it's better? And Yes I'm gonna add that!

Specialists.jpg
 
Last edited:
"Upgradeable" Specialists based on tech and/or buildings would indeed be very cool (I made a similar suggestion in one of the C7 threads a while ago), but the AI doesn't even understand when/how to use the 5 basic types that exist in unmodded C3C!

It is notorious for assigning far more Clowns than it needs to, firstly because it doesn't routinely use the Lux-slider, but also because it insists on eliminating all unhappiness -- instead of simply balancing the number of unhappy citizens against the number of happy citizens.

Similarly, even as it's wasting its tile-yields by turning all its unhappy citz into Specialists, it still doesn't assign them for maximum effect (e.g. preferentially using Clowns, even when it could 'afford' to have some of them become Geeks or Taxmen instead). And I have never seen a Governator using Cops or Engineers.

So I would suggest fixing some/all of those problems first, before creating new ones...
 
"Upgradeable" Specialists based on tech and/or buildings would indeed be very cool (I made a similar suggestion in one of the C7 threads a while ago), but the AI doesn't even understand when/how to use the 5 basic types that exist in unmodded C3C!

It is notorious for assigning far more Clowns than it needs to, firstly because it doesn't routinely use the Lux-slider, but also because it insists on eliminating all unhappiness -- instead of simply balancing the number of unhappy citizens against the number of happy citizens.

Similarly, even as it's wasting its tile-yields by turning all its unhappy citz into Specialists, it still doesn't assign them for maximum effect (e.g. preferentially using Clowns, even when it could 'afford' to have some of them become Geeks or Taxmen instead). And I have never seen a Governator using Cops or Engineers.

So I would suggest fixing some/all of those problems first, before creating new ones...
Personally even if imaking the AI able to use them properly was just too difficult it would still be worth it for making mods.

I remember one time I made a set of human only and AI only bonuses for my games. Whenever I gave an advantage to humans I would offset it by giving an AI only advantage that humans couldn't possess then I would balance it out.

An example of this is I made it possible for humans to load cruise missiles to fighter jets and gave jets the ability move around the map. Humans had their operational range shortened since they could move around the map loaded with missiles to both launch them and do missions. The AI had no clue how to use them so their advantage was they kept operational range, got their very own unmobile missile with flags that that manipulated them into loading missiles into jets to fly off somewhere and fire them then return home. Their jets also had more movements for such scenario since they would only run like that to fire cruise missiles and return home for jet missions.

Get what I mean? Even if we couldn't make the AI smarter we could somehow compensate while still allowing the human to have a richer experience. I personally would rather have a better human experience than worrying about the AI if it was just too dumb, but then find a way myself to make it more believable by giving them a bonus to offset the human player vie human only and AI only flavors.
 
Having specialists expire with techs would be great, yeah! While it wouldn't fix the AI issues for the most part (besides the basic entertainer going obsolete and the AI drifting to the next in list that hopefully just got unlocked), it would be a big boon for humans already, not having to cycle through obsolete specialist roles.

Another interesting thing for them would be to have their yields be affected by buildings such as markets and libraries. I find that in vanilla they are almost never worth the investment, the only exception being super high corruption (and no improving buildings) and really terrible tiles but still a lot of food - a rather rare occurence.

Edit: Do you think it'd be possible to configure the barbarian search radius that is at 6 by default with the diagonal fix on? Particularly for scenarios, a different value might be desirable (I realise that a larger value probably increases calculation time, but might be useful for some scenarios like with pirates or desert raiders). I personally would prefer a somewhat lower one like 2-3 so the barbs don't home in on your units from so far away.
 
Last edited:
Hi and thanks Flintlock for all your work!

I was trying to edit the config .ini file to make railroads work like fast roads, but it doesn't work. I set "true" and then a moltiplicator number (I tried with 2 and with 3), but it doesn't change nothing.

While other settings change work fine (No Raze, Stack Units)

Any idea?
Thanks!
 

Attachments

  • Screenshot (1183).png
    Screenshot (1183).png
    36.5 KB · Views: 14
I have played with specialists for a while in the editor and I wish there were MORE options. I really liked civ4's concept of unique people specialists that joined the city as a super specialist. I'm not trying to copy civ4 but as a ruler it would feel more engaging if your servants could do more that just be there and could enforce your will in a more meaningful way.
Could anything be done to specialists to give them more depth such as:
The code regarding specialists isn't very modular which makes this sort of thing more difficult than it otherwise would be. For example, there's no one function that determines if a given specialist type can be assigned in a given city, however the game does call a function each time it needs to know if a city's owner has the technology needed to unlock a specialist type. I could intercept those function calls to make specialists go obsolete and insert additional requirements, though there are two issues with that. First, I don't know everywhere specialists can be assigned, and second, I'd have to do something with specialists when they become obsolete.

Having specialists produce culture would be awkward because culture is calculated separately from the other yields, so I'd have to take care to make sure that whenever culture is recalculated, the specialist contribution is added in. And the other way around, whenever specialists change, the culture income would have to be adjusted too. Food should be easy since, based on what I've seen so far at least, the game always recomputes a city's food balance whenever anything related to specialists changes.

RAR has a handful of additional specialists, but the AI is in no case able to use them. So they are only a very big advantage and therefore a cheat for the human player. This is the reason why I had to cut them out in RARR.
Do you know if these problems with specialists apply to the human as well when using the AI governor? I've found the game's method to manage city happiness under the control of a governor, and it looks like it tries to assign whichever specialist type gives the most happiness when adding specialists to fix happiness. I don't know whether or not that method is what the AI uses to manage its cities, though I can see that it checks whether the city is owned by an AI player or not, which suggests that it is at least sometimes called for the AI.

Edit: Do you think it'd be possible to configure the barbarian search radius that is at 6 by default with the diagonal fix on? Particularly for scenarios, a different value might be desirable (I realise that a larger value probably increases calculation time, but might be useful for some scenarios like with pirates or desert raiders). I personally would prefer a somewhat lower one like 2-3 so the barbs don't home in on your units from so far away.
Yes, that would just be a matter of editing the limit on the number of tiles that the barb unit AI checks around itself. The only challenge is I don't have a formula for the number of tiles within a given radius and I've never seen one in the game logic, either, so I'd either have to figure it out or hardcode a list up to a radius of 10 or so. (That's what I did for the configurable work area.)

Hi and thanks Flintlock for all your work!
I was trying to edit the config .ini file to make railroads work like fast roads, but it doesn't work. I set "true" and then a moltiplicator number (I tried with 2 and with 3), but it doesn't change nothing.
Hi, glad you're enjoying it! The limit_railroad_movement setting isn't a multiplier, it's the number of tiles you can move along a railroad. So set it to 6 with the fast roads setting on if you want railroads to work like double speed standard roads.
 
Flintlock updated C3X with a new update entry:

Release 23

New in this version:
- Include AMB editor
- Option to throttle AI's expansion by temporarily applying perfume to settlers each time it founds a city
--- Controlled by two settings named ai_settler_perfume_on_founding(_duration)
- Disallow trespassing setting kicks trespassers out of each player's territory at the start of their turn and after signing peace
- Option to block the galley chaining exploit by preventing units from loading into two different transports on the same turn
--- Option...

Read the rest of this update entry...



Edit: I decided not to bother with a third preview version of R23. Here's the full list of changes from R22:
  • Include AMB editor
  • Option to throttle AI's expansion by temporarily applying perfume to settlers each time it founds a city
    • Controlled by two settings named ai_settler_perfume_on_founding(_duration)
  • Disallow trespassing setting kicks trespassers out of each player's territory at the start of their turn and after signing peace
  • Option to block the galley chaining exploit by preventing units from loading into two different transports on the same turn
    • Option named limit_unit_loading_to_one_transport_per_turn
  • Adjustable rebase range as multiple of operational range, setting named rebase_range_multiplier
  • Option not to draw capital cities larger than they really are, named do_not_make_capital_cities_appear_larger
  • Fix division by zero in AI logic to evaluate proposed alliances
  • Fix possible crash when unit performing stack bombard is destroyed
  • Prevent airdrops from violating the trespassing restriction
  • Fix city screen zooming out for adjacent tiles that aren't actually workable due to maximum work radius
  • Fix empty army movement
 
Last edited:
Hi, glad you're enjoying it! The limit_railroad_movement setting isn't a multiplier, it's the number of tiles you can move along a railroad. So set it to 6 with the fast roads setting on if you want railroads to work like double speed standard roads.
Even if the number is 6 or 10, the moviment is unlimited as in original game

Nevertheless the code line seems clear:

"limit_railroad_movement = 6"
"limited_railroads_work_like_fast_roads = true"
 
Even if the number is 6 or 10, the moviment is unlimited as in original game
Nevertheless the code line seems clear:
"limit_railroad_movement = 6"
"limited_railroads_work_like_fast_roads = true"
Are you sure that config is getting loaded? Could you have another config file that's overwriting those settings?
 
Are you sure that config is getting loaded? Could you have another config file that's overwriting those settings?
Solved! I use CCM mod, and in that folder there was another config file in which it was written
limit_railroad_movement = false

Thank you!
 
I don't know of any really easy way to do that. The easiest would probably be to edit the rules so that harbors and airports don't allow sea/air trade. As EPW pointed out, you can do that without losing the map icons as long as you have the city_icons_show_unit_effects_not_trade C3X setting turned on.


By far the slowest part of recomputing trade networks is searching for connections between cities with harbors. That's because that involves the pathfinder and has to be done for each pair of harbor cities. Recomputing the road networks also involves the pathfinder but it's an operation that's done once per road network, not per city, so when you have 512 cities it's negligible compared with the sea trade calculations. In my testing on the Monstrosity map, computing road networks took much less than 1% the overall turn time.

The less water the better because it means the pathfinder has fewer tiles to check while searching for a path. I don't think it's an exaggeration to say computing sea trade would be 1000x times faster for a city on a 10 tile lake compared to one on a 10000 tile ocean.

Computing airport connections would take almost no time since it doesn't involve pathfinding at all, though I haven't bothered to measure it. Multiple airports in the same city would not make any difference compared to having only one. Adding airports could even speed up the overall trade network calculation if the airports connect cities that otherwise would have been connected by harbors. That's because the calculations first check if two cities are connected by road or air before searching for a connection by water. The trade network calculations are pretty inefficient but not completely stupid.

By the way, if you want some hard numbers, C3X has a feature that times the trade network computation and overall interturn time. It's something I added while working on Trade Net X. The option is named measure_turn_times.


Units with a transport capacity > 0 will never stack, I don't suppose those tanks are modded to be able to carry units? That would explain it, otherwise I have no idea. In my own testing, I've never seen unit stacking not work properly.


I'm reluctant to add things like this because they'd be perfect for little Lua scripts. All you really need is a little function that rules out build options based on the state of the city: the presence or absence of buildings and resources. Splitting that out over many different config variables is a much uglier way of making it work. I realize that Lua is still a long way off so maybe I'll add this kind of thing anyway, but it'll be for R24 at the earliest since I've already decided what will be the final things for R23.


Not that I know of. I've never looked at that part of the code, but it doesn't sound difficult.


The big problem with this (I'm guessing you're asking for Civ 2 style movement) would be the pathfinder. I don't think it would be feasible to modify the pathfinder to handle that kind of movement rule. The only option would be to replace the whole thing which would be a huge job.


Alright, I got it, thanks. I'll look into this sometime in the next few days.


Right off hand, I don't see any reason it wouldn't be feasible. It might mess with armies, but it shouldn't be a problem to carve out an exception just for them. The game already does something similar to this where armies take up more space in transports than single units (under the hood an army is a single unit with its own passengers), so that's another indication that it's possible.
``I'm reluctant to add things like this because they'd be perfect for little Lua scripts. All you really need is a little function that rules out build options based on the state of the city: the presence or absence of buildings and resources. Splitting that out over many different config variables is a much uglier way of making it work. I realize that Lua is still a long way off so maybe I'll add this kind of thing anyway, but it'll be for R24 at the earliest since I've already decided what will be the final things for R23.``

That would be great to have such an option to block a building if a resource or another building already exists; I don't mind the way it is done, as soon as it brings that; Another thing that I really need is a resource prerequisite for a Tech; both these, combined with the already existing option for buildings to generate resources, will open up endless creative modding possibilities; In my mod I try to implement a one time choice - 1 building from possible 4, and once build, the other 3 possibilities to disappear; Otherwise the AI goes into endless looping between these :) Many thanks in advance, for all future updates
 
I've encountered an eternal-freeze bug. Happens reliably when ending the turn on an autosave, but also when loading the autosave prior and then ending turns twice. However, it is on a rather modded game (Rhye's of Civilization with heavy adjustments). Do you want to take a look at it, Flintlock? I can zip up the files in that case. (Appeared in a game started in R22, but also exists in R23)

Separate question: Is it possible to give something both a flat and a percentage perfume? Like +50 flat and +200%.

Lastly, I'm pretty sure units can upgrade beyond an "obsoleted" barrier. For example, say cavalry is obsoleted by tanks (upgrades to, but does not have the upgrade ability), and I have leftover knights, then while I wouldn't be able to upgrade cavalry to tanks, I can still upgrade knights to tanks since they jump across the step of cavalry that would lack the upgrade ability that knights still have. Sounds like something that might be cumbersome to fix, though, with checking through the entire upgrade chain required.
Ideally, in the situation that you have knights, but also unlocked cavalry and tanks, knights would still be upgradeable to cavalry even though the cavalry itself has been superseded by tanks.

Edit: I actually had another idea. I often see the AI spam single cities across the entire map (desperate to settle in even the worst places when the nearby area is full). Do you think the AI tile evaluation for cities could be modified so that it will only found cities that are either connected to its culture (meaning culture area +2 or 3 tiles since that'll then auto-connect on city founding), or on the coast? Basically preventing lonely landlocked cities that really do the AI no good, but absolutely still allowing distant coastal settlements (and of course it can spread inland from here via the new culture).

Edit 2: The reduced settler production rating after city founding is really nice in my first tests, thanks for the great update! :)
 
Last edited:
I've encountered an eternal-freeze bug. Happens reliably when ending the turn on an autosave, but also when loading the autosave prior and then ending turns twice. However, it is on a rather modded game (Rhye's of Civilization with heavy adjustments). Do you want to take a look at it, Flintlock? I can zip up the files in that case. (Appeared in a game started in R22, but also exists in R23)
Yes, definitely. Fixing bugs is always a priority, doubly so for game stopping ones.

Separate question: Is it possible to give something both a flat and a percentage perfume? Like +50 flat and +200%.
Not at the moment. Right now perfume can only be specified as one or the other and if you specify perfume twice for the same item, the second amount will overwrite the first. It's possible to program in what you're asking for, of course, but again I'd rather jump to the ultimate form of this kind of thing, which is allowing a Lua script to modify AI evaluations.

Lastly, I'm pretty sure units can upgrade beyond an "obsoleted" barrier. ... Sounds like something that might be cumbersome to fix, though, with checking through the entire upgrade chain required.
I'll look into this. It may not be cumbersome, the game has a method I've named City::get_upgraded_type_id, which determines the upgraded type, and if there is one, of a given unit type in a given city. It's pretty simple so I would be able to reimplement the whole thing to work differently if needed.

Edit: I actually had another idea. I often see the AI spam single cities across the entire map (desperate to settle in even the worst places when the nearby area is full). Do you think the AI tile evaluation for cities could be modified so that it will only found cities that are either connected to its culture (meaning culture area +2 or 3 tiles since that'll then auto-connect on city founding), or on the coast?
Sure, and again, wouldn't it be nice if the game called out to a Lua function to evaluate potential AI city locations? That would make this sort of thing so much easier.
 
Yes, definitely. Fixing bugs is always a priority, doubly so for game stopping ones.
Sent you a direct message :) Thanks for looking at it!

Not at the moment. Right now perfume can only be specified as one or the other and if you specify perfume twice for the same item, the second amount will overwrite the first. It's possible to program in what you're asking for, of course, but again I'd rather jump to the ultimate form of this kind of thing, which is allowing a Lua script to modify AI evaluations.
Ok, no problem. Was just curious :)
I'll look into this. It may not be cumbersome, the game has a method I've named City::get_upgraded_type_id, which determines the upgraded type, and if there is one, of a given unit type in a given city. It's pretty simple so I would be able to reimplement the whole thing to work differently if needed.
Thanks!
Sure, and again, wouldn't it be nice if the game called out to a Lua function to evaluate potential AI city locations? That would make this sort of thing so much easier.
Hehe, all hail lord lady Lua! :P Btw, what is it that makes this language so suitable for these applications compared to say python?
 
Last edited:
I want to enable the sacrifice option in my scenario at the earliest stage of the game, but I found 1 major and 2 minor problems:

1) It is impossible to disable it later. It just need to uncheck this box when researching a technology (like a monotheism for example), but the editor lets only to turn it on.

2) For some reason, if a unit (for example, a worker) does not have the sacrifice option enabled, the AI can still sacrifice it when researching the necessary technology, but you cannot.

3) I still do not understand the principle of culture points adding after the sacrifice. It would be logical if it depended on the religious type of civilization, but tests showed that there is no such connection.

P.S. The AI is surprisingly good at sacrifice. If it captured several workers, it will direct one to culture (sacrifice), and add the others to the city's population, so that later it can speed up production at their expense.
It's strange that this interesting feature was almost forgotten. Sacrifices were common practice in human history a long time ago and they could have enlivened the cultural aspect of the game at its very beginning.
 
I use it in the Modern period for Guerrilla units who spawn from victories against enemies by Militia units.

As a workaround for disabling sacrifice later in the game, try making two separate units: Forced Laborer (unit produced by capturing pop), which upgrades to Gladiator. Forced Laborer can't be sacrificed, but Gladiator can. If you tag Gladiator as a King unit, you won't be able to build it, only upgrade to it.
 
Back
Top Bottom