Interesting idea but improvements ti be made to the if i fell or not system. Otherwise creative idea :)
Viewing post in What Goes Up Must Come Down jam comments
thanks,
if i continue developing the game i will need to scrap the entire system and rewrite it from scratch as the current implementation is fundamentally broken, most bugs in it where fixed using workarounds instead of actually fixing the underlying issues.
a non-exhaustive list of issues and the workarounds i implemented:
* the corner between 2 slope tiles is infinitely thin, which would cause you to randomly hit the edge of the block below it (all tiles have individual colliders, i had to manually implement collider generation as bevy_ecs_ldtk lacks built in avian support) and ""fall"" while rolling down slopes, my workaround was to implement collider culling to remove colliders that don't have a adjacent air tile.
* the system doesn't actually respond to collisions as they happen, it runs at a specific point in time and compares your height to a "last height" height, if its higher it just sets last height to your current height, if you are lower a fall it registers out... turns out this interacts very badly with teleporters, one of the most difficult bugs to debug and fix was a fall being registered when going through a grounded portal as portals ran between the "update grounded" system and the "trigger fall" system, meaning the register fall system would not see you being grounded before teleporting or not being grounded after telporting, it would see you being grounded after teleporting (grounded check runs on old position, teleporter teleports, then fall updates with new position), i think i fixed it by reordering the systems but i'm not sure, i had about 4 hours left when i discovered the bug.
* theres a small buffer so that if you fall, bounce off the ground due to physics, then fall further the small bounce does not count as a fall, this resulted in you being able to bypass fall detection by spamming jump, i just added a if statement to bypass the buffer if the player jumped in the current tick.
* you stay grounded for 2-3 ticks after jumping, i "fixed" this by making ground detection count moving upwards as not grounded even if you are touching the ground
* the first work around was not enough, a slope directly next to a ledge would still have 1 tile with a collider under it as the tile has a adjacant air tile, resulting in a repeat of the issue, i just disabled ground detection for all tiles without a air tile above.
* the above was not enough, you still randomly fall while rolling down slopes