Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by ByteSheep · Apr 27, 2013 at 10:44 AM · iosinstantiateobjectperformancepooling

IOS Object Pooling

Hi,

I've been looking through unitys docs reading about IOS optimization for my game and am now wondering whether it would make sense to use object pooling in the following case:

During the 2-3 minute gameplay in my game around 80-120 game objects are thrown by the character.
Each projectile is a simple prefab with a mesh of about 100 vertices and currently I have just been using Instantiate and Destroy to manage them, with no concern for memory management.
There are only ever about 6 projectiles in game at one time, so an object pool would seem like a possible solution to lower any memory usage.

Would it make sense in this case to try create an object pool rather than the current instantiate method? (I'm guessing yes)
And also each time a projectile hits it instantiates a particle system - should I create another object pool for the hit particles? (I'm guessing yes again)

Just want to make sure it would make sense to create an object pool before I begin coding.

Thank you very much

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Apr 27, 2013 at 11:42 AM 2
Share

sure, almost everything, in any video game, is a pool

(You simply do not instantiate, during game play, for any reason)

here is a massive discussion:

http://answers.unity3d.com/questions/321762/how-to-assign-variable-to-a-prefabs-child.html

pls vote it up if helpful :)

I think also it's worth noting. Questions like this often come up "what is more efficient". Say you had to decide on two 'different" pooling strategies. ($$anonymous$$aybe, 4 separate pools, or, one pool with changing objects ... say.) the fact is you just have to do it both ways and check. That's how game production goes. I mean it's only a few lines of code either way.

$$anonymous$$y point is just that you often get questions where people are keen to know which will be quicker. Almost always the answer is "take ten $$anonymous$$utes to try it each way and compare". So just bear that in $$anonymous$$d in your travels also!

But yeah, don't instantiate

avatar image ByteSheep · Apr 27, 2013 at 11:54 AM 0
Share

Wow that is a very detailed answer you posted - should be plenty of reading material ;)
I will have to try out different pools and see what works best.
Just wanted to make sure I understood the concept properly, when to use it, and if there were any alternative approaches.
Thanks for taking the time!

avatar image Fattie · Apr 27, 2013 at 02:41 PM 0
Share

it is my pleasure AND I both noticed and appreciated you voted it up on that page -- WHOO 25 votes !!

thank you !

avatar image ByteSheep · Apr 27, 2013 at 02:47 PM 0
Share

No problem, the answer definitely deserves the votes.. very entertaining too.
Got the object pool up and running!
Cheers

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Game Slow Performance on iOS 11 iPhone 6 0 Answers

Object Pooling, have some question marks 0 Answers

Instantiating Prefabs Lags in Android 0 Answers

How to Use Object Pooling for a 3D Autorunner? As Opposed to Instantiate? 0 Answers

Coin Magnet Performance Issue Mobile 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges