Jump to content

What is the biggest performance bottleneck in Phaser (or any gfx lib)?


GreatBigBore
 Share

Recommended Posts

Is it just the computation, or is it mostly the I/O, like talking to the browser and waiting for it to push a bunch of pixel data to the hardware? I ask because I wonder if I could fast-forward my game (for a sort of time-travel effect) just by telling Phaser to stop drawing and keep time going forward, but a zillion times faster than the normal frame rate. But if the slow part is really just computing all the physics and stuff, I guess there's no way to fast-forward. Anyone know anything about the guts of graphics libs?

Link to comment
Share on other sites

47 minutes ago, ozdy said:

Just try for yourself, physics performance depends greatly on number of objects ingame. Drawing still seems to be the bottleneck in my games (non web-gl).

Not sure how to try for myself. Do you mean turning off the drawing to the canvas? That's what I was thinking of, but I don't know how to do it. Is it just an easy switch somewhere?

Link to comment
Share on other sites

So. You could make your game "the fastes forwarding" by normal speed. -> So you need the performance to be capable of. But that's your entrypoint: fastest speed. And to play the game at "average ingame speed" you can set 
game.time.slowMotion = 0.5;

https://phaser.io/examples/v2/time/slow-down-time

Not as smart as doing is programmatically but maybe a thought worth it?
For slow-motion you could even go slower and stuff - and with desiredFPS you can control your setup.

regards

Link to comment
Share on other sites

game.time.slowMotion doesn't make things go faster, only slower. 

If you lower the desiredFPS, you will increase the speed of everything in the game. e.g. game.time.desiredFps = 30 will give you double the speed of 60 (the default). The drawback is that you're now looking at 30 FPS, which isn't as easy on the eyes as 60. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...