Archived

This topic is now archived and is closed to further replies.

MagTDK

Halflife BSP format - were are the portals?

Recommended Posts

Does anyone know were the portals, that were used to generate the pvs, are stored in the halflife bsp file? This is what I have for the BSP format:
  
typedef struct                 // The BSP file header

{ long  version;               // Model version, must be 0x17 (23).

  dentry_t entities;           // List of Entities.

  dentry_t planes;             // Map Planes.

                               // numplanes = size/sizeof(plane_t)

  dentry_t miptex;             // Wall Textures.

  dentry_t vertices;           // Map Vertices.

                               // numvertices = size/sizeof(vertex_t)

  dentry_t visilist;           // Leaves Visibility lists.

  dentry_t nodes;              // BSP Nodes.

                               // numnodes = size/sizeof(node_t)

  dentry_t texinfo;            // Texture Info for faces.

                               // numtexinfo = size/sizeof(texinfo_t)

  dentry_t faces;              // Faces of each surface.

                               // numfaces = size/sizeof(face_t)

  dentry_t lightmaps;          // Wall Light Maps.

  dentry_t clipnodes;          // clip nodes, for Models.

                               // numclips = size/sizeof(clipnode_t)

  dentry_t leaves;             // BSP Leaves.

                               // numlaves = size/sizeof(leaf_t)

  dentry_t lface;              // List of Faces.

  dentry_t edges;              // Edges of faces.

                               // numedges = Size/sizeof(edge_t)

  dentry_t ledges;             // List of Edges.

  dentry_t models;             // List of Models.

                               // nummodels = Size/sizeof(model_t)

} dheader_t;
  
Note: this is the quake 1 format which appears to be the same as the halflife bsp format.

Share this post


Link to post
Share on other sites

I''m starting to think that they don''t save the portals that were used during PVS creation in the bsp file or any file for that matter. Can anyone confirm this?

I believe they do for quake 2, just not quake 1 or halflife. I say this because at flipcode, there''s an article on quake 2''s bsp fromat showing a lump for them.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Even in Quake 2, the areaportals aren''t the same as the portals used to generate PVS.

They aren''t saved in Halflife BSPs, but you have access to the source code to their BSP compiler. You could certainly modify it to save that information.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
They''re not really portals, they''re ''VIS blockers.'' An areaportal prevents the engine from processing the stuff behind it. They''re commonly placed with doors to keep polys behind a close door from rendering.

Share this post


Link to post
Share on other sites
The portals are saved in a .ptl file during the QBSP process. They''re used by the LIGHT program to speed up the lighting calculations, and they''re fundamental to the workings of the VIS program.

But I don''t think they''re saved in the file format - there''s so many portals created that it''d bump up the filesize too much, besides which I don''t think HalfLife has any use for them...


btw. Anon - no, Quake generates it''s portals rather cleverly at the same time as the bsp constuction process.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by CatWeazle
btw. Anon - no, Quake generates it''s portals rather cleverly at the same time as the bsp constuction process.


I am aware of that. Those portals are not saved in the BSP, though - They''re just for computing the PVS data.

MagTDK was referring to the ''Areaportals'' lump in the BSP, which is something different.

Share this post


Link to post
Share on other sites