ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
623 stars 73 forks source link

[TF2] spheres are not spheres #5905

Open wgetJane opened 2 months ago

wgetJane commented 2 months ago

image

the source engine's UTIL_EntitiesInSphere function that is often used by tf2 actually uses a cube rather than a sphere

examples of mechanics that are affected by this:

it is unknown if this is intentional or not for any of these mechanics

BreavyTF2 commented 2 months ago

Doesn't the dragon's fury also use a Sphere function?

Joshua-Ashton commented 2 months ago

UTIL_EntitiesInSphere should set up an iterator that checks the radius itself -- the spatial partition query EnumerateElementsInSphere is only meant to serve as a broadphase, with the iterator serving as the actual radius check for narrowphase.

Joshua-Ashton commented 2 months ago

I will also admit, I am scared as to what fixing that would break...

Joshua-Ashton commented 2 months ago

Seems like a good portion of the code is actually aware of this, so we should probably just keep fixing this for the select few areas.

wgetJane commented 2 months ago

Doesn't the dragon's fury also use a Sphere function?

can't tell without decompilation since the dragon's fury is missing from the leaked 2018 source code

i do know that it definitely uses a cube currently: https://youtube.com/watch?v=FfumM6hzar0

the existence of the tf_fireball_radius cvar does imply that it might've been intended to be a sphere

I will also admit, I am scared as to what fixing that would break...

imo should be fixed individually if it's deemed likely enough that a certain mechanic is intended to be using a sphere

also i should've mentioned that explosive blast damage already correctly uses a sphere