clearscope on Actor.checkSight() and Actor.isVisible()

These are not rejected - but are not considered highly important right now.

Moderator: Developers

clearscope on Actor.checkSight() and Actor.isVisible()

Postby Gutawer » Tue Jan 02, 2018 7:45 am

I need to check if a monster can see the player in renderOverlay to determine whether to render some stuff, but right now, checkSight and isVisible are play-scope only so I can't do this. It doesn't seem that making these clearscope should be harmful, as they are just checking line of sight between two actors, so it'd be nice if this could be done.
User avatar
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby Kotti » Tue Jan 02, 2018 8:35 am

I don't think this is possible. P_CheckSight contains calls to a random number generator which would go out of sync when being called from the UI.
Kotti
 
Joined: 27 Dec 2016

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby Marisa Kirisame » Wed Feb 28, 2018 6:50 pm

wait why the heck does checksight have rng calls?

Edit: god damn it marisa
Last edited by Marisa Kirisame on Wed Feb 28, 2018 6:57 pm, edited 1 time in total.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby phantombeta » Wed Feb 28, 2018 6:55 pm

@Marisa
Code: Select allExpand view
   if ((flags & SF_IGNOREVISIBILITY) == 0 && ((t2->renderflags & RF_INVISIBLE) || !t2->RenderStyle.IsVisible(t2->Alpha)))
   { // small chance of an attack being made anyway
      if ((bglobal.m_Thinking ? pr_botchecksight() : pr_checksight()) > 50)
      {
         res = false;
         goto done;
      }
   }

For some reason, it does this.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: doom2fan

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby Marisa Kirisame » Wed Feb 28, 2018 6:58 pm

This Marisa feels the urge to fix the problem another Marisa has caused.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby Graf Zahl » Thu Mar 01, 2018 4:41 am

Sorry, but RNG issue aside, CheckSight cannot be made clearscope before we do not have a clearer picture of how this will be represented on the client side in a C/S environment, as this runs on the full set of play data and would necessitate making a full copy of it each frame - and that's too big a can of worms in the current state.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby ZZYZX » Thu Mar 01, 2018 6:17 am

For client we should implement renderer-based ui-scope IsVisible. IMO
That should work both for C/S and current P2P networking.
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby Rachael » Thu Mar 01, 2018 6:19 am

How is that going to be implemented without being too costly?
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby Graf Zahl » Thu Mar 01, 2018 7:04 am

Not at all, that's how. I won't make any decisions here before we have at least a rough picture how C/S will have its data laid out.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby ZZYZX » Fri Mar 02, 2018 3:32 am

Rachael wrote:How is that going to be implemented without being too costly?

With renderer reporting what was drawn? I mean, that info is already stored (the renderer collects actors for rendering before actually doing it). And it can be a flag or something similar to what I said about checking sight for particles by marking sectors rendered in the last frame by the renderer.

Once the renderer somehow marks the actors with an unique id of the frame drawn (validcount) then there's almost no overhead and the visibility check can be done using simple int comparison (including portals, camtexs, skyboxes...)

And @Graf this approach has nothing to do with networking because I doubt that the data about rendered actors is going to be absent from the client. (or that clientside scripts are going to be absent from the client)
Both makes zero sense.
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: clearscope on Actor.checkSight() and Actor.isVisible()

Postby Graf Zahl » Fri Mar 02, 2018 3:38 am

That doesn't work because sprites are processed by sector, i.e., only a single subsector needs to be visible for a sprite in the containing sector to be run through the renderer.
That data is totally useless for analysis. You'd get far too many false positives.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to On Hold Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest