[No] Actor scripts stops ticking, based on players radius

Moderator: GZDoom Developers

Actor scripts stops ticking, based on players radius

Postby Steve5563 » Thu Sep 24, 2020 8:53 am

Request NO.1 - is it possible to add a flag to actors which can check to see if a player is inside a given radius value, if the player is not inside this given radius value of the actor the script stops ticking.
this is a cpu optimization idea for level designers that will have lots of level decoration actors placed in their level that uses scripts,
as i have noticed with hundreds of actors placed in a large level with "actor states" scripting the fps takes a decent hit,
but if you have the same number of actors in the same map that don't have any "actor states" scripting attached to them the fps is much higher so essentially you can add more actors to the map for the same fps.(decoration objects)

im guessing this is because the cpu has to run through all of the "actor state" scripts for each actor in the level at the same time,
what this flag can do for a level designer is by using the correct check player radius value given for those actors, the engine is now only operating the scripting that has the player within those given actors radius values.
eg. 2000 actors on the map with the flag attached to them with the radius values set,
while the player is inside 30 of those actor radius in the game,
the engine "activates the tics", and only runs through the scripting that is attached to those 30 actors and the rest of the actors in the level are in a "tic rate stopped mode".
so you should get close to the performance of 30 actors in your map that has actor state scripting applied to them and not the full performance hit of the 2000 actors.

Request NO.2 on top of the first feature that i have asked about is it possible to add a 2nd flag that can tell the engine to stop rendering based on a given radius. (actor draw distance)
if the player is within this given radius the engine renders the actor and if the player is not within this given radius distance the engine excludes rendering this actor.

can this feature also have some sort of "interpolating - fade to effect" so when the engine is excluding rendering this actor, the engine can change the given alpha value of ( 50/75/100%) and interpolate the value to 0% over a desired tic rate duration (35 tics) and then hold this value.
Once the player gets is inside the given radius the engine will then interpolate its alpha value from 0% to what the user originally set it to (50/75/100%) over a desired tic rate duration (35 tics),
and then continue to render the actor while the player is inside the given radius.
could this fade to tic rate time have a default time of (35 tics) in the engine but if the user really needs to they can set their own tic rate duration.
this would be a nice touch to make the draw distance pop in/out effect less cheap looking. (if possible)

if there is a better way of doing what i have requested here then please do that instead as i am no programmer its just an idea i have. cheers
User avatar
Steve5563
 
Joined: 28 Jan 2019
Location: Australia

Re: Actor scripts stops ticking, based on players radius

Postby Nash » Thu Sep 24, 2020 9:03 am

This was already answered and closed: viewtopic.php?f=18&t=69966
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Actor scripts stops ticking, based on players radius

Postby Rachael » Thu Sep 24, 2020 9:04 am

Also do not merge two requests into the same thread.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Actor scripts stops ticking, based on players radius

Postby Steve5563 » Thu Sep 24, 2020 10:06 am

yea no worries Rachel will keep that in mind for nest time,
yea Nash when i wrote the request i must have spent to long writing it and when i hit the submit button i was automatically logged out for some reason.
so the feature request never saved to my account and couldn't see it among the other feature requests in the main list. so i wrote it again not knowing it was already looked at.
User avatar
Steve5563
 
Joined: 28 Jan 2019
Location: Australia

Re: Actor scripts stops ticking, based on players radius

Postby Blue Shadow » Thu Sep 24, 2020 11:24 am

Steve5563 wrote:yea Nash when i wrote the request i must have spent to long writing it and when i hit the submit button i was automatically logged out for some reason.
so the feature request never saved to my account and couldn't see it among the other feature requests in the main list. so i wrote it again not knowing it was already looked at.

Since the post was made while logged out (as a guest), it needed to be approved by a moderator. That's why it "disappeared" after it was made.

Anyway, you now have ownership of that post.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests