Please or Register to create posts and topics.

Too many triggers overlapping? [map optimisation]

Hey guys!

I'm finishing a very complex map, not only because it is indeed complicated puzzle-wise, but because it has some hidden rooms, apart from around 8 main areas and what is worse, it's based in bouncing gel and conversion gel, and to move them both by means of orange and blue funnels. The player ends up painting with conversion gel a fairly big part of the central area in order to reach many other subareas by being funneled... And I'm in the fine-optimisation part of the job :D

It's a 'remix' of one of Chander's maps. His 12th.

Apart from the skip/hint brushes to help vvis to delimit the most outstanding portals and main areas (and observations rooms, unused places, etc. etc.), I like to use areaportals everywhere I can and I use to make them open/close as the player moves along the map... But I'm having some weird troubles with this one, right because of its structure. Maybe my approach was wrong in the first place: I closed 5 areas by areaportals, ok? and I focussed in each of them (one by one) placing a bunch of triggers covering each possible position the player could be into with the typical outputs OnStartTouch > areaportal > Open and OnEndTouch > areaportal > Close... Since this map allows the player to move really freely all around and reach many areas/views with the conversion gel and the funnels, I ended up creating many trigger_multiple brushes for each sealed area to avoid the player from viewing any of the areaportals closed...

I repeat that maybe my approach was wrong in the first place (I deleted all of the triggers to use a different approach today :D)

The problem is that there are at least 2 points where the triggers seem not to be working out properly, and here comes my question: if the player walks through a trigger brush and while still standing into the area of that first trigger brush he enters into another trigger's area, and both have no opposite outputs that cause a conflict, could it be that the mere act of triggering a new trigger (e.g. smaller) inside another one (e.g. bigger onw) is interrumpting the first outputs chain or connection in order to arrange the new one?

Let me explain myself: in my case, I enter in a trigger area that outputs OnStartTouch > areaportal > Open; then I continue walking and without leaving the first trigger area I enter another trigger area that outputs another OnStartTouch > areaportal > Open but related to a different areaportal (and both areaportals are far away from each other, ok?), now, could it be that the second triggering is interrupting the first one? because to me it seems so, and I end up watching the first areaportal closed as if the output OnEndTouch > areaportal > Close would have been fired...

Anyone who knows about this? :notworthy:

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

Hi, Jose. I've just recreated your issue in a simple test room and has no problem with overlapping triggers.
Try enter in the console developer 2 and check what outputs and inputs are when you enter or exit triggers.

God bless the quick save's inventor...(Portal: Prelude)

I don't want to spoil the fun, but it doesn't sound to me like you're making appropriate use of areaportals. If you're trying to manually do with triggered areaportals what the engine is already doing with visleafs, then you're doing it wrong.

josepezdj wrote:
I like to use areaportals everywhere I can and I use to make them open/close as the player moves along the map...

This is exactly what visleafs and vis calculation are designed to do, automatically. Of course there are some cases where you will want to use hints as well, but it sounds like you have that covered.

josepezdj wrote:
Since this map allows the player to move really freely all around and reach many areas/views with the conversion gel and the funnels, I ended up creating many trigger_multiple brushes for each sealed area to avoid the player from viewing any of the areaportals closed...

The only reason for using an areaportal for this is if the player can see them closed (e.g., door models that don't ordinarily block visibility when they are closed, or windows that close when the player is too far away to tell the difference). If you just want to prevent the engine from rendering a piece of the map when that piece is out of line of sight, use hint brushes.

The other reason for using areaportals is if you want visibility to be calculated per-object from a certain point of view. For example if you're expecting the player to look through a small window which would restrict his view, then this is a good candidate for areaportals. But this per-object calculation is expensive and can easily do more to hinder performance than to help it.

Mevious has a good point: "But this per-object calculation is expensive and can easily do more to hinder performance than to help it."

Hint and skip help the engine to tell what sees what. If you are in leafvis one, that visleaf can see two and three so two and three are rendered as well. Very simple.

Areaportals work different: they say: "Hey, There's something behind here; calculate what we can see!". Note the calculate part; it is a calculation; it costs performance. However; since it's also making sure things aren't rendered you should get a net performance gain.

Because valve knows that areaportals cost performance when open they allowed them to close as well. If the areaportal is closed it's like: "Hey, let's calculate what;s behind there... ah nevermind, probably not interesting; don't render anything!"

Once the areportal is opened again the game needs to calculate the stuff behind it again; costing performance.

In portal areaportals are common in doors: they prevent the elevator from being rendered whilst in the room for example. The I/O for them is also very easy Ondooropen() -> areaportal(open); OnDoorFullyClosed() -> close areaportal.

I would highly recommend only using the areaportals for those kinds of situations where the I/O is simple; if it gets so complicated like you describe it there will be a lot of calculations and you'll end up hurting the performance more than you help it.

greykarel wrote:
Hi, Jose. I've just recreated your issue in a simple test room and has no problem with overlapping triggers.
Try enter in the console developer 2 and check what outputs and inputs are when you enter or exit triggers.

Thank you Grey :D Sometimes I simply forgot the most basic debugging commands (I prefer ent_draw_message 1 though :thumbup:). However, what I described was the short version... in my case there were more than just 2 trigger areas overlapping and I'd like to do a further serious research about this step by step and isolating variables... just in cases I find something interesting (some kind of limitations) because I rechecked everything 100 times and that issue had no reason for being...

@Mevious: thank you so much. After reading your post and think, man, you are completely right :notworthy: I am not making an appropriate use of the areaportals even I've read many good tutorials and "I know how" to use them, while I don't :D ...lol what is overlapping here is the optimisation elements' functions :lol: I think my work with skip/hint brushes is enough. I'll do several tests and compiles this afternoon. Thank you!

Lpfreaky90 wrote:
Mevious has a good point: "But this per-object calculation is expensive and can easily do more to hinder performance than to help it."

Indeed! Again, Mevious, thanks for your clear and clever understanding and help! :thumbup: Yes, I think this much opening/closing areaportals is expensive and costs performance, it was not a good approach at all on my side!

So afterall, I was true that I was not doing an appropriate approach with regards to this map's optimisation, but not because of what i thought! I was doing wrong because I duplicated optimisation and I was more damaging performace than making it smoother.

Thank you guys (and gal)! :thumbup: I'll post some results later on!

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

This thread was jose's 1000th post. Congrats man :D

My Hammer Maps
[Released] Power Interference
[Released] Rust and Dust (Spotlight Map!)
[Released] Multiportal

Wow! yeah, thanks Cobra! :thumbup: those are some, right? :D I hope that at least a 25% of those posts were helpful for someone!

Now.... tet's go for the 2000!! ....let's :blah: :blah:

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]
josepezdj wrote:
Wow! yeah, thanks Cobra! :thumbup: those are some, right? :D I hope that at least a 25% of those posts were helpful for someone!

Now.... tet's go for the 2000!! ....let's :blah: :blah:

Or were they? :blah: for the sake of :blah: is not helpful to anyone...
Or is it?

P.S. :blah:

?????????????????????????????TWP Releases | My Workshop