Results 1 to 4 of 4

Thread: Caves via simulated lightning

  1. #1

    Default Caves via simulated lightning

    Using a Dielectric Breakdown Model -- essentially, simulated lightning -- produces some interesting-looking results.

    They're not very fancy, but might suit a lo-fi game like a roguelike. One nice feature is that they have no disconnected parts, because of the way they're grown.


    1) set the electrostatic potential along the bottom of a grid of cells to 1, and that of a "seed" cell at the top to 0;
    2) calculate the potential at every other cell in the grid;
    3) find all the cells which are adjacent to a seed cell;
    4) choose one of these cells randomly, with probability proportional to its electrostatic potential, and let it become another seed cell with potential 0;
    5) if the new cell is at the bottom of the image, or if you've added a pre-determined maximum number of new cells, stop; otherwise, goto 2.

    The collection of seed cells grows downward from the original seed cell, sending out random tendrils along the way, until it reaches the bottom, or you run out of cells to place. A parameter in the probability calculation changes the shape, making the pattern straighter or more radial (the probability that a cell in (3) becomes a seed is the nth power of its potential, divided by the sum of the nth powers of all their potentials -- if n = 1, you get normal-looking lightning, if n = 0.5 it's rounder, if n = 1.5 it's straighter). The potential can be found via a "relaxation" method for solving Laplace's equation.

    I just realized how mathy this has gotten, and now I doubt anyone would ever use this method, but if you're interested you can google some relevant terms and find more information. For everyone else, it's picture time!

    Actually, now I'm thinking this is just utterly stupid, but after spending all this time making this post, I can't bring myself to cancel it.

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	lightning.png 
Views:	69 
Size:	4.0 KB 
ID:	59171   Click image for larger version. 

Name:	lightning2.png 
Views:	57 
Size:	4.2 KB 
ID:	59172   Click image for larger version. 

Name:	lightning3.png 
Views:	50 
Size:	4.0 KB 
ID:	59173   Click image for larger version. 

Name:	lightning4.png 
Views:	55 
Size:	4.2 KB 
ID:	59174   Click image for larger version. 

Name:	lightning5.png 
Views:	39 
Size:	4.0 KB 
ID:	59175  

    My random map generators and GIMP scripts:

  2. #2


    Center-to-edges, instead of top-to-bottom.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	center.png 
Views:	46 
Size:	8.2 KB 
ID:	59177   Click image for larger version. 

Name:	center2.png 
Views:	41 
Size:	8.2 KB 
ID:	59178  
    My random map generators and GIMP scripts:

  3. #3
    Guild Artisan Falconius's Avatar
    Join Date
    Jul 2013


    The center to edge ones seem better for top down representation of a cave system while the edge to center ones seem better for vertical sectioning, looks a lot like what I'd expect water to do to porous weak rock.

  4. #4


    Even if they are a bit lo-fi, you could easily use these as a jumping off point. It could serve to give you some great inspiration and general backbone/shape to your cave complex.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts