[Sub Editor] Lights Randomly Don't Cast Shadows*
Disclaimers
- [X] I have searched the issue tracker to check if the issue has already been reported.
- [ ] My issue happened while using mods.
What happened?
To clarify the title, sometimes any light placed in a room, set to cast shadows, will simply refuse to cast shadows at all unless it has its range increased (or decreased) to another arbitrary number. This small room in the photo below requires a light set to range 1200, otherwise the light completely ignores the walls
Best I can tell this may be a small-room issue, but I have had this occur in a large room as well. I can't think of any particular direct causes however. Reproduction steps are the best I have to go on. Edit: It appears this does stem slightly from light positioning, moving the pictured light left 2 grid spaces fixes it. However, I do believe this behavior is a bug worth figuring out. Additionally reducing the range after moving it reintroduces the bug
Reproduction steps
- Build a submarine
- Place a light
- Set the light to Cast Shadows and On
- Move it into a room and test if the light behaves
- If it does not, adjust the range up or down until it suddenly behaves
Bug prevalence
Happens regularly
Single player or multiplayer?
Other
-
Sub Editor, possibly affects singleplayer/multiplayer. Untested.
Version
v1.0.21.0
-
No response
Which operating system did you encounter this bug on?
Windows
Relevant error messages and crash reports
No response
I was able to repro this although a little differently.
- place a light down, set it on and to cast shadows
- set the range to 0
- increase the range
- occasionally the shadows work, but most of the time not. Decreasing the range makes the shadows work again
so a friend and I may have pinned down why? Seems to be related to having no hulls at all, then adding a light. Once a hull is added it still won't fix it, but if you save & reload the sub, it fixes it. Maybe it's got something to do with physics body generation? IDK how the light code works
Additionally shifting the entire submarine in the editor can move around the problem locations, even to other lights
Might've been addressed by the changes in https://github.com/FakeFishGames/Barotrauma-development/pull/5372 (PR in our private repo), which fixed Lamp Causes Light Leak Through Hatches After Open & Close and Opened hatches/doors do not cast shadow when closed. Moving to QA for a re-test
Tested, could no longer repro the issue with either of the described repro steps.