These details are CRITICAL; DO NOT skip them or your issue may not be reviewed.
**GAME BUILD #: 78174
**GAME PLATFORM: Steam
**OPERATING SYSTEM: Windows 11 Home
In the scenario i have attached, i have placed a trigger which deactivates villager production when a player has 50 villagers.
The trigger is named “p1 vill disable” and is located at the bottom of the triggers list
The condition is “own objects” for villager (male) and quantity of 50
and the effect is Enable/Disable objects : villager (male)
The issue is that this trigger is activating inconsistently. In one test it won’t activate at all, in another it will activate when the player has 110 villagers, in another when he has 55 etc, with no changes to the map in between. So far it has never activated on 50 villagers, which make me believe that there must be a bug when counting villager numbers.
I have used the same trigger to limit fishing ships and trade carts, and it has worked normally
FREQUENCY OF ISSUE
How often does the issue occur? CHOSE ONE; DELETE THE REST!
100% of the time / matches I play (ALWAYS)
List CLEAR and DETAILED STEPS we can take to reproduce the issue ourselves… Be descriptive!
Here’s the steps to reproduce the issue:
Test the scenario
Build villagers until you cannot anymore
What was SUPPOSED to happen if the bug you encountered were not present?
Normally when the player reaches 50 villagers, any further production of them should be disabled
ALWAYS attach a PICTURE (.jpg, .png, .gif) or VIDEO (.mp4, YouTube link) that highlights the problem.
I just ran the test, it worked just fine as long as you don’t (or the AI) task the created villagers.
What is causing the issue is that Tasked villagers (i.e. “lumberjack”, “farmer”, “gold miner” etc.) are not accounted in the calculation of the condition. So everytime the condition checks for the said number of Villagers, it will ONLY count the untasked villagers who still display the name “Villager”.
So if you have, say, 100 villagers total, but 80 of these are tasked and are lumberjacks, farmers or whatnot, it means that the condition will understand you still only have 20 Villagers, and thus still lacking 30 to trigger the effects.
That is not working properly indeed and should be fixed.
This is not a bug. The trigger does what it says it does.
What you want to do is go to “Own Objects,” set “Object Group” and/or “Object Type” to “Civilian” without choosing “villager” or any other specific unit on the object list. This covers all male and female villagers performing any possible task, and doesn’t include ships or carts.
That wouldn’t work since “Civilian” does include other unit types than Villagers only, namely Trade units (carts and cogs alike), fishing ships or even herdables… I just ran the test just to be sure, all trade units are counted as “Civilians” and herdables too.
Sorry, I phrased it slightly incorrectly the first time going from memory. Although if you’d done both it would have worked.
What you need is the “Object Group” to be set to civilian (with or without selecting an “object type”). Then it does what I described earlier.
Again though, this is not a bug. Object List is for selecting a specific unit, or “form of a unit” in the case of villagers. Which makes it useful because you could, e.g. have a trigger that conscripts only male villagers, or provide some economic reward for having X Farmers or Gold Miners.
Object type is very for broad classes and object group is for fairly specific (but still broad in the case of “villager”) classes. You’ll notice “Trade Boat,” “Trade Cart,” and “Fishing Boat” appearing in their own categories there.
Edit: The only game change I would recommend that’s related to this discussion is for the “Object Group” category of “Civilian” to be renamed to “Villager,” since it has a more exclusive meaning than the more intuitive “Object Type” usage of “Civilian.”
I tested it and you’re correct. I never had to use a “villager count condition” of any sort so far so the problem never rose to me before. But yeah, I was sure the “civilian” from Object Type and Object Group was the very same. It should indeed be renamed to “Villagers” for clarity sake I guess.
But yes: putting Civilian in Object Group only counts villagers (tasked or not) like you said and thus the issue is settled.