Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing door buttons or sprite depth bug #9462

Closed
1 of 2 tasks
Randy624 opened this issue Jun 25, 2022 · 6 comments
Closed
1 of 2 tasks

missing door buttons or sprite depth bug #9462

Randy624 opened this issue Jun 25, 2022 · 6 comments
Assignees
Labels
Bug Something isn't working Code Programming task Unstable Tickets that are included and being tested in the current Unstable build.

Comments

@Randy624
Copy link

Randy624 commented Jun 25, 2022

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

missing door buttons or sprite depth bug

Reproduction steps

Easy in reproduction
Door has default sprite depth - 510.

Bug prevalence

Happens every time I play

Version

0.18.12.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

_No response

button.mov

_

@MaaiG
Copy link

MaaiG commented Jun 25, 2022

Scale depths bug.
The depth scale of left background wall does not match the depth scale of right background wall!
Something like that!. Apparently they have two different depth reference points or different depth scales.
Sprite on the left - from a new set. Apparently unresolved errors accumulate. It is the lack of uniformity in basic things... IMHO

P.S. You can add the video just by dragging it into the message body (maximum 10 mb).

@Randy624
Copy link
Author

Randy624 commented Jun 25, 2022

I understood about the hidden depth limit, the background walls don't seem to have such limitation.
it's different here
I do not understand the logic of button behavior in this at all. And why is it different from the rest of the door.

@MaaiG
Copy link

MaaiG commented Jun 25, 2022

I do not understand the logic of button behavior in this at all. And why is it different from the rest of the door.

The door structure is composite! The frame with buttons and the door itself are two elements. They are located at different levels of the depth scale.
111
In your example, the door is fine.
The problem is that the background wall on the left and the background wall on the right have the same depth settings, but the left wall is higher than the right wall. That is, the 890 depth level for the left is not the 890 depth level for the right.
Apparently they have two different depth reference points or different depth scales.
The left background wall has been added recently in a new set of background walls! Obviously, this problem with all the walls of the new set compared to the old walls.
If you take the background wall from the same new set as the left, there will be no problem between them.

111.mp4

@Regalis11 Regalis11 added Bug Something isn't working Code Programming task labels Jun 27, 2022
@Regalis11 Regalis11 self-assigned this Jun 27, 2022
@Regalis11
Copy link
Collaborator

@MaaiG

That's pretty much what's happening here, although it is not about "different reference points" nor "depth scales" (there's actually no such thing, the issues you reported in that other ticket are caused by different types of entities being rendered in separate passes, which enforces a certain draw order between them).

When two entities have the same sprite depth, their draw order is based on their ID and the texture they use. So essentially, if you set the sprite depth to the exact same value, the draw order between them is inpredictable (but consistent). And what's happening with the door is that the buttons are separate sprites with a depth of 0.89.

@Regalis11
Copy link
Collaborator

Addressed in https://github.com/Regalis11/Barotrauma-development/commit/82e7e2c87e8b6e37cc013836b54b4cf107f9c790 by separating the buttons from the door's background sprite, so the buttons can have a lower sprite depth than the background.

@Regalis11 Regalis11 added the Unstable Tickets that are included and being tested in the current Unstable build. label Jun 29, 2022
@NilanthAnimosus
Copy link
Collaborator

NilanthAnimosus commented Jul 4, 2022

Tested in 0.18.13.0, works correctly, closing.

Notes: could not find any outpost module/vanilla submarine that appeared to use values that may cause any issues. Moving walls around shows the button hides at the intended depth of 0.75 offset by the door depth (IE. +0.01 to door depth is +0.01 to button depth). it is now easily possible to hide the background of the door and not hide the buttons with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Code Programming task Unstable Tickets that are included and being tested in the current Unstable build.
Projects
None yet
Development

No branches or pull requests

4 participants