Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
scifista42

XLAT or other redefinition of linedef action / sector effect 0 possible?

Recommended Posts

Is there any possibility (via ZDoom's XLAT or other special effect redefinition scripts) that linedef action 0 or sector effect 0 would ever mean something else than "no special action/effect" to some Doom engine, or can linedef action 0 and sector effect 0 always be safely considered to mean "no special action/effect"?

I'm asking because I want to know if a potential node builder or reject builder tool can always safely assume that when a given sector has sector effect 0, and the sector's tag doesn't appear on any linedef with an action other than 0, and the sector itself isn't on the back side of any linedef with an action other than 0, then the sector can never move its floor or ceiling either up or down, which can be taken advantage of during visibility checks, particularly when the sector's height is 0 (or under other special circumstances), for perfecting reject and node building.

Share this post


Link to post

Perhaps my chances to get an answer will improve if I ask the question simplified, so:

Is it feasible to algorithmically detect that certain sectors in a map will never change heights, and use this knowledge during advanced visibility calculations for creating very accurate REJECT tables, or even optimized NODE trees omitting segs that should never get rendered ingame?

(I proposed such an algorithm in my previous post: When a given sector has sector effect 0, and the sector's tag doesn't appear on any linedef with an action other than 0, and the sector itself isn't on the back side of any linedef with an action other than 0, then the sector should be static ingame, as in never change heights.)

Share this post


Link to post

I'm pretty sure that for linedef types and sector types, the engine uses a if (type != 0) { dosomethingwiththetype_probablyahugeswitchstatement(); } construction, so 0 will always be nothing.

You proposed algorithm, however, is not safe, since you must take stair builders into account.

Share this post


Link to post

A lot depends on what limitations of engine you are willing to accept.

In ZDoom, any linedef with a tag other than 0 can change its meaning through scripting.
As a corollary, any sector bordering such a linedef can be subject to a 'activate sector on the other side of the linedef' action.

Another thing that can affect untagged sectors are stairs - or donuts.

There's possibly some trickier things at play here that also may create some unintended side effects that would bresk such a map.

There's a reason why in GZDoom I do not even start to get into these things for optimizing the data for rendering.

Share this post


Link to post

Thanks for the reminders about stairs, linedef tags and such. Now let's say that the algorithm would consider each linedef action to potentially mean "build stairs like Doom and/or like Boom and/or like ZDoom", because XLAT, and expand the "dirty mark" (marking all sectors which can potentially change heights at runtime) to any sectors according to Doom's/Boom's/ZDoom's stairbuilding rules. The algorithm would also consider each linedef with a non-zero tag (or line ID) as having potentially any meaning, too. Would this make a foolproof algorithm?

I might be overthinking it. The algorithm could probably afford to disregard the possibility of XLATing actions/effects whatsoever, and just assume that the actions are standard Doom's ones, respectively Boom's, ZDoom's, Heretic's, Hexen's, etc, according to input instructions maybe. The resulting REJECT tables or NODE trees would potentially turn out to be buggy if the maps were run with a crazy future XLAT or another port-specific or game-specific action/effect redefinition script, but that might be OK to disregard for now.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
×