[MUD-Dev] Coordinate mapping with text-based MUDs
Kwon Ekstrom
justice at softhome.net
Tue May 22 18:32:52 CEST 2001
From: "Jared Nielsen" <grafx at innovativestudios.com>
> I've been doing my research on text MUD systems and have attempted
> to incorporate some elements of a graphical MMORPG into a text-based
> game.
> One element that seemed pretty important was the need for spatial
> measurements in the game. At risk of losing the immersive quality
> of free-form text, I created a coordinate system of 1m x 1m and then
> "grouped" these logical "tiles" into "rooms". Each room contained a
> master tile to which was linked all global room information like the
> "look" message and the exit links, etc...
> The avatar can now move from room to room just like a MUD, but he
> can also "inch" around to a particular tile and examine it more
> closely.
<snip>
> Now that I have more of a spatial placement of avatars I can have a
> more realistic form of combat including vector tracing of missiles,
> haphazard risks of striking other players in the case of critical
> misses, weapon-specific range limits, etc.
I've been working with a coordinate system for my text mud (written in
java), but you're system appears to be more "spatial" than mine.
It uses "rooms" as per a normal mud, but most of the work has been in
optimizing the lookup code. Rooms are arranged in 10x10 sectors using
a 2d array. A sector contains the Z coordinate, allowing a full 3d
range. I've yet to decide exactly how I want to lookup sectors, for
now I'm using a general Java hashtable, but I'm working on a plan for
more specific indexing. Sectors are linked so the global list is
rarely used (Generally for goto or at type commands)
The plan is to have more spatial awareness than a standard linked room
system. Builders would "generate" a sector and attach it to an area.
You'd then add detail by building walls or "filling" rooms. You can
'step' out of bounds to an extent (As long as you don't leave the
current max/min coordinate range). When stepping out it'll generate a
sector based on all available surrounding sectors.
Full ranged combat is intended with fairly rapid weapon switch. I'm
looking at a world where ranged combat should be as common as melee
combat, with benefits for using one or the other. Magic will also
have certain ranged spells/affects.
I do intend on releasing my code someday, and everything is written to
use interfaces instead of the objects directly, so I've left things
very open ended. The rest of this post goes into my object
arrangement so feel free to skip it if you want. I feel it's
necessary to understand my coordinate system, but it doesn't relate
directly.
Anything that can "exist" in the game world is a Token, a Location is
any object that can store a Token... The heirarchy up to Place (which
is what Room implements) looks something like this:
Location: Allows an object to contain Tokens
->Container: Allows an object to contain Items
->->Place: Allows an object to contain Creatures and Items
Each defines methods to add, remove, get, and list.
Either get or list methods will accept a String, Filter, and List, or
any combination
The string is required as a key
A filter can be used to limit the search, but isn't necessary... for
example you can use a RaceFilter to only retrieve Creatures that are
Dwarfs... I've also got a MultiFilter which simply contains other
filters and checks the object against each filter it has until one
returns false. Filter is one of my "custom components" which seems to
save alot of code.
If you supply a list, it'll add the output to the list instead of
returning.
Plane: Allows an object to contain Places.
Sectors implement Plane, so does a World object which contains Sectors:
There's a variety of code reuse that comes with this, I'll explain
more if there's interest.
-- Kwon Ekstrom
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list