spirulence / power-department-ld38

A game about powering the people. Ludum Dare 38 Jam entry.
GNU Affero General Public License v3.0
1 stars 1 forks source link

Powered area highlight performance is not up to par #37

Closed caryoscelus closed 7 years ago

caryoscelus commented 7 years ago

When the network becomes very big, powered area highlighting becomes quite slow.

spirulence commented 7 years ago

...highlight performance is not up to par <- was that an in-joke? 👍

This problem also applies to line placement when the lines become large - I haven't profiled, but I think the fix is likely making lines and powered area highlights their own Phaser.Group objects containing simple Phaser.Sprites. Every time a tilemap is altered, Phaser does a lot of recalculating and re-rendering that's ultimately just redone when the next tile is altered...

caryoscelus commented 7 years ago

was that an in-joke?

Yep.

I should perhaps also mention that general load seems too big: the game constantly eats about one whole core (on my firefox), even when nothing happens. This might be not related to your code, though.