News for hackers. Stuff that matters.
Re:Classic Minecraft now free online by asdfman123 on Wednesday May 08, 2019 @04:22PM (#19862509)
I've got a question since we've got a lot of developers together talking about Minecraft: why is it so inefficient? If I take a rowboat anywhere on my MC (decently spec'd) server the loading is horrible.

Is it just because there's so much going on in every chunk, and the rendering engine has to load entire chunks all the way from the bedrock to the sky?

Re:Classic Minecraft now free online by nulagrithom on Wednesday May 08, 2019 @04:45PM (#19862735)
For one, it's single threaded (last I checked). It also seems to be built on a big heap of messy Java.

Check out Cuberite for comparison. It's a Minecraft server built from the ground up in C++ and it's waaaaaaaay faster than the official server. Advantages of a rewrite I suppose...

Re:Classic Minecraft now free online by asdfman123 on Wednesday May 08, 2019 @04:59PM (#19862874)
You'd think MS could do a rewrite given how much money they spent on it. But I guess the incentive to mess with things just isn't there for them.
Re:Classic Minecraft now free online by detaro on Wednesday May 08, 2019 @05:08PM (#19862963)
There are two completely separate lines of Minecraft ("Java Edition" for PCs vs "Bedrock Edition" for PCs/game consoles/...), so they've done a rewrite, but not dared kill off the original product, because they aren't compatible.
Re:Classic Minecraft now free online by mathw on Thursday May 09, 2019 @04:48AM (#19866483)
Not just compatible, the game mechanics aren't even the same :(

I think the end of the line for Java Edition will come at some point, but I also think they know perfectly well that they cannot do that prematurely, and we're very much still in "premature" territory.

Re:Classic Minecraft now free online by pythonaut_16 on Wednesday May 08, 2019 @05:04PM (#19862919)
You know they have right? The Window 10/Xbox/Pocket Edition is a complete rewrite in C# afaik
Re:Classic Minecraft now free online by zapzupnz on Wednesday May 08, 2019 @05:32PM (#19863176)
C++, actually.
Re:Classic Minecraft now free online by voldacar on Wednesday May 08, 2019 @04:28PM (#19862571)
Minecraft IO isn't terribly efficient. The chunks don't get rendered bedrock to the sky, but the chunks have to be loaded from disk like that. Due to the way they are stored, there is no way to load only the visible/nearest part of a chunk. (I'm working on a minecraft clone with cubic chunks btw)
Re:Classic Minecraft now free online by Dylan16807 on Thursday May 09, 2019 @02:14AM (#19865829)
A chunk from bedrock to sky is 5KB on disk. There's no way that loading order is the problem.

There might be issues caused by the raw number of chunk loads, I'm not sure there. But I can say that the majority of my lag issues when hosting minecraft can be squarely blamed on doing world generation in the main thread.

Re:Classic Minecraft now free online by LeifCarrotson on Thursday May 09, 2019 @07:24AM (#19867156)
Whick is why a lot of large servers pre-generate the world out to a few thousand blocks.
Re:Classic Minecraft now free online by zapzupnz on Wednesday May 08, 2019 @05:31PM (#19863172)
I wonder if cubic chunks is possible to add to Minecraft through modding, or to its nearest open-source 'competitor' (for lack of a better term), Minetest.
Re:Classic Minecraft now free online by FooHentai on Wednesday May 08, 2019 @06:54PM (#19863723)
Re:Classic Minecraft now free online by voldacar on Wednesday May 08, 2019 @06:40PM (#19863627)
It would require a hugely significant engine rework. Networking, IO, world generation, entity AI, etc

Basically any part of the code that reads/writes chunks in the world or just references some kind of chunk-related data-type would have to be altered

Re:Classic Minecraft now free online by zapzupnz on Wednesday May 08, 2019 @07:28PM (#19863955)
Another user has posted a link to a mod for 1.12 that seems to do cubic chunks. I wouldn't have thought networking would need to be altered for servers where all users have the appropriate mods installed on the client; world generation and entity AI would follow already-established rules about how loaded chunks relate to unloaded ones.
Re:Classic Minecraft now free online by pythonaut_16 on Wednesday May 08, 2019 @05:03PM (#19862913)
I'd be interested in checking that out! Is it open source? Do you have a Github link?
Re:Classic Minecraft now free online by voldacar on Wednesday May 08, 2019 @06:38PM (#19863618)
It's very much a WIP and is not on any public git server yet. If it ever gets to that point, I'll probably post it on this site
Re:Classic Minecraft now free online by openbasic on Wednesday May 08, 2019 @06:32PM (#19863586)
Re:Classic Minecraft now free online by jonathanhd on Wednesday May 08, 2019 @04:34PM (#19862632)
Most games can use loading screens to hide their "chunk lag", minecraft doesn't have that option.
Re:Classic Minecraft now free online by Profan on Wednesday May 08, 2019 @04:35PM (#19862647)
If you can spare the RAM, i'd stick the world on a ramdisk (I did when hosting a MC server and it makes an appreciable difference versus the terribleness of disk IO)
Re:Classic Minecraft now free online by lildoggo on Wednesday May 08, 2019 @04:52PM (#19862806)
Could you expand on this more? My friends and I just got up and running on our own beefy home server and it'd be nice to take advantage of the massive amounts of RAM on it.
Re:Classic Minecraft now free online by NegativeLatency on Wednesday May 08, 2019 @04:57PM (#19862851)
Google for something like: your os name + "make a ramdisk"

You'll also want to look into making sure the save data is persisted to durable disk across reboots/power loss.

Re:Classic Minecraft now free online by Profan on Wednesday May 08, 2019 @09:07PM (#19864459)
Others have expanded a bit, but it depends on what you're running it on, a tmpfs setup is your friend on linux and even for windows there are free alternatives :)

Of course you will probably want to incorporate something that copies the ramdisk contents to somewhere a little more permanent ever so often, set an interval you're comfortable with losing data within! (but given the huge improvement i'd say it is worth it!)

Re:Classic Minecraft now free online by sgarman on Wednesday May 08, 2019 @04:58PM (#19862860)
If you are running off a fast SSD for storage I'm not sure that the RAM disk method will get you noticeable perf improvements; but I don't have any data for this so appreciate any corrections.
Re:Classic Minecraft now free online by mises on Wednesday May 08, 2019 @07:22PM (#19863909)
RAM is easily ten times as fast as a nice SSD.
Re:Classic Minecraft now free online by Dylan16807 on Thursday May 09, 2019 @02:29AM (#19865885)
That doesn't mean it necessarily makes a difference. If your bottlenecks are CPU speed and disk latency, an SSD will remove 99% of the time spent waiting for disk, and even an infinitely fast ramdisk can only give you another 1%.