Actor collision detection with offset hitboxes #96

Open
kirsle wants to merge 2 commits from actor-collision into master
kirsle commented 2024-10-20 18:21:36 -07:00 (Migrated from git.kirsle.net)

This branch attempts to fix actor collision hitboxes when their hitbox is "offset" away from the 0,0 top left coordinate.

Most of the built-in doodads have hitboxes anchored at 0,0 but some (like the Snake and Crusher) are offset - if playing as them, collision bugs may cause clipping through floors or not activating buttons correctly.


Some issues remaining:

  • If playing AS an offset-hitbox character:
    • Solid hitboxes against closed doors and platforms works OK.
    • Button InHitbox (overlap) checks do not fire (buttons won't press).
  • If playing with a non-offset character (e.g. boy.doodad)
    • Solid hitboxes work and Buttons will press correctly.
  • Both types of player hitboxes:
    • When touching a static object such as the Start Flag which has an offset hitbox of its own: the Start Flag will creep up the level on its Y axis when touched before it settles and won't move.

373028a166

Play as Boy:

  • Start Flag (offset) creeps upwards on collision
  • test-hitbox doodad solid collision OK
  • No 'sticking' on sides of solid doodads (can still fall down): OK
  • Button interaction OK
  • DOES NOT reliably trigger Crumbly Floor (0,0,98,11) (OnTop regression?)

Play as Mario (0,32,32,32):

  • Start Flag creeps upwards on collision
  • Button doesn't interact normally: its active hitbox triggers ~32px below where it should
  • Jank hitbox with closed electric doors (0,0,34,76): can clip inside and get stuck
  • test-hitbox doodad solid collision OK
  • Crumbly floor: hit or miss whether he lands on (doesn't trigger it), or triggers it but teleports straight through
This branch attempts to fix actor collision hitboxes when their hitbox is "offset" away from the 0,0 top left coordinate. Most of the built-in doodads have hitboxes anchored at 0,0 but some (like the Snake and Crusher) are offset - if playing as them, collision bugs may cause clipping through floors or not activating buttons correctly. --- Some issues remaining: * If playing AS an offset-hitbox character: * Solid hitboxes against closed doors and platforms works OK. * Button InHitbox (overlap) checks do not fire (buttons won't press). * If playing with a non-offset character (e.g. boy.doodad) * Solid hitboxes work and Buttons will press correctly. * Both types of player hitboxes: * When touching a static object such as the Start Flag which has an offset hitbox of its own: the Start Flag will creep up the level on its Y axis when touched before it settles and won't move. --- # 373028a16693ed2fccb0f867a6cbb1ee1009c308 Play as Boy: * Start Flag (offset) creeps upwards on collision * test-hitbox doodad solid collision OK * No 'sticking' on sides of solid doodads (can still fall down): OK * Button interaction OK * DOES NOT reliably trigger Crumbly Floor (0,0,98,11) (OnTop regression?) Play as Mario (0,32,32,32): * Start Flag creeps upwards on collision * Button doesn't interact normally: its active hitbox triggers ~32px below where it should * Jank hitbox with closed electric doors (0,0,34,76): can clip inside and get stuck * test-hitbox doodad solid collision OK * Crumbly floor: hit or miss whether he lands on (doesn't trigger it), or triggers it but teleports straight through
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin actor-collision:actor-collision
git switch actor-collision

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff actor-collision
git switch actor-collision
git rebase master
git switch master
git merge --ff-only actor-collision
git switch actor-collision
git rebase master
git switch master
git merge --no-ff actor-collision
git switch master
git merge --squash actor-collision
git switch master
git merge --ff-only actor-collision
git switch master
git merge actor-collision
git push origin master
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: SketchyMaze/doodle#96
No description provided.