KirUn Posted October 16, 2016 Share Posted October 16, 2016 Hello everyone. I am currently developing fast paced html5 game and I want to ask you some opinion and advice about framerate. What is recommended fps by default? 30 or 60? 60 looks much more smooth for me, but in general, many people cant tell any difference and, also, 60fps is twice resource consuming as 30, so it could be a problem on some devices. I know, that optimal solution is dynamic framerate, but it require some serious work to dodge collision bugs etc.. What is current standart with html5 games? Quote Link to comment Share on other sites More sharing options...
tips4design Posted October 16, 2016 Share Posted October 16, 2016 " many people cant tell any differenc " ? Everyone can tell the difference between 60FPS and 30FPS, unless they are blind. If your game is a board game, or something that doesn't have animated entities you can have your game run at 0FPS and only update the sceen when required. Otherwise, always go for 60FPS. KirUn 1 Quote Link to comment Share on other sites More sharing options...
mattstyles Posted October 17, 2016 Share Posted October 17, 2016 Some people have super-duper monitors that break the legendary 60fps, they'll tell you they can tell the difference between 60 and 120. I think the myth about 30fps comes from TV's, that traditionally operated at something like 24fps, although I'm not sure thats try any more either. Try moving a sprite backwards and forwards across the screen and change the fps (use a tick and then just throttle it to get whatever fps you want), I'd wager most people will tell you 30 looks jerky, 60 is smooth (I've done this test on several groups, but nothing statistically significant). Your browser will typically ensure your display updates at 60fps and I don't think there is anything you can do about that, even if you have a super screen. Similarly, if you're animating with CSS it’ll render at 60fps (if it can) and I don't think you can change that either. I agree with tips though, it only matters for consistently moving entities or if you do something like hang your timing off the fps (not generally recommended). KirUn 1 Quote Link to comment Share on other sites More sharing options...
stay Posted October 17, 2016 Share Posted October 17, 2016 On 10/16/2016 at 1:44 AM, KirUn said: I know, that optimal solution is dynamic framerate, but it require some serious work to dodge collision bugs etc. Fortunately, once you have a dynamic framerate system set up, there are usually just a few problem areas, like the physics update issue you mentioned, and there are usually some good known solutions for those. For instance, with collision you can run several short physics/collision cycles in one frame (as many as you need to match how much time has passed), and leave the rest of your logic based on a dynamic frame rate. As mattstyles says, hanging all your game timing off fps is not good. You'll eventually regret it - for one reason or another your game will be running faster or slower than you expected, and all the game timing will be wonky. Deltatime is golden. And once you have it, you can do cool things like artificially slow your calculated deltatime down for slow-motion effects, without rewriting any game logic. On 10/16/2016 at 1:44 AM, KirUn said: What is recommended fps by default? What goals are important to you? Ultra smooth animation and responsiveness all the time? Great. Target 60fps and make sacrifices elsewhere (in game logic and scene complexity). But if you're just trying to ship a fun game, I'd say don't lose too much sleep over it - plenty of games running at 30fps are perfectly playable! And it's just a target, anyway - since you can't generally control the hardware your game is run on, you can target 60fps all you want and you won't always get it, which is part of why you really need a system that can adapt to any frame rate the host device supports. mattstyles and KirUn 2 Quote Link to comment Share on other sites More sharing options...
mattstyles Posted October 18, 2016 Share Posted October 18, 2016 http://gameprogrammingpatterns.com/game-loop.html This is a good high-level resource. Note that some of this isn't really possible with JS or in the browser. stay and KirUn 2 Quote Link to comment Share on other sites More sharing options...
KirUn Posted October 24, 2016 Author Share Posted October 24, 2016 Thank you guys, all of this was really helpful. Yes, I wanted (and initially developed with) 60 fps, but for the reason of compatibility and smoothness on phones and old computers. I guess, it is time to learn dynamic framerate and delta time. Thank you again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.