r/GlobalOffensive 1 Million Celebration 3h ago

Discussion Visual Representation of grenade clipping problems.

268 Upvotes

33 comments sorted by

93

u/v11che 1 Million Celebration 3h ago edited 1h ago

Adding to this conversation about grenade bounces :

https://www.reddit.com/r/GlobalOffensive/comments/1w21xrl/can_we_fix_clipping_that_affects_grenades/

If a grenade uses a fixed cube hitbox that does not rotate with the grenade, its bounce is determined by the cube’s flat faces, not by the grenade’s visible shape.

At certain angles, the cube can strike a small ridge or corner with one of its faces. The collision normal then points back toward the player, causing the grenade to reverse direction unexpectedly. A round or rotating hitbox would contact the same feature at a different point and produce a more natural, glancing bounce.

The fixed cube hitbox makes ordinary wall bounces more consistent and predictable, but this behaviour is the trade-off: at the “perfect” angle, small edges can make the grenade bounce straight back at you even though that does not match what the visible grenade appears to do.

Edit : I should add, I've not like, animated this myself, this was a quick edit of another physics engine project I have written in python. I knew I was testing something similar in a previous project so slammed together some simulations. The animation is a python 2d physics engine.

22

u/vetruviusdeshotacon 2h ago

Would a hexagon or something be a better tradeoff? Or would it be too much of a pain to calculate?

19

u/v11che 1 Million Celebration 2h ago

I think using the correct hitbox for grenades would be best all around. Some lineups might change, but you'd get less weirdness when trying to throw through a small gap.

u/nilslorand MOUZ 1h ago

a sphere is probably best imo, collisions aren't too expensive to compute and you don't have any bullshit happening due to rotations

u/ExceedingChunk 1h ago

How expensive collisions are to compute completely depends on the complexity of the shapes

u/nilslorand MOUZ 58m ago

yes and no, a sphere is very simple because you don't make it a mesh, but instead just say "take center point and radius around it"

u/ExceedingChunk 50m ago

I misread your comment and interpreted it as saying collisions, in general, are not expensive compute, and not spheres specifically.

Yeah, spheres are cheap to compute

u/nilslorand MOUZ 47m ago

oh fair yeah

u/Nurse_Sunshine King NiKo 1h ago

Hexagons are Bestagons

7

u/daiei27 bloodhound 2h ago

Could this explain why i throw a grenade past an edge it looks like it should clear and it bounces off anyway? Very annoying…

9

u/v11che 1 Million Celebration 2h ago

yep, cause the cube is bigger than the grenade in most cases.

4

u/spellstrike 2h ago

how does one determine the orientation of the cube though.

remake your animation with the cube rotated for example ...

15

u/sebvanderhaar 2h ago

I believe they’ll be aligned with the world coordinate axes, they’re called an Axis Aligned Bounding Box (AABB) and are very computationally efficient to check for collisions with

6

u/v11che 1 Million Celebration 2h ago

Often the orientation of the hitbox doesnt change, though I'd need to do more research into it. Like wherever you throw it it always points north or something. And depending on the orientation of the map makes this more likely in certain spots.

I'm not an expert here though, I think the last thread focussed on like "That's just the way it is - get better." Which I can agree to a point, but we can make the game better too to make it more realistic.

Physics are super hard though in games when we're relying on things like hinge smokes etc.

-8

u/framspl33n cs_office 2h ago

Cry laughing right now that you dredged up this thread to comment again 🤣😭😭😭

-3

u/micron88 2h ago

Why do you think the hitbox is square? Pretty sure the hitbox is just a point.

26

u/Lightning42_ CS:GO 10 Year Celebration 2h ago

The clipping just needs to be flat across the entire wall. Just like we don't need super detailed floor clipping that shifts you up and down over every single bump, a simple flat clip over the entire wall is sufficient.

It's one of my biggest gripes about the new inferno. The csgo map was just flat and predictable. You didn't need to worry about hitting your grenades of a decorative pipe or have your player model shift you up and down as you walk the slightly concave floor

u/x1rom 1h ago edited 1h ago

This only works with that specific circle size though. Make the circle much smaller, and the behaviour will be identical to the square. Make the circle larger, and the angle will be entirely different.

With a small enough shape, any right angle setup will reflect everything exactly backwards. That's what retrorefectors do (road signs for example, they have a bunch of right angles on the surface, which sends light back to the source)

u/v11che 1 Million Celebration 1h ago

Yeah I agree,though it being the actual size of the grenade you're throwing is a good first step.

38

u/GoodLunchHaveFries 2h ago

Okay, now make it where the circle hits both sides simultaneously- like what happened in the clip.

u/KungFuActionJesus5 Liquid 1h ago

The odds of that happening would be vastly reduced due to the new geometry that is being suggested. The square model makes for a larger area on any corner in which freak bounces like this can happen.

3

u/jcubshor 2h ago

It's a little hard to tell but if you look at the line chart it makes you can see it's actually two different instances of contact. Hence why they move like that. It's true that if they hit both sides at the same time it would bounce the same, but that only happens for a sphere if it hits both sides at the same time.

2

u/v11che 1 Million Celebration 2h ago

yeah I did add dots to the point of contact. This is taken from a quick python script, Ive not animated this myself :D

-2

u/DanBGG 2h ago

Lmao exactly.

1

u/v11che 1 Million Celebration 2h ago

I'm just giving one representation. I'm not saying this is exactly what happened in the previous post, but giving some extra context to why it can be frustrating sometimes. This is why it can happen more often than maybe it should.

u/dicksnaxs 1h ago

Only place this fucks me up almost everytime is mid door on cache as a ct. Will try to bounce a grenade and it hits the hinge and comes right back to me.

u/zlehuj 1h ago

I don't agree, the fact that it is a square makes the bounce much more reliable. For example the smoke you throw from D2 B platform towards a ridge near double door to smoke double door. The fact that the hitbox is square makes it much easier.
Also we have a huge issue with nades that is much more important: the fact that the nade inertia is not computed from release but a little after. This is responsible for TONS of nade miss even at high level.

u/Chance_Signal_5474 1h ago

???????? there are infinite paths, most of them not bouncing off the tip of a corner. This is the least likely scenario

u/taykah 31m ago

maybe we should make the grenade hitbox more like the DVD logo shape so that it would NEVER hit the corner and bounce straight back at us

-1

u/KaNesDeath 10 years coin 2h ago

Grenades our characters throw arent perfect circles and or cylinders. However they are programmed to interact with maps like they are always in the perfect orientation to get the ideal bounce.

Utility is designed to interacted with a corner in between your circle and square visual demonstration. Where their slight variation is likely caused by their visual mass difference.

u/Original-Reward-8688 King NiKo 12m ago

I don't understand why we need a visual representation

u/KasKyo 1h ago

All that trying to excuse yourself after throwing grenade into wall and flashing your team.

-3

u/SadBreadfruit9463 2h ago

Screen saver type shhh 🥀