Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Portals - what's the best approach to divide sectors?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
Koobazaur
Member


Joined: 08 Mar 2007
Posts: 22

PostPosted: Tue Oct 09, 2007 12:42 am    Post subject: Portals - what's the best approach to divide sectors? Reply with quote

Greetings,

I've been working with Deled for a while creating levels for my little DirectX project. I want to implementa Portal Engine so, needless to say, I need to "bend" Deled to work with that. I am going for the "hand-made" portals approach.

Now, placing a portal is easy (just do a rectangle with a name (or class name) "portal" and have my engine deal with that). However, portal polygons by themselves don't do much, they need to be tied to specific sectors... and so the question arises, how can I divide my world into sectors?

The most obvious answer is - use the grouping! Problem is, the feature is buggy, and thus I cannot use it.
Another idea would be to simply give my shared polygon's the same name or a tag... but the problem is, there is no easy way to distinguish in Deled which polygons have what names (thus what belongs to what sector) short of clicking on every single object to find out. I can't "group-select" a sector this way either.

Merging is a no-no either, as it will prevent me from modifying the geometry afterwards (or make it very annoyingly painful).

Another idea is to have each sector be a separate file, but that is rather annoying (especially in my level with lots of rooms, all of which I want to make a separate sector) and makes it difficult to align everything correctly (and ensure matching proportions).

I would really hope the grouping bug I posted gets resolved as that would be an amazing way to divide my world into sectors (and make it easy editable via select -> freeze all but selection), but alas, it doesn't work...


Last edited by Koobazaur on Tue Oct 09, 2007 12:49 am; edited 1 time in total
Back to top
View user's profile Send private message
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Tue Oct 09, 2007 1:20 am    Post subject: Reply with quote

Just keep all the sector polygons inside the sector box itself. Than do a check to see which sector it belongs to when you load your file. Any polygon inside a sector box is part of that sector.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Koobazaur
Member


Joined: 08 Mar 2007
Posts: 22

PostPosted: Tue Oct 09, 2007 2:05 am    Post subject: Reply with quote

I was thinking about it, using some sort of portal-bounds, but realized that they are too limiting. That is, there are certain shapes that cannot be approximated by a simple box or sphere.

That, and placing a huge box over half my map wouldn't be very convinient for editing said map (especially since I can't group the sector boxes and hide them because of screwy grouping)...
Back to top
View user's profile Send private message
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Tue Oct 09, 2007 11:50 am    Post subject: Reply with quote

Koobazaur wrote:
I was thinking about it, using some sort of portal-bounds, but realized that they are too limiting. That is, there are certain shapes that cannot be approximated by a simple box or sphere.
If a triangle is in one of the portal boxes, it belongs to that sector. Where is the hard part? I don't understand you?

Quote:
That, and placing a huge box over half my map wouldn't be very convinient for editing said map (especially since I can't group the sector boxes and hide them because of screwy grouping)...
Freeze them, and use a transparent material. Then they will never bug you again while you edit.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jwatte
DeleD PRO user


Joined: 26 Apr 2006
Posts: 513

PostPosted: Tue Oct 09, 2007 5:10 pm    Post subject: Reply with quote

You need shapes other than just rectangular blocks for your sectors. You might want to look into using, say, extruded polylines to support this.
Back to top
View user's profile Send private message
Koobazaur
Member


Joined: 08 Mar 2007
Posts: 22

PostPosted: Tue Oct 09, 2007 7:26 pm    Post subject: Reply with quote

Daaark wrote:

That, and placing a huge box over half my map wouldn't be very convinient for editing said map (especially since I can't group the sector boxes and hide them because of screwy grouping)...
Freeze them, and use a transparent material. Then they will never bug you again while you edit.[/quote]

What if I don't want my sector to be a box? What if it doesn't make sense? Imagine a zig-zaggy corridor interweaving with another corridor. You can't just put a box around it as you would end up catching in polygons that shouldn't be in there (from the other corridor). Also, using multiple boxes for a single sector is also painful especially when working with uneven and complex sectors.
Back to top
View user's profile Send private message
jwatte
DeleD PRO user


Joined: 26 Apr 2006
Posts: 513

PostPosted: Wed Oct 10, 2007 2:21 am    Post subject: Reply with quote

As I said: use a polyline.

However, most zone/portal systems want the zones to be convex, and non-overlapping. Convex, because of certain geometric properties (any line from within two points will not exit the zone), and non-overlapping because you can't do point-to-zone tests otherwise.

The zig-zag corridor would likely be a lot of zones; one per zig (and one per zag :-)
Back to top
View user's profile Send private message
Koobazaur
Member


Joined: 08 Mar 2007
Posts: 22

PostPosted: Wed Oct 10, 2007 8:27 am    Post subject: Reply with quote

jwatte wrote:
As I said: use a polyline.

However, most zone/portal systems want the zones to be convex, and non-overlapping. Convex, because of certain geometric properties (any line from within two points will not exit the zone), and non-overlapping because you can't do point-to-zone tests otherwise.

The zig-zag corridor would likely be a lot of zones; one per zig (and one per zag Smile


True, but with more complex structure this is almost always impossible unless you cut up a single room into several portals. Heck, even a door frame sticking to the inside would instantly make it non-convex, but it would be a terrible idea to divide the room into three sectors (to the left, top, right of doorframe extending into the room) just for the sake of convexity...
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Wed Oct 10, 2007 12:07 pm    Post subject: Reply with quote

But that's a problem your engine needs to tackle, right? Are you saying it supports non-convex zones?
Back to top
View user's profile Send private message Visit poster's website
jwatte
DeleD PRO user


Joined: 26 Apr 2006
Posts: 513

PostPosted: Wed Oct 10, 2007 9:03 pm    Post subject: Reply with quote

Convex sectors is different from convex geometry.

You can do concave sectors with polylines, if you want -- you just have to be more careful in how you construct the engine.
Back to top
View user's profile Send private message
Koobazaur
Member


Joined: 08 Mar 2007
Posts: 22

PostPosted: Thu Oct 11, 2007 11:44 pm    Post subject: Reply with quote

Paul-Jan wrote:
But that's a problem your engine needs to tackle, right? Are you saying it supports non-convex zones?


Yes, as it's often far more efficient. The issue in this thread isn't how to handle it from programming perspective, but how do I tell my engine which polygons go with which portals in the level...

jwatte wrote:
Convex sectors is different from convex geometry.


How so?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum