[MUD-Dev] Thinking outside of the room . . . ur . . . box
T. Alexander Popiel
popiel at wolfskeep.com
Thu Jul 31 13:07:39 CEST 2003
In message: <E19iIgs-00045e-UR at bush.kanga.nu>
mud-dev-request at kanga.nu writes:
> I'm trying to strive for a fairly uniform system. [...coordinate
> systems...] 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.
It sounds like what you want is not truly uniform, but is instead
several disparate representations with methods for translating from
one system to another. The only thing that all of the
representations have in common is a sense of location (though
perhaps not distinct locations, in the case of the stuff people are
holding). There is no need for a uniform 'movement' interface; any
object that wants to move just moves in its own preferential
coordinate system, then translates the new position into the
coordinate system of its container when the container needs to be
informed. As long as each object defines its own coordinate system
and a method for translating that into some representation that each
other object it wants to communicate with understands (either direct
translation or through some common intermediate representations),
then there is no need for uniformity.
Of course, this could all get rather slow, if you're constantly
asking for coordinate transforms. Caching might help, if that's an
issue.
> Another idea: descriptions are comprised of objects, not strings
> of text attached to rooms.
There's been a fair amount of work on natural language descriptions
of scenes. I don't know the details, but the research is out there.
Mostly in AI circles, story generation and comprehension being one
of the big consumers of it.
> 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?
Not particularly.
> 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.?)
Yes, there are several generic algorithms for determining if a point
is inside a polygon. Here's a common one:
1. First, ensure that the polygon border does not cross itself
(decomposing the polygon if necessary).
2. Find some point known to be either inside or outside the
polygon (the average of all the verticies is often used).
3. Draw a line segment from that known point to the question
point.
4. Determine the number of times that line segment crosses the
polygon border.
5. If the number of crossings is even, then the question point's
insideness is the same as the known point's insideness.
Otherwise, the question point's insideness is opposite the known
point's insideness.
Obviously, this is a bit more expensive than the simple case checks
for rectangles, triangles, circles, and the like, which is why most
systems use the simple cases wherever possible.
> 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?
This is best handled just through line-of-sight stuff, straight from
the 3D graphical environments. You may also want to add in some
'haze' factor to restrict how far out you can see...
> 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? ;)
FWIW, doing 3D graphical is easier than doing text very well. For
the graphics, all you have to do is get the pixels on the screen,
and the humans do all the interpretation. For the text, you have to
have some machine doing the interpretation and explaining that in a
convincing way to humans. As I mentioned earlier, there's been a
lot of AI work on scene description, but don't be fooled into
thinking that it will be simpler than graphical stuff.
- Alex
_______________________________________________
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