Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

The game can run 60FPS on a PC, but only 30FPS on the phone?
Started by vb66r55 Nov 21 2019 11:30 AM

- - - - -
4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

vb66r55

[GLOBAL: userInfoPane.html]
vb66r55
  • Enthusiast

  • 65 posts
  • Corona SDK

Greetings,
 
My game can reach a smooth 60FPS on a PC.
System Memory is about: 9Mb
Texture Memory is about: 8xxMb
 
But it will be reduced to 30fps on the phone.
My phone has 5GB RAM.
 
 
I am playing a mobile game running 1.3~2GB.
The game can run at 60fps.
But my game can only have 30fps?
 
Why is there such a difference, obviously all consumption is less than it?
 
 
Thanks.
 
 
Oh, I did a test and found that the animation module I called was global instead of Local, and it changed to normal after modification.
 
However, I saw in the performance-related posts that the useless animation requires pause to greatly improve performance.
 
But the animation is not just switching on a picture that has already been built. Why does pause have a significant impact on performance?
 
Can anyone explain it?
 
Thanks.

Edited by vb66r55, 21 November 2019 - 04:58 PM.


[TOPIC: post.html]
#2

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 106 posts
  • Corona SDK

Did you set 60fps in build settings?

[TOPIC: post.html]
#3

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,113 posts
  • Corona SDK

5 GB of ram seems like an odd number (brilliant, I know, this works on two levels!)

 

This isn't purely a question of your device's RAM though. I'm also expecting that the 1.3 to 2 GB that you are talking about refers to the game's installation size, not its texture memory usage. The most likely answer as to why a much larger game performs much better is that it is simply optimised better. Your computer probably has a dedicated GPU with sufficient RAM to run everything by itself. Phones rarely do. Even if your game is poorly optimised, a standard computer packs so much more power than a standard phone that it should have no problems with running poorly optimised mobile games.

 

Now, over 800MBs of texture memory usage is very large, especially for a mobile game, but if I'm not mistaken, we've talked about this before. In order to hit that, you could simultaneously load 13 images that are 4096 x 4096 pixels in size, which is really excessive.

 

The easiest solution is to optimise your image sheet usage. You can do things like trimming down the existing image sheets, being smart about when and where to load them (and when to unload them), as well as knowing what images are often used together.

 

For instance, if you have some UI assets that are required everywhere, then put those in a sheet of their own so that you don't need to load any more than you absolutely have to. Then again, you'll most likely have lots of assets that will only be required in specific scenes, so be sure to load and unload them when necessary. When you properly split your assets based on where they'll be used, you can reap significant performance boosts.

 

Finally, since you are working with animations, one of the most significant things that you can do is to literally optimise your art. I'm assuming you have a player character with a walk cycle? A simple, effective and good looking walk cycle can often be done with 3 frames. If you instead want to go for "perfectly smooth", then you'll require around 15-20 frames. So, knowing where to cut and how can save you significant amounts of space. Same goes with attack animations. If your player character has a gun and you animate a sequence where the character pulls out their gun, aims and fires, and then the blast effect fades away, you'll be looking at a lot of unnecessary and wasteful frames. If the gun were in a sequence of its own, at least partially, you could cut the firing sequences frames in half again, etc.

 

-

 

So, simply put, there's a lot that you can do. Then, the reason why there is a significant performance hit with keeping animations running when they aren't needed is because they require the engine to keep handling large image files. If you don't need to run something, then don't. It's as simple as that.


  • pixec likes this

[TOPIC: post.html]
#4

pixec

[GLOBAL: userInfoPane.html]
pixec
  • Contributor

  • 106 posts
  • Corona SDK

Well yeah, poorly optimized is the thing

[TOPIC: post.html]
#5

vb66r55

[GLOBAL: userInfoPane.html]
vb66r55
  • Enthusiast

  • 65 posts
  • Corona SDK

@pixec   Yes,I have set up in the initial production.

 

@XeduR      

The big game I played, the installation size is 3.5GB, I detected that it memory consumption is 1.3~2GB in actual operation, it is amazing.

But it is extremely smooth, except for a little power problem.

This makes me wonder how it did it.

 

In addition, we did discuss it before, but in the end I changed it to 2048*2048, after all, there seems to be restrictions on the phone on the document.

 

However, the image is really a big problem. I have to make a choice. I am currently testing on my mobile phone and found that the main cause is Local and Gobal. I am trying to cancel Gobal and use Local. Thank you, I have learned a lot.




[topic_controls]
[/topic_controls]