Please help me figure out how to get substitution to work....
GIVE ME AN EXAMPLE. Nothing is clear to me at this point.
Here's a full example of several types of distribution, including changing mountains from stone to dirt, deepening dirt to level 50, removing all water, and turning the ground in levels 60-80 to glass.
Each distribution has a different group of settings, so I hope this provides you the examples you need to make sense of the Substitution distribution.
Additionally, by "Sprocket," I was referring to a utility I wrote that takes a simple INI-style file, and generates a full, working XML file, so you don't have to do all the heavy lifting. You can find it here. Oh, and here's the INI file I used to generate the above Substitution Test file.
Oh, and if you use the water-removal config in the above test file, be prepared to wait a while; the world creation can take some time (It took me 10 minutes to generate a world using all Substitution tests enabled...the result produced a truly alien world.), because all air will be turned to water before it is turned back into air... All the way from level 0 to 255
<Substitute name = 'fig 10' block='stone' maxHeight='64'>
Figure 1: This replaces any block that isn't water into stone. This is so that I can generate caves within stone blocks without having interference with other blocks.
Figure 2: This replaces any block below y 50 that is air into stone. (To avoid replacing air with stone above ground.)
Figure 3: This replaces any gravel into dirt (So that when the cave veins are generated, they don't cut through into the ocean, making a water opening).
Figure 4: This replaces water with stone below y 30. I still find water underground and I don't know why. But it's very rare.
This is a cave vein which is a motherlode that spawns around 45y give or take a few blocks. The size of branches are around 137 blocks long, with a slight angle and pitch variance. I'm not sure if their pitch or angle even matters, or inclination. They affect the branching FROM the point of the motherlode origin rather than the curvature of the vein.
Chance per chunk is 3-4%. This is because the length of branches can cross 3-7 chunks. 3-4% is between 1/20 and 1/30 chance to spawn. If you take the cross potential as a radius, that's a 14x14 area a motherlode can cover max. 14x14, with a branch's maximum reach of 7 chunks is 1/28 chance in 14x14 chunks.
Take that, and add another 1/28 per amount of branches, and every chunk you come across will have a 10% chance of containing a vein (At it's average height). 3-4% chance to spawn could be toned down slightly, but odds of vein crisscross are very very low below 10% chance.
.008% of blocks are clay instead of air. This is supposed to let me know which vein is which.
Segment Radius is 1.7. This is a comfortable size for caves. Although the walls, ceiling, and ground contain distortion/noise meaning that the ragged edges stick out. (Stone gets in the way and is an obstacle, or Air pokes down oddly and you fall into a 1x1x1 gap, and is an obstacle. :P)
The position of this cave branching is around y36 with a range of 13. I like this to have a potential placement near the figure 5 setup so that I have bulky cave nodes that collide with the skinnier ones, leading up away from the lower veins.
Segment Radius is 2.2 with a range of 0.2. I want these noticeable bulkier than the skinnier veins.
8% chance dirt is placed instead of air for being able to spot this vein. These will obviously be removed later on.
Chance to spawn: 3.2%. This vein has a smaller branch length, meaning it would be around 5% chance per chunk to contain it's branches. I want this simply because of the slight difference in vein size, and I don't want it to create too much empty space making spotting of ore distribution types so obvious, you could mine through walls of caves into the next cave wall and so on.
This is another skinny cave branch distribution. The spawn height is 43 with a range of 7. So it's as low as 36 up to 50. Height limit could be changed. If it's kept to 30, and a motherlode is spawned at 50, that's a potential for a branch to reach into stone blocks that exist above 65y (Hills).
7% spawn chance. More frequent than Fig 5's chance, however this is across the 36-50y spawn gap, so it can collide with fig 5's often enough to make diverse cave intersections and cool nodes to mine inside as a player.
About the same as Figure 7, with NORMAL type.
These are generated around y13. Height limited to 15 per branch deviation. So at most, a branch can reach up into 30y.
Spawn chance 5%. Low height spawns. Yay.
The reason I have 4 or 5 different vein distributions like this instead of just one with a totaled chance from these veins, is because I want to segregate motherlode position and branching angle/pitch/length characteristics. For instance, Crisscross between different vein types, and then have those particular vein distributions contain child veins that can occur as a result.
This turns all the dirt that was gravel into stone so that after caves have been generated, they are encapsulated by what was gravel before under the ocean. (I changed this before I corrected the dirt spawn in figure 6.
I found kind of a hacky way to get something to generate 'near' a specific block.
What I've noticed so far, is that if you generate a distribution, or at least try, if it contains a child, it MUST have removed at least one block before the child can be generated, or else the generation is skipped. That is what I'm assuming.
If you want to generate near the surface of dirt at any level where the dirt touches sunlight, you can try:
<Replaces block='grass'/> <- There is the key!
<ChildDistribution block='target block near grass'>
//The height of this distribution may matter, because if height is ignored, you could replace stone near bedrock instead of near the grass block.
//This is why I make multiple of the same sort of thing, but require the parent type to define it's specific height's too.
Easy enough I guess. You could use something like this to spawn near certain ores just by making the parent type remove and replace that specific ore. It's frequency of generation for the ore could be 1 per chunk, however if there is more than one of that ore in the chunk, find a way to encapsulate the parent to avoid making the frequency higher than your cpu can handle, but the child distribution can certainly be specified.
Oh also, nothin quite like spiky ellipsoid quartz deposits