Fix pen handling for multiple func_breakable_surf skipping glass breaking effect#1716
Conversation
c2ee1fe to
1bd5807
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Thanks! I'll see if I can solve that, or at least make it more like ognt. In all versions very shallow angles fail to draw the decal. |
|
While AI generated comments are useful for understanding what the introduced changes were, I would reconsider:
Generally repeating what the code does in the comments eventually leads to a "the map is not the territory" mismatch, and it's a pain for collaborators that aren't using AI to keep comments up to date. And collaborators that are comfortable with AI can just query an agent to research what the code actually does. Excessively verbose comments also potentially confuse humans and can cause AI agents go into a contradiction resolving rabbit hole, so I would learn from such comments but then try to make them more succinct. |
|
Also I would generally keep the Description field on topic about what this PR does, and to move the methodology explanations and general commentary in the comments section. |
|
Here's a test map with 1 unit width windows to the right, and 2 unit windows in the left rows: And some screenshots of the test. Shooting 1 bullet with the OGNTPenetrates eleven 1 unit panes. So I guess 1*11 < MAX_PENETRATION_DEPTH holds, assuming OGNT used the same constant? This is what we would want. NTRE branch at commit cbcc3b0 (latest commit before this PR)Penetrates 1 pane, but then the bullet does appear to traverse through the rest? Or at least the bullet decal is drawn. This PR at commit 1bd5807 (current latest)Goes through them all. Which is a bit unexpected, considering the issues mentioned above with the bullet decal. Arguably going through all of the panes is still better than what we currently have in the master branch logic, but ideally we'd want the parity behavior. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
6a41e7f to
f35e67f
Compare
…ass surfaces - prevent the back trace from stopping short due to disappearing glass entity by setting a synthetic fraction value - resolve the right material pen resist and not defaulting to concrete pen resist when it's a nodraw texture of a glass pane
accaacd to
6e955e9
Compare
|
Alright after reading this better, the ai code was truly garbo and I rewrote most of it, but I still used it's core fix of faking a fraction value. Two big issues before the fix:
Only thing I am not happy with is the bullet holes sometimes refuse to draw when breaking through multiple panes, I couldn't figure that one out. -- screens (all ntre screns are with fix): |
There was a problem hiding this comment.
Thanks for continuing to work on this.
This looks good to me for the most part, however I left some notes for things that we should fix before merging. Most importantly the NEO preprocessor guards.
On another note, I noticed that for some guns we don't quite get the same breakable_surf penetration as OGNT. I don't know if it's because OGNT does something completely different for glass penetration, or whether our penetration values are inaccurate, but in either case I think this is good enough for merge and we can revisit later if needed. But for reference, I tested all of the OGNT guns against the 1 unit pane test map, and here are the results:
Using position: setpos 477.541809 -1622.499756 186.031250;setang 0.000000 90.000000 0.000000;
With the test map: https://github.com/user-attachments/files/25472359/ntre_pen_test_map.zip
All guns penetrate 11 panes, except:
| weapon | n panes broken |
|---|---|
| aa13 | 5 |
| supa7 | 8 (For normal shot. Slug round penetrates 11 panes) |
| srm_s | 9 |
| kyla | 9 |
| m41l | Untested (gun is disabled in current OGNT) |
| smac | Untested (gun is disabled in current OGNT) |
But again, perhaps out of scope for this PR, so I'm not requesting any more changes for the glass pen values.
|
retested seems ok |
5f77626 to
be6c79f
Compare
|
Same, thank you for the map and debugging, it was a huge help. |















Description
Fix bullet penetration through multiple
func_breakable_surfpanes.Two fixes:
Plus I told the ai to not apply any damage reduction with these, but I am not sure what the behavior in the original is. (easily removable if incorrect)The original fix had some crash happen, I went through the firing range and it didn't crash. I also tested the double shatter multiple times, nothing bad happened.
disclaimer: These changes were authored by AI. I reviewed it best I could, but it's the first time I look at Source(tm) code. The solution makes sense I guess.AI assisted in finding cause of bug.
Toolchain
Linked Issues