Game Development Community

[T3D Beta 1.1 (beta 1) - slow performance in GuiBitmapCtrl::setBitmap

by Dusty Monk · in Torque Game Engine · 03/24/2010 (3:11 pm) · 4 replies

So after porting over from 1.0.1 alpha to 1.1 beta, something I've noticed is that all my UI refreshes are taking *much* longer. I've narrowed this down to the fact that I do a lot of setBitmap calls to UI elements for things like ability lists & inventory. Now allowing for the fact that many setBitmap calls on UI elements is probably not the most efficient way of doing things, nevertheless in T3D 1.0.1 alpha this was never a problem, and my UI updates were pretty spritely and quick.

Now though, my entire game pauses for close to a second whenever I bring up the inventory as the script runs through all the slots setting bitmaps according to what's in the inventory. I've perused the code in GuiBitmapButtonCtrl, and while the structure has changed somewhat, the underlying functionality is pretty much the same. Go through and create (or look up) the texture handle for each button variation of the button's bitmap (normal, depressed, inactive, highlighted). So given that *that* code hasn't changed much, I can only assume something has changed in the underlying texture management.

So, has anyone else experienced this when going to 1.1? Or can anyone make suggestions on making setBitmap faster? Would it help if my textures were all power of 2 dimensioned? Do I need to specifically create a material definition for each button texture? Is there some way in script I can preload the textures, and just assign the texture handles to the buttons?

Any thoughts, comments, or similar experiences would be greatly appreciated.

About the author

Dusty Monk is founder and president of Windstorm Studios, an independant game studio. Formerly a sr. programmer at Ensemble Studios, Dusty has worked on AAA titles such as Age of Empires II & III, and Halo Wars.


#1
03/24/2010 (8:46 pm)
I've noticed this as well. I have about 15 buttons that have circular timers that I manage in script. Like you said, it's not the most efficient way to do it (one of these days I'll make a proper GuiControl out of it), but in 1.0.1 it worked just fine. Now, I click the button and the framerate takes a drastic hit and the updates skip most of their frames. I've actually had to turn it off while testing things just to not have to deal with it :/
#2
03/24/2010 (9:41 pm)
Shouldn't this be in the T3D private forum rather than TGE?
#4
03/25/2010 (4:56 am)
Totally my bad. Was surfing many different boards and hadn't realized I'd ended up in TGE when I posted. Thx for the heads up.

Reposted HERE

And close this thread.