physics performance objects vs family vs tileset

0 favourites
  • 6 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hi

    Currently working on a physics game prototype on mobile.

    I was wondering which of bellow 3 situation has better performance and the possible reason

    A. 20 different physical objects (and immovable).

    B. 1 family with physical behavior (and immovable) and 20 members

    C. 1 tileset with physical behavior and with 20 different shapes

  • Entry No2. it seems that no one is answering!

    Testing on galaxy note3 ...

    Scene size is 480x640 with 20 units of 32x32 sized objects performance is quite similar between different objects (unique, family, tiled background, tilemap) with 1-2 mini hiccups during initial start of game then it is smooth so the performance difference can be ignored i guess!

  • I'd like to pick up the topic but in another context:

    I'm currently building a dig&collect game ( pretty similar to Motherload if some can recall this classic hit ) and I'm using Physics to deal damage due to velocity at impact etc.

    My ground is a tileset (currently 130x400, I'll change it to a max of 75x1000) with a physics and immovable behaviour assigned. If I dig and delete a tile however I get some 3-5 frame lag. I took a look into Debuging and I saw that the physics in the Profiler went up to 40-50% CPU usage for this time.

    I don't know how the physics updater work but I guess it's lagging because it has to reevaluate the whole tileset or at least the whole visible screen. Is there a way to alter the update routine or do I have to use ghost tilemaps which are just about 75x25 or rather 25x25 in size? I haven't tested this ghost tilemap approach yet but I think this could help...

    Best regards

    Michael

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay I tested it with the ghost tilemap approach:

    It was the size of the tilemap. I can make it up to 100 tiles deep on the whole width with small lag (2-3 frames). I think I'll make one ghost every 75 block depth.

  • I personally think there are optimization tricks for games like Motherload like:

    -Fake physics since only the vehicles seems to be physical

    -Only blocks with one empty block near them have physics activated because otherwise no one will know them they have physics or not anyway!

    -When digging disable physics and collision for the block and make the vehicle do a fixed move like "go 1 block height down in 1 second" so there are no continuous physical collision.

    -Blocks that are not in scene do not exist and only are created when they have distance of 1 block from the scene borders, and removed when distance is more than 1 block from scene borders.

    I wish you success

  • Thanks for your reply. I'm using the built in physics so I don't have to worry about programming them myself and I also use them to calculate damage (which will be different from planet to planet due to gravity)

    I'm not sure if placing only physic blocks where at least one block is empty will help or minimize the update time. Just to be clear: I use a tilemap object so it's not like I spawn every block as a single sprite instance or something.

    Yes I already disabled that during digging because I else couldn't even dig into the blocks (without a big workaround to reduce the collision mask each move.

    Not sure if it even matters if my ghost tilemaps are not even created unless I'm in range for the physics disable them self after a specific idle time.

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