Introduction

The Python Universe Builder (aka PUB) is a set of
Python modules for writing text-based adventure games or interactive fiction.

Features

Many of these features are simply the features of Python itself, which is one of the best languages I've ever seen (and definitely the best interpreted language I've ever seen). In addition, the PUB modules offer some innovative features not found in other interactive-fiction builders:

Starting Points

First, look at some
games written with PUB. Depending on your system, you may need to first get and install Python (which is free), or you may be able to get stand-alone executables.

Next, read the documentation, which includes a simple tutorial. This will lead you through the process of creating a very simple interactive-fiction game from scratch.

Then browse the library reference. This shows you all the great object classes that have already been defined, so all you have to do is drop them in your game and give them names and descriptions.

Finally, go back to the games you've played a bit, and examine their code. Now that you've gotten the general idea, you should be able to understand what makes these games do what they do, and you're ready to start designing your own.


History of PUB

Terry Hancock

I first discovered PUB in 2000, but it was actually written in about 1996 by Joseph J. Strout. I was very excited when I found out about it, because it was exactly what I needed at the time -- an engine and language environment which would work like developing games in Inform for the Z-Machine, but run under Python, with full access to the computer's resources. This makes it possible to interface with the software easily for building extended environments or interfaces.

At the time I was working on an adventure game project The Light Princess, and PUB looked like a good base to start the game engine, since we really wanted a graphic engine that "felt" more like using the old text adventure (or "interactive fiction") games. I thought of it as "interactive cinema".

However, that is a really ambitious idea, and as the primary interest in The Light Princess was from artists and writers, rather than programmers, and as I was not up to writing the engine myself, and as, late in 2001, I got a "real" job, the project just stalled for about 4 years. In 2005, however, Jeff Waddell, who had originally inspired me to attempt The Light Princess managed to do it again, and what with 4 years progress on game engine software, it is looking feasible to continue.

Meanwhile, Py-Universe/PUB project sat here for about 24 months, with very little being done to it, although it was during this time that I added some of the docstrings, and Lalo Martins added the necessary machinery for PUB to install as a proper Python package.

In 2003, interest perked up, particularly driven by Gabriel Jägenstedt, who has been the most active developer over the last few months, and is still quite active (2005).

PUB has a number of nice features beyond what you usually get in an interactive fiction system, for example: partial real-time capabilities and multi-user play (support for MUDs) via TCP/IP connections. Also, since the player character is modeled like a non-player character, and because the system is object-oriented, there is direct support for characters to pass messages to each other and to other objects in the environment.

For the The Light Princess project, I had visualized building on the Oz Architecture to create more interesting characters. This still seems like a good idea, but it is definitely non-trivial in complexity. However, most of the code in the original Oz project (unfortunately not available -- I made some inquiries, and it seems to be essentially lost), was simply to provide the "topological world-model" (which is what PUB does already). Thus it seems like a natural to extend the PUB character object into an Oz-like agent.

Since I'm starting up on the The Light Princess again, I'm waking this idea up, too. Our initial implementation (demo) probably won't use it, which reduces the pressure a bit. But I've created a web page for a new sub-package for PUB to be called Emerald as a nod to the Oz Project that inspired it, even though Emerald will probably wind up being quite different, as I'm implementing a different type of emotion model and we'll probably borrow some ideas from Cyphesis (World Forge) and other places.

Specifically for The Light Princess, I'm planning to create a game engine by simply gluing together some pre-existing graphics and multimedia engines into Python Universe Builder's logic (the result will run on top of PyGame, and so therefore on SDL, and will run on many platforms). I'm calling this simply Universe, because what else would you build with Python Universe Builder?

Interfaces and Adapters

The main contribution of Gabriel Jägenstedt, beyond simply cleaning up classes and adding a few new "mixins", is to convert PUB over to more of a "component" architecture. This involves using the
PyProtocols package to implement "interfaces" and (potentially) "adapters" as needed to interface PUB with external packages. This is something I expect to get some mileage from as I work on the Universe and Emerald concepts.
SourceForge Logo