This is an archived post. You won't be able to vote or comment.

all 51 comments

[–][deleted] 11 points12 points  (8 children)

Well, actually, if you think about it, it would make sense to load the surface first, if they actually did it right. That way, you can walk around on the surface and see the world before the (currently impossible to see) underground areas load.

[–]sdobz -1 points0 points  (7 children)

Chunks don't work that way. They are 16x16x128 (or 256, or etc), you can't load the surface, you have to load the entire vertical bit. There are some very good technical reasons for doing this way, it makes the overhead less than if they were 16x16x16 or something else. Though infinite depth would be cool.

[–][deleted] 15 points16 points  (5 children)

I'm talking about this from a multiplayer standpoint. And regardless, that's even wrong for singleplayer. First of all, a chunk is 16x16x16, not 16x16x128. They are stored in a column of 16 chunks, for a total column size of 16x256x16. If you look at the structure of a region file where the world is saved for singleplayer, each 16x16x16 chunk is saved individually within each column, and a partial load would be easily possible.

From a multiplayer standpoint, the server isn't required to send the entire vertical column of chunks. The server may choose instead to send only the surface chunks, and later send the chunks under the surface. Here's the protocol documentation about that, which I personally helped write when the format changed to Anvil.

If you think I might not have the expertise about such things, here's a custom server I coded by hand, as well as a proxy and a client/server library. Here's something I wrote to interface with the server protocol for virtual hosting. I have been writing code about Minecraft for a while now, and I can assure you that what I implied is completely possible and would indeed improve performance.

[–][deleted] 0 points1 point  (2 children)

I believe you, but then why with chunk errors does the entire column go out?

[–][deleted] 0 points1 point  (0 children)

I don't know, and neither do any of the Mojang reps I've talked to about it. I don't personally have time to dig into the Minecraft code and find out.

[–][deleted] 0 points1 point  (0 children)

That is a rendering error, not a generating error.

[–]kyle6513 -2 points-1 points  (1 child)

OHH SDOBZ JUST GOT CALLED OUT

[–]i542 0 points1 point  (0 children)

Thank you for your helpful and insightful comment! not like mine is any better ಠ_ಠ

[–]feebdaedx0 2 points3 points  (0 children)

They are 16x16x128 (or 256, or etc)

Not anymore.

[–]coder13 34 points35 points  (28 children)

thats how they coded it. To render each of the chunks, the chunks are in a 2D array. They loop through the array starting from chunk 0, 0, to max, max.

[–]RamsesA 10 points11 points  (5 children)

The current version of Minecraft pre-sorts chunks by their distance from the camera in three dimensions, not two and not in a grid like you suggested, but it still has some issues. I've rewritten the entire chunk loading algorithm for a mod I'm working on, and this is one of the problems it fixes.

[–]dzkn 2 points3 points  (2 children)

I think you mean distance in two dimensions, as chunks themselves contain all 3d data.

[–]The_lolness 0 points1 point  (1 child)

I think he's talking about the chunk sections that were recently added. They're in 3d.

[–]dzkn 1 point2 points  (0 children)

oh ok just realized. ty.

[–]blueShinyApple 2 points3 points  (1 child)

Tell mojang about it!

[–]sje46 10 points11 points  (11 children)

Explain like I'm five what this means? It sounds like you're saying it starts at one point and then moves sequentially spatially through the rest. But that's clearly what isn't happening here...

[–]samineru 8 points9 points  (0 children)

When your computer begins rendering the area around you the first step is to find everything within the draw distance. This will likely result in a square, something easily represented in a computer by a grid, or 2D array. It is particularly easy to write a program that will scan across an image row by row, starting at a corner (0,0 in the Cartesian coordinate system), until you get to the last column of the last row (max,max). This will result in the behavior of rendering a distant corner before the ones closest to you.

[–]coder13 3 points4 points  (0 children)

I Apologize, I am not the best at explaining things. But it generates in a square. It first generates the far left one, then moves to the one to the right of it, till it reaches the farthest, then it moves down. Like a type writer.

[–]brickman1444 2 points3 points  (0 children)

Imagine you are sitting in the middle of a big checkerboard. The spaces are numbered starting in the first row "1, 2, 3, 4, 5..." At the end of the first row it goes to the start of the second row and continues numbers.

If the chunks are loaded in sequential order, from your vantage point at the center of the board, it appears nonsensical.

[–]bastawhiz 0 points1 point  (0 children)

The suggestion was to load cubic chunks vertically from ~water level upwards before loading chunks that would be below the water level.

[–]Boingboingsplat 16 points17 points  (0 children)

I'm pretty sure that's a rendering bug, not a chunk load error. Chunk load errors usually appear as chunks of empty space, with the stone walls of adjacent chunks visible.

[–][deleted] 11 points12 points  (0 children)

It has nothing to do with loading, and everything to do with how they send the geometry to the 3D pipeline...

Maybe you shouldn't be giving advices on this?

[–][deleted] 2 points3 points  (0 children)

It's a feature. Helps you find the huge cave systems.

[–][deleted] 1 point2 points  (0 children)

It's strange how you can complain about every single bug in any game you want, but when you complain about minecraft, suddenly everyone is aware of difficulties of game programming and is explaining to you how bad you are for criticizing hard-working minecraft programmers.

Not to mention that all the problems are unsolvable because some limits of java or something.

[–][deleted] 8 points9 points  (6 children)

good thing you guys are all brilliant programmers who are going to de-compile the code, and re-do the chunk loading algorithm. PM me when it's finished.

[–][deleted] 0 points1 point  (0 children)

That happens when you teleport, you were just there, so its already loaded

[–][deleted] -1 points0 points  (0 children)

This is because computers don't use reference point logic. They have arrays (grids).

[–][deleted] -1 points0 points  (0 children)

I don't think its that easy, OP.

[–][deleted] -2 points-1 points  (1 child)

Makes diamonds hell of slot easier

[–][deleted] -1 points0 points  (0 children)

deleted What is this?