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


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

    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 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).

    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)

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

            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.
    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:

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

    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.

    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):
    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):
    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.

    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


    phlum: That's great, I have never tried it with a faction plugin, but I can see how it can be fun.

    @turtlelotd: I don't see why it shouldn't be, MV runs after world generation and deletes ores. Ofc I can't see the source code, so it's hard to tell, but if Nordic uses bukkit worldgenerator system properly, it should be.
  3. Offline


    Yes, it is completely compatible. It is also compatible with Tropic.
  4. Offline


    this is my faction config, the gold is default
    block: IRON_ORE
    seed: 67436874
    density: 0.6
    thickness: 12
    densityBonus: 0.1
    heightAvg: 25
    heightVar: 20
    heightLength: 80
    densLength: 400
    exclusive: false
    block: REDSTONE_ORE
    seed: 4325483
    density: 0.7
    thickness: 6
    densityBonus: 0.1
    heightAvg: 15
    heightVar: 10
    heightLength: 20
    densLength: 150
    exclusive: false
    block: DIAMOND_ORE
    seed: 98746835
    density: 0.3
    thickness: 6
    densityBonus: 0.1
    heightAvg: 10
    heightVar: 10
    heightLength: 10
    densLength: 200
    exclusive: false
    block: LAPIS_ORE
    seed: 63834343
    density: 0.3
    thickness: 8
    densityBonus: -0.2
    heightAvg: 10
    heightVar: 10
    heightLength: 10
    densLength: 40
    exclusive: false
    block: COAL_ORE
    seed: 543543
    density: 0.65
    thickness: 10
    densityBonus: -0.0
    heightAvg: 40
    heightVar: 40
    heightLength: 80
    densLength: 400
    exclusive: false
  5. Offline


    I see some posts about it and I cant be sure by what people have typed..... who here has made a configuration that has almost exactly the same ores per chunk as vanilla minecraft?

    I dont want the value/rarity of ores to change in any way just group their placement closer to real life.


    EDIT: Dark_Link777 in your notes you mention vanilla. Are you saying vanilla for this mod or vanilla for minecraft?

    I did /mineralvein apply world from the console. The console did nothing in reply. How do I know apply worked?

    The mod is loaded.

    EDIT: Ok in your original post you used a backslash, for the command to work I have to use a forward slash. It is applying now.

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


    I meant vanilla for Minecraft, sorry for not clarifying. Hope that helps!
  7. Offline


    Thank you Dark_Link777, I have applied mineral vein with your settings. I hope m0rt makes them the default for the mod.

    My server autorestarts at 4am. Apparently the application of mineral vein took so long when I went to bed it didnt get past 18%. Is mineral vein apply safe to run again? Should I expect it to be really broken and restore from backup?

    CONSOLE: Application on world: 13MB, 18.0%
    CONSOLE: Application on world: 11MB, 18.0%
    CONSOLE: Application on world: 11MB, 18.0%
    CONSOLE: Application on world: 11MB, 18.0%
    CONSOLE: Application on world: 9MB, 18.0%
    CONSOLE: Application on world: 9MB, 18.0%
    CONSOLE: Application on world: 8MB, 18.0%
    CONSOLE: CONSOLE: Forcing save..
    Server: Automatic restart.
    Server: Server is restarting. World is being saved.
    CONSOLE: CONSOLE: Enabling level saving..
    CONSOLE: CONSOLE: Forcing save..
    CONSOLE: CONSOLE: Stopping the server..

    EDIT: The issue still happens even if I turn off automatic restarts. The server goes really fast to 16 percent then takes hours to go from 16 to 18%, then never goes past 18 percent for hours, then the server crashes. When I got back home today from work the server was off.
  8. Offline


    ImKharn: This is very strange, but it seems as some chunk unloading error. The applying process hold until there is enough free memory, which for some reason doesn't happen. Are you running the server with enough ram? Maybe it could work if it had more memory to waste.
  9. Offline


    I use paid for server hosting. Is it possible to use less ram? Do you think Its possible for me to download the map, convert it in single player on my gaming computer and upload it?
  10. Offline


    I don't know what hosting you use, but they usually have about 5x smaller RAM than you would need when using bukkit. I is of course possible to convert it on your computer, if you manage to get the map file from the hosting service. However you should still use MV for newly generated chunks.
  11. Offline


    I have the map downloaded.
    I have never installed bukkit before. Can I install it to single player or do I have to host a server?
  12. Offline


    Bukkit is a server by itself, it doesn't have any client version. Just put the "world" folder, the bukkit jar and a folder "plugins" (with mineral vein in it) to the same folder and double-click bukkit. You don't even have to join the game, you can just use the command from console.
  13. Offline


    I know that you probably get asked this alot: When are you going to update so that this is compatible with mc 1.2.4?

    Please PM me, I would like to discuss something with you.
  14. Offline


    From what I am reading, this mod will increase the amount of ore in your world and change the value of stuff.
    For people wanting to edit m0rts settings to match vanilla minecraft. You will find this research useful.

    Vanilla Minecraft ore frequency:
    Average of 110 coal ore per chunk
    Average of 84 iron ore per chunk
    Average of 25 redstone ore per chunk
    Average of 7.5 gold ore per chunk
    Average of 3.4 Lapis Lazuli ore per chunk
    Average of 3 diamond ore per chunk
    (233 ore per chunk) = (2% of all stone)
    Source: Official Minecraft wiki for all but one ore type which was gathered via forum.

    Personally, I am looking to edit this such that it has vanilla ore populations but make the groupings of ore so huge and spread out that 8/9 chunks dont have ore at all. IMAO, this will be closer to real life. (though in real life rare ore is only found a few places on earth)

    EDIT: Want to include that
    Has already made settings that place ore in vanilla amounts. I personally am doing my research so I can edit this and have deposits be even more rare and bulky.
  15. Offline


    last_408: After a quick test I would say it works for 1.2.4, so far I could tell.
    ImKharn: What are these values? The amounts in vanilla, or with MV? And are they calculated or measured?
    The idea with 8/9 chunks is neat, however considering the number of different ores (especially if you're using IC or RP or stuff), finding a specific ore under this conditions could take very long.
  16. Offline


    m0rt Then my apologies. I generated a new multiverse world with tropic and a custom seed. After which I tried to use minveral veins to repopulate this world with rescources. It didn't work, I removed and did not save the error code it threw. I will retry, thanks again!
  17. Offline


    Ok, m0rt I updated the post to explain further, and yes it would take a long time to find ores if most chunks are empty, but at the same time once you do find ore, it will be a massive massive amount that you hide and dont tell anyone til you finish the hours mining it out :)
  18. Offline


    I have a question hopefully someone can answer. I started a server that has completely custom landscapes all made manually using voxel sniper 2000x2000. When I first began I tried to make extra ores but couldn't figure out anything cause I wasn't as smart back then. So right now all I have is world edit ores by doing //set 1,1,1,1,1,1,56,14 which just makes single ore chains and is super stupid to mine. Is there any way to make this plugin or any plugin help me to add ores to a already created world?
  19. Offline


    Mstabarrie: That's exactly what MV can do, however currently it only replaces stone with ores, so if you have some other base material, it won't work. All you have to do is run the server with the plugin and then use the command (/mineralvein apply), it should go through the entire world and generate ore veins.
  20. Offline


    m0rt Can you please add one somewhat simple feature.
    At the end of mineral vein apply, send a server announcement that Looks like
    Coal: Removed: 20600 Placed: 21060
    Iron: Removed: 15087 Placed 14508

    This will allow people who applied it to know how much more or less ore was placed.
  21. Offline


    When will this be updated to 1.2.4? Will it be before 1.2.5?
  22. Offline


    It was claimed and confirmed several post ago, it works fine for 1.2.4, and propably will go on working on 1.2.5 without any change.
  23. Offline


    Everytime I try to run the command it says "only console may call this." And also for somereason when I created my map it had a space called "bedrock world" so maybe this is a problem? I just used bedrock_world when attempting the command. I also tried the command in console and it did not work. Can somone please help me!
  24. Offline


    Hi all.
    Please help:
    How to reduce the amount of certain ores at a map in a few times? What parameters to change?

    One way or not?
  25. Offline


    Did anyone answer?
  26. Offline


    Mstabarrie: Try using world ID number (if you use apply with nonexisting world you will get a list of worlds and their IDs)
    hollow36rus: if you want to reduce amount/chunk, decrease density. If you want rarer and smaller veins, decrease densBonus. If you want smaller veins with same amount/chunk, decrease densLength
  27. Offline


    I typed /mineralvein apply 1 0 0 1000 1000 and it doesn't work in game or in console, then I tryed /mineralvein apply in both and it still says only console may call this then I tryed /mineralvein and it still said it. Then I checked my log and it doesn't show any errors or me inputing the command even though I did. Hopefully you may know the problem? Maybe a conflict or something?
  28. Offline


  29. Offline


    Love the plugin. Just curious, is it possible to generate veins in user added formations? I've added some mountains using VoxelSniper, but it's just stone, there's no ore inside. When I add the veins to my world, they only seem to be added to natural areas, and not through all the stone I added.
  30. Offline


    You probably just need to create a vein with it's possible height set high enough to fill the mountain. The default ones don't go much above sea level. If your mountains are added after the terrain is generated you'll have to run the command to create the ore manually since the mountain wasn't there when the chunk terrain was generated.
  31. Offline


    Ok, i tried for about 1 hour, and still failed.
    I want my map filled with ore, (big ass diamond deposits and not rare)
    But i couldn't get it to work.
    So here i am, would anyone post a config with;
    - Solid ore viens
    - Many and big ore viens
    That would be very helpfull,

Share This Page