Minecraft Finally Gets Multi-Threaded Servers

Minecraft servers are famously single-threaded and those who host servers for large player bases often pay handsomely for a server that has gobs of memory and ripping fast single-core performance. Previous attempts to break Minecraft into separate threads haven’t ended successfully, but it seems like the folks over at [PaperMC] have finally cracked it with Folia.

Minecraft is one of (if not the most) hacked and modded games in history. Mods have been around since the early days, made possible by a dedicated group who painstakingly decompiled the Java bytecode and reverse-engineered it. Bukkit was a server mod back in the Alpha days that tried to support plugins and extend the default Minecraft. From Bukkit, Spitgot was forked. From Spitgot, Paper was forked, which focused on performance and gameplay mechanics. And now from Paper, Folia is a new fork focused on multi-threading.

A Minecraft world is split up into worlds (such as the nether or the overworld) and chunks. Chunks are 16x16xZ vertical columns of blocks. Folia breaks up sections of chunks into regions that can be ticked independently. Of course, moving to a multi-threaded model will cause existing plugins to fail. Very little was made thread-safe and the idea is that data cannot move easily across ticking regions. Regions tick in parallel, not synchronously.

Naturally, the people benefiting from Folia the most are those running servers that support hundreds of players. On a server with a vanilla-like configuration only around a hundred or so players can be online. Increasing single-core performance isn’t usually an option past this point. By moving to other cores, suddenly you can scale out significantly without restoring to complex proxying. Previous attempts have had multiple Minecraft servers and then synced players and entities between them. Of course, this can cause its own share of issues.

It’s simply incredible to us what the modding community continues to develop and create. It takes deep patience to reverse-engineer the system and rearchitect it from the outside. The Folia codebase is available on GitHub under a GNU GPL 3.0 license if you’d like to look through it.

Tetris Joins Minecraft And DOOM In Running A Computer

There is a select group of computer games whose in-game logic is enough for them to simulate computers in themselves. We’ve seen it in Minecraft and DOOM, and now there’s a new player in town from a surprising quarter: Tetris.

One might wonder how the Russian falling-blocks game could do this, as unlike the previous examples it has a very small playing field. And indeed it’s not quite the Tetris you’re used to playing, but a version played over an infinite board. Then viewed as a continuous progression of the game it can be viewed as somewhat similar to the tape in a Turing machine.

The various moves and outcomes are referred to through a Tetris scripting language, so states can be represented by different sets of blocks and holes while logic elements can be be built up using the various shapes and the game logic. From those a computer can be built, represented entirely in Tetris moves and shapes. It’s a little mind-bending and we’d be lying if we said we understood every nuance of it, but seemingly it works well enough to run the game from within itself.. If it had the catchy music from the NES version, we’d declare it perfect.

Hungry for more? Here’s DOOM doing some adding, and of course Minecraft has a rich computing history.

Real Minecraft Furnace Generates Electricity From Coal

There’s a furnace in Minecraft that is used to power all kinds of things in the game. [Joel] of Joel Creates decided he wanted to build a real-world replica, and did exactly that.

The furnace consists of a 30 cm aluminium cube, inside which the coal is burned. Thermoelectric generators (TEGs) are then placed on the sides of the furnace to turn the heat into useful electricity. The TEGs are installed in a sandwich of aluminium plates designed to maximize heat transfer through the TEGs themselves. They’re fitted with heatsinks to help create the maximum thermal gradient for greater power output. The entire setup is housed in a larger aluminium cube that’s finished to look like the Minecraft furnace — achieved by using a CNC machine to draw on the aluminium with high-temperature Sharpies.

With the coal a-burning inside, the furnace was able to generate enough power to run its own cooling and exhaust fans. It even had a little power left over to charge a phone. Overall though, [Joel] hopes that with some improvement, it can one day power his Minecraft car replica up to its top speed of 25 mph.

Continue reading “Real Minecraft Furnace Generates Electricity From Coal”

Minecraft furnace IRL

Replica Minecraft Furnace Actually Powers The Game

Let’s face it, we all need a little distraction sometimes, especially lately. And for our money, there’s no better way to put your brain in park than to start up a Minecraft world and get to digging. The simple graphics, the open world, and the lack of agenda other than to find resources and build things are all very soothing.

But play the game long enough and you’re bound to think about what it would be like if the game world crossed over into the real world. The ironically named [Michael Pick] did just that when he managed to craft a real Minecraft furnace that can actually power the game. Of course, there are some liberties taken with the in-game crafting recipe for a furnace, which is understandable for a game that allows you to punch trees with a bare fist to cut them down.

Rather than using eight blocks of cobblestone to build his furnace, [Michael] made a wooden shell for a commercial folding camp stove. Insulated from the shell by a little cement board, the furnace looks pretty true to the in-game item. To generate the electricity needed to run the game, he used a pair of thermoelectric camping generators. With the stove filled with wood — presumably un-punched — the generators put out enough juice to at least partially charge a battery bank, which was then used to power a Raspberry Pi and 7″ monitor. His goal was to get enough power from the furnace to do a speed run in the game and find three diamonds to build a diamond pickaxe. Honestly, we’re jealous — our first diamonds never come that easy.

We’ve seen other Minecraft-IRL crossovers before. Fancy a ride in a minecart? We’ve got that covered. Or maybe you’d rather control a desk lamp from within the game? That’s a thing, too.

Continue reading “Replica Minecraft Furnace Actually Powers The Game”

Joel in his minecart

This Little Minecraft Mine Cart Of Mine

[Joel] of Joel Creates loves trains and Minecraft. So what better way to combine them than to make a real-life electric mine cart and ride it around?

At first glance, it seems pretty straightforward. Four wheels, each with a flange, mounted to a box with a motor. In practice, it was a little more complex than that. Just finding a spot of track to even ride on is tricky. Most “abandoned” tracks that you might see around your city often aren’t all that abandoned. Luckily for [Joel], he remembered an amusement park in the area that he went to as a kid, which he remembered having a decent amount of track. Additionally, the rails were smaller and closer to the scale of a real Minecraft track where one block is 1 meter. After calling up the owner and receiving permission, Joel began to build his cart.

First attempts to procure actual train wheels were foiled by cost and lead times, and simply CNCing a set of wheels was too expensive from a time and materials point of view. [Joel]’s first thought was about making an assembly out of two wheels to grip the rail, much like a roller coaster. However, there were dozens of switch points on the track at the park and several road crossings, both things that wouldn’t work with that sort of setup. Stumbling upon a bit of hacker inspiration, [Joel] turned to brake drums, which happen to be reasonably close to the correct size. They also have the superb quality of being relatively cheap and available. Almost all the parts were CNCed out of aluminum, plywood, or foam.

Given that the theme of the build was doing things to scale, [Joel] was mindful of the top speed of a minecart in the game, which is 8 meters per second or roughly 25 miles per hour, so he set that as his goal to hit. A beefy motor from an online warehouse and a lithium-ion pack allowed him to hit that easily; it was just a matter of doing so safely.

If you need even more Minecraft vehicles in your life, perhaps an RC boat might do the trick? Video after the break.

Continue reading “This Little Minecraft Mine Cart Of Mine”

RC Minecraft Boat Patrols The Pool For Treasure

Looking to recreate those relaxing Minecraft fishing sessions in real life, [electrosync] recently set out to 3D print himself a blocky remote controlled boat, complete with a similarly cubic occupant to ride in it. Each element of the build, from the oars to the bobber on the end of the fishing line, has been designed to look as faithful to the source material as possible. In fact, the whole thing is so accurate to the game that it’s almost surreal to see it rowing around the pool.

That said, some of the resemblance is only skin deep. For example the rowing action, though it appears to be properly synchronized to the boat’s movement through the water, is completely for show. A standard propeller and rudder arrangement under the boat provide propulsion and directional control, and [electrosync] notes its actually powerful enough to push the boat very near to its scale top speed from the game, despite the exceptionally poor hydrodynamics of what’s essentially just a rectangle.

A look under the deck.

Speaking of which, [electrosync] even went through the trouble of printing the hull in wood-fill PLA and coating it in polyester resin to make sure it was watertight. Granted he could have just made the boat out of wood in the first place, saving himself the nearly 60 hours it took to print the hull parts, but that would have been cheating.

Beyond the servos and motors that move the boat and the oars, [electrosync] had to give his 3D printed fisherman a considerable amount of dexterity. Servos embedded into the 3D printed parts allow “Steve” to rotate at the hips and raise and lower his arm. With a fishing pole slipped into a hole printed into the hand, he’s able to cast out his magnetic bobber and see whats biting.

We’ve actually seen quite a number of projects that allow virtual objects inside Minecraft to interact with the real world, but comparatively few efforts to recreate objects from the game’s blocky universe, so the change of pace is nice.

Continue reading “RC Minecraft Boat Patrols The Pool For Treasure”

Putting Thousands Of Minecraft Players On The Same Server

Multi-threading was the common go-to technique for extracting more performance from a machine for several years. These days it’s all about horizontal scaling or adding more virtual machines to a pool of workers. The Minecraft server is still stuck in the past in some ways as it supports neither multi-threading nor horizontal scaling. [Jackson Roberts] decided to change all that by hacking Minecraft to support thousands of players rather than dozens.

Since the server is single-threaded, having more than 100 players on a single server can slow it to a crawl. Some mods try to optimize and speed up the existing server but [Jackson] wanted more. An early proof of concept was to slice the world into separate servers, each holding 64×64 chunks (chunks are what Minecraft defines as a 16x256x16 volume of the world). When crossing a boundary, entities such as players and zombies were transferred from one server to another. While workable, the demo had issues such as parts of the world being inaccessible if a server went down. The boundaries were also jarring as you had to reconnect and couldn’t see players outside your server.

Instead of splitting the world, [Jackson] took the approach to split the players and have some backing store for persisting and broadcasting changes. A proxy sits in front of several Minecraft servers, which each have a connection to a WorldQL server (a spatial database based on Postgres). Each server reports the player’s location to the WorldQL server and receives updates for their loaded locations. When a server comes online, it catches up with the changes stored in WorldQL and starts syncing, allowing servers to auto-scale. There are still a few core game mechanics that aren’t quite ready for prime-time such as NPCs and Redstone, but the progress so far is remarkable.

The code for the Minecraft plugin is up on GitHub, but more is coming in the future. So if you’re interested in something a little more vanilla, why not marvel at the completely playable Pokemon Red inside vanilla Minecraft?