Results 1 to 6 of 6

Thread: Caves via simulated lightning

  1. #1
      isomage is offline
    Guild Journeyer isomage's Avatar
    Join Date
    Dec 2008
    Posts
    137

    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.

    Algorithm:

    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 Caves via simulated lightning-lightning.png   Caves via simulated lightning-lightning2.png   Caves via simulated lightning-lightning3.png   Caves via simulated lightning-lightning4.png   Caves via simulated lightning-lightning5.png  

    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  2. #2
      isomage is offline
    Guild Journeyer isomage's Avatar
    Join Date
    Dec 2008
    Posts
    137

    Default

    Center-to-edges, instead of top-to-bottom.
    Attached Thumbnails Attached Thumbnails Caves via simulated lightning-center.png   Caves via simulated lightning-center2.png  
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  3. #3
      Falconius is offline
    Guild Artisan Falconius's Avatar
    Join Date
    Jul 2013
    Location
    Israel
    Posts
    501

    Default

    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
    Guild Novice
    Join Date
    Oct 2013
    Posts
    7

    Default

    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.

  5. #5
      isomage is offline
    Guild Journeyer isomage's Avatar
    Join Date
    Dec 2008
    Posts
    137

    Default

    Invasion percolation gives decent results and is much faster.
    Attached Thumbnails Attached Thumbnails Caves via simulated lightning-cave.png  
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  6. #6
      isomage is offline
    Guild Journeyer isomage's Avatar
    Join Date
    Dec 2008
    Posts
    137

    Default

    Hexy invasion percolation, with and without automatic removal of small interior hex clusters to make it more cavernous.
    Attached Thumbnails Attached Thumbnails Caves via simulated lightning-cave2.png   Caves via simulated lightning-cave1.png  
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

Posting Permissions

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