• Stars
    star
    333
  • Rank 126,599 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 14 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A client-side framework for narrative hypertext interactive fiction.

Undum

Undum is a game framework for building a sophisticated form of hypertext interactive fiction.

If that means nothing to you, then let's go back a few steps. Remember those Choose Your Own Adventure, or Fighting Fantasy books? Where you got to choose what your character does next? Well if you think of that in a web-page you have hypertext interactive fiction, or HIF. Instead of turning to a particular page, you click a link, and the next bit of content appears.

The problem is that those kinds of games are pretty limited. Every time the player does something, the story could go in different directions. So the author has to either write masses of branches, or else the decisions you make as a player have to be relatively short lived. If you played CYOA books you'll know that the wrong move either ended the story pretty quickly, or else it didn't really matter what you did because you'd end up at the same place.

To beat this limitation, Undum allows you to make the output dynamic. It allows you to keep track of what has happened to the character (any kinds of data, in fact), and to then change the text that gets output accordingly. Effectively it is like writing a CYOA page that is different each time you read it. This allows for far richer and more rewarding game design.

Undum is a pure client client-side library. It consists of a HTML file and three Javascript files. The HTML file uses a nice bit of styling, so there's a bunch of CSS and images in the default package too, but that can be replaced if you want. To create your own game, you edit the HTML file a little (mainly just changing the title and author), and edit one of the Javascript files.

Because the game is written in Javascript, you get the full power of a dynamic and efficient programming language. This isn't a CYOA scripting system with limited functionality. You can take control of anything you want. Or you can just keep things simple using a bunch of simple functions provided by Undum.

Compatibility

Undum is designed for HTML5 and CSS3 browsers. It has been tested on Firefox 3.6, Chrome 5, and Safari 5. Older browsers may work okay too, but some of the animation won't work, the styles may render poorly, and saving and loading of games is unlikely to work. Anyone who wants to hack around with it and make it work more widely is welcome. Just fork this project on Github.

The local storage system on some browsers does not work when loading a page from your hard drive. To test your game when developing it, you may want to start up a simple local webserver. I have found that Chrome seems to reliably provide local storage for local development. It also has excellent Javascript debugging tools.

Getting Started

  1. Download Undum. Use the 'download zip' link in the right column of this page.

  2. Unzip Undum somewhere on your hard-drive.

  3. Open games/tutorial.html in your browser, and play through the tutorial.

  4. Copy games/tutorial.html to a file that reflects your game name.

  5. Edit your HTML file and add the title, author and description of the game you want to write. At the bottom of the file change the name of tutorial.game.js to something else (by convention your-game-name.game.js.

  6. Copy tutorial.game.js to the file name you chose in the last step. Open it and begin creating your game.

Reference documentation, including full API details, is at http://idmillington.github.io/undum/, and is also included in the repository.

The source code for all the files is also heavily commented, so if you get stuck, go in and read it.

Deploying

To deploy your game, just upload your HTML file and the media folder to your webserver. You can serve several games with the same look and feel from the same directory. You need a different HTML file for each game, and each one should load the correct .game.js file at the end. Add any media you need for your game (images, audio, video), and the remaining files will be reused.

For example, if you had 3 games: episode1, episode2, and christmas-special. You'd have a directory structure:

episode1.html
episode2.html
christmas-special.html
media/
    css/ ...
    img/ ...
    js/
        jquery-1.4.2.min.js
        undum.js
    games/
        episode1/
            episode1.game.js
            ... media for episode 1 ...
        episode2/
            episode2.game.js
            ... media for episode 1 ...
        christmas-special/
            christmas-special.game.js
            ... media for christmas special ...

This assumes you use the same directory lay out that I do. You are welcome to change things around, of course, as long as you work and change the references.

Undum

The name undum came from a little project that preceded this code base. In 2008 I put together a simple browser based game. It was narrative, but used the grind-based mechanics of games such as Farmville and Mafia Wars. Because of the grinding, I called it Carborundum, which I found I couldn't type at speed, so it became Undum. The code has changed out of all recognition since them, as the grind-based game moved to Flash. But the name stuck for the Javascript framework.

License

The code, documentation, styles, design and images are all distributed under the MIT license. This permits you to modify and use them, even for commercial use. A copy of the MIT license is found in the LICENSE file.

More Repositories

1

cyclone-physics

The Physics engine that accompanies the book "Game Physics Engine Design"
C++
884
star
2

aicore

Now obsolete code accompanying the first (2005) edition of the book "Artificial Intelligence for Games"
C++
532
star
3

layout

A page layout engine for Python
Python
17
star
4

gnoam

A specification for a DSL / generating engine for data-driven natural language generation (NLG).
C#
8
star
5

idm-django-utils

My house set of django utilities.
Python
8
star
6

thebigdev-flash

A utility toolkit for managing the complex hierarchies of communication in Flash games. Based on similar code used in current generation PC and console games.
ActionScript
6
star
7

mini-languages

A bunch of experiments on writing mini-languages (mainly functional).
Python
3
star
8

csscolor

CSS 3 compatible color constants and parsing.
Python
2
star
9

dicecards-pledgemgr

The Software used for the pledge manager tool for my Dicecards Kickstarter campaign.
2
star
10

giclee

Code to make it easier to write object-oriented editing applications based on html 5 canvases.
JavaScript
2
star
11

sparkle

An extension and modification of John Aycock's Spark Python parsing package.
Python
2
star
12

cachemir

A simple Python decorator library for derived files.
Python
1
star
13

ajax-client-tools

A set of tools for building static HTML/JS interfaces on dynamic JSON data.
JavaScript
1
star
14

single-page-app-template

A template structure for developing a single page app with React, using Gulp + plugins for setup.
JavaScript
1
star
15

logstream

Secure data and issue tracking.
1
star
16

papersizes

Standard papersizes and manipulations
Python
1
star