View Single Post
Old 07-13-2012, 04:42 PM   #51
realmsofvalor
New Member
 
Join Date: Jul 2011
Posts: 22
realmsofvalor is on a distinguished road
Re: Can MUDs implement range/distance?

The MUD I work on, Arantha, uses a hybrid room-and-coordinate
system we call tactical movement. Room-to-room movement is a MUD
standard with cardinal directions. Within each room is an X, Y grid.
Interacting with objects/mobs/players can be dependent on whether or not
you are close enough. For example, when you drop an object it will drop
on the same tactical space your character is standing on. If an object is
more than a step away, you cannot use 'get' to pick it up. You can't slap
(social) a person across the room, but you can whistle at them.

In regards to combat, moving into a room with an aggro mob will
automatically switch you to the 'tactical' mode. Movement is using the
same north-east-south-west, and once you walk out of the room it returns
to normal movement mode. Positioning can affect combat & group
dynamics, especially when AOE spells are slung into the fray.
From a code perspective it's quite simple to keep track of an X &
Y-placement integer for each obj/mob/PC and dimensions for each room,
then build your features by calling on those values. As the average room
spans 3x3 to 8x8, there's no issues with huge numbers, and the tactical
maps are designed to be displayed in a simple telnet client with minimal
embellishment.

I would agree with KaVir that if you're looking for accuracy,
full-coordinate is the way to go. Personally, I find the hybrid system makes
combat quite interesting, while still retaining the traditional MUD elements
of rooms. As to floating point numbers, I dislike using them due to the
rounding errors, but they are a very handy variable for large-number
calculations. If you want to learn more about the rounding issues, maybe
this article won't hurt your head:
realmsofvalor is offline   Reply With Quote