🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Where to get a tutorial on multiple sector worlds...

Started by
2 comments, last by Confused 23 years, 11 months ago
Where can I get a tutorial on multiple sector. I know in the NeHe tutorials they say it is easy to implement and I believe I could do it but I want to know I was doing it right... So can someone post a link to a tutorial on this or give me a breif paragraph or 2 on how to do this? ------------- cOnfuSed
-------------cOnfuSed
Advertisement
Hi,
I think, what you want to do is Sectors, Portal. So it''s pretty easy.

typedef struct tagSectors
{
Polygons *Polys; // This is a list of ptrs to polygons that make this sectors
Portals *Portals; // This is a list of portal that are being a part of this sectors
Box BoundingBox; // With this, you can make a rapid check, did i''m maybe in this sector
};

So, the only thing that you have to do is check the sector you''re in, test each polys to check if you see it. Then Draw them. After that, check if you dont see any portal, when you see a portal, that mean you maybe see trought a door, a window, a hole, ... You you must check the next sectors which must be attached to the same Portal as well.

This is not very complecated to implent. But something harder to do is implement Portal with octree, this way it''s could be great.
In the case you want to use Octrees too, with your portal engine.
just replace Polygons *Polys in struct, by something like COctree Octree;

Happy Coding,
LowRad
Although the idea of testing sectors for speeding up your engine seems like a pretty simple idea, if you decide to pre-compile your PVS (potentially visible set) then you may get bogged down and give up.

I recommend that you look into BSP trees. Mr.Gamemaker just posted the first part of a great tutorial - the link is somewhere on the gamedev news. So long as you understand recursion, BSP is probably easier to implement (including compiling) than a full-blown PVS...

Look into it!



========
Smidge
smidge@smidge-tech.co.uk
========
--Mr Smidge
Thanks guys...you helped alot

-------------
cOnfuSed
-------------cOnfuSed

This topic is closed to new replies.

Advertisement