Skip to content

Block guard detection and light with doors - #2886

Open
ChiguireDigital wants to merge 2 commits into
endlessm:mainfrom
ChiguireDigital:fix/door-guard-detection
Open

ChiguireDigital wants to merge 2 commits into
endlessm:mainfrom
ChiguireDigital:fix/door-guard-detection

Conversation

@ChiguireDigital

Copy link
Copy Markdown
Contributor

Summary

  • Block guard detection when doors are closed.
  • Add light occlusion to horizontal and vertical doors.
  • Enable and disable door light occlusion based on the door's opened state.

Resolves #2824

@ChiguireDigital
ChiguireDigital requested a review from a team as a code owner September 14, 2026 01:02
@ChiguireDigital

Copy link
Copy Markdown
Contributor Author
Detection (1)

Hi! Here is the result for now (it was a bit tricky, but I think I solved it well 😅), let me know if there are any errors.

@github-actions

Copy link
Copy Markdown

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.)

@wjt

wjt commented Sep 14, 2026

Copy link
Copy Markdown
Member

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

@ChiguireDigital

Copy link
Copy Markdown
Contributor Author

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.mp4

That’s how it stands for now; I’ll keep an eye out in case there’s anything else to resolve :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doors: Block guard's detection and add light occlusion

2 participants