Facepunch / garrysmod-issues

Garry's Mod issue tracker
141 stars 56 forks source link

Certain maps seem to break Trace Hulls (Included 3 maps that can cause this issue) #5938

Open MagentaIris opened 2 months ago

MagentaIris commented 2 months ago

While playing Temporal Assassin (https://steamcommunity.com/sharedfiles/filedetails/?id=3258426988)

Going into the levels 1 after the other seems to break ALL TraceHull checks VS Npc Bounding Boxes.

I'm unsure what causes this or why it happens and was hoping you would be able to provide more insight on this.

Can find the maps in question here - https://drive.google.com/file/d/1i5C96Us6dpsLgzuLYOo6zQyGJRU9uBKt/view?usp=sharing

They're part of a set from Spherical Nightmares.

EDIT: It appears to be completely related to sn_level04a which breaks trace hulls as soon as it's loaded in.

robotboy655 commented 2 months ago

Can you please elaborate on how to reproduce the issue?

Does it happen only in your gamemode, or in Sandbox as well? Is just entering that map enough to trigger this? In what way exactly is it apparent that something broke on your end? Traces simply not hitting NPCs?

I have tried, on x86-64 beta, using your gamemode and Sandbox, and could not see anything out of the ordinary, using the hulltrace example from wiki. image

MagentaIris commented 2 months ago

I'm doing a lot of my weapons Trace Hulls on the Client and using that data to tell the server to do things for clarity.

As soon as you enter the map the system seems to fail to work anymore. Purely in TA for some reason?

Here's a snippet of code from the A.R.C Blade Swing Filter is just an array of the Player and the Weapon ent. Pos is the players eye position an ANG is the players view angle.

local TR = {}
TR.start = POS
TR.endpos = TR.start + ANG:Forward()*95
TR.filter = self.SWING_FILTER
TR.mask = MASK_PLAYERSOLID
TR.mins = Vector(-8,-8,-8)
TR.maxs = Vector(8,8,8)
local Trace = util.TraceHull(TR)

Here's the Check, Simplified for easier reading.

if Trace.Hit then
local ENT = Trace.Entity                
if IsValid(ENT) then        
if ENT:IsNPC() or ENT:IsNextBot() then
Do Shit Here Wow
end
end
end

This all seems to instantly happen on sn_level04a, it's never happened on any other level before, so it baffles me.

EDIT: Upon further inspection, restarting the game and going STRAIGHT to sn_level04a doesn't cause the issue.

I'm doing some more indepth testing now.

EDIT 2: No matter how much I run through the testing, I can't seem to get this issue to come back up again, It's happened to 3 other people, including myself back when I first tested these levels.

But now it seems to just be fine? I swear this problem is just extremely inconsistent.

robotboy655 commented 2 months ago

I'd take a good luck at the variables you feed it first, before blaming the game. Maybe some crappy mod is overriding MASK_PLAYERSOLID, or there's some condition(s) where the data you feed it isn't what you expect it to be?

MagentaIris commented 2 months ago

I'd take a good luck at the variables you feed it first, before blaming the game. Maybe some crappy mod is overriding MASK_PLAYERSOLID, or there's some condition(s) where the data you feed it isn't what you expect it to be?

Going to tell you right now I don't use anything but my own things. Nothing I do overrides Mask contents at all.

Going through absolutely ANY other map what so ever doesn't create this issue, Though it did happen to me during Half Life Source, a single time. I was back then also not able to replicate it.

Perhaps it's to do with doing Too many traces in a single frame and that somehow breaks?

Either way, I did try more and I couldn't seem to re-create the issue. When the issue first cropped up i checked a lot of variables and nothing was out of the ordinary either.

Sorry.