x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Frame rate drops over time because of Event Tick?

Hello. In my project, I have a sequencer connected to an event tick. This is causing my frame rate to drop to 10 in under a minute. In my blueprint, I need all of the things to be constantly running and checking for variables, branches, etc (that is why I hooked up the sequencer to the event tick). How would I be able to stop the lag, but not have to change everything? Thank you.

alt text

Product Version: UE 4.20
Tags:
eventtick.png (69.6 kB)
more ▼

asked Nov 27 '18 at 04:19 AM in Rendering

avatar image

NotOriginal22222
16 1 2

avatar image NotOriginal22222 Nov 27 '18 at 04:25 AM

Uh oh! I don't think it's the event tick after all. Please tell me if this is causing the lag, because even when hooking the event tick up to a 1-second delay, it still lags.

avatar image NotOriginal22222 Nov 27 '18 at 04:27 AM

Actually, it is confirmed. When I disabled the event tick, it didn't lag.

avatar image NotOriginal22222 Nov 27 '18 at 04:32 AM

When I put on a long delay (10 seconds), it takes longer for it to drop. Is it a node, or is it just too many things hooked up to the sequencer?

avatar image ThompsonN13 Nov 27 '18 at 04:55 AM

doing things on tick is generally a bad way to go, that is theres usually a better method that could be used. tick is an expensive operation when you have many things being run. just think if you have 20 pins off the sequence as you do, thats 20 scripts that need to be run between each frame. on a decently well optimized game thats lets say 60 times per second, so thats 1200 operations per second. and thats not even taking into account how complex the operations are. lets imagine you instead tried using a timer which loops every 0.2 seconds, in this case the sequence would only be run 5 times per second for a total of 100 operations per second. that simple solution would save you a bunch of performance with only slightly less responsiveness.

though a system where things are only run when needed would be better. maybe you could post more script and explain what your trying a bit more so we could propose alternative methods.

avatar image NotOriginal22222 Nov 27 '18 at 02:09 PM

most of the things hooked up to the sequence are variables connected to branches. So when the variable gets turned to true or false it activates something. the event tick helped with that because it would do the action on the exact moment and every millisecond practically, it would be checking.alt text

evwenti.png (292.0 kB)
avatar image ThompsonN13 Nov 27 '18 at 03:12 PM

so little info given. such spaghetti. what are your variables actually doing? i see you are repeatedly setting a snow variable to true (whats the point if its not allowed to change why keep setting it), but you are not actually calling any events. you really should consider re-configuring your script, most things could be done with loops or direct calling of events. for example where you set enable extra functions you could immediately have a function or call an event that sets the lightning var.

avatar image NotOriginal22222 Nov 27 '18 at 09:37 PM

the snow variable I could remove, it was just to test snow particles when the variable was true. also, a lot of the things the event tick leads off to is things such as casting to classes. I really need to organize, but for now, most of the things are either variables or casts. Also, should I make a function for every cast or just a function for all the casts? If I did a function for every cast (with a loop) that would be hard to keep track of. If I did a function for all them, would it lag still? Please let me know.

avatar image ThompsonN13 Nov 27 '18 at 11:03 PM

without context and knowing the end goal for each thing its hard to tell you to do A or B. we would need to go through each individual process to determine the best method to use.

optimization can be a tricky thing but basically doing less will give you better responsiveness. so doing less things or doing the same number of things simpler with less nodes, will give you better performance.

avatar image NotOriginal22222 Nov 29 '18 at 11:15 PM

I have fixed it! I basically removed ALL event ticks in my game (including event ticks in widgets and blueprints), and just replaced them with timers firing every 0.05 to 0.1 seconds! Thank you for the suggestion. I also organized everything. Thank you so much!!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question