Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XML Worlds

18 views
Skip to first unread message

Mike McKee

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
This is all pretty prototypish, but I'm getting somewhere. I have wandered
off into my own direction, against the tide of TADs and Inform, because I
wanted to use my own development environment. I have been trying to build a
new interpreter and use XML as the game file. I have been successful in that
you can wander around, north, south, west, east, up, down, and can "see"
(read) places, things, and characters. I have also been successful in
creating a limited English language parser that breaks down 2-3 word verb
phrases into a handful of things it can deal with. Another success I have is
something called "GodMode". When you switch to GodMode in the game and
supply a special password, you can walk off in directions you're not
supposed to, name these places, define what they appear like, create things
and characters, and even connect these places into a circle so that they
loop back around. On the loopback, imagine going north, east, south,
west--you'd like to be right back where you started, right? I have a command
you type in GodMode to get the rooms/places connected that way. The other
mode--MortalMode--is the mode that one gets into when they play the game.

The games cannot be played yet--I'm still working on making standards for
this in my interpreter. All you can really do is move around and see things,
or you can switch to godmode and edit the worlds.

My first interpreter is being built in Visual Basic 5 (perhaps 6 soon),
because of its outstanding object creation and handling capabilities. Plus,
it's not extremely slow and it is easier to debug complex code. Eventually,
I can put the code for this interpreter out in the public domain and others
can port it to other operating systems.

I have given the name of the interpreter as Tangent (WinTangent to be exact)
and the files it uses as TAN. Those of you familiar with XML will be able to
open the TAN file in wordpad and see that it looks like an ordinary XML
file, which looks something like:

<PLACES>
<PLACE>
<PROP NAME="Name">Pond</PROP>
<PROP NAME="Key">54573885</PROP>
<PROP NAME="ShortDef">This is the pond.</PROP>
<PROP NAME="NorthPlace">76972758</PROP>
<PROP NAME="WestPlace">45716609</PROP>
<PROP NAME="EastPlace">19216572</PROP>
<THING>
<PROP NAME="Name">Canoe</PROP>
<PROP NAME="Key">67009887</PROP>
</THING>
<THING>
<PROP NAME="Name">Oars</PROP>
<PROP NAME="Key">41289270</PROP>
</THING>
</PLACE>
<PLACES>

Well, I have a long road ahead for the design of this. I'm just stopping in
to say that a lot can be accomplished in Visual Basic, against the tide of
naysayers.

Mike McKee
mckeeSP...@imetrus.com
You know what to do to reply.


J. Trischman

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
I think using XML is a clever idea.
I've been playing around with a similar idea for a
couple of years, but programming in Java.
My reasoning there was twofold. First Java is
portable, and second it can run in a Web browser.

The clever thing would be to come up with a standard
Interactive Fiction Modeling Language in XML.
Designed correctly it wouldn't force an implementation
on anyone. Then you could separate the world
design from the game interpreter design.

Another point to consider. Most Web Browsers
are being built with XML parsers built in. The hierarchical
object structure that gets built is then accessible through
various APIs.

It would be interesting to have a collaborative IF world
spanning various web sites that could be experienced
using web browser.

Unfortunately having a few kids and a full time job doesn't
leave much time for this sort of thing.
--
-----------------------------------------------------------
James Trischman tris...@spawar.navy.mil


Mike McKee

unread,
Apr 21, 1999, 3:00:00 AM4/21/99
to
Aha! I caught someone trying to have dialogue with me without being
combative in this newsgroup. Thank you, kind sir. (Note on protocol when
speaking to a Navy Officer--use "sir" a lot. <grin>)

How did you know I have a few kids and a full time job? <grin> Actually, IF
programming, for me, is something I plan to do for a very long time, kind of
like Ham Radio. So, as long as I pace things out over time, I have plenty of
time for job, wife, and kids. Plus, it's not like I'm trying to rush to take
this to market for profit--all I get out of this is to be the "father" of
something, even something minute.

You make some interesting points, especially about separating the world
modeling language from the game code. However, in my implementation of my IF
programming environment--The open-source "Tangent" project--there is no
programming--merely objects and properties. So, the XML file could be used
for both the world modeling and the game "code" (although the code is
abstracted from you). The "tricks" that make the game entertaining are
merely properties you turn on or off and set various parameters on. I'll
have about 25-30 "tricks" available in version 1, and I'll keep adding
"tricks" as I upgrade Tangent, but still providing backwards compatibility
with previous tricks.

Okay, so what the heck is a trick? A trick is something that you commonly
see in IF games, such as a ghost that goes through walls, or a character
that insists on fighting you to the death, or the fact that if you try to
open some objects with the wrong tools you vaporize into bits.

However, others may want more power and may wish to use XML as their world
modeling language and use another file for the game code. That's fine, and
both our standards can coexist in an XML environment.

Microsoft provides an XML parser ActiveX DLL, but I haven't figured out how
to use it yet. Besides, I was using XML for my "worlds" way before Microsoft
had this DLL available in their web browser. Now that they have it
available, I might consider using it for speed.

>It would be interesting to have a collaborative IF world
>spanning various web sites that could be experienced
>using web browser.

Wow, man, that's a Deep Thought kinda thing. We'll have to wait 2 million
years for the result and the answer will be "42".

Gotta go. The wife is home with my kids from soccer.

Mike McKee


Mike McKee

unread,
Apr 23, 1999, 3:00:00 AM4/23/99
to
In my XML worlds, or, to be more precise, "landscapes" in my terminology
book, you can build them in many different ways. If you are good with
notepad and want to write straight XML, then that can work. If you want to
use my editor (written in VB) to move around in the XML world as if you are
playing it, building "rooms", "things", and "actors" as you go, then that's
another way. Or, because it's XML, you can make a treeview editor for
managing the landscape easily in either VB, Java, C++, and a gazillion
different languages.

But this is all still very prototypish, so don't ask me for source code yet.
I'm in this project for the long haul and it will probably take me another 4
years before I have something really cool. All I have now is just something
slightly cool.

All I'm trying to really express here is that XML makes a darn good
landscape tool, and in some game varieties where the "tricks" to the games
are simply properties you set on rooms, things, or actors, then these can be
set in XML as well.

Mike McKee


Mike McKee

unread,
Apr 23, 1999, 3:00:00 AM4/23/99
to
A sample of an XML world is at:

http://www.imetrus.com/if/sample.xml.tan.txt

For lack of time this morning, I forgot to put any actors into the XML file,
so forgive me.

I have 3 major concepts in my design:

places - collection of place objects, and they make up the landscape.

place - a container with a name, a short and long definition, hyperlinks in
all directions, and may contain things and actors.

thing - a thing object, such as a doorway, a rock, a book, etc., and may
cause harm, or not cause harm, be moveable, taken, destroyed, or not.

actor - a creature, person, fairy, ghost--something that has or resembles a
bodily form. An actor may cause harm, or not cause harm, might be carried in
some cases, destroyed, or not.

The Place, Thing, and Actor objects have properties. I denote these with
<PROP NAME="{label}">{value}</PROP>

In the <RESERVED> tags, I place things specific to my game of Tangent, but
want to leave that open to what others want to put in there. So far, that's
where I put my version number of the XML game file.

You might also note that every place, thing, and actor has a name as well as
a key. The key is just there to eliminate the problem of two things being
named the same thing. There's nothing special about my keys--they just are
an 8 digit number. You might also notice that some of the places have a
NorthPlace, DownPlace, etc. This is nothing but a "hyperlink" connecting
that place with another place so that when someone types GO NORTH they
follow the NorthPlace hyperlink which is a link to the key of the other
place object.

In your case, you might use XML purely as a landscape file, where in my case
the landscape file and the game file will be the same thing. In my design,
games are built simply by turning on properties that enable a canned set of
"tricks" that may also have extra properties on them. As my games advance
forward in versions, I'll add more canned tricks that one can turn on.

I provide only one editor for the XML landscapes now--you simply enter the
text adventure in an empty room, switch to "godmode" at command-line, and
start zapping and naming things as you move up, down, north, south, east,
and west. You can also connect things, if you want, into a loop, so that
when you go n, e, s, w, you start right back where you were--but this is not
a requirement and is not done automatically for you.

Eventually, I also want to produce a visual XML landscape editor using
something like an Explorer TreeView.

Pretty simple, huh?

Mike McKee


0 new messages