wootguy / bspguy

Tool for editing GoldSrc maps without decompiling
The Unlicense
124 stars 28 forks source link

Export portal file from bsp #97

Open mfaizsyahmi opened 1 year ago

mfaizsyahmi commented 1 year ago

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.

Qwertyus3D commented 1 year ago

@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.

marigi64 commented 1 year ago

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 commented 1 year ago

@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.

UnrealKaraulov commented 1 year ago

@mfaizsyahmi bsp2ptr is opensource tool? how to download it?

I think it needed feature because some manipulation can destroy VIS data.

UnrealKaraulov commented 1 year ago

@wootguy you don't know ? BSP file contains needed information for writing .PRT file?

wootguy commented 1 year ago

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.

UnrealKaraulov commented 1 year ago

@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?

marigi64 commented 11 months ago

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.

20230801150748_1