Ranged Weapons and Spells

  • Slings
  • Bows
  • Darts
  • Firearms
Average: 4 (3 votes)


Torog's picture

Why? Why wouldn't people want ranged weapons?

Some discussions of ranged combat I found around the web:


Anyways, truly ranged combat within a MUD generally falls under one of two categories: coordinate-based ranged combat (like GodWars), or room-based ranged combat. If you're thinking of implementing it, you'd do better to stick with room-based unless your game already uses coordinates instead, as converting your whole movement system requires a major overhaul.

In room-based ranged combat, there are really only two feasible types of attacks: projectiles and spells. You can also count traps as ranged if you'd like, but they don't require line-of-sight like the other two. Here's a run-down of the basics:

First off, ranged attacks shouldn't (and won't be able to) initiate normal combat, which means you need to have a way to detect/avoid said attacks. From my experiences, this is usually accomplished by giving a message such as 'You see a large fireball hurdling towards you from the south!', followed by impact a couple seconds later if it's not avoided.

This brings about a problem if you have immobilizing affects in your game (such as web spells, paralyzation, etc) and can lead to rampant cheasy kills. In my opinion, the best way to avoid this is to A) give the attack X% chance to miss the target (depending on dexterity/accuracy or what not) and B) allow a stationary target some way to block the attack (via a shield or spell, most likely).

In order to check who the player can/cannot attack, you simply follow the room structure (pseudo-pseudo: for r = my room->north; r != null; r = r->north) in a loop until you find the target or run out of range. Obviously this follows 'line-of-sight', but you may eventually want spells that don't - such as ones that affect an area of rooms around a target, which is left as an exercise for the reader.

An interesting take. How to prevent cheesy kills with ranged weapons? Would spells have a range?


If I were coding a solution that was simple.. I'd treat classes + weapon combination as a range, but the only thing I'd have a hard time with is something like a wizard.

Take for instance a bard with a bow, obviously he'll be at range.

A rogue with a bow might be at range, but with swords/daggers, definitely melee.

But a wizard holding a dagger?  If we're thinking that because the world is magic, that anytime a wizard holds a dagger, they are using some kind of ethereal magic that allows them to traverse disances and use "energy slashes" from a distance, then we could assume they're always ranged.

But the basic assumption would be that a caster is always ranged, and a physical player can choose to be ranged or not depending on weapon.

Torog's picture

I think one problem we'd likely encounter is overly cheesy sniping, which might be realistic to some degree, but perhaps not fun in a game. There would likely have to be some skills that would allow people who have been sniped (fired upon) to quickly close the distance between themselves and the attacker. Any sort of ranged combat, I think, should have a serious delay attributed to it. Maybe some weapons would have a reduced delay, and there could be skills to reduce it -- or maybe players CHOOSE how long to aim, and the receive a bonus the longer they aim but with an increased post-firing delay in which they cannot move.

Also, maybe a way to allow the player when engaged in melee to automatically switch to a melee weapon.

So a ranged attack could look like:

Archer scans east > code checks for available target, finds one > PlayerX is far to the east >

archer 'aim east 1 PlayerX' > short time passes, reduced dam and hit chance > time up, check for t arget >

PlayerX still in position > process ranged combat > PlayerX receives messages that he's been fired upon, direction >

PlayerX's 'Fast Close' skill is checked against delay (low) because Archer aimed for 1 time value > successful? > PlayerX is suddenly in the same room as the Archer, melee ensues. Archer switches to default melee weapon.

> failure of 'Fast Close' > PlayerX must manually move to the Archer

So if the Archer were to issue 'aim east 5 PlayerX' then the delay would be longer, but their chance of actually hitting and doing damage would go up, but PlayerX is more likely to have moved. During that waiting phase before the firing, the archer should suffer some defensive penalty, as though they were resting or laying down, etc.

I picture ranged weaponry as a means of opening up combat -- with a poisoned arrow, an entanglement (bola) or just to get a mob or player to come to the archer. Maybe the 'Fast Close' skill would be toggleable, to allow a player to simply suffer the slings and arrows and not become embroiled in melee, as they see fit.