Updated from v10.118 to v10.191 - framerate drop

Previous topic - Next topic

Falstaff

Hello everyone, have been kept fairly busy w/ RL stuff lately, but have been trying to get back into the swing of things with my game this past weekend with some new code changes. I didn't do tooo too much, (mostly bug fixes, and implementing some new bitmap font routines.. trying to work around the weird anti-aliasing stuff that GLB suddenly has), but suddenly I'm finding my game is experiencing slow down when I go to test my latest build on my phone.. on windows of course it's a solid 60 FPS, but for some reason I'm pushing around 40 FPS on my iphone. After uncommenting my profiling code, I was able to see that yet again it is SHOWSCREEN that is the culprit, taking up a good 20-25 ms per frame.. This is the behaviour I used to see, back when I was using CREATESCREEN for everything, but hadn't seen once I switched over to using POLYVECTOR for everything, including my scaling stuff. Not too too much has changed in my code, although I have upgraded to the latest version of GLB, when I was last testing I was sticking to the last version before the weird anti-aliasing stuff that popped up in the latest updates.. was on v10.118 I think.

I guess I'll go through and start trying to re-build some old version of my code with the latest version of GLB and see if it's anything I've done with my latest build.. but yeah I'm still left with scratching my head as to how I can improve on this.. don't really have much control over SHOWSCREEN..

I am using the new ALPHATESTING command to try to get rid of these weird artifacts that are showing up around my bitmap fonts, is it possible this command is somehow responsible for the slowdown? Any other suggestions?

Would really appreciate any ideas.. thanks guys!

AlienMenace

Are you using USESCREEN? When I use that, I get a huge performance hit.
Apps published: 3

Falstaff

Nah that's what I was wondering about.. I just grep'd to double check but there's nothing like that in there. This is actually what made me switch over all my stuff to POLYVECTOR instead of USESCREEN for my scaling; I was seeing a similar performance hit before.

That being said I didn't recently make any changes to my overall graphics approach, everything has been working fine. I just finally updated to the latest GLB version after hearing about the anti-aliasing stuff and the new ALPHATESTING command, so maybe that's it. I'm going to start re-compiling old versions and see if I see the same weird results.. then I know it's something that's changed in GLB since my last builds..

Falstaff

Well, updated the topic name because I have tracked down the cause of my framerate woes:

It seems that if I compile my pre-existing code in v10.191, SHOWSCREEN suddenly takes twice as long to execute. On average 20-25 ms. When I take the exact same code and compile it with v10.118, then it takes a more reasonable 10-13 ms. This means not only do my fonts look messed up when I scale them in 10.191, but my game also runs at a much lower framerate.. pretty much unacceptable.  :zzz:

I guess for now I'll just have to stay with 10.118 for now..

Falstaff


Kitty Hello

can you try ALPHATESTING 1 if you are using alpha blending?
Otherwise my state-machine might be an overhead. I can remove that again.

Falstaff

ahh, ok that seems to fix it. I was using alphatesting a bit already for my text commands but if I just slap it down after SHOWSCREEN it seems to run as normal.

Thanks!

spicypixel

Quote from: Falstaff on 2011-Dec-14
ahh, ok that seems to fix it. I was using alphatesting a bit already for my text commands but if I just slap it down after SHOWSCREEN it seems to run as normal.

Thanks!

Can you explain what you mean by slap it down after SHOWSCREEN please. Not that I'm experiencing problems but you seem to have found a fix for your issue and it would be good to understand what you're referring to.

Thanks
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

MrTAToad

I think he was doing something like :

Code (glbasic) Select

ALPHATESTING 1.0; PRINT "bbb",0,0
ALPHATESTING 1.0; PRINT "ccc",0,0
ALPHATESTING 1.0; PRINT "ddd",0,0


As opposed to

Code (glbasic) Select

ALPHATESTING 1.0
PRINT "bbb",0,0;
PRINT "ccc",0,0
PRINT "ddd",0,0


spicypixel

http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Falstaff

Well before I was doing something like:

ALPHATESTING 0.6
(printstuff)
ALPHATESTING -1 (or did I have it set to 0? can't remember now)

but now I'm just doing

SHOWSCREEN
ALPHATESTING 1

and leaving it like that.. seems to do the trick.

Kitty Hello

Don't mix alphamode and alphatesting. They are different.