These are the buildings inside your castle:

Building Unlocked after Cost Functions
Keep available at start n/a The heart and soul of the land. Heals your hero while behind the castle walls.
Gold Mine available at start Base Values: 15, 50, 85, then 120 for each mine after that. Automatically built on gold quarries, mines increase the rate that you recieve gold in battle. You may have up to 7 at once. The final 2 are built outside your walls
Wooden Walls available at start n/a Very weak, basic wooden wall, capable of only the most basic defense. They will require constant repair.
Repair available at start varies When bought fully repairs your walls, price depends on how much damage your wall has taken and can only be done once every 12 seconds. Has the icon of your current wall type.
Arrow Tower Stage 2 75 Deal medium damage and has a high rate of fire. Arrow Towers prioritize aim against units with low health.
Battle Academy Stage 4 125 Arms Peons (see Good units)  with swords and shields, giving them bonus Damage and bonus speed.
Stone Walls Stage 6 75 + Repair Strong stone walls, capable of withstanding much more damage than the basic wooden wall.
Ballista tower Stage 7 100 Shoots large, long range, armor piercing bolts, prioritizing aim against units with the highest health.
Blacksmith Stage 8 100 Upgrades Pikemen (see Good Units)  with bonus Damage (max +19) and bonus Health (max +25). Peons trained in a Battle Academy also get a chance to do AOE attacks.
Dwarven hut Stage 9 150 Gives all Dwarves bonus Damage (max +120%) and bonus Range (max +300%). Also gives them a chance to throw powerful bombs.
Reinforced Walls Stage 10 150 + Repair (cost goes down by 75 if you upgrade while Stone Wall is active) Durable stone walls with the added protection of steel reinforcement.
Mortar Tower Stage 12 100 Shoots hightly disruptive cannon, dealing medium damage.
Steel Walls Stage 13 225+ Repair (cost goes down by 75 if you upgrade while Stone or Reinforced Wall is active) Extrembly durable walls, able to withstand all but the most devestating siege attacks.
Forge Stage 16 100 Catapults, Cannon Towers and Blunderbusses fire faster (max +100% faster), and deal extra damage (max +60%).
Captain's Tent Stage 18 100 Captains and Longbeards gain bonus Health (max +175), bonus Damage (max +150%), and give bigger bonuses to other units.