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"

Error during PIE initiation and after play once

Hi everyone, I'm having two issues that I can't solve and wanted to see if you guys could help me out.

The first issue is that when I start a new instance of the project from my MVS 2015 C++ code it throws an exception which I'm posting a screenshot

Error when starting new instance

And the second Issue is that after I play the game once in PIE and stop it, if I try to play it Again it throws another exception which I'm posting a screenshot

Error after played once

Product Version: UE 4.10
Tags:
more ▼

asked May 17 '16 at 08:15 AM in C++ Programming

avatar image

WolfAlvein
23 13 16 20

avatar image Matthew J ♦♦ STAFF May 17 '16 at 05:14 PM

Hello WolfAlvein,

This seems like it may be an issue of a null reference somewhere in your code, but I can't tell where as these are just the exceptions thrown. Can you hit the "Break" button and provide the callstack for these occurrences? It may be helpful to comment out your most recent changes to see if something recently added may be causing the issue.

Edit: Also moving this out of Bug Reports for the time being, as it seems to be a project related issue rather than a bug with the editor.

avatar image WolfAlvein May 18 '16 at 10:05 AM

I can't get a stacktrace, but I managed to get a print screen of the first issue when opening the Unreal Editor. alt text

And this is the only Output error it's giving me after verifying everything in the code:

alt text

and this is all the info I got from it:

alt text

How can I get the Stacktrace?

first error.png (53.6 kB)
error 2.png (93.3 kB)
error 3.png (74.7 kB)
avatar image Matthew J ♦♦ STAFF May 18 '16 at 01:24 PM

The callstack should be under the "Call Stack" tab at the bottom left of Visual Studio after you select Break. Also, if you're unable to get any information from opening the project via debug, can you try compiling it for Development Editor and attempting to open the .uproject directly?

avatar image WolfAlvein May 19 '16 at 06:10 AM

Ok, here is the call stack for when the PIE crashes after trying to replay it. alt text

avatar image WolfAlvein May 19 '16 at 06:24 AM

And this is the call stack when I start a new instance.

alt text

avatar image Matthew J ♦♦ STAFF May 19 '16 at 02:11 PM

Are you calling UPrimitiveComponent::AreSymmetricRotations at any time in your code, possibly in BeginPlay? This seems like a complex project and I'm unfortunately not going to be able to learn but so much without seeing the code itself.

avatar image WolfAlvein May 24 '16 at 07:13 AM

Hi, sprry for such a delay on my response, I don't call upon UPrimitiveComponent::AreSymmetricRotations, but I do set the characters position and rotation during BeginPlay(), I can send you the code if you wan't.

avatar image Matthew J ♦♦ STAFF May 24 '16 at 04:10 PM

That would be helpful. You could either link to a download for the code here (the whole project if possible) or send a link to me through a private message on our forums.

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

1 answer: sort voted first

Hello WolfAlvein,

Thank you for sending me your project. I found that the issue is related to this line of code, which is #139 in your KingdomManager.cpp file:

 siteName = "Resource Field " + siteName + FString::FromInt(i);

Due to how the for loop is set up that this is contained in, it is resulting in the siteName string becoming extremely long with the words "Resource Field" repeating over and over. This results in an assert triggering when the name hits a certain limit, which explains this check causing an assert:

 check(TCString<TCharType>::Strlen(InName)<=NAME_SIZE);

I commented out the body of the for loop that the line I mentioned above is in and I was able to PIE without an issue. I would like to explain how I found this however so hopefully you can find the next error that you run into.

Once I hit PIE and VS broke, I hit "Break" and then double-clicked the first line listed in the callstack. This took me to the check that caused the assert. After that, I noticed that the assert was checking a variable called "InName" and something about that value was why it was asserting. I then opened the "Locals" tab at the bottom right and found "InName". Looking at the value, it showed that it was repeating "Resource Field" over and over as its value. I then noticed that the assert was checking against a "Size" variable so I assumed that the problem was how large the string was. This prompted me to search for the words "Resource Field" in your code which led me to this line of code.

Hope this helps!

more ▼

answered May 31 '16 at 07:16 PM

avatar image

Matthew J ♦♦ STAFF
31.8k 526 91 417

avatar image WolfAlvein Jun 01 '16 at 07:34 AM

Hi Matthew, I did now about this issue and this is something new I have been testing and working on, it's not part of the original problem, The issue starts wen you try to rerun the project on the PIE after the first time it has been played, can you verify whats the problem there, the call stack doesn't give me enough information on to what is happening.

avatar image Matthew J ♦♦ STAFF Jun 01 '16 at 01:59 PM

From messing around with it some more, it seems like it may be a memory related issue. Everytime an assert is triggered, it points toward something not being initialized or failing a check for currentWorld being initialized. One of the times it also directly asserted due to a lack of memory.

After a few asserts pointing to the ChangeMainCamera function in CameraManager and the BeginPlay function in PlayerCharacter, I commented out the body of the former and the following line from the latter:

 AInputManager::Instance()->Possess(this);

This led to being able to press play/stop about 4 times before running into another assert which also seemed to be memory related. It's looking like there are some things that aren't being released when PIE ends. Do you have any ideas where that could be? The project is rather large so I don't have much of a grasp on everything that is going on behind the scenes.

avatar image WolfAlvein Jun 02 '16 at 09:09 AM

Can you tell me what type of that should be releases, since I thought that at stopping the PIE editor, it would automatically release everything from memory.

avatar image WolfAlvein Jun 07 '16 at 11:02 AM

Hi Matthew, maybe it's some of my singletons, should I destroy them when the project is stoped so the allocated memory can be released?

avatar image Matthew J ♦♦ STAFF Jun 07 '16 at 05:01 PM

That could definitely be the issue. This is an older post but the subject matter should still apply.

https://forums.unrealengine.com/showthread.php?29765-Game-Instance-VS-Singleton

I don't have much experience with using Singletons in the editor myself, but seeing as PIE always creates a new instance of everything to run, that would explain this only causing problems on subsequent attempts.

avatar image WolfAlvein Jun 14 '16 at 10:07 AM

Thanks Matthew I'm sure I'll look into this info to correct the issue, but is there any event in the gamemode that is called at the stop of PIE play or on exit of the game?

avatar image Matthew J ♦♦ STAFF Jun 14 '16 at 05:46 PM

As GameMode inherits from Actor, you could override EndPlay which should be called once PIE ends.

(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