5 ms·
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 (decen
by asdfman123 8y ago
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?
- voldacar 8y agoMinecraft 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)
- pythonaut_16 8y agoI'd be interested in checking that out! Is it open source? Do you have a Github link?
- voldacar 8y agoIt'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
- zapzupnz 8y agoI 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.
- voldacar 8y agoIt 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
- zapzupnz 8y agoAnother 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.
- FooHentai 8y agoYes, there are cubic chunks mods https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2792887-cubic-chunks-mod-almost-infinite-world-height-and https://www.minecraftforum.net/forums/mapping-and-modding-ja...
- Dylan16807 8y agoA 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.
- LeifCarrotson 8y agoWhick is why a lot of large servers pre-generate the world out to a few thousand blocks.
- jonathanhd 8y agoMost games can use loading screens to hide their "chunk lag", minecraft doesn't have that option.
- Profan 8y agoIf 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)
- lildoggo 8y agoCould 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.
- NegativeLatency 8y agoGoogle 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.
- sgarman 8y agoIf 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.
- mises 8y agoRAM is easily ten times as fast as a nice SSD.
- Dylan16807 8y agoThat 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%.
- Profan 8y agoOthers 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!)
- nulagrithom 8y agoFor 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...
- asdfman123 8y agoYou'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.
- pythonaut_16 8y agoYou know they have right? The Window 10/Xbox/Pocket Edition is a complete rewrite in C# afaik
- zapzupnz 8y agoC++, actually.
- detaro 8y agoThere 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.
- mathw 8y agoNot 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.
- openbasic 8y agoMinetest is an open source, C++ clone: https://www.minetest.net/#features https://www.minetest.net/#features Quite fast. https://wiki.minetest.net/Differences_from_Minecraft https://wiki.minetest.net/Differences_from_Minecraft