Advanced visibility-filtering

Moderator: GZDoom Developers

Post Reply
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Advanced visibility-filtering

Post by FDARI »

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 234 times
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: Advanced visibility-filtering

Post by Major Cooke »

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?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Advanced visibility-filtering

Post by Xaser »

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. :)
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Advanced visibility-filtering

Post by Nash »

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.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: Advanced visibility-filtering

Post by amv2k9 »

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.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Advanced visibility-filtering

Post by NeuralStunner »

It works by pointers, not class.

[wiki=Actor_properties#VisibleToPlayerClass]We already have a visibility filter by class[/wiki].
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Advanced visibility-filtering

Post by Nash »

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...
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”