mt-mods / jumpdrive

Minetest jumpdrive mod

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Freeze player mid-air while jumping

thomasrudin opened this issue · comments

Prevents the "falling through the floor" issue after the jump
Related: #32

Wouldn't that require players to have the fly mode toggled on beforehand?
It might be a better solution to just set gravity to 0 for a moment for the players in question.

Wouldn't that require players to have the fly mode toggled on beforehand?
It might be a better solution to just set gravity to 0 for a moment for the players in question.

You are right 😞 ...
Currently there is the hacky solution which moves the player +1 node in y-direction (62520e1#diff-7e84b1b4ef436fa578e06f0e58252390R110) but thats just annoying on multiple jumps...

Setting the gravity to 0 during the jump would not solve the problem: the jump is executed in a single serverstep, so no information is changed/sent to the client...

Another solution would be to move the player to the jumped position in the next serverstep, i have to experiment with that...

On our server, we use this solution:
https://gist.github.com/technix/3862c9eeb54cfb822d71fda5d091b269

  • temporary disable gravity and player movement before jump
  • re-enable gravity and player movement 3 sec after jump
  • sometimes player still falls through, so place player into right position 3 sec after jump
  • disallow jump if gravity is not enabled yet - i.e. immediately after jump

The only downside is that player is not allowed to move immediately after jump and have to wait 3 sec until quantum spacetime continuum settles down :)

New concept/proposal:

  • register new invisible climable = 1 node
  • fill target area with "buffer" node
  • Use player:send_mapblock() to send "buffered" target area to player
  • Execute jump (deferred?)

OR

  • re-teleport player after a timeout (1 or 2 seconds) to same position again

EDIT: nevermind, used your idea @technix, thanks 👍