Jump to content


Photo

Getting Additional Texture Swaps, GM:S Bug?


Best Answer icuurd12b42, 04 October 2015 - 07:23 AM

If it's not possible to have every ui elements and font on the same page; I assume it's not... because you use that external system, you have to layer your drawing which you are not doing at all here

Your ui element and font should be on a texture page, those inventory items on another and you should draw all your uis first, then the items, then all the items texts

draw ui elements (1 swap for ui and font (GM) texture page)
draw inventory items (1 swap for the items texture page (that dynamic system getup))
draw the text over the elements (1 swap, the ui and font page again) Go to the full post


  • Please log in to reply
7 replies to this topic

#1 cookieboy

cookieboy

    Seabass (The Human)

  • GMC Member
  • 747 posts
  • Version:GM:Studio

Posted 03 October 2015 - 11:30 PM

I am using Braffolk's external sprite system: http://gmc.yoyogames...howtopic=669935

 

Now I am facing an issue where GM:S is making repeated texture swaps even though it is calling from the same background each time.

 

Evidence A: http://imgur.com/BxD7gEW (Texture Page saved to a .png after it is created via the scripts)

Evidence B: http://imgur.com/HelQvh9 (Example of the issue)

 

Does anyone have an idea of what is going wrong here? I checked the scripts and they are using the draw_background_general() to draw from the background that is created.

 

An additional note, I am using GM:S version 1.4.1657. I've also tested this in GM:S EA version 1.99.420


Edited by cookieboy, 03 October 2015 - 11:37 PM.

  • 0

Vnc5NxB.jpg

Support a fellow GMC member? <3

http://store.steampo...com//app/357650


#2 TimothyAllen

TimothyAllen

    GMC Member

  • GMC Member
  • 4394 posts
  • Version:GM:Studio

Posted 04 October 2015 - 02:46 AM

Could be several things that break the batch. The text you are drawing (stack number) is probably breaking the batch. Also draw_set_colour and similar functions break the batch.
  • 2

gmcSig0.png


#3 cookieboy

cookieboy

    Seabass (The Human)

  • GMC Member
  • 747 posts
  • Version:GM:Studio

Posted 04 October 2015 - 02:58 AM

That is extremely helpful to know. Just to clarify... any sprites/backgrounds modified by draw_set_color() will generate another texture swap?


  • 0

Vnc5NxB.jpg

Support a fellow GMC member? <3

http://store.steampo...com//app/357650


#4 TimothyAllen

TimothyAllen

    GMC Member

  • GMC Member
  • 4394 posts
  • Version:GM:Studio

Posted 04 October 2015 - 04:14 AM

The text will cause a texture swap if it is not on your texture... which in your case it is not. Draw_set_colour (and similar functions) dont cause a texture swap, but they do cause a break in your batch sent to the gpu.

 

http://docs.yoyogame..._debugging.html


  • 0

gmcSig0.png


#5 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 04 October 2015 - 07:23 AM   Best Answer

If it's not possible to have every ui elements and font on the same page; I assume it's not... because you use that external system, you have to layer your drawing which you are not doing at all here

Your ui element and font should be on a texture page, those inventory items on another and you should draw all your uis first, then the items, then all the items texts

draw ui elements (1 swap for ui and font (GM) texture page)
draw inventory items (1 swap for the items texture page (that dynamic system getup))
draw the text over the elements (1 swap, the ui and font page again)

Edited by icuurd12b42, 04 October 2015 - 07:25 AM.

  • 1

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#6 cookieboy

cookieboy

    Seabass (The Human)

  • GMC Member
  • 747 posts
  • Version:GM:Studio

Posted 04 October 2015 - 08:31 AM

Interesting. I thought Game Maker did all that on its own. Kept it in memory for the frame since it is swapped in the first time you called it. I will definitely give that a try though. My fonts are used throughout the game and so I don't keep them on any page in particular. If I can keep it under 15 swaps I'm happy. I just obviously can't let 65 swaps be a normal thing.


  • 0

Vnc5NxB.jpg

Support a fellow GMC member? <3

http://store.steampo...com//app/357650


#7 cookieboy

cookieboy

    Seabass (The Human)

  • GMC Member
  • 747 posts
  • Version:GM:Studio

Posted 04 October 2015 - 09:00 AM

I can confirm that @icurrd12b42 is correct. If call a sprite or image from a different page between draw functions, it will cause an additional texture swap. Thanks for clarifying that!


  • 2

Vnc5NxB.jpg

Support a fellow GMC member? <3

http://store.steampo...com//app/357650


#8 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 04 October 2015 - 09:04 AM

https://www.youtube....h?v=orbN2y86lZs
  • 2

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button