Poll

Hurp

Durp
Derp

Author Topic: Minecraft  (Read 680447 times)

0 Members and 1 Guest are viewing this topic.

Offline Josasa

  • Commando Soldier
  • *****
  • Posts: 4001
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #870 on: June 26, 2009, 02:49:07 pm »
That was awesome! Giant wall coming straight at all of us!

Offline DarkDragon

  • Final Fantasy Fanatic
  • *****
  • Posts: 6501
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #871 on: June 26, 2009, 03:44:43 pm »
I think Notch could optimize Minecraft in terms of map storing and handling, have a look at how the Minecraft maps are stored:

1. The normal size of a map is 256x256x64, the map is stored pixel by pixel and using layers so each layer is 256x256 and the whole map is 256x256x64
2. That means a whole map occupies a maximum of of 4,194,304 pixels which (I can't recall right now but I'm pretty sure) means it occupies 4,194,304 Bytes = approx. 4MB (that's not counting coordinates which probably bring it up to 9x that)
3. That's probably if the map is full of dirt, etc. I don't think air blocks occupy anything, they're basically the "blank" block because they're the most common.

Either way, it's unpractical. Notch's method on the left, my method on the right:


As you can see Notch stores every pixel so each pixel (lets say) occupies 9 bytes, I haven't worked with Java in a while but I think an Integer in Java is 4 bytes meaning that if you want to store the x, y and color of a pixel it takes 4, 4, 1 bytes respectively.
So to store the layer above using the Notch method we would be storing 14,196 pixels, each with 8 bytes of coordinates (on this layer) meaning that bit of dirt uses 113,568

Now have a look at my method, a function runs through the layer and finds the greatest block that can that fits in there, then it finds smaller blocks around it and so on (I did this by hand just to show it):

So, looking at my method on the right side we have 8 imaginary squares (x, y - width * height):

1: 373, 55 - 56 * 17 (952 pixels)
2: 368, 72 - 66 * 7 (462 pixels)
3: 364, 79 - 75 * 7 (525 pixels)
4: 383, 86 - 56 * 5 (280 pixels)
5: 338, 86 - 9 * 58 (522 pixels)
6: 347, 86 - 36 * 79 (2844 pixels)
7: 383, 91 - 67 * 113 (7571 pixels)
8: 450, 91 - 20 * 52 (1040 pixels)

We have 8 blocks in this case, each block stores 8 Bytes for coordinates, 8 Bytes for size and 1 Byte for block type (which is represented by color, in this case it's dirt)
What the above means is that using this method (with each block using 17 Bytes) that piece of dirt uses only 136 Bytes!

Compare 136 Bytes to 113,568
The new method uses only 0.12% of the data the other one uses and achieves the same effect. Of course Notch would have to write new algorithms to handle this new method but in the long run (and applying this to a 3d world) it would save a lot of rendering and processing time as well as map size, it would also allow for maps (hundreds?) of times bigger than what we have now, which would be quite epic.

I could go on, but I think you get the picture :P
« Last Edit: June 26, 2009, 03:46:52 pm by DarkDragon »
DarkDragon's Minecraft Survival Server (use this as the IP):

gamingsteve.dyndns.org

- The server uses a whitelist, if you're not on the whitelist (can't connect), PM me your minecraft name.

Offline Xeno264

  • Defender Devotee
  • ***
  • Posts: 447
  • Don't eat the yellow snow.
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #872 on: June 26, 2009, 03:48:23 pm »
That was some nice flooding. Also, what with this Spleef stuff I keep seeing.

http://minecraftwiki.net/wiki/Spleef

Offline Celdur

  • R-Type Force Pod
  • *****
  • Posts: 6615
  • :33
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #873 on: June 26, 2009, 03:53:15 pm »
MATHS

you should email him or pm him in IRC, he listens to suggestions

Quote from: Krakow sam
That quote is actualy very witty, Celdur. I suggest you use that in your signature.

Offline DarkDragon

  • Final Fantasy Fanatic
  • *****
  • Posts: 6501
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #874 on: June 26, 2009, 04:04:41 pm »
I probably will.
DarkDragon's Minecraft Survival Server (use this as the IP):

gamingsteve.dyndns.org

- The server uses a whitelist, if you're not on the whitelist (can't connect), PM me your minecraft name.

Offline Beastosaurus

  • Asteroids Aficionado
  • **
  • Posts: 114
  • Heeeeeeeeres Beasty!
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #875 on: June 26, 2009, 04:32:20 pm »
I think Notch could optimize Minecraft in terms of map storing and handling, have a look at how the Minecraft maps are stored:

1. The normal size of a map is 256x256x64, the map is stored pixel by pixel and using layers so each layer is 256x256 and the whole map is 256x256x64
2. That means a whole map occupies a maximum of of 4,194,304 pixels which (I can't recall right now but I'm pretty sure) means it occupies 4,194,304 Bytes = approx. 4MB (that's not counting coordinates which probably bring it up to 9x that)
3. That's probably if the map is full of dirt, etc. I don't think air blocks occupy anything, they're basically the "blank" block because they're the most common.

Either way, it's unpractical. Notch's method on the left, my method on the right:


As you can see Notch stores every pixel so each pixel (lets say) occupies 9 bytes, I haven't worked with Java in a while but I think an Integer in Java is 4 bytes meaning that if you want to store the x, y and color of a pixel it takes 4, 4, 1 bytes respectively.
So to store the layer above using the Notch method we would be storing 14,196 pixels, each with 8 bytes of coordinates (on this layer) meaning that bit of dirt uses 113,568

Now have a look at my method, a function runs through the layer and finds the greatest block that can that fits in there, then it finds smaller blocks around it and so on (I did this by hand just to show it):

So, looking at my method on the right side we have 8 imaginary squares (x, y - width * height):

1: 373, 55 - 56 * 17 (952 pixels)
2: 368, 72 - 66 * 7 (462 pixels)
3: 364, 79 - 75 * 7 (525 pixels)
4: 383, 86 - 56 * 5 (280 pixels)
5: 338, 86 - 9 * 58 (522 pixels)
6: 347, 86 - 36 * 79 (2844 pixels)
7: 383, 91 - 67 * 113 (7571 pixels)
8: 450, 91 - 20 * 52 (1040 pixels)

We have 8 blocks in this case, each block stores 8 Bytes for coordinates, 8 Bytes for size and 1 Byte for block type (which is represented by color, in this case it's dirt)
What the above means is that using this method (with each block using 17 Bytes) that piece of dirt uses only 136 Bytes!

Compare 136 Bytes to 113,568
The new method uses only 0.12% of the data the other one uses and achieves the same effect. Of course Notch would have to write new algorithms to handle this new method but in the long run (and applying this to a 3d world) it would save a lot of rendering and processing time as well as map size, it would also allow for maps (hundreds?) of times bigger than what we have now, which would be quite epic.

I could go on, but I think you get the picture :P

tl;dr
I think fish drown when they are knocked unconscious or pierced through the lung.

Offline Tesla

  • Street Fighter Champion
  • *****
  • Posts: 10617
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #876 on: June 26, 2009, 04:33:34 pm »
Thanks for that Beast. Honestly.
No way dude, you're trolling me.

Offline Beastosaurus

  • Asteroids Aficionado
  • **
  • Posts: 114
  • Heeeeeeeeres Beasty!
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #877 on: June 26, 2009, 04:39:15 pm »
Thanks for that Beast. Honestly.

You're welcome, Alwayspooping!  ;D

I actually did read it, and I quite agree. Map unpacking seems to be a tad inefficient when viewed like that. I can go from over 200 FPS down to 7 FPS just moving the camera slowly, and my laptop doesn't suck. I can play Spore and DoW II, but Miecraft is super laggy at times. I think it'll just get worse once gameplay is added.  

EDIT: Added scatological humor at Alway's expense.
I think fish drown when they are knocked unconscious or pierced through the lung.

Offline Kenobro

  • Space Harrier
  • *****
  • Posts: 4086
  • I am not a robot!
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #878 on: June 26, 2009, 04:40:08 pm »
What does tl;dr mean anyway?

But I agree with it, really inefficient.


Quote from: Grazony
Thanks Kenobro. :)

Offline Tesla

  • Street Fighter Champion
  • *****
  • Posts: 10617
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #879 on: June 26, 2009, 04:44:13 pm »
What does tl;dr mean anyway?

Too long; Didn't read.
No way dude, you're trolling me.

Offline Kitkat

  • Ultima III Time Lord
  • *****
  • Posts: 2859
  • Beep Boop.
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #880 on: June 26, 2009, 06:58:58 pm »
DD, did you shut down the server?
Goddamnit kitkat, you make me look late
Come check out The Bino and The Ni'Calls
(Or don't these are old and embarrasing)

Offline DarkDragon

  • Final Fantasy Fanatic
  • *****
  • Posts: 6501
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #881 on: June 26, 2009, 07:05:26 pm »
Yeah, I wanted to play TF2 a bit and it was lagging like hell, it's back up now.
DarkDragon's Minecraft Survival Server (use this as the IP):

gamingsteve.dyndns.org

- The server uses a whitelist, if you're not on the whitelist (can't connect), PM me your minecraft name.

Offline Kitkat

  • Ultima III Time Lord
  • *****
  • Posts: 2859
  • Beep Boop.
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #882 on: June 26, 2009, 07:10:03 pm »
Doesn't seem to be working.
Goddamnit kitkat, you make me look late
Come check out The Bino and The Ni'Calls
(Or don't these are old and embarrasing)

Offline DarkDragon

  • Final Fantasy Fanatic
  • *****
  • Posts: 6501
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #883 on: June 26, 2009, 09:15:34 pm »
Sorry about that, some problem with Java.

Server is up with new Canyon map, if you guys want to finish something in the previous one I'll get it up one of these days.
DarkDragon's Minecraft Survival Server (use this as the IP):

gamingsteve.dyndns.org

- The server uses a whitelist, if you're not on the whitelist (can't connect), PM me your minecraft name.

Offline Legodragonxp

  • Excitebike Gearhead
  • *****
  • Posts: 3556
  • Now for some real user power...
    • View Profile
Re: Minecraft (new poll added; please share!)
« Reply #884 on: June 26, 2009, 09:56:15 pm »
You need to add a vote... 'game doesn't work for me and I don't play it anymore'.
-Lego