• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows I can't preview my Spine sprites on Texture Pages

K

Kreastricon62

Guest
Hello. I enjoy helping you guys on the community forum, but now I need help.

I also looked all over the internet, but I could not find a solution to the problem I'm having.

I use Spine to create animations and they look great when I import them to Game Maker Studio, but I cannot preview them on texture pages.

Here is what I am doing. I go to Global Game Settings/ Windows/ Graphics/ and then I click Preview to see all my texture pages. The texture page size is 2048*2048.

After I click the button, GMS creates all the texture pages (in a backup folder I presume). Shortly after, my windows photo gallery pops up displaying all texture pages I created. Of course, I can preview all the sprites I made EXCEPT for the Spine sprites. After looking through all the pictures in this folder, None of the Spine sprites I created have appeared on any of the texture pages. Note: All the other sprites that I have NOT made in Spine appear exactly in the texture groups I expect them to be, backgrounds included.

So my question is, where are my Spine sprites?

The reason why I am asking is because I am trying to optimize my game. It would help me to minimize the texture swapping in my game as much as possible, and it would help if I could see which texture pages they are on. I infer that the fewer texture pages they are on, the better.

This is NOT a big problem for me right now because my game runs like close to 700 fps on 30 texture swaps, but I don't want it to become an issue later in development as my game gets bigger.

I would also like to suggest that everyone who has Spine animations in their game do the steps I just did to see if they have this problem as well.

Thanks in advance.

Kreastricon62

Edit: I would also like to suggest that this issue is addressed in the Game Maker help section when it is figured out.
 

obscene

Member
Unfortunately GM uses special texture pages for Spine files, so there is no optimizing it other than smart depth ordering. If you do however use multiple instances of a spine sprite and draw them all at the same time they will at least share the texture swap.
 
K

Kreastricon62

Guest
Unfortunately GM uses special texture pages for Spine files, so there is no optimizing it other than smart depth ordering. If you do however use multiple instances of a spine sprite and draw them all at the same time they will at least share the texture swap.
What do you mean by smart depth ordering? Could you elaborate on that a little bit more?
 

obscene

Member
Well basically you just don't want a lot of spine objects at various depths causing GM to have to switch back and forth between your own texture groups and the built-in spine ones.

Draw stuff behind Spine objects
Draw Spine objects
Draw stuff before Spine objects

Basically you should make sure every Spine object has one certain depth, but also that if you have two separate spine objects with different sprites they should be a depth apart. For instance if you have Spine trees and Spine grass, draw all the grass at one depth, draw all the trees at a different depth, so that GM doesn't do something derpy like draw a tree, draw some grass, draw another tree, draw some more grass, etc.
 
K

Kreastricon62

Guest
Well basically you just don't want a lot of spine objects at various depths causing GM to have to switch back and forth between your own texture groups and the built-in spine ones.

Draw stuff behind Spine objects
Draw Spine objects
Draw stuff before Spine objects

Basically you should make sure every Spine object has one certain depth, but also that if you have two separate spine objects with different sprites they should be a depth apart. For instance if you have Spine trees and Spine grass, draw all the grass at one depth, draw all the trees at a different depth, so that GM doesn't do something derpy like draw a tree, draw some grass, draw another tree, draw some more grass, etc.
Son of a gun, are you serious? That sounds like a problem because my game is an isometric game, and all the Spine sprites have their own depth value. Looks like I will be forced to use a lot of texture swaps. However that advice you have on drawing all the same spine sprites at the same depth value just might prove useful to me. It looks like I will have to add some extra code to optimize the depth drawing. Ugh... I didn't even know GMS swapped textures when you draw a different sprite every depth.
 

obscene

Member
Swaps don't happen every depth, but as instances are drawn in order by their depth as soon as an instance has a sprite not on the current texture page a swap occurs, so the logical way to optimize texture pages in a similar fashion.

Now with isometric I feel your pain as you probably can't do thing so simply... but in my game (a basic 2d platformer)... I do something like this...

Texture page for skybox draws first.
Second texture page includes level-specific backgrounds.
Third texture page is general playfield things (blocks, grass, etc.)
Then the spine objects are all drawn.
Now level specific foregrounds are drawn from another texture page.
Finally a post effect texture page is loaded for lensflares, filters, GUI etc.

In theory everything is drawn on screen in 6 texture swaps. However there are lots of real-world issues that break this, but that's the idea most of the time. Basic idea: load a page, draw what you need and be done with that texture page until the next step, while also throwing big background images onto level specific pages that can be loaded / unloaded on each level minimizing memory usage.
 
K

Kreastricon62

Guest
Swaps don't happen every depth, but as instances are drawn in order by their depth as soon as an instance has a sprite not on the current texture page a swap occurs, so the logical way to optimize texture pages in a similar fashion.

Now with isometric I feel your pain as you probably can't do thing so simply... but in my game (a basic 2d platformer)... I do something like this...

Texture page for skybox draws first.
Second texture page includes level-specific backgrounds.
Third texture page is general playfield things (blocks, grass, etc.)
Then the spine objects are all drawn.
Now level specific foregrounds are drawn from another texture page.
Finally a post effect texture page is loaded for lensflares, filters, GUI etc.

In theory everything is drawn on screen in 6 texture swaps. However there are lots of real-world issues that break this, but that's the idea most of the time. Basic idea: load a page, draw what you need and be done with that texture page until the next step, while also throwing big background images onto level specific pages that can be loaded / unloaded on each level minimizing memory usage.
Alright then. It looks like I will have to get creative. Lucky for me it looks like in my project GMS only does texture swaps for sprites that are in view, so that helps a lot. Looks like I will have to revise a little bit of code or just use some clever level design to minimize texture swapping, so It's going to put my progress back a bit but I might be able to find a way past this by the end of the week.

I might post again if I have any more questions to ask.
 
Top