Advanced visibility-filtering

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Advanced visibility-filtering

Re: Advanced visibility-filtering

by Nash » Mon May 11, 2015 3:44 pm

Hey sorry for the bump, but I was wondering if this can be looked at again? I'm using an in-engine source modification to filter the rain sprites for multiple players for my real time weather engine but it would be great if it was implemented in normal (G)ZDoom so that no source hacks are required...

Re: Advanced visibility-filtering

by NeuralStunner » Wed Dec 14, 2011 3:35 pm

It works by pointers, not class.

[wiki=Actor_properties#VisibleToPlayerClass]We already have a visibility filter by class[/wiki].

Re: Advanced visibility-filtering

by amv2k9 » Wed Dec 14, 2011 3:28 pm

Xaser wrote:Goddamn! If I understand this correctly, this would make it possible to have generic weapon spawners in a class-based mod that spawn ALL classes' weapons and then make it so weapons for the other classes are both un-pickuppable AND invisible. Not bad at all. :)
If this is really how it works, it'd be especially good for multiplayer class-based mods.

Re: Advanced visibility-filtering

by Nash » Sun Dec 11, 2011 8:54 pm

Major Cooke, no. What this can be used for is, for example:

A) Spawning an actor that only its master Player is able to see (other players don't see it)
B) Spawning an actor that is only visible to other players but not myself (replicating the SpeedTrail, for example)

... among others.

Re: Advanced visibility-filtering

by Xaser » Sun Dec 11, 2011 7:34 pm

Goddamn! If I understand this correctly, this would make it possible to have generic weapon spawners in a class-based mod that spawn ALL classes' weapons and then make it so weapons for the other classes are both un-pickuppable AND invisible. Not bad at all. :)

Re: Advanced visibility-filtering

by Major Cooke » Sun Dec 11, 2011 7:15 pm

OH DAMN!

Now THIS is hot! I'm going to download this now and take a whack at it!

Out of curiosity, could this be used to apply hardware shaders to sprites, such as turning on and off a warping effect (ANIMDEFS style), or to change it's color?

Advanced visibility-filtering

by FDARI » Sun Dec 11, 2011 5:10 pm

The features for filtering by class and team are not always enough for what we/I/somebody want to do. Sometimes it would be useful to apply a different filter. With this patch, that is possible. This visibility is purely a rendering matter, and does not affect game logic. (The actor is not considered invisible when this feature prevents it from rendering for any given player)

Decorate property: int VisibleFilter
Decorate flag: FILTERHIDES

The filter uses AAPTR_ values to identify actors (players) that may render this actor.
If the filter is 0 no filtering occurs.
If FILTERHIDES is set, the filter identifies actors (players) that may not render the actor.

I have not set up string parsing for the VisibleProperty (yet). That means that the property in decorate syntax is next to useless. I might add that later, or try to make the decorate parser expression-aware (so that you can use named constants directly. This would change Actvation and other properties, which must now use string constants to identify individual flags. An expression aware parser would accept any constant decorate expression.)

However, you can change the flag and filter at runtime from ACS or decorate.

ACS-property identifiers:
APROP_VisibleFilter
APROP_FilterHides

Decorate declarations:
int VisibleFilter -- setting 0 will disable filtering (default)
flag FILTERHIDES -- only applies when VisibleFilter is non-0.

Decorate modifiers:
A_FilterVisibility(int filter)
A_ChangeFlag("FILTERHIDES", true|false)


For those who want to filter one actor so that only master sees it, and one so that only master does not see it, who also happen already to have this particular actor as an activator at some point in an acs script:

Code: Select all

SetActorProperty(0, APROP_VisibleFilter, AAPTR_MASTER);

Code: Select all

SetActorProperty(0, APROP_VisibleFilter, AAPTR_MASTER);
SetActorProperty(0, APROP_FilterHides, true);
Spoiler: Technical notes
Spoiler: About the demo
Attachments
visiblefilter.zip
(5.04 KiB) Downloaded 235 times

Top