• Play your daily rated matches of Black Forest on Community Patch 1.6 RC and win a Voobly premium membership.     [ More Information ]

Keshiks generating gold




This feature from Definitive Edition was added very late because we couldn’t copy the implementation done in the original game due to limitations on the user patch. Originally it was adapted to “Keshiks return gold when they die” and this is the base for the implementation we finally got. The credit of this idea goes to GorLeon.

Madrasah​

Madrasah is the saracen unique tech that makes monks return gold when they die. Let’s see how it works. If we filter technologies through civilization 9 we find Madrasah is number 490 with effect 545. Its only relevant command is the first one, upgrade unit 134 into unit 936. These two units are monk corpses that stay in the ground and disapear after a while. Their only difference is in the resource storages. Both of them have type 12, “Corpse Decay Time”, a counter for how long the corpse stays. The one that appears with Madrasah also has 33 units of “Gold Storage” on “Store mode” 1 which, as the description says, is stored in the bank even after the unit disapears (contrary to the way houses give population space and remove it when destroyed). This means that saracen monks die into a unit that, upon apearing, generates a one-time payment to the palyer.

Adaptation to Keshiks​

The idea now is to have a way to create a unit every time the Keshik attacks, it can have -1 hit points and die instantly, that generates a small amount of gold. There is actually a way to have a unit like that: arrows. Every time an archer shoots, it creates an arrow object that has its own unit number.

If we look at the Keshik, unit 1253, we can see that it deals normal melee damage but actually shoots unit 1257 “keshik proy”. As the description on the “Secondary Proyectile Unit” hints at, the first arrow a unit fires uses the unit stats and only secondary arrows use their own stats. Therefore, we do not have to worry about the Keshik dealing anything but melee damage even if it’s shooting arrows.

Let’s look now at the arrow itself, unit 1257. There is nothing relevan to see on its stats since it is fired from zero distance so all the proyectile stats are irrelevant. The important thing is that it generates 0.7 gold when appearing. This value is derived from this page, where it is explained that Keshiks generate 0.7 gold per attack.

That’s it, every time the Keshik attacks, it shoots an arrow that, when appearing, generates a bit of gold. You may have noticed that this introduces a bug: Keshiks now generate gold also when attacking buildings, something they do not in Definitive Edition. We decided to leave it like this as the gold generation is very small to really be worth ignoring the enemy units and just attack buildings but we like to have the ability on Keshiks.
 
Back
Top Bottom