mojira.dev
MC-2931

Boat location desync

Boats have synced badly for a long time now.

To begin with, each boat has a flag telling whether the local player is controlling the boat. This is only updated upon entering, but not exiting the boat. Until the boat is reloaded, it will always think the local player is controlling it. The server sends packets of the form [player attached to boat] upon entering and [player attached to null] upon exiting. It seems the code interpreting the packets expects [something that is not the player attached to boat] instead of [player attached to null].

That flag is used by the client to pretend to have complete control over the boat. It stops responding to position updates sent by the server (1.8 changes this slightly). The updates set some internal variables, but those are never used to actually update the boat's position. Due to this lack of updates, the client's position quickly diverges from the server's. This leads to boats hitting things and possibly breaking in what appears to be open water. In extreme cases you could (before 1.8) run off of the edge of the world on the client, because the position was off by all of the render distance.

The client runs full server code on boats it believes it's controlling. This includes breaking lily pads and snow layers in the boat's way. This is another source of desync because it updates the local view of the world without the server's consent. In the lily pad test case you can see two trails of broken lily pads, one of them due to a hallucinating client (not visible on the attached screenshot, which is of an older version).

Since 1.8, boats do respond to forced teleports, which generally occur every 20 seconds or so. They will instantly jerk to the reported position and set their velocity to zero. Makes for a very jerky ride that actually creates some desync as I'll detail in a moment.

A good test case is/used to be a superflat world with preset "3;minecraft:bedrock,2*minecraft:water,minecraft:waterlily;24;oceanmonument,biome_1". Place a boat and gently move around (so that the boat breaks lily pads, not the other way around). The desync should soon become apparent when the server breaks lily pads that don't appear to be near you. If you manage to break the boat, the resulting planks and sticks will drop where the boat really was, whereas your character remains where the client thinks it was. 1.8 still wreaks havoc even though it kind of fixes itself periodically.

Yet another issue is the mishmash of client and server control that was the intended result. The client predicts the boat's movement by reacting instantly when you press a key or move your mouse. You can't conflate the position reported by the server a round trip ago with the current predicted position. If you do, a few moments after accelerating you will jerk backward. After stopping, you'll jerk forward. After turning 90 degrees, you'll jerk sideways. That's what 1.8 does periodically now.

So many things are broken. Every attempted fix only makes things more convoluted without truly fixing anything. I stand by my suggestion (which I left in the comments over half a year ago, before I got to own this report) to leave everything to the server. My point that you don't know what you're doing has only become more solid. So keep it simple. Boats react very slowly anyway, so a little bit of network latency is hardly noticeable. Horses are much more sensitive, yet the client doesn't predict them.

Linked issues

MC-2315 Async boats / invisible blocks in water ? Resolved MC-4738 Lilypads still breaking boats Resolved MC-7367 Boat breaking randomly Resolved MC-15165 Boat Entity Despawns While Loading New Chunks Resolved MC-17717 Boat Bug Resolved

Attachments

Comments 97

I can confirm that boats still break from lily pads in 1.4.5. It can happen at any speed and water depth. I've made a video in which I reproduce the bug at various speeds and angles in both shallow and deep water. http://www.youtube.com/watch?v=u4uai1h3usc
I can also confirm the desync bug in 1.4.5. I've made a video for that as well, it shows the issue quite clear. http://www.youtube.com/watch?v=zOm_iUSscBA

Boat constantly smashes apart on lily pads in a swamp in 1.4.6. Seems to occur when catching lily pads by the corner of the boat.

Soooo annoying (lily pads breaking boats). I confirm in 1.4.7 Voted.

Lily pads still break boats in snapshot 13w16b. It even seems worse now.

Happens for me in usual swamp biomes as well, no need for a custom creative world to reproduce. Just go to a swamp biome, get in a boat and hit a few lily pads.

87 more comments

Still an issue on 15w41b. Teleported from the "edge of the world" unloaded chunk boundary back into an island I was nowhere near. Server was on localhost, so it wasn't a network issue.

WOW! I've been playing with the new boats on the latest snapshot, and they're great! The "rowing" took me a bit to get used to, until I realized I can just hold down both buttons and go. I'm still getting used to the steering, but they don't seem to catch and jump like they used to, they can be pushed but don't shoot away when you get out, and they don't break when you run into things. I ran full speed into a squid, and it wound up in my boat. It's still there, after I've gotten in and out, and slept a night. It's adorable.

I'm happy.

Cannot confirm for 43b. Haven't been getting this with the new boats.

Same here. Can no longer reproduce in 15w43b

Resolving as fixed for 15w43b.
If you're able to reproduce this issue in either 15w43b or newer, please create a new issue mentioning this one.

Malte Maiwald

jonathan2520

(Unassigned)

Confirmed

boat, desync, location, position

Minecraft 1.4.4, Minecraft 1.4.5, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w05b, ..., Minecraft 15w33b, Minecraft 15w35d, Minecraft 15w35e, Minecraft 15w36d, Minecraft 15w41b

Minecraft 15w43b

Retrieved