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.
- 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.
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)
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
- 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.