Skip to main content

Questions tagged [object-pools]

The object pool pattern is a software creational design pattern that uses a set of created objects kept ready to use (a "pool") rather than allocating and destroying them on demand.

Filter by
Sorted by
Tagged with
2 votes
1 answer
91 views

I'd like to refactor my pooling class to work for more object types in my top down Unity game. Right now it's working fine for player projectiles, but I want it to also work for enemy projectiles, ...
Aloof's user avatar
  • 21
0 votes
1 answer
192 views

In our c# game we use object pools to store sprites once the Dispose() method gets called.Then when the Sprite.Create method gets called if a sprite is in the pool it gets depooled, cleared and ...
Matteo's user avatar
  • 15
1 vote
2 answers
891 views

I have made a loop to spawn and despawn a basic sphere gameobject. The issue is that when spawning goes over the max size, it does not decrease the ActiveCount when ...
Methalous's user avatar
1 vote
1 answer
250 views

I have a Prefab with a number of Components, such as: Rect Transform Text Mesh Pro Sprite Renderer Box Collider 2D I think Instantiate a GameObject using the Prefab, and configure it. As the ...
kanamekun's user avatar
  • 399
0 votes
1 answer
103 views

Context Hello, its me again. I have been playing around with "Object Pool" and it is fascinating the amount of CPU performance can save up. However, I have encountered a new "feature&...
Zeid Tisnes's user avatar
0 votes
1 answer
140 views

I have created the gun with two barrels, which fire in alternation. I have implemented pooling for one barrel, But I need to pool bullets in both barrels when firing in alternation. This is my Bullet....
Naveen Thikshana's user avatar
0 votes
1 answer
354 views

Let's say I have a very simple 2D square prefab that has a script like this attached to it: ...
Ginger and Lavender's user avatar
0 votes
1 answer
174 views

Until now, I know 2 bullets' algorithms/configurations : (I mean 2 ways of logically creating a bullet class) Make a bullet class and create only one instance from it that represents the bullet. The ...
Salem's user avatar
  • 226
0 votes
1 answer
399 views

Re-using pre-instantiated objects in a pool. Destroying then re-instantiating objects in a pool. Both pools are limited. When creating loads of objects which is better for performance?
IndividualGames's user avatar
0 votes
1 answer
88 views

The mobile game I am developing consists of one to four players and different agents that are being spawned and act in their own way. All those Agents (Car, Animal and Powerup) derive from the same ...
Roman Stadlhuber's user avatar
1 vote
1 answer
932 views

I am trying to create doodle jump like game with object pool for platforms. I have created an empty object with box 2D collider attached to it. This object moves with player and should be gathering ...
Random generalist's user avatar
1 vote
3 answers
1k views

I'm working on my first Unity project, which (maybe naively) I decided to make a shmup. I've been doing a lot of reading about Unity, and about object pools, and about using components to control ...
StrixVaria's user avatar
0 votes
1 answer
248 views

I'm making an infinite runner game and I'm trying to spawn obstacles, but all of them float far above the ground instead of being at the ground level. This is the code on summoning the bears. ...
SleepySleeper's user avatar
0 votes
2 answers
2k views

I'm trying to make two obstacles that are different sized to come in a random order in one straight line where the player is going. Doesn't have to be with object pooling. It seems that the ...
SleepySleeper's user avatar
2 votes
2 answers
3k views

Are there any cases where I should not use object pools but instead rely on Instantiate and Destroy? (Or more generally, outside ...
starikcetin's user avatar
  • 5,333
4 votes
1 answer
530 views

I'm currently working on a 2D platforming game with an infinite map. I did my research and I discovered that I can use chunks. Based on my understanding chunks is about spawning terrain at the right ...
masterYao09's user avatar
2 votes
3 answers
602 views

Example I have an "Enemy" class, and 5 types of enemy subclasses. These enemies will be spawn often, so I want to use an ...
not tellin's user avatar
0 votes
1 answer
181 views

According to When and why is a Pool class needed to hold objects?, pools are used when the number of "instances" of an object fluctuates. However, StarWarrior (the Artemis example) uses a pool for the ...
Evorlor's user avatar
  • 5,881
1 vote
1 answer
1k views

I want to use ParticleEffectPools in libGDX but I'm running into an odd issue where the effects don't seem to be reset when obtained by the pool. The code below looks for an existing ...
JPRO's user avatar
  • 233
0 votes
1 answer
147 views

To simplify, let's say in en engine I'm coding for a game, I have the Main class an Object class. In the Main class' update method, I loop through the array of all Objects in the game. I also have a ...
user30893's user avatar
13 votes
1 answer
982 views

I've been studying opengl es and an example I saw was using a "Pool" class to keep track of touch and keyboard events. Could someone please explain how and why a pool class is needed. From what I was ...
jaypowers's user avatar
  • 509
0 votes
1 answer
682 views

Currently I am using arrays to handle all of my game objects in the game I am making, and I know how terrible this is for performance. My question is what is the best way to handle game objects and ...
user avatar
8 votes
4 answers
6k views

I'm making a simple game, and have decided to try to implement a messaging system. The system basically looks like this: Entity generates message -> message is posted to global message queue -> ...
you786's user avatar
  • 645