Home - ThePix/QuestJS GitHub Wiki
Welcome to the QuestJS wiki!
QuestJS is a framework for creating parser-based text adventures. As yet there is no GUI editor (though it is under development), but there is a tutorial to walk you through creating a simple game by coding in a text editor, and the system is sufficiently complete that you can use that to create games of any complexity. This is still in development, but version 1.0.0 has now been released.
If you want to jump straight in, the first page of the tutorial will get you going.
Why Use QuestJS?
The Quest system has been around for over twenty years. QuestJS, or Quest 6, draws on that experience to offer a mature, full-featured system, capable of handling the most complex game mechanics, including containers and countables and support for NPCs. What makes QuestJS different to earlier versions of Quest is that it is written entirely in JavaScript.
Games run in the browser. Everyone has a web browser, which means everyone already has all the software they need to run your game. Players can save their game progress on their own PCs to "localStorage" or to file on their hard drive.
- As games run on the player's PC there is no lag and no time-out
- Games can be easily uploaded to any web site (as well as textadventures.co.uk)
Anything can be customised. The whole system is written in the same language you create your game in, and the entire framework is part of your game package. Anything you want to change, you can. You can re-write the parser, you can rebuild the interface from scratch or you can just slightly tweak how containers work. It is all there for you. As far as I know, this makes it unique among Interactive Fiction authoring tools.
QuestJS (like Quest 5) is open source.
QuestJS is easy to use. Decompress the zip files, double click "index.htm", and you have the basic game up and running in your browser. Edit a data file in a text edit, save it, reload the web page, and now you are playing your modified game. There is no compiling, nothing you need to do with the command line, no installation software - it is, to the best of my knowledge, the easiest IF system to run.
QuestJS is (relatively) easy to debug. A "syntax error" - something the interpreter cannot understand - will give an error message that tells you the file and the number of the line with the error. It tells you exactly where the error is. Many common errors have messages that will suggest how to correct them. At any point in the game you can check to see the value of any attribute of any object - and even change it on the fly. More details here.
If you already know JavaScript, you already have a great head-start. If you do not know JavaScript, you are about to start learning one of the most important computer languages of the Internet! And the good news in that QuestJS has done all the hard work has been done already, you will only need to a small bit of JavaScript to get going, and to create great games.
What does QuestJS code look like?
QuestJS has been designed to make it as easy - and as quick - as possible for anyone to write in code. It is in JavaScript, and that determines much of how it is written, but nevertheless, simple items and locations can be created without much effort at all. This example creates two rooms, plus a single item and the player object. You do have to be careful with your brackets and commas, but you can probably work out what most lines do just by looking at them.
createItem("me", PLAYER(), {
loc:"lounge",
synonyms:['me', 'myself', 'player'],
examine:'Just a regular guy',
})
createRoom("lounge", {
desc:'A small room with an old settee and a telly.',
east:new Exit('kitchen'),
})
createRoom("kitchen", {
desc:"The kitchen looks clean and well-equipped.",
afterFirstEnter:function() {
msg("You can smell freshly baked bread!")
},
west:new Exit("lounge"),
})
createItem("hat", WEARABLE(), {
examine:"It is straw boater, somewhat the worse for wear.",
loc:"lounge",
})
If you want to do complex stuff, it will, of course, get more complicated, but conversely because you are writing in the same language the framework is written in, you can make make systems as complex as you want - there is no limit to what you can do. Plus, there is a huge number of web sites already dedicated to JavaScript on the internet, so even if the answer is not here, you may well find it elsewhere.
Take a look at the tutorial if you want to see more; it will take you through downloading the game files, creating your own simple game and then uploading it.
If you want to see what games look like:
- There is a tutorial on how to play parser games on TextAdventures.co.uk and on Itch.io.
- A game, "The House of Highfield Lane", was an entry in IFComp 2021 (it came 17th out of 71 entries). The game is open source, the code is here.
- There is a "Cloak of Darkness" sample game, more about that here.
- You can see a demo showing what is possible with the user interface (though not without a fair bit of effort) here.
- There is an example game where I test most of the features here - but be warned, it is not that coherent for playing.
- There is a game by someone called XelX using QuestJS here; this was the first proper QuestJS game!