Category: algorithms

Procedural Generation Using LSystems
Lindenmayer system (Lsystem) is a representation of how plants and some other biological structures grow. If we look at its text form, it is simply a sequence of simple characters called the initial state of the system. We also have a axiom (a rule) that defines what a particular character in initial string should be…

Poisson Disk Sampling
Poisson disk sampling is a technique for generating random points in the given space such that it ensures that points are distributed more evenly compared to purely random sampling, and it helps to avoid clustering or large gaps between points. The technique balances randomness with uniformity, making it suitable for procedural placement of trees in…

Simulating Hydraulic Erosion of Terrain
Hydraulic erosion is a naturebased algorithm that simulates erosion caused by water on terrain. It is useful to make procedurally generated terrains look more realistic & interesting. Hydraulic Erosion Overview Water from mountains come down through slopes, forming creases along the way. This water is then accumulated as is travels, causing the formations of streams.…

Noise Functions
In a Nutshell Noise functions of various kinds are used in game development to achieve variety of tasks. It includes making oceans, terrains, forests & vegetations and so on. This post discusses different kinds of noises, their implementation & uses. in nutshell following are the noises I’ll discuss today: 1. white noise 2. value noise…

Marching Cubes Algorithm
In a Nutshell Imagine that you have a 3D space having a color assigned to each point ranging from black to white. Now imagine that you take a reference color, for example grey; and call whatever is lighter than it to be “inside” and whatever darker than it to be “outside”. Now to enforce this separation,…

3D Procedural World Generation
In procedural geometry generation, we need two things: algorithms to define the shape & algorithms to construct it. Those algorithms that define the shapes are often based on perlin or simplex noise & other mathematical functions. These often take spatial values (xyz values) in its inputs & return the vertex displacement value. The other class…

Pathfinding Using A* Algorithm
In a Nutshell A* algorithm for finding shortest path is, in simple words same as Dijkstra algorithm with a slight difference. In dijkstra, the algorithm considers edge cost only to determine which node to jump next. In A* however, the algorithm also considers (in addition to edge cost) an estimated value of cost from current…

Pathfinding Using Dijkstra’s Algorithm
Today, you can use Dijkstra’s pathfinding algorithm to find the shortest path from the gate to cafeteria. After understanding what it is & how exactly it works, we’ll implement it using Python. Later, we’ll implement a more better variant of it called A* algorithm. But in this post, we’ll keep ourselves to Dijkstra algorithm. If you…