The construction technique used were practiced using trial and error method. There weren't any Ruwanwali Seya that just sprung up. Ruwanweli Seya was build because we have perfected the art of building small stupas. The same goes for Sigiriya.
Our ancestors didn't build airplanes, nuclear...