Skip to content

Issues resolving "unit-sized" objectsΒ #47

@1bardesign

Description

@1bardesign

In the game I'm working on (along with several others previously) I prefer using tile unit positions rather than pixel unit positions. Think rather than a 32x32 box for each tile, a 1x1 box for each tile, and everything else in the world to a similar scale.

This almost works with bump (things do collide mostly correctly and performance is fine using an 8x8 spatial hash on a 512x20 map), but seems to brush up against some floating point error issues that result in "snags" that don't occur at larger scales.

To be clear, I'm not talking about performance hitches, but erroneous collisions against neighbouring (internal) tile edges while walking from one tile to another. I haven't had similar issues when writing similar AABB solutions myself (albeit usually without the swept AABB collisions), so it may be some bump-specific optimisation meddling here. Adjusting the DELTA inside bump didn't seem to help anything, and I didn't have the patience to dig further into the internals and find out what might be causing it.

I've managed to workaround this by scaling everything up by a factor of 32 for bump only, allowing me to work in other units for the rest of my game while keeping bump happy - but I figured I'd report it as it may save someone else a headache and maybe @kikito has some insight into why this otherwise great lib may have trouble with unit boxes πŸ‘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions