Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Odd FPS problem

Author
Message
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 13th Mar 2013 12:14
When I run my game on PC I get 51-59 FPS and the game stutters. Now the game uses less than 1% of my CPU. If I turn on the music I get a solid 60 FPS, using 5% of my CPU.


Demo 3 is out now!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Mar 2013 13:01
What code runs when the music isn't on that doesn't when it is playing? Anything? If not then try to reproduce it in some simple code and post it on the bug board.


this.mess = abs(sin(times#))
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 13th Mar 2013 14:14
Well, I don't load any music and there is a very simple function I am skipping once every loop. I have noticed this lag for a while but not on my phone. It's like it doesn't take enough power to run fast enough. I should check if I just need to load the music or if it has to play. But not home at the moment.


Demo 3 is out now!
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 13th Mar 2013 14:50 Edited at: 13th Mar 2013 14:51
Have you tried doing the set syncrate(60, 1) Acording to the documentation, it should keep your f
FPS steadier but use more CPU. It doesnt explain the music hanging it though
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 13th Mar 2013 15:50
Hmm, I should check and see what difference that makes. Maybe that's what happens when the music plays?


Demo 3 is out now!
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 13th Mar 2013 21:46
Using setsyncrate(60,1) gives me 60 FPS but also 13% CPU. Which is a little more CPU than running 0,0 and 1300 FPS.

However, simply loading in the music (without playing it) gives me a solid 60 FPS. And 4-5% CPU.

AGK seems to do something when the music is loaded. I am using 1076. Not sure how to do a demonstration of this. RTA is quite big so I guess it's about displaying sprites and perhaps running through some code each loop.

Funny thing about this testing is that I have discovered that my world map actually takes longer to process than playing the levels. Those got more sprites, code and working collisions. I can only guess it got something to do with the different sprites that are visible on screen.


Demo 3 is out now!

Login to post a reply

Server time is: 2024-05-08 02:17:28
Your offset time is: 2024-05-08 02:17:28