Bobby

Bobby

8M Downloads

World Confusion with servers using proxies.

GreatMCGamer opened this issue ยท 7 comments

commented

Basically, I have my own server that has multiple servers tied to 1 proxy.
Many of these servers include multiple worlds.

The Bobby appears to work properly with multiverse plugin, but when it comes to the main worlds, it believes that every different servers main world is the same world.

It is slightly silly to see plots servers builds in one direction and legacy servers chunks in another direction. and then there's the survival servers chunks around too.

Is there really no way for the client to know what servers main world, under the same proxy, it is in?

commented

Bobby differentiates worlds by server-supplied dimension id and parts of the seed (hash). That's really all the differentiating information which the server sends to the client, so if those two are the same for multiple worlds behind the proxy, then as far as the client is concerned, it's the same world.

For old servers using ViaVersion, you can change the dimension id it sends via the ViaVersion config file: https://github.com/ViaVersion/ViaVersion/blob/101a4f63defd84349e010e89b2f475da8f42a3e7/common/src/main/resources/assets/viaversion/config.yml#L216

For modern servers, I may consider adding support for https://github.com/kosma/worldnamepacket (a server-plugin which sends the "level-name" to clients, you just need to install it on all servers and make sure their level-names are all different) if that would be useful in your case. Went with a dynamic solution instead, see below.

commented

Would it be possible to add a manual switch for this?

commented

I can say that adding support for WorldNamePacket seems useful. It requires a bit of setup server side, but with how useful Bobby is it's worth it.

But I'm in the same situation GreatMCGamer is. I just have two servers connected to a proxy, one survival and Bobby is mixing up some of the chunks between the two of them.

commented

What's the status on this @Johni0702 ?

commented

I've been working on a solution which always starts a new cache on each connect (and world change) and then automatically merges that cache with existing ones as soon as it finds enough chunks which they have in common.

Currently that threshold is set to 10 chunks and increases by 2 for each mismatching chunk it finds. A similar threshold exists for declaring two caches as definitely-not-the-same-world (so we don't have to keep trying) at 100 mismatching chunks, also increasing by 2 for each matching chunk.
Chunks are compared only based on the opaqueness of their blocks; all blocks that are opaque are considered to be the same; all blocks that are non-opaque are considered to be the same; there is only two groups. This is so minor changes like dirt turning to grass, water flowing and leaves decaying won't make a difference and so the computed fingerprint of most chunks hopefully remains the same across Minecraft versions.
Chunks which do not contain enough identifying information (also called low quality chunks) such as plain flat-world chunks are ignored when matching (though only if both caches have a low quality chunk; if one does but the other does not, then that's a mismatch). A chunk is considered to be low quality if it consists only of homogeneous layers, i.e. all the blocks on any given y are the same (wrt opaqueness), i.e. within any particular y-layer, either all blocks are opaque or all blocks are non-opaque.

I have pushed my WIP implementation to https://github.com/Johni0702/bobby/tree/feature/multi-world and here's a build of that if you want to give it a try: http://i.johni0702.de/bobby-4.0.6-experimental-multi-world-v0.jar

To use the feature, you need to enable it in the config while the game is closed or in the main menu. You will also have to run /bobby upgrade if wish to use an existing cache with it (though if your cache is already mixed between two worlds, then you will probably want to start fresh).
For debug info on all local worlds, you can run /bobby worlds.

Be sure to backup your .bobby folder before using this version. It may very well still include some pretty bad bugs.
Things I already know that still need fixing:

  • After running /bobby upgrade, your old chunks won't immediately become visible. You have to move around enough for it to see sufficiently many new chunks (only those loaded after the upgrade finishes) that it can match against the existing cache.
  • Some small amount of chunks seem to get stuck in the "unknown state" even after /bobby worlds full (should coincide with "Found chunk X in region Y when it should be in Z" message in the log)
  • Lots of debug info is being printed to the log while a merge is in progress
  • The "Delete Unused Regions After X Days" setting may interact badly with this feature (or it may not; idk, haven't looked at it yet)
commented

Any eta on when it will be finished and merged with the main branch ?

commented

Above-mentioned dynamic multi-world support has now landed in Bobby 5.1.0 available for Minecraft 1.20.2 and 1.20.3/4.

Note that it is currently still disabled by default but enabling it should be as simple as flipping the corresponding switch in the Bobby config.