Overview

An Object Pool is a games programming pattern that is used to optimise performance and memory management by reusing game objects instead of creating new ones and later destroying them. This pattern should be used when objects of the same type, or same size, are required frequently. For example, if we wanted to create decals on a wall displaying bullet holes when a gun is fired, we could use an object pool instead of creating and destroying each decal. By creating a pool of ‘reusable’ objects you can help alleviate memory fragmentation, however, you must be able to manage your objects thoroughly as they must be returned to your object pool so that the program does not encounter an empty pool when resources are needed.

Leave a comment