Blue CTF Soldier
QuakeWorld Python

QWPython is a Python-powered QuakeWorld dedicated server in which the QuakeC interpreter has been removed, and Python used in its place to execute game logic.

Python game logic can be generated by an included QuakeC -> Python translator.

Runs on:

  • Unix (tested on FreeBSD 4.2)
  • Windows (tested on NT 4.0 and 2000)

Requirements:

  • Python 2.0 or higher
  • Quake/QuakeWorld .PAK files

File Placement

QWPython should work out-of-the-box if you place its files relative to your Quake installation like this:

  • quake/
    • id1/
      • pak0.pak
      • pak1.pak
      • server.cfg
    • ctf/ (optional)
      • pak0.pak
      • pak1.pak
      • server.cfg
  • qwpython-x.y/
    • ctf.py
    • deathmatch.py
    • setup.py
    • py_ctf/
      • ...
    • py_dm/
      • ...

If you don't use this particular placement, you'll have to edit the deathmatch.py and/or ctf.py files to look somewhere else for the game's .pak files.

Building the native code

(Unix users need to follow this step. Windows distributions contain pre-built binaries allowing you to skip this, but if you have VisualC++ you can follow this step also to build your own binary.)

Change to the qwpython directory and run this command:

python setup.py install --install-lib .

This will compile the native-code part of QWPython (the actual QuakeWorld engine), and a couple supporting modules, and place the resulting package in the current directory. So you should end up with something like (many files omitted):

  • quake/
    • id1/
  • qwpython-x.y/
    • build/
    • setup.py
    • qwpython/
      • pakfile.py
      • qcsupport.py
      • qwsv.pyd (or .so)

You may remove the 'build' directory after this is finished.

Running a Game

QWPython comes with pre-translated versions of Deathmatch and CTF, which can be found in the py_dm and py_ctf directories. If you want to translate your own QC code, be sure to read the translator notes.

You might want to use a standard QuakeWorld 'server.cfg' file (usually in the same place as your .PAK files), that looks something like:

deathmatch 1
hostname "Python-Powered Deathmatch"
timelimit 15
fraglimit 150
maxclients 16
rcon_password mypass
map dm1

Although it should still work without one. From inside the QWPython directory, run this command:

python deathmatch.py

and you're in business. You should also be able to use the normal QW command line parameters, such as: +map dm1

Currently QWPython doesn't handle keyboard input to the console, so to stop it you'll either have to use the 'kill' command on Unix, or just close the window under Windows, or use the QuakeWorld 'rcon' command from within a connected QW client console (as in: rcon mypass quit).

Python Powered