# Little Drill Miner Guide

I decided to make one complex guide on all of the stuff I used in LDM(Little Drill Miner). And I highly recommend to read my article about LDM, if you haven’t read it.

# Perlin noise

Obviously, you can use it in greatly many different variations. As a more natural random, than normal random, as a heightmap, quantize, not quantize, multiply, divide, transform. Just use your imagination!

I use it for ores and sandstone. In my case, I just simply scale it by multiplying(dividing) coords and quantize by given threshold.

# Cellular automaton

Data scientists have made a “halo of difficulty” around it, but in the core sense it is very simple.

Interesting and not too hard guide about cellular automatons — link. You need only 7.1 and 7.2, the rest is not necessary, but great for understanding what is going on.

I use cellular automaton to make caves. Rule: if lower than 4 — dead, if upper or same — alive. Iterations: 5. Threshold of random: 67 of 100.

# Roots

Maybe it isn’t the most difficult, but most complex part of LDM.

It is a recursive algorithm. The root is made from sections. Every section has a length and a thickness. The first section is the longest and the thickest, however the last is the thinnest and the shortest. I just scale it within the algorithm.

When the section is created I make another one with small random angle shift. When the length of the section is lower than configured threshold, recursion ends.

After the main root has been created, I create an additional branches. After every section I create just another root with big random angle.

For drawing sections I use an algorithm called DDA. I haven’t found cool guides on it, so this may be the best one — link. I cut the section on an array of vectors.

Funny story with this algorithm. I invented it myself. And a month after I created roots geo, I open Reddit and see the algorithm with a “halo of difficulty”(very scientific), open it. And that’s it! It turns out it’s called DDA — Digital Differential Analyzer. OMG! Why so difficult? It’s a very simple algorithm. So I called it just Chopper for myself. Thus, not everything that has difficult name is really so difficult.

Returning to our roots I’ll say that DDA gave us array of points in the section and now we need to draw it. To do it I use *double for* with *if*,* *where I check if the point is in range(thickness) of the root section. If is, I draw it a tile. To check it we just use a simple math with Pythagorean theorem.

# Point

Also in my project I use just point random generation for Amber, but I think that I don’t need to explain what is it. You just generate random point and place there an object.

It is all at the moment. I’ve said about everything interesting for you in my project. When I would make something new, I will notify you.