In ancient China, around 800 A.D., medieval alchemists created a mixture that exploded with a bright flash when near fire, while experimenting with this, they unintentionally burned down the shack they were working in. They immediately alerted the emperor of this new creation, who quickly saw the potential ideas.
Many people were involved in this revolution, to name a few, Emperor Wu Di of the Han Dynasty and Roger Bacon were important, but for some strange reason, the famous "alchemists" names were lost. In 1044 the first book in history to record gunpowder, "Wujing Zongyao" was produced and contained instrustions on how to make and use gunpowder, that books writer is unknown. The effect gunpowder had on battle was so great, that the previous cutting-edge weaponry was practicaly useless.
Before gunpowder the main weapons of infantry were the sword shield and spear, as far as long-range weapons, the bow only shot as far as you could pull it. The cavalry sodiers were the strongest and fastest warriors on the battlefield before riflemen, and knights were used to carry out the orders of the king. Before guns, it was challenging to attack from a distance so soldiers needed more armor and were slowed by the extra weight, also the price of the armor was high so only the rich and nobles could be soldiers. Previous to my revolution, there was a great search for new weaponry to gain a technological advantage over enemies.