Minecraft

Looking at the decompiled code, I can say that they send a flag with the chunk-packet which determines if the packet contains any chunk-data or none.
Its that easy to do. (You still have to check if the chunk is empty before you send the packet)

Edit: Pseudo-code example time!


## SERVER TO CLIENT SEND FUNCTION OF CHUNK ##
- Prepare chunk data for fast compressed sending.
- Determine if the chunk is empty by some means.
- IF chunk.isEmpty DO
  - Send Byte 0
 -ELSE
  - Send Byte 1
  - Send Chunk Data (in whatever form you want)

## CLIENT CHUNK RECEIVAL ##
- Read Byte
- IF read-byte EQUALS 0
  - Create new Chunk and fill it with Air
 -ELSE
  - Create new Chunk and fill it with data from the Packet.

Its fast AND easy to implement.

  • Longor1996

I think I can agree on the thing with the space-game.

The problem with the heightmap calculation was that it get’s a lot more complicated and resource-intensive, even if you implement a “lazy”-heightmap implementation, that updates the height-map as chunks are generated and visited. Right?

In the end its just these problems here:

  • Heightmap Calculation/Generation/Updating
  • Sky-Lighting calculation.

If these are the only problems, then I can fully understand why you wouldn’t want to implement it.
And as long as there isn’t a solution to it that give’s the same(or better) performance than the current system with the above given problems, you won’t ever implement it.

I got my answers. I am happy.

Have a nice day jeb_!

  • Longor1996

PS: {mcfan-mode-on} YAY, I talked to jeb. {mcfan-mode-off}. Thats enough to make my day.
PPS: Some people on minecraft-forum.net are constantly trying to find a solution for the above given problems. Maybe one day they find one… maybe not!

Actually, one thing I always wanted to know. How do you handle empty chunks/air blocks? I’ve always wondered because it seems keeping air hocks would hog a lot of memory and it would be a waste of precious processing power. I don’t really know how to combat this as they’re still hold, and I still need them to do calculations, but they’re useless for anything else.

Looking at the decompiled code, I can say that they send a flag with the chunk-packet which determines if the packet contains any chunk-data or none.
Its that easy to do. (You still have to check if the chunk is empty before you send the packet)

Edit: Pseudo-code example time!


## SERVER TO CLIENT SEND FUNCTION OF CHUNK ##
- Prepare chunk data for fast compressed sending.
- Determine if the chunk is empty by some means.
- IF chunk.isEmpty DO
  - Send Byte 0
 -ELSE
  - Send Byte 1
  - Send Chunk Data (in whatever form you want)

## CLIENT CHUNK RECEIVAL ##
- Read Byte
- IF read-byte EQUALS 0
  - Create new Chunk and fill it with Air
 -ELSE
  - Create new Chunk and fill it with data from the Packet.

Its fast AND easy to implement.

  • Longor1996

Right, I know that, but air in a chunk that isn’t completely air, how do you do that? I guess it really wouldn’t be that big of a deal, but I don’t know!

If a chunk is just 90% Air, it will be sent.
If a chunk is 100% Air, it will not be sent.
If a chunk is 0% Air, it will be sent.

As an if statement:


if(Chunk.containsOnly(AIR))
  isEmpty = true;
else
  isEmpty = false;

Don’t try do cut out the Air sections out of the single chunks, thats unecessary and a waste of time.
Just check if the chunk consists only of air, and if that is, the chunk is empty.

If your chunk is just 4096 blocks, and each Block takes up some bytes (1-4), it doesn’t really matter if you try to cut out the single Air section out of that chunk. If each block would take up 8 bytes or something bigger, then you should consider cutting out unecessary sections of air, or compress the chunk at runtime.

  • Longor1996

Right, I know that, but air in a chunk that isn’t completely air, how do you do that? I guess it really wouldn’t be that big of a deal, but I don’t know!

If a chunk is just 90% Air, it will be sent.
If a chunk is 100% Air, it will not be sent.
If a chunk is 0% Air, it will be sent.

As an if statement:


if(Chunk.containsOnly(AIR))
  isEmpty = true;
else
  isEmpty = false;

Don’t try do cut out the Air sections out of the single chunks, thats unecessary and a waste of time.
Just check if the chunk consists only of air, and if that is, the chunk is empty.

If your chunk is just 4096 blocks, and each Block takes up some bytes (1-4), it doesn’t really matter if you try to cut out the single Air section out of that chunk. If each block would take up 8 bytes or something bigger, then you should consider cutting out unecessary sections of air, or compress the chunk at runtime.

  • Longor1996

I just want to say thank you to Jeb for having had the courage and foresight to completely redo the Minecraft chunk system when he put out Anvil.

I understand the position he was in and why he chose to do it the way he did at that time. Because of that everyone now gets to take for granted the Double Height that they now enjoy and which prior to that many swore could never happen. And it was classy when you gave a shout out to Robinton, author of the Cubic Chunks Mod, back when you released Anvil. :slight_smile:

btw: Jeb, is Grumm still working on upping the height to 2000 and adding 3D Biomes? Even without a complete cubic chunks work-up that would take Minecraft to a whole other level, as well as allowing people to build 1:1 scale replica buildings and such without height mods.

Again Jeb, Thanks!

I just want to say thank you to Jeb for having had the courage and foresight to completely redo the Minecraft chunk system when he put out Anvil.

I understand the position he was in and why he chose to do it the way he did at that time. Because of that everyone now gets to take for granted the Double Height that they now enjoy and which prior to that many swore could never happen. And it was classy when you gave a shout out to Robinton, author of the Cubic Chunks Mod, back when you released Anvil. :slight_smile:

btw: Jeb, is Grumm still working on upping the height to 2000 and adding 3D Biomes? Even without a complete cubic chunks work-up that would take Minecraft to a whole other level, as well as allowing people to build 1:1 scale replica buildings and such without height mods.

Again Jeb, Thanks!

Yes, Grum is still working here!

What you are talking about, I believe, is the now abandoned project to rewrite the client. The intention was to better separate game logic from rendering, and looking into a more efficient way of handling chunks. The project was abandoned because it didn’t really lead anywhere… just a lot of work.

The idea is not completely dead, though. As we’re working on making the game suitable for modding, we have to decide on where to put the API’s boundaries. For example, should a mod be able to modify how chunks are stored, or should the game always assume the current system? I guess we’ll see…

Yes, Grum is still working here!

What you are talking about, I believe, is the now abandoned project to rewrite the client. The intention was to better separate game logic from rendering, and looking into a more efficient way of handling chunks. The project was abandoned because it didn’t really lead anywhere… just a lot of work.

The idea is not completely dead, though. As we’re working on making the game suitable for modding, we have to decide on where to put the API’s boundaries. For example, should a mod be able to modify how chunks are stored, or should the game always assume the current system? I guess we’ll see…

Jeb_, can I have your thoughts on my first and new unreleased game.
The post is: http://www.java-gaming.org/topics/better-camera-controls/31022/view.html

p.s don’t mind the better camera controls title

Jeb_, can I have your thoughts on my first and new unreleased game.
The post is: http://www.java-gaming.org/topics/better-camera-controls/31022/view.html

p.s don’t mind the better camera controls title

Minecraft dev team still posts on JGO? Awesome!

Jeb_, any plans for 2.0?

You guys should be here as programmers, not mc fanboys. Treat him like any other jgo member.

Minecraft dev team still posts on JGO? Awesome!

Jeb_, any plans for 2.0?

You guys should be here as programmers, not mc fanboys. Treat him like any other jgo member.

Exactly. This is a java programming forum, and this thread should be 100% relevant to that. Not an AMA of Jeb.

You might as well lock the topic really. As long as it’s visible people are going to continue updating it.

  • Jev.

This thread is for the game Minecraft, and most people are asking Minecraft and/or Java related questions. There’s no need to close the thread if it is getting traffic.