0 Favourites

How do I check one tile meets the conditions easily?

  • My game has 5300 isometric tiles. Checking them all is a huge task for the game- dropping fps by 40 for each event that does this every tick.

    Currently to check the instance variable of a tile, I have had to use 'for each tile'- causing it to check all tiles every tick, even if include- Trigger once.

    Is there another way to do this?

    Thank you.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I assume the tiles are made of sprite objects and you are not using a tilemap.

    If you need to use for each, first set all the limiting conditions and to for each as the last condition. For each is slow so it is best to limit the instances it checks. With so many isometric tile objects you want to avoid doing for each unless necessary.

    Also why are you checking it every tick? What is the purpose of it? Is there not some particular triggering action that mandates a check which could trigger a function?

  • I assume the tiles are made of sprite objects and you are not using a tilemap.

    If you need to use for each, first set all the limiting conditions and to for each as the last condition. For each is slow so it is best to limit the instances it checks. With so many isometric tile objects you want to avoid doing for each unless necessary.

    Also why are you checking it every tick? What is the purpose of it? Is there not some particular triggering action that mandates a check which could trigger a function?

    Yeh they are. Isometric tile mapping was very difficult with C2. (i've read the 'tutorials' for it).

    I put trigger once but it was looping per tick somehow.

    Thanks for the advice I thought adding conditions would limit how many tiles it looks over. I guess if say theres 5 checks, if i make most of them branch off it will only check branch 2 if branch one has been met which should help. If that makes senses.

    I've found a kindof way around but it isn't ideal. Checking tiles by cursor position.

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