

With big graphics, the situation looks a lot different. and then you notice that your enemy sprites and particle effects are scattered all over your generated texture pages, and this seemingly useless and totally automatic "feature" that lets you choose where your sprites go will suddenly descend from the heavens as your game's holy savior from eternal suffering in the depths of lag hell.Īs you may have noticed, the scenario I'm describing mostly deals with multiple smaller sprites being drawn. Even worse, whenever you spawn any particle effects, the game slows down to a crawl. The more enemies are being drawn at the same time, the higher the chances of more and more swaps occurring, and eventually, you'll end up with a relatively simple-looking 2D platformer game that barely runs at 60 FPS for no apparent reason. With that setup, whenever your enemy layer gets drawn, texture pages would be swapped left and right, which contributes to lag. In the worst case, it will end up putting enemy sprites across several texture pages (because there may be other, larger graphics that are being prioritized to put onto texture pages as early as possible), even if they could realistically all be put on a single page. When left alone, the texture packer tries to fit sprites into texture pages as tightly as possible, but doesn't exactly care what it's putting where - more like how much it's putting onto a single page. For example, if you have a various enemies in a platformer game, it's not too uncommon to place them all on the same layer to ensure they will be drawn at a similar depth. Texture page management refers to the strategy of placing graphics which will often be drawn together on the same texture page. This swapping of imaginary palettes is what we refer to as a "texture swap", and it takes additional time on top of drawing that can sometimes be avoided with proper texture page management. If you want to draw something that isn't on the palette you're currently holding, you have to put it down and pick up the right one before you can resume drawing.

You can have as many palettes as you want, but you can only ever hold one of them at a time. Imagine a texture page to be like a palette that you can use to draw things to the room. The core principle here is that all graphics are placed onto so-called texture pages. The issue being discussed in the forum posts you found are most likely talking about texture page management, which is a part of game development that is often forgotten or neglected and then later bites developers in the back when they least expect it.

There is no inherent problem with using large graphics.
