Conversation
I think it's because for every overlay layer you're creating you're filling a |
Yeah, is each metatile frame in its own layer? I haven't looked closely at the script yet. |
|
There's a few optimizations beyond that but yes on some maps it can use thousands of layers (which should be fine, that works pretty efficiently right now but it will fully freeze Porymap on some maps with this change). I'm not sure why a given layer should assume it will use the entire scene. |
|
I guess I didn't understand what layers were for in the context of overlays. In my head they were analogous to metatile layers, and it would make sense that each frame of the animation is its own layer. But I can at least see how that could be inefficient, especially when only a subsection of the layer needs to be updated. |
When you add an item to the overlay you aren't given a way to refer back to that item, so layers were a way to A: refer back to them so you could change the item without clearing the overlay and recreating it, and B: group things together to make changes to multiple items. If there were a way to address changes to a specific item within a layer then something like the animation script wouldn't need to use nearly as many layers, but I still think it should be reasonably efficient to have a lot of layers. |
Motivation here is to be able to control transparency on a layer wide basis and not OverlayItem basis.
Needs some work to investigate why certain scripts are made slower (eg Porymap-Animation), and how to update them.
Example script before and after
Before:

After:
