Okay, I’m jumping on the ChoiceScript bandwagon. I had a different idea initially for my first CS game, but as I worked with CS, I discovered it would let me do a bit more than I suspected would be possible. The key is the ability to use JavaScript in the game. I’m not sure if what I do with JS will interfere with my ability to port this game as a native app to hand-held devices, but I’m not going to be concerned about that for now, as long as it’s playable on the web. Most hand-held devices have the means to play web-based games, they just aren’t native to the device.
My idea for Castle of Chaos is a mathematically generated huge maze on a 1000x1000 grid (yes, that’s a total of one million locations). You start at one corner of the maze, and see where you can manage to get to from there. The character is a Tunnels and Trolls based character, which doesn’t mean you need to know the Tunnels and Trolls rules (T&T is the second oldest RPG, for those who don’t know), but if you want to understand the mechanics used in the game, then you can check out the T&T rules. You can find a free abridged copy of the rules at
The complete and latest 7.5 rules that I’m basing my game on aren’t free, but can be found at
This game is basically a vehicle for me to figure out how to do certain things. For instance, one feature of the game will be the ability for members of the Trollhalla Inner Sanctum to use the attributes of their Trollhalla avatars in the game. The Trollhalla Inner Sanctum can be found at
This is possible because a particular URL already exists on the Trollhalla web site that allows the browser to pull the stats for the member when the member is logged into the Trollhalla Inner Sanctum in the browser. The URL returns JavaScript, so I pull it into the game by including a script tag in the index.html file for the CS game; I then transfer the values obtained from the JS to the stats variable in the mygame.js file. It’s working very nicely on my local machine; I don’t yet have any version of the game installed on the web for anyone else to look at or try out.
If the player is not a member of the Trollhalla Inner Sanctum, then I generate stats for them according to the character generation rules in T&T 7.5. Most members of Trollhalla have built up their avatar stats to much higher levels than are easily generated by the rules, so they will have an advantage in the game.
For a game this size, I need a save feature. I have some open source jQuery-based HTML5 storage system code that I created some time ago for other purposes, and I’ve figured out how to make it work with the CS interpreter. It took a while to figure out exactly what functions in the interpreter to call, and what arguments to pass them, but all my tests are now passing (though it will certainly need more testing). The way I’ve implemented it at this point, the links to save, load, and delete games are always on the page rather than being *commands that you embed in your scenes. This means the game can be saved at any time, and a saved game can be loaded at any time. There’s also the ability to delete any saved game. Since it uses HTML5 storage, it can save more data than you could save with cookies, and in fact the system allows the player to save multiple game states, giving each saved game a name to remember it by.
The big drawback to using this storage system is that you can’t save games on one computer and load the saved games on another computer. You can only access the saved game on the same computer that did the saving to begin with. There is a “password” system built into the CS interpreter that allows the player to copy a “password” that can be saved to a file, which could be moved to another computer the same way any other file can be. By pasting the contents of the file into a text area provided by CS (if you know how to enable it), you can restore the game that way as well. I think of that kind of saving and loading as an import/export feature. I’ve got some existing open source code written for doing that sort of thing, which I think I might integrate with the CS interpreter in the same way I’ve integrated the storage system.
Anyway, I’ve really dived into working with CS and the interpreter, and I’ll try to put up what I’ve done so far on the web on my Eposic server as soon as I get a chance. Won’t be this weekend, because I promised someone else I’d post some open source dice animation code for them. Plus, I’ve got to figure out exactly which CS files need to go on the web server when you install a CS game on the server. There’s probably some docs or discussion topics on that somewhere, eh.