Retrieve spectator cameras coordinates from BSP?

  • If you're asking a question make sure to set the thread type to be a question!

teamwork.tf

L1: Registered
May 20, 2016
20
41
Hi, me again with a BSP file question! I've been looking into ways of exporting maps to either 3D formats, or just plain creating a better repository with accurate images, as the current sets seems to be a bit messy (outside for the TF2Maps repository).

Anyway, thanks to some helpful tutorials from TF2Maps, I learned about the existence of vbspinfo.exe, a utility which can provide the bounds of a map, given a BSP map. This is very useful with automation of screenshots, as I can use these coordinates to determine an accurate cl_leveloverview scale. So I can create (relatively okay-ish) automated level overview screenshots.

However, is there a utility or way to retrieve what the coordinates of spectator cameras are in BSP's? I could not find any resources.

Also vbspinfo.exe does not seem to work on every map. Something about a Lump error? Can this be resolved in an automated manner (e.g. not decompiling to vtm, open in hammer and re-save)?
 

henke37

aa
Sep 23, 2011
2,075
515
Or just peek at the entdata lump. It's the list of all the entities placed by the map and then some. You should have no issue finding the instances of the info_observer_point entity class and by extension the position, angle and FOV for each of them.

As for the lump error, it's likely that the map has per lump compression. Older tools don't expect that and don't know how to decompress the lumps. You should be able to losslessly decompress lumps using the bspzip command. Note that I say should. I don't trust the implementation to be bug free.
 

teamwork.tf

L1: Registered
May 20, 2016
20
41
Thanks for the tips! I'm now writing a script which retrieves the spectator camera's by decompiling the bsp's with BspSource to VMF, which seem to contain the info_observer_points.

Once it's worked out I will publish it for anyone to use as they wish.
 

henke37

aa
Sep 23, 2011
2,075
515
Decompiling is a lot of work compared to just reading the entdata lump. Decompiling is also far from an accurate affair.
 

teamwork.tf

L1: Registered
May 20, 2016
20
41
In that case I will try out extracting the entdata lump from the bsp instead. Thanks for the tip!
 

Exactol

Certified Hammer Hacker
aa
Jul 11, 2013
421
537
I've extracted data from bsps before, feel free to send a message if you need any help.