TrueCraft icon indicating copy to clipboard operation
TrueCraft copied to clipboard

Jumping feels very different to Minecraft

Open Calinou opened this issue 9 years ago • 8 comments

In TrueCraft, jumping is enough to step over blocks, but the total air time is very low compared to Minecraft. This is probably due to the gravity being too high. It feels like you're bumping, more than jumping.

Calinou avatar Apr 12 '16 22:04 Calinou

Working on it it might take awhile ;)

ghost avatar Aug 11 '16 04:08 ghost

The problem seems to be that the player just accelerates to terminal velocity way too fast. That's probably an AccelerationDueToGravity issue, but I can't find the relative variable that would have any effect on it.

MggMuggins avatar Apr 24 '17 21:04 MggMuggins

The physics engine is buggy as fuck. It's difficult to build a clean-room physics engine that behaves exactly like Minecraft - reverse engineering friends have mentioned that Minecraft's own physics engine is really poorly implemented and difficult to precisely describe.

Currently the best attempts are on the wiki:

  • https://github.com/SirCmpwn/TrueCraft/wiki/Entity-Movement-And-Physics
  • https://github.com/SirCmpwn/TrueCraft/wiki/Vertical-entity-movement

I encourage anyone to take a whack at improving it. There are also less cosemetic (and possibly easier to solve) issues to tackle, like figuring out why non-player entities (sand, mobs, items) have a tendency to fall through the ground. Take a look at the unit tests if you want to look into these issues, they're a good tool for creating reproducable scenarios to test with.

ddevault avatar Apr 24 '17 21:04 ddevault

I messed around a little with the value in TrueCraft.Client/MultiPlayerClient.cs a bit. Changing the Gravity acceleration and drag made things a lot more like vanilla MC. However, doing that means the player can jump 2 blocks high instead of one. Trying to figure out why that is. Is there a maxJumpHeight somewhere, or something that would help determine what is going on there?

MggMuggins avatar Apr 24 '17 22:04 MggMuggins

Those values are straight from Minecraft, changing them wouldn't fix the real bug. The bugs are in the physics simulation, not the constant.

ddevault avatar Apr 24 '17 22:04 ddevault

Temporary fix?: Setup an spigot server and use a plugin to record the height value of your player, and make a curve graph based on the data. You could add velocity based on the curve (interpolate)

RepComm avatar Jul 09 '17 22:07 RepComm

Should be possible even without a plugin.

  1. Open debug screen (F3)
  2. Start screen capture
  3. Jump.
  4. Transcribe framenumber (calculate time) and height
  5. Draw graph and compare to truecraft

wischi-chr avatar Sep 01 '17 08:09 wischi-chr

Simulating some other motion curve isn't going to cut it. It's not designed that way. We give the player positive vertical velocity and let the physics engine do the rest.

ddevault avatar Sep 01 '17 08:09 ddevault