Auto-translated
Yes, and the damage also depends on how developed the magic guild is (each level gives +1 to attack power).
So, each upgrade is considered a separate building.
I don't remember which castle is the best in terms of maximum development (it seems like Necropolis or Haven), but in general, it turns out to be about +46 archers in battle.
Once, an enemy was attacking my brother's castle. And he had very little money and almost no soldiers. I advised him to build a well. At first, he looked at me like I was an idiot. Then he came to the conclusion that it was the best investment of 500 gold!