[ What's New ]
[ Documentation ]
[ PUB Games ]
[ pub.tar.gz ]
Python Universe Builder
The Python Universe Builder (aka PUB) is a set of Python modules for writing text-based adventure games or interacti
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:
- sophisticated sentence parser (in some ways, better than Infocom's)
- fully object-oriented
- rich, deep language which is remarkably easy to learn and use
- includes full source code for the system
- may be connected to other services (web, TCP/IP, scripting languages, etc.)
- may be extended in C, C++, FORTRAN, etc.
- runs on almost any platform
- may be used as a multi-player network game (i.e., a MUD)
- free for non-commercial use
- an event-based scheduler which handles timing in a powerful way
- output is directed not just at the player, but at any object which is
- all actors (both the player and NPCs) have equal status and abilities
(though these may, of course, be modified by the game designer)
PUB currently consists of seven source files:
And two optional files (for making a network game):
The files were last modified
, with several updates to work correctly under Python 1.5.2.
Simply download each one and put them somewhere in your Python path. Then
launch python with pubdemo.py (e.g., type python pubdemo.py
or if you're on a Mac, drag pubdemo.py onto the Python application).
Or, if you'd rather, you can get pub.tar.gz, a
complete copy of the PUB files and documentation packed with tar and gzip.
Filenames are kept short enough to work on even the most primitive file systems.
Note: PUB files are all written with a standard Mac text
editor, in which tabs are equal to four spaces. If your editor can only use
eight-space tabs, you may be interested in
How should I start?
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
. . . . . . Joe Strout
. . . firstname.lastname@example.org