Another implementation worth explaining for later on, when we reuse it for Burgundians and Sicilians, and because it takes a while to unravel without help. Here we are going to look at the extra villagers or llama Chinese, Mayans and Incas get, and how the Tatar bonus is also an implementation of the first idea.
Since these bonuses are related to the town center, let’s look at it in the code. If you write “town center” in the filter box, you get 20 different units. There are actually 5 town center versions for each age, you can read this page to learn more about how it works. The unit that interests us is number 109, the dark age town center, the one where villagers and techs are created. If we scroll down to the “Annex units” section, bellow the resources we can see that unit 109 has four different annex units attached to it. The first three are parts of the town center (see the page cited above). The fourth one, “Empty TC annex”, unit 890 is the interesting one.
Let’s look at its stats. Right away we can see that it has no graphics, it’s invisible. Moreover, it has -1 hit points and, as the help says, this means it is an instantly dying unit. Therefore, every time you build a town center, you create this invisible unit that dies instantly. Moreover, this unit’s “Dead unit” is -1, meaning that, when it dies, it just disappears from the game without transforming into something else. Pretty absurd at first sight.
Back to the Units tab to check this new unit. It’s still an invisible unit that dies instantly but, if it’s responsible for creating the extra villager, it has to do something else. If we scroll down we can see three things:
Let’s look first at the unit, “Villager building”, number 1394. Again an invisible unit that dies instantly without triggering techs or having new annex units. However, its “Dead unit” has something: unit 1397, “Villager building2”.
“Villager building2” also dies instantly but now, its dead unit is an actual villager, unit 83.
Let’s recap what we have discovered. For normal civilizations, the town center has unit 890 attached to it, a useless unit that dies instantly. For Mayans, this unit is changed to unit 1398, which goes through several transformations:
Now, you may think that this code does several redundant steps and that it could achieve a similar thing with less units. That is true in part, unit 1398 could trigger tech 676 and die directly into unit 1397 without having to go through unit 1394. However, this is implemented this way as a copy of the Chinese bonus, which requires the extra process.
As with unit 1398 for Mayans, this unit triggers tech 552. The difference is in the annex units; whereas the Mayan version placed only one annex unit, the Chinese one places three copies of unit 1394, one for each new villager. From this point, the process is the same one: turning units 1394 into units 1397 and finally turning into villagers.
Effect 733, “Disable TC spawn extra” has only command: to upgrade unit 890, “Empty TC annex”, into 889, “Disable TC spawn”, which is basically a copy of unit 890. Recall that this effect happens once units 1394 or 1396 have died and placed the annex units. What this technology is doing is preventing the bonus to happen on extra town centers the player may start the match with. Since the game goes through the town centers sequentially, the first one it encounters creates extra villagers and deactivates it for any other town centers that may be already present.
Since these bonuses are related to the town center, let’s look at it in the code. If you write “town center” in the filter box, you get 20 different units. There are actually 5 town center versions for each age, you can read this page to learn more about how it works. The unit that interests us is number 109, the dark age town center, the one where villagers and techs are created. If we scroll down to the “Annex units” section, bellow the resources we can see that unit 109 has four different annex units attached to it. The first three are parts of the town center (see the page cited above). The fourth one, “Empty TC annex”, unit 890 is the interesting one.
Let’s look at its stats. Right away we can see that it has no graphics, it’s invisible. Moreover, it has -1 hit points and, as the help says, this means it is an instantly dying unit. Therefore, every time you build a town center, you create this invisible unit that dies instantly. Moreover, this unit’s “Dead unit” is -1, meaning that, when it dies, it just disappears from the game without transforming into something else. Pretty absurd at first sight.
Mayan bonus
Let’s try to find now how Mayans create the extra villager. Go to the Techs tab and filter with Civilization 16 to see the technologies only Mayans can research. There is a tech called “Start /w 4 villagers”, number 554. Let’s look at its effect, 586. It upgrades unit 890, the “Empty TC annex” from before to unit 1398, “Villager annex (Mayan)”.Back to the Units tab to check this new unit. It’s still an invisible unit that dies instantly but, if it’s responsible for creating the extra villager, it has to do something else. If we scroll down we can see three things:
- It initiates technology 552, “Disable TC spawn extra”.
- It has another annex unit attached to it, 1394, “Villager building”.
- Its “Dead unit” is still -1.
Let’s look first at the unit, “Villager building”, number 1394. Again an invisible unit that dies instantly without triggering techs or having new annex units. However, its “Dead unit” has something: unit 1397, “Villager building2”.
“Villager building2” also dies instantly but now, its dead unit is an actual villager, unit 83.
Let’s recap what we have discovered. For normal civilizations, the town center has unit 890 attached to it, a useless unit that dies instantly. For Mayans, this unit is changed to unit 1398, which goes through several transformations:
- It creates unit 1394 attached to it and triggers tech 552.
- Unit 1394 dies instantly and turns into unit 1397.
- Unit 1397 dies instantly and turns into a villager.
Now, you may think that this code does several redundant steps and that it could achieve a similar thing with less units. That is true in part, unit 1398 could trigger tech 676 and die directly into unit 1397 without having to go through unit 1394. However, this is implemented this way as a copy of the Chinese bonus, which requires the extra process.
Chinese bonus
Let’s look now at the chinese version to see why so many switches between units are needed. Go to the Techs tab and filter the chinese technologies, number 302, “Start /w 6 villagers”, is the one we care about. Its effect, 302, does something very similar to the Mayan one: it upgrades unit 890 to unit 1396, “Villager annex (Chinese)”.As with unit 1398 for Mayans, this unit triggers tech 552. The difference is in the annex units; whereas the Mayan version placed only one annex unit, the Chinese one places three copies of unit 1394, one for each new villager. From this point, the process is the same one: turning units 1394 into units 1397 and finally turning into villagers.
"Disable TC spawn" techs
Finally, let’s look at the technology the civilization bonuses trigger. Techs 552 produces effect 733.Effect 733, “Disable TC spawn extra” has only command: to upgrade unit 890, “Empty TC annex”, into 889, “Disable TC spawn”, which is basically a copy of unit 890. Recall that this effect happens once units 1394 or 1396 have died and placed the annex units. What this technology is doing is preventing the bonus to happen on extra town centers the player may start the match with. Since the game goes through the town centers sequentially, the first one it encounters creates extra villagers and deactivates it for any other town centers that may be already present.
Tatar’s extra sheep
The Tatar bonus follows the same ideas but has some variations, since it applies to newly constructed town centers after Castle Age. If we look at the tech that creates it, number 704, we see it requires Castle Age to activate. Its effect, 741, turns unit 890 into unit 1390, “Sheep annex 1”. This does not affect the initial town center as its unit 890 died at the beginning of the match. Unit 1390 goes through several transformations until turning into two sheeps with the difference that it doesn’t trigger the “Disable TC spawn” techs, as it should happen for all new town centers.
Last edited by a moderator: