[MUD-Dev] Thinking outside of the room . . . ur . . . box

Nolan J. Darilek nolan at thewordnerd.info
Wed Jul 30 00:21:03 CEST 2003


I realize this subject has probably been beaten to death in the
archives, and I've done several extensive searches which have pulled
up lots of juicy information, but I'm fairly new to the concept of
spatial data structures and such, so much of what I read was above
my head. :)

As you've no doubt guessed from my subject, I'm trying to create
another roomless MUD. I'm still fairly deep into character
generation and action resolution, though I suppose it's never too
early to start considering how to accomplish what I want.

I'm trying to strive for a fairly uniform system. What I mean by
that is, the same code that moves spaceships across interstellar
distances also moves your character across the common
room. Similarly, to use a very extreme example, if the planet you
stood on were to vanish while you still existed, your coordinates
would be scaled up to their equivalent coordinates in the area one
level up in the containment hierarchy. At the moment my current
structures are simple rectangular prisms which are responsible for
defining their own containment mechanisms. I.e. a character's
containment need not include coordinates, as it really doesn't
matter where your longsword is in relation to your
pocketwatch. Rooms, space (in the galaxy/universe sense) will
probably use Cartesian, while planets will use spherical. I realize
this is somewhat complex; my aim is to create a somewhat generic
platform atop which many things are possible. If, for instance,
someone wants a space-based game, I want characters to run low on
fuel, realize that they have just enough to reach a nearby planet
but not enough to reach a spaceport, land in wilderness, and have
their coordinates converted to spherical based on where they've
landed.

Another idea: descriptions are comprised of objects, not strings of
text attached to rooms. If, for instance, you stand at an
intersection of 4 streets with a building on each corner, each
building's facade contributes to the description. The building
covers a lot, so teleport the building away and the "room"
description alters. Destroy it, and the building becomes a pile of
rubble. As I also want descriptions to change based on perspective
and read more like a book than a random string of text that just so
happens to be connected, descriptions will consist of a tag-based
language which will allow for both textual substitutions
(I.e. something that inserts the words "ahead/behind/right/left")
and "hints" (I.e. even though the flashing neon sign is smaller than
the skyscraper, you'd probably notice it first.)

I'm having a few problems determining how this system will work
(just a few, huh ;) so I wanted to toss out my ideas long before I
start coding. First, I'm not terribly clear on how to integrate
polar and Cartesian coordinates. I mean, say I have a square area on
a planet's surface. I want the square area to represent a city, so I
decide that it's, say, 5X5 KM. It would be easiest to handle this as
a square using cartesian coordinates . . . and, for such a small
area, the curvature of the sphere won't matter. What if the area is,
say, 1000X1000 KM, however? I'm trying to avoid special-case
situations ("You can instantiate rectangular areas, but don't make
them larger than X!"), so I'm wondering if there's a more elegant
solution for creating shapes atop spheres?

Within the game, many of the shapes used will be rectangles as to
make navigation a bit easier (I'm not entirely sure how to handle
oddly-shaped rooms as of yet.) I would, however, like to offer the
option of making triangles, octagons, whatever your twisted builder
heart desires. :) I thought about doing this with a generic polygon
containing a list of vertices, but are there any generic algorithms
for taking a polygon of N sides and determining whether a point is
contained within, or is this problem solved on a case-by-case basis
(I.e. define a triangle class, rectangle class, etc.?)

I'd also like to handle non-flat surfaces. I don't necessarily mean
highly-detailed mountains with narrow ledges and lots of random
contours . . . but I'd like a way to, say, walk down a road, up a
hill and have your radius of visibility expand, walk into a valley
and lose sight of the castle beyond the last hill, etc. Given that
I'm only aiming for reasonably simple inclines, are there any good
mechanisms for handling something like this?

I'm not sure if this last requirement is horribly naive . . . but,
as this platform will be 3-D (albeit with a more simplified
structure) I'd like to offer graphics of some sort in the future
(though this isn't an initial design goal and, in fact, may be
struck entirely.) As descriptions consist almost entirely of nearby
objects, it seems possible that I might be able to split object
descriptions into several specifications. Text descriptions could
contain strings with hints, while a graphical specification could
list URIs for tiles, relative placement, etc. Not having much
experience with graphics programming, I'm not sure what details the
specification would need to export to the client. Also, assuming I
use polygons to create objects, it seems that I might be able to
achieve some level of 3-D graphics but again, not knowing much about
how such things are structured, I could be horribly naive about
this. I'm definitely not aiming for something to compete with
commercial 3-D RPGs (especially as much of my interaction will still
be text-based) but, assuming I wanted to create some sort of
graphical representation of my world, what might be best?
Tile-based? Simple 3-D? Or should I just scrap this crazy notion and
stick with doing text very well? ;)
_______________________________________________
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