Virtual function for overriding hurtfloor damage

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Virtual function for overriding hurtfloor damage

Postby Marisa Kirisame » Sat Mar 07, 2020 9:28 am

I am suffering right now. This is one thing that always gives me trouble. I want a way to tightly control the way sector damage is handled by the player. Let's say for example, that I have a flight powerup, and I want to have it so the player never "touches the ground with their feet", in theory, they shouldn't take damage from hurtfloors, and yet they do if their origin is at floorz, no matter what. I could hack around this by giving them a powerironfeet too, but it obviously doesn't work with leaking floors. Another hack would be to restrict their minimum height to floorz+1, which is more reliable but looks weird and may cause problems.

Why can't I just... override the whole thing at the very source by having DoSectorDamage scriptified and made into a virtual function?
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Virtual function for overriding hurtfloor damage

Postby Graf Zahl » Sat Mar 07, 2020 9:36 am

Marisa Kirisame wrote:Why can't I just... override the whole thing at the very source by having DoSectorDamage scriptified and made into a virtual function?


Why don't you just... do it? ;)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Virtual function for overriding hurtfloor damage

Postby Matt » Sat Mar 07, 2020 7:12 pm

This could be helpful!

(Gotta admit though, that particular use case you describe sounds far more comfortable in my mind being done as forcing the player to be just a bit above floorz since that's what's "actually" supposed to be happening diegetically)
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Virtual function for overriding hurtfloor damage

Postby Nash » Sun Mar 08, 2020 1:47 am

Graf Zahl wrote:Why don't you just... do it? ;)


Not to be a dick or blame anyone but in her defense - and also can be seen with other external PRs - is that sometimes those PRs just sit there unattended for a very long time, then something changes so much in the engine and the PRs become dirty and by then the authors could have lost interest, or not even be available to fix them due to time schedule issues or anything like that. All I'm saying is, I can understand where the reluctance to send PRs comes from sometimes.

I understand time is short for everyone involved, which was why we had that internal discussion for a call for new developers on the team, which does indeed helps GZDoom a little but ever since that thread and new addition to the team was made, it appears the amount of open PRs on the Github is still 2 digits while there are still 300+ open bugs on the forum, so I'm not sure what else to suggest. :mrgreen:

That said though, yeah, I believe MK is capable of doing a PR of this, it appears (to my inexperienced eyes, at least) that exporting some virtuals to scripting does not require that high of a programming skill (compared to doing other more complex things in the engine, that is)... where it becomes complicated is if there's wrong or right way to do a certain thing, and/or whether doing something will degrade the engine's performance...

As for the topic itself: very helpful virtual, I have nothing more to add that hasn't already been said.
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Virtual function for overriding hurtfloor damage

Postby Rachael » Sun Mar 08, 2020 2:00 am

I think something that is a simple export, as long as a testable sample is provided, should prove to be easier to merge than most of the PR's that appear.

If no significant code changes are made and the code is easy to follow, it's going to get merged a lot quicker.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Virtual function for overriding hurtfloor damage

Postby Graf Zahl » Sun Mar 08, 2020 2:07 am

Nash wrote:
Graf Zahl wrote:Why don't you just... do it? ;)


Not to be a dick or blame anyone but in her defense - and also can be seen with other external PRs - is that sometimes those PRs just sit there unattended for a very long time, then something changes so much in the engine and the PRs become dirty and by then the authors could have lost interest, or not even be available to fix them due to time schedule issues or anything like that. All I'm saying is, I can understand where the reluctance to send PRs comes from sometimes.


You know, I repeatedly asked the other developers to be less hesistant about PRs, and yet, everybody defers it to me, they even open PRs themselves. Too bad if I cannot find the time to do it. Sorry, it doesn't work this way.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Virtual function for overriding hurtfloor damage

Postby Rachael » Sun Mar 08, 2020 2:09 am

Graf Zahl wrote:You know, I repeatedly asked the other developers to be less hesistant about PRs, and yet, everybody defers it to me, they even open PRs themselves. Too bad if I cannot find the time to do it. Sorry, it doesn't work this way.

Once bitten twice shy.

I've been yelled at more than once for things I've accepted. I don't particularly enjoy that (even on the honest rare occasion where it probably is warranted - I'll admit).

I don't know every single corner of the engine, certainly less than you do, I don't know what pitfalls to look for in every submission. And this gets even worse with the more complex submissions. Most of the time it's either really "merge this and see what bugs crop up" (which is a risk we're quite liberally willing to take with the more seasoned developers, anyhow) or just let it rot.

So most of the time if I merge something it's either have faith that it works (and pray that it doesn't have side effects, which you are sure to get on my case for), or be absolutely sure that there aren't any problems before taking it.

(FWIW I don't blame you for being protective - but if I knew the quirks and things I need to look out for in the general areas covered by every submission I think I'd be a lot more willing to review and merge them)
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Virtual function for overriding hurtfloor damage

Postby Graf Zahl » Sun Mar 08, 2020 3:14 am

If you are not sure, even doing a review of a PR, and if unsure asking specific questions, would help a lot. If I have to do the entire review process alone it's inevitable that only those things get added where I can quickly see that it most likely won't cause interference.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Virtual function for overriding hurtfloor damage

Postby phantombeta » Sun Mar 08, 2020 8:23 am

I don't merge PRs unless they're simple changes that I can verify are correct just by looking at the code, or they have test files. People don't seem to provide them usually, and I can't simply blindly trust someone saying the change works - specially considering they probably never tested the error cases, and have only tested it with the expected, valid input.

And for PRs that affect the renderer, I'll never merge those unless I have actual performance data on it so I can see if it messes up performance, which people never provide, even if asked as far as I can tell. (And I have absolutely no idea how to get proper performance data on C++ programs, so I sure ain't doing it for them)

And, of course, I'll never merge platform-specific PRs for Linux or Mac, because I have no means of verifying those, and I don't want to be responsible if those break either, considering I don't maintain them.

Additionally, there's at least 5 PRs with changes requested that were never updated after that, and there's nothing we can do about those.

I've actually been meaning to check Cooke's view angles PRs, he's even given me a test file, but I've been distracted by other stuff. (Mainly my own personal projects)
(A PR for this, by the way, would've fallen under the "simple changes that I can verify are correct just by looking at the code" part.)
Last edited by phantombeta on Sun Mar 08, 2020 8:27 am, edited 1 time in total.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: Virtual function for overriding hurtfloor damage

Postby Graf Zahl » Sun Mar 08, 2020 8:27 am

phantombeta wrote:I don't merge PRs unless they're simple changes that I can verify are correct just by looking at the code, or they have test files. People don't seem to provide them usually, and I can't simply blindly trust someone saying the change works - specially considering they probably never tested the error cases, and have only tested it with the expected, valid input.

And for PRs that affect the renderer, I'll never merge those unless I have actual performance data on it so I can see if it messes up performance, which people never provide, even if asked as far as I can tell. (And I have absolutely no idea how to get proper performance data on C++ programs, so I sure ain't doing it for them)


These are all good points. Yes, test files are a necessity, ESPECIALLY for changes to the renderer. And obviously, those where changes are requested but not implemented will end up ignored.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Virtual function for overriding hurtfloor damage

Postby Major Cooke » Sun Mar 08, 2020 8:48 am

User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests