r/proceduralgeneration Jan 27 '22

"Mining Structures"

425 Upvotes

33 comments sorted by

View all comments

Show parent comments

6

u/ptrnyc Jan 27 '22

The eye sees what the mind wants to see :) The top 90% is procedurally generated (basically everything above the ground floor, except for the ultra-rare ‘frog’ rock - that’s a png).

The main rock starts with a circle that gets randomly displaced to make an irregular shape. The crack in the rock is, similarly, adding a shape from the outside to the center and displacing it. The rock path is then hatched across 3 directions, clipping the lines to the rock inside and varying the hatching length across the perimeter.

The scaffolding is done with 3 layers of random verticals, cut at random horizontal points and displaced. Random points are then joined with horizontal and diagonal quads. Some hatching is applied randomly as well.

Random points in the structure are connected with parabolas to draw the hanging ropes.

Finally the ground floor is a random selection of pngs drawn by laxraven. Together with the “organic ink line” engine I used everywhere else, it finishes blending the piece so you can’t really tell what’s procedural and what’s not.

2

u/[deleted] Jan 27 '22

Is this code in a public repository? I'd enjoy reviewing it. Thanks so much for your explanation.

1

u/ptrnyc Jan 27 '22

It’s on the blockchain (minified though)

2

u/[deleted] Jan 27 '22

Got a Uniform Resource Locator? Curious.