plugging "leak" of units in vanilla?

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
Here is a screenshot of the statistics screen from a pure vanilla bts game I played recently. How can units disappear without being killed or lost? There are 8 archers currently, but 11 were built and none were lost or killed. The missionaries and settlers are fine; they "leak" because they are destroyed in spreading religion or founding cities.

attachment.php


Is there some way a unit can be deleted without showing up in the killed or lost column? This screenshot shows 3 archers leaked, and one swordsman leaked. I have tried to track this in the sdk code. There are many places where pUnit->kill() is called, such as when disbanding units. But CvUnit::kill calls the log function and also calls the python onUnitKilled event. So these calls are not "leaking" units.

I am concerned about this, because in Dune Wars, I have a "Mentat" city governor unit which is being leaked at a high rate, and I cannot figure out how they are disappearing. I autoplay 100 turns and look in the stats. For one duel game, there were 12 built by one team and 7 built by the other, but there were zero of them anywhere on the map. So 19 were "leaked" in 100 turns.

If I can find why this is happening in vanilla, perhaps it will give me a lead on my vanishing Mentats. More detail on mentats in this thread.
 

Attachments

  • unit-leak.gif
    unit-leak.gif
    45.6 KB · Views: 172
I always assumed these were units that had been upgraded.
 
You gave me hope for a few minutes. I learned more but I am still stuck.

You are definitely right that upgrades would account for some leaked units. Also, I have studied the statistics tab more, and I misunderstood it. The "killed" column does not show how many of your units have been killed, it shows how many you have killed yourself. For example, most players have killed a few animals, which they clearly did not build.

Still, I can see units leaking which are not due to upgrades. In another game, not the one from the screenshot, one player had 2 axemen current, and 3 built. None of the other players, including barbarian, had any axemen listed as killed. The only upgrade of axeman is maceman, and no players had any macemen. I suppose one unit could have been gifted, but I can't find any extra axemen for the other players.

It may be that these leaked units are a tangent, but I am stuck trying to figure out where my mentats are going. They don't upgrade to anything and I'm losing one every five turns.

Can anybody suggest other possible experiments?
 
I checked that; when the AI disbands a unit, it calls pUnit->kill, which calls the onUnitKilled python function; and the missing units are not showing up with onUnitKilled. Whatever is deleting the unit is not using pUnit->kill.
 
Gifting?
Deleting via worldbuilder?

Thanks for the suggestions. I am running duel games, and I look at the current, built, killed and lost for both players and barbarian. If gifted, they would show up in the total of the other player, but they aren't.

I would know if I were deleting them in WB.
 
Could you just watch it turn by turn? If not, set autosave interval to 1, and watch every 5 or 10 turns instead. And when you spot the discrepency, you can go back through fewer autosaves...
 
Back
Top Bottom