Warfare in premodern Southeast Asia, roughly that fought up until the end of the 19th century, was shaped by the environment across the region. Maritime trade connections brought the introduction and circulation of external models of warfare that would help to frame the way warfare in the region was depicted in some of the indigenous literature and art (including the influence of the Indian epics on shadow puppet theater). Firearms played a more direct role in determining the development of warfare in the region over the course of the early modern period. As a result of better firearms, the elephant declined in battlefield importance and was increasingly replaced by cavalry. In the 18th century, Southeast Asians fielded some of their best-organized armies, and in the early 19th century there was a temporary revival of naval strength in parts of the region, particularly in Vietnam. Nevertheless, the introduction of the steamship and better European military technology from the 1820s ushered in the decline of the remaining Southeast Asian armies by the end of the 19th century. Although indigenous states would attempt to modernize and catch up with Europe militarily, all of Southeast Asia, save for Thailand, fell under European control.