I am fairly sure China did develop cannons, though... they were kind of bottle-shaped rather than cylindrical, but cannons nonetheless. (I suppose if your big threat is nomadic raiders on a large, open border you are going to think more of building walls than on figuring out how to blow walls apart... though I think the Chinese did fairly well on siege weaponry anyway, to the point that Genghis Khan hauled a bunch of Chinese engineers westward with him on his conquests. But my Asian history is sadly fuzzy, so you should not trust me on any of this.)
no subject