Help with Lights

Guys, first sorry, because yesterday I had posted something about the subject here and I deleted the topic because I thought I had solved it. But today I realized it wasn’t.

I automatically create light on the character as soon as he enters the room:

But when starting it happens

As I use zoom in my game, I decided to also zoom in on the Light layer and then, it works like this:

In the video below, I did an example putting the lights on the base layer (taking it from the layer created by the light) and it works better. However, when placing several lights, the same thing happens in the image above, see:

What I already did:

*I changed the color of the lights
*I changed the color of the light layer

  • I had all the lights created in the light layer and in the base

What I want is a light on my character that will illuminate the dark path of the map, and the map will be completely dark so that the player cannot see in front of him. Only where there are lights will it be possible to see.

After many attempts and persistence, I realized something. This seems to only happen on tilemaps, note that objects like the character itself and candles are colored correctly.

Please note the following situations:

Tilemap with just the Lightning layer (in the editor)

In the game:

Tilemap with the Lightning layer and a light (in the editor)

in the game:

For those who still have doubts if I’m placing the objects correctly:

Base Layer (Normal objects - Tilemap, character, candles)

Lightning Layer (only one light)

Layers:
Screenshot_20220723_102537

Tilemap properties

However, I have noticed one thing, if I put the light on the base layer, this happens here:

In the editor

In the game

As you can see, the tilemap is not all white, it only lights up where I want it to be and that’s what should happen. However, there is still a problem, the illuminated area is not fully visible.

I checked the gdevelop examples about “lights” and it works perfectly, I tried to replicate it the way it was in the examples to see if I was doing something wrong or different, and no, everything was correct!

I even tried disabling everything in the scene, and putting only what you need to work the lights and the same thing happens:



I have no more ideas! :face_exhaling: :face_exhaling: :face_exhaling:

EDIT:
Woooow, looks like I found some bug… I don’t know if this should happen, but it does

Unfortunately, TIlemap does not and has not ever supported the lighting engine (correctly). From what I remember, the source library (Pixi-tilemap) doesn’t support blending modes at all in general, but I don’t have time to read through the original issue currently: Additive rendering Bug with Tilemap Objects · Issue #2774 · 4ian/GDevelop · GitHub

Someone relatedly reported back in February: Tilemap and light object