Tips and Advice for Physics performance on Mobiles

Get help using Construct 2

Post » Thu Oct 23, 2014 4:57 pm

I've been trying to make my own 2D bike physics game. It is now coming along quite nicely but I am after a few tips and advice if people are able to help:

1) Adding Gyro effect in the air (brake / accelerate to tilt - doesn't seem to be automatically supported with the physics)

2) Tips and Advice on mobile performance. Any advice on how to handle player collisions / settings to help keep a good fps on mobile devices. Currently I have setup with physics behavior. Body parts are pinned together with revolution joints at the start of the level. I have turned off all sprite collisions to reduce the no collision checks per tick.

3) Best way to scroll to player. Currently the bmx frame sprite has the scroll to behavior. This works fine, except it creates jerky movement sometimes when scrolling.

4) Most efficient way to handle collisions with the track. Currently I have over 8 points on the collision polygon. I tried a whole single track sprite but with around 40 collision points it phew the collisions off. I have now broke down into smaller / reusable track parts.

Any advice wold be appreciated. I've seen a couple of games out there that look like they use physics and have a few particle effects and seem to run pretty smooth on mobile devices. (Mine runs ok but slight stuttering when scrolling at the moment. FPS goes from 30-60 fps

Image

Image

Image

Image
Last edited by Mayfly on Wed Oct 29, 2014 4:40 pm, edited 2 times in total.
B
38
S
11
G
1
Posts: 203
Reputation: 4,473

Post » Thu Oct 23, 2014 6:29 pm

The gyro effect can be faked by adding some torque I think.
B
92
S
32
G
109
Posts: 5,294
Reputation: 70,999

Post » Wed Oct 29, 2014 4:36 pm

Thanks for the reply @R0J0hound,

I managed to add gyro effect like you said. I put together a very simple level just to test the physics out. Not too bad, but a little bouncy in places =( Hopefully can get it more robust with some tweaking. When I used to use MMF products I always stuck to platform movement for this kind of game due to funny physics.

https://dl.dropboxusercontent.com/u/631 ... index.html

(W, S, A, D are keyboard controls to move and lean) and also touch controls for mobile devices.

I just need to sort the most optimised way of handling the physics so I can start making proper levels that also work well on mobile devices =)

Youtube clip below:

Image
B
38
S
11
G
1
Posts: 203
Reputation: 4,473

Post » Thu Oct 30, 2014 1:57 pm

Unfortunately, physics behavior is very taxing on mobiles, even for very simplistic implementation.

Maybe consider it a challenge, whether you can get a similar result visually & gameplay wise without using any physics behaviors at all? :D
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Wed Nov 19, 2014 6:55 pm

It's a shame because the physics work so well. Gives nice pedal animations / bike rotations. Shame it stutters a little when scrolling =(

I have tried some additional measures to improve performance
- played around with scaling (graphics settings example I found)
- Made the player collision polygon simpler shapes / less sides

I still can't get it to run smooth, still jerks when scrolling =( Hopefully someone can help with this or give more optimising tips
B
38
S
11
G
1
Posts: 203
Reputation: 4,473


Return to How do I....?

Who is online

Users browsing this forum: khelaghor and 39 guests