As for the first error, perhaps it is trying to access blocks outside of the current range (although for the given size I don't know why it would). I need to put more checking in. Try running it on a restricted set of chunks and see if it works. If not, I would like a copy of your map to test.
I tested with 2 saves and there are different results for them. (used last version of your tool from previous post)
1) My save i used in my previous post. Success with chunk range:
But without --cxr and --czr it still fails with same error:
>nbtoolkit oregen -b 112 -w testsave2 -r 5 --MinDepth=1 --MaxDepth=127 -s 5 --oi 1 -d 2
Unhandled Exception: System.IO.FileNotFoundException: Unable to find the specified file.
at NBToolkit.Region..ctor(RegionManager rm, Int32 rx, Int32 rz)
at NBToolkit.RegionManager.GetRegion(Int32 rx, Int32 rz)
at NBToolkit.Chunk.GetTree()
at NBToolkit.Chunk.GetBlockID(Int32 x, Int32 y, Int32 z)
at NBToolkit.GenOreBlockManager.SetBlockID(Int32 x, Int32 y, Int32 z, Int32 id)
at NBToolkit.NativeGenOre.Generate(BlockManager blockMan, Random rand, Int32x, Int32 y, Int32 z)
at NBToolkit.Oregen.ApplyChunk(World world, Chunk chunk)
at NBToolkit.Oregen.Run()
at NBToolkit.Program.Main(String[] args)
2) Ink Blot Island V03 map fails with other error regardless of --cxr and --czr params:
>nbtoolkit oregen -b 112 -w "Ink Blot IslandV03" -r 5 --MinDepth=1 --MaxDepth=127 -s 5 --oi 1 -d 2 --cxr 1:10 --czr 1:10
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at NBToolkit.Chunk.GetBlockID(Int32 x, Int32 y, Int32 z)
at NBToolkit.GenOreBlockManager.SetBlockID(Int32 x, Int32 y, Int32 z, Int32 id)
at NBToolkit.NativeGenOre.Generate(BlockManager blockMan, Random rand, Int32x, Int32 y, Int32 z)
at NBToolkit.Oregen.ApplyChunk(World world, Chunk chunk)
at NBToolkit.Oregen.Run()
at NBToolkit.Program.Main(String[] args)
Same error is without --cxr and --czr but it takes much more time like the tool is trying something with the map, and map files size changes.
Alright, it's clear what's going on now, I wasn't aware your map was a pregenerated one.
The way the native algorithm works is it offsets ore placement so that it might spill over into a neighboring chunk. However all edge chunks have the 'TerrainPopulated' flag cleared. That means MC never tries generating ores in a chunk until all of its neighboring chunks have been created. In pregenerated maps, all chunks have the TerrainPopulated flag set, including edge chunks, so it's trying to write off the edge of the map.
This should be fixed soon. In the interim, you should be able to run the tool on the map by setting the range to exclude the edge chunks.
Another bugfix update, this should solve the crashing problems on pregenereated maps (both the desert and inkblot work for me now).
I switched the "mathfix" option so that the patched version of the native algorithm is used by default. It gives more satisfactory results but you can set the flag if you want the buggy quadrant behavior.
Also, a new 'purge' command has been added to delete chunks. Use the existing chunk filtering options to control deletion. Remember the --crv flag to invert the selection, if you want to select a region and trim everything beyond it. Region files that are completely emptied will be deleted from the world directory. And remember that these options specify chunk coordinates, not block coordinates.
gmcs -out:nbtoolkit.exe Program.cs NBT.cs Harness.cs TKOptions.cs NDesk/Options.cs TKFilter.cs Oregen.cs Replace.cs RegionFile.cs RegionFileCache.cs Zlib/Zlib.cs Zlib/ZlibStream.cs Zlib/ZlibConstants.cs Zlib/ZlibCodec.cs Zlib/ZlibBaseStream.cs Zlib/Tree.cs Zlib/InfTree.cs Zlib/Inflate.cs Zlib/GZipStream.cs Zlib/DeflateStream.cs Zlib/Deflate.cs Zlib/Crc32.cs
Oregen.cs(9,45): error CS0246: The type or namespace name `IChunkFilterable' could not be found. Are you missing a using directive or an assembly reference?
Oregen.cs(239,39): error CS0246: The type or namespace name `BlockManager' could not be found. Are you missing a using directive or an assembly reference?
Replace.cs(9,46): error CS0246: The type or namespace name `IChunkFilterable' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 3 error(s), 0 warnings
make: *** [all] Error 1
I'm sure this isn't the fault of your program, but more the maps im using. I was trying to test 2 barren flat premade custom dirt maps for different things, so I used the oregen to put ores in. Well it all worked well I used an X-rayer to look and they was there, but the odd thing is when I moved near ores they would just vanish from existance. I dug down to where I saw some and some of the ores where replaced with smoothstone.. Im pretty sure your program can't do that but I've never heard of anything like this. Is there perhaps it is being caused by it? The save not actually recording it, or something?
I have encountered a bug (perhaps the same bug) quite frequently on my SMP map where all materials underground will show up as smoothstone until I destroy them or place a torch on them. It's quite annoying, but usually goes away after restarting the client. Back when Lapis was first added, I was quite perplexed after I spent an hour of digging not finding any, bitching all the way, and then my friend goes through and says "dude, you missed a bunch in plain sight".
Yeah I restarted the client.. I turned it off when I did the stuff to it.. turned it on to see the results.. got confused why it was vanishing, exited out and went back in and it kept doing it. Apperntly though I'd dug down to some of the spots and broke the smoothstone and it turned into cobble so I have no idea what was up.
I then tried it on a map I generated through seed, and it works fine, the ores stay and dont dissappear and arent smoothstone. So I have no idea what was wrong with those custom maps that would make them do that, other then the fact they where dirt, but I dont think dirt would have anything to do with not being able to 'hold' ore.
Is there anyway this tool can generate sandstone the way the game generates it in new worlds? I have an old world that was generated before the natural sandstone update, and we keep finding floating sand.
Rollback Post to RevisionRollBack
If you have ask "Is using X cheating?", the answer is most likely yes. Being a sandbox game doesn't change the fact you are cheating in it, regardless of what people say. However, the question you should be asking is "Does it matter?" The answer to that question is no.
Thanks! I look forward to fixing my problems when it is released.
Rollback Post to RevisionRollBack
If you have ask "Is using X cheating?", the answer is most likely yes. Being a sandbox game doesn't change the fact you are cheating in it, regardless of what people say. However, the question you should be asking is "Does it matter?" The answer to that question is no.
I should also mention, anyone interested in writing MC tools in C# may be interested in using NBToolkit as a library for map/region/chunk/block abstractions. After all, the whole idea behind NBToolkit is general-purpose manipulation, with emphasis on making bulk processing easy. It's still WIP and doesn't support everything, but maybe the existing functionality will be useful. Browse the online SCM.
>nbtoolkit oregen -b 229 -w Sol -r 6 --MinDepth=1 --MaxDepth=127 -s 5 --oi 1 --oi 48 -v
Processing Chunk (-10,-8)
Generating 6 size 5 deposits of 229 between 1 and 127
Processing Chunk (-10,-7)
Generating 6 size 5 deposits of 229 between 1 and 127
Processing Chunk (-10,-6)
Generating 6 size 5 deposits of 229 between 1 and 127
Processing Chunk (-10,-5)
Generating 6 size 5 deposits of 229 between 1 and 127
Processing Chunk (-10,-4)
Generating 6 size 5 deposits of 229 between 1 and 127
Processing Chunk (-10,-1)
Generating 6 size 5 deposits of 229 between 1 and 127
Processing Chunk (-9,-9)
Generating 6 size 5 deposits of 229 between 1 and 127
Processing Chunk (-9,-8)
Generating 6 size 5 deposits of 229 between 1 and 127
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at NBToolkit.GenOreBlockManager.GetBlockRef(Int32 x, Int32 y, Int32 z)
at NBToolkit.NativeGenOre.Generate(BlockManager blockMan, Random rand, Int32 x, Int32 y, Int32 z)
at NBToolkit.Oregen.ApplyChunk(World world, Chunk chunk)
at NBToolkit.Oregen.Run()
at NBToolkit.Program.Main(String[] args)
map was MCEdit'ed before. what's wrong with it >_<
maplink if needed: here or there
If i run it more times - it crashes after another amount of chunks, seems random, but no progress far from start.
Updated version.
The utility now includes a 'dump' command to dump chunk data to a JSON file (per one of your requests). You can selectively dump entities, tile entities, or all block data (as Bas64 encoded strings) along with basic chunk info.
Most of my time lately has been spent giving the world SDK a major overhaul and cleanup. It'll probably introduce bugs. But besides just changing code around, the existing oregen and replace tools should now properly maintain TileEntitiy consistency.
-p, --prob=VAL Replace any matching block with probability VAL (0.0-1.0)
But the tool actually waits for probability value being entered with comma instead of dot.
>NBToolkit.exe replace -b 3 -a 1 -p 0.5 -w test
Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToDouble(String value)
at NBToolkit.ReplaceOptions.<.ctor>b__4(String v)
at NDesk.Options.OptionSet.<>c__DisplayClass3.<Add>b__2(OptionValueCollection v)
at NDesk.Options.OptionSet.ActionOption.OnParseComplete(OptionContext c)
at NDesk.Options.Option.Invoke(OptionContext c)
at NDesk.Options.OptionSet.ParseValue(String option, OptionContext c)
at NDesk.Options.OptionSet.Parse(String argument, OptionContext c)
at NDesk.Options.OptionSet.Parse(IEnumerable`1 arguments)
at NBToolkit.ReplaceOptions.Parse(String[] args)
at NBToolkit.Program.Main(String[] args)
>NBToolkit.exe replace -b 3 -a 1 -p 0,5 -w test
Affected Chunks: 1159
Done
I tested with 2 saves and there are different results for them. (used last version of your tool from previous post)
1) My save i used in my previous post. Success with chunk range:
But without --cxr and --czr it still fails with same error:
2) Ink Blot Island V03 map fails with other error regardless of --cxr and --czr params:
Same error is without --cxr and --czr but it takes much more time like the tool is trying something with the map, and map files size changes.
The way the native algorithm works is it offsets ore placement so that it might spill over into a neighboring chunk. However all edge chunks have the 'TerrainPopulated' flag cleared. That means MC never tries generating ores in a chunk until all of its neighboring chunks have been created. In pregenerated maps, all chunks have the TerrainPopulated flag set, including edge chunks, so it's trying to write off the edge of the map.
This should be fixed soon. In the interim, you should be able to run the tool on the map by setting the range to exclude the edge chunks.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
I switched the "mathfix" option so that the patched version of the native algorithm is used by default. It gives more satisfactory results but you can set the flag if you want the buggy quadrant behavior.
Also, a new 'purge' command has been added to delete chunks. Use the existing chunk filtering options to control deletion. Remember the --crv flag to invert the selection, if you want to select a region and trim everything beyond it. Region files that are completely emptied will be deleted from the world directory. And remember that these options specify chunk coordinates, not block coordinates.
http://hocuspocus.taloncrossing.com/rii/nbtk2.zip
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
We actively participate in the MC SMP global bannning system. Join up!
I forgot to update the Makefile with the extra dozen+ source files that got added since I last tested building on Linux
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
I have encountered a bug (perhaps the same bug) quite frequently on my SMP map where all materials underground will show up as smoothstone until I destroy them or place a torch on them. It's quite annoying, but usually goes away after restarting the client. Back when Lapis was first added, I was quite perplexed after I spent an hour of digging not finding any, bitching all the way, and then my friend goes through and says "dude, you missed a bunch in plain sight".
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
I then tried it on a map I generated through seed, and it works fine, the ores stay and dont dissappear and arent smoothstone. So I have no idea what was wrong with those custom maps that would make them do that, other then the fact they where dirt, but I dont think dirt would have anything to do with not being able to 'hold' ore.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
Is something I am doing wrong?
http://hocuspocus.taloncrossing.com/rii/nbtk2.zip
I should also mention, anyone interested in writing MC tools in C# may be interested in using NBToolkit as a library for map/region/chunk/block abstractions. After all, the whole idea behind NBToolkit is general-purpose manipulation, with emphasis on making bulk processing easy. It's still WIP and doesn't support everything, but maybe the existing functionality will be useful. Browse the online SCM.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
map was MCEdit'ed before. what's wrong with it >_<
maplink if needed: here or there
If i run it more times - it crashes after another amount of chunks, seems random, but no progress far from start.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
Updated version.
The utility now includes a 'dump' command to dump chunk data to a JSON file (per one of your requests). You can selectively dump entities, tile entities, or all block data (as Bas64 encoded strings) along with basic chunk info.
Most of my time lately has been spent giving the world SDK a major overhaul and cleanup. It'll probably introduce bugs. But besides just changing code around, the existing oregen and replace tools should now properly maintain TileEntitiy consistency.
Mods I Develop: Garden Stuff -- Storage Drawers -- Hunger Strike
Tools I Develop: NBTExplorer -- Substrate
But the tool actually waits for probability value being entered with comma instead of dot.