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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Spawn Particle at Location Performance Hiccup

Problem

I get a small but noticeable hiccup in performance when I spawn a particle system from C++. This is in essence what the spawn function looks like:

 UGameplayStatics::SpawnEmitterAtLocation(this, BotchedEffect, Hits[i].ImpactPoint, FRotator::ZeroRotator);

BotchedEffect is a pointer to the asset that I've set in the Editor.

I've also tried using TAssetPtr with SimpleAsyncLoad to load the asset on start and then call .Get() to get the pointer and spawn the asset but that also has a hiccup.

Details from "stat unitgraph"

alt text The above images show the two different events. (1) is the first spawn with the hiccup (2) is the second spawn and all others after that, that do not cause a hiccup.

Assumption

I feel like the issues stems from the concept that the asset isn't loaded when I try to spawn it so the engine has to load the asset into memory and spawn it.

Question

Any thoughts on why this might be happening? Is there a proper way to spawn assets without a hiccup? Specifically particle systems, but in general all things.

Product Version: Not Selected
Tags:
more ▼

asked May 12 '15 at 10:42 PM in C++ Programming

avatar image

Mercurial Forge
99 13 17 18

avatar image Tragic Comic Jul 16 '15 at 05:27 PM

I am seeing this exact problem as well. Any additional info would be great.

avatar image Mercurial Forge Jul 16 '15 at 06:02 PM

Yeah this is an issue I'm still seeing :(

I'll post here if I ever find anything!

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

3 answers: sort voted first

Hi Joe,

After profiling this intensely I found that the issues was just my perception of the graph. I was testing it at an unlocked framerate and thus the difference was visible. After capping it at 60fps there is almost no visible impact at all.

Sorry for the undue trouble!

more ▼

answered Jul 21 '15 at 09:14 PM

avatar image

Mercurial Forge
99 13 17 18

avatar image callen55047 Aug 29 '18 at 04:24 PM

Hey guys, I’m a little late to this discussion but I think I’m having the exact same problem with my project. I’m designing a mobile game, and specifically on android and iOS there is a noticeable hiccup in performance when particles and actors are spawned. It won’t slow down on a windows build, but on mobile hardware the impact in performance will hang the game for almost a full second at times. Wondering how you used the Asyc loading to avoid this issue? I’ve experimented with a few but none have worked yet :(

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

If the asset is not loaded when you call .Get(), the game will pause until it is loaded before continuing.

Docs are here:

more ▼

answered Jul 16 '15 at 09:53 PM

avatar image

joeGraf STAFF
1.5k 35 12 69

avatar image Mercurial Forge Jul 20 '15 at 08:19 PM

I'm still seeing a slight spike the first time I call Get() on the item. I check to see if the asset is loaded so I know it's in memory. Is this expected? It doesn't hurt the frame rate but I feel like this is abnormal?

The second spike is the second time I call it which is faster. I assumed using AsyncLoads would remove that initial spike time.

alt text

avatar image joeGraf STAFF Jul 20 '15 at 08:26 PM

Is that on the Get()? or on the SpawnActor? Spawning an actor has costs associated with it, so it is not surprising to see some amount of overhead

avatar image Mercurial Forge Jul 21 '15 at 04:25 AM

I tried the Get() and it has almost no visible impact on the graph, which is great.

So It must be the spawning actor cost, which looks like this. In the following image I spawned the actor twice. But only the first really affected the graph. That spike put me at 22ms. That seems like a bit much no?

alt text

Why is the first spawn so costly?

Is there a way to soften this cost somehow. It seems to cause a hicup when I spawn the particle for the first time.

avatar image joeGraf STAFF Jul 21 '15 at 02:47 PM

Not sure without digging in. Especially with the subsequent spawns not costing the same amount. If they did, then I'd say something in your setup of the particle system, say maybe a lot of pre-warmed particles

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

You can use FindObject to see if an object is in memory or not

more ▼

answered Jul 17 '15 at 12:01 AM

avatar image

joeGraf STAFF
1.5k 35 12 69

avatar image Mercurial Forge Jul 17 '15 at 12:52 AM

I have tested the TAssetPtr Get() with 4.8.2 and found it no longer has a hickup. I just updated all my code and it now works. I will report back if anything changes. Thank you.

(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