Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

QuakeWorld dedicated server wrapped up as a Python module, QuakeC -> Python game translator

NotificationsYou must be signed in to change notification settings

barryp/qwpython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

Runs on:

  • OSX (tested on 64-bit Yosemite 10.10.3 with Python 2.7.6)
  • FreeBSD (tested on 64-bit 9.3 with Python 2.7.9)

Version 1.0 ran on:

  • Windows (tested on 32-bit NT 4.0 and 2000 with Python 2.0 back in 2001)

Requirements:

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

File Placement

QWPython should work out-of-the-box if you place its files relative to your Quake installationlike 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/    qwypthon-src

If you don't use this particular placement, you'll have to edit thedeathmatch.py and/orctf.py files to looksomewhere else for the game's .pak files.

Building the native code

(Unix users need to follow this step. Windows distributions containpre-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, andplace the resulting package, named 'qwpython', in the current directory. So you should end up with something like:

qwpython-x.y/    build/    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 thepy_dm andpy_ctfdirectories. If you want to translate your own QC code, be sure to read the translator notes indocs\translate.html.

You might want to use a standard QuakeWorldserver.cfg file (usuallyin the same place as your .PAK files), that looks something like:

deathmatch 1hostname "Python-Powered Deathmatch"timelimit 15fraglimit 150maxclients 16rcon_password mypassmap 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 QWcommand line parameters, such as:+map dm1

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

Running as a WinNT/Win2k Service

The file ctf_service.py is an example of running a QWPython game as aservice. To install and run, use the commands:

  python ctf_service.py install  net start ctfpython

To stop and remove the service, try:

  net stop ctfpython  python ctf_service.py remove

You can also control the service through the Windows service controlpanel. Adapting this to other games besides CTF should be easy - nothingin the game itself changes, only the ctf_service.py has anything specificto Windows services in it.

About

QuakeWorld dedicated server wrapped up as a Python module, QuakeC -> Python game translator

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp