GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Health and Fall damage systems by MrGunflame · Pull Request #462 · feather-rs/feather Conversation
|
| self.set_block(pos, BlockId::air()) | ||
| } | ||
|
|
||
| pub fn reset_player(&self, player: EntityRef) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think just completely ignoring a failure here is not ideal, maybe return an error of some kind upon failure.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /// Increasing distance of an entity falling. Used to calculate | ||
| /// fall damage for entities with health. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Assuming I understand what this means, I think it would be best to say something similar to
/// Distance fallen since an entity was on solid ground.
Without the explanation of what the type is for.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Should be mostly complete now. Someone glance over it again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It works quite weird when you bunnyhoping down from low hills, and you also take damage during bunnyhop with some delay. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| let client_id = game.ecs.get::<ClientId>(player_id).unwrap(); | ||
| let client = server.clients.get(*client_id).unwrap(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can't you ? these instead of unwrapping?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yea, not sure why I used unwrap there, but returning an error is the better way. Though not sure what error would be appropriate for server.clients.get instead of unwrapping if any?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| let network_id = game.ecs.get::<NetworkId>(player_id).unwrap(); | ||
| let position = game.ecs.get::<Position>(player_id).unwrap(); | ||
| let uuid = game.ecs.get::<Uuid>(player_id).unwrap(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can't you ? these instead of unwrapping?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Is this PR mergable ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.