Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [object-pools]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
58 views

How can I cache and read fields on non instantiated prefabs?

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

Recycling bullets versus spawning them on demand

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 ...
user avatar
  • 216
0 votes
1 answer
155 views

Unity Performance: Recycling Pooled Objects OR Re-Instantiating?

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?
user avatar
0 votes
1 answer
41 views

Object pooling of different tpyes of agents (Mobile Game) in Unity

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 ...
user avatar
1 vote
1 answer
652 views

Object pooling with collisions in Unity

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 ...
user avatar
1 vote
3 answers
1k views

How/whether to pool bullets for a shmup in Unity?

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 ...
user avatar
0 votes
1 answer
179 views

Why do my obstacles float above the ground? Unity2D

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. ...
user avatar
0 votes
2 answers
1k views

How to get obstacles to spawn randomly in x position in an infinite runner? 2D

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 ...
user avatar
1 vote
2 answers
3k views

When shouldn't I use object pooling?

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

How to spawn Chunks in Libgdx?

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 ...
user avatar
2 votes
3 answers
522 views

How do I architect around Object Pools?

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

What is a Pool? [duplicate]

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 ...
user avatar
  • 5,171
1 vote
1 answer
1k views

ParticleEffectPool.obtain() not resetting particles

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 ...
user avatar
  • 233
0 votes
1 answer
114 views

Object generation from an existing object in a game engine

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 ...
user avatar
12 votes
1 answer
885 views

When and why is a Pool class needed to hold objects?

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 ...
user avatar
0 votes
1 answer
618 views

Java game object pool management

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
5k views

Game Messaging System Design

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 -> ...
user avatar
  • 645