Inactive [WGEN] Mineral Veins 1.4.1 - Ore placement overhaul [1.2.5-R1]

Discussion in 'Inactive/Unsupported Plugins' started by m0rt, Sep 7, 2011.

  1. Offline

    m0rt

    Mineral Vein - Ore generator modification
    Version: v1.4.1
    Download: jar
    Source: github
    BukkitDev

    WARNING - As of MV 1.4.1, instead of veins.yml, config.yml is used. It's purely a name change, caused by switching over to the new API, file format remains the same.

    Mineral Vein changes the way ores are generated. Instead of lots of small, randomly placed deposits, several huge veins will be generated.
    Technically, Mineral Vein adds new BlockPopulator that removes all previously placed ores and generates new ones. This ensures compatibility with any other world generators, including the default one.

    Veins
    Veins are vast, rare areas, that are rich on particular resource. These veins are multiple chunks wide and long, their respective resources don't exist outside them. Veins aren't made completely of given material, it's just very common there, and often multiple veins of different materials overlap. This ore distribution changes mining for resources completely - you have to scout wide areas for a vein, and when you finally find one, it can supply you for quite a long time. In general, the average density of resources/chunk is simillar, but the distribution is changed completely.

    Converting old worlds

    By default, the plugin works as world generator and only affects newly generated chunks. However, you can force it manually to apply the algorithm to any chunks that are already present.
    The command \mineralvein apply <worldname> [x] [z] [width] [height] will apply this to the selected world. Run this command just once after installing MineralVein, then you don't have to run it at all. By default the command is accessible from console and/or anyone with "MineralVein.apply" permission. (since you need to run this command exactly once, you propably won't need the permission at all.
    The numbers default to 0,0 (center) and 200x200 chunks around it. If your map is bigger, use appropriate setting (widht corresponds to X coordinate, the value is in chunks).

    Screenshot:
    Show Spoiler
    comparsion.png Vanilla minecraft on left, MineralVein right. (white areas are iron blocks, other ores aren't shown, but generated in simillar manner)



    Configuration
    All variables used in ore placement can be set in config file.

    Code:
    worlds:
      default:
        -
            block: GOLD_ORE
            seed: 35434
            density: 3
            thickness: 4
            densityBonus: 0
            heightAvg: 20
            heightVar: 20
            heightLength: 80
            densLength: 80
            exclusive: false
            #biomes: [forest,swampland]
            #exclude_biomes: [desert]
            mode: replace
    
    Each item of the list represents one "layer" that is generated. By default, there is one layer for each ore type, but there can be more.
    seed is a unique number for each layer. If you want to create a layer with two different ores, that always uses same space, just use the same seed.
    density is a chance multiplier. Higher density means more ore
    thickness is vertical size (actually it's distance from the center of the vein, in which the ore can spawn, so it's one-half of the actual thickness)
    densityBonus: The density in an area is determined using a random generator, that gives values between -1 and 1, where 0 and less represent no chance of ore spawning in given location. Giving a densityBonus of 1 will represent in this layer to be filled with resource everywhere on the map.
    heighAvg is the average height in which this layer can be found
    heightVar is the random portion of heigh, the actual heigh goes from avg - var to avg + var (in the example, setting of 20/20 would result in layer beeing between 0-40)
    heightLength is distance in blocks between height definition points changes (higher values -> less frequent height changes)
    densLength is distance in blocks between density definition points changes (higher values -> bigger, rarer veins)
    exclusive parameter makes sure no other veins appear if this one is present (technically, it descreases their chance by the density of this ore here)
    biomes is a list of biomes this vein can appear in. If this parameter is NOT present, it appears everywhere.
    exclude_biomes is a list of biomes to be excluded from the list (logically this should be used when biomes option is defaulted to all)
    mode allows to turn off replacement (by setting mode to "add") - this vein will just add more blocks, without removing the old ones

    The mathematics behind (open)

    This section explains how exactly the ore generation works, which should help you in deciding what config to use.

    The ore placement process works in two levels: column(X and Z coordinate) and block (Y coordinate, within the column). Some of the values (like VeinHeight) will be generated for each column, then all blocks within the column will have a specific chance to spawn ore in them. The following tutorial explains how a single ore vein is generated.

    At the very beginning, height and density maps are generated. Those describe distribution of VeinHeight (block height in world) and VeinDensity (spawn chance multiplier). These maps are based on world seed, so they are identical every time you run the apply command.
    tut1.gif
    This is an example of a density map (not yet finished). The way this generator works is it selects random values each densLength blocks (in this case 40), and interpolates inbetween. (This is a simplified generator, the actual generator has much smoother results). Another example:

    tut2.gif
    Here the densLength is 20, resulting in much faster changes in density. In a moment, the density is "cut", anyting below zero is ignored.

    tut3.gif
    This represents the basic ore vein distribution. Wherever you can see the red plane, the density map generated value below zero, therefore this ore will not spawn in this column. However, before the cut is done, densBonus is applied.

    tut4.gif
    This is the same map with +0.3 densBonus applied. You can see the red areas are much rarer, resulting in ore beeing much more common. This value (random+densBonus) is now multiplied by density, giving the final VeinDensity for the particular column.
    Generating heigh map is simpler, the height map just needs to be adjusted according to heightAvg and heightVar (note this is just a side view, for a single Z coordinate):
    tut5.gif
    This could be described by a simple formula height=heightAvg+(rand*heightVar).

    So now we have VeinHeight and VeinDensity for each column. Each column is then run through, and generated a ChanceMap for. It looks like this (Y is on the horizontal axis):
    tut6.gif
    The result of this function (0 to 1) is multiplied by VeinDensity for this column, resulting in a chance that the ore is spawned in this block (0 is no chace, 1 is 100% chance).
    You can see that blocks that are close to the VeinHeight have a high chance of ore spawning, while blocks that are further that thickness have zero chance. Then a "dice" is rolled for each block and compared with the resulting chance, to see whether this block will have the ore spawned in it or not. Note that the "dice" roll is completely random, independent of world seed, so each run of apply would result in different local layout.


    Changelog:
    Version 1.4.1:
    • Compatibility for MC 1.2.3
    • Minor fixes, permissions should work
    Version 1.3.10:
    • added debug mode ("debug: true" in config file)
    • BEWARE - permission now defaulted to OP (temporary solution)
    Version 1.3.9:
    • application now runs in sync, should take care of concurrent modification exceptions
    Version 1.3.8:
    • fixed some issues, now works quite fine
    Version 1.3.7:
    • Now supports ANY id, even non-existing ones. Useful for MCForge-added blocks (e.g. Industrialcraft)
    Version 1.3.6:
    • fixed thread usage in apply command
    Version 1.3.5:
    • new HeightRel option
    Version 1.3.4:
    • Two new config options - mode and exclude_biomes
    • Fixed bug with using same noise generator for height and density
    • Fixed apply command
    Version 1.3.3:
    • Fixed crash for config files that don't have "default" world setting
    Version 1.3.2:
    • The "Apply" command is now executed in separate thread, and worlds can be referenced by their index (failed command will display list of worlds and indexes)
    • Huge changes in default config file, hopefully for the best
    Version 1.3.1:
    • The "Apply" command now works much better and safer
    Version 1.3:
    • Added exclusive and biomes parameters to config
    • It is now possible to populate already existing worlds
    Version 1.2:
    • Added heightLenght and densLength parameters to conf file
    Version 1.1:
    • Fixed bugs, switched to in-built Noise generators for better results
    Version 1.0:
    • First release
     
  2. Offline

    ledhead900

    I have not I will try this now and report back

    Shows up with /plugins

    I will try the command. Tho I wish there was a way to tell it what map to generate ore in I think that is what I done with planetx it said default in config I changed it to the world I created when I finished setting it up so IT SHOULD be working on that world only.


    Edit:
    PHP:
    2011-10-18 23:46:53 [INFOledhead900 [/10.0.0.12:49528logged in with entity id 6281 at ([planetx713.7350225008549122.9101699694301, -980.2376875640576)
    2011-10-18 23:46:55 [WARNINGCan't keep up! Did the system time change, or is the server overloaded?
    2011-10-18 23:48:40 [INFO] <[Admin]ledhead900> \mineralvein apply planetx
    2011-10-18 23:49:05 [WARNING] Task of '
    NoLagg' generated an exception
    java.util.ConcurrentModificationException
    at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
    at java.util.ArrayList$Itr.next(Unknown Source)
    at org.bukkit.craftbukkit.CraftWorld.getPlayers(CraftWorld.java:551)
    at com.bergerkiller.bukkit.nolagg.ChunkHandler.canUnload(ChunkHandler.java:51)
    at com.bergerkiller.bukkit.nolagg.ChunkHandler.cleanUp(ChunkHandler.java:129)
    at com.bergerkiller.bukkit.nolagg.NoLagg$2.run(NoLagg.java:134)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:441)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-18 23:49:15 [SEVERE] java.lang.[NullPointerException]
    2011-10-18 23:49:15 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1111)
    2011-10-18 23:49:15 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:467)
    2011-10-18 23:49:15 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    2011-10-18 23:49:15 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-18 23:49:15 [SEVERE] Unexpected exception
    java.lang.NullPointerException
    at net.minecraft.server.World.tickEntities(World.java:1111)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:467)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417) 
    Right before that error it said it had completed its job on planetx, tho I wish this was give me more info on what it was doing.
     
  3. Offline

    Shereis

    This Plugin is Great !!! I think, with a good config, it finally give an interest to exploring world and Cave, looking for Minerals veins !!
    I hope you'll keep it updated, and optimise the /mineralvein apply command !
    On big world, can't you just split the ore generation ? At a given number of chunk generated ... the process stop and is saved in a file... and can be continued later... or something like that... Maybe it'll prevent the server from crashing ! ??
     
  4. Offline

    Domochevsky

    I second that notion. Being able to split the conversion up into more manageable pieces seems like the way to go for this. :)

    (And yes, i can't convert a already existing world either, even after cropping it with MCEdit to only the bare bones.)

    Meanwhile... so setting the DENSITY of ores to 1000 will cause them to be solid veins instead of being spaced out? What other effects does this have? Does a different setting need to be decreased to counterweight this?

    Also: Is it possible to add the IndustrialCraft ores to this as well? (Copper, Tin and Uranium)
     
  5. Offline

    m0rt

    Well the apply command should save the chunks during application, but it seems to fail for some reason. I am planning for some time now to change the ore generation to fixed area between two coordinates, that should fix some issues, however it would make the command much harder to use.

    Density: It will have no other side effects, just make the vein solid (it will multiply the chance -> where there was at least some chance the ore would spawn, it will spawn now)

    IndustrialCraft: A) How would you use this together with industrialcraft? B) Mineralvein can only use materials that are in Material.java class, so if industrialcraft uses it, it would work.
     
  6. Offline

    Domochevsky

    A) Industrialcraft spawns custom ores in the world, so combining that would be useful
    B) I don't think it does, since i can't add settings for it into the veins.yml
     
  7. Offline

    m0rt

    I know what Industrialcraft does, I just don't know HOW you use Mineral vein and Industrialcraft at one time, since one is server mod and the other client mod.
    And since I wasn't able to find source code for Industrialcraft, I can't tell if it could or could't work (try using the ore ID's instead of name, that could work, but again, depends on how Industrialcraft is implemented - the "block" setting accepts both name and ID)
     
  8. Offline

    CommanderGizmo

    I'm very glad I found your mod mort. I had been planning on building this myself, but you've already done it! Thanks for the hard work.

    I am having a bit of trouble getting the results I'm looking for. No matter how I adjust the settings, I seem to find the ore only occurs above the heightAvg layer in the world. I am using Minecraft X-Ray to review the results of my efforts. Can you advise as to why I am not seeing a proper vertical distribution as per the heightVar value?

    Also, would you be open to adjusting the variables exposed in the config file? If I better understood their impact I might be able to come up with a more user friendly way of controlling the result of the algorithm.

    [edit]
    I thought that was a bit vague. Specifically, what I am seeing is that the veins always seem to start at a level slightly higher than the heightAvg and then their depth from that point is effected by the thickness and heightLength variables. However, I do not find any veins forming at varying heights in the level.

    [edit 2]
    After some debugging from the source code, I believe I have found the problem. Since the methods getVeinHeight and getVeinDensity both use the same noise generator, any value from the generator that results in a negative value which would use the lower end of the variance provided by heightVar will also cause a huge increase in the likelyhood of a negative density.

    The function getOreChance uses cos() to provide the noise along the y axis, which always returns a positive value. Since this is multiplied by density, all negative values of density result in 0 chance of the deposit being placed at that height.

    Thus, if the noise generator creates a low value to place the vein at a height lower than the heightAvg, it also creates a density that is low in equal proportions. These coupled together generate a strong bias against any mineral deposits forming below the height average.

    What do you think? Does this sound about right?

    [edit 3]
    I have also noticed that the veins appear to follow a sine wave pattern. While this is obvious at very high density, it is (I think) very noticible even at low densities as many veins follow a 'V' pattern. Since this wave occurs over the y axis and that is controlled by the cos() function, it seems reasonable to believe this function is the cause.

    Perhaps what would produce a cleaner result would be the use of a separate noise generator on each axis, or using the noise generator's three dimensional method.

    Alternatively, by applying a scaling factor of 1.66 to the coordinates the getVeinDensity function feeds to the noise generator, I have found results that seem to be quite adequate. The veins now occupy the full range they are given and the sine wave effect is somewhat more broken up (though that may be only with the current settings).

    What do you think of this?
     
  9. Offline

    Domochevsky

    Oh, right. Tsk, silly me. There is a server version of Build-/Industrialcraft for bukkit, which can be found here. :)

    I think industrialcraft ores use damage values to do their thing, so i don't know how to go about that in particular. I can't describe them with COPPER_ORE or similar in the veins.yml either. (It fails to load the veins mod at all.)
     
  10. Offline

    m0rt

    CommanderGizmo: Thanks for the work you put into this. Using same noise generator is quite an oversight on my side. I otiginally used my own noise gen, where I just fed different seed value, and this is some remnant of the past (unfortunatelly inbuild noise generators don't allow seed change). I think that separating the generators should resolve all this issues.
    Y axis: the idea behind the Y axis randomization is that in every column, the vein has a certain height, and the ores spawn near this height, with higher density closer to the height point. If I used noise generator for Y axis, too, it would result in random small deposits all over map, looking a lot like the in-built ore generator.

    IndustrialCraft: If they use damage value, it shouldn't be a problem to implement, however it would require users to know the actual values (since I don't so far). ( I didn't know there were that many client/server mods btw.) I found some sort of modding API for IndustrialCraft, but there wasn't anything about ores. If I manage to find some documentation, I could add some word->id/damage translation table.

    I hope that I will get to update MineralVein

    [EDIT]
    According to minecraft wiki, the ID's are 222 for uran, 229 for tin and 246 for copper, try using these values, it might work.
     
  11. Offline

    Domochevsky

    Mhm, if it helps, the IC2.cfg contains the following settings:

    valuableOres=14:3, 15:4, 16:1, 21:3, 56:5, 73:3, 247:4, 248:2, 249:2

    blockOreCopper=249
    blockOreTin=248
    blockOreUran=247
     
  12. Offline

    CommanderGizmo

    I see what you mean about the y axis. I wondered if that wasn't what you were going for.

    After scaling the noise pattern for density by 1.66 (an unlikely scalar to be recreated by differences in heightLength and densLength), I have found the results to be very nice. The wave effect now causes veins to snake around, and I feel like I have very good control over the entire placement and shape of the veins.

    Although I have managed to get a feel for some of the variables, I still think this mod could use some more user-friendly ones. Do you think you can come up with a set of variables that relate better to the end user, then translate them into useful values for your algorithm?

    Feature Request:
    It might be handy to have a biome exclusionary list for each ore as well. This would allow the ores to be blocked from one biome without having to all the others. This is especially handy when dealing with Notch's constant updates of new biomes.

    I'll make a new post since this is a change in direction from my last post.

    I have just about finished the config file for our new world. I'll break this down into a few sections and see what you guys thing of it.


    Variable Explanations
    The previous variable explanations were still confusing to me, so I'm gonna have a go at it now myself. The variables in the config file can be separated into two basic categories as seen here:

    Vein Control
    These controls the how, when, and where of an entire vein.​

    seed:
    This is half of the seed for the noise generator that chooses where to put the veins and how. Think of this as a name for the vein that it will create. If two ore entries use the same seed value, their veins will be generated in the same way.​

    densLength:
    This controls how far apart the veins are and how large of an area each vein covers. A larger value moves the veins farther apart but increases their size. You can understand this more clearly if you understand that this value scales the noise pattern which is used to sculpt the veins. You may want to check out these images that result from a small value and a large value. If more detail on this is required I can make a longer post about it.​

    densityBonus:
    This controls how often a possible vein location chosen from densLength actually gets a vein. You can put a value between -1 and 1 here, with zero being equal to about 50% of the locations being populated, -1 being 0%, and 1 being 100%.​

    heightAvg:
    This specifies the number of blocks from the bottom of the world at which you want the veins to be most prevalent. You can put a value between 0 and 127 here, with 64 being sea level.​

    heightVar:
    This specifies the number of blocks above and below the heightAvg value at which you want the veins to appear. This is a range at which a vein can appear, with the chance of an appearance decreasing at farther distances from the heightAvg value.​

    heightLength:
    This controls how the vein is spread in three dimensions. This functions similar to densLength, but controls the vertical spread of the vein. A larger value will cause a more horizontal flow of a vein, while a smaller value will cause a more vertical flow. The default value of 80 does a pretty good job of creating veins that ‘snake’ through the ground.​


    Ore Control
    These control the how, when, and where of the ore within a vein.​

    density:
    This controls how much of the vein is populated with ore. You can put a value between 0 and 1 here, which roughly translates to the percentage you want filled with ore. However, this value is modified by the densBonus and thickness variables and so may need some tweaking to get it just right. If you have a densBonus of 1 and a density of 1, you will have many veins that are solid ore.​

    thickness:
    This controls how far from the vein’s location the ore can be placed. You can think of this as the number of blocks around the vein you want ore placed, thus it can be viewed as a way to control the general size of the ore deposit. It should be noted that the densLength controls how big the initial vein size is, and only then does the thickness modify the vein’s size.​


    My Config File
    I have setup my preferred configuration to create a mineral dispersion to my liking. Hopefully someone else will find it useful as well. It feels somewhat complicated to me, so I'll start by explaining what I've done:


    Vein Classes

    I have separated the veins into three general classes, which each have a different style of distribution.​

    General Formations:
    These offer the basic supply of ores for the world. These placements are designed to give around 50% of the default 1.8.1 generator's ore content. It is also bunched together in veins now and split up into overlapping layers with various chances to form. For example, diamonds can now form much higher, but only very rarely. This makes it possible to find ore outside of it's band, but still leaves a general layer for the best likelihood.​


    Biome Boosted Formations:
    These are rarer biome specific ore deposits of a greater size and/or density. Each ore has a specific biome where it is most prevalent. If you are in need of a great deal of that ore, you'll have to find that biome and build a transportation system to get you there and the ore back. There will be usually be enough ore to sustain an actual mine shaft with rails and carts.​

    Mega Formations:
    These are extremely rare, but provide a massive cache of ore. These deposits are very hard to find, but offer a huge cache of a given ore. Further, they grant some extra bonuses and surprises to be discovered by the user. Again, they are very rare.​



    Now With Extra Flava

    I have spiced up the mix by adding a few extra details to the ore veins here and there. Since the idea is to enjoy the flavor by surprise, I'll not detail them here. You can pm me for a more in depth explanation if you for some reason want one.​



    The Config

    I'm sharing my config file so far. I welcome any comments or improvements that can be had.​
    The Config (open)
    Code:
    default:
        -
            #  >block ID or name of this ore
            #block: GOLD_ORE
            #  >used for random generator, pick random different number for each vein
            #seed: 35434
            #  >ore chance multiplicator, default 1
            #density: 0.3
            #  >maximal vertical span from vein center, default 5
            #thickness: 4
            #  >density modification. Random number is between -1 and 1, this is applied and result is ore spawn chance (negative is zero chance), default 0
            #  >e.g. 0.0 will result in 50% of columns covered in ore, -0.5 25%, -0.9 5%, -1 0%
            #densityBonus: -0.5
            #  >average height this vein spawn at, default 32
            #heightAvg: 20
            #  >maximal random difference from heightAvg, default 20
            #heightVar: 20
            #  >distance in blocks between height slope change, default 80
            #heightLength: 80
            #  >distance in blocks between density slope change, dafult 80
            #densLength: 80
            #  >if this ore is present, it will block out any other ores (in column), default false;
            #exclusive: false
            #  >this vein will manifest in given biomes. default: all biomes
            #  >biomes are: RAINFOREST, SWAMPLAND, SEASONAL_FOREST, FOREST, SAVANNA, SHRUBLAND, TAIGA, DESERT, PLAINS, ICE_DESERT, TUNDRA;
            #  >there are also: EXTREME_HILLS, HELL, OCEAN, RIVER;
            #biomes: [forest,swamp]
        -
            # ----------------------------------------------------
            # Start of standard smattering of ores on all biomes.
            # ----------------------------------------------------
        -
            block: COAL_ORE
            seed: 348976434186
            density: 1.5
            thickness: 8
            densityBonus: -0.80
            heightAvg: 50
            heightVar: 40
            heightLength: 50
            densLength: 70
            exclusive: false
        -
            block: COAL_ORE
            seed: 543543
            density: .8
            thickness: 17
            densityBonus: -0.7
            heightAvg: 40
            heightVar: 40
            heightLength: 80
            densLength: 150
            exclusive: false
        -
            # This iron forms with coal deposits.
        -
            block: IRON_ORE
            seed: 543543
            density: .09
            thickness: 8
            densityBonus: -0.7
            heightAvg: 40
            heightVar: 40
            heightLength: 80
            densLength: 150
            exclusive: false
        -
            block: IRON_ORE
            seed: 548946454
            density: .2
            thickness: 3
            densityBonus: -0.45
            heightAvg: 25
            heightVar: 20
            heightLength: 80
            densLength: 45
            exclusive: false
        -
            block: LAPIS_ORE
            seed: 63834343
            density: 0.2
            thickness: 4
            densityBonus: -0.7
            heightAvg: 10
            heightVar: 10
            heightLength: 35
            densLength: 42
            exclusive: false
        -
            block: GOLD_ORE
            seed: 35434
            density: 0.1
            thickness: 2
            densityBonus: -0.5
            heightAvg: 15
            heightVar: 12
            heightLength: 80
            densLength: 80
            exclusive: false
        -
            block: REDSTONE_ORE
            seed: 4325483
            density: 0.8
            thickness: 3
            densityBonus: -0.72
            heightAvg: 10
            heightVar: 10
            heightLength: 20
            densLength: 30
            exclusive: false
        -
            block: DIAMOND_ORE
            seed: 98746835
            density: 0.45
            thickness: 3
            densityBonus: -0.79
            heightAvg: 10
            heightVar: 10
            heightLength: 10
            densLength: 40
            exclusive: false
        -
            block: OBSIDIAN
            seed: 98746835
            density: 0.85
            thickness: 3
            densityBonus: -0.79
            heightAvg: 10
            heightVar: 10
            heightLength: 10
            densLength: 40
            exclusive: false
        -
            # This diamond is a mostly rare smattering of barely any diamonds above the bottom layer of larger veins.
        -
            block: DIAMOND_ORE
            seed: 16894564
            density: 0.15
            thickness: 3
            densityBonus: -0.85
            heightAvg: 25
            heightVar: 5
            heightLength: 80
            densLength: 55
            exclusive: false
        -
            # This coal is just filler for some of the empy spaces.
        -
            block: COAL_ORE
            seed: 268632497357
            density: 2
            thickness: 0.9
            densityBonus: -0.78
            heightAvg: 50
            heightVar: 40
            heightLength: 50
            densLength: 21
            exclusive: false
        -
            # ----------------------------------------------------
            # Begin boosted biome deposits
            # ----------------------------------------------------
        -
            block: COAL_ORE
            seed: 23484654
            density: 0.9
            thickness: 14
            densityBonus: -0.55
            heightAvg: 25
            heightVar: 20
            heightLength: 80
            densLength: 150
            exclusive: false
            biomes: [SWAMPLAND]
        -
            block: DIAMOND_ORE
            seed: 921358641
            density: 0.15
            thickness: 3
            densityBonus: -0.49
            heightAvg: 15
            heightVar: 17
            heightLength: 80
            densLength: 110
            exclusive: false
            biomes: [DESERT]
        -
            block: DIAMOND_BLOCK
            seed: 921358641
            density: 0.01
            thickness: 3
            densityBonus: -0.75
            heightAvg: 15
            heightVar: 17
            heightLength: 80
            densLength: 110
            exclusive: false
            biomes: [DESERT]
        -
            block: STATIONARY_LAVA
            seed: 921358641
            density: 0.10
            thickness: 3
            densityBonus: -0.57
            heightAvg: 15
            heightVar: 23
            heightLength: 80
            densLength: 110
            exclusive: false
            biomes: [DESERT]
        -
            block: STATIONARY_LAVA
            seed: 168632497357
            density: 0.87
            thickness: 0.9
            densityBonus: -0.78
            heightAvg: 50
            heightVar: 40
            heightLength: 50
            densLength: 21
            exclusive: false
        -
            # This lava makes the desert biome quite a bit more 'interesting' when searching for those diamonds.
        -
            block: STATIONARY_LAVA
            seed: 6515424354
            density: 0.17
            thickness: 4
            densityBonus: -0.63
            heightAvg: 15
            heightVar: 23
            heightLength: 80
            densLength: 52
            exclusive: false
            biomes: [DESERT]
        -
            block: IRON_ORE
            seed: 75494651574
            density: 0.5
            thickness: 4
            densityBonus: -0.35
            heightAvg: 55
            heightVar: 25
            heightLength: 80
            densLength: 75
            exclusive: false
            biomes: [EXTREME_HILLS]
        -
            block: LAPIS_ORE
            seed: 24676984534
            density: 0.4
            thickness: 5
            densityBonus: -0.65
            heightAvg: 10
            heightVar: 10
            heightLength: 75
            densLength: 82
            exclusive: false
            biomes: [OCEAN]
        -
            block: GOLD_ORE
            seed: 8614635735
            density: 0.3
            thickness: 2
            densityBonus: -0.4
            heightAvg: 15
            heightVar: 12
            heightLength: 80
            densLength: 95
            exclusive: false
            biomes: [RIVER]
        -
            block: REDSTONE_ORE
            seed: 461567653
            density: 0.8
            thickness: 3
            densityBonus: -0.60
            heightAvg: 10
            heightVar: 10
            heightLength: 50
            densLength: 70
            exclusive: false
            biomes: [RAINFOREST]
        -
            # ----------------------------------------------------
            # Begin in-mountain ore deposits
            # ----------------------------------------------------
        -
            block: IRON_ORE
            seed: 24664534
            density: 0.5
            thickness: 6
            densityBonus: -0.45
            heightAvg: 80
            heightVar: 20
            heightLength: 80
            densLength: 75
            exclusive: false
            biomes: [EXTREME_HILLS]
        -
            block: COAL_ORE
            seed: 24664534
            density: 0.1
            thickness: 3
            densityBonus: -0.45
            heightAvg: 80
            heightVar: 20
            heightLength: 80
            densLength: 75
            exclusive: false
            biomes: [EXTREME_HILLS]
        -
            # ----------------------------------------------------
            # Begin mega ore deposits
            # ----------------------------------------------------
            block: IRON_ORE
            seed: 34621874534
            density: 0.2
            thickness: 6
            densityBonus: -0.95
            heightAvg: 27
            heightVar: 14
            heightLength: 80
            densLength: 1075
            exclusive: false
            biomes: [EXTREME_HILLS]
        -
            # These diamond blocks are surrouned by lava and obsidian.  The diamond is rarer than the
            # other two, so they can form without the diamonds.  This makes the desert biome even more
            # dangerous to mine in.
        -
            block: DIAMOND_BLOCK
            seed: 921358641
            density: 0.4
            thickness: 5
            densityBonus: -0.95
            heightAvg: 6
            heightVar: 6
            heightLength: 80
            densLength: 24
            exclusive: false
            biomes: [DESERT]
        -
            block: STATIONARY_LAVA
            seed: 921358641
            density: 0.6
            thickness: 5
            densityBonus: -0.85
            heightAvg: 6
            heightVar: 6
            heightLength: 80
            densLength: 24
            exclusive: false
            biomes: [DESERT]
        -
            block: OBSIDIAN
            seed: 921358641
            density: 0.4
            thickness: 5
            densityBonus: -0.85
            heightAvg: 6
            heightVar: 6
            heightLength: 80
            densLength: 24
            exclusive: false
            biomes: [DESERT]
        -
            # Large gold deposits under rivers!  With an added bonus!
        -
            block: GOLD_ORE
            seed: 36137872
            density: 0.7
            thickness: 5
            densityBonus: -0.94
            heightAvg: 15
            heightVar: 12
            heightLength: 65
            densLength: 105
            exclusive: false
            biomes: [RIVER]
        -
            block: GOLD_BLOCK
            seed: 36137872
            density: 0.1
            thickness: 2
            densityBonus: -0.94
            heightAvg: 15
            heightVar: 12
            heightLength: 65
            densLength: 105
            exclusive: false
            biomes: [RIVER]
        -
            block: GLOWSTONE
            seed: 36137872
            density: 0.05
            thickness: 2
            densityBonus: -0.94
            heightAvg: 15
            heightVar: 12
            heightLength: 65
            densLength: 105
            exclusive: false
            biomes: [RIVER]
        -
            # Huge lapis deposits under oceans!
        -
            block: LAPIS_ORE
            seed: 7106548346
            density: 0.3
            thickness: 5
            densityBonus: -0.65
            heightAvg: 10
            heightVar: 10
            heightLength: 95
            densLength: 482
            exclusive: false
            biomes: [OCEAN]
        -
            block: LAPIS_BLOCK
            seed: 7106548346
            density: 0.01
            thickness: 1
            densityBonus: -0.65
            heightAvg: 10
            heightVar: 10
            heightLength: 95
            densLength: 482
            exclusive: false
            biomes: [OCEAN]



    A Fix For You

    I hope mort doesn't mind, but I thought I'd upload the fixed file I am using to generate the ore usng the hightVar value. I'm sure he'll get a better fix out soon, but perhaps this will help in the mean time. [I'll gladly remove it if you see an issue here mort.]

    [Edit]
    I have updated the config file with some fixes.​


     

    Attached Files:

    Last edited by a moderator: May 19, 2016
    Acrinom and flamedaces like this.
  13. Offline

    m0rt

    New version up, I finally got apply working (now using a fixed area), and there are new config options - mode and exclude_biomes, as always defaulted to previous behavior. However the change in noise generators will cause veins to be generated differently from 1.3.3

    CommanderGizmo: I appreciate your effort with this plugin, the config is pretty interesting, I just implemented the two things you need, exclude biomes and mode, which will allow to add the lava around diamonds (as in your config file), without removing all existing lava in the world.
     
  14. Offline

    CommanderGizmo

    Just in case it matters to someone, but I noticed that the lava and obsidian did not disappear from the worlds I was generating. My guess is they were generated after the mod ran during the detail pass. I am, however, very happy to see the 'add' mode. I was really wanting to put that in, so now it's just about perfect!
     
  15. Offline

    Darksonn

    OMG i found alot of ores pretty fast! [​IMG]
     
  16. Offline

    mtszyk

    Wonderful plugin, m0rt, I've had my eye on it for quite a while. Had a server running over the summer, and will be running it again come ~January when I am able to play again with my brothers, and this is really the only critical mod in my opinion!

    Anyway, I have a feature request if you have the time to do it: If you could have an option that said whether or not the maximum height of terrain in the area had an effect on heightAvg, that would be awesome (maybe just a "magnitude" of some sort).

    As far as implementation goes, I don't know the bukkit API, but maybe this terrible pseudocode helps to start (to minimize thought on your part if you are interested in this idea, not because I am trying to tell you how to code or anything! That's just silly :rolleyes:):
    FindChunkHeight()
    height = 70 (or other educated guess, biome dependant?)
    chunkpos[5.or.so] = {(8,8) (middle of chunk), (0,8) (edge), ... etc}
    for i in 5.or.so
    while block at (chunkpos(i), height) is not air
    height++
    while block at (chunkpos(i), height) is air
    height--
    chunkheight(i) = height
    return average(chunkheight)

    And when necessary...
    heightAvg = heightAvg+magnitude*(FindChunkHeight - 64)


    When I originally looked at your source, I figured out where you could put that last line, but it's changed quite a bit since I last looked, sorry :D

    Obviously, this could hit performance, but I figure adding a few hundred operations max per chunk isn't TERRIBLE, right? :(

    Regardless, thanks for the great mod!

    Edit: It also makes sense for there to be a modifier for the chance that depends on the height, but I didn't think on that at all.
     
  17. Offline

    m0rt

    I could add this: heighVar and heightAvg are set that they generate value between 0-1, which will be multiplied by maxHeight, resulting in final height. The maxheight will be calculated for each column, otherwise it would result in quite big steps at chunk borders. (This of course will be optional setting, defaulted to previous behavior, as always)
     
  18. Offline

    mtszyk

    Sounds great!
     
  19. Offline

    blackalegator

    Strange, didnt work for me. Craftbukkit v1496. executes smth like mineralveins main 0 0 5500 5500. Worked for an hour, nothing changed. Could I make a plugin suggestion? I cant really implemen it myself, even though I have all your code, still... Could you make a plugin which will regenerate all the ores using a different seed for block populator? I am sure a lot of people would need it as for it is great for anti x-ray purpose
     
  20. Offline

    m0rt

    I haven't yet tested it for 1.0, but it should work, I don't know about any major changes in blocks. Anyway I am going to test and release new version soon (including mtszyk's request).
    About the populator: you mean that it would generate ores the classic way, but with another seed? That's not as easy, since you can't really access the old populator anyhow... But you might create a config for MineralVein that will result in vanilla-like deposits (I think I already did it somewhere in this forum, just use small densLen)
     
  21. Offline

    Morte

    Its possible to create map with this plugin on minecraft 1.0.0 ?
     
  22. Offline

    m0rt

    I tested the new version (1.3.5) on CB 1493, works fine. Since there isn't much change from previous version, I expect any version to work with 1.0.
     
  23. Offline

    Morte

    How to make veins in shape as cube by 10x10?
     
  24. Offline

    Greedish

    How do I know if the apply command worked? It lagged the server for a while but I see no difference.

    Actually I haven't found any veins, just regular ores, even on new chunks. What gives?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  25. Offline

    Morte

    I testing it on X-ray, so this plugin working good. But i cant make veins in shape as cube by 10x10 or something.
    Always are too big or too small.
    And how to erase all gold from my map?
     
  26. Offline

    m0rt

    I also use X-ray to test (the one that is an external program, not the plugin), it is quite old, not really works for new blocks since like 1.5, but fine for ores.
    You can't really make them cubes, but if my calculations are correct, the average width/height of the vein is approximatelly densLength, but it will always vary a lot.
    Greedish: What CB do you use?
     
  27. Offline

    Aelinthali

    I would really like to try this out but all it ever does is lock up my server. I am typing in the command line for the console and I have tried:
    mineralvein apply DarkStar
    mineralvein apply 0
    mineralvein apply DarkStar 0 0 100 100
    mineralvein apply DarkStar 0 0 1024 1024
    I get the same thing every time. My CPU usage jumps up dramatically but the server stops responding. Am I doing something wrong? Does this process take a long time and I am just not waiting long enough?
    EDIT:
    I tried those same commands as an OP on the server with the same results. Also, if I MUST HAVE a config file, where do I place it?
     
  28. Offline

    m0rt

    There is some sort of problem with threads, I will upload fixed version asap. The config file is the veins.yml file, that is created automatically, or downloaded in the zip, in plugins/Mineral Vein folder.
     
  29. Offline

    Aelinthali

    Thanks! That did the trick. Also thanks for pointing out where the config file was.
     
  30. Offline

    m0rt

    All right, just uploaded new version, should work with IC-veins now (now block config node accepts any id in format XX-YY for ID-DATA)
     
  31. Offline

    Zidkon

    Men are you sure this is working automatically for newly generated chunks? Because I setted density bonus to -1 (no ore by any chance) and I applied to a new world, is worked no gold in the applied chunks, but I started to move in 1 direction and at the new generated chunks the gold appears like normal minecraft default thats why I ask.

    If is any bug please fix it :D thanks
     

Share This Page