Reflective Flags

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8215
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:

Reflective Flags

Post by Major Cooke »

https://github.com/rheit/zdoom/pull/183

This adds a number of flags that deal with reflectivity.

(All of these require the REFLECTIVE flag to work.
  • THRUREFLECT - Projectiles are reflected, but they pass through the enemy instead of bouncing back. The velocity is not lost. Takes precedence over all others reflection modifying flags.
  • MIRRORREFLECT - Projectiles perform a direct 180 turn-around.
  • AIMREFLECT - Projectiles are aimed straight back in the direction of the original shooter. The speed of the projectile is unmodified.
Last edited by Major Cooke on Tue Dec 09, 2014 12:34 pm, edited 2 times in total.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: Reflective and Impact Pointer Flags

Post by D2JK »

Maybe a dumb question, but are the "HIT" flags related to Ed the Bat's "Set victim as tracer?" thread? I was just reading it up, and wondered about the same thing.

If so, brilliant!
User avatar
Major Cooke
Posts: 8215
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: Reflective and Impact Pointer Flags

Post by Major Cooke »

Yep.
User avatar
Nightfall
Posts: 555
Joined: Thu Aug 06, 2009 4:00 am
Location: Finland

Re: Reflective and Impact Pointer Flags

Post by Nightfall »

Graf Zahl wrote:This is never, ever, EVER going to work if it's implemented as a hack. Frankly, the whole thing is in despeate need of being cleaned up, unfortunately that will break lots of existing mods.
Really, the only solution I see is to add a few new pointers with completely unambiguous semantics and NO WRITE ACCESS from DECORATE at all!
Whatever happened to this ideology? :|
User avatar
Major Cooke
Posts: 8215
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: Reflective and Impact Pointer Flags

Post by Major Cooke »

Graf Zahl wrote:This is never, ever, EVER going to work if it's implemented as a hack.
Nightfall:

1. I'm not Graf.
2. I don't view this as a hack. I view it as the simplest solution to that suggestion. What Graf was talking about (correct me if I'm wrong Graf) was the whole pointers and introducing new ones that involved working solely for the purpose of projectile deaths.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Reflective and Impact Pointer Flags

Post by Fishytza »

I don't view it as a hack either. Although Graf did say "NO WRITE ACCESS from DECORATE at all" which I assume includes what you just implemented. (Actually, It's probably not implemented yet at the moment of typing.)

I'm not complaining, just a little amused that some things the devs rejected for various reasons such as "Not Needed, Too specific/niche, supports modder laziness" etc, you've managed to implement without much objection.
Maybe it's just me though.

Also, I think 'ideology' is a bit too strong if not outright dangerous word to use.
'Standard' or 'design philosophy' seem like a better description IMO.

EDIT: I was just wondering, could you tell me what's the actual usefulness of THRUREFLECT? What's the point of a projectile that passes through and changes its target field to the thing it just past through? Seems kind of odd.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Reflective and Impact Pointer Flags

Post by Gez »

The difference is that what Graf was talking about was a suggestion to make all projectiles unconditionally store the actor they hit in a pointer. This is not the case here, because it's conditional, depending on having one of these flags. It will have no gameplay effects on any existing projectile. What Graf was saying was that unconditional storing would have to be in a new pointer made specifically for that, precisely so as to have no gameplay effect on any existing projectile.

The "write access from DECORATE" thing was that this new pointer would be put outside the reach of functions such as [wiki]A_RearrangePointers[/wiki].
FishyClockwork wrote:I'm not complaining, just a little amused that some things the devs rejected for various reasons such as "Not Needed, Too specific/niche, supports modder laziness" etc, you've managed to implement without much objection.
Writing the code goes a long way towards making unneeded, niche-specific suggestions get accepted after all.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Reflective and Impact Pointer Flags

Post by Fishytza »

Gez wrote:Writing the code goes a long way towards making unneeded, niche-specific suggestions get accepted after all.
Apparently. This is why I find it amusing.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Reflective and Impact Pointer Flags

Post by Graf Zahl »

What's amusing? If someone who NEEDS the niche feature and goes out spending his own time implementing and testing it is a whole lot different than having a dev spend their time on it - someone who doesn't have a major interest in this feature.

That said, I think that some cleanup will be in order after this gets added. There's too many reflection-specific things spread out through the main flags now, they better get consolidated into their own ReflectionFlags field, just like it was done for bouncing flags.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Reflective and Impact Pointer Flags

Post by Fishytza »

Graf Zahl wrote:What's amusing?
Well, I always thought that one had to argue with the devs (or other 'influential users' who the devs respect) about whether a feature gets to be implemented in the first place. Even if the feature suggester was the one coding-in the feature.

(I remember something about being careful about what feature goes in, making sure it's not redundant and unnecessary because "it could be done much better with scripting", i.e. DoomScript/ZScript.)

But I guess I was totally wrong about that.

A bit tired at this point, but I think I'll say it anyway.
@Major Cooke
Maybe I'm wrong about this but you claim that all the new 'reflective' flags require REFLECTIVE to work.
However, i've noticed that apparently REFLECTIVE isn't needed for THRUREFLECT?
Spoiler: code
It seems to me that missiles will pass through and change their target even if the actor that is being past through lacks REFLECTIVE.
Again, kinda tired. Might have missed something. Apologies in advance.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Reflective and Impact Pointer Flags

Post by Graf Zahl »

You clearly misunderstand our motivations completely. Code submissions can and will be rejected if they are considered harmful to future stability or require constant maintenance in the future. What Major Cooke is doing here is far from both.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Reflective and Impact Pointer Flags

Post by Fishytza »

So to clarify.

Stability, functionality, and minimum maintenance are far more important to you than preventing redundancy and bloating the code?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Reflective and Impact Pointer Flags

Post by Gez »

Redundancy is mostly incompatible with minimum maintenance. When you have redundant code, it means you have to change two parts of code (or more, depending on level of redundancy) instead of just one when there is some maintenance to do there.

Stability, functionality, and minimum maintenance seem to be good priorities. Don't forget that one man's bloat is another man's dream feature, and vice-versa.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Reflective and Impact Pointer Flags

Post by Fishytza »

To give examples:

It is more important that:
Functions such as A_DamageTarget, A_DamageTracer, A_DamageSelf are reasonable stable and bug free.
(to be clear, I'm not saying they should be removed since, at this point, it's far too late.)

Rather than:
Seriously considering if the aforementioned functions are in fact redundant/code-bloat and are therefore unnecessary since a generic A_Damage function would be a much better candidate. After all, maintaining one is easier than maintaining three.
(A_DamageMaster in an exception because it's been around for a long time and must be maintained for backwards compatibility.)

I'm just trying (and apparently failing) to understand the policy about what sort of suggested features and/or code submissions are acceptable to implement.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Reflective and Impact Pointer Flags

Post by Gez »

Yeah I'm not sure either why there are all these variants, but it's not really code redundancy. Behind the hood, they're all the same function.
Spoiler:
See? Only _Siblings and _Children actually have some logic on their own, so as to iterate over the multiple valid targets. Having just one A_Damage function wouldn't really reduce actual code bloat.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”