In other game engines, object pooling is creating lots of objects at the start of a scene, then reusing them instead of destroying them. How can you do that with Defold?
This practice is not necessary in Defold. It’s automatically done for you. The reason why it’s automatic is that in your game.project you set the max of everything you want, and then those are reused.
Create/destroy objects at will. There is no issue for this in Defold.
As @Pkeod says there really is no need to manually pool your objects. I created an example a long time ago that shows this: https://github.com/britzl/publicexamples/tree/master/examples/pooling_vs_creating
Is there a performance hit in setting really high limits in game.project?
It will allocate more memory. But if you set 10000 as limit and use only 10 it would not traverse all 10000 so from an update perspective there shouldn’t be any difference.
A recommendation is to never set higher limits than you know that you will use. Use the profiler or make manual calculations and then set limits based on your findings.
Thanks, that’s a great idea!