mameau redbubble image
Get Shirty!Keep us online, Buy some kit.

Converting QuakeLive Maps to Q3A Engine Games

I have been playing World of Padman (based on the Q3A engine) with my son recently and I wanted to throw in a couple of classic duel levels from previous quake titles. Maps like Aerowalk and the Edge are personal favourites. While neither the Q3A nor the QuakeLive map versions are exact replicas of the original Quake 1 maps they are close enough for my son to get the general flow/experience. Just out of curiousity I decided to look at converting the QuakeLive Map versions across just out of curiosity. The method below will convert them for use with Q3A engine titles but there are missing shaders.

Decode the QuakeLive pk3 file(s):

$ wget http://aluigi.altervista.org/papers/quakelivedec.zip
$ unzip quakelivedec.zip
$ sudo apt-get install build-essentials
$ gcc quakelivedec.c -o quakelivedec
$ quakelivedec ~/.quakelive/quakelive/baseq3/aerowalk.pk3 aerowalk_dec.pk3

Convert the BSP file to the correct version for the Quake 3 Engine.

$ ql2q3a.py aerowalk_dec.pk3

Use this Python Script to convert bsp file in the decrypted pk3, (will only work with single BSP files)

#!/usr/bin/env python

import binascii
import sys
import os
import zipfile

def convert_bsp(bsp_data):
    map_ver = binascii.hexlify(bsp_data[1][4])
    if map_ver == '2e':
        game_ver = "Quake 3 Arena"
        map_ver = '2f'
    elif map_ver == '2f':
        game_ver = "QuakeLive"
        map_ver = '2e'
    print "This is a " + game_ver + " map, converting"
    new_bsp = bsp_data[1][:4] + binascii.unhexlify(map_ver) + bsp_data[1][5:]
    return new_bsp

def read_pk3(file, ext=".bsp"):
    with zipfile.ZipFile(file, "r") as z:
        for name in z.namelist():
            if os.path.splitext(name)[1] == ext:
                data = z.read(name)
                return name, data
        z.close()
    return None

def write_pk3(file,input,output):
    with zipfile.ZipFile(file, "a") as z:
        z.writestr(input,output)
    z.close()
    return

def main():
    if len(sys.argv) > 1:
        map_name = sys.argv[1]
    else:
        print "Include path to map file (e.g. <pathto>/file.pk3)"
        sys.exit()
    game_ver = "Unknown"
    print "Input: " + map_name
    bsp_data = read_pk3(map_name)
    c_map = convert_bsp(bsp_data)
    write_pk3(map_name,bsp_data[0],c_map)

if __name__ == "__main__":
    main()

 

You will also need to decode all the standard pakX.pk3 files and copy them across to enable most shaders. In reality I will probably just end up using the original Q3A versions instead of the QuakeLive version but it was an interesting experiment none the less.

Show Buttons
Hide Buttons