Man, I really have to find a way to stop getting into logic dead-ends.
So, in the story I’m writing, there’s this country that developed big bad war machines that run on steam engines. The way they work or if they make sense or not is irrelevant.
These war machines brought military superiority to the said country and made them conquer pretty much every other country except one because this one has magic (specifically, this kind of magic).
Now, I need for the sake of logic that the aforementioned big bad war machine bearing country still uses sword, shield and pike infantry and heavy cavalry. Or to be clearer, I need a country that has steam engine technology to not have discovered gunpowder yet.
Obs.: By "gunpowder" I mean "projectile propulsion system that would effectively (including cost-wise) replace swords, shields, pikes and heavy cavalry".
I did my research. According to source, gunpowder was first used in the military by China in 1126, while the first steam engine used to actually move a big vehicle (locomotive) was only applied in 1804 (source). That’s 678 years. Is that plausible that a civilization based on our own would not discover something that important for more than 500 years? Can I have a plausible excuse?
- This country is cold, harsh, and very military based. The same can be said about its people;
- They can’t use magic because reasons. Even if they have the fuel mentioned in the linked question, it just doesn’t work;
- Steam engines are the only advanced technology they have. No electricity or the likes.
Also, note that they having discovered gunpowder but being unable to apply it in the military is also a solution (obviously with a plausible enough explanation).
Lack of interest in chemistry is out of question. There is no way a military force that big is not actively and extensively researching chemistry. Also, little edit in the body of the question.
UPDATE: Thanks for all the answers. I'll go with a mix of @Jeutnarg and @PaulTIKI's answers, as those were the ones that gave the most useful solutions to my specific world, and @Graham's comment.