Actor scripts stops ticking, based on players radius

Moderator: GZDoom Developers

Post Reply
User avatar
Steve5563
Posts: 82
Joined: Sun Jan 27, 2019 11:18 pm
Operating System Version (Optional): windows 10
Graphics Processor: nVidia with Vulkan support
Location: Australia
Contact:

Actor scripts stops ticking, based on players radius

Post by Steve5563 »

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
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Actor scripts stops ticking, based on players radius

Post by Nash »

This was already answered and closed: viewtopic.php?f=18&t=69966
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Actor scripts stops ticking, based on players radius

Post by Rachael »

Also do not merge two requests into the same thread.
User avatar
Steve5563
Posts: 82
Joined: Sun Jan 27, 2019 11:18 pm
Operating System Version (Optional): windows 10
Graphics Processor: nVidia with Vulkan support
Location: Australia
Contact:

Re: Actor scripts stops ticking, based on players radius

Post by Steve5563 »

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.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Actor scripts stops ticking, based on players radius

Post by Blue Shadow »

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.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”