Health and Fall damage systems
Health and Fall damage systems
Status
- [ ] Ready
- [x] Development
- [ ] Hold
Description
Adds Health and Hunger components. Adds a health and fall damage system.
Related issues
#358
Progress
Currently waiting for physics/velocity for correct player fall damage calcuation
- [x] Health and Hunger components
- [x] Health system
- [x] Fall damage system
- [x] Hiding dead clients for others
Checklist
- [x] Ran
cargo fmt,cargo clippy --all-targets,cargo build --releaseandcargo testand fixed any generated errors! - [x] Removed unnecessary commented out code
- [ ] ~~Used specific traces (if you trace actions please specify the cause i.e. the player)~~
Should be mostly complete now. Someone glance over it again.
It works quite weird when you bunnyhoping down from low hills, and you also take damage during bunnyhop with some delay.
Really hard to reproduce, I believe what happened was that when you hit the ground and jump again before the server ticks, the fall damage is calculated for both jumps. Resetting the fall distance when moving up should fix this, but this behavior should only be applied to players.
Yep, looks like it is fixed. But there is another problem, sometimes when you fell down, the server does not register your fall at all, no one debug message about the missed fall. Demo
That's a really weird one, seems to only happen when, immediately after connecting, you jump from a cliff into another chunk causing the client to reload and for some reason teleporting a bit up, resetting the falling distance. I'm not sure how to solve this in the current implementation while not re-enabling the bunnyhopping issue. I guess there's a reason minecraft uses player velocity to calculate fall damage, but that's not implemented in feather yet (afaik).
I think this is mostly do to physics not being implemented on server side, which means we 100% rely on the data from the client.
Is this PR mergable ?
Currently this implementation works for mobs, but for players it's a little buggy due to entity physics not being implemented yet. I'd therefore wait until entity physics are implemented before merging this.