Thanks for the clarification, I do have one more question. Let's say some one, for what ever reason, wanted to turn all the trees in the world into lava, what would he set chunk.Data[treeBlocks] to?
You have to set chunk.Blocks[treeBlocks] to change the block type to Lava (Still), and then set chunk.Data to change the lava's level to 0, which means a full source block. If you want the game to process the lava and make it flow the next time you play, use LavaActive instead.
Some reason I'm getting an error with your code;
NameError: name 'alphaMaterials' is not defined
If you've only done an "import mclevel" up at the top, you wouldn't have that name defined. Try adding "from materials import alphaMaterials" (or just "import materials" and reference it by the "full" name).
If you've only done an "import mclevel" up at the top, you wouldn't have that name defined. Try adding "from materials import alphaMaterials" (or just "import materials" and reference it by the "full" name).
I figured it out myself this morning. mclevel does a 'from materials import alphaMaterials' so I just used mclevel.alphaMaterials and then it worked.
How hard would it be to use pymclevel to merge two levels into one? Assume the two worlds have no intersection and that they are adjacent, if that helps! Thanks!
Um...really simple? The only thing left is to calculate destinationPoint so I'll leave it up to you to position the incoming world. If the two worlds really are not overlapping with regards to the global coordinate system, you can use 'world2.bounds.origin' for destinationPoint.
Congrats on the MCServerChunkGenerator stuff. Seriously. It's incredible.
Quick question: Is there a way to specify which generator gets used? (Skylands vs Nether vs Normal)
I don't know about Skylands because I haven't seen a server mod for it. However, the generator is aware of dimension numbers and will try to generate chunks from the matching dimension.
There's no way to explicitly ask for Nether terrain, but it will be generated whenever you ask it to generate chunks into a Nether level. If you want to have Nether terrain on Earth, you'll have to explicitly use copyBlocksFrom to put it there.
The above is notoriously incompatible with Bukkit since Bukkit changes the directory layout of multidimensional worlds.
So, I'm actually looking at what you are doing in pymclevel now. It appears as if you are creating a temp world, setting the player spawn point to a particular location, launching the server, waiting for it to generate a spawn area and then copying the chunks we want back over to the real map. Iterate as needed.
That's brilliant, and should be mostly future proof since you don't have to worry about figuring out which obfuscated method is which in every patch.
One potential issue I can see with this... I've often noticed that trees can be generated on a chunk border. Trees are also random, and can differ in size and position between generations. Will copying over specific chunks like that cause trees to get chopped off at chunk borders?
I was also hoping this might enable the ability to query a specific spot for biome info, but I don't see how that could work without trying to hook into specific functions (like Biome Extractor), and that would be labor intensive to maintain.
Rollback Post to RevisionRollBack
MCDungeon - Procedural Dungeons
The volume of a pizza of thickness a and radius z can be described by the following formula: pi*z*z*a
One potential issue I can see with this... I've often noticed that trees can be generated on a chunk border. Trees are also random, and can differ in size and position between generations. Will copying over specific chunks like that cause trees to get chopped off at chunk borders?
Yes. I'm playing with a potential solution right now, and that's to find all chunks adjacent to the requested ones and copy them to the temp world, and then after running the server, copy them back along with the requested chunks.
Trees can change between generations because they're placed in the second step of terrain generation, "Population". This step is only run on chunks which have all 8 neighbors generated. This is because it affects not just one chunk, it affects a 32x32 area centered on the chunk. Trees, lakes, and other features will "look ahead" into this 32x32 area to decide where they can be placed and if that area is different for any reason (e.g. the chunks were generated and populated in a different order(!) ) then you'll get different results.
For what it's worth, I've seen some other artifacts of this "population" stage in world generation beyond trees and lakes. Traditional dungeons, for example, seem to get generated later.
In my MCDungeon tool, I've had cases where I'll generate a quick map, save, pull it into my tool, and then find that an old style Minecraft dungeon was generated after the fact right in the middle of my dungeon.
Other little things will happen too. Like underground water and lava springs happen in generally the same chunk but in a slightly different position.
I wonder how 1.8 will deal with features larger than a chunk? Towns and ravines, for example. Do you suppose this buffer zone will expand?
EDIT: (I just ran across all the conversation in the MCEdit thread... I'm late to this game!)
Traceback (most recent call last):
File "./BuildWorld.py", line 46, in <module>
File "./BuildWorld.py", line 40, in main
File "/mnt/git/TopoMC/mcarray.py", line 161, in loadArrays
File "/mnt/git/TopoMC/mcarray.py", line 147, in loadArray
File "../pymclevel/infiniteworld.py", line 2624, in createChunk
File "../pymclevel/infiniteworld.py", line 503, in __init__
File "../pymclevel/infiniteworld.py", line 673, in create
File "../pymclevel/infiniteworld.py", line 681, in save
File "../pymclevel/infiniteworld.py", line 1702, in _saveChunk
File "../pymclevel/infiniteworld.py", line 1124, in saveChunk
File "../pymclevel/infiniteworld.py", line 1180, in _saveChunk
File "../pymclevel/infiniteworld.py", line 930, in file
File "../pymclevel/infiniteworld.py", line 924, in <lambda>
IOError: [Errno 24] Too many open files: 'Worlds/SanFrancisco/region/r.0.0.mcr'
useNumpy is True, and I am attempting to load 56134 arrays. Is this too many?
Jack.
(edited to add code tags)
This happened six months ago, and you figured out by using lsof that numpy was leaving a bunch of filehandles open. Did you find out anything else this time?
(You might be able to change the system's limit on filehandles with ulimit if you really need to.)
Here's an idea. If numpy isn't closing its file objects correctly, you can handle that yourself:
This happened six months ago, and you figured out by using lsof that numpy was leaving a bunch of filehandles open. Did you find out anything else this time?
(You might be able to change the system's limit on filehandles with ulimit if you really need to.)
Here's an idea. If numpy isn't closing its file objects correctly, you can handle that yourself:
Ugh, you are so right. I changed it back to true because my home version of numpy was fixed, but the one on my AWS image is still broken. Sorry to bother you. :-)
I will give your code changes a try if I can't find a clever way to test for numpy's brokenness.
I think numpy is relying on the garbage collector to close the filehandles when the file objects get reaped. In modern python, you're supposed to use a with-statement to open and close the file so that when you jump out of the with-block for any reason (exception, break, etc) the file object will be closed.
You could try calling gc.collect() at intervals too. It returns the number of objects reaped.
Im trying to use your pymclevel to profile the land and identify valleys and cliffs on the surface (then make bridges)
So I need to be able to find the height of the highest non-air block for every x, y, z co-ordinate on the map.
I intend to load every chunk in order and look at chunk.HeightMap, but when I do that, I get the same heightnumber for every block in the chunk!
.........................OK this is command line
So...After the hassle of installing the right python version as well as Numphy I have no idea how to run this.
I have Python v2.6 for Windows 7 x64 as well as Numphy
Is it suppose to be in a certain directory?
Do I launch it with a .bat file and include the arguments?
Am I suppose to launch a certain file and input the arguments there?
Tried: launching mce, mclevel, and mclevelbase
Got: magical appearing and disappearing command window.
Am suppose to launch it from command prompt when I type in the file directory and location?
Am I suppose to launch it from Python's . . . Executable in the Python26 directory?
...Just 3 things I need to do
Replace diamond with lapusblock
Save the bottom fourth (from 0 to 32) of the world as a shcematic
Lower the entire world by 32 blocks. Overwriting the bottom 32.
Rollback Post to RevisionRollBack
You should definitely go to sfxworks.net and support my modpack.
You installed a 32-bit numpy into a 64-bit python.
Uninstall python and start over. 64-bit numpy binaries are available here. Once that is sorted out, you can run mce.py on your world to get started. There's no straightforward "slide the whole thing downward" command, though. To slide the terrain downward, I suggest to import your world into a new blank one. Something like "mce.py newworld create; mce.py newworld import oldworld (0 -32 0)" but I haven't tried it so I'm not sure.
Alternately, write a "slide the whole thing downward" function. It would be able to skip the lighting step if done correctly.
Well, did a replace 56 with 22. Thats working. Still im left with the issue of how to lower the world and save the bottom part as a shem since I can't specify a negative point..
Rollback Post to RevisionRollBack
You should definitely go to sfxworks.net and support my modpack.
You have to set chunk.Blocks[treeBlocks] to change the block type to Lava (Still), and then set chunk.Data to change the lava's level to 0, which means a full source block. If you want the game to process the lava and make it flow the next time you play, use LavaActive instead.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
Some reason I'm getting an error with your code;
NameError: name 'alphaMaterials' is not defined
If you've only done an "import mclevel" up at the top, you wouldn't have that name defined. Try adding "from materials import alphaMaterials" (or just "import materials" and reference it by the "full" name).
I figured it out myself this morning. mclevel does a 'from materials import alphaMaterials' so I just used mclevel.alphaMaterials and then it worked.
Jack.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
Quick question: Is there a way to specify which generator gets used? (Skylands vs Nether vs Normal)
The volume of a pizza of thickness a and radius z can be described by the following formula: pi*z*z*a
I don't know about Skylands because I haven't seen a server mod for it. However, the generator is aware of dimension numbers and will try to generate chunks from the matching dimension.
There's no way to explicitly ask for Nether terrain, but it will be generated whenever you ask it to generate chunks into a Nether level. If you want to have Nether terrain on Earth, you'll have to explicitly use copyBlocksFrom to put it there.
The above is notoriously incompatible with Bukkit since Bukkit changes the directory layout of multidimensional worlds.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
So, I'm actually looking at what you are doing in pymclevel now. It appears as if you are creating a temp world, setting the player spawn point to a particular location, launching the server, waiting for it to generate a spawn area and then copying the chunks we want back over to the real map. Iterate as needed.
That's brilliant, and should be mostly future proof since you don't have to worry about figuring out which obfuscated method is which in every patch.
One potential issue I can see with this... I've often noticed that trees can be generated on a chunk border. Trees are also random, and can differ in size and position between generations. Will copying over specific chunks like that cause trees to get chopped off at chunk borders?
I was also hoping this might enable the ability to query a specific spot for biome info, but I don't see how that could work without trying to hook into specific functions (like Biome Extractor), and that would be labor intensive to maintain.
The volume of a pizza of thickness a and radius z can be described by the following formula: pi*z*z*a
Yes. I'm playing with a potential solution right now, and that's to find all chunks adjacent to the requested ones and copy them to the temp world, and then after running the server, copy them back along with the requested chunks.
Trees can change between generations because they're placed in the second step of terrain generation, "Population". This step is only run on chunks which have all 8 neighbors generated. This is because it affects not just one chunk, it affects a 32x32 area centered on the chunk. Trees, lakes, and other features will "look ahead" into this 32x32 area to decide where they can be placed and if that area is different for any reason (e.g. the chunks were generated and populated in a different order(!) ) then you'll get different results.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
In my MCDungeon tool, I've had cases where I'll generate a quick map, save, pull it into my tool, and then find that an old style Minecraft dungeon was generated after the fact right in the middle of my dungeon.
Other little things will happen too. Like underground water and lava springs happen in generally the same chunk but in a slightly different position.
I wonder how 1.8 will deal with features larger than a chunk? Towns and ravines, for example. Do you suppose this buffer zone will expand?
EDIT: (I just ran across all the conversation in the MCEdit thread... I'm late to this game!)
The volume of a pizza of thickness a and radius z can be described by the following formula: pi*z*z*a
Here is the source of loadArray:
useNumpy is True, and I am attempting to load 56134 arrays. Is this too many?
Jack.
(edited to add code tags)
This happened six months ago, and you figured out by using lsof that numpy was leaving a bunch of filehandles open. Did you find out anything else this time?
(You might be able to change the system's limit on filehandles with ulimit if you really need to.)
Here's an idea. If numpy isn't closing its file objects correctly, you can handle that yourself:
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
Ugh, you are so right. I changed it back to true because my home version of numpy was fixed, but the one on my AWS image is still broken. Sorry to bother you. :-)
I will give your code changes a try if I can't find a clever way to test for numpy's brokenness.
Jack.
You could try calling gc.collect() at intervals too. It returns the number of objects reaped.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
Im trying to use your pymclevel to profile the land and identify valleys and cliffs on the surface (then make bridges)
So I need to be able to find the height of the highest non-air block for every x, y, z co-ordinate on the map.
I intend to load every chunk in order and look at chunk.HeightMap, but when I do that, I get the same heightnumber for every block in the chunk!
How do I make this work?
So...After the hassle of installing the right python version as well as Numphy I have no idea how to run this.
I have Python v2.6 for Windows 7 x64 as well as Numphy
Is it suppose to be in a certain directory?
Do I launch it with a .bat file and include the arguments?
Am I suppose to launch a certain file and input the arguments there?
Tried: launching mce, mclevel, and mclevelbase
Got: magical appearing and disappearing command window.
Am suppose to launch it from command prompt when I type in the file directory and location?
Am I suppose to launch it from Python's . . . Executable in the Python26 directory?
...Just 3 things I need to do
Uninstall python and start over. 64-bit numpy binaries are available here. Once that is sorted out, you can run mce.py on your world to get started. There's no straightforward "slide the whole thing downward" command, though. To slide the terrain downward, I suggest to import your world into a new blank one. Something like "mce.py newworld create; mce.py newworld import oldworld (0 -32 0)" but I haven't tried it so I'm not sure.
Alternately, write a "slide the whole thing downward" function. It would be able to skip the lighting step if done correctly.
"We will absolutely not keep in mind what external mapeditors will have to do to read data from the disk, that makes no sense whatsoever." - Grum
replace 56 with 22 (5071, 1, 5103) to (-5200, 128, -5168)
They are points in my world. I don't understand.