Mobile performance question


(Nate ) #1

Hey guys, I am working on a mobile project just for fun using my FD + FP skills and I have a nice playable demo right now, just the basics. I have a question that is kind of broad but I am looking for some guidance.

On my computer I have the game running at 60 FPS and it runs totally fine. When I put it on my phone, should I be lowering the FPS? When I do lower the FPS, does that mean that I have to increase variables such as the movement speed, gravity, friction etc?

My phone is the Samsung Galaxy S3. I set the FPS of my most recent build to 40, and I tweaked with the characters walk speed slightly, and it seems to run better on my phone. I was just wondering if there were general rules of thumb that I might be missing that would be helpful in getting the game looking as smooth as it does on my computer on my phone.

Thanks guys!


(Kyuur) #2

The best idea is to use a variable timestep:

http://useflashpunk.net/intermediate/timing-and-motion.html


(Nate ) #3

Okay, do you mean in terms of the variables or the framerate?


(Ultima2876) #4

You’ll want to keep your framerate set at 60, most likely, and make sure your game can handle running at lower framerates. You can use either a fixed or variable timestep for this (as described in the page linked above) - there are various opinions regarding which is the better option.

Something very important to consider - your phone is a very high end model so your game will be running quite well on that, but on average and lower phone (and tablet) models, you’ll see a significant hit to your framerate. Most completed games I’ve tested run at about 9-12fps on my middle range test devices (iPad 3, Kindle Fire HD). This is obviously close to unplayable - unfortunately, blitting isn’t the best option performance-wise on mobile (to get great performance you’ll want to use Stage3D, for example Starling).

Generally when developing games you want to cater to the lowest end devices to maximise the number of people who will be able to play the finished game.


(Nate ) #5

Thank you for the information Ultima! I will look into Stage3D/Starling.


(Tumetsu) #6

However, the players might appreciate that you limit your FPS since it should decrease the battery consumption. Or at least that was recommended some time ago. Also, I think that the FPS problem varies greatly on the game type. If it is something hectic, Stage3d might be the better choice. However, I have noticed that slower paced games might work well enough on FP too.

I developed one game using Starling this year. I have to say that it is quite nice library. However, it doesn’t have some of the luxury of Flashpunk’s premade classes. Also to get the performance boost, you have to think about how you render your stuff etc. Also, if you are planning for web-release, keep in mind that there are still people with stage3d incompatible videocards and some portals embed the game incorrectly.


(Nate ) #7

Thank you for the information Tumetsu! :smiley: I have been messing around with the application FPS, I currently have it at 30, and I adjusting some of the physics values to smoothly match the FPS and currently I have it running very nicely on my phone. I am also looking into Starling as I have heard of it before but never looked into it.


(Tumetsu) #8

Your welcome.

Also, I think that most Flash mobile guidelines recommend one to drop the fps when it is not needed, like during menus or when application loses focus to save the battery. Personally I’d probably try to find the lowest framerate which works best for the game in question and optimize and design for it. Imo 60fps is waste for most turn based puzzle games for example. Of course for most action games that might not be feasible.

I might also add that the cons of Starling other than portal thing might not be serious problem if you are familiar with coding/as3 enough. They just mean a bit more work.


(Nate ) #9

Okay thank you again Tumetsu. I have extensive AS3 knowledge as well as general programming knowledge so picking up Starling from what I looked at already with Starling should be pretty simple. But I must say for the application that I am tweaking around with, it is a very dumbed down side scroller… I seem to have it running with FlashPunk pretty smooth. Although learning more about Starling has me very curious as to how the same application would run with Starling.