Historically guns existed next to swords for over 400 years, 1200-1600, there are even some instances where swords were used effectively as late as WWII. Japanese officers were known to use katanas in close quarters fighting with low visibility. So what are the options for including firearms in a D&D style role-playing game?
- You can make the firearms very basic and unreliable
- You can balance the rest of the world around the guns
- You can make guns very rare and expensive
You can make the firearms very basic and unreliable
If you make firearms basic and unreliable you make them basically gunpowder fueled crossbows, which if you look at early guns they were. Early guns general had a single shot and produced a thick haze of obscuring smoke. When someone fires one of these guns it should give the opponents a concealment modifier against further range attacks. I would make the damage slightly higher than a crossbow of the same size like 1d8+1 rather than just 1d8. Another downside of these guns is they take a long and complex process to reload. You have to pour in powder, pack the barrel with cloth or leaves place the bullet, if its a flash pan prior to firing you have to pour powder in the pan. Guns like this are often prone to misfire sometimes as high as 25% of shots failed to fire for one reason or another. You could illustrate this by making it critical miss on 1 or 2 instead of just 1
You can balance the rest of the world around the guns
Making guns horrible doesn't really make them fun. Another option is in a world with magic people would naturally create defenses against firearms. Mages could have shield spells that repel bullets. Fighters should have enchanted armor that is impervious to bullets. that sort of thing.
You can make guns very rare and expensive
Guns don't have to exist in every corner store to be in your world. maybe they come from some far off land. Gun powder existed in china for hundreds of years before it was imported to Europe. Maybe you have a secret society that jealously guards the secret of gunpowder to increase the price of it.