How do I check one tile meets the conditions easily?

Get help using Construct 2

Post » Sun Jan 22, 2017 12:53 am

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.
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
2
Posts: 129
Reputation: 3,169

Post » Sun Jan 22, 2017 11:14 am

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?
B
15
S
6
Posts: 85
Reputation: 1,195

Post » Mon Jan 23, 2017 8:28 am

Pulstar wrote: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.
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
2
Posts: 129
Reputation: 3,169


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests