Extremely low performance on importing or changing assets in Paper2d

Hello everyone,

I would like to report that as my project is getting bigger performance in everything related with paper2d,from importing json files to batch changing an origin point to grabbing 50 tiles and trying to duplicate them in editor is so slow that makes Unreal unusable.

Two days ago it took me 4 hours(!!) to import 4 json (files) textures sized less than 2048x2048 that contained 400 sprites in total. Unreal crushed many times since my system run out of RAM (i have 16GB) while trying to import a 1.5 mb file! It seems that there is either a memory leak or an infinite loop going on in there.

I believe that this is a very serious problem and needs to be addressed as soon as possible since it is so counterproductive that renders Paper2d unusable .

Thank you.

Hey ,

I was able to reproduce long import time with json sheets with a large number of sprites, and entered a bug report in our system (UE-4637). During import process, I was seeing memory spike to nearly 30G, and after import memory would stay at that level. Noland believes it may be generating garbage and we need to implement some garbage collection during a long import, but team will need to look into why memory is spiking so high.

It also seems that something being saved in Saved folder for project is affecting runtime memory usage, and I have entered a bug for that as well (UE-4639).

For now, you may need to clean out Saved folder frequently to improve performance, especially before and after any import of jsons with large numbers of sprites, as sprite asset creation is definitely part of what’s creating all data in Saved folder.

Thanks for report! I’ll let you know as I see any updates with these bug reports.

Is there a chance to see this fixed in 4.6?I am because this problem has brought my productivity to a halt. I am trying to create levels for my game and it is taking me minutes just to duplicate and move things around.It is destroying my moral and i am starting to lose interest in working. :frowning:

Hey ,

fixes for these bugs will not make it into 4.6, but they are being worked on currently. Is clearing Saved folder frequently helping at all?

Unfortunately not.Everything seems random.Sometimes when i try to import 6 json spritsheets in a row first few take 20 minutes each and fifth (just an example) takes 15 seconds and last one another 20 minutes.That was in 4.5.1 because now in 4.6 things are even worse.

But on bright side i can confirm a massive speed improvement inside editor when i duplicate many sprites to create a level.In 4.5.1 it took me more than 20(!) minutes to alt copy 200 sprites now it takes just a few seconds and in anything less than 50 it is almost instantaneous .
Batch changing anything related to sprites in 4.6 (pivot point,collision etc) is a nightmare . Changing a material is fast though.

Okay, thanks for update. I will let you know when I see any changes on these bugs.

Hey ,

and I were looking into long import time, and it looks like problem is that each sprite in map is being reregistered during import process; it is throwing away their physics and render states and recreating them. In a project like yours, which has 6000+ sprites placed in map, this process can take 10 minutes on our machines and spikes memory usage an insane amount (and I imagine much longer on slower systems, with possibility of crashes if auto-save is triggered during process).

So has submitted a fix for that which we will hopefully see in 4.7. In meantime, a workaround that might help you is to open an empty map when importing larger sprite sheets and then load back to your main map once it’s finished. Let me know if that helps!

That explains everything!I followed your advice and i imported one of my spritesheets on an empty level and it took me 1 sec! levels i am currently working(i started as soon as i saw huge speed improvement inside editor) have more than double amount of sprites from demo level i have send you, and thats why i told you that in 4.6 things are even worse than 4.5.It all makes sense now.

Does above workaround work for changing many (batch) sprites properties at once?Like pivot points,collision ON/OFF etc.Should i have an empty level open when i want to change anything from above in hundreds of sprites ,or this is a separate problem?

I went crazy and tried to change 900 sprites of my main character from 3dphysics to None, on an empty level. I was prepared for melting pc parts and software crashes beyond recovery.Guess what? It took less than 10 sec!!! So it works . :slight_smile:

I think it’s same issue, but can you check and see if that helps at all? Whether it does or does not, I’d like to let know. Thanks!

Very glad to hear it! I’ll let know.

Cool, I’m glad that workaround is helping. I’ve checked in a proper fix as of https://github.com/EpicGames/UnrealEngine/commit/ddf3b089e05e7f089be14d2e73933f891514fc2a in main, which should be a part of 4.7. It’s too late now to get it in for 4.6.

With this change in sample map you sent, it took 18 seconds to import 1024 sprite sheet and didn’t have an appreciable impact on editor memory high watermark usage (just what you’d expect from extra assets themselves).



Awesome work!It works like a charm in all but one situation.If you have many textures(try with 30+) and try to batch change (property matrix) compression method from default one to userinterface2d it gets stuck again.Just wanted you to know :slight_smile:

Hey, sorry for delay in response, only just now saw this.

So I opened up project you sent us in 4.7, grabbed all of textures from Textures folder (around 60), and updated Compression Settings using Property Matrix, and it took less than two minutes.

It seems like biggest delay is caused by Compress Without Alpha setting: first time I tried it, it took about a minutes with multiple values for textures. Second time, I tried it with Compress Without Alpha set to false for all textures, and it took about half a minute. With it enabled for all textures, it took less than 2 minutes.

Those times make sense to me, given how many there were. But it sounds like you’re experiencing a much longer wait. Are there any particular assets you’re using that cause this issue? Are there any other settings that I might be missing?

No problem,
If i recall correctly it gave me usual ‘not responding’ message in task manager but it wasnt as severe since it stopped at about 5 gigs of memory usage .I will have to test this again for you tomorrow because i do not remember all details and i will report back with my findings.
EDiT: I believe this happens only in newly imported textures.But i will tell you tomorrow for sure.I am away from my pc right now.

Sounds good, thanks .

Today i imported 83 png’s. When i tried to change textures settings (property matrix) from tc default to paper2d one i encountered again same problem! My memory usage spiked to crazy numbers until my system run out of memory and unreal crashed.Could you please check to see if this is happening to you as well? Maybe forgot to fix this specific setting?
P.s Don’t forget to try this with 10.000+ sprites on a level.

Hey ,

Sorry for missing this post. Are you still having trouble with this? Which branch/commit are you using currently? I might need an updated copy of your project, as well; feel free to put something in dropbox and PM me, and I’ll take a look.

Yes it is still occurring .I am using master branch release from 22/12/14. but tomorrow morning i will update to latest master release and i will let you know if this happens there as well.

Hey ,

Just checking to see if you’ve tried this since you last updated Master. If so, would you mind getting me a more recent version of your project to test this in? Thanks!