AI Not building workers [3.14.1]

The AI gets free workers on Immortal and Diety. I don't believe we can modify the AI worker build order with this mod (needs a DLL mod). The Build_Flavors table we generated is for tooltip purposes.
 
OK, I know I am a bit of a noob for this, but I have to say it:

BEHOLD THE POWER OF FIRETUNER! :bowdown:

Wow, that was so cool being able to watch god-like as all is revealed during these turns. Quite the show being on a long conference call while seeing the civs doing their thing across a huge communitas map every time I looked into my office.

That being said, am on a PC, and yes, still using the mods listed in the OP for 250 turns - long enough to get a sense of who is improving, and who is "lazy". Used the stackpointer modifications.

So far, 9 out of 12 civs belong to the no worker club, and only one CS out of 24, Singapore, has a worker built. All have healthy militaries, have invested in one or 2 wonders (some in progress based on map), and the average number of cities is 3: Attila has one, and Ethiopia leads with 4. All improvement civs had all strategic and luxury tiles improved, and were starting on the secondaries (deer, etc.)

Improvement Civs:

Carthage, the Huns, and England (w/ 2 workers from Liberty).

No Workers:

Japan, Maya, Ethiopia (game leader), Morocco, Babylon, Greece, Persia, Indonesia, and Egypt.

Everyone (including CS's) with sea resources had workboats, except for Maya with unimproved pearls in the capital.

Will run a CEP-only game overnight for comparison and post tomorrow.

- Erikose
 
If it hasn't been made clear yet, could you do any testing with ONLY CEP in your mod lists.
This way we can get a baseline of what you are seeing. Then add back your other mods.

Ran game overnight at same settings (all but the github changes) and CEP only. Turn 250, average 3 cities - 4 for leader - and no CS and only Korea and India have workers, and only the ones they started with. Like before, strategic and luxuries improved, and other tiles just starting. Korea even has unexploited wheat tile in capitol, and they have farms as part of the UA!

Going to start a new game with the above changes to the leader flavor file, and the github changes to buildings and units files.

@stackpointer, github question: when looking at the two changes, one for each file, it is a little difficult to figure out what the differences are until I expand the whole file and compare side by side (notepad and github). For instance, in the first edit, only one line is highlighted as green, although 10 lines, including the parentheses, are being added. Have to adjust the tabs again as notepad does not paste them in as written. When modifying the second file, it is much easier to see that only one line is being changed. I don't mind relying on my Mark I eyeball/brain to figure that out, but is there an easier way to bring those changes into your exiting file, especially as some of the commits are more complicated? This visual confusion is what stops me from playing with any of the commits that I see.

- Erikose
 
The mod creates a new table, Build_Flavors, which assigns values to the various improvements available to each civ. Ostensibly this is used to determine which tile gets what improvement. The values are outlined in CEAI_WorkerBuilds.xml.

I can't though figure out how or where these values are 'actually' being used!:scan:

Another area we might need to look at is the Resource_Flavors table.
In vanilla every resource is just given a flat value of 10. We do some major adjusting and have values from 2 -- 20. It may be possible some values here are making decisions difficult.

Curiously wheat, as pointed out by Erikose and also noted by myself, has a better FLAVOR_GROWTH value in CEP than vanilla yet doesn't get improved.:confused:

Still, in my setup, just the stock standard 3.14.1 version. I see no problem with the workers. All the civs seem to be improving the tiles that need it. Floodplains have farms, grasslands mostly have villages/trading posts, hills sometimes have mines and the resource tiles all get the appropriate improvement. (except wheat)
 
Hello,

I am going to test a game with the following changes:
Spoiler :
UPDATE Leader_Flavors
SET Flavor = Flavor - 2
WHERE FlavorType = 'FLAVOR_OFFENSE';

UPDATE Leader_Flavors
SET Flavor = Flavor - 2
WHERE FlavorType = 'FLAVOR_DEFENSE';

UPDATE Leader_Flavors
SET Flavor = Flavor - 2
WHERE FlavorType = 'FLAVOR_WONDER';

UPDATE Leader_Flavors
SET Flavor = Flavor + 2
WHERE FlavorType = 'FLAVOR_TILE_IMPROVEMENT';


CEP only with standard game settings.

On a side note, are the vanguard flavors in the CEP_LeaderFlavors.sql supposed to be commented out?

EDIT: I played about 75 turns and the fix worked. I was skeptical when I didn't notice any worker improvements being built. At first only the liberty civs had improvements from the free workers. Then my warlike neighbor Suleiman started improving his luxuries (did not take liberty). The AIs did seem to be improving their land fairly late however, so maybe we can bump up the improvement flavor by +3 as opposed to the +2 I did in the fix. Wonders were still built, and military units were still built.
Great fix!
 
On a side note, are the vanguard flavors in the CEP_LeaderFlavors.sql supposed to be commented out?

Yes that flavor is no longer used. Added by us in a previous version and removed again.
The spreadsheet used to generate the file still has that listed and will be updated.
 
Expired, the Build_Flavors table is not used for any AI purposes. It's only used for the tooltip good for values.
 
@stackpointer, github question: when looking at the two changes, one for each file, it is a little difficult to figure out what the differences are until I expand the whole file and compare side by side (notepad and github). For instance, in the first edit, only one line is highlighted as green, although 10 lines, including the parentheses, are being added. Have to adjust the tabs again as notepad does not paste them in as written. When modifying the second file, it is much easier to see that only one line is being changed. I don't mind relying on my Mark I eyeball/brain to figure that out, but is there an easier way to bring those changes into your exiting file, especially as some of the commits are more complicated? This visual confusion is what stops me from playing with any of the commits that I see.

- Erikose

If you are having trouble with the GitHub interface then you can actually download the file in question by clicking on the file (View) and then clicking on Raw. Other methods include building your own branch or using the notepad++ to jump to the specified lines.


Hello,

I am going to test a game with the following changes:
Spoiler :
UPDATE Leader_Flavors
SET Flavor = Flavor - 2
WHERE FlavorType = 'FLAVOR_OFFENSE';

UPDATE Leader_Flavors
SET Flavor = Flavor - 2
WHERE FlavorType = 'FLAVOR_DEFENSE';

UPDATE Leader_Flavors
SET Flavor = Flavor - 2
WHERE FlavorType = 'FLAVOR_WONDER';

UPDATE Leader_Flavors
SET Flavor = Flavor + 2
WHERE FlavorType = 'FLAVOR_TILE_IMPROVEMENT';


CEP only with standard game settings.

Could you try replacing this file instead? https://raw.github.com/Thalassicus/...c3bc745ad9a/Ceg/Ceg/AI/Flavors/CEAI_Units.sql

Save it to replace the file at: CEG/AI/Flavors/CEAI_Units.sql
 
Thinking a bit more on that table.

If all it does is show values in the tooltip, then it is next to useless!
Those values don't actually mean anything to the player, he would make his choice on what to build regardless. In much the same way as the advisors recommendations can be completely ignored.

So if the AI don't use them, and we can safely ignore them, why are we providing them.

Unless it is in preparation for a yet to be implemented feature?
 
It's a tooltip feature and if the player does not find them useful then they can be turned off if so desired like the rest of the good for values.
 
Yeah I understand 'How' it is used. I am questioning 'Why' it is used.

e.g.

You show a tooltip over your unit and it gives you accurate details about, strength, range, terrain bonuses, promotions and the like. That is useful to determining how that unit will be used.

You show tooltip info for a tile needing a plantation, for example, and it gives you values for Growth, Gold, Expansion or whatever. This is useful for nothing as the AI doesn't view it that way and the values displayed are arbitrary.
Additionally plantations apply to more than one type of resource and they have different values for different resources. Even more confusing we have set up a Yield_Flavors table that then gives flavors to the yields provided by those resources, yet they are all the same value! This table is, as far as I can tell, only used as an aid in setting up other tables. Why, when the values are all the same is beyond me.
(needlessly venting comments that don't serve to aid the discussion):D

Now if the tooltip showed the values from the Resource_Flavors table that at least would provide an indication of how the AI might view that tile and might be of some use.
 
Thanks, stackpointer. The raw feature will definitely make it easier to test and incorporate individual changes.

@SlothACID, what is your game speed and where does 75 turns take you? On Marathon, I notice some improvement with the above changes, but not until much later than usual. 300 turns takes me about midway through the classical era, 500 BC, BTW. No coincidence that marathon players notice this first as we go this many turns with no one to trade luxuries with, even CSs!

Here are the results of this game at turn 300:

7 CS now have workers and improving, while 4 civs, as opposed to 3 last time, are improving, one of them being India and the other 3 going Liberty. Civ sizes are ranging between one and 5 cities at this point.

Going to run this for another 200 turns and see where we are then. 500 turns seems to be more than adequate, even on marathon/king/huge, to see what impact the changes had. Remember, I originally saw almost no improvements even after astronomy! The presence, or lack thereof, of barbarians seems to make no difference as far as I can see.

Let me know if you want more detail on the civs/CSs involved, ExpiredReign, and am happy to upload saves as well.

- Erikose
 
Spoiler :
@SlothACID, what is your game speed and where does 75 turns take you? On Marathon, I notice some improvement with the above changes, but not until much later than usual. 300 turns takes me about midway through the classical era, 500 BC, BTW. No coincidence that marathon players notice this first as we go this many turns with no one to trade luxuries with, even CSs!


The game settings for my first test were Small, Pangaea, Standard Speed, 6 Random Civs myself included. AIs included China, Maya, France, Ottomans, Celts. I rolled Portugal. I dedicated my hammers into scouts and boats and took social policies to get a free settler and the reveal all CS in Patronage. I beelined Optics and Currency for the fast naval exploration and open borders. I wasn't trying to win; I was only trying to keep an eye on the AIs performance. 75 turns took me roughly to open borders, I did not need them to check all the civs considering my scout spam. I used the "Global Politics" tab within the Diplomacy window to check which civs took perks in Liberty and deduced that only china had taken free workers initially. This raised a flag for me, then sent scouts to the other liberty civ's borders (Celts), they had not taken free workers, but eventually (turn 60ish) started to improve their tiles. The other civs began improving tiles around the same time. I never built a single worker. Mind that this paragraph is with the flavor adjustments originally suggested by stackpointer.

I will get around to testing the second set of changes either today or sometime next week. I have been using this mod since it was Thal's combined balance and have lurked this forum. I love it, and want to contribute so I may continue to play Civ V.
 
As a non-coder, it seems to me that improvement flavor values might not be the right place to look; it wouldn't surprise me if unit construction decisions on whether to build workers vs units or buildings might be totally separate from what to do with the worker once you have them.

It seems that increasing building or military flavors might have ended up leaving workers to be too low down on the priority list?
 
@Ahriman

I agree with your hunch. If anyone has an idea of where to look, I will check it out. Also any additional information on how CEP modifies the vanilla game will help me understand where to look. I am adamant about contributing to this project and any help you give me will ultimately help CEP, I hope.

Off-topic?: I'm a non-coder but I am starting to learn. I started with the free elementary classes provided by code.org. And Am making a platformer using Game Maker Studio provided free on Steam.
 
I am starting a test game with the following changes.
I did a clean manual install of CEP and modified the following file.


Mods: CEP, In-game Editor, Quick Turns.

Settings: Emperor (6), Standard Speed, Standard map size, Continents Plus, 8 major civs self-included, 16 minor civs (CS). BARBARIANS OFF.
Manually set AIs to be: Zulu, Huns, India, Korea, Random x3. This is to separate civs that start with a worker, warmongers, and 3 random civs. I will be playing as America for the sight bonus, which in turn might reduce the amount of time spent using IGE to "spy" on other civs.

I'll play normally but with no intent of a victory. I'll use IGE to observe the AIs on turns 25, 50, and 100. My reasoning is that by turn 100 on standard speed the AIs should have roads and improved tiles. Will edit as I go.

EDIT:
Turn 25:
Spoiler :
Greece: has worker, liberty + free gold policy, but no free worker from liberty. worker is building a farm.

Huns: has worker, liberty, no free workers from liberty. worker seems to be improving a luxury.

India: started with a worker, has 2-3 farms and worker is building a mine. took honor.

Brazil: has a worker currently making a farm. took honor.

Siam: Worker will be done in 5 turns. Liberty opener.

Korea: Started with free worker. has camps and a worker building a pasture. took honor.

Zulus: Honor opener, no worker, currently constructing Heroic epic.


Turn 53:
Spoiler :
Greece: 1 worker, capitol almost done improving, recently founded 2nd city, amassing an army.

Huns: Same description as Greece.

India: 2 cities, cap is almost done improving, building UB and a wonder.

Brazil: 2 cities, cap almost done, building defense units.

Siam: 1 city, a settler en route to a city spot, few units, building a spearman. I suspect Attila is going to crush Siam soon.

Korea: on its own land mass, 1 city, settler en route, capital almost done, building infrastructure.
Zulus: 3 cities, 1 worker, capital half improved, worker is in 3rd city mining iron.

Note: Many AIs have lots of plantation luxuries nearby and did not tech calendar, however other non-calendar luxes were also nearby. With the exception of Greece, who has only plantation lux and NO calendar.


Turn 78:
Spoiler :
As I suspected Attila conquered Siam. Rammy is no more


Turn 101:
Spoiler :
Greece: Road from Athens to Sparta! Luxuries improved, building units for war with the Huns.

Huns: Road from Attila's Court to city 2! building HE and units for war with Alexander.

India: Road from Delhi to Mumbai! Land is developed, with workers chopping jungles for bananas.

Brazil: 3 cities, nearest one and capital are connected, 2 workers constructing a road to other city. All lux are improved most but not all bonus's are improved.

Korea: 2 cities connected by a road. only 1 worker. All lux improved, 1 camp out of 3 deer, 0 quarries out of 2 stone, 1 unimproved fish, but there are 3 improved whales.

Zulus: Land is almost all improved, no roads, no calendar nor writing, has 1 plantation lux, has -2 unhappy, Beelined metal casting for UU.


Overall the unit flavor fix seems to have worked. Based on this experiment and my previous experiment with AI Leader Flavors, I think that both changes may be necessary in order to have the AI improve their land competitively. I propose that the leader unit flavors change plus a slight tweak in Leader Flavor for tile improvement be implemented.
There are some quirks when it comes to AI teching, but that was not the focus of this experiment. Please comment with concerns or improvements to my method.
 
FLAVOR_TILE_IMPROVEMENT is the only flavor that workers have and I'm not sure what other factors are taken into account other than the flavor values.
 
Thanks for all your testing SlothACID. It's likely that the Pottery -> Calendar tech path may need to be adjusted so the AI prioritize it more since plantations are pretty common on the Communitas mapscript.
 
Back
Top Bottom