Jump to content
  • Advertisement

Archived

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

gorgorath

removing polygons from quake maps

This topic is 5224 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After implementing a CSG process that compiles quake 3 maps ( not the BSP ones ) i''ve found myself with a awful lot of polygons that are never seen. Basically this polygons seal of the world, they can be removed safely. But how to achieve this, should I build portals to determine which polygons are inside the world. Or is there a easier work around? I was thinking of shooting a ray alongs the polygon''s normal and if no intersection with another plane is found it is safe to remove this polygon, this however has some level-design drawbacks and isn''t that fast( consideringen 50000+ polygons a level ) so are there any other routines? thanks in advance Paul

Share this post


Link to post
Share on other sites
Advertisement
Yes, I think that if you construct portals, then it will be easier to determine this...

If a certain leaf of polygons isnt seen from any other leaf then perhaps it should be classified for deletion...

... none the less i think that this should still be a human-supervised procedure, just to be sure you arent removing a more secluded part of the level or something...

If you need any help with Portal Generation, ask away, ill try to find and share some resources...

Salsa cooked it, your eyes eat it!
[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][My DevDiary]
[Yann L.][Enginuity] [Penny Arcade] [MSDN][VS RoadMap][Humus][BSPs][UGP][NeHe]
"our stupidity allways comes back to bite us in the ass... in a white-shark sort of way..." - Prozak

Share this post


Link to post
Share on other sites
thnks for the reply,

i haven''t looked into portals myself.
But should I build a BSP tree for this? Since I really don''t want to use it, for the collision detection i''ll stuck with octree and for the rendering i''ll use a portal technique.

Paul

Share this post


Link to post
Share on other sites
The way quake (qbsp) dealt with this was to do a CSG union operation on all the brushes in the level, this removed any geometry of a brush that penetrated other brushes.

Once this was done, a BSP was calculated and then portals were generated using the splitting planes as guides. Then a portal adjaceny graph was constructed (basically saying which leaves were connected by which portals) and a flood fill was performed starting from player spawn point entities that had been placed inside the map.

Think of it putting a water fawcet in a leaf with a spawn point and turning it on. Once the leaf filled up, the water will spill over though the portal and fill up the next leaf. Once the entire level was flooded, any leaves that were not flooded with water had their polygons removed from the list. These leaves were the ones that contained the outfacing skin of the level after the CSG union op. had been done.

Once this was done another BSP tree of the geometry was constructed and is what was used in the final .bsp

-=[ Megahertz ]=-

Share this post


Link to post
Share on other sites
I believe the Q3 bsp process adds a box around the level, expanded a little from the bounding box. Then starting from a point inside this box (near the side, less that the expansion factor so that it''s sure to be outside) it removes all faces for that leaf, then moves on to its adjacent leafs connected by a portal. When this process finishes the outside of the map has been stripped off.

For each leaf it checks if a path can be found to the playerstart without passing through a solid leaf, if it can it will print ''Leak''.

Share this post


Link to post
Share on other sites
I think you can use Portals with Octress, i have never worked with octrees before.

The point here is to eliminate unseen geometry, right? After you aply the portal code, locating this unseen geometry should be relatively easy.

None the less, doing it using a BSP tree may be simpler...

Salsa cooked it, your eyes eat it!
[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][My DevDiary]
[Yann L.][Enginuity] [Penny Arcade] [MSDN][VS RoadMap][Humus][BSPs][UGP][NeHe]
"our stupidity allways comes back to bite us in the ass... in a white-shark sort of way..." - Prozak

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Rubber! Somebody?

Share this post


Link to post
Share on other sites
quote:
Original post by Megahertz
Then a portal adjaceny graph was constructed (basically saying which leaves were connected by which portals) and a flood fill was performed starting from player spawn point entities that had been placed inside the map.

I hate to be pedantic, but I''m pretty sure it was the other way around The flood fill started from the outside of the map and worked inward. If an entity was found, it indicated a leak in the map. Once the fill was complete, all filled leafs were marked as solid. In essence, what Fidelio66 says happens for Q3 BSP compiles. This doesn''t solve the problem of removing leafs that are never reached, but really a "leaf that can''t be visited" only makes sense within the context of the game logic. Who knows, maybe a mapper wants to make an Easter Egg only available via noclip off in the corner of the map

I''m using Half-Life compile tool source code as a reference, which is based up the Quake 1 engine and compile tools, so things should be extremely similar.

Share this post


Link to post
Share on other sites
"I hate to be pedantic, but I''m pretty sure it was the other way around The flood fill started from the outside of the map and worked inward."

How do you determine if a leaf is an outside leaf?

-=[ Megahertz ]=-

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!