How do I make objects use only a tiny amount of performance?

0 favourites
  • 12 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I have a tiled map (not using tilemap) that has 5000 objects. It runs at 60fps (with other things going on), but I would like to make the map bigger. At 15000 tiles it runs at 8fps. I have collisions turned off but if there anything else I can do? Nothing is checking the tiles or anything.

    Thanks for your help!

  • 15000 is too much.

    Best option to retain that size is to split it up into different layouts.

  • Any particular reason you aren't using the tilemap object?

  • I'm guessing it is because it is some kind of mining game, in which he needs so many objects to destroy. Like newt said, use more layouts and just move the player to the new layout when they reach either side or bottom.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 15000 is too much.

    Best option to retain that size is to split it up into different layouts.

    Im really surprised that there is no way to lessen the cpu use from objects.

  • Tilemap is the go to method.

    It's one large texture versus 15000 small textures.

    It puts the burden more on the gpu, which is what it excels at.

    The only other optimisation worth mentioning is "render cells" located under the layer properties.

    It tells the system not to worry about rendering objects that can't be seen.

    It will lessen the load, but 15000 is still a bit much for the cpu to keep track of, even if they are static.

  • Im doing isometrics and ive got most of the game coded but I wanted a larger world. Gamers love big worlds even if they add no gameplay value

    Tilemap is terrible for iso though

  • Well the only other option is to create, and destroy those objects based on where the view is.

    Setting it up is pretty convoluted as you need a map, and creating, with destroying a bunch of stuff all the time can be just as big a draw on the system.

    Then another way would be a combination of that with something like multiple layouts, but using cells on one layout instead, sort of like how the old Zelda's did it.

    The trade off is that the player has to wait while the next cell is created.

  • Newts first method is the approach I would attempt, and as he mentioned it is not simple. Although I'm sure the performance would be significantly better than having 15000 objects loaded at once.

    I'm assuming that the player only sees a tiny fraction of the total 15000 tiles at any given time. You'll want to create those tiles at runtime within a set range around the player. The method of generation would probably be via an array containing tile coordinate and ID information, or from a seed.

    You may even be able to use exported data from a map built in program like Tiled, as isometric tile data is more or less the same as orthographic, just displayed differently.

  • Thanks for the advice guys Some very interesting ideas to have a go with. Players can zoom right out and see the whole map though (especially useful for the map editor) but I will have a go.

  • You can use 2 tilemaps to represent ISO.

    And, you can translate tiles to sprites and sprites back to tiles to improve performance. ... -2016-capx

  • I think a common technique is to replace the tiles with a lower resolution image/larger tile as you zoom out - you dont need all the detail when you can't see it anyway.

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