Jump to content

How can I speed up the game updates?


Ijatsu
 Share

Recommended Posts

Hi everyone,

 

 

I searched in the API and code and did not found what I wanted, that's why I come here to ask you. ;(

 

 

Currently, if your game is running at 30 FPS, there's 30 render cycle per second. For each render cycle there's 1 update cycle.

What I want is to add more update cycle to a render cycle, this way the game will be speeded up without unecessary render cycle.

 

Why do I need this functionnality?

I'm coding small evolutionarry games, when testing or playing it I need to accelerate the process to see any emergence.

 

 

After a brief look at the game.update function, I can implement it, but I need to know first it isn't already implemented.

 

Thanks :)

Link to comment
Share on other sites

De-couple the 'game update' from the phaser update - i.e. when the phaser 'update' is called, iterate through your simulation as many times as required to achieve your desired rate.

I don't understand how I am supposed to do that ^^'

I tried to call game.update inside the update function I give when creating Phaser.Game object ( with recursion blocking ), but it doesn't work and that's logical because I try to call update while an update isn't event finished. ^^'

Link to comment
Share on other sites

Ok let me put it another way - your simulation obviously isn't tied to the render frequency, which means it must have something that controls it - some kind of simulation manager? that is responsible for managing all of the objects within the simulation, advancing their states, etc. So what I'm saying is call this on whatever timed basis you need and just use the game update to trigger that. Or you could even just start off a setTimeOut (Interval) in the create and have that call your simulation at whatever frequency it needs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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