2D Lighting in 2.5d game

I am making a 2.5d game and trying to get the lighting working correctly. Some enemies have a light attached so when they approach a building, the light should effect the building, however because its 2.5d the light should only effect certain parts of the building (like the parts near the ground). The image below is a basic layout of one of the buildings, as you can see the light is effecting the top and sides of the building, which wouldnt make any sense since the enemy(light) is meant to be on the ground behind the building. I know i can use shadow masks, to mask off the tops of the building so the light wont effect that, but this wouldnt work with the sides because in certain areas the light should leech onto the buildings. I am also looking into trying to mask certain areas off using avo? in Blender, but dont know a lot about that. Wondering if anyone else has any ideas that I could try out, to get it to work the way I am wanting. Thanks

9423011--1320623--upload_2023-10-21_15-34-55.png

You can get that effect using normal maps on your sprites, enabling the normal maps in your 2d lights and adjusting the height parameter(under normal maps section) of your 2d lights.

That being said, it looks like you are at the beginning of your 2.5d game journey. I would highly suggest you just do a 3d game with an isometric camera instead. Almost everything will be easier, almost everything will have better tools and tutorials.

Thanks a lot, I will give the normal map idea a try. I know the game doesnt look like much from the image, but about 85% of the code for the game is in place, its just the assets etc thats been left till the end, so cant really switch to 3d now. If I am doing a 2.5d game again though I will go with 3D.

A very simple act of fakery is to adjust your art so the tops of your buildings are very dark. Right now you’ve got the shadow in the down-right direction. So move it to the top, then put a gradient on the sides of the building so they’re only partly affected by lights behind the building.

9423689--1320770--dd - Copy.png

It won’t solve the problem only cover it up somewhat. But if lights are on the floor, then relatively darker roofs makes sense… so long as it’s not too sunny out!

2d lights cant be sorted

that is the root of the problem