I am having lag issues with map system

0 favourites
  • 13 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • I have a map system where if it is explored it is visible on the map page you can move the map around with wasd.(I use something like set maptile.x to MapXOffset ) but it gets laggy when there are a lot of tiles and dont know how to fix it. Would using the pin function help?

    Tagged:

  • Your map is made of tiles and each tile is a sprite? How many instances of these tiles are there?

  • each tile is an instance, there are hundreds possibly going to be over a thousand later on

  • I have around 500 right now

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 500 instances isn't too bad, but if they are animated or have effects or behaviors on them, this may be the cause of poor performance.

    An obvious solution is to use a tilemap. Or perhaps you can paste the tiles on a single DrawingCanvas and then destroy them.

  • I also recommend tilemap, it's also easier to save it as TilesJSON to load its current progress state whenever needed, and if it requires animated tiles for specific spots, you can always spawn animated sprite tiles in the wanted spots by comparing tiles ID

  • Thanks for the help

  • I think I wanta to stick with using sprite tiles, I use Adjust HSL to make them light up if the player is in that room, would this be worth finding another way to do it?|

    Also I noticed it only gets laggy when a lot of tiles are explored (visible)

  • This is what the map looks like at the moment

  • If you want the player position to glow on the map, use a sprite that follow player position, a cursor if you want, then play with blend modes, effects and sine or sprite animation to create a glow effect

  • I already have that feature set up in the game. And the way it can tell if the player has or is in a tile is in the actual game I use a 9-patch with a specific code thats different from the rest and if the player is in that it makes the map tile with that code explored and glow up

  • In that case it shouldn't be hard to make the cursor glow instead of the tile itself

  • I use Adjust HSL to make them light up if the player is in that room, would this be worth finding another way to do it?

    500 sprites with an effect may explain poor performance. Make sure you disable the effect on sprites that don't need it, not just set the default HSL values.

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