More actor functions should be data scoped?

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

Moderator: GZDoom Developers

More actor functions should be data scoped?

Postby Sir Robin » Mon Mar 14, 2022 8:32 am

In the actor class, some functions are clearscoped, such as isFrozen, SpawnHealth, GetMaxHealth, etc, but lots of functions like CanTouchItem, CanCollideWith, CanResurrect, GetBloodType, GetGibHealth, etc are left in play scope. I would think that any get* or can* or is* functions that just read data and return a value should be data scoped. Is there a reason they're left in play scope?
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: More actor functions should be data scoped?

Postby Graf Zahl » Mon Mar 14, 2022 8:38 am

Some require a play-side parameter or access play-side data and others have little use in UI code. Of the ones you listed the only one that might make sense to change is GetGibHealth.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: More actor functions should be data scoped?

Postby Marisa the Magician » Mon Mar 14, 2022 2:52 pm

I would definitely like GetGibHealth to be clearscoped, mostly to get rid of some hacks in LineTracer classes.
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#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: More actor functions should be data scoped?

Postby Sir Robin » Tue Mar 15, 2022 1:57 pm

I'm writing a feature on the UI to tell the player about the object in front of them. The alternate is to have a function that calls these from play scope and stores the results somewhere accessible from UI. I was just curious why they weren't already accessible there, if there was a reason or just an oversight.

The other ones I was thinking of were the GetUDMF* from line and sector structs

Marisa Kirisame wrote:I would definitely like GetGibHealth to be clearscoped, mostly to get rid of some hacks in LineTracer classes.

If you know about the Line Tracer class can you take a look at this? A line trace will pass through a 3d floor if it touches a poly object first.
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: More actor functions should be data scoped?

Postby AFADoomer » Tue Mar 15, 2022 5:42 pm

The same could be said for most "Get*" Side/Line/Sector functions...

I would love to be able to use these to (for example) properly retrieve a Side texture Y offset from inside of a LineTracer callback in order to check if the tracer actually hit the texture of a non-wrapped midtex.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: More actor functions should be data scoped?

Postby Graf Zahl » Wed Mar 16, 2022 1:18 am

The line tracer should be play scope. Please don't tell me it isn't. :?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: More actor functions should be data scoped?

Postby Marisa the Magician » Wed Mar 16, 2022 4:12 am

it's entirely data scope.
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#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: More actor functions should be data scoped?

Postby phantombeta » Wed Mar 16, 2022 1:12 pm

Graf Zahl wrote:The line tracer should be play scope. Please don't tell me it isn't. :?

Why should it be play scope? That'd severely limit its usability, and as far as I know, LineTracer (due to requiring you to implement the whole trace callback manually) entirely bypasses the stuff in the default line-tracing code that causes external changes.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: More actor functions should be data scoped?

Postby Marisa the Magician » Thu Mar 17, 2022 7:09 am

I don't think I've ever needed to use a LineTracer from ui scope, though.
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#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: More actor functions should be data scoped?

Postby Graf Zahl » Thu Mar 17, 2022 8:06 am

The thing here is, the line tracer is fundamentally a play feature. With Play/UI we need to think in client/server terms. Play features run on the server and UI features run on the client. Running a line tracer would require a complete round trip from client to server to client to produce some results. Any such feature really should have no business whatsoever on the UI side if it was done properly.

Yes, I know, the engine is not C/S but it's things like this that make it so hard.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: More actor functions should be data scoped?

Postby Marisa the Magician » Thu Mar 17, 2022 8:58 am

I'd figure if it's made play scope, we can re-enable the flags for activating line cross specials with it, then (currently have to re-implement this in the callback itself by filling in an array of activatable lines for the user code to manually trigger).
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#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: More actor functions should be data scoped?

Postby JPL » Thu Mar 17, 2022 10:21 am

The main argument I can think of for making Trace available from UI scope is if you're doing the equivalent of client side only checks that are explicitly assumed to be unreliable, eg Quake 3's "ground trace" that runs on both server and client to do things like its client side prediction. https://github.com/id-Software/Quake-II ... ch?q=trace
That's obviously getting ahead of things a bit in GZDoom because it's not fully C/S but separating the concepts in anticipation of it being seems prudent.
Edit: but it would probably need to be a special version of Trace that disallows side effects?
User avatar
JPL
 
 
 
Joined: 09 Apr 2012

Re: More actor functions should be data scoped?

Postby Major Cooke » Thu Mar 17, 2022 5:04 pm

Graf Zahl wrote:The thing here is, the line tracer is fundamentally a play feature. With Play/UI we need to think in client/server terms. Play features run on the server and UI features run on the client. Running a line tracer would require a complete round trip from client to server to client to produce some results. Any such feature really should have no business whatsoever on the UI side if it was done properly.

Yes, I know, the engine is not C/S but it's things like this that make it so hard.


Mods like TargetSpy would not be doable if the ability to perform such functions outside of play scope was taken away. These rely on getting the player's target for example and displaying the names of the target, health bar, etc.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: More actor functions should be data scoped?

Postby Graf Zahl » Fri Mar 18, 2022 12:51 am

I know. But it''s these mods which make it virtually impossible to do a better multiplayer implementation. In a well designed environment they'd work by sending a request to the server and only print their information when the server sends the requested data back.

But since it's too late for that we'll be stuck with the current network system and never see Zandronum update.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: More actor functions should be data scoped?

Postby Nash » Fri Mar 18, 2022 1:11 am

Easy, just deprecate the old mods (they will never support the Zandronum update), modders who want to make their mods work with the Zandronum update will just have to update their works to the better-designed network API. :mrgreen:

Can't have your cake and eat it too especially where major progress is concerned
User avatar
Nash
AKA Nash Muhandes! Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Next

Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests