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"

Updating instances in a function which is looped with a timer is killing fps

I have this function:

alt text

It is called by a timer every 0.1 seconds:

alt text

The function is updating 500 instances. Unfortunately, this is decreasing the fps extremely. The stats look like this:

alt text

But the stats are wrong, I get something like 2 fps. The stats don't even make sense, since either GPU or Game has to be equal to the frame time. So, I get 2 fps.

If I disconnect the timer and instead run the function every tick:

alt text

Then the fps should be even worse, but no, they are not! With running the function every tick, which is more often than 10 times a second, I get this stats:

alt text

And these stats are correct, it's running smoothly with ~30 fps. So the GrowTree function is called 30 times a second instead of 10 times with the timer, but the fps are 100 times better.

Does not make sense. So there has to be a bug with the timer.

Product Version: Not Selected
Tags:
more ▼

asked Apr 30 '15 at 07:34 PM in Bug Reports

avatar image

John Alcatraz
1.3k 57 139 125

avatar image John Alcatraz Apr 30 '15 at 07:50 PM

Here you have a repro project:

https://drive.google.com/file/d/0BzqDz_3FVfpOWE1wTlpGQmNuVTQ/view?usp=sharing

Just open the Trees blueprint and disconnect the timer and connect the function to the tick to see the difference.

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

2 answers: sort voted first

Hi John Alcatraz,

I have been able to reproduce this on my end and have entered a bug report, UE-14819 to be assessed by the development staff.

more ▼

answered May 01 '15 at 02:51 PM

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

There may be a few things gs going on.

I would put a print statement in the function as its called and one when it completes. what happens if the function is called again before it completes.

This is an area you may want to put into C++ but you will still potentially have undefined behavior if you are modifying the contents of a list simultaneously. Regardless of the fps inconsistenvies I'd expect other bugs as well if that loop is run again before it completes the first time. If it is in series and is waiting to complete there is your blocking behavior.

more ▼

answered Apr 30 '15 at 07:58 PM

avatar image

mikepurvis
2.5k 101 66 260

avatar image John Alcatraz Apr 30 '15 at 08:02 PM

I am not modifying content simultaneously. You see, if I call the function every tick I get 30 fps. So if I want to do the same thing 10 times a second, I would not do anything simultaneously since 10 times a second fit's perfectly in 30 available fps, so the timer would just do the same thing as the tick, but just every third frame. But it does not, and this is the bug.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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