l0b0 / mian

Mine analysis - Graph blocks to height in a Minecraft save game
https://github.com/l0b0/mian/wiki
GNU General Public License v3.0
14 stars 4 forks source link

2 new plot modes. #19

Closed Fenixin closed 12 years ago

Fenixin commented 13 years ago

My branch new-plot adds 2 new plot modes. Both use the same data, a numpy.array with the counts of every chunk. The new mode I like more is colormap:

http://imgur.com/8ys59

This represents the amount of the specified block by colors in a map, every square in the map is a chunk. This map is for the block torch. Can you see the line with aprox 10 torches/per chunk that goes from the big city to the West? That is a big minetrack tunnel. The map is made so you can point, look at the chunk coordinates and, once converted, use them in game. Maybe is not really useful, but a like it! To use this mode just call mian with: --mode colormap or -m colormap

The other one is the wireframe map:

http://imgur.com/43DN7

This plots the same data but using a 3d maps where elevations are the amount of blocks. It's pretty cool, but a bit useless. The image is also of torches in a smaller world. You can rotate the image by drag&drop. Warning! using this mode with huge maps can be cpu intesive... To use this mode just call mian with: --mode wireframe or -m wireframe

This is almost finished, but I wanted to ask before finish because if we are to change to optparse and to make major changes to mian, maybe, this is a good moment organize ourselves. What do you think? Do you like these modes? Any ideas to improve them? This modes are not in the help yet.

The generated data can be used also to plot surfaces and similar graphs of Matplotlib.

pepijndevos commented 13 years ago

I have some local work for different kinds of plots as well. I realized that the more you dig, the more material moves up. This means that it would be possible to see the cultivation of a map by the centre of mass. The center of mass for my own small map is 34.94958, but I suspect this is higher for a SMP map.

I also generated a graph that displays one region by chunk:

http://yfrog.com/4b50719191p

Not as useful as I thought.

Fenixin commented 13 years ago

A like your idea of centre of mass. We can also plot the centre of mass per chunk, so the chunk with higher centre of mass can be the chunk with more caves or the chunk with more buildings.

pepijndevos commented 13 years ago

This is what you saw in the image. The problem is that you see what I suspect to be mountains more than anything else.

Fenixin commented 13 years ago

ah... ok. Maybe we can plot the centre of mass map and another map that represent if there is mountains in the same chunks (counting the amount of stone?), so you can compare and evaluate... maybe is too complicated.

If we want a caves mode we can take only de first 64 levels of the chunks and count the air blocks in there, so more air, more caves.

pepijndevos commented 13 years ago

Easier would be to diff between the map as generated, and the map now.

Fenixin commented 13 years ago

Mhh... so you say to store the map anywhere in the hard drive and differentiate the array with the new map to see what chunks changed the centre of mass?

pepijndevos commented 13 years ago

This could be really interesting to see biomes and other local things in 1.8. What is the status of this?

We could implement the cave map by adding a generic height range, and then using your color map with air.

Fenixin commented 13 years ago

The status is that I need to give a look to the code, because too much time has passed. I'll try to do it this weekend!

Yes, we have to tune it to look up for caves and other stuff, the color map has a lot of possibilities!

Fenixin commented 13 years ago

I've just uploaded a new branch with the 2 plot modes. Is still buggy and messy but works. Try it and tell me what you think (It scans for the first block in the list). I think after this we need to clean the code, maybe make it object oriented and use the nbt library.

pepijndevos commented 13 years ago

Works like a charm, only you forgot a comma on line 568.

Fenixin commented 13 years ago

Ah! Fixed. I introduced that fixing PEP8 things. In the next days I'll try to make use of the nbt library.

pepijndevos commented 13 years ago

What about the axis, they are per chunk, right? So maybe do that times chunk size, to make it easier to find?

Fenixin commented 13 years ago

That is definitely a good idea. I'll try that soon.

Fenixin commented 13 years ago

New small update on the branch plot-mode. Now it does some sanity checks with the options and the colormap mode axis are in blocks (not yet the wireframe ones).

I think this can be merged to master, but if you could test it that would be great. Also, once merged, how do I do to create a a new package for easy_install? Is it enough to create a new tag? I've never done this before.

Fenixin commented 12 years ago

I think I'm going to merge this right now, update the with the new blocks and create a new version.

EDIT: The new 1.9 prerelease 3 is here! I'm going to wait for the new blocks and then I'll create a new tag.

Fenixin commented 12 years ago

Done! I only need to upload a new egg package to pypi, but not sure how to do that... closing this!

l0b0 commented 12 years ago

Just uploaded the new egg - It should be installable with pip (recommended) or easy_install right nüü.

l0b0 commented 12 years ago

Aaand tested. Works fine!

Fenixin commented 12 years ago

Thanks a lot!