snake-biscuits / bsp_tool

Python library for analysing .bsp files
GNU General Public License v3.0
103 stars 8 forks source link

Convert CSS/CSGO map to CSO2 #11

Open organnerx opened 3 years ago

organnerx commented 3 years ago

Hello! I didn't find a way to contact you directly so I have to ask it here. I run a community and EU/RU server of the game called Counter-Strike Online 2 which works on the modified Source engine. It is possible to add different custom content to the game, but not the maps. I'm looking for someone who is experienced in the .bsp format to create a map converter: CSS -> CSO2 or CSGO -> CSO2. If you like to try it I will drop you few CSO2 maps for investigation. Error 1) Different BSP version, 100 expected. Can be bypassed by editing .bsp file in hex editor. Error 2) Funny lump size. Stuck here. I heard some guys bypassed the funny lump size error by adding zeroes at the end of the lumps, but they gave up at the upcoming errors.

snake-biscuits commented 3 years ago

You can contact me on Discord, my tag is b!scuit#3659. I'll grab myself a copy of CSO2 so I can get the original maps and test any conversions I attempt. Can't promise I'll be able to make any progress anytime soon though, converting between branches can get hard.

I'm already looking at converting maps for Titanfall, so I am planning to make tools for this. However I'm pretty flat out with Uni & other life stuff at the moment so I can't make any promises.

If you can offer any kind of payment I'd look into allocating some time to it, but I need to prioritise my studies.

If you'd be more interested in mapping out CSO2's .bsp format, I wrote this guide a while back that may help: https://github.com/snake-biscuits/bsp_tool/wiki/Writing-a-custom-branch-script

If you develop a decent mapping for the format developing an converter function tool should become possible.

def css_to_cso2(css_map_filename: str):
    css_map = bsp_tool.load(css_map_filename)
    cso2_map = bsp_tool.ValveBsp(f"cso2/{css_map.filename}")
    for lump in css_map.HEADERS:
        lump_data = getattr(css_map, lump)
        # change the lump to CSO2 format
        setattr(cso2_map, lump, lump_data)
    cso2_map.save()