bspguy
bspguy copied to clipboard
Export portal file from bsp
A shot in the dark here, but related to #96.
I want to re-VIS a bsp file so that the area with info_overview_point
is visible everywhere on the map. But VIS program requires a portal file, which doesn't come with maps you didn't compile yourselves.
There is a program called bsp2prt out in the wild, but it only takes in quake bsp maps. It refuses to take in goldsrc's bsp files. But this proves that it's technically possible to fish out portal data from a compiled BSP.
If #96 isn't going to be pursued, It'd be mighty helpful to finally have the goldsrc counterpart to the program, so that we can re-VIS existing maps. Perhaps to fix VIS glitches from the original VIS with modern tools.
@mfaizsyahmi I think it's probably possible to edit BSP in any HEX-editor and change its' header, to specify another BSP version. So this will hopefully 'demake' BSP into file, compatible with bsp2prt.
This unfortunately doesn't seem to work with bsp2prt. Changing the header to version 29 results in the program not generating any prt file.
@mfaizsyahmi I think it's probably possible to edit BSP in any HEX-editor and change its' header, to specify another BSP version. So this will hopefully 'demake' BSP into file, compatible with bsp2prt.
Doesn't work. I tested this route before I raised this issue.
@mfaizsyahmi bsp2ptr is opensource tool? how to download it?
I think it needed feature because some manipulation can destroy VIS data.
@wootguy you don't know ? BSP file contains needed information for writing .PRT file?
I don't think it does, but marking which leaves you want visible is doable. I guess there would be a leaf selection mode where selecting a face highlights all the faces in the same leaf. Then you could have a widget that lets you set the leaf to be globally visible.
I do feel like it should be possible to re-compile a bsp, starting from the BSP stage. After CSG finishes you get a set of faces which I think is similar to the final bsp but without any cuts. I couldn't get hlbsp to work with any faces I made though. I don't understand the compilation process well enough to get that working.
@wootguy I think PVS can be edited without problem https://www.youtube.com/watch?v=2Lkkyb7tuos (but this old version with bugs, in latest buld VIS Debugger works without problems), if need I can add edit option and compress vis data back after editing.
But if need do full revis, vis.exe requires .prt file, i don't know file format and specs, something like
<leaf num>
<portals num>
LEAFS:
1
1
1...
PORTALS:
<NUM VERTS> <LEAF1> <LEAF2> <xyz num verts times>
or for run vis.exe need something else?
Being able to edit Vis or recompile it would certainly come in handy. Some faces don't display in many old maps and I've been looking for a way to fix that without having to recompile the entire map.