Block guard detection and light with doors - #2886
ChiguireDigital wants to merge 2 commits into
Conversation
|
Play this branch at https://play.threadbare.game/branches/ChiguireDigital/fix/door-guard-detection/. (This launches the game from the start, not directly at the change(s) in this pull request.) |
|
Great start! I think it would be useful to include a test scene exercising this - even simply committing the change you did to test. I made a similar change, except i gave the guard a patrol path that spans the whole width between those two doors. Of course the guard is blocked by the door, but: their light and vision can go through the door. Screencast.From.2026-09-14.12-50-35.0.00.-.0.16.8.mp4 |
|
Hi! I’ve addressed the issues I found: Regarding the lighting, I slightly increased the size of the LightOccluder2D; this prevents light from bleeding through to the other side, even when the guard is right up against the door. As a result, when the guard stands close to the door, the LightOccluder2D itself lights up (since the guard is inside it); I think this creates a nice effect where the bottom of the door on the opposite side gets illuminated. As for detection, I realized the issue stemmed from the guard's automatic detection system, which triggered upon entering a specific radius but didn't account for obstacles between the enemy and the player. To fix this, I incorporated the function used for the guard's vision range to detect obstacles. I also added a test scene named "issue_2824.tscn" where you can test the implemented changes. Test.mp4That’s how it stands for now; I’ll keep an eye out in case there’s anything else to resolve :) |

Summary
Resolves #2824