4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.71k stars 845 forks source link

Collision between sprites rubbing at y=32 coordenate is detected #2292

Closed frikiloko closed 2 weeks ago

frikiloko commented 3 years ago

Describe the bug

When there are 2 objects rubbing in the Y = 32 coordinate, it does not matter if they are sprites or tiles, and we have used some action with angles, the collision (without borders) is detected with objects placed in borders . This bug only occurs if the object has changed its angle to 180, with the other right angles it does not happen. Also only occurs at coordinate Y=32 where both objects are rubbing, at any other coordinate it does not. The way to deal with this problem that I have used but in my case is not very compromised, since there are almost no collision checks, is to reduce the mask I make of the object just one tenth, for example the mask 0x0-64x64 will become 0.1x0.1-63.9x63.9.

Please double check that the bug is not already reported in the issues list.

To Reproduce

Steps to reproduce the behavior:

  1. Place 2 square objects rubbing in the y=32 coordenate
  2. change the angle of bottom object to 180
  3. make a collision event without borders(objects are rubbing and no overlapping)
  4. make a action in case there is collision like destroy instance
  5. check if the collision is detected

Other details

GDevelop version 5.0.0-beta101 Windows 10.

AlexandreSi commented 2 years ago

I checked with your game:

I don't understand why only one edge is kept not rounded. Maybe it happens in Polygon2d::Rotate

Bouh commented 2 weeks ago

This bug doesn't occur on version 5.4.213, there have been several rounding corrections on previous versions, I can't remember which build, but I'm glad this bug has disappeared.