During this period, although the Emperor of Japan was officially the ruler of his nation and every lord swore loyalty to him, he was largely a marginalized, ceremonial, and religious figure who delegated power to the "shōgun", a noble who was roughly equivalent to a general. In the years preceding this era, the shogunate gradually lost influence and control over the "daimyōs" (local lords). Although the Ashikaga shogunate had retained the structure of the Kamakura shogunate and instituted a warrior government based on the same socio-economic rights and obligations established by the Hōjō with the "Jōei" Code in 1232, it failed to win the loyalty of many "daimyō", especially those whose domains were far from the capital, Kyoto. Many of these lords began to fight uncontrollably with each other for control over land and influence over the shogunate. As trade with Ming China grew, the economy developed, and the use of money became widespread as markets and commercial cities appeared. Combined with developments in agriculture and small-scale trading, this led to the desire for greater local autonomy throughout all levels of the social hierarchy. As early as the beginning of the 15th century, the suffering caused by earthquakes and famines often served to trigger armed uprisings by farmers weary of debt and taxes.