|
|
|
|
Reply From: |
MysteryGM |
Hi, I profiled the games performance and discovered some problems.
First, I had the reverse problem, on my mobile it was so fast that it flew up over the pipes, with a single touch.
It looks like your touch code, is executing every frame. Instead you should maybe only check when the touch started.
You should use delta time, that way the game won’t work with frame rate but time instead.
func flap(InDelta):
bird.set_linear_velocity(Vector2(bird.speed , bird.linear_velocity.y - 100 * InDelta))
When ever you then call the function you pass Delta to it:
func update(delta):
if Input.is_action_pressed("flap"):
flap(delta)
pass
See update() already provides you with delta time.
Delta time, is the time it took to get from one frame to the next. So if your game is 60FPS then Delta will always be 0.016ms.
Your game is also using 160mb of memory. This is bad for very old mobiles, but not a problem for new ones. Because mobiles share memory between graphics and everything else. A sprite sheet could fix this.
I hope this helps.
Hi,
1 - I reset the FPS to 60. Is there any setting that I have to notice?
2 - In my Flying State - the stage at beginning of the game like the video above. It do not have any code in func update (delta). But you could see, the bird not smooth and lag sometimes.
3 - How to check memory in Android while running game? I can check the version on PC by the system monitor but I am not sure it same as the Android version. And Android Studio cannot find my device when I using Godot.
homaroxbk | 2018-08-31 02:43
1.) If your frame rate is back to 60 then everything should be fine. All you need to do now is make the game frame rate independent.
The only other setting that can effect frame rate is V-sync. It should be on by default.
2.) Profiling on the PC should still give you stats, these won’t be accurate but can work as a rule of thumb, kind of thing.
Enable the developer function on your Android to see the stats of the device. That way you can see how much resources you have to work with. How to get developer options on your Android phone | Digital Trends
3.) If android studio can’t find your device then it could be too old. I have 2 mobiles that fell off the supported list with the last update.
Using a older SDK could help. But isn’t needed. Like I said earlier, profiling on the PC should give you acceptable memory measurements.
All you need now is to learn how to use the Delta value. I will try to explain it.
MysteryGM | 2018-08-31 09:47