Questions tagged [procedural-generation]

Programmatic generation of content (graphics, sounds, level-design,...) using random or pseudo-random processes, usually on the fly.

535 questions
2
votes
2 answers

Rectangle overlapping in Java

I'm trying to make a random map generator. It should create a random sized rooms at random coordinates, and remove the room it it overlaps with other rooms. However, the overlap checking isn't working. Here are the relevant parts of code: public…
bunjo
  • 23
  • 2
2
votes
0 answers

Calculating UV coordinates during mesh extrusion

I'm currently implementing a mesh extrusion algorithm for plane shapes, let's assume for a rectangle. When I extrude this rectangle I create four new sides (resulting in 8 new triangles) and a new bottom for the 3d shape. This works fine when I…
padmalcom
  • 1,156
  • 3
  • 16
  • 30
2
votes
3 answers

Fall-off function for mountains

I am writing mincraft-like game with voxel terrain. For mountains, I specify a location, a height and size. There is a function to return True if the block at the current (x, y, z) coordinate is part of a mountain. If a block is far away from the…
kCODINGeroo
  • 443
  • 4
  • 13
2
votes
2 answers

How make a Sine wave generator in Unity?

I want to create a Sine Wave generated from a unit circle in Unity whose amplitude and frequency can be dynamically changed by changing the speed and radius of the circle. Ex: The result should look something like this(see pictures below) where one…
2
votes
1 answer

Perlin Noise getting wrong values in Y axis (C++)

Issue I'm trying to implement the Perlin Noise algorithm in 2D with a single octave with a size of 16x16. I'm using this as heightmap data for a terrain, however it only seems to work in one axis. Whenever the sample point moves to a new Y section…
Strawie
  • 143
  • 8
2
votes
2 answers

Generating a dungeon with the given tileset with different sizes

I have a tileset with some tiles and should to generate a dungeon from it. It should be dungeon with one entrance point, one bossfight (exit point within) with three or four ways that can connect each other or not. Looks like this, with one start…
2
votes
1 answer

OpenSimplex and PyQt5: Why is my function taking so long?

I am trying to implement Simplex Noise using PyQt5 and Python to create Proceduraly Generated Height maps for simulation purposes. I have chosen PyQt5 because that is the GUI I am most familiar with. Here is my code for the Height Map Generation…
2
votes
1 answer

Making a customizable LCG that travels backward and forward

How would i go about making an LCG (type of pseudo random number generator) travel in both directions? I know that travelling forward is (a*x+c)%m but how would i be able to reverse it? I am using this so i can store the seed at the position of the…
2
votes
1 answer

Unity Surface Shader - Runtime UV mapping

I want to map a 2D Texture onto a procedurally generated plane, using vertex local position, in Unity. This is the code: Shader "Custom/planeTest" { Properties { _MainTex("Albedo (RGB)", 2D) = "white" {} _Scale("Scale of texture", Vector) =…
2
votes
1 answer

mystery "rnorm" function terrain generation javascript - what is this doing?

Question: What in the world is this piece of code doing? Also: Is the way 'w' is being used some sort of existing algorithm? I'm trying to figure out the intent of the function, or at least describe what sorts of numbers it produces. Context: I'm…
2
votes
0 answers

Unity3D - Starting multiplayer architecture

I am working on a new 3d game based on a 2D tiled map. After developing the most basic features (procedural map generation, and player movement) i want to make it work in multiplayer. I have read the whole HLAPI documentation and I have done twice…
2
votes
0 answers

Procedural extrude of mesh problems

I'm trying out some procedural mesh extrusion but I've got two problems at the moment. The code that performs the extrusion is a part of a Unity example package, and is available here (MeshExtrusion.cs) First problem is that the update to the mesh…
Tony
  • 3,587
  • 8
  • 44
  • 77
2
votes
1 answer

How are infinite worlds stored and restored?

I'm trying to write a 2D game with an infinite world in Unity. It should be like Terraria except "infinite" in every direction. So chunks are generated, stored and loaded on the go as the player moves. My question is: how are chunks stored and later…
H. Saleh
  • 554
  • 1
  • 5
  • 19
2
votes
1 answer

Procedural maze remove old colliders

I followed a tutorial on making a procedural generated maze in unity using C# that when you click the mouse button, it generates a new maze. However, when I generate a new maze everything looks right but the MeshCollider for the old maze mesh is…
2
votes
1 answer

Random seed for Simplex noise

I'm procedurally generating terrain for games. I gave Simplex noise a shot. The terrain is generated beautifully. However, when I run the program multiple times, the terrain is the exact same. How to randomize the Simplex noise? from opensimplex…
Keto Z
  • 49
  • 1
  • 7