COFH World Generation User's Manual

Discussion in 'Mod Discussion' started by unknown zombie, Jul 31, 2014.

  1. unknown zombie

    unknown zombie Well-Known Member

    COFH World Generation User's Manual
    This post contains two resources that I hope will prove useful to anyone wanting to make their own modpack. Here I will maintain a guide that covers how to customize ore generation using COFH features and a cheat-sheet that lists the internal block names used by Minecraft to identify special resource blocks found within mods.

    -------------

    External links for those who would like a printable or more easily readable version:

    COFH World Generation User's Manual [Google Docs]
    Minecraft Internal Ore Names Cheat Sheet [Google Sheets]

    -------------
    If you see any errors, misinformation, or would just like to contribute then feel free to post a reply to this thread or leave a comment in the Documents!

    -------------
    More mods will be added to the Internal Ore Names Cheat Sheet when I have time.

    Feel free to post ores from mods that aren't yet added here, and I will add them to the Spreadsheet and this post when I get time. Let's keep it just to ores and special worldgen, please!

    -------------

    [​IMG]

    COFH World Generation User’s Manual
    Shape the world how you will!


    This is an introduction and guide for utilizing and customizing the powerful new generation features found in COFH Core for Minecraft 1.7.10.

    First you will learn how to understand what you're looking at when editing the necessary files, then you will learn some advanced techniques for absolute control over how your world is made!

    Special Thanks:
    @Golrith

    Ore! Huah! What is it good for?

    The very first thing you may not immediately understand is why exactly you might want to go through the trouble of editing these files instead of just using the defaults. While assuming that the defaults are best is a perfectly sane conclusion on the surface, some knowledge of how generation methods work and how they interact with one another will give you the knowledge necessary to make a more informed decision about whether all of this is necessary for you. What mods you use, how many mods you use, and your play style will all come into play. Other considerations may also be appropriate, such as how many people would be playing on your server or if you would be using a pre-generated world with a border.

    Most mods are designed from the standpoint that you should be able to successfully play them when they are the only mod installed. This can cause some overlap when multiple mods that provide their own generation are used at the same time. For example, Thermal Expansion, Tinkers’ Construct, Forestry, and Mekanism all generate Copper and Tin ores. If all of these mods are allowed to generate their resources you will end up with four different versions of each resource! This has some consequences, such as each individual version of the same ore will not stack, and that each resource will be made too abundant because all four mods are generating their resources without regard for what any other mod may be providing.

    Get a grip!

    Before we get started, the first thing you’ll want to do is get yourself a good text editor. The format of these files is very specific, and having a good text editor with syntax highlighting will make finding the inevitable errors much, much easier. I use Linux, so my favorite is Medit (which is also available for Windows). Another good solution is Notepad++.

    These editors are capable of color-coding blocks of text in accordance with the format of the file you’re editing. This means that you will have a much easier time finding missed commas, brackets, etc.

    [​IMG]

    The second thing you’ll want to do is to locate these three files:
    • In the minecraft/config/cofh directory:
      • CoFHCore.cfg
    • In the minecraft/config/cofh/world directory:
      • ThermalExpansion-Ores.json
      • Vanilla.json
    Once you’ve located those files, the first one you’ll want to edit is CoFHCore.cfg. Open the file and find the line near the end that says “B:ReplaceVanillaGeneration=false” and change it to “true.” Make sure you save it! The second file we’re going to look at is where the real work begins -- ThermalExpansion-Ores.json. Once you’ve opened it you will be greeted by a file jumbled with numbers and brackets that looks pretty similar to the picture above.

    You’ll notice that the file begins with one opening brace { and ends with one closing brace }. The placement of braces { }, brackets [ ], colons, and commas is very specific when editing this file. Pay close attention to them! If your ore generation breaks for any reason chances are good that one of these critical components was accidentally left out or misplaced. These special characters separate the code into blocks of data. As the file is parsed the specific placement of each is how the program will understand how the current value it is looking at should be interpreted.

    It may appear daunting at first, but let’s break it down section-by-section and explain what each does. Here is a reference image in which I have trimmed down the entire file into one single ore entry:

    [​IMG]

    You’ll notice, as previously mentioned, that the first character (Line 1) is a single open brace { and the last line (Line 20) is a single close brace }. These are very important and should always be the first and last characters of your file.

    Definitions

    Here are some definitions for the different elements of the file. References to these definitions from here out will be bolded for visibility and quick reference.

    1. STRING: A String is a sequence of characters wrapped in double quotation marks. A string may contain any character except a backslash or quotation mark. All text in the image above which is magenta-colored or red-colored is an example of a String.
    2. VALUE: A Value can be a String, a number, a true, or a false. Any text in the image above which is blue-colored or red-colored is an example of a Value.
    3. ARRAY: An array is a list of Values surrounded by [ ] (brackets). Each Value in the array is separated by a comma. Lines 13 and lines 15 through 18 are examples of Arrays.
    4. NAME: A Name is a String that serves the special purpose of defining the meaning of the Value or Array it is paired with. All Names are followed by a colon. Any text in the image above which is magenta-colored is an example of a Name.
    5. PAIR: A Pair is the combination of a Name and a Value or a Name and an Array. Lines 3 through 20 are each an example of a Pair.
    6. OBJECT: An Object is a Name preceding a list of Pairs surrounded by { } (braces). Each Pair in the list is separated by a comma. The entirety of lines 2 through 19 is an example of an Object.

    Make an Object!

    Line 2 is an object that defines an actual resource. This block of information specifies everything about this resource; including what block should spawn for this resource, where the resource should spawn, and how abundant this resource should be. The name for this object is an alias for the resource, which follows the same conventions as a string. In this case it has been named “darkIron.” It is, quite simply, a way to provide a human-readable name for the resource, to make editing the file simpler. The alias you provide for the resource will have no bearing over what the in-game name for the item is. These aliases should be unique; any alias referenced more than once in the file will have its values overwritten by the values assigned to the last instance of it in the file. Each Object should be separated by a comma, except for the very last Object in the list. In the example above there is no comma after the Object’s closing brace (Line 19) because it is the only Object listed in the file.

    Give it a Template!

    Line 3 is a pair given the name of “template,” and its value can be one of two strings: “uniform” or “normal.” Uniform is the type of template you will most frequently use. It allows a resource equal chance to spawn at any level between the minimum and maximum height. Normal is only used by one type of ore by default: Lapis Lazuli Ore. The normal-type template causes the resource to spawn more frequently at a certain specified depth. More information about this will be covered later, in the section titled “Set how deep it spawns!”

    Specify the Block!

    Line 4 is a pair given the name of “block,” and its value should be a string containing the internal name that Minecraft uses to identify the desired block for this resource. This internal name is normally hidden from the user; however, there are a few ways to discover it. The most accessible option is to refer to the Minecraft Internal Ore Names Cheat Sheet. Another option would be to press F3+H while playing Minecraft, which will turn on an option that adds internal item names to the mouseover tooltip displayed when hovering your cursor over an item in your inventory.

    Line 5 is a pair given the name of “metadata,” and its value should reflect the number used for the metadata on the desired block for this resource.

    Restrict the spawn!

    Line 6 is a pair given the name of “material,” and its value should be a string containing the internal name of the block you wish the resource to replace when it spawns. In the image above “minecraft:stone” is given as the material, meaning that Stone is the only block which this resource will be allowed to replace. The benefit of providing this restriction is that the resource will not be able to replace any other (possibly more rare) resources.

    Set the rarity!

    Lines 7 and 8 determine the rarity of the resource. Increasing the numbers makes the resource more abundant and decreasing the numbers makes the resource more rare. The values provided in these lines are not a guarantee; invalid spawn locations will affect how much of the resource is able to be spawned. Examples of invalid spawn location could be that the resource attempted to spawn in dirt when its “material” is restricted to stone, or that the resource tried to generate at y=80 when the world terrain only generated up to y=60.

    Line 7 is a pair given the name of “clusterSize,” and its value should be a number greater than 0. The cluster size specifies the maximum number of pieces of this resource that can spawn in one attempt (cluster).

    Line 8 is a pair given the name of “numClusters,” and its value should be a number greater than 0. The number of clusters specifies the maximum number of attempts to spawn a cluster in the given height range.

    Set how deep it spawns!

    Lines 9 and 10 determine the range of depths that the resource is able to spawn in. The minimum height should probably be greater than 2 or 3 so that the world’s Bedrock is not disturbed, but less than the value of the maximum height. The maximum height can be any number greater than the minimum height and less than or equal to world height (256). Setting the maximum very high will not cause ores to spawn floating above the ground; air is an invalid spawn block. These pairs work in conjunction with the “numClusters” pair. If the number of clusters is set to 10, the minimum height set to 5, and the maximum height set to 80, the game will attempt to generate ten clusters randomly scattered throughout the y=5 to y=80 range.

    Note that if a resource’s template is set to “normal” instead of “uniform,” these lines should be named “meanHeight” and “maxVariance.” Mean height will specify a preferred depth level for the resource to spawn at, and max variance will specify how much lower or higher from that depth the resource generation is allowed to deviate when it forms a cluster.

    Line 9 is a pair given the name of “minHeight,” and its value should be a number greater than 0 and less than the value given for “maxHeight.” The minimum height specifies the lowest depth at which a resource cluster will attempt to be generated. When the value of “template” is set to “normal,” the name of this pair should be changed to “meanHeight,” and its value should be a number greater than 0 and less than or equal to 256. The mean height specifies the preferred depth that this resource will spawn at.

    Line 10 is a pair given the name of “maxHeight,” and its value should be a number greater than the value given for “minHeight,” and less than or equal to 256. The maximum height specifies the highest depth at which a resource cluster will attempt to be generated. When the value of “template” is set to “normal,” the name of this pair should be changed to “maxVariance,” and its value should be a number greater than or equal to 0 and less than or equal to 256. The maximum variance specifies how far from the value for “meanHeight” the generation is allowed to deviate when generating clusters.

    Retroactively generate it!

    Line 11 is a pair given the name of “retrogen,” and its value can be one of two strings: “true” or “false.” Retrogen, or retroactive generation, will allow the game to evaluate chunks that have previously been generated and attempt to spawn new resources which have been added since that chunk was originally generated. This is useful when adding a new resource once you’ve been playing in a world for a while. I recommend that you just leave this set to true at all times; there’s really no need to set it to false.

    Make it Biome specific!

    Lines 12 and 13 determine what biomes the resource is allowed to spawn in. Biomes are referred to by their ID number. The availability of biomes and the ID number they are assigned will change depending on what mods are installed. The only way to find this information is to use Not Enough Items (NEI) to create a dump of current biome information. This can be done by opening your inventory, clicking NEI’s “Options” button, clicking “Tools,” clicking “Data Dumps,” and finally clicking the “Dump” button in the row titled “Biomes.” This will create a folder labelled “dumps” in your Minecraft folder, and place a file labelled “biome.csv” inside that new folder. Use a spreadsheet program that can import comma separated value (csv) files, such as OpenOffice Calc, Microsoft Excel, or Google Sheets to view it in an easily-readable format.

    Line 12 is a pair given the name of “biomeRestriction,” and its value can be one of three strings: “blacklist,” “whitelist,” or “none.”

    Line 13 is a pair given the name of “biomes,” and its value may be formatted as an array. The values it contains should be numbers that reflect desired biome IDs. Each biome ID should be separated by a comma. The purpose of this pair differs according to what value is given to “biomeRestriction.” If “biomeRestriction” is set to “blacklist,” each biome referenced in this pair will be excluded from the generation of this resource. If “biomeRestriction” is set to “whitelist,” each biome referenced in this pair will be included in the generation of this resource. If “biomeRestriction” is set to “none,” the contents of this pair are ignored.

    *Note that in the version 3.0.0B3-26 release of CoFH Core, biome specific generation is broken.

    Make it Dimension specific!

    Lines 14 through 18 determine what dimensions the resource is allowed to spawn in. Dimensions are referred to by their ID number. The availability of dimensions and the ID number they are assigned will change depending on what mods are installed. Below is a chart that lists dimension IDs for various mods according to their default configuration settings.

    Screenshot - 08162014 - 09:59:31 PM.png

    Line 14 is a pair given the name of “dimensionRestriction,” and its value can be one of three strings: “blacklist,” “whitelist,” or “none.”

    Lines 15 through 18 comprise a pair given the name of “dimensions,” and its value may be formatted as an array. The values it contains should be numbers that reflect desired dimension IDs. Each dimension ID should be separated by a comma. The purpose of this pair differs according to what value is given to “dimensionRestriction.” If “dimensionRestriction” is set to “blacklist,” each dimension referenced in this pair will be excluded from the generation of this resource. If “dimensionRestriction” is set to “whitelist,” each dimension referenced in this pair will be included in the generation of this resource. If “dimensionRestriction” is set to “none,” the contents of this pair are ignored.

    Advanced Techniques

    Now that you’ve got a grasp on what is required to make the most basic generation rules, we can touch on some more in-depth techniques that will allow greater fine-tuning of resource generation.

    Weighting

    Through the use of a new pair given the name of “weight,” it is possible to spawn clusters that contain several different resources. To take advantage of this, the values of the “block” and “metadata” pairs are formatted as arrays.

    Below is an example of one entry that uses the newly introduced weighting system:

    [​IMG]

    When using the weighted system, the “block” pair is formatted as an array. Its values should be a list of strings that contain the internal names that Minecraft uses to identify the blocks for the desired resources. In the example above, the two blocks that will spawn in this resource cluster will be Minecraft Gravel and Tinkers’ Construct Aluminum Gravel Ore.

    When using the weighted system, the “metadata” pair is also formatted as an array. Its values should be a list of numbers that correspond to the metadata on the desired blocks for the desired resources. The order of the values here should be listed respectively to the order of the values in the “block” array.

    The final requirement to using the weighted system is the inclusion of a new pair given the name of “weight.” The value of this pair is formatted as an array, and should be a list of numbers that set the desired frequency of occurrence for each resource in the cluster. The order of the values here should be given respective to the resources listed in the values for “block” and “metadata.” The numbers given here do not appear to be an actual percent, as providing numbers that give a total which exceeds 100 does not cause errors. It is advised, though, to treat it as such.

    What this all means is that, for the example given, each cluster that spawns would contain a total of 15 blocks. 20% of those blocks would be Tinkers’ Construct Aluminum Gravel Ore, and 80% of those blocks would be Minecraft Gravel. Keep in mind, however, that this would be a perfect cluster spawn. The values provided are never a guarantee; invalid spawn locations will affect how much of the resource is able to be spawned.

    [​IMG]

    -------------

    Minecraft Internal Ore Names Cheat Sheet
    • The spreadsheet currently contains gems, ores, and special worldgen from the following mods:
      • Applied Energistics
      • Artifice
      • Big Reactors
      • Biomes O' Plenty
      • Chisel
      • Factorization
      • Forestry
      • Mekanism
      • Minecraft
      • Nether Ores
      • Professor Flaxbeard's Wondrous Steam Power
      • Project: Red
      • Railcraft
      • Thaumcraft
      • Thermal Expansion
      • Tinkers' Construct
    -------------
    Special thanks to contributors:
    -------------​

    The data from the Google Docs spreadsheet is also provided below, in this post. However, it may not be as up-to-date as the document.

    The data from the Minecraft Internal Ore Names Cheat Sheet will no longer be pasted here; it was making the post too long. Please use the Google Docs link at the top of the post.
     
    Last edited: Aug 31, 2014
  2. Golrith

    Golrith Over-Achiever Trusted User

    I haven't the answers, but here are my thoughts from looking at it:

    Template defines the spawning method, which in previous was NORMAL and UNIFORM. All ores apart from Lapis use UNIFORM (pretty pointless having a NORMAL system). NORMAL increases the chance of an ore at a specific level (so generation is more like /\, while UNIFORM is -- equal chance at all levels). I tend to use multiple entries for one ore with different densisties/spacing instead of relying on NORMAL.

    Block field appears to be a filter to specify what block is replaced. If you look, there's a rule for Nether Quartz, and that has an entry for Netherrack. So you could get quite fancy with generation (like for example custom generating Tinkers Gravel ores to only appear in gravel veins - note to self, that's damn good idea)

    numClusters is the same as previous. The number of clusters to generate. I don't know if the behaviour is the same as previous, as it was always the number of attempts. It picked a Y, if it was a valid co-ord, ores would spawn, otherwise it would add one to the cluster loop, and try again until hitting the cluster max.
     
  3. King Lemming

    King Lemming New Member

    Yup. Golrith has it.
     
  4. unknown zombie

    unknown zombie Well-Known Member

    Thanks for the answers! But one question remains.. How do I figure out what to put into the "block" field? I'm guessing it has to be the internal name for Mod X's ore block, but how do I find that out?

    Sent from my SAMSUNG-SGH-I337 using Tapatalk
     
  5. King Lemming

    King Lemming New Member

    There's no good way to know at this time, sorry. Will look into some sort of info dump.
     
    unknown zombie likes this.
  6. Gideonseymour

    Gideonseymour Relatable Gamer Trusted User Retired Staff

    I believe if you have Minetweaker 3 installed, there is a command for it.
     
    Kill-Joy, unknown zombie and Elec332 like this.
  7. Qazplm601

    Qazplm601 Lord of the Tumbleweeds

    /minetweaker names
     
    Elec332 and Gideonseymour like this.
  8. Golrith

    Golrith Over-Achiever Trusted User

    I've discovered that bspkr's core mod dumps out a complete list of block IDs. Found a txt file in my game folder, thought, hmm, what's that, and bingo, what looks like a complete list of IDs.
     
  9. unknown zombie

    unknown zombie Well-Known Member

    /minetweaker names is a bit cumbersome because it dumps almost every block. It won't work, though because it doesn't dump blocks that use meta-data. For example, it only lists TConstruct:GravelOre (iron ore gravel), and not TConstruct:GravelOre:1 (gold ore gravel), etc.

    You could get around this by filling your inventory with the blocks you're interested in and typing /minetweaker inventory; however, the output of that command doesn't give you the human-readable names of the blocks, so you end up having to cross-reference the list you have with which ores are in what inventory spots.

    But! I just discovered that pressing F3+H will add internal block names to the mouseover tooltip, the same way it added block/item id's to the tooltip in 1.6.4 days (which it also still does, fwiw). So people who don't want to use Minetweaker but are willing to do some note taking also have an option.
     
    Last edited: Aug 1, 2014
  10. unknown zombie

    unknown zombie Well-Known Member

    For anyone interested, here is a link to a google doc I've made that lists internal names for ores & gems added by Minecraft, Forestry, Nether Ores, Biomes O' Plenty, Tinkers' Construct, Project: Red, and Factorization.

    I'll add more mods to this quick reference as I get time and if the interest is high.

    I'll also edit the first post and try to paste all the info into that, and keep it updated, for people who don't like to click links on message boards.
     
    Last edited: Aug 1, 2014
    Golrith likes this.
  11. unknown zombie

    unknown zombie Well-Known Member

    Figured it out by testing.. Typing it like below causes ore gen to break completely. Making 3 separate entries for the different height levels is the way to go.

    A question, @King Lemming: If I wanted to make three valid height ranges to spawn copper ore, so that I can more finely control distribution, could I do something like this example below? Or should I create 3 totally separate entries for each individual height range? I'm curious after looking at the way default TE silver & lead spawns are written.

    Code:
    {
        "copper": {
            "template": "uniform",
            "block": "ThermalFoundation:Ore",
            "metadata": 0,
            "clusterSize": 6,
            "numClusters": [
               6,
               4,
               5
            ],
            "minHeight": [
               59,
               103,
               138
            ],
            "maxHeight": [
               76,
               127,
               157
            ],
            "retrogen": "true",
            "biomeRestriction": "none",
            "biomes": [
                "all"
            ],
            "dimensionRestriction": "blacklist",
            "dimensions": [
                -1,
                1
            ]
        }
    }
    
     
    Last edited: Aug 2, 2014
  12. unknown zombie

    unknown zombie Well-Known Member

    I played around with this for a while because it sounded like a great idea but, unfortunately, it doesn't really work well. To actually get any TCon gravel ores to spawn in gravel veins found in a landmass you have to crank the generation so high that it turns ocean floors and riverbeds into a complete farce.

    Here's a screenshot of the output of a one-chunk-sized quarry:
    [​IMG]
    That's 344 gravel -- none of it spawned any TConstruct gravel ores.

    Now, here's a screenshot of the bottom of the nearby ocean floor (view it full-sized for better detail):
    [​IMG]

    ...So much for that! :eek:
     
  13. Golrith

    Golrith Over-Achiever Trusted User

    What about changing the vanilla gravel to be like the silver/lead from TE?

    So you specify gravel and the various TC gravel ores, then work out a weight for the TC gravel ores. Thus each cluster of gravel generated has a chance of containing gravel ores? That wouldn't affect gravel generated by other means (such as sea beds).


    I was thinking something similar with ores (if Tabula Rasa updates, or an alternative block adding solution can be found).
    Generate a big cluster of an ore, but each block has a high chance of being a "poor ore", normal ore, or a tiny chance of a dense ore.
     
    Gideonseymour and unknown zombie like this.
  14. unknown zombie

    unknown zombie Well-Known Member

    Good idea.. I'll mess around with it some.
     
  15. unknown zombie

    unknown zombie Well-Known Member

    Well, that idea of yours worked out really well, and I'm glad.

    I liked the idea of gravel ore, but I couldn't stand the default method of presentation offered by TConstruct where you could find it sitting by itself on the grass right beside your spawn.

    I wanted to use it, but I wanted it to actually be mixed in with plain gravel if I did; and now it is -- without turning ocean floors and lake beds into a carnival.

    I think I've gotten my ore generation about where I want it. This is the result of a one-chunk-sized quarry from y=69 to bedrock:
    [​IMG]

    This is for the 1.7.10 version of a personal mod pack I'm making for my wife and myself to play, and I have to strike a very careful balance between what I want and what she will tolerate. We have very different goals in Minecraft so it can get tricky. She just wants to build stuff, and never even touches automation or machinery. I, however, want to make all the machines and automate everything.. But I want it to be a painful slog that drags out for months with scarce resources and hard recipes. She loses patience with that very quickly, though!

    The 1.6.4 mod pack I made for us had IC² and Gregtech in it. If you didn't know, IC² made tool creation a real pain in the ass because you had to use hammers and files and use metal plates (even I thought it was a bit much, tbh). She quit playing very quickly until I compromised by cheating her in a Thaumium pick with Repair X on it so she didn't have to make picks all the time. :p

    But, I digress..

    Now I have to start working on generation for Nether Ores. :eek:
     
    Last edited: Aug 4, 2014
    MigukNamja likes this.
  16. Golrith

    Golrith Over-Achiever Trusted User

    Sweet, can you share that config? I need to dive into the realms of custom ore gen too soon. I'm similar, I like resources to be scarce, so you have to make the best use of your materials to achieve your goals. Wasting resources hurts, but likewise, doing a dungeon raid and getting some gold and iron ingots is a nice reward instead of something you'd only bother taking if you had inventory space.
     
  17. Eyamaz

    Eyamaz New Member

    I was going to put out a tutorial video on how to use these until my pc exploded, but you can do the gravel seed easier by using the weighted system and some trickery. The weighted system can be found in the Thermal Foundation json. The trickery involves how you write the files.
     
  18. Golrith

    Golrith Over-Achiever Trusted User

    That's what unknown has done, manipulate the gravel entry with weighted gravel ores.
     
    Eyamaz likes this.
  19. trab

    trab New Member

    Easiest way I have found of getting the right item data for 1.7 is the NEI itempanel dump.

    Make sure you have nothing typed in the search panel and dump the whole lot.

    OR

    Use a search and/or item subset selections then make a dump of what you need.
    (Might be an idea to exclude facades or microblocks for example).

    Dump.png

    and yeah it would be interesting to see you gravel settings Unknown :)
     
    Ritt, unknown zombie and Golrith like this.
  20. Golrith

    Golrith Over-Achiever Trusted User

    I was wondering where to get the meta from. Just started tinkering with Minetweaker, and it's report function doesn't got to the level. I'll check out NEI.
     

Share This Page