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 / Strange, my game seem to be limited to 25 fps ... what gives?

Author
Message
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 20th Jun 2019 15:39
I have tried with SetVSync(1) SetSyncRate(0, 0) and SetSyncRate(60, 0) but the framerate keep running below 25.0
I searched for "25" in my code but no results.
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 20th Jun 2019 18:43
Update: Tried it on another machine, and then the framerate was perfect. So I guess my code is horribly slow.

Is there a smart way to measure how much juice each function are using?
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 20th Jun 2019 19:48
Grab and compare time at the beginning and ending of a given process.

That said, i think vsync and set sync rate are incompatible. If you want to set a sync rate, you need to turn vsync off. Vsync on will just use the display's native refresh rate.
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 20th Jun 2019 20:44
Quote: "That said, i think vsync and set sync rate are incompatible"

True! What I meant was that I had tried 'em all, hoping that one of them would give some magical fix.

Quote: "Grab and compare time at the beginning and ending of a given process. "


So simple? Okay, gave it a try. It looks like the bottleneck is Display pixelart B.
The only thing it does is a single Swap() ... can this really be the issue?


Attachments

Login to view attachments
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 21st Jun 2019 09:11 Edited at: 21st Jun 2019 10:31
Now I see the problem. I misunderstood loadimageresized() and ended up with a 16384x5184 pixel sprite ...

With that fixed, my framerate is now about 80. Still not super fast, though.
Checking an empty test game, I got a framerate of about 800

I display a monitor-sized sprite with transparence, and a pixelart sprite upscaled to monitor size. Maybe it just take that many resources?

by not rendering the upscaled pixelart and not rendering the hd texture I can get a framerate of 230. The rendering still looks like the bottleneck, though.

Login to post a reply

Server time is: 2024-04-19 14:57:50
Your offset time is: 2024-04-19 14:57:50