View previous topic :: View next topic |
Author |
Message |
Koobazaur Member
Joined: 08 Mar 2007 Posts: 22
|
Posted: Tue Oct 09, 2007 12:42 am Post subject: Portals - what's the best approach to divide sectors? |
|
|
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 |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Tue Oct 09, 2007 1:20 am Post subject: |
|
|
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 |
|
|
Koobazaur Member
Joined: 08 Mar 2007 Posts: 22
|
Posted: Tue Oct 09, 2007 2:05 am Post subject: |
|
|
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 |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Tue Oct 09, 2007 11:50 am Post subject: |
|
|
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 |
|
|
jwatte DeleD PRO user
Joined: 26 Apr 2006 Posts: 513
|
Posted: Tue Oct 09, 2007 5:10 pm Post subject: |
|
|
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 |
|
|
Koobazaur Member
Joined: 08 Mar 2007 Posts: 22
|
Posted: Tue Oct 09, 2007 7:26 pm Post subject: |
|
|
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 |
|
|
jwatte DeleD PRO user
Joined: 26 Apr 2006 Posts: 513
|
Posted: Wed Oct 10, 2007 2:21 am Post subject: |
|
|
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 |
|
|
Koobazaur Member
Joined: 08 Mar 2007 Posts: 22
|
Posted: Wed Oct 10, 2007 8:27 am Post subject: |
|
|
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 |
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 |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Wed Oct 10, 2007 12:07 pm Post subject: |
|
|
But that's a problem your engine needs to tackle, right? Are you saying it supports non-convex zones? |
|
Back to top |
|
|
jwatte DeleD PRO user
Joined: 26 Apr 2006 Posts: 513
|
Posted: Wed Oct 10, 2007 9:03 pm Post subject: |
|
|
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 |
|
|
Koobazaur Member
Joined: 08 Mar 2007 Posts: 22
|
Posted: Thu Oct 11, 2007 11:44 pm Post subject: |
|
|
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 |
|
|
|