procedural generation
107 subscribers
4.55K photos
1.35K videos
2 files
9.98K links
Created by @r_channels
Download Telegram
Dead simple but effective (fake) water erosion algorithm

​

https://i.redd.it/cezs1vc6h5wb1.gif

I'm working on water streams for the forest terrain in my game. (In the GIF above the terrain is shown without trees or grass.) The streams were not looking natural, especially running down slopes in fairly straight lines.

I had noticed in references that water rarely goes down a straight slope, but rather does it in jumps and waterfalls. So I wanted to add randomness to the height of the sloped path, but the height would have to stay monotonically decreasing.

So changed the height of each point (they're spaced a few meters apart) to a random height between its own height and the height of the next point.

Doing this once helps a tiny bit, but I then did this 10 times in a row, using the same seed for the randomness each time, so the same points get lowered the least and most in each iteration.

I think this really helped a ton. You could say the random numbers (which stay the same in each iteration) is a really crude simulation of the ground being harder to erode in some spots than others, so it produces roughly similar results.

The nice thing here is that the algorithm is extremely fast as it operates on 1D data, not 2D or 3D terrain data. It's also useful if you don't want to change the route of the water, only the height, since that is all it does.

To be clear, the terrain changing around the water is not based on any erosion simulation on the terrain data itself. I am simply using deformation that makes the terrain close to the water smoothly match the height of the water. This was the case before I implemented the simple water erosion too. Only, once the water path is lowered in some places, this terrain deformation lowers the nearby terrain again, and the result kind of looks like the water eroded the terrain around it. It's simply a neat side effect!

You can see a first-person video of the water stream on Mastodon here:

https://mastodon.gamedev.place/@runevision/111289842235060360

https://redd.it/17fcrk9
@proceduralgeneration
Extended submission deadline — EvoMUSART 2024 conference

Hey Folks, 👋

Good news! The submission deadline of evoMUSART 2024 has been extended to November 15th! 🙌

You still have time to submit your work to the 13th International Conference on Artificial Intelligence in Music, Sound, Art and Design (evoMUSART).

If you work with Artificial Intelligence techniques applied to visual art, music, sound synthesis, architecture, video, poetry, design, or other creative tasks, don't miss the opportunity to submit your work to evoMUSART.

EvoMUSART 2024 will be held in Aberystwyth, Wales, UK, between 3 and 5 April 2024. 🏴󠁧󠁢󠁷󠁬󠁳󠁿

For more information, visit the conference webpage: https://www.evostar.org/2024/evomusart


​

https://preview.redd.it/2cf8knsfrrwb1.png?width=1000&format=png&auto=webp&s=24c218e8ab229725c5497d2accee7f7a5a53c3ad

https://redd.it/17hr0jq
@proceduralgeneration
Guidance for a newb: Branching paths built of tiles that must meet at Important Points/Tiles

I've been hearing great things about this sub and after a decent amount of lurking, I've got to say I'm blown away by all the cool developments going on.

Even as someone without a CS background, I've found the various techniques fascinating and so full of potential that I've wanted to try to implement it in a project I've been working on for some months now.

However, with all the resources out here, I'm having difficulty narrowing in on a specific method that would be applicable for my use-case, not to mention something that my skill level (\~3 years experience on & off in C#/Unity development) could work through / modify / expand upon . I've created some tests to generate maps (including a very simple WFC), and though it's cool to see it build a little map using basic test tiles, I'm lost on how to build it to take into consideration my main goals.

With that in mind, I'd appreciate some pointers on what I should look into to effectively implement procedural generation to built stages for my project. (e.g. is WFC the way to go for this? If so, how do I ensure it branches out & builds paths based on my rules? If, not is there a better technique to use?)

Thanks in advance!

​

Mediocre diagrams to (hopefully) help describe what I'm building:

Left side: Magnification of example of first branch. \(Map is 3D so included different perspectives to show the layers\). Right Side: Overview of game's major branches, decision points, stages, etc.

Key Details + Constraints:

Player Movement: The player can control movement along the x and y axes, however they're always going forward on the z-axis (with some wiggle room of being able to turn within 45 degrees of Z-forward).

Game Progression: See World Map image \- the player starts at Stage A (bottom) and will traverse through paths/tunnels until they reach Stage M. Along the way there are challenges/decision points where the player chooses which path to take to continue to progress / discover new areas. As you can see the world begins with very few branches, but branches out until the mid-point. Then the branches merge more and more until the end point.

Decisions Points (orange diamond): Branches always split /converge at the predefined Decision Points. These decision points are hand-crafted areas that generally remain the same through each play through.

Transition points (Green box): Indicate where there's a change in environment / movement from one stage to the next. I'm hoping to have a seamless transition, however that will require more play-testing.

Paths: When you zoom into a branch (red dotted line on the world map), you will see that the branch is actually made up of a collection of paths with the same starting and end points (see Branch Magnified diagrams).

\- These paths are made up of a bunch of pre-built tiles in 3D space. Sometimes there will only be one path that splits off and then splits off again, but then merges together before the next Decision or Transition Point.

\- Paths can never do a U-turn. Generally, the angle should be within 45 degrees of the Z-Forward direction

\- Paths cannot be dead-ends. They must lead to the next key decision or transition point.

Goals:

1) Populate the Transition and Decision point tiles \- connections between each of these will be predefined (e.g. The first transition tile in Stage A must lead to the first Decision Point in Stage A. In turn, this Decision Point must connect to the second Decision Point as well as branch out to rightmost Transition Point in Stage A).

2) Propagate 3D tiles starting from the Decision and Transition points based on the predefined connections to create. (no dead-ends,u-turns, and always lead to the next Transition or Decision Point)

3) (Goal for later) Populate the 3D tiles according to Stage objectives/player decisions
How does this pattern emerge from primes? Concentric circles? Details below

​

To produce this pattern I was playing around with the DFT of various functions, taking 2D input. adjusting for scale, function X\) x\[i\ = 350* cos\(primes[i\]*angle\), function Y: y[i\] = 350* sin\(primes[i\]*angle\). n_primes = 40000. primes is just a list of primes.](https://preview.redd.it/xmk0pt5ndizb1.png?width=979&format=png&auto=webp&s=59e1c71f0854a52786701b6d03d1bf7c9ea4cad9)

Looking to improve my implementation for this. For now, anyone else notice what appear to be vortex rings? Seems way too geometric. Is there anything useful to be found from this? Can't seem to find similar pictures online.

Also, anything special about the number of points forming around the perimeter?

Happy crafting!

https://redd.it/17s2glp
@proceduralgeneration
How would I generate a terraria-like terrain in python?

I'm making a game for a school project and I was wondering how you'd go about making a terraria like terrain (not necessarily with chasms). Would perlin noise be the best way of doing this? The player of the game also needs to be able to place blocks or materials in the same way you would in terraria or minecraft.

Thanks in advance

​

https://redd.it/18ap6kk
@proceduralgeneration
Sphere texturing for planet generation

​

Mesh smoothing \/ non-uniformly sampled sphere, created using Matlab

Hello, this is my first post regarding procedural generation though I've observed and learned from a lot of amazing posts on this subreddit. One of my interests is different mathematical approaches for texturing a sphere (I'm not an expert I just dabble - mostly in Matlab).

A common method people use to texture a sphere is to sample Perlin or Simplex noise on the sphere surface. The images above were generated via an alternate method: randomly sampling points over a sphere and using connections between adjacent points defined by the convex hull to create a large and sparse system of equations. Noise was added and then the system of equations was solved to find the least-squares solution that would fit the "observations" of noise simultaneously constrained by a regularizer that determined the smoothness of the result. There is additional tweaking applied to each of the planets & moons above. The code for generation of these is very short and should be pretty easy to follow, you can find an example here: https://www.mathworks.com/matlabcentral/communitycontests/contests/6/entries/15522 and here: https://www.mathworks.com/matlabcentral/communitycontests/contests/6/entries/16129, some recent entries I made for a contest that is now over. The video below is similar to the gif created by the code in the first link, but with better texture, created using a random sphere.

Planet with swirling clouds

The clouds especially may look a bit artifacty but please keep in mind they are being visualized in Matlab - which has shockingly powerful tools for data visualization, but it is still not Unity. Also, I am sure I'm not doing things optimally in Matlab, either. At any rate, hopefully the code should be easy to follow for surface generation, creation of the cloud swirls, etc.

https://redd.it/18e76fj
@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! :)


​

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




Rocky Formations, etc...

https://redd.it/18sljn1
@proceduralgeneration
Help with river generation

I'm trying to generate some rivers for my island, but I'm getting not very good results. I don't want to simulate erosion and rainfall and would like to just create a wiggly path that somewhat looks like a river.

Initially, I was using this algorithm, as, at first glance, it seemed to yield some good results while being relatively fast. However, I've run into some problems.

If the stars align and the source and endpoints are in a good position, it actually looks great:

​

https://preview.redd.it/hq179wuusbgc1.png?width=529&format=png&auto=webp&s=b9794336ee7ecd644e536a28d33666398af31cb1

But, if they are at the same level, it becomes a weird-looking straight line:

​

https://preview.redd.it/rhtf4pr0tbgc1.png?width=1238&format=png&auto=webp&s=de746169e7b2f36ab0022c45f983dfb98834d1ca

What do you guys suggest I could do? I thought about A*, but won't it always make the shortest path to the source point? So, always a straight line?

https://redd.it/1ahqykr
@proceduralgeneration
A python script to demonstrate how to mimic river meanders and oxbows formation

​

https://reddit.com/link/1alb19r/video/hhyycqe0s7hc1/player

https://redd.it/1alb19r
@proceduralgeneration
Advice on Procedural Generation Methods

I've been tinkering around with procedural generation for my game for the last few months on and off in my free time. My basic goal was to have a map of n islands separated by sea. Currently, I've got a fairly trivial setup:

1. Generate a heightmap using simplex noise.
2. Apply a shaping function (square bump) to the heightmap to give the shape of an island in a given area.
3. Set the cells based on their resulting altitudes.
4. Repeat this process in different areas of the map.

The issues I'm running into involve improving the generation with more advanced features, some of which are as follows:

Biomes (and biome blending) - with my current setup I'm not sure how to best achieve this. I can add in another simplex map but applying that (even with low octaves) may look somewhat unnatural when spread across the whole world (cutting through different islands) etc.
Feature areas (related to biomes) - How can I identify (and even place) things like lakes, rivers, and areas with heightened difficulty? Anything that may have distinct features/properties (different fish types in lakes/rivers, harder enemies in certain areas, etc.)

If anyone has any tips on how I can improve upon my current approach, or if I should switch over to something like Voronoi or a different combination of algorithms, I would appreciate any help from those who are more experienced than me in this space. Thank in advance.

​

https://redd.it/1at27rp
@proceduralgeneration