How do I solve this tilemap performance problem?

  • Hi! Could you help me?

    I'm making a tank game where the bullets collids with map and it destroy a tile range with a certain radius. My game works fine, but I have a bad performance, specially on .nw version.

    I noticed that smaller is the tilemap, faster is the game.

    I noticed that when I use a 2x2 tile size, it's faster than using 1x1.

    I know, all that shit is obvious. My problem is:

    1) The event that set the map doenst work if tile size is not 1x1.

    2) If I draw the tilemap manually, the event that erase a tile range doenst work also.

    Why dont those functions work when I use a tile size differente from 1x1?

    How do I fix it? I need a better performance!

    Thanks!

  • kind of impossible to tell without looking at code.

    you are probably doing something every tick, you have too many collision checks or have too many objects.

  • gabmusic: I wouldn't use tilemaps for objects changing ingame and I wouldn't use collisions with tilemap objects. Tilemaps are more like static background. What I would do in your case is using sprites with two "animations" for objects that can be destroyed by the tank shells (like trees, walls...). If a shell hits a sprite, it changes it's "animation" (just one picture in this case, like from a whole tree to a broken tree).

    If a shell hits the regular ground (like gras), I would just spawn a crater-sprite. No need for collisions here. You can use like a 1 second timer to spawn a crater and destroy the bullet after it has been fired.

    A nice performance boost would be to limit collision checks to objects on screen or to objects in a certain range of the bullet.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OP uses example from this post:

    construct.net/en/forum/construct-2/how-do-i-18/simple-scorched-earth-worms-ga-129595

    It's probably the only way to make destructible terrain in Construct, but of course the tilemap should not be very big.

  • Hey guys, thanks for advices...

    I've solved my problem just turning the seamless mode OFF.

    Now it's running at 55-60 FPS.

    :D

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