Background design - choose Sprite / TiledBackground / Tilemap ?

  • Which one should I use Sprite or TiledBackground or Tilemap ?

    If :

    Player Character = Sprite with animation, Platformer

    Enemy Character = Sprite with animation, Platformer

    1. If the solid area see picture below with red rectangle mark, also contain tilt area. Should I use a saparate hidden sprite (solid behavior) for the all the collision area, and leave all background design origin without solid behavior ?

    2. Is it wise to use Tilemap to draw the background in this case, tilemap collision area is fixed to rectangle 32x32 even the object contain blank area ? Can I change the tilemap collision area ?

    3. Tiledbackground collision area is fixed ? how to use tiledbackground for tilt area ?

  • You can modify collision polygon for individual tilemap tiles (for example to make 45 degree slopes). You can also rotate and flip tiles.

    In your example it may be better to use TiledBackground. It has a fixed collision polygon, but you can rotate it to any angle and stretch to any length without distortion.

    You can also use a combination of all 3 object types, it's entirely up to you. For example, the main collision map is made of TileMap (it can even be invisible). And some elements like floating tilted platforms are sprites or tiled backgrounds.

  • Hi Dop :)

    thanks for the reply...

    I found it.. I should right click on the tile to change tilemap collision

    LOL.. it use same icon in UI, I never thought its different :D

  • How about the efficiency ?

    Which one better :

    1. 1 Sprite size 32x32 NO animation (speed set to 0), duplicated to 7 item with different UID

    2. 1 Tiledbackground with original image size 32x32, resize the width to 224 in layout to form 7x32

    3. 1 Tilemap with original image size 32x32, tiled 7 times

    Let say.. 3 of them in 3 separate different project.

    Of course cannot feel the different because only that item in the project.

    But imagine 1000 item not just 7, which one is the best choice in this case ?

  • I imagine if you just put lots of objects onto the layout, there will be no difference in performance. It all changes once you start adding behaviors and events to your game.

    Keep an eye on the number of collision checks in debug mode, don't let it go to very high numbers. Don't overuse "heavy" behaviors like PathFinding. Minimize the number of events that are run on every tick. Don't apply too many effects to objects. And then you'll be fine.

  • I see.. thanks Dop..

    other question :

    So If Solid behavior need to apply in that Tilemap / TileBackground / Sprite, which one better ?

    Well if I use Physics object for the player/enemies sprite, then I also need to apply Physics to all of those and set "immoveable" to tilemap/tiledbackground/sprite which hold the enemy to prevent it fall out from viewport

    Object with solid behavior can hold the Platformer object,

    but If Platformer change to physics, solid behavior cannot hold it.. should apply physic with checked immoveable

    Is there any other trick to make less physics object ?

    Or every object that physics immovable optionchecked consider as not physics object ?

  • Physics objects only interact with other Physics objects. Objects with Solid behavior interact with Platformer, 8-direction, Car and many other behaviors. It's generally a bad idea to mix Physics with any of other movement behaviors. In other words, don't have both Platform and Physics behaviors enabled on one object at the same time.

    I believe immovable object uses much less resources than movable, but it's still a Physics object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see.. thanks for the advice Dop..

    I am still learning all about this optimizing stuff especially what is the proper way to load the image file in game.. which one should be sprite, which one should be tilemap or tiledbackground when it come to be huge and a lot of images

  • How about the efficiency ?

    Which one better :

    1. 1 Sprite size 32x32 NO animation (speed set to 0), duplicated to 7 item with different UID

    2. 1 Tiledbackground with original image size 32x32, resize the width to 224 in layout to form 7x32

    3. 1 Tilemap with original image size 32x32, tiled 7 times

    Let say.. 3 of them in 3 separate different project.

    Of course cannot feel the different because only that item in the project.

    But imagine 1000 item not just 7, which one is the best choice in this case ?

    For repeating tiles, always use Tiled Background or Tilemap instead of Sprite. Tiled Background is vastly more efficient than sprites for repeating images

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