The samurai followed the code of bushidō since the Heian Period. This code derived from japanese culture in many ways, such as their belief in kami.