MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.64k stars 1.33k forks source link

Water jump boost #5198

Closed SomethingSomethingV2 closed 2 weeks ago

SomethingSomethingV2 commented 6 months ago

If you are standing at the edge of a block, and next to a body of water, you can spam space to jump as high as 4 blocks. Here's a link to a high quality video: https://drive.google.com/file/d/1FPCs0hztItLZqxlgh83vYGi5-Nq9iDmQ/view?usp=sharing Demo

This is the version I was playing on: Version

Khaled-Dridi commented 2 months ago

hello i can reproduce it this is the video

https://github.com/MovingBlocks/Terasology/assets/95275414/24063b68-b473-49c6-84c7-c0f1f2b30905

i think its fun if we keep it most games have some mechanics like this where with some exploits you can jump higher like the Minecraft damage jump boost ( link if you want to see it :https://www.mcpk.wiki/wiki/Damage_Boost )

engiValk commented 2 weeks ago

Working on this now.

engiValk commented 2 weeks ago

So been doing some digging, the issue is a bit more prevalant than what is demonstrated here.

If the character is in water we set their gravity scale factor to 0.05f which should be fine but the way we check if the character is in water is with two points related to characters world position. If the bottom one is in water and the head isn't it counts as swimming so lowers the scale of gravity (which again should be fine).

The issue we are having here is that if you are hanging mostly off a ground block over water, it reads the player as in a swimming state so lowers gravity, but can still jump. I've thrown together a super quick fix but in the process the issue has become a little bigger. If you are under water that isn't flowing down and jump up INTO the water, it changes gravity scale factor and shoots you up into the air still.