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

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: clearscope on Actor.checkSight() and Actor.isVisible()

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

by Graf Zahl » Fri Mar 02, 2018 2: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.

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

by ZZYZX » Fri Mar 02, 2018 2: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.

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

by Graf Zahl » Thu Mar 01, 2018 6: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.

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

by Rachael » Thu Mar 01, 2018 5:19 am

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

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

by ZZYZX » Thu Mar 01, 2018 5:17 am

For client we should implement renderer-based ui-scope IsVisible. IMO
That should work both for C/S and current P2P networking.

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

by Graf Zahl » Thu Mar 01, 2018 3: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.

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

by Marisa the Magician » Wed Feb 28, 2018 5:58 pm

This Marisa feels the urge to fix the problem another Marisa has caused.

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

by phantombeta » Wed Feb 28, 2018 5:55 pm

@Marisa

Code: Select all

	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.

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

by Marisa the Magician » Wed Feb 28, 2018 5:50 pm

wait why the heck does checksight have rng calls?

Edit: god damn it marisa

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

by Kotti » Tue Jan 02, 2018 7: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.

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

by Gutawer » Tue Jan 02, 2018 6: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.

Top