You start with a level 1 castle. There are 10 regular upgrades, and then three more super powerful ones. With every upgrade, you collect gems faster and faster. To battle, you must buy knights with the gems you collect. The slider variables on the battle are percents and automatically subtract the soldiers you use from your total (evenly), so to evenly split your soldiers between the three flanks set the percents to 33, 50, 100.
This is basically the same as the one that thebludgeoner2 made, but I just fixed the back button on the battle map. Enjoy!