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"

[Bug/Feature] Player Controller floods Log

I have my PlayerController class with overriden Tick(float) function. I put there exception protection:

 AMyPlayerState * MyPlayerState = (AMyPlayerState*)PlayerState;
 if(!MyPlayerState->IsValidLowLevelFast())
 {
     //There was UE_LOG, but i removed it.
     return;
 }

This is Tick function, so I used fastest way to catch bad pointers (without cast). This code do it's job flawlessly, but it have one issue: IsValidLowLevelFast flooding Log with LogUObjectBase:Error: 'this' pointer is invalid.. This is strange, because it is check function, it must not log it's actions.
And there a second bug/my-fault: this flooding is get going after i stopped simulation. This means, that PlayerController still exists in memory even when there is no simulation running. Is that OK?
These two moments not affecting game stability by the way.

P.S. And i have engine version 4.8.0 still.

Product Version: UE 4.8
Tags:
more ▼

asked Jul 23 '15 at 02:21 PM in C++ Programming

avatar image

HungryDoodles
490 29 22 40

avatar image Ben Halliday STAFF Jul 23 '15 at 05:03 PM

Hey HungryDoodles,

I've assigned a member of our team to look into this for you, and they'll post here if they need further information. Thanks for your report!

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey HungryDoodles-

You may want to avoid using C style casts since they will try to preform the cast even if it's not the correct type. Instead you can use UE4 casts (=Cast(PlayerState>) instead since it will check for a valid type automatically. The log spam would be expected if the value is Null. The best way to check for this would be to make sure that PlayerState is valid itself with an "if(PlayerState)" first and place the cast inside the if statement.

Cheers

Doug Wilson

more ▼

answered Jul 23 '15 at 06:39 PM

(comments are locked)
10|2000 characters needed characters left
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