CERESUltra

Music Nerd, Author, Yote!

  • She/they/it

30s/white/tired/coyote/&
Words are my favorite stim toy


brodnork
@brodnork

ok cool so 2d lights in Godot have TERRIBLE performance on lower end devices. That would have been good to know before I went and made a cool lighting effect that I'm now going to have to feel very sad about removing.



brodnork
@brodnork

...wait . The lights work totally fine in this other room. Room 1 has extreme lag and runs better when I disable the lights. Room 2 has the exact same amount of lights with absolutely no problem????


brodnork
@brodnork

Youre not gonna believe this but the lighting issue was caused by foot sounds


brodnork
@brodnork

Here is an Area2D in the Godot editor. This box acts as a trigger that can run code when an object enters it. I have an object I use multiple copies of that have an Area2D to change what sound the player's footsteps make, for different materials. However, if it's saved as a separate object, you lose direct access to the collision shape, which makes it annoying to resize.

So what did my dumb ass decide to do?

I made the base of the footstep sound trigger a sprite instead. You can resize a sprite easily, and it changes the size of its children. So the footstep trigger is an empty, fully transparent sprite with an Area2D to make it just a little tiny bit easier for me to edit in engine. What's the worst that could happen?

The worst that could happen is transparency is expensive to render and lighting is expensive to render and lighting transparency is expensive to render. The room this issue was occurring in was a cave. So I had a footstep trigger the size of the whole room. Having a gigantic, fully transparent box with multiple lighting sources effecting it is obviously very very bad and I don't know what I was thinking.

the obvious solution was to just make the code immediately hide the footstep sound trigger so it's not rendering. i'm sure this will lead to further issues one day.