feather icon indicating copy to clipboard operation
feather copied to clipboard

Health and Fall damage systems

Open MrGunflame opened this issue 4 years ago • 8 comments

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 --release and cargo test and 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)~~

MrGunflame avatar Sep 11 '21 19:09 MrGunflame

Should be mostly complete now. Someone glance over it again.

MrGunflame avatar Sep 12 '21 10:09 MrGunflame

It works quite weird when you bunnyhoping down from low hills, and you also take damage during bunnyhop with some delay.

qualterz avatar Sep 13 '21 11:09 qualterz

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.

MrGunflame avatar Sep 13 '21 15:09 MrGunflame

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

qualterz avatar Sep 13 '21 17:09 qualterz

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).

MrGunflame avatar Sep 14 '21 08:09 MrGunflame

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.

Defman avatar Sep 14 '21 08:09 Defman

Is this PR mergable ?

leElvyn avatar Jan 31 '22 14:01 leElvyn

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.

MrGunflame avatar Feb 01 '22 10:02 MrGunflame