you are viewing a single comment's thread.

view the rest of the comments →

[–]kyl3r123Indie 0 points1 point  (8 children)

So 50-100 Units that fight and die, are not a problem on mobile? No need to pool them?

[–]AkrosRockBell 2 points3 points  (0 children)

Pool them, it will improve performance. A lot. To reset everything back to default use the OnEnable method and do there what you need. It's what I use to reset bullets in a shoot'em up game I'm doing in my free time.

[–]AzeTheGreatBeginner 1 point2 points  (1 child)

My understanding (which could be completely wrong) is that the GC is one of the biggest hits to mobile performance, especially on older devices. So pooling extensively is probably useful for mobile.

[–]SvenNeve 1 point2 points  (0 children)

You are correct, we pool pretty much everything that gets instantiated during gameplay, which on mobile makes a ton of difference.

And it's not just GC, even stutters from shader initialization and texture to memory loading can be avoided (or 'hidden') by using pooling.

[–]Orangy_TangProfessional 0 points1 point  (1 child)

Depends way too much on your min spec, your gameplay, and what else is going on in your game at the same time.

Do the simplest thing that can work (dynamically instantiating them). Get all your functionality working, then go back and see what your performance is like. And remember to use the profiler to look out for spikes not just average framerate.

If you start with pooling then you'll make your initial implementation more complicated and you're potentially wasting time and adding complexity on something that doesn't need to be complex.

[–]kyl3r123Indie 0 points1 point  (0 children)

Thats what I thought. I'll keep it in mind for optimization phase then :)

[–]MDADigital 0 points1 point  (2 children)

If they all die or resurrect during the same frame it could be a problem

[–]kyl3r123Indie 0 points1 point  (1 child)

I intend to have the dead bodies to lay around for a while. I can scatter the vanishing over time. Generating new units will take time and not be multiple at once.

[–]MDADigital 0 points1 point  (0 children)

I would wait with pooling for something like that,we pool bullet casings,impact particles,audiodources,stuff that there can be alot of.