GameMaker So what's the point of Texture Groups?

MilesThatch

Member
So I'm at the point where I would like to address the amount of texture swaps happening on some of my larger levels. Multiple people have said that texture groups are best used to group sprite and tile assets so that GMS has to travel less between texture pages to load in the visual assets. I understand the concept of texture pages and swaps and I'm guessing that the texture groups are there for you to put all assets belonging together.... well, together... But with larger projects I run into a problem. I can't place the same sprite into more than one texture group. There's no way that one texture group can satisfy all of my levels. The further I go, the more assets get added and introduced to the player as the player progresses. New assets come into play, old assets stop being relevant BUT those old assets are still on the same texture group I created earlier.

My impression was that you can create texture groups on a per-level basis, as in, you take a look at your current level, see all the visual assets, sprites and tiles used and you add them to one group. I thought that this would make GMS create a special texture page from all the assets of that group (provided that they all fit onto one page) and thus texture swaps decrease. But again - can't place the same sprite onto more than one texture group so I'm not getting something right here.

Thanks in advance. I've running 30 to 40 texture swaps on my larger levels.
 
  • Thinking
Reactions: Mut
Yes, texture groups are for grouping textures together so that less swaps are needed, however levels should not be the only grouping considered!
For example, I would consider placing the player sprites and other sprites needed across the whole game in a group, and then maybe "bundle" levels that share some of the same resources, and group the textures used as well as possible :) You can rarely perfectly divide you textures in groups - the trick is to do it as close to perfect as possible ;)
 

CMAllen

Member
Texture groups are the way GM organizes all graphical assets into groups for drawing functions. They're actually texture pages (note: have a look at 3d modeling and such if you want a more in depth understanding of textures, UVs, and the like) that GM makes by arranging all your graphics onto as little space as possible on the texture sizes you select. Now in previous incarnations of GM, you wanted to avoid switching between texture pages as much as possible, so you wanted them grouped up as logically as possible. Each time a texture page swap takes place, it interrupted the drawing batch and slowed down the drawing pipeline. However, with GMS2, the drawing pipeline has been improved, so texture swaps are less harsh on performance. Still, it's not a bad idea to arrange your texture groups logically to avoid unnecessary performance degradation.
 
Top