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"

Editor World starts ticking in PIE if you press F8

For a while on our project we have had some big slowdowns when going out of the player with F8. The slowdown would get worse and worse until the editor becomes unusable. There would also be some huge memory spikes when stopping play. (up to 10 GB)

We just tracked it down to what seems to be a problem with AActor::ShouldTickIfViewportsOnly() We use this to draw quite a bit of debug graphics in editor mode when the game is not running.

It seems like when you unposses the actor with F8, this function starts getting called again and the Actors in the Editor World (Not the PIE world) start ticking again. (This seems like a bug?) But also all the debug graphics that would be drawn (We cant see it because we are in PIE) appears not to be cleaned up correctly, because the number of batched lines just keeps increasing. (We saw up to tens of millions of lines in the LineBatchComponent.

The workaround for us has been to use this line instead of just returning true:

bool ASomeActor::ShouldTickIfViewportsOnly() const { return GEngine->FindFirstLocalPlayerFromControllerId(0) == nullptr; }

This prevents ticking when the game is playing.

Product Version: UE 4.13
more ▼

asked Oct 19 '16 at 07:12 AM in Bug Reports

avatar image

31 2 4 14

avatar image TJ V ♦♦ STAFF Oct 19 '16 at 06:42 PM

Hey Amimoller,

I'm having issues reproducing this. Could you post a list of what debug commands are you using?

avatar image Amimoller Oct 20 '16 at 07:39 AM

I managed to reproduce this in the first person template. Here is how:

In Character.h add this:

 virtual bool ShouldTickIfViewportsOnly() const override;
 virtual void Tick(float DeltaSeconds) override;
 bool InGame;

in Character.cpp add this:

 void ACharacter::BeginPlay()
     // Call the base class  
     InGame = true;
 bool ACharacter::ShouldTickIfViewportsOnly() const
     return !InGame;
 void ACharacter::Tick(float DeltaSeconds)
         DrawDebugSphere(GetWorld(), FVector::ZeroVector, 2000, 300, FColor::Red);
         UE_LOG(LogTemp, Warning, TEXT("This should not log ingame"));

In the editor you will see the log print and the sphere in the world. Start the game, the log print will stop. Press F8 to go into fly mode. Log will start printing and your framerate will take a massive hit.

//Cheers Jonas

avatar image TJ V ♦♦ STAFF Oct 20 '16 at 07:29 PM

Could you test disabling the draw debug graphics and see if the performance still takes the hit? I just want to be sure we aren't seeing another underlining issue.

As far as performance while drawing debug graphics, the debug info is being drawn each frame. So a large hit like you are seeing is expected, especially over time. Are you planing to use the debug graphics in the final game?

avatar image Amimoller Oct 21 '16 at 05:49 AM

Yes everything is fine if i dont draw any debug graphics. And in the repro im only drawing one sphere per frame, which runs fine until you press f8 and then you go down to 5-10 fps. We dont use the debug graphics in game, we use it in the editor, hence why we make ShouldTickIfViewportsOnly() return true.

If i can just send you the repro project maybe that is easier?


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

1 answer: sort voted first

Sure. If you can make a test project that is under 5 mb you can upload it directly to here. Otherwise, you can upload it to Google Drive, Dropbox, etc and then PM me a link to download it directly over the Forums.

more ▼

answered Oct 21 '16 at 05:15 PM

avatar image

41k 1009 183 494

avatar image TJ V ♦♦ STAFF Oct 25 '16 at 07:58 PM

Hi Amimoller,

We haven't heard back from you in a few days, so we are marking this post as resolved for tracking purposes. If you're still experiencing this issue, please feel free to post back here with additional information to reopen the post.



(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