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

    foxkritsune

    Used multiple layers (glowstone/air/nether), matching density/height lengths, and inverted height avg to produce 'Geodes' where Glowstone grows sideways from rock faces within a Netherrack shell. It takes place around level 10-20. The idea was to create awesome geodes, and it occurred to me that it's a nice alternative to the Nether. Very cool, give it a go!

    2012-05-19_17.23.11.png 2012-05-19_18.01.13.png

    Code:
    # Nether Geodes
    - block: NETHERRACK
      seed: 5678
      density: 10
      thickness: 2
      densityBonus: 0
      heightAvg: 15
      heightVar: 10
      heightLength: 30
      densLength: 30
      exclusive: false
      mode: add
    - block: NETHERRACK
      seed: 5678
      density: 10
      thickness: 2
      densityBonus: 0
      heightAvg: 15
      heightVar: -10
      heightLength: 30
      densLength: 30
      exclusive: false
      mode: add
    - block: AIR
      seed: 5678
      density: 10
      thickness: 4
      densityBonus: 0
      heightAvg: 15
      heightVar: -5
      heightLength: 30
      densLength: 30
      exclusive: false
      mode: add
    - block: AIR
      seed: 5678
      density: 10
      thickness: 4
      densityBonus: 0
      heightAvg: 15
      heightVar: 5
      heightLength: 30
      densLength: 30
      exclusive: false
      mode: add
    - block: GLOWSTONE
      seed: 5678
      density: 10
      thickness: 2
      densityBonus: 0
      heightAvg: 15
      heightVar: 1
      heightLength: 30
      densLength: 30
      exclusive: false
      mode: add
    - block: GLOWSTONE
      seed: 5678
      density: 10
      thickness: 2
      densityBonus: 0
      heightAvg: 15
      heightVar: -1
      heightLength: 30
      densLength: 30
      exclusive: false
      mode: add
     
  3. Offline

    foxkritsune

  4. Offline

    ImKharn

    Vanilla Ore Counts concentrated into massive veins!
    --------------------------------------------------------------
    I used a mod to count ores from 2025 chunks to ensure this matches vanilla ore counts.
    The ore groupings are pretty rare but when you do find them, you might as well put down a sign that says coal mine, because you just found enough coal for the next week of playing.
    Mining underground for a while you should be able to somewhat easily find every ore but gold and diamond, but if you are the lucky player that stumbles upon gold or diamond, get ready to rip everyone off on your server (warning: blood diamonds might happen)

    Here you go:

    Code:
    default:
    - block: GOLD_ORE
      seed: 35434
      density: 1000
      thickness: 3
      densityBonus: -0.89
      heightAvg: 20
      heightVar: 10
      heightLength: 10
      densLength: 180
      exclusive: false
    - block: IRON_ORE
      seed: 67436874
      density: 1000
      thickness: 37
      densityBonus: -0.87
      heightAvg: 35
      heightVar: 30
      heightLength: 80
      densLength: 60
      exclusive: false
    - block: REDSTONE_ORE
      seed: 4325483
      density: 1000
      thickness: 1
      densityBonus: -0.65
      heightAvg: 8
      heightVar: 8
      heightLength: 10
      densLength: 60
      exclusive: false
    - block: DIAMOND_ORE
      seed: 98746835
      density: 1000
      thickness: 3
      densityBonus: -0.91
      heightAvg: 7
      heightVar: 7
      heightLength: 100
      densLength: 180
      exclusive: false
    - block: LAPIS_ORE
      seed: 63834343
      density: 1000
      thickness: 6
      densityBonus: -0.91
      heightAvg: 14
      heightVar: 10
      heightLength: 10
      densLength: 60
      exclusive: false
    - block: COAL_ORE
      seed: 543543
      density: 1000
      thickness: 9
      densityBonus: -0.56
      heightAvg: 35
      heightVar: 100
      heightLength: 80
      densLength: 60
      exclusive: false
    Ore Counts:
    Show Spoiler

    Before MineralVein
    CONSOLE: COAL_ORE: 316286
    CONSOLE: IRON_ORE: 171256
    CONSOLE: GOLD_ORE: 16747
    CONSOLE: REDSTONE_ORE: 50879
    CONSOLE: DIAMOND_ORE: 6409
    CONSOLE: LAPIS_ORE: 6963
    After Mineralvein:
    CONSOLE: COAL_ORE: 327038
    CONSOLE: IRON_ORE: 172203
    CONSOLE: GOLD_ORE: 16072
    CONSOLE: REDSTONE_ORE: 51539
    CONSOLE: DIAMOND_ORE: 6715
    CONSOLE: LAPIS_ORE: 6898
     
  5. Offline

    foxkritsune

    What mod did you use to count ore? That would be so useful.
     
  6. Offline

    ImKharn

    PM Dark_Link777. He will send you the mod, I don't think he published it on the web yet.
     
  7. Can be put the name of the biomes "custom" that come with the plugin "Terrain Control"?.
    Or only works with default biomes minecraft vanilla?.

    Regards and great plugin.
     
  8. Offline

    needle44

    I have a question could anyone configure the config for me I tried to but the ores are spawning everywhere and I want them to spawn in certain biomes. Here's a list of what I want (I want all ores in huge groups but area ton rarer (around 0.3x that of original minecraft rarer)

    - Coal: I'd like it to only spawn in Jungle and Extreme Hills and Mushroom Biomes.
    - Iron: I'd like it to only spawn in forests and mushroom biomes.
    - Redstone: I'd like it to spawn in tundras and taigas and mushroom biomes.
    - Gold: I'd like it to spawn in desert and mushroom biomes.
    - Lapis: I'd like it to only spawn in plains and mushroom biomes.
    - Diamond: I'd like it to spawn in only swamplands and msuhroom biomes.

    Like I said though huge clumps of them but they're a lot rarer. Thanks if you can do this for me please send it to me via pm.
     
  9. Offline

    Whatshiywl

    guys i'm having some problems getting these things right...

    here's my config:
    Code:
    default:
    - block: GOLD_ORE
      seed: 35434
      density: 5
      thickness: 4
      densityBonus: 0
      heightAvg: 128
      heightVar: 128
      heightRel: false
      heightLength: 5
      densLength: 15
      exclusive: false
      mode: replace
    - block: IRON_ORE
      seed: 67436874
      density: 20
      thickness: 5
      densityBonus: 0
      heightAvg: 128
      heightVar: 128
      heightLength: 5
      densLength: 15
      exclusive: false
    - block: REDSTONE_ORE
      seed: 4325483
      density: 150
      thickness: 3
      densityBonus: 0
      heightAvg: 128
      heightVar: 128
      heightLength: 5
      densLength: 15
      exclusive: false
    - block: DIAMOND_ORE
      seed: 98746835
      density: 5
      thickness: 3
      densityBonus: 0
      heightAvg: 128
      heightVar: 128
      heightLength: 5
      densLength: 15
      exclusive: false
    - block: LAPIS_ORE
      seed: 63834343
      density: 10
      thickness: 4
      densityBonus: 0
      heightAvg: 128
      heightVar: 128
      heightLength: 5
      densLength: 15
      exclusive: false
    - block: COAL_ORE
      seed: 543543
      density: 35
      thickness: 8
      densityBonus: 0
      heightAvg: 128
      heightVar: 128
      heightLength: 5
      densLength: 15
      exclusive: false
    
    I get some wierd ore colums... like these:
    [​IMG]

    And if I use the default's vaules for heightLength and densLength (both 80) i get these circles:
    [​IMG]

    Anyone got any ideas? I don't realy want rare huge chunks of ores, just normal vanilla distribution or something close....
     
  10. Offline

    ImKharn

  11. Offline

    Whatshiywl

  12. Offline

    lostinmyhead

    Hey m0rt, I'm holding off starting a server until things have settled down in Minecraft's development but when I do I'm planning to use this as an integral part. The aim was to have mineral deposits spaced out with a frequency of roughly one per biome although with the larger biomes in 1.3 I may aim for more. Finding a deposit should be a big deal - nay, a huge deal - as it will need to supply everyone in the vicinity, putting the discoverer in a position of power through their control of the resource. I'm talking huge deposits spaced over huge distances. I'll be doing this in a Tekkit server (without EE because unbalanced) in which I envisage people using quarries to drill core samples in search for the fabled ore bodies then setting up larger quarries to mine the minerals when found. Any tips on what my configuration should look like?
     
  13. Offline

    sting_auer

    What I need to do is make ores show up at least 2 kilometers apart, be about 10 blocks thick, and contain a few thousand ores apiece. How do I do this exactly? I tried to do it before but I had a lot of trouble with the config file.
     
  14. Offline

    tfenderson

    Could someone confirm my understanding of the /mineralvein apply command is correct before I potentially destroy my map?

    I have a map whose spawn is located at -112 (x), 252 (z). WorldBorder is set up to restrict the world to a round map with a radius of 8000. If I want to run the /mineralvein apply command to regenerate the ore on that map, would the following params work?

    /mineralvein apply world -112, 252 8000 8000
     
  15. Offline

    kamino

    can anyone give me an config, that doubles or triples all the ores in the world.
    i m trying around since hours but i dont get it work, like i want
     
  16. Offline

    mossyblog

    After some tests i've found what I think is probably the ongoing issue here.
    When the plugin initially hooks into the WorldInit event all works reasonably fine (works as per design). When the player(s) move around in the world and the Chunks are being generated their seems to be a disconnect in the logic, that is it makes "additive" additions/changes to the chunk but the chunk still generates the vanilla ore(s) as well.
    When i've run Worldedit //regen command on chunks they revert back to the Mineralvein logic, thus giving you the intended vein strikes.
    - It's either a event timing issue (ie i wonder if Mineral-Vein is being called first then Bukkit does its population after?)
    - It's not taking exclusive hold over the ore management, looking at the code it seems to not have any reset functions. I wonder if its worthwhile doing a pre and post chunkloaded checks?
    Nevermind its currently still a bug in Bukkit - https://bukkit.atlassian.net/browse/BUKKIT-4390
     

Share This Page