News for hackers. Stuff that matters.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by rasz on Tuesday June 27, 2023 @12:16AM (#36488832)
>Players were spread into 49 different teams across the map. Each team consisted of around 20 players.

How is that different from sharding into mini 20 player servers? I was hoping for 1000 players all in visual range :)

Eve Online record is >6000 players all in visual range, but they cheat by lowering server tick from 1Hz down to 0.1Hz https://wiki.eveuniversity.org/Time_dilation

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by creatonez on Tuesday June 27, 2023 @12:24AM (#36488890)
As I understand, Folia can't help you if all your players are bunched together, but unlike having separate servers connected by Velocity or Bungee, it is a seamless experience -- everyone is in the same world and can visit anyone else without having to use commands, go through portals, or even wait for a loading screen. The "bubbles" that make up the world merge and split seamlessly, with special attention paid to avoid breaking vanilla game mechanics.

The test placed each 'team' 10240 blocks apart, which is close enough for a ~30 minute walk to get to another team (~4 minutes if you take the nether), so I assume a lot of bubble merging/splitting happened. This is a relatively realistic scenario for an SMP, where towns are usually 2,000 to 20,000 blocks apart.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by skrebbel on Tuesday June 27, 2023 @02:50AM (#36489682)
Tbf “a ~30 minute walk to get to another team (~4 minutes if you take the nether)” doesnt seem very seamless to me. That’s quite a commute!
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by creatonez on Tuesday June 27, 2023 @04:39AM (#36490405)
Hah. On 2b2t, an "anarchy" server where any player can blow up any build and type whatever garbage into chat they want, players often opt to travel out tens of millions of blocks in an effort to make their builds extremely difficult to find. Can take many hours of nether travel to get to where you want to go.

And inevitably, people still find them, usually through advanced techniques -- hacks that tell you whether a chunk is newly generated or part of an existing 'chunk trail' can be used to hunt down players that have taken great effort to hide their location.

Anyways, a distance of 10240 is just how this particular test was set up. The regionizing is still useful in a much cozier world.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by AgentK20 on Tuesday June 27, 2023 @12:55AM (#36489063)
Keep in mind that the entities-in-viewing-range scales exponentially with players. 10 players in view distance is (at 20 ticks per second) 180 packets per second *per player*, or ~2k pps on the server. 100 players, ~200k pps. 1000 players, ~20m pps. All on a single Java thread, hence why Minecraft typically performs better on high clock-speed low(er) core count CPUs. Folia splits the load for the world into multiple threads, but only on a per-region basis, with each 512x512 being (potentially) on a different thread.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by creatonez on Tuesday June 27, 2023 @01:15AM (#36489159)
> Folia splits the load for the world into multiple threads, but only on a per-region basis, with each 512x512 being (potentially) on a different thread.

A small correction - Folia regions are not Minecraft regions. They don't necessarily align with the 512x512 region grid, and can take different shapes and sizes depending on what the regionizing algorithm is doing. The term "bubble" is used in some of the documentation and may be a more accurate description.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by AgentK20 on Tuesday June 27, 2023 @02:19AM (#36489491)
Ohhh, very interesting. I'll admit I only took a cursory glance at the code when it was first announced on the Paper discord since I'm not as much involved with MC anymore, but that's good to know. I'll need to dive in again one of these days.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by ocelotpotpie on Tuesday June 27, 2023 @02:36AM (#36489602)
Come back to the Discord and pepper away with questions!
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by doctor_phil on Tuesday June 27, 2023 @01:34AM (#36489254)
That scaling sounds quadratic and not exponential.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by ocelotpotpie on Tuesday June 27, 2023 @01:00AM (#36489087)
(Disclaimer: I'm on the Paper team, and Paper is the org under which Folia sits)

AgentK20 explained the technical bits along with the other reply to you, but basically the "actually all in one world" is the big part. For sharding you're handing players off to different instances. With Folia someone can just walk from one person to another without any issue or lag.

Folia dynamically groups people into regions depending on their distance. So it was designed to have people spread out to be able to support many regions across many threads. You can put 1000 people in one spot, it just gets very unhappy and you're now not really taking advantage of the whole point of Folia.

It's not a solution for every server or person but it's definitely cool because it's another tool in the Minecraft tool box. And the API is very similar to Paper, whereas the sharded options start to get kinda tricky quickly.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by imtringued on Tuesday June 27, 2023 @01:26AM (#36489212)
That is a completely different problem that is mostly bottlenecked by bandwidth and not CPU time. Every players data has to be sent to every other player. This requires a CDN like architecture to increase bandwidth.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by rasz on Tuesday June 27, 2023 @01:48AM (#36489324)
Sure you need fast tick updates for dynamic models right in front of you, but something ~100 virtual meters away? can at least halve it, 500m maybe even 1/10 will suffice.