Tips and Advice for Physics performance on Mobiles

0 favourites
  • 5 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • 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

  • The gyro effect can be faked by adding some torque I think.

  • 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:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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

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