[No] Make CheckSight clearscope.

Moderator: GZDoom Developers

Make CheckSight clearscope.

Postby Accensus » Wed Dec 08, 2021 1:52 am

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.
Joined: 11 Feb 2016

Re: Make CheckSight clearscope.

Postby Marisa Kirisame » Wed Dec 08, 2021 6:18 pm

CheckSight unfortunately has certain hardcoded RNG calls that make it unreliable for use in UI scope.
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: Make CheckSight clearscope.

Postby Accensus » Wed Dec 08, 2021 9:39 pm

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.
Joined: 11 Feb 2016

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests