procedural generation
121 subscribers
4.9K photos
1.43K videos
2 files
10.4K links
Created by @r_channels
Download Telegram
Wake up babe, 21 of the 97,000,000 proc gen races just dropped
https://redd.it/18r9m5j
@proceduralgeneration
consistently distort voronoi edges

I am creating an endless voronoi city using threejs. So far, all i can calculate is whether a given vertex is a road or a city block. it looks like this:

https://preview.redd.it/df3g159ios8c1.png?width=1447&format=png&auto=webp&s=7bed235e081f49d6510e066b6e2f37b81a1ffec3

i want to distort the roads using perlin noise, so they are windy rather than straight. However, when i try to do this (by adding a perlin noise generated value to the x and y of currentVertex), it seems to mess up the road width. I need the road width to stay consistent.

Here is my script. What is the best way to make my roads curvy?

export const getVertexData = (x: number, y: number) => {
const gridSize = 300;
const roadWidth = 20;
const currentGrid = Math.floor(x / gridSize), Math.floor(y / gridSize);
var points = ;

for (let ix = currentGrid0 - 1; ix <= currentGrid0 + 1; ix++) {
for (let iy = currentGrid1 - 1; iy <= currentGrid1 + 1; iy++) {
var pointX = math.seedrand(ix + "X" + iy);
var pointY = math.seedrand(ix + "Y" + iy);
var point = new THREE.Vector3(
(ix + pointX) gridSize,
(iy + pointY)
gridSize,
0
);
points.push(point);
}
}

var currentVertex = new THREE.Vector3(x, y, 0);
points.sort((a, b) => {
var distanceA = currentVertex.distanceTo(new THREE.Vector3(a.x, a.y, 0));
var distanceB = currentVertex.distanceTo(new THREE.Vector3(b.x, b.y, 0));

return distanceA - distanceB;
});
var closest = points0;

for (
let ix = currentVertex.x - roadWidth;
ix < currentVertex.x + roadWidth;
ix += roadWidth
) {
for (
let iy = currentVertex.y - roadWidth;
iy < currentVertex.y + roadWidth;
iy += roadWidth
) {
var nearbyVertex = new THREE.Vector3(ix, iy, 0);
points.sort((a, b) => {
var distanceA = nearbyVertex.distanceTo(new THREE.Vector3(a.x, a.y, 0));
var distanceB = nearbyVertex.distanceTo(new THREE.Vector3(b.x, b.y, 0));

return distanceA - distanceB;
});
var neighborClosest = points0;

if (closest != neighborClosest) return "road";
}
}

return "block";
};

Edit: while noise-based curvature is preferred, if it's way easier to curve the roads with a sine wave rather than perlin noise, i am open to that option as well.

https://redd.it/18rvlf0
@proceduralgeneration
Beginnings of my procedural dungeon generator. What do you think?
https://redd.it/18r18i2
@proceduralgeneration
Can we consider AI-assisted game designing as a part of PCG?

I am currently working on a review paper related to Procedural Content Generation. When I was reading research papers, I came up with AI-assisted game design as a different topic from the PCG. The term PCG refers to using algorithms to create content, either semi-automatically or automatically. AI-assisted game design also aids designers in creating game content such as levels, items, and so on. So, can it also be considered a component of PCG, especially since there is a sub-field of PCG called mixed-initiative/Co-creation?

Please note that I'm a beginner in this field.

https://redd.it/18r6d8n
@proceduralgeneration
How could you create very abstract and ever-changing terrain?

I've been experimenting with procedurally generated terrain in Roblox, specifically with modifying 3D Perlin noise. While I've managed to create a variety of terrains, from abstract to realistic, I'm facing a challenge.

The issue is that the generated terrain tends to look quite similar across the map due to the inherent characteristics of Perlin noise. I'm on a quest to achieve something more extraordinary – a terrain that becomes increasingly bizarre and otherworldly the further you travel, almost like stepping into another dimension. Something that always looks different and unique.

Is it simply a matter of adding more noise layers, with varying levels of amplitude and frequency, or are there other methods to break away from the Perlin noise predictability and achieve that mind-bending, alien, or and almost inter dimensional effect?

https://redd.it/18tu9y3
@proceduralgeneration
This media is not supported in your browser
VIEW IN TELEGRAM
Realistic Ocean Simulation Week 10: Generated normal maps and ocean mesh. Currently, running DFT with 16284 distinct frequencies (Small amount).
https://redd.it/18t48no
@proceduralgeneration
Games with a lot of procedural content

Hi! Is any games that generates a lot of content procedurally? Not only map or dungeons. I mean random/procedural NPCs, divines, mythology, lore, quests, races, etc.
I know, Dwarf Fortress and Wizards and Warlords can do some of that.

https://redd.it/18w5h0j
@proceduralgeneration
What algorithm would work best for rigid stepped elevations, while having smooth portions.

Wow, that's a long title! But it basically describes exactly what I'm looking for. I had previously been using fractal noise with octaves in order to create terrain, and this worked very well for things such as large "relatively smooth / flat" areas of land mass.


However I am wondering what algorithm would work best to incorporate rocky formations or ridges on top of these smooth portions. Sort of like a step elevation.

Below are a few pictures which represent what I'm attempting to achieve. Thanks for your time! :)


&#x200B;

Ridges and a sort of \\"step\\" elevation




Rocky Formations, etc...

https://redd.it/18sljn1
@proceduralgeneration
more voronoi trouble...why are some cell walls not extending to their circumcenter?

if you have seen some of my other posts, you know i am working on developing a voronoi based city using threejs. I am taking a different approach now, utilizing the [delaunator npm package](https://github.com/mapbox/delaunator) to detect circumcenters, and then connect them to form the cell walls.

i have spent all day trying to figure out why some of these walls are not reaching their end points (see image below)

https://preview.redd.it/lhfb5807jy8c1.png?width=1615&format=png&auto=webp&s=f0a5e33b4731558ba6ca69fe4916d3a04cd003e7

here is my script. any ideas what is causing this problem? thank you

import Delaunator from "delaunator";
import * as THREE from "three";
import { _math } from "../_/math";

export const getVertexData = (x: number, y: number) => {
const gridSize = 100; //500?
const roadWidth = 5;
const currentGrid = [Math.floor(x / gridSize), Math.floor(y / gridSize)];
var points = [];

for (let ix = currentGrid[0] - 1; ix <= currentGrid[0] + 1; ix++) {
for (let iy = currentGrid[1] - 1; iy <= currentGrid[1] + 1; iy++) {
var pointX = _math.seed_rand(ix + "X" + iy);
var pointY = _math.seed_rand(ix + "Y" + iy);
var point = new THREE.Vector3(
(ix + pointX) * gridSize,
(iy + pointY) * gridSize,
0
);
points.push(point);
}
}

var currentVertex = new THREE.Vector3(x, y, 0);
const delaunay = Delaunator.from(points.map((point) => [point.x, point.y]));

const circumcenters = [];
for (let i = 0; i < delaunay.triangles.length; i += 3) {
const a = points[delaunay.triangles[i]];
const b = points[delaunay.triangles[i + 1]];
const c = points[delaunay.triangles[i + 2]];

const ad = a.x * a.x + a.y * a.y;
const bd = b.x * b.x + b.y * b.y;
const cd = c.x * c.x + c.y * c.y;
const D = 2 * (a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y));
const circumcenter = new THREE.Vector3(
(1 / D) * (ad * (b.y - c.y) + bd * (c.y - a.y) + cd * (a.y - b.y)),
(1 / D) * (ad * (c.x - b.x) + bd * (a.x - c.x) + cd * (b.x - a.x)),
0
);

circumcenters.push(circumcenter);
}

const voronoiWalls = [];
for (let i = 0; i < delaunay.halfedges.length; i++) {
const edge = delaunay.halfedges[i];

if (edge !== -1) {
const v1 = circumcenters[Math.floor(i / 3)];
const v2 = circumcenters[Math.floor(edge / 3)];

if (v1 && v2) voronoiWalls.push(new THREE.Line3(v1, v2));
}
}

for (let i = 0; i < voronoiWalls.length; i++) {
var closestPoint = new THREE.Vector3(0, 0, 0);
voronoiWalls[i].closestPointToPoint(currentVertex, true, closestPoint);
if (currentVertex.distanceTo(closestPoint) <= roadWidth) return "road";
}

return "block";
};

Edit: i have confirmed that the circumcenters are in the correct spots. i think this may have something to do with the voronoiWall calculations...having a bit of trouble understanding the delaunator plugin. Here are the docs i've been trying to follow: [https://mapbox.github.io/delaunator/#incoming-edge-index](https://mapbox.github.io/delaunator/#incoming-edge-index)

https://redd.it/18sk7jv
@proceduralgeneration