We are making a game, and we want to add a potion/magic mechanic to it, but keep it consistent with the lore (1787ish) and fairly realistic. Does anyone have any ideas on how to do it?
Alchemists believed they could change a metal into another, dissolve them, cure every sickness, prolong life or even expand their conscience. Well, maybe they did achieve that last one with opium or the fumes from boiling mercury.
Even Newton believed in Alchemy. From Wikipedia:
In his Hypothesis of Light of 1675, Newton posited the existence of the ether to transmit forces between particles. The contact with the theosophist Henry More, revived his interest in alchemy. He replaced the ether with occult forces based on Hermetic ideas of attraction and repulsion between particles. John Maynard Keynes, who acquired many of Newton's writings on alchemy, stated that "Newton was not the first of the age of reason: He was the last of the magicians." Newton's interest in alchemy cannot be isolated from his contributions to science. This was at a time when there was no clear distinction between alchemy and science. Had he not relied on the occult idea of action at a distance, across a vacuum, he might not have developed his theory of gravity.
You are being rather vague; I don't know what "consistent with the lore of 1787" might mean.
Many realistic things, like radio transmission, magnetic effects (and especially electromagnetic effects in which the field can be switched on and off), remote hearing (what 'telephony' means), remote viewing (what 'television' literally means), a self-moving machine ('auto-mobile') and so on would be considered magic in earlier ages. Music from a cell phone would be considered magic.
added: As far as a potion is concerned; something like an oral antibiotic to cure an infection, or a hallucinogenic like LSD, or a knockout drug could be considered 'magical'. Drink it and you pass out for twelve hours, but wake up rested without any hangover or other ill effects. Heck, even an oral topical anesthetic to "cure" a toothache might be considered a magic; just the ache returns when the magic wears off. Most pills could be dissolved in liquid to make "potions", how about nitroglycerin to alleviate chest pains? Concentrated aspirin (salicylic acid) to relieve other aches and pains?
Again, if you can be more specific about the magic component you wish to introduce, we might be able to help you more; I will revise this answer.
If you were a real pedant, you would read Newton, then Lavoisier and the scientists of that era (there were many), then jump off from them. Some of the second string crew had some cool ideas - I stumbled into Marat's experiments on the nature of fire but I had trouble finding them in full text - link please anyone who can. Often the original works contain their own speculations which are perfect for your needs but dead wrong, and so these bits do not make it into the modern summaries. Some of this stuff is hard to find on line. The thing is that it would take a lot of reading time but for a game, your audience (unfamiliar with these works) would not appreciate how true you were being to the 1787 scientific vibe and how much reading it took to get you there. Probably this path would be better for a novel where the readers would include aficionados who would be thrilled at correct references and would notify others of their ilk.
A shortcut for you would be to jump off from Jules Verne - 50 years later than you want but no matter. I greatly suspect that most steampunk writers read Verne and Wells and take it from there in a similar vein. Nothing wrong with that, and you can find all the works of both men on line.
I suspect that you might want a third and even quicker route: to have someone here familiar with path 1 or path 2 provide you with what you need to build your game. That is a fine thing for the world building site but you need to be more specific as to what this magic will do. There is lots of kinds of magic people have made up.
Microorganisms are an invisible force of nature that directly interfere with the lives of human beings in a myriad ways.
Depending on the setting you could explain what's happening using microorganisms, bio-engineered, natural or otherwise.
You couldn't shoot fireballs with them, but curses, hallucinations, mind-altering, curing diseases, physical changes and some light transmutations are possible within the limits of the setting.