Zorjax

I’ve decided to create an application for running Infocom-style text adventure games through the web. An application that allowed someone to easily create their own adventure games without an artist or a programmer.

Technologies:

  • JavaScript w/Prototype – processing user commands and interpreting the XML.
  • AJAX & PHP – Load and save games in XML on the server

So far all I have is the basic interface. It doesn’t do much yet, just parrots back whatever the user types in. Also, there are two annoyances in IE7; a crack between the textarea and the input area and when focus is set to the input area the cursor is all the way over on the left.

XML Structure:
These are the only files a game designer should have to touch:

game.xml will just have some basics; list of chapters and their file names and a pointer to starting chapter.
chapter.xml sheets will hold information on interface appearance and starting character traits. The rest will be split into three main sections: Places, Things and People.
save.xml inventory list, current character traits and plot points (did character throw the switch on the big dark machine? y/n)

Syntax:
For there to be any “game” in the game I’ll have to put a command structure into the XML itself. I’m thinking they’ll look something like:

<things>
    <radio
        look="It looks like a standard transistor radio"
        play="You turn on the radio.||TUNE rocksong.mp3||You rock out."
    ></radio>
</things>

In this example the verb play will be split by the ||’s into three commands. The first and last are going straight to display by default, but the middle command starts with the command TUNE which will tell Zorjax it’s time to play the file ‘rocksong.mp3’.

Last night I came up with a list of commands that I’ll need for starts:

  • IF – essential, and the conditionals are going to be a pain in the ass. might result int an END of the command or SKIPing a line.
  • SFX – play sound once.
  • TUNE – play sound on loop
  • WAIT – delay a number of milliseconds
  • IMG – change the background image of the textarea
  • ADD – put an item in the inventory
  • DROP – remove and item from the inventory
  • MOVE – teleport character to new place
  • CHAR (+/-/ ) – modify characteristic
  • SET – set plot point
  • GOTO – go to new chapter
  • RAND – random number, for damage or IF statements

Big Challenges:

  • Command parsing – I’m pretty sure I can program a simple command structure based on VERB NOUN or even VERB NOUN with/from NOUN but user commands like all, no or one will be more of a challenge.
  • Speech – Interactive NPC’s are going to have to talk. I’m hoping I can incorporate AIML into the first version of Zorjax.
  • Party NPC’s – I think it’d be neat to have characters follow the PC around. And I’m pretty sure how I’m going to do it, but it’s probably not going to be as easy as I think it is, especially if I want them to talk. This’ll probably wait until a future version.

I hope this is going to be a bigger hit than sothen.org was.

Filed under: LiveJournal Days,Uncategorized
Comments: (8)

8 Comments »

  1. If you can get some use cases/uml diagrams/requirements docs together, you can offload some javascript/php work to me.

    Comment by jonthegm — October 12, 2007 @ 3:31 pm

  2. That’d be awesome!

    How’s your understanding of web security? I’m pretty sure if I wrote a routine to save an xml sheet to a server it’d be a huge security hole.

    I was thinking the server side interfaces for AJAX calls would look like:
    checkuser(name) – checks if name.XX.xml exists
    createuser(name, password) – creates name.XX.xml
    login( name, password) – checks if password is in name.XX.xml
    save (name, password, index, location, xml) – checks password, saves xml as name.index.location.XX.xml
    load (name, password, index) – checks password, returns xml

    —where XX is a 16 character identifier so no one can poke around the USER directory looking for files. No cookies or other session info, since I’m keeping so much in the JavaScript memory anyway I was just going to add that.

    Does this sound like a good idea? Is it something you wouldn’t mind doing? I know it’s pretty boring, but I still don’t have a strong grasp of what else is needed.

    Comment by tone_milazzo — October 12, 2007 @ 4:45 pm

  3. Sure, have you decided on a PHP framework yet? That will help solve some of your obfuscation issues since you can load a dynamic view for a given action based upon input.

    If you’re not up to speed with the latest and greatest in frameworks, I must admit that I’ve done so much java for the last three years that I’ve fallen behind in what’s currently the best. However, quick googling gave me http://www.phpit.net/article/ten-different-php-frameworks/ which seems like it should answer questions.

    Comment by jonthegm — October 12, 2007 @ 4:55 pm

  4. While I admire your initiative, I’d like to caution you from spending too much time on this. There is a reason those games died out and became obsolete. Being non-graphical they have very little interest to most people. I LOVE old skool adventure games and hope to build some some day. But text-parsing is too primitive even for me. I’m sure you know about AGS, Wintermute and the others. It might be better use of your time to study the existing free graphical engines, learn to use them and/or build tools for those.

    Also, seeing as multiplayer games are the wave of the future, you might want to spend some time at Raphael Koster’s Page. One of the developers of Ultima Online, he recently went public with Metaplace, an engine that allows anyone to create their own 2D MMO. Building tools for that or other engines like it seems like a better way to develop and publicize your mad skillz.

    This coming from the guy who worked on a Flash adventure game engine full-time for a solid month earlier this year before putting it on the back burner.

    Comment by sewyrn — October 12, 2007 @ 5:16 pm

  5. It is pitch black. You are likely to be eaten by a grue.

    Comment by the_bone — October 12, 2007 @ 6:39 pm

  6. I have some bad memories of web hosting services that didn’t supply PHP5 so I’m leaning toward the intersection of AJAX and PHP4 which is CakePHP and ZooP.

    The only thing ZooP doesn’t have is an object-record mapper and since I don’t kow what that ORM I hate ORM. And I like their motto. So why don’t we go with ZooP?

    Comment by tone_milazzo — October 13, 2007 @ 8:00 am

  7. This isn’t going to take too long to program.
    And it has the advantage of padding my web developer resume and starting my game designer resume.

    Comment by tone_milazzo — October 13, 2007 @ 8:02 am

  8. “Grue” must be your nickname for the guy on the other side of the glory hole.

    Comment by tone_milazzo — October 13, 2007 @ 8:05 am

RSS feed for comments on this post. TrackBack URL

Leave a comment