Make CheckSight clearscope.

Moderator: GZDoom Developers

Accensus
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Make CheckSight clearscope.

Post by Accensus »

I have this radar code and so far the only reason some of it is in play scope is because CheckSight is also play, so I can't move all of it to UI scope. But that's only half of the issue. The issue that I encountered just now, brought upon by the code being split into play and UI, is that the UI code destroys radar blips under certain conditions, and because the array containing the blips is created in play scope, I am unable to clean it up upon object destruction. I instead have to do a separate loop in WorldTick (every once in a while) to cull null references because otherwise the array would never be cleared and those would pile up.

tl;dr CheckSight not being play scope makes me double the number of loops which results in a mild performance impact that could otherwise be avoided entirely.

Would love to have that clearscoped so I can convert everything to UI scope and solve a bunch of headaches that I have, particularly performance ones.

EDIT: I kind of forgot I can modify data scope variables from within both UI and play, so that second loop isn't even needed. And on second look I can't even convert all of it to UI anyway. Oh well. Crisis averted. It'd be still nice to have CheckSight clearscoped, though.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Make CheckSight clearscope.

Post by Marisa the Magician »

CheckSight unfortunately has certain hardcoded RNG calls that make it unreliable for use in UI scope.
Accensus
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: Make CheckSight clearscope.

Post by Accensus »

Shame. But thanks for the info, still. On the bright side, it turned out that it doesn't really matter in my case so it's all good.

Return to “Closed Feature Suggestions [GZDoom]”