How do I improve performance for obstacle spawnings

0 favourites
  • 3 posts
From the Asset Store
Obstacle Impacts and Cartoon voices, will makes your game more funny!
  • Hi guys,

    I am currently working on an endless runner in which I have a set of obstacles that get created randomly outside of the screen while running.

    The obstacles are tilemaps and are placed in a separate layout.

    Now the game runs quite smooth on mobiles, but with every obstacle that spawns I experience a small lag. Summed up for every obstacle

    that spawns it results in a laggy experience.

    I tried the following to solve this problem:

    1.) I tried to place all the obstacles inside the main layout. I was expecting the Loader Layout to preload all of them so that spawning an obstacle

    doesnt create a lag anymore. However, the result was a drastic constant frame drop to about 5 fps.

    2.) Tried to preload the obstacle layout from the layout loader and jump into the main layout after completion. However, when a layout it changed, all preloaded images get removed from memory again. This also means that with every new game session, all obstacles need to be loaded again.

    Happy for every input...

  • are you destroying the obstacles that are already out of the window?, even if you can´t see them, the engine is still calculating position and collisions, that might be causing your slowdown

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • yea im destroying them. its not a slowdown that gets worse while im playing. I can definitely

    tell that it is caused by loading an obstacle

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