My game is feeling clunky


(Ferran Ruiz Sala) #1

I am making a king of game about climbing a procedurally generated tower.

I’m not sure if i should use fixed or variable timestep and then i am npt sure where i should put or not put the FP.elapsed.

The game for some reason runs at 40FPS instead of 60FPS and feels a bit clunky. How can i make it feel smoother? :confused:

Here’s the file: TheTower.swf (98.7 KB)

If you have any feedback on the game itself, feel free to post it :slight_smile: i’m just working on the basics so theres a long way to go, and thats why i dont wanna make any base mistake and have the game running smoothly before i add more and more stuff.

Thanks!


(Ultima2876) #2

Have you tried running a release compile in the browser? It’s a common problem for flash games to do some odd vertical syncing and lock at 40fps in debug mode or on the desktop ‘flash projector’. The best way to test is in the browser.


Tweens dropping fps to 4
(Darrin) #3

I run it at 60 FPS.

(yes it does)


(Bora Kasap) #4

i run it at 60 FPS too, as i feel.


(Ferran Ruiz Sala) #5

Yeha i tested it uploading it online and it runs at 60 everytime so no problem :smiley: about variable vs fixed timestep, what should i do? Now i’m running variable, so i should be doing the FP.elapsed thing, but im not doing it and it works fine anyway, so i’m lost.


(Bora Kasap) #6

i’m not sure about where to use variable timestep thing, i think it may be used in syncing multiplayer games or turn based strategies or something like that? i’m not sure about that. Also, it may be used for games which all visual events must be seen by player because of a visually oriented game, so it makes user to don’t miss screens which he/she must see to go on playing. So, in action games, i think it’s not required? Also may be used in simulation stuff, to make researchs for science.


(Ultima2876) #7

Actually it’s the other way around - variable timestep means the game simulation isn’t ‘deterministic’; this means it’ll be slightly different every time, for every player. So in a multiplayer game, it’ll go out of sync quickly if you use a variable timestep. However, in a purely single player game variable timesteps can make the game look smoother, and they have the advantage that on very weak systems (that can only run your game at 10-15fps or so) the game will still be pretty playable (albeit choppy looking).

Fixed timesteps are accurate all the time as every ‘step’/frame is processed no matter what and everything is guaranteed to move a specific amount every step, rather than some multiple of the elapsed time. However, if the game starts lagging, we need to run extra frames to keep up - assuming the rendering is what is causing the slowdown, this is fine… but if not, this will actually make the problem worse and crash the game. So systems that can only run the game at 10-15fps… will now not be able to run the game at all.

However, this is largely academic these days as most target computers will be fine running almost anything you throw at them; stick with a fixed timestep. Mobile devices are the only place where this is a different scenario - if you have plans to port to mobile then consider using a variable timestep from the get-go (and also check out Stage3DPunk!).

Also note that unless you multiply all movement code by FP.elapsed, there is NO advantage in using a variable timestep. In fact, all that will achieve is that your gameplay will be slower for people who cannot run your game at full speed - the worst of all scenarios. Make sure all your positional movement, rotations and physics are multiplied by the elapsed time!


(Ferran Ruiz Sala) #8

Thanks man! That was hella useful! I’ll make sure to fix my code :slight_smile:


(Ultima2876) #9

No problem! Post here if you think of anything else :slight_smile: