Limit the fps

0 favourites
From the Asset Store
Create a game inspired by great arcade classics as Operation Wolf
  • Ok, I think I found the pb at my end.

    I optimised as much as I could my first world (101 draws in the biggest level, 7.7 mo of ram, 230 ko), that I decided to authorize myself a big image for the background (1024), to do nice clouds moving with the scrolling.

    As I tried to get rid of everything one by one to find the pb, I tried my game with a 512 image, and the pb disappeared.

    So i thought, ok, it's that, even if the Iphone 5 is supposed to handle that very easely, but as I'm naughty (lol, sorry english isn't my first language, don't know how to say that), I tried with the same image but at 1020.

    And at that size, the pb was not there neither.

    So I tried at 1023, and... it works !

    I have now a constant 62 fps on my Ipad2 and Iphone5 (just once 58 on the Ipad2, but with no "burp" like before").

    It's the same than before in my Ipod4 (between 40 and 60), whatever is the size of the image (1024 or 512, I think i'm more "stuck" with the number of objects on this device), but it's reaaly playable, even if the FPS do a kind of constant up and down.

    So at the end, don't know if everyone here was using a big image, but it seems that the trick is simply, if you want to use a big image, to use a 1023 px image instead of a 1024.

    Personnally, I will finally use a 512, cause the graphic difference doesn't justify (for my project) the differecne of size, and cause it will make me win memory (8.3 instead of 10.2 for the moment), what can be good when i will have my entire game (i'm still finishing the 1st world). Maybe I should try 511 too haha.

    That's all !

    :)

  • Well, false reason it seems.

    It was working well, but it came back, for really no reasons (with my 512 image).

    It's complitely illogical it seems lol.

    So the pb is something else !

    I will continue to try to find :)

  • It's probably Javascript garbage collection.

    I was discussing this issue with a programmer friend and yeah that's what he guessed as well. Making sure sounds are preloaded does seem to have improved my project (for the first few seconds of gameplay which stuttered a bit before). But, i'll try to optimize further.   <img src="smileys/smiley1.gif" border="0" align="middle" />

    Just added proper portals to my project, so you can warp between the randomized areas and your home area. Hopefully i'll cap a video and post it on dropbox or something soon.

  • Big fan of Terraria huh? Me too! Good taste!

    Absolutely love that game, and other similar ones heh. But, i'm also mixing in a number of other genres, so it's not a clone. I know people will see nothing but terraria and braid until I replace the placeholder assets however. I want to post video now, but I don't want to explain "yeah yeah placeholder art" to everyone who watches it.

    A bit of a conundrum, since posting the video might attract a good artist to replace the placeholders. <img src="smileys/smiley36.gif" border="0" align="middle" />

  • goldentreee - For an English-2nd-language speaker, you're doing amazingly well. Only the occasional "burp" in your speaking skills, but you're otherwise VERY easy to understand. Well done in your studies! English is NOT an easy language to learn, even if you grew up speaking it!

    I'm also very glad you posted this help request, as it gives me a lot to keep in mind as my own project grows. I've been concerned, too, about putting too many objects on my screen, and I haven't even crossed 100 on one layout (I'm still in very early development)!

    Ashley - Thanks for the feedback on goldentreee's issue. It's nice to know that even if there is the rare-n-random "burp", it's not out of the norm for now. Looking forward to improvements when you make them. :) But I trust you WILL. You're good like that.

  • Here's a guide that may help you with your performance:

    https://www.scirra.com/manual/134/performance-tips

    That was a GREAT resource. Thanks for bringing that to our attention. Soooooo much to learn! LOL

  • Rhindon, np :)

    I'm not sure if I mentioned it here or a different forum post, but I was able to get more smoother gameplay for my app by changing my background images to an exponent of 2 (for example 1024,512, etc..) as it seems to save up memory usage. With the new construct 2 updates you can see how much memory usage your wasting by looking at the memory use at the bottom of C2. Now compare the memory usage of your game to the ram/memory usage of your phone and you should get a rough idea of how well your game will run.

  • Don't just compare it to the amount of ram your phone has, because you have to share that ram with the os and other apps. I read somewhere that on iOS you only get access to like something like 10% (it might have been 20%, I don't recall exactly how much memory the device had) of the device's memory!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Arima & retrodude - NOTED. When me and my design partner are ready to export, we'll be paying more attention to that.

  • Arima is right, Apple recommands to not go more than 20 mb or 20%, not sure, if i'm not wrong, but in reality, it seems that you can use more :

    170-180mb of ram on devices with 512 Mb of ram total (iPhone 4, iPad 2, iPod touch 4g)

    40-80mb of ram on devices that have 256 MB of ram (iPad, iPhone 3gs, iPod touch 3g)

    25 MB on device with only 128MB of ram (IPhone 3g, iPhone 2g, iPod touch 1g-2g)

    found here, not official at all : stackoverflow.com/questions/6044147/memory-limit-and-ios-memory-allocation-in-iphone-sdk

    but in general, it's what appears to be possible. (i saw the same kind of returns in lot of websites).

    And as long as it's impossible to escape the fact that all the game (and so all the use of ram, if i understood well too) is load at the begining of the game (can't wait cocoonJs to support the loading of each layout), it's a thing you have to really be carreful of, to my opinion :)

    ps : thanks for your words about my english, i try to do my best :)

  • Don't just compare it to the amount of ram your phone has, because you have to share that ram with the os and other apps. I read somewhere that on iOS you only get access to like something like 10% (it might have been 20%, I don't recall exactly how much memory the device had) of the device's memory!

    Darn I almost foregot about that.. On Iphones, Samsungs and some of the newer phones (older ones too, I think) show roughly how much memory they are using on the device in the options menu, so maybe checking those can help give a better estimation?

    I'm too sure how to do it on iphone because I don't have one, but there are videos on how to check your memory usage, usually its in the options menu anyways. But even so, I still get high memory usage for my endless runner, so I'll revise over it and see if I can find a way to lower the usage.

  • I'm not sure if this helps anyways out but my sprite character had 100+ sprite frames and that took up around 25-35 mb of ram, so if anyone is seeing heavy memory usage, then check that out, also check over the sprite sizes on your sprite objects as well, the "sizes on the editor".

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)