78 comments

[ 3.2 ms ] story [ 132 ms ] thread
I presumed for a moment someone had built a web server running off the Minecraft redstone circuits.
Great work, but...Java? Is this for compatibility with mods?

One of the biggest pain points with running a Minecraft server is the onerous memory requirements. Java needs a ton of memory to get out of bed, and after that it's not always pretty with how the allocator works. That's fine on an enterprise server with 64GB of memory, but not cool when you're paying $10/mo. per GB of memory for what should be an inexpensive hobby.

Have you ever played Minecraft on a server without mods? It’s impossible to administer past 5 people. For that using realms is an alternative . Every other server needs mods to function.
You may not have paused to consider that an open source minecraft server is free to implement a better administration system.

It is not necessary to have mod compatibility in order to provide an extensible, powerful alternative.

Yeah, most likely. It says it supports Bukkit and Sponge plugins, both of which are built in Java (dunno much about Sponge, but Bukkit plugins are literally just .JAR files)
This was the original reason for the language choice: native compatibility with Bukkit plugins.
$10 per GB? That’s insane -- basically what high end DDR4 costs upfront.
It's basically what Digital Ocean's droplets cost: https://www.digitalocean.com/pricing/

$5/mo for 0.5G, $10/mo for 1G, $20/mo for 2G. All the standard droplets, except for the 3G for $15/mo one, make you pay $10 more per gigabyte.

Both Vultr and Linode seem to offer twice the amount of RAM per dollar though.

(comment deleted)
They just added a $15/mo 6G plan, though, which is mighty nice.
No, it's just 3G for $15/month, so that one particular plan takes $5 per gigabyte like Vultr and Linode.

That isn't to say it isn't a nice deal though.

Digital Ocean do a really good value base VPS, but once you're spending $20/mo with them, there's much better options with more traditional VPS providers. They're priced to compete with an EC2 box, while not providing the value-add to go with it, IMO.
That's not unusual for small VMs, but at the point where you need a serious amount of RAM it's drastically cheaper to rent dedicated hardware.
You can get 32 or 64GB dedicated servers for around $80-110USD per month, so that is technically more economical, but that's a lot if you need to commit to that just to get a good deal per GB of memory.
Yes because buying a stick of memory from Best Buy is ALMOST the same thing as hosting a sever in a cloud data center with an slice of an entire computer, redundant power, redundant network, and administration baked in. It is soo insane that every time we have a post, and someone compares hosting a computer in their garage with AWS. This may be a new record though, comparing hosting with buying a stick of memory at best buy.
Its not exactly a controversial statement that AWS carries a massive premium on stuff like RAM.
Great, and a airplane flight from Chicago to New York City caries a premium on the price of a gallon of gas. Please tell me how this means it is a reason to complain about the price of airline tickets?
Your analogies do nothing but confuse the issue, AWS is vastly more expensive that comparable connectivity and reundancy with colocated, dedicated or even virtualized instances in comparison to other providers, at all but the smallest scale, especially in terms of ram.
You are comparing apples to oranges. Look at the list of services you can spin up with 1 click at AWS. Now go to your little rent-a-server provider with a $49 a month server. Tell me how you add RDS / multi region LB / S3 / IoT / blah blah blah with 1 click to your $49 rent a server?
Yes, because when I'm hosting a server to play Minecraft with a few friends I need redundant power, network, and administration. It's not as if I could just go to Best Buy, buy another stick of RAM, shove it into my decently spec'd desktop, port forward to a self hosted server, and get 99% of my necessary performance for a tenth of the cost (over a year of operation). Plus I don't have to return the RAM to Best Buy after I'm done with it.

Because casually hosting a Minecraft server is ALMOST the same thing as hosting a SaaS which needs 5 nines of reliability.

I don't even think you can get 16 GB of DDR4 for $160.
I imagine most people interested in hosting their own minecraft server has some old laptop or desktop lying around. It's a very inexpensive hobby to just install linux on them and run a minecraft server there.

If the power bill is a concern, the computer wouldn't even have to be on 24/7; if it's just a server you and friends play on, it would be perfectly acceptable to just boot the computer whenever you want to play together.

I looked at using a droplet on DigitalOcean, it worked fine but there's quite a lot to consider in running a server. You can keep an image of the droplet and just boot when required. By that point my kids had moved on to Robocraft, and now Garrys Mod, and so it wasn't worth me maintaining a server for the occasional use it was getting.
Memory has never been a problem for MC servers. Speaking as someone who's personally been involved in some of the larger servers --

Pain point has always been CPU usage on a single threaded level. Nowadays servers are optimized to the point where we squeeze all of the performance out of the CPU and run multiple instances of MC in order to accomplish that on a multi-threaded level. You can easily hold 500 players concurrent with zero lag on as little as 16GB of RAM and an E3v3 processor. You might say this is a lot of resources, but compare it with other FPS games and how many players they hold on single instances, and you'll realize Minecraft is in it's own league.

Also, due to how much CPU is a bottleneck for MC, Cloud providers are avoided at all costs. 2.2ghz (AWS) is not acceptable at all for the use case.

Minecraft servers are extremely optimized nowadays -- I have no clue where the rumor started that Java was the pain point.

My point is 16GB of memory isn't a whole lot if you've already got server hardware and a place to host it, that's really low-end these days, but it's a small fortune if you need to pony up $5-10/GB. per month for hosting services.

I've been able to host Minecraft instances on my own hardware over a cable modem feed, and on a VM provisioned within a machine I fully control, but it's just not economical to do cloud-wise.

I do miss the days when the server component of a multi-player game was pretty lean and non-intrusive so you could run it as a background process on pretty much anything that had good bandwidth.

Perhaps you use a cloud VPS provider that over-provisions customers.

Until recently, I ran a Minecraft server on a $10/month DigitalOcean Linux VPS. (I consider $10/month dirt cheap.)

It ran very smooth. No lag or performance hiccups.

I really don’t want to discourage you from looking into Glowstone, but a really cool project I had stumbled over half a year ago is Cuberite[1], a Minecraft server written in C++.

[1] https://cuberite.org

If you're interested in roll-your-own things like this, stop by #mcdevs on Freenode and take a look at our documentation at http://wiki.vg, where we've been RE'ing the protocol and game internals for 8+ years.
Ah, good ole wiki.vg is still around; good to see! Haven't been in the Minecraft modding scene in years, but that site was always a godsend (I once worked on a project to implement a chat-only Minecraft client for Android; couldn't have even attempted it without wiki.vg).

And wow, I can't believe Minecraft is 8 years old -- feels like I first played it just yesterday.

Are Minecraft servers with a massive number of players something common or really not something the average player cares to participate in?

I used to run my own Ultima Online server with an emulator called RunUO about 15 years ago. The same sort of fun I had running that server is what I see people enjoying in Minecraft today. Its really great to see. It was possible back then with a .Net windows server to support 1000+ concurrent clients with very little noticeable lag.

I'm currently working on my own game in Unreal Engine 4 but if I could clone myself I think I would set about creating a Minecraft client that could connect to a RunUO server so that you could achieve those kind of 'MMO' numbers. As well, you could leverage the RunUO codebase to add support for a lot of the Ultima Online functionality (home ownership, spell casting, deep crafting, etc, etc)

What is the best community to look into for supporting massive numbers of concurrent players in Minecraft?

If you're interested in doing anything with Minecraft where starting from the official client/server won't cut it, #mcdevs is the right place.

I have no idea about what the players want these days. The large-player-count servers I believe still use instancing and transferring players between servers to support those numbers.

The other hard part is the game's mechanics. You'd need a lot of careful game design to reign in the destructible nature of the game world and all its contents. Minecraft isn't about questing and loot, it's about construction, and if you're not leveraging this you might be better served by making your own game. Large servers typically address this with round-based deathmatch or deathmatch-like gameplay, not really what you seem to be interested in.

We still use it sometimes at Mojang :)
Does anyone know if this is less resource-intensive than the original server (both CPU and RAM)? Or if it can at least leverage multiple cores properly?
I spun it up on my server (an FX-8350) and it seems the load is higher than the stock server w/ a view distance of 24. Mind you I'm only running one realm (we really only stay on the default world) because it's just my ~8 person gaming group.

It is continually surprising to me that there are all these reverse engineered minecraft servers yet none of them seem to provide a significant performance advantage within a single world. Cuberite, Glowstone, etc. They provide a notable boost when your machine is serving many worlds, but it seems most still use a single thread per world model. At least cuberite offloads chunk generation to a second thread, but in their own documentation they claim they don't want to support arbitrary levels of multithreading for fear it would hurt performance on anything less than a quad core. Even though this is a bit of a misconception, I don't understand why they wouldn't make such a thing configurable.

It's a trade off, my understanding is that Glowstone's trade off is providing customization through APIs and mechanisms that will last. E.g. simplicity and power at the cost of performance.

As an aside they make a claim that will be familiar to many lisp programmers. Their claim is by providing better power they will improve the average performance in the long run for their users (e.g. people who like lots of mods). Look at it this way, if you use horribly buggy edge cases to build flying machines that's going to take a ton of work for the server to simulate (minecraft flying machines often use tick perfect timings arrived at through - effectively - busy loops); if instead you used a mod that provided flying mechanics, and flying control blocks (e.g. that knew when to inject their logic) you would save a lot of performance. They may not be able to have the fastest server around, but given the things their users will use it for, theirs will probably be faster than those efficient servers in those cases.

Also, writing a plugin system that plays nice with threads is going to be a pita.
This is the big one. Glowstone was designed to be a native implementation of the Bukkit API (back when it was still on top), and I assure you that that API, and thereby every plugin built against it, makes some heavy single-threadedness assumptions.

Even if you conceive an API from scratch, Java hasn't the tools to prevent plugin authors from doing things they shouldn't in this regard.

I don't want to denigrate the effort, but... I'll be interested when I see something with a Forge-equivalent API.

Porting Electrical Age to a different Java-based minecraft server is in principle not terribly difficult, it's reasonably well abstracted already, but there needs to be a modding api.

While there's no reason this is fundamentally impossible, there are several difficulties:

- Forge doesn't really have an API layer and expects devs to work directly against deobfuscated Minecraft code. Mods break every Minecraft version.

- Forge-level mods require cooperation from the client, beyond what the official client offers. Forge mods are structured so the same mod file runs on both clients and servers.

- Because of this, a server reimplementation providing Forge features must do one of three things: compromising on open-source by releasing a client mod, reimplementing the Minecraft client (hard, and hard to get people to use), or mods splitting in Forge-based client halves and new-API-based server halves (code duplication, hard to convince modders to not just use Forge).

I can address the first point, at least. Forge-equivalent wasn't meant to mean identical; I'd be absolutely delighted to see a better (that is, existent) API, it just needs to support about the same things. Which does not include coremod hackery.

And yes, you'd need to create a client mod. Sure, it's a compromise, but it'd still be an improvement over the current state of affairs.

We're actually working on this, first with a rewrite of our item/block behavior system to be modular and moddable using lamdbas.

Then we will be adding a way for plugins to provide new textures in resource packs.

Once that's all done, we will create a client Forge mod to allow for plugins to add new blocks rather than reuse existing ones.

We also have a pretty nice modular system for AI tasks, but it needs more stress testing with a pathfinding implementation before we start finalizing the API for it.

Needs Rust, blockchain and AI to qualify for the front page.
It seems you won't post within the guidelines like we've asked, so we've banned the account. We're happy to unban accounts if you email us at hn@ycombinator.com and commit to commenting civilly and substantively in the future.

https://news.ycombinator.com/newsguidelines.html

Is Minecraft still a thing?

Have my kids (10,13) just grew out of it?

Minecraft is still alive and well. Still has hundreds of thousands of players daily every month on the servers. The problem is because there is a mobile app now, people will just pay $7 and play on their phones. Therefore new players arent entering the market.

It's a shame. Some of the things people have created for the MC community are nothing less than truly amazing. For example

> For example

I presume you accidentally posted too soon. Would love to see the example.

My seven year-old boy is obsessed with it. Keeps up with news in the modding community. And the amazing thing is that he's shown me how to do things with it that I didn't even know about (I'm more of a casual player and Dad with responsibilities, obviously).
There are no games that superseded it. Other "sandbox" games are entirely different, with more cautious use of sandbox concept.
What's the best open source minecraft client? And how does it compare to the official client?
I'm old enough to remember when buying Minecraft Alpha included a promise that the code would be made open source some day. IIRC it was "when I'm tired of working on it", which given the success it's been is probably never. (For some value of "I" that's not Notch.)
Selling the product to Microsoft is pretty much the opposite of making it open source.
I would probably go back on a lot of things I've said if someone offered me over a billion dollars. Also minecraft being as popular as it is you would end up with a lot (more) pissed off clueless users. cf kodi.
This is nice, but considering the animosity the modding community receives from official channels I'm really surprised why FOSS Minecraft clones that specifically focus on mods, like MineTest, haven't taken off comparatively.

https://www.minetest.net/

Could language choice play a part in it?
I think, that's rather an argument in favor of Minetest.

It's true that Java (which the original and mainly modded version of Minecraft is written in), is widely known and generally allows to write functionality relatively quickly.

Minetest uses C++ for the engine and Lua for its modding API. C++ is much better suited for a game engine, due to being closer to the hardware, using less RAM (due to not being executed in a virtual machine), not having a Garbage Collector, which halts the universe for a short moment every few seconds and is the main-reason for Minecraft still having lag spikes after years of optimizations, and then miscellaneous things like array boundary checks, but also just more game libraries being available in the C++-context (Minetest for example builds on top of Irrlicht).

But Lua for the modding API is the critical part. Minecraft doesn't have a modding API. To this day, you still mod the original Minecraft by decompiling its code (which is relatively easy thanks to Java), making your changes as a professional developer at Mojang would have to make them, and then bundling your modifications up and releasing it to the world.

As a result, it's just really not easy to do at all and mods regularly break when Mojang releases a new version.

With Minetest's modding API on the other hand, it's really easy to just quickly make some changes. I for example always disliked that digging stone gives you cobblestone, which you then have to smelt in order to get stone again. Changing that took me less than 10 minutes with no experience in Minetest modding.

All I had to do, is to find the right file and then in this section:

    minetest.register_node("default:stone", {
	description = "Stone",
	tiles = {"default_stone.png"},
	groups = {cracky = 3, stone = 1},
	drop = 'default:cobble',
	legacy_mineral = true,
	sounds = default.node_sound_stone_defaults(),
    })
...change the Drop from default:cobble to default:stone.

I then also added in a crafting recipe to convert stone to cobblestone, if I ever want to use cobblestone. Again, find the right file and then just add this:

    minetest.register_craft({
	output = 'default:cobble',
	recipe = {
		{'default:stone'},
	}
    })
Just copy-paste an existing crafting rule and change it to your needs. This is something I could have pulled off (and would have had huge fun with) even before I really knew what programming is.
I see this sentiment a lot on HN. I know nothing about Minecraft, but I'd be surprised if the factors at play here are any different from other situations where "superior" FOSS clones fail to overtake the original closed versions:

Network effects. If Minecraft is a multiplayer game whose fun is largely derived from sharing your experiences with others, then a new and "better" version isn't really better at all if it's sparsely populated. Not only do the network effects create value for players and spur growth, but they create lock-in, too.

Risk aversion. Developers and modders have less motivation to build for a new platform with few users and no profits because it's more likely to tank. Not everyone wants to be a pioneering early adopter.

Economies of scale. Minecraft makes a great deal of money. That money can be used to build features, woo developers, and launch marketing campaigns that bring in users. It's hard to compete as a free-to-play competitor.

Awareness. How many people are aware of and care about this particular issue? Most people aren't developers.

As someone who _does_ know about Minecraft I will say you're probably right on the Network Effect in particular and go into this a bit more:

Modded Minecraft is pretty unlike a typical modding community. Few people add one mod to their Minecraft game, what people tend to do is run a mod _pack_ which is typically dozens of mods with different authors that are integrated together by the pack author the way a movie's Editor turns hundreds of hours of pictures and sounds into a coherent 2 hour film.

It's out of hand enough that you will see people saying e.g. "Ugh, I can't face Magic Bees without Gendustry" - Minecraft doesn't have any bees at all, bees are added by a mod called "Forestry", then magical bees are added to that with "Magic Bees" by a different author and the mod called "Gendustry" by yet another author exists _solely_ to make the genetics gameplay from the Forestry mod more... industrial.

So there's an _ecosystem_ at work here, akin to the Windows vs Unix ecosystems and that network effect applies to your whole ecosystem.

The PC "Java" Minecraft associated with modding actually ships new versions relatively often still after all these years. But because mods are so involved, even tiny changes under the hood can mean hours of software development for the mod authors, so the ecosystem moves to newer versions less steadily, a "pack" of mods will usually be forever associated with a specific Minecraft version. Unlike most games which "upgrade" like a web browser or operating system, Minecraft actually lets you pick at start time which version you want to run in order to facilitate this. For example one of the most famous packs "Agrarian Skies" is for 1.6.4 and will never work with a newer Minecraft but still has some players.

As a result of players being interested in this ecosystem rather than the individual mods, it only takes one of dozens of key developers to stymie a move to a different platform, whether that's a new Minecraft version or somebody else's Minecraft clone. If this happens, the only way forward is for part of the ecosystem to evolve around the gap which happens much more slowly.

Example: A big part of Minecraft is crafting, and mods often add dozens of new things to craft and even new ways to craft things. Rather than have a web browser open on your phone to check what you're doing as you play, the game needs an integrated way to remind you how to make, say, a Wireless Crafting Terminal (yes that's a thing you can make inside the game). The first mod to do this was called Too Many Items. So a pack would add "Too Many Items" and that made players lives easier

But TMI was limiting and ceased to be maintained. What to do? Fortunately Not Enough Items came along. Not Enough Items was maintained for a long time, and became pretty sophisticated, able to tell players which complicated industrial machines could produce which products and with what inputs. But eventually Not Enough Items too fell by the wayside and in the latest Minecraft versions packs use Just Enough Items which is different but arguably better.

So, if you've ever gone onto the Google Play Store and saw some Minecraft clone that worked far too well for what anyone could possible hope to invest and make money off, that's almost certainly a rebranded Minetest-version.

And there is a lot of these. It would not surprise me, if Minetest had already silently overtaken Minecraft in terms of active players.

But yeah, this doesn't solve the awareness issue. These users don't know that they're playing Minetest. Even if they were playing the official Minetest Android build, they'd not know that this is the real thing.

And people interested in modding Minetest might not learn this either, so never reach the platform in the first place. Some of these rebranded Minetests bundle mods, icon packs etc., so you at least have an audience.

When I was in college, I did one in C https://github.com/kev009/craftd. Looking back, there are trivial concurrency bugs and some critical arch flaws that are somewhat embarrassing and would be easy to fix now. But wow that project set me up with a lot of useful experience I don't know how else I could have ever gotten.

Another fond random memory was, during a scalability test with over 500 users on a cheap linode, Notch joined thanks to a friend that became a popular live streamer. I long for the free time and lack of organizational soul suck to do stuff like that again.

I remember your name. I think it was from reading about the Minecraft protocol, which makes sense if you wrote a server.
For what it's worth, coming from an outsider with no interest in the game, that's some beautiful looking C.
Other than pistons not working it doesn't seem like there's a good list of known issues or missing functionality. Is there a link that I'm missing?
I think the issues on Github can give a general idea.

Pistons actually work (at least basic pushing/pulling) since a recent update, so we should probably update that on the wiki. Other than that, I'd say the biggest missing feature is Entity AI/Pathfinding at the moment.

Yes, I'm not really interested in gaming as of such, but that C code looks amazing.
What C code? I only see Java.
I just tried setting up a Glowstone server on a Linode instance. It was a very quick experience. However, I ended up switching to the official Minecraft server jar provided by Mojang when I realized that Glowstone doesn't support the "allow-flight" option for flying in creative mode :/