Skip to content

Conversation

@tobbi
Copy link
Member

@tobbi tobbi commented Feb 2, 2025

Basically, it's in the title.

Currently, only one object can be set as ignore object for the collision system. This is alright when we want to prevent self-collisions. However, sometimes multiple objects need to be ignored. For example in case of ledge behaviour where we want to prevent badguys from assuming players can be walked on.

Therefore, I changed GameObject* ignore_object to const std::vector<GameObject*>&.

Furthermore, I've changed the code to ignore players when checking whether the badguy may fall because we don't want badguys to consider players as suitable target for continuing to walk when their ledge behaviour is set to stay on the platform.

Fixes #3194

MatusGuy

This comment was marked as off-topic.

@MatusGuy
Copy link
Contributor

MatusGuy commented Feb 2, 2025

Oops, accidentally reviewed sorry

@tobbi
Copy link
Member Author

tobbi commented Feb 2, 2025

Why does this ignore only players now? Does this fix a bug?

Fixes #3194 (see title)

@tobbi
Copy link
Member Author

tobbi commented Feb 2, 2025

Maybe RayCastIgnore::IGNORE_OBJECTS would yield the same result? IDK.

Copy link
Contributor

@MatusGuy MatusGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's a better way of fixing this. For the BadGuy, you can detect if the object hit by the raycast is static, or, in other words, either COLGROUP_MOVING or COLGROUP_MOVING_STATIC.
If it's really needed to ignore objects (which is not the case in might_fall) we can think about this later. I'm rewriting these functions sooner anyway

Copy link
Member

@Hypernoot Hypernoot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually fixes only the case when the bug is triggered by the player. But it can be triggered by any object in the group COLGROUP_MOVING. Problem is, that the group COLGROUP_MOVING sometimes acts as solid (the case of badguys) and sometimes acts as non-solid (the case of powerups and the player). Therefore, a badguy may still stand temporarily on COLGROUP_MOVING. Therefore, the correct behaviour would be:

  • If the badguy stands on COLGROUP_STATIC or COLGROUP_MOVING_STATIC, then refuse to walk on COLGROUP_MOVING.
  • If the badguy stands on COLGROUP_MOVING, then don't test for walkable ground. I guess that badguys are not supposed to walk on top of each other permanently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Haywire player ledge collision error

4 participants