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"

Emptying the level doesn't free memory nor restores textures best lod

Hello,

My game is sort of a baby editor, where players can spawn/destroy actors at will.

When i spawn too much actors, there is a point where all the textures go super low detail.

alt text

This is normal, it just tells me that i am using too much memory.

But when i destroy all the actors but one, i have two problems:

A) the remaining actor never gets its nice texture back, and no matter what i spawn after that, all the textures are super low detail

B) in the windows task manager, the memory taken by the game never decreases, here is a typical scenario:

  • i launch the game -> 300 mo

  • i load my save with lots of actors -> 1300 mo

  • i destroy all the actors -> 1300 mo (the memory is not freed)

  • i reload my huge save -> 2300 mo (the memory increases again)

In the hereabove screenshot, the central picture is before the heavy load (on the left), and the picture on the right is after the destruction of all other actors.

The only way i can get the textures back is to close and reopen the game.

To destroy the actors, i was using the aactor::destroy() function, and after some research, i used the function Rama gives in this thread, but it didn't solve the problem.

https://answers.unrealengine.com/questions/2922/i-cant-fully-destroy-actors-after-i-spawn-them-act.html

So is it normal that the lowest LOD of all textures is used in an empty level after the level has been populated and emptied ?

Or am i destroying the actors incorrectly ?

Thanks !

Cedric

Product Version: UE 4.9
Tags:
texturepb.jpg (124.0 kB)
more ▼

asked Sep 26 '15 at 11:36 AM in Bug Reports

avatar image

uced
870 75 93 363

avatar image AndrewHurley Sep 28 '15 at 08:57 PM

Hey uced,

It sounds like you could have a texture streaming issue. as your assets are loading and destroying correctly. You can try increasing your streaming texture pool size, as well as debugging your texture streaming.

Be sure the assets you are loading and destroying have texture streaming enabled for their respective texture assets, i.e. MipMaps and the Never Stream option is checked on.

For more information about how to debug your textures, take a look at our documentation which will provide some helpful commands and tools to find where the issue lies.

Texture Streaming

https://docs.unrealengine.com/latest/INT/Engine/Content/Types/Textures/Streaming/index.html

Let me know if this was helpful, or if you are still having issues.

Cheers,

Andrew Hurley

avatar image uced Sep 30 '15 at 03:27 PM

Hey Andrew,

Thanks for your answer, but i am still a bit confused.

I unchecked the texture streaming and it solved the problem, except the sky was all blurry. The sky is not so important in my game so at least i have a workaround.

Trying to be less violent, i checked again the texture streaming and made a few tests by loading my large save with various sizes for the texture pool. I tried 1024, 2048 and 4096 mo, and i watched the "stat texturegroup" in the console.

Using 1024 and 2048 bring expected results: when the memory becomes greater than the texture pool value, the textures go wrong.

But, strangely enough, using 4096 bring the same result as "no streaming": the texture are always ok, no matter the memory used.

But i still believe there is something strange going on, as when i load several times the same save, the memory is never released and endelessly adds up.

In the three following screenshots (all taken with texture pool = 4096mo), you'll find: - first: the memory usage right after launching the game (PIE) - second: after the first load (so you can see the size of one loading) - third: the size after a few loads of the save (you can see the memory accumulates to crazy values)

alt text

alt text

alt text

I am positive the assets are destroyed when i reload (doubled check the code, and when i move an object, there is not several copies of it at the same place, so i am sure they are destroyed before reloading).

I am by no mean a texture expert, so you might find this normal, at least you have the info, just in case there might be a real problem somewhere with memory freeing.

In the meantime, i am tempted to just uncheck the texture streaming, any idea of all the bad this might bring ?

Cheers

Cedric

beforefirstload.jpg (106.4 kB)
afterfirstload.jpg (169.4 kB)
lotsofloads.jpg (169.2 kB)
avatar image AndrewHurley Oct 02 '15 at 05:42 PM

Hey Cedric,

Thank you for the detailed response.

Are you rebuilding your scene between each iteration? Since you are loading and destroying actors, and modifying the max memory pool, you will want to rebuild your scene.

The reason your project seemed to work okay with 4096 and Never Stream is the pool size was not longer the limiting factor. Once you reload your map, try rebuilding the scene to see if the memory is still huge.

Let me know if you are still having trouble.

Thank you,

Andrew Hurley

avatar image uced Oct 02 '15 at 08:17 PM

Hi Andrew,

I'm not sure what you mean by rebuild. Do you mean rebuild in the editor ?

All i am describing is occuring during runtime, in PIE or in a packaged game.

When i speak about loading, i mean during runtime, using an FArchive to store/read data in/from a file, and spawn/destroy object in c++ code.

My map never changes and remains empty in editor. I don't even use the editor preview frame, as you can see on the screenshot below, it is kept to a minimum size and my map contains a player start, a sky sphere, a postprocess volume, and that's pretty much it.

alt text

The level is populated/emptied only during runtime, either by players, or when reloading a save. To do that, i use the UWorld::SpawnActor function to create a default actor (from a class i wrote, containing skeletal/static mesh components), then i dress it with properties i loaded using the FArchive. All the static/skeletal meshes, or even blueprints are loaded dynamically using functions such as StaticLoadObject, etc.

That is why i am not sure about my memory management :-D

Maybe it will be more clear with a video, you can see the sort of things players can do here, where i setup a little scene from scratch: https://www.youtube.com/watch?v=z6TmrrwzGtQ

Or do you mean there is a way to rebuild a scene during runtime other than waiting for the next frame ?

Cheers

Cedric

cedriceditor.jpg (74.7 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey uced,

Thank you for clarifying this is all happening at runtime. I was under the impression you were destroying actors while PIE and then ending your PIE session and allowing the meshes to reload. This is why I asked you to 'Rebuild' and by that I mean using the 'Build All' option within the viewport to rebuild you scenes geometry and lighting.

In regards to the texture streaming, I am actually assigned another issue where a user is reporting a similar problem with his project.

AnswerHub Post - Streaming Texture Bug

https://answers.unrealengine.com/questions/312370/streaming-texture-bugs.html

If you follow the forum link provided in that post, you can see we are aware of the issue and have begun entered a bug report. If you have any questions in regards to this issue, would you mind posting in the link provided so we can keep these together and organized. It helps us track the issue more efficiently and assist users in an effective manner.

Update For reference the bug entered is UE-21800. It has been verified and fixed as number of fixes were entered into recent versions that address the issues mentioned here.

Thanks,

Andrew Hurley

more ▼

answered Oct 05 '15 at 04:02 PM

(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