mdhdev Posted August 29, 2014 Share Posted August 29, 2014 Using P2 physics, what would be a realistic gravity setting for a marble falling to the ground? I have set game.physics.p2.gravity.y = 500 which seems a bit slow in firefox but quite a bit faster in Chrome. 500 sounds a bit hight and i'm wondering if that's a normal setting? Also, is it normal to have speed differences between Chrome and Firefox? Link to comment Share on other sites More sharing options...
JUL Posted August 30, 2014 Share Posted August 30, 2014 No 500, is not unusual neither extreme, at least for the arcade physic I use, never tried the P2 but I guess it's the same speed (I said I guess). I know in arcade physic engine, when you go beyong 1000 or so, you need to use the game.physics.arcade.TILE_BIAS, to avoid having the sprite going through the floor after a relatively short free fall, don't know what's the equivalent for P2, or if any needed. Link to comment Share on other sites More sharing options...
mdhdev Posted August 30, 2014 Author Share Posted August 30, 2014 Thanks, good to hear that's not an extreme value. Any idea about the massive speed difference between firefox and chrome in how fast the object falls? Link to comment Share on other sites More sharing options...
JUL Posted August 30, 2014 Share Posted August 30, 2014 Firefox is a loosy browser quite frankly, for games. It's filled with politics, unfortunately.For instance the flash player is limited to 30 fps. Why ? Either because it's poorly implemented or <conspiracy theory>plain sabotage</conspiracy theory>. So, I'm not surprised that javascript is slower. The only good part is that FF is more tolerant regarding bad practices, but that's a false friend. Link to comment Share on other sites More sharing options...
mdhdev Posted August 30, 2014 Author Share Posted August 30, 2014 I think I found the answer, when setting up the game, changing Phaser.AUTO to Phaser.CANVAS sped it up a lot! Firefox now matches the chrome speed. Link to comment Share on other sites More sharing options...
valueerror Posted September 2, 2014 Share Posted September 2, 2014 the new firefox is quite the same to chrome performancewise.. with webgl on linux it's a little bit slower.. if you see a difference in the speed of your marbles falling down you should activate advanced timing and display the current fps : you should see that there is a difference in the frames per second.. because most things are calculated in frames - processing 60fps will be twice as past than 30fps - this also is true for gravity.. so make sure your game is coded in a way that you will have 60fps almost all the time.. btw. a normal setting for p2 physics to imitate real gravitation 9.81 g would be 1200 - 1400 so don't worry.. 500 is actually very low mdhdev 1 Link to comment Share on other sites More sharing options...
Recommended Posts