_id
int64
0
49
text
stringlengths
71
4.19k
5
How to make non standard sized zones for a procedurally generated 2d map? I am making a procedurally generated map with different zones (plains, forest, village, etc) and am currently just designing each one as a square zone. However, I think it'd be neat if the zones were more randomly distributed so that they could be irregular sizes. I'm not sure how to do that in a good way. (Any given tile needs to know what zone it belongs to quickly and deterministically based on its x, y, and random seed for the world) Are there existing algorithms for this?
5
How do I do random isometric paths? I'm working on an isometric city generator, and I am looking for a little push in the right direction. I'm looking to randomly generate roads on an isometric plane. I have never done path making before, and I've Googled it and didn't find any articles relating to what I am trying to do. Basically, my program generates a random isometric city and I am hoping to add roads to that.
5
Mix of Procedural and Manual level design creation in UE4 I'm trying to design a maze using a mix of procedural and manual generation. I have the maze already generated and would like to place other objects in the maze manually in the editor. The issue is the maze object is created on BeginPlay and so I'm unable to view it in the Editor itself while dragging the object to the Outliner. Any suggestions? I'm thinking of doing something in the Construction Script or the object Constructor but not not sure if that would be the way to go. I'm still getting familiar with the Engine code base and only have a little experience in Maya or Blender since I'm a programmer.
5
Procedural 3D Environment Generation I am concerning a 3D Scroller game which is like Subway Surf or Temple Run. The thing I am confused about is their way of generating 3D environment. For example for 2D games like Flappy Bird, there is a camera and player which have fixed positions respect to the X axis. And the environment is being generated, moved into camera's viewport, and finally gets destroyed after getting out of viewport. I mean, player and camera does not move in general, the environment does. Is this approach efficient by means of performance for 3D scrollers? Do they use a box which covers the camera's viewport, and when objects get out of the box, destroy them? Or do they create the environment via code as the player goes further, then make the camera follow the player and they are moving both? Is this a valid approach and what are the advantages or disadvantages of these implementations? Thanks in advance!
5
3D terrain generation with overhangs caves 3D terrain with 2D noise function as heightmap is kind of 'easy'. Make a plane and adjust height based on the noise. How would one start working on 3D terrain with overhangs caves? There are some older topics (for example related to Minecraft) on the thema, but non of them cover overhangs and in general techniques that can be applied to heightmap generated terrain.
5
Coherence between 2d tile maps In dwarf fortress, there are 3 levels of maps in the screen you pick your starting position, and they all coincide with each other perfectly. I am assuming that the top level tile accounts for lets say 36 smaller map blocks, and when the player spawns on the map, that is just a noise value at a different level or frequency of even more tiles. The selection screen looks like this How is such a level of coherence achieved? It doesn't seem like simply adjusting noise frequency octave values would work perfectly, or maybe it does, I am just not grasping the workflow properly?
5
Combining Minecraft and Dwarf Fortress Simulating autoplay in a pseudo infinite procedurally generated world? One of the interesting things about Dwarf Fortress (and other procedurally generated games like Civilization) is that the game simulates multiple AI factions interacting with each other over time (what might be termed "autoplay") to generate an evolving world which changes over time, even whilst the player is playing the game. On the other hand, simulating all the factions simultaneously is surely going to become a bottleneck as the map grows. With a bigger map and more factions, the performance requirements become exorbitant. Minecraft gets around this problem by simply storing the inactive chunk in memory as is as soon as the player leaves the area. The minecraft world is a static, never changing place. When a player comes back from a trip, the chunk is exactly as he left it. No world evolution occurs. Everything is always the same. The most straightforward approach to this, which is to just to make chunks remain loaded in memory even after the player is no longer in them, has the same performance issues as mentioned earlier as the player moves across thousands of blocks, you will sooner or later run into computation limits. Moreover, this does not solve the general problem of faction simulation factions can expand or contract through many chunks, whereas keeping one chunk loaded in memory would not affect its neighboring chunks, so that doesn't quite achieve the same effect as autoplay. The "solution" that I thought of is to come up with a closed form formula that simulates autoplay somehow. That is, a function f(time,coordinates), such that given the time and and coordinates of a block, will tell you what state that block should be in. The problem with this is that this assumes a truly predeterministic world evolution, in which players have control over only their local chunk and no others. In other words, no butterfly effect. Furthermore, when a player leaves a chunk, he has made some changes to it, but the function cannot take those changes into account when computing the state of the block the next time the player enters it, in other words all changes that the player made to the block are lost as soon as he leaves. This is obviously not ideal. Am I asking for something impossible?
5
How to structure a non rectangular maze I have built a few mazes and are familiar with maze algorithms however all examples I have learnt from are square or rectangular. In these mazes the code structure usally has a 2d array of maze cells and it is easy to navigate or test to adjacent cells. How do you structure the code for a say a Y or circular shaped maze to know what the avaliable joints between cells nodes in the maze are?
5
How to generate a city street network? I would like to create a city generator for a game, but I am facing a problem at the very start of the generation the road system. As it is a medieval world, I don't want a grid plan like many modern cities. I would ideally prefer a pseudo random generation of large avenues and smaller streets, where it could be possible to get lost, but with still some logic not a complete labyrinth. Something that would look like a naturally grown town. In order to keep it simple, let's say my cities would be on flat and stable terrains, without any river crossing or relief problems. I could try to integrate it to a solution after. I didn't decide of a precise size or disposition for my cities, so if you have a solution that would work only with cities of a precise form (square, circle, rectangle etc), I would take it.
5
What is the state of the art in procedural character animations? I'm a programmer and I'm interested in programmatic character animation walking or running, bipedal or many legged what is the state of the art today? I heard about NaturalMotion's Euphoria system and Ubisoft's IK Rig, and they look amazing. Where can I find more info about similar algorithms?
5
How to generate smoother Perlin Noise? So, recently I've been learning procedural generation stuff (Perlin noise specifically) and I've kind of hit a wall. This is the result that I've seen everyone get, but this is what I'm getting, This is my code, (I'm using python) import random import math import PIL.Image class Noise def init (self, x, y) self.x x self.y y def lerp(self, start, stop, t) return start (1 t) (stop t) def smoothstep(self, t) return 3 (t 2) 2 (t 3) def gradients(self) grads for in range(4) x random.randrange(0, 361) y random.randrange(0, 361) grads.append((math.cos(x), math.sin(y))) return grads def cvectors(self) botleft (self.x, self.y) botright (self.x 1, self.y) topleft (self.x, self.y 1) topright (self.x 1, self.y 1) cvecs botleft, botright, topleft, topright return cvecs def makenoise(self) dot grads self.gradients() cvecs self.cvectors() for i in range(4) (x, y) cvecs i (a, b) grads i dot.append((x a) (y b)) st self.lerp(dot 0 , dot 1 , self.smoothstep(x)) uv self.lerp(dot 2 , dot 3 , self.smoothstep(x)) stuv self.lerp(st, uv, self.smoothstep(self.y)) return stuv size 128 img PIL.Image.new('L', (size, size)) for x in range(size) for y in range(size) perlin Noise(random.uniform(0, 1), random.uniform(0, 1)) img.putpixel(tuple( x, y ), perlin.makenoise()) img.save("nois.png") This is just a guess, but I feel like it's a scaling issue. Thanks in advance, and apologies, as well, for the horrible code.
5
How can I create hemisphere worlds (floating islands?) with 3d (or 2d)? Noise (Perlin OpenSimplex) I've been experimenting with noise for a while and I've gotten some terrain up It looks like this What I'd like instead is to have planets like this (currently mine is in a cube shape) My generation code actually skews the values so the top is not solid and the bottom is. I tried to reverse this but I got a giant mess, with the top being completely solid up to the worldheight and the bottom having holes caved into it. Here is my generation code float value noise.GetPerlinFractal(worldLoc.x, worldLoc.y, worldLoc.z) if (y lt waterHeight) for (int i y i lt waterHeight i ) chunk.addBlock(x, i 1, z, BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.WATER)) if (value ((y 128) 0.01) gt 0) if ((y gt waterHeight amp amp y lt waterHeight 2)) chunk.addBlock(x, y, z, BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.SAND)) else chunk.addBlock(x, y, z, BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.GRASS)) if (y lt 105) if ((Math.pow(noise2.GetNoise(worldLoc.x, worldLoc.y, worldLoc.z), 2) Math.pow(noise3.GetNoise(worldLoc.x, worldLoc.y, worldLoc.z), 2)) lt 0.02) if (!(chunk.getBlock(x, y 1, z) (BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.WATER)))) chunk.addBlock(x, y, z, null) This is done for every block in every chunk. I'm a bit confused here and saw other ancient posts about this. However, I don't exactly understand and was wondering if someone could explain such for me. Thanks so much in advance!
5
Creating a set of islands by subtracting gradient values from a Perlin noise The answers to this question explains fairly well how to create a big island in the center of the screen by setting up a gradient and then subtracting its value from a Perlin Noise. Anyway they explain how to create only one gradient at the center of the screen to create a big, sort of circular island. But what if I want to create an island which has more than one gradient to create a less regular shape, or if I want to create multiple separated islands by setting multiple gradients in different positions? What value should I subtract from the Perlin Noise function for each point? The sum of the distance from each gradient to that point? The average? Edit Jon's method of multiplying and normalizing worked, got this result with 4 gradient points
5
Translating conditions ("If A has B, then true") into objects that satisfy them ("A has B") I have a system where I'm sifting through a large number and variety of objects in my game, looking for objects that match an arbitrary search criteria that can be simple or complex. For example, suppose a Foo has three integer properties, A, B, and C. I might search the list of Foo objects three times. First, I want to find a Foo where A gt 5. Second, I might want to find a Foo where A lt B or B 8. Third, I might want to find a Foo where A 2, B 6, C gt A, and C lt B. The point is that I could arbitrarily pass any of a very wide set of conditions into the search. Now here's my problem. In all cases, if I can't find an item that matches these criteria, I want to create a new Foo that does match, and add it to the list of Foo objects. The thing I'm wrestling with is figuring out an underlying system of representing conditions that allows me to then create an item that directly matches those conditions. So far I've got two ideas, neither of which I'm a fan of Repeatedly generate random Foo objects across the span of possible properties, until applying the criteria to one of them results in true. Given the possible permutations involved, this feels like an absolute performance nightmare, and would probably require a ton of caching logic to track what possibility spaces have already been tried. Establish a list of individual conditions with isolated variables (such as a GreaterThan condition with the referenced property that indicates whether the property is A, B, or C and the target value) and create a corresponding declaration (Make property a random value between targetValue and propertyMax ). Not only is this incredibly tedious, but I'm also not really confident I understand how it would work, particularly in C but more generally also. This feels like self reading code and that's something I have no experience with. My question is, basically, what designs and techniques can I use to address this sort of issue the need to create objects that match criteria, when those criteria could be arbitrary? Surely this has come up in other projects. What kinds of constraints or frameworks are applied to make this doable?
5
How can I get old Minecraft style terrain biome selection? I'm using this post as a reference for what I'm doing. The real thing of interest is this As you can see, this is a Whittaker diagram, with temperature and rain considerations. So would this be the algorithm he uses? def rain(x,z) return some fbm perlin noise(x,z) def temp(x,z) return some fbm perlin noise(x,z) def biome at point(x,z) return diagram at point(rain(x,z),temp(x,z)) The issue with this is that if I assume the fbm perlin noise to be in the range 0,1 for both of them, then this algorithm only covers the bottom left half of the diagram. What is the top right half? And also, perlin noise tends to make "short forays" into extreme ( 0.9,1.0 ) values, so the smaller, rarer biomes would have little tiny dots scattered around the map. An example would be the tundra the tundra is very rare, and when it happens it probably only happens for a small area. But what actually happens in Minecraft is that the smaller, rarer biomes are very rarely come across, but they still have a normal size. I've tried something like this def rain(x,z) return hash(nearest voronoi point(x,z)) def temp(x,z) return hash(nearest voronoi point(x,z)) But this runs into the triangle problem, and a new one the hash function, by definition, is incoherent, which means that it could put a desert next to a snowy mountain, because there are no constraints. How does can I fill in the final triangle and not half tiny biomes everywhere, while maintaining biome coherency?
5
How do games like Minecraft generate entire worlds from a seed number? I want to generate a completely unique world with biomes (like what Minecraft and similar games do). I don't understand how they generate these entire worlds from a single "seed" number. Can someone provide a basic overview of the technique?
5
How do I do random isometric paths? I'm working on an isometric city generator, and I am looking for a little push in the right direction. I'm looking to randomly generate roads on an isometric plane. I have never done path making before, and I've Googled it and didn't find any articles relating to what I am trying to do. Basically, my program generates a random isometric city and I am hoping to add roads to that.
5
How to change chance of spawn based on distance? I am trying to make a cellular automate cave but want to keep the middle empty. How should I change the chance based on the distance from the middle? I don't want to completely deny it just want a small enough chance to keep it almost empty.
5
Tweaking Heightmap Generation For Hexagon Grids Currently I'm working on a little project just for a bit of fun. It is a C , WinAPI application using OpenGL. I hope it will turn into a RTS Game played on a hexagon grid and when I get the basic game engine done, I have plans to expand it further. At the moment my application consists of a VBO that holds vertex and heightmap information. The heightmap is generated using a midpoint displacement algorithm (diamond square). In order to implement a hexagon grid I went with the idea explained here. It shifts down odd rows of a normal grid to allow relatively easy rendering of hexagons without too many further complications (I hope). After a few days it is beginning to come together and I've added mouse picking, which is implemented by rendering each hex in the grid in a unique colour, and then sampling a given mouse position within this FBO to identify the ID of the selected cell (visible in the top right of the screenshot below). In the next stage of my project I would like to look at generating more 'playable' terrains. To me this means that the shape of each hexagon should be more regular than those seen in the image above. So finally coming to my point, is there A way of smoothing or adjusting the vertices in my current method that would bring all point of a hexagon onto one plane (coplanar). A better approach to procedural terrain generation that would allow for better control of this sort of thing. A way to represent my vertex information in a different way that allows for this. To be clear, I am not trying to achieve a flat hex grid with raised edges or platforms (as seen below). I would like all the geometry to join and lead into the next bit. I'm hope to achieve something similar to what I have now (relatively nice undulating hills amp terrain) but with more controllable plateaus. This gives me the flexibility of cording off areas (unplayable tiles) later on, where I can add higher detail meshes if needed. Any feedback is welcome, I'm using this as a learning exercise so please all comments welcome!
5
How to orient a surface normal to a cubic surface The immediate question is in HLSL, how can I orient a surface normal generated in UV space so that I can apply it to a cube face? The overall project is that I'm trying to build a procedural planet generator. I'm using a cube projected to a sphere where each face is a quad tree. The intermediate project is that I want to generate a normal map for the terrain. I think the best way for me to do this (and understand what I'm doing) is to generate the normals for the cube version first, then work out the transformations to warp those normals to the sphere. Ideally the method would not involve branching code based on which face I'm working on (i.e., if we're on the top side of the cube, then U X and V Y). In other words, what I'm hoping for is some math magic like "Oh, just cross multiply the terrain normal by the dot product of the cube face normal and blah blah blah". 9 20 10 ETA I know how to calculate normals for a flat surface. My subsequent problem is two fold How do I rotate the normal map so it is oriented correctly on each of the cube faces? how do I warp the flat normal map so that it wraps the sphere? I've found one solution that uses a Jacobian matrix, but I can't get it to work. Even when all of the normals are pointing straight up (i.e. a flat surface), the HLSL code involving the Jacobian totally messes up the lighting so it makes me not trust my implementation of the solution.
5
Generating a town layout in a grid I want to generate a town layout in a square grid (rendered isometrically, but that doesn't matter) using the following elements 2x2 Houses Roads, 1 unit wide Canals, 1 unit wide Sample layout I always have a specific number of houses, and as many roads and canals as necessary to connect them all. The houses need to have two pieces of road in front of their front door (which is always pointing to the right) It would be nice to have fields of grass (emptiness) inbetween. Is there a ready made algorithm for this? If not, what direction should I be thinking of to implement this?
5
Workflow for creating spherical heightmaps I'm wondering how I can create a spherical heightmap. In my ideal workflow, you'd see a 3D sphere that you can edit using procedural terrain techniques (like World Creator) and that spherical terrain can be exported into six seamless images based on what layout you want your images to fold up into a cube in game to create your planet. Another option would be if you can at least tell the program you want specific images to tile with other images, such as the designated 'front, right, back, left' images tile with each other and the 'up, down' images seamlessly. Specifically, I'm making planets for a game that wraps six images into a cube and 'inflates' them into a planetary terrain. I've made a few basic heightmap sets in a program called Scape, and flipped them so at least four of the images mirror each other, then I edited the interior of those maps to all be different so the landscape isn't repetitive. However, manually editing the top and bottom maps is very daunting to get perfect, and I'm creating a dozen or more planets. I'd like to know how to make 'front, right, back, left' images tile with 'up and down' images and I can edit the interiors of the images in a 3D program of choice. I've been directed to this site from search queries many times, but I'm a newbie to all things code so I have no clue how to use things such as the Diamond Square method or any algorithms to achieve seamless textures (what program do you actually use, literally a python script you write in Notepad or something?).
5
Making dialogue different with each playthrough I'm making a little demo game where roughly half of the NPCs in a little town have a profession, as well as a personality. I'm trying to have the game procedurally create dialogue, so when an NPC is talking about what they do, they describe it with some personality. So for example, I may have a farmer who's an over achiever. He may have dialogue like this "I farm from sun up to sun down. And I have the most cows around!" In another incarnation, a brainiac farmer may say, "Hi, my farm has exactly five cows, and is run very efficiently." In the demo, the town will be procedurally generated, with a small number of townsfolk (around ten or twelve). Some will be peasants, others will be farmers. One or two will be merchants shopkeepers. When the player talks to some of these folk, the NPC may greet the player and say something about what they do. Or they may describe themselves, as well as something about their town. On occasion, the NPC will also say something about their family. I have thought of using a templating system, where it would fill in some of the dialogue. But I would like the sentences to vary with each playthough. I have also thought of using parts of speech so as to create sentences. The problem with using parts of speech (at least with using NLTK) is that I need some form of grammar to string them all together, and this is mainly meant for a small demo. Another option is to use a natural language generator (NLG), but that's getting into the realm of advanced AI. And I would like to steer away from that. So should I use a templating system for the dialogue (I have tried using Rant, but I got into some really complicated syntax with that)? Or, should I use a dialogue system that uses parts of speech, and strings them together with some kind of grammar? For what it's worth, I'm restricting the NPCs to a group of personalities. Also, some of what they say is based upon their stats. So if their intelligence is low, yet their charisma is high, maybe they'll be a xenophobe, or an over achiever.
5
Non Perfect maze generation with objectives I need an algorithm that can generate mazes with these requirements Allows for random structures to be made (Ex a center spawn area, objective points and 'Caverns (corridors with 2 or more entrances and a width gt 1)' ) Generates paths from structures to required connections Can be implemented in Python with relatively little difficulty No extra modules (unless supports Python 3.5.5) As an example, the objectives would look like this in game (I use integers to store the walls in the ray caster) 2 2 2 2 2 0 0 2 2 0 0 2 2 2 2 2 I also tried looking on wikipedia and I found this semi helpful link but none have helped me achieve this so far.
5
How to generate doorways procedurally, on the fly, and guarantee acessibility I'm currently creating a spaceship exploration game, and I have a massive problem I've been trying to solve for months, and through the rest of my group deciding to opt for a rewrite to fix some massive spaghetti. Anyway, the problems goes as follows The player starts in a room, from which they can travel to some other adjacent rooms through doorways. These doorways are stored in a map of the direction they're in, and the doorway object they reference. Each Doorway object keeps track of the two rooms it links, and will direct the player to each one when necessary. However, all rooms need to be accessible by at least one route, and going through a doorway on the starboard side means that the other room needs to have the same doorway on the port side. I can do this by just having every wall be a door, but that gets boring to explore. Pre generating these proved enough of a glitchy mess for me to fail it, but now, the spec has changed. The world will be theoretically infinite, and as such, the pathing cannot be pre generated, and instead must be done as new rooms are needed, or expected to be requested soon. So I need to generate what is essentially a maze, with loops allowed, drawn on a grid, one square at a time, where not only is every room not directly aware the others exist, but acessible from every other. On top of this, going through a doorway on one side of a room means that the same doorway needs to be on the opposite side of the next room. What's a good way to guarantee all these properties? I am willing to part with rooms having no knowledge of others, but would rather keep it this way for ease of re generating a room's type later, should that become necessary. Below is a text file ascii mockup of a 5x5 example I created https pastebin.com EtdAWAwD Lines are walls, Xs are doors, and the S is the player starting position. Any advice at all is appreciated, even on alternate routes to consider for generating these.
5
2d Procedural universe generation I want to create a flat universe, where at first the whole universe is blank. That would be represented by a parallax scrolling nebula background image. What I want to do is represent the planets as disc shaped objects in the universe. They can be of various sizes. The inside of the discs will consist of a landmass, then outside that will be a body of water and after that air. what would be the best way to go about creating those tiles procedurally as for example the air would consist of various gases and the land of various minerals and resources. My first thought is to create texture images and then stamp out the circles out of those textures, but problem is that those textures would have to wrap horizontal and vertically. Is there a fully procedural way of doing this?
5
How can I ensure procedural levels in an RTS are fair? I've seen that symmetry and coherance is important in RTS level design, but I'm lazy and want to do procedurally generated levels. How can I ensure I generate a fair playing field when procedurally creating levels for an RTS?
5
Procedural terrain in the Style of "Zelda A Link to the Past" I am working to create a system that randomly generates pseudo 3d terrain on a tile grid using the methods used in the legend of zelda games between link to the past and minish cap. I have created a tileset for it, and after manually making some maps and getting a feel for what the tile placement algorithm needs to do, I've implemented one of four possible layer transitions. There are still some special edge cases which will likely need special tiles, but the image shows a fully procedural map using it. My implementation keeps track of the altitude of each vertex (not center) of a tile. By comparing the altitudes at each corner, and in some cases those around the focused tile, I can determine which sprite to use. This system needs to be "infinite" in that I can generate chunks adjacent to existing ones using the same noise function. I have plans to make a worldmap system similar to a LOD system too, which wouldn't be too hard with perlin noise, but alternative suggestions should keep this in mind. I have several questions about this system. The first is this How I can make my noise more like the example, preferring to line up edges which are nearby (but only to a degree)? How can I make it prefer less complex shapes, more similar to octagons than realistic messy hills? The second is about how I can connect the layers for altitude changes greater than 1 level, I want to require the player to use ramps. Unfortunately I don't have a solid example of this in my current tileset, but essentially, two disconnected altitudes should have a "slope" (really just the neutral tile) between them... I could use A or similar, but how do I detect where it needs to be used? Or is there a better way to ensure connectivity? Excuse the programmer ""art"" please What I have What I want
5
How is a 3d perlin noise function used to generate terrain? I can wrap my head around using a 2d perlin noise function to generate the height value but I don't understand why a 3d perlin noise function would be used. In Notch's blog, http notch.tumblr.com post 3746989361 terrain generation part 1, he mentioned using a 3d perlin noise function for the terrain generation on Minecraft. Does anyone know how that would be done and why it would be useful? If you are passing x,y, and z values doesn't that imply you already have the height?
5
Help with concrete examples of Perlin Noise variables for terrain generation I believe this question can help beginner game developers. I've looked through a dozen or so answers on perlin noise here and on Stackoverflow, and found only 1 concrete implementation of perlin noise that I have listed below. There's a lot of advice, but it's hard to translate into what I have to do with X and Y values, and if I have to do this at all times, or only when I want specific features to appear. Here's what I got from Stackoverflow I believe this was advised as mixing various noise octaves. It seems to generate a fairly interesting terrain, although it rarely generates mountains for me. float perlinNoiseValue 1 15.0 fabsf( generator perlinNoiseX perlinX y localYIndex z 0 t 0 ) 2 15.0 fabsf( generator perlinNoiseX 2 perlinX y 2 localYIndex z 0 t 0 ) 4 15.0 fabsf( generator perlinNoiseX 4 perlinX y 4 localYIndex z 0 t 0 ) 8 15.0 fabsf( generator perlinNoiseX 8 perlinX y 8 localYIndex z 0 t 0 ) I'm looking at this answer on Perlin Noise by Byte56, and it's hard for me to translate verbal descriptions into what I have to do with X Y inputs. Can someone provide concrete examples, along with descriptions of what terrain features such noise generates? For example, does mixing noise by picking the max value equates to something along the lines of float perlinNoiseValue1 fabsf( generator perlinNoiseX perlinX y localYIndex 300 z 0 t 0 ) float perlinNoiseValue2 fabsf( generator perlinNoiseX perlinX y localYIndex z 0 t 0 ) float finalValue fmax(perlinNoiseValue1,perlinNoiseValue2) Do I always pick the max value in the case above, or only in some cases when I want a certain feature to manifest? Does flatter terrain look like ? float flatterTerrain fabsf( generator perlinNoiseX perlinX y 0.2 localYIndex z 0 t 0 ) Does wider valleys and hills look like? float widerValleys fabsf( generator perlinNoiseX perlinX 3.0 y localYIndex z 0 t 0 )
5
Procedural 3D Environment Generation I am concerning a 3D Scroller game which is like Subway Surf or Temple Run. The thing I am confused about is their way of generating 3D environment. For example for 2D games like Flappy Bird, there is a camera and player which have fixed positions respect to the X axis. And the environment is being generated, moved into camera's viewport, and finally gets destroyed after getting out of viewport. I mean, player and camera does not move in general, the environment does. Is this approach efficient by means of performance for 3D scrollers? Do they use a box which covers the camera's viewport, and when objects get out of the box, destroy them? Or do they create the environment via code as the player goes further, then make the camera follow the player and they are moving both? Is this a valid approach and what are the advantages or disadvantages of these implementations? Thanks in advance!
5
Getting name fragments for a name generator Back again to ask more about name generation this time about the dictionary of syllables which I apparently need to reliably generate a name. For reference, my last question. I've written a little bit of code which, given a file, uses the first line to determine how long the name can be (with multiple options for variability), then builds one from the syllables given in the rest of it. It works decently enough, given example syllables in an example file. For those wanting to try out a set of syllables of their own, I've made a version on Ideone.com. stdin contains the list of lengths and syllables. That's where I'm having an issue, though. What should I use for the syllables? I've looked around, but I've been unable to find a good list of names to draw from. Maybe it's just that I'm bad at this or something, but I can't really get a good list of syllables that make names. To add to that, I have to do it by hand, and I'd much rather make a program to split a list of names into syllables, but I can't get that to work. I'll post the source for my attempt once I'm home. In short, how can I get a good list of syllables for use in a name generator? Is there pre existing code I can use or modify and pass it a list of names to chop into syllables, then save those to a file? If not, how would I go about writing my own?
5
How to combine embedded generated graphs in a finite 2D plane? I'm pretty new to working with graphs but I'm looking at using them to create the world map for our game (a text mud with rooms nodes and paths edges between rooms). There are a number of interesting small world generators, for example Watts Strogatz (http en.wikipedia.org wiki Watts and Strogatz model) that I'd like to combine. My question is how to combine different generators. All the rooms will have coordinates in an XY plane (the rooms themselves won't have real dimensions). I can easily generate a graph, and then laying it out I can work out the XY coordinates of its nodes. But then I'd like to generate a new graph and connect at least one of its nodes to a node on the previous graph. My first idea is to figure out the XY bounding box of a graph, and use that to place it in the larger XY plane next to the previous graph (kind of tiling the graphs). Are there other methods I should be aware of?
5
Procedural Dungeon Generation Is there a simple algorithm to make sure all of these rooms get connected using minimal corridors? Is it possible to get a hive like structure, connecting all the rooms without having too many corridors? (Too many being 3 4 corridors coming from a single room) Below is the output of how my rooms look, basically they randomly placed. What I'm hoping to get corridor wise.
5
How is a 3d perlin noise function used to generate terrain? I can wrap my head around using a 2d perlin noise function to generate the height value but I don't understand why a 3d perlin noise function would be used. In Notch's blog, http notch.tumblr.com post 3746989361 terrain generation part 1, he mentioned using a 3d perlin noise function for the terrain generation on Minecraft. Does anyone know how that would be done and why it would be useful? If you are passing x,y, and z values doesn't that imply you already have the height?
5
What is the state of the art in procedural character animations? I'm a programmer and I'm interested in programmatic character animation walking or running, bipedal or many legged what is the state of the art today? I heard about NaturalMotion's Euphoria system and Ubisoft's IK Rig, and they look amazing. Where can I find more info about similar algorithms?
5
How to structure a non rectangular maze I have built a few mazes and are familiar with maze algorithms however all examples I have learnt from are square or rectangular. In these mazes the code structure usally has a 2d array of maze cells and it is easy to navigate or test to adjacent cells. How do you structure the code for a say a Y or circular shaped maze to know what the avaliable joints between cells nodes in the maze are?
5
How are voxel terrain engines made? A few days ago I found something called voxel terrains and I think that they're pretty cool. But I don't know anything generating them. Do you model it in your modeling software or use something like a heightmap? I read on wikipedia that voxels are like 3d pixels or volumetric pixels. After I make the voxel terrain, how can I take these voxels and make them destroyable diggable? I will pick the best answer based on code and algorithms. preferably based in C explanations. I am a beginner with algorithms but I'm very familiar with object oriented programming step by step demonstrations. Not only concept but direction. diagrams illustrations. No, not screenshots of other engines. I know that this is a complicating subject. But, thanks for any help! No, I'm not trying to make a minecraft clone. Edit Thanks to everyone for your great help (especially Nick Wiggill)! This is what I managed to make (Work in progress).
5
How can I ensure procedural levels in an RTS are fair? I've seen that symmetry and coherance is important in RTS level design, but I'm lazy and want to do procedurally generated levels. How can I ensure I generate a fair playing field when procedurally creating levels for an RTS?
5
How to generate a city street network? I would like to create a city generator for a game, but I am facing a problem at the very start of the generation the road system. As it is a medieval world, I don't want a grid plan like many modern cities. I would ideally prefer a pseudo random generation of large avenues and smaller streets, where it could be possible to get lost, but with still some logic not a complete labyrinth. Something that would look like a naturally grown town. In order to keep it simple, let's say my cities would be on flat and stable terrains, without any river crossing or relief problems. I could try to integrate it to a solution after. I didn't decide of a precise size or disposition for my cities, so if you have a solution that would work only with cities of a precise form (square, circle, rectangle etc), I would take it.
5
How can I procedurally generate the right difficulty of enemy waves? I'm programming a space shooter mobile game with a sandbox gameplay style similar to Defender's. The player faces infinite waves of enemies moving towards his ship. The game has many upgrades the player can buy to increase his ship's strength. It is important that the difficulty of each level matches the player's skill and strength. This includes setting the right number of enemy waves per level and the number and toughness of the enemies in them. This must be done procedurally, since the game has no predefined set of levels laid out by a designer. I'm interested in straightforward solutions with more or less the desired effect, simple enough to quickly implement and test. How should I approach this?
5
Are there any methods for generating rivers on demand with Perlin Simplex noise? I'm aware of many methods for procedurally generating rivers, but they require an entire heightmap beforehand in order to work. For instance, they may require to find a high position on the map and find a path to the ocean. But when working with on demand on the fly procedural generation (generating the map around the player as he moves), those requirements are unfeasible. For instance, Minecraft doesn't have "true rivers" the river does not in fact have a start and end point, it is actually just dividing the two biomes, this means that it uses the distance between the point and the edge of the biome to determine how deep the water should be, with some variance of course. This mod seems to solve the issue, but how? Probably it takes advantage of the fact that entire chunks are generated and thus is not entirely on demand per position. So, the question is how can I generate rivers procedurally on demand? More preciselly, I want a function f(x, y) which tells me whether there is a river at (x,y) or not (and its flow direction). It seems pretty unsolvable for me, but maybe people have come with some solution.
5
Manipulating Perlin Noise I've been learning about Procedurally Generated Content lately (in particular, Perlin noise). Perlin noise works great for making things like landscapes, height maps, and stuff like that. But now I am trying to generate structures more like mountain ranges (in 2D, as 3D would be way over my head right now) or underground veins of ores. I can't manage to manipulate Perlin Noise to do this. Making a cut off point (i.e. using only the tops of the 'mountains' of a heightmap) wouldn't work, because I would get lumps of mountains veins. Any suggestions? Thanks, Numeri
5
UE4 Procedural Planet Design I am building a game that requires a full planet but it would be too complicated to create it as one mesh, so I decided that I will use procedural generation to create the (partially) editable landscape, rocks, trees, caves, etc. I was wondering on what server side a procedural planet is generated? For example, is it generated when the player first plays the game, and is it the same for every player? Or is it completely rebuilt each time the player enters the game? If the answer is the latter, is there any way to somehow save the planet and make it into one map for everybody using the game and not change if they reload the game? If possible, I would strongly prefer any answers in Blueprints rather than C . FYI I haven't started building the game yet and am still researching my options for how to create the world. I didn't find much about saving the character's location anywhere so far.
5
How are voxel terrain engines made? A few days ago I found something called voxel terrains and I think that they're pretty cool. But I don't know anything generating them. Do you model it in your modeling software or use something like a heightmap? I read on wikipedia that voxels are like 3d pixels or volumetric pixels. After I make the voxel terrain, how can I take these voxels and make them destroyable diggable? I will pick the best answer based on code and algorithms. preferably based in C explanations. I am a beginner with algorithms but I'm very familiar with object oriented programming step by step demonstrations. Not only concept but direction. diagrams illustrations. No, not screenshots of other engines. I know that this is a complicating subject. But, thanks for any help! No, I'm not trying to make a minecraft clone. Edit Thanks to everyone for your great help (especially Nick Wiggill)! This is what I managed to make (Work in progress).
5
Dynamically Generated Mesh Not Visible Unless In Wireframe Mode I'm trying to create a dynamic mesh using ArrayMesh but my mesh isn't visible unless I turn on wireframe debug mode. Here is a minimal example of a plane mesh consisting of 2 triangles (this script is currently placed on a Spatial node) func ready() With these two lines added I can see the wireframe of the mesh (picture below) otherwise I see nothing. VisualServer.set debug generate wireframes(true) get viewport().set debug draw(Viewport.DEBUG DRAW WIREFRAME) var ve PoolVector3Array PoolVector3Array() ve.push back(Vector3(0, 0, 0)) ve.push back(Vector3(10, 0, 0)) ve.push back(Vector3(0, 0, 10)) ve.push back(Vector3(10, 0, 10)) var uv PoolVector2Array PoolVector2Array() uv.push back(Vector2(0, 0)) uv.push back(Vector2(1, 0)) uv.push back(Vector2(0, 1)) uv.push back(Vector2(1, 1)) var co PoolColorArray PoolColorArray() co.push back(Color(1, 1, 1)) co.push back(Color(1, 1, 1)) co.push back(Color(1, 1, 1)) co.push back(Color(1, 1, 1)) var id PoolIntArray PoolIntArray() id.push back(0) id.push back(2) id.push back(1) id.push back(1) id.push back(2) id.push back(3) var no PoolVector3Array PoolVector3Array() no.push back(Vector3(0, 1, 0)) no.push back(Vector3(0, 1, 0)) no.push back(Vector3(0, 1, 0)) no.push back(Vector3(0, 1, 0)) var array mesh ArrayMesh.new() var arrays arrays.resize(ArrayMesh.ARRAY MAX) arrays ArrayMesh.ARRAY VERTEX ve arrays ArrayMesh.ARRAY COLOR co arrays ArrayMesh.ARRAY INDEX id arrays ArrayMesh.ARRAY NORMAL no arrays ArrayMesh.ARRAY TEX UV uv var m i MeshInstance.new() array mesh.add surface from arrays(Mesh.PRIMITIVE TRIANGLES, arrays) m i.mesh array mesh add child(m i) Now with wireframe debug mode on I see the following Otherwise, I can't see anything. If I add an albedo color to the material override then the lines will change to be that color. I'm pretty new into procedural generation but I've found that a similar thing will work in Unity so I'm not sure what I'm missing here.
5
What does the "random element" do in Cellular Automata I'm reading this post on TutsPlus regarding procedural level generation using cellular automata. My question arises in this code snippet float chanceToStartAlive 0.45f public boolean initialiseMap(boolean map) for(int x 0 x lt width x ) for(int y 0 y lt height y ) if(random() lt chanceToStartAlive) map x y true return map In the first line, the author declares a float that represents 45 . This makes sense. However, the role of this is unclear to me. In this line if(random() lt chanceToStartAlive) A random number is being generated, and being tested if it's less than 0.45f. Since it is an inequality, this expression can either return true or false correct? How exactly is this percentage affecting this loop? Thank you!
5
Procedural generation of jagged peaks I would like to generate random cave type backgrounds similar to the one shown below. I doubt anything I generate will look as good as the image, but something with that feel of sharp, jagged peak should be possible. I don't have any experience in procedural generation and as such have no idea where to start.... Note I am using libGdx on Android
5
Huge procedurally generated subway transit map How could I generate a single transit map image , which is not based on any real map, on a massive scale? Are there algorithms or tools which could do something like this already? Unlike conventional maps, transit maps are usually not geographically accurate instead they use straight lines and fixed angles, and often illustrate a fixed distance between stations, compressing those in the outer area of the system and expanding those close to the center. The scale I'm looking for is earth like. If a line ran horizontally across it could have 40,075 stations kind of map. Ideally, It should also wrap around, like on a sphere. I want it to look just like any local transit map (I'm basing myself on the Montreal metro map) which means I don't care about what a metro system of this scale should look like or how useless this would be. So far, the research Nathan Hellinga's Processing.py subway map generator resembles what I'm looking for and looks great but the algorithm wouldn't scale well to a very large grid. Jannis Redmann's generating transit map theory is really interesting but bases itself on real world data. Maybe it could be used with generated data but how do you generate that data then? Fractal generators! But how do I make it look like a transit map? With Graphviz, I would still need an algorithm to generate data. Slime is a really interesting idea! But how do you procedurally generate that? Wave function collapse algorithm!! Generating a random heightmap, making a graph out of it, and then making it pretty My idea, a random walker. You all know what this is, I just don't think that's the best option there is.
5
How can I create beautiful, random, abstract images? To generate random, beautiful, abstract images which algorithms are not too complex and give good results?
5
generating random block based worlds with 3D noise I want to create a 3D block based infinite world. For any block, I want to be able to compute its block type. 3D perlin noise is the usual building block of such a world. If you ask the 3D noise function the value for a 3D point, it'll give you a value between 1 and 1. How do you turn this number into a block type? I want blocks on the surface to be turf, and different minerals to have different probabilities based on depth. I want sprawling caves and caverns and lava flows but not small ones. And so on. So how do you turn noise into block types into a coherent subterranean world? Particularly how do you make things like coal appear in seams and crystals only appear in caves and any other rules that can be invented that make the type of a block dependent upon its neighbours? And how to do this efficiently, in an oracle function rather than by having to create large 3D arrays to store the decided outcomes of some terraforming?
5
How can you use Fractals to perturb an image? I've been playing around with Procedurally Generated World. I've so far managed to create the Height Map, and a translate map, but now i'm attempting to create Caves, The main idea is to use another Noise map, with values being either 0 or 1, and multiply it with the Height Map. I've managed to achieve this This is currently described with a float Width, Height , which has value 0 for those points (x,y) such that (x,y) is black, or 1, for those which (x,y) is white. I want to apply some fractal to this to achieve this However, i have no idea how to do this! (I also apologize for any grammatical errors. I haven't slept in like 18 hours and i can't think straight)
5
Combining Minecraft and Dwarf Fortress Simulating autoplay in a pseudo infinite procedurally generated world? One of the interesting things about Dwarf Fortress (and other procedurally generated games like Civilization) is that the game simulates multiple AI factions interacting with each other over time (what might be termed "autoplay") to generate an evolving world which changes over time, even whilst the player is playing the game. On the other hand, simulating all the factions simultaneously is surely going to become a bottleneck as the map grows. With a bigger map and more factions, the performance requirements become exorbitant. Minecraft gets around this problem by simply storing the inactive chunk in memory as is as soon as the player leaves the area. The minecraft world is a static, never changing place. When a player comes back from a trip, the chunk is exactly as he left it. No world evolution occurs. Everything is always the same. The most straightforward approach to this, which is to just to make chunks remain loaded in memory even after the player is no longer in them, has the same performance issues as mentioned earlier as the player moves across thousands of blocks, you will sooner or later run into computation limits. Moreover, this does not solve the general problem of faction simulation factions can expand or contract through many chunks, whereas keeping one chunk loaded in memory would not affect its neighboring chunks, so that doesn't quite achieve the same effect as autoplay. The "solution" that I thought of is to come up with a closed form formula that simulates autoplay somehow. That is, a function f(time,coordinates), such that given the time and and coordinates of a block, will tell you what state that block should be in. The problem with this is that this assumes a truly predeterministic world evolution, in which players have control over only their local chunk and no others. In other words, no butterfly effect. Furthermore, when a player leaves a chunk, he has made some changes to it, but the function cannot take those changes into account when computing the state of the block the next time the player enters it, in other words all changes that the player made to the block are lost as soon as he leaves. This is obviously not ideal. Am I asking for something impossible?
5
Where can I find code examples of different variations of Perlin noise? I have seen the PCG wiki, and it is a great resource. But a lot of the articles are very brief and it is hard to find good links on specific things. I have been searching for ways to transform my Perlin noise height maps to make ridges, rivers, and other terrain features. I also can't find any articles on how to divide up the map into different areas for calculating texture coordinates or other values specific to the game. I have only been able to find websites detailing their software that can generate the different things, but no code or explanations. Are there any good sources of code examples explanations on how to do the above mentioned with Perlin noise? PS. This should probably be a community wiki. I don't know how to make it as one though.
5
map world "decorator" algorithms patterns I've spent a lot of time working with perlin simplex noise for different styles of map gen, but I'm having a hard time finding advice resources on how to populate the map with "world decor" that have some patterns to them... not just a random flower or tree. I can control where on the map they spawn based on the height temp values, but what are some good ways to control "patterns" the items spawn in? For example, I want a specific plant to always spawn in clusters, but I want it to look natural and random a bunch all together in a cluster and some individuals further out. I don't want all spawn instances to look the same. A good reference is the Minecraft ore spawner they're always in random configurations with some min max size variations. Larger veins are even more rare.
5
Procedural dungeon algorithms for a more open dungeon I'm working on a game that I want dungeon generating in, but I plan on having ranged weapons in it, so I want it a bit more open. I'd like to avoid corridors and I don't want to use a grid of custom rooms. I don't want to use perlin noise and make it like random blotches, so that's not an option. All I need is a summary of how the ideal algorithm for this works. EDIT Something that gives a result like this It doesn't need to be so rounded. The point is that there aren't really corridors. I'm also fine with a modular approach where the areas are hand made as long as it's still not on a grid. The issue is that if it's not on a grid, the areas are normally connected by corridors. EDIT2 I made this a while ago, which works when it comes to shape, but it works with a modular system and it looks like this because I intentionally put rooms on top of other rooms. This causes problems if I start decorating the rooms and filling them with interesting stuff.
5
Zooming into generated map I have generated a 1024 X 1024 heightmap using Open simplex noise. Now i want to zoom into a 64X64 area. Every pixel in the 64X64 is not 16X16 on the larger scale. I tried just generating the area, but problem is, that I want to also calculate normals from it, and the normals are different for the zoomed in area from the big map. The difference comes from the fact that on the big map the height difference between 2 pixels can be quite large, but when zoomed in, new pixels are place between the original 2 so if now normals are calculated, they are totally different. How can I zoom into an area of a generated heightmap but retain the normals? On the left is the large scale map and on the right is the zoomed in area. Zoomed in area is the upper left corner of the large scale map. As you can see the normals are completely different. Both of these images are textures. There are no meshes or anything only textures, and there will not be any meshes in future either. This is how I calculate normals from heightMap. u noiseValues x (y 1) width r noiseValues x 1 y width Vector3 up new Vector3(0, 1, (noiseValues index u) 100) Vector3 across new Vector3(1, 0, (r noiseValues index ) 100) normal across.Cross(up).Normalized() normal (normal new Vector3(1, 1, 1)) 2.0f After updating these lines in normal calculation Vector3 up new Vector3(0, 1 zoomFactor, (noiseValues index u) 100) Vector3 across new Vector3(1 zoomFactor, 0, (r noiseValues index ) 100) This is the result after adjusting normal calculation
5
Create vertices indices for cylinder with triangle strips I'm trying to create vertex and index buffer for a cylinder (in OpenGL, but it shouldn't matter). I think my vertex buffer is fine (I checked drawing with GL POINTS). Here's the code that builds it int sides 10, slices 40 float radius 3.5 10.0 numVertices sides slices Vertices malloc(sizeof(Vertex) numVertices) int angleincs 2 M PI sides int cs angleincs 2 M PI slices float zval float zstep height (float)sides float i for(int m 0 m lt slices m ) int index (m sides) for (int n 0 n lt sides n ) Vertices index n .Position.x cosf(i) Vertices index n .Position.y sinf(i) Vertices index n .Position.z zval i angleincs zval zstep I'm stuck at the index buffer generation. Any help on how to build it? I tried to adapt some code from a torus generator, and I get something that apparently resembles a cylinder but it's a bit weird and has a few extra weird triangles. numIndices (2 (sides 1) slices slices) Indices malloc(sizeof(GLushort) numIndices) int n 0 for (int i 0 i lt slices i ) for (int j 0 j lt sides j ) Indices n i sides j Indices n ((i 1) slices) sides j Indices n i sides Indices n ((i 1) slices) sides Indices n ((i 1) slices) sides Thanks in advance.
5
How to make noise generated terrain more square? I use a perlin noise generator to create a map. All works fine and dandy. It uses the following formula Generate perlin noise Posterize the height values to be an integer between 0 and 5. What I get works well. Just, the terrain is TOO organic for my purposes. Is there a way to make it a little more square and chunky?
5
Question about CDLOD quad tree I have been digging and researching into CDLOD and there are some things I dont understand. https github.com fstrugar CDLOD blob master cdlod paper latest.pdf states The quadtree structure is generated from the input heightmap. It is of constant depth, predetermined by memory and granularity requirements. Once created, the quadtree does not change unless the source heightmap changes. Every node has four child nodes and contains minimum and maximum height values for the rectangular heightmap area that it covers. Doe's this mean I calculate every node and child nodes to the finest level at the setup phase (i do not split and unsplit at run)? If so, what's the roughest level I start with? And how do I get the minimum and maximum height from my perlin noise height map for an node area? Lastly how CDLOD would work, when I zoom in out into a big planet (up factor)? Can get that into my imagination.
5
Procedural terrains in 3D what has been done ? Are there common algo and or theories about it? Besides programming, modeling an environment takes a great deal of time. I don't know about the work time involved, for example, in a WoW dungeon level, or other beautiful city like, future environment, jungles, fantasy, etc, but this kind of work is made from scratch by artists. What are the techniques involved in the TorchLight level randomizer, and does other titles have similarities with this ? Is there a family name for such techniques ?
5
Voxel River Generation at Biome Borders or Biome Blending I'm creating a voxel (block, Minecraft like) game and I have different biomes (flatland, mountains, ect) and the problem is they are abrupt changes when biomes end begin. I'm using 3d perlin noise, so I can't just quot average out quot the heights. So I thought to make rivers when biomes end begin. Does anyone know how I could do this, or how it could work? With 3d noise I get very nice features, however the noise represents density rather than height, so I'm not sure how to go about doing quot weight quot and such. If not, how can I do blending with 3d perlin noise? Many thanks in advance. I'm also wondering of how Currently, for each chunk of the world I have a certain chunkGen set, and when the biome changes (randomly determined) the chunkGen changes. Even if I were to generate on a block by block basis, I'm not exactly too sure how that could help me as the 3d perlin value I'm getting is of density. I think my best bet would be using 2d perlin with 3d perlin, the 2d for height and the 3d for ridges but I have no idea of how to implement this. Would it also be possible to create a buffer terrain between the biomes? with the averages of the octaves, gain, frequency? EDIT I've actually just tried buffer terrain but it doesn't work well, often enough it moves up randomly or happens in the middle of lakes.
5
Correct way to "randomly" generate flowing terrain I'm creating a simple top down RTS game. I plan on it "randomly" generating maps on the fly when I need to. I plan on it all working in 'passes' Fill the terrain in with all grass Go back and add some random spurts of gravel Round out the gravel Draw Mountain Landscape on second layer Round out mountains etc. etc. Now, take a look at this picture below I hand created this using my map editor but I plan on this basically being the result after hopefully pass step 3. How should I go about deciding when and were to place my gravel so that it is at least irregularly shaped and sporadic enough to look natural? Thanks if you can! Any and all help is appreciated! As a side note Each pass is basically me iterating through all of my tiles (The map is divided into 40x40 tiles) similar to this for (int x 0 x lt GRIDMAX 1 x ) for (int y 0 y lt GRIDMAX 1 y ) Terrain(x, y, 0) SomethingHere
5
how to generate road in racing game I'm making a racing game in python and I kind of wrote myself into a corner. This for loop for i in objects if i.name "road" if i.y 0 road Road(road x, 20,road width,20) objects.append(road) is how I generate new road tiles as the old ones move down the screen. When a block spawns 20 pixels offscreen, it falls down until its top left corner hits 0 and then a new block spawns above it. if you run this code https github.com hailfire006 economy game blob master racing 20game you can see that it works great, right up until the player accelerates by pressing up or "w", at which point the road stops spawning. What I think is happening is that the road is skipping the 0 mark and that's why no new road is spawning, but increasing the acceleration in the code doesn't seem to mess it up, it's only when it's changed dynamically in game. Can soneone explain what's happening here because nothing I try is working and I've been stuck on this for days...
5
Procedurally placing buildings on noise field So, I have a procedurally generated planet. In my case it's 3D (hexagon pentagon globe) but for simplicity let's assume it is a 2D grid. I have distributed resources over this planet, using Simplex Noise, with a cut off value, giving me a binary distribution. One of the things I generate in this way, are fields of wheat, shown in yellow below. After the wheat fields are generated, I want to procedurally place farms on the planet. If I would just randomly pick a "yellow tile" (tile with wheat on it) then I run the danger of having them poorly distributed, as shown on the left. What I want, is a nice distribution where farms favour large wheat areas that are still unoccupied by other farms, as shown on the right. Is there a simple algorithm that can do this placement? NOTE I want to use this approach for other buildings like mines, quarries, lumberjack operations, etc. So I want to avoid placing first, and then growing resources around it. I want the noise field to drive the placement, not the other way around. NOTE Farms will not consume the wheat. I've made wheat fields binary wheat no wheat but also have scaled distributions with "potency" for e.g. forests, where the number of trees per tile can vary.
5
Basic procedural generated content works, but how could I do the same in reverse? My 2D world is made up of blocks. At the moment, I create a block and assign it a number between 1 and 4. The number assigned to the nth block is always the same (i.e if the player walks backwards or restarts the game.) and is generated in the function below. (Image shows a small portion of the game, in practice there are much more blocks) As shown here by this animation, the colours represent the number. function generate data(n) math.randomseed(n) resets the random so that the 'random' number for n is always the same math.random() fixes lua random bug local no math.random(4) print(no, n) return no end Now I want to limit the next block's number a block of 1 will always have a block 2 after it, while block 2 will either have a block 1,2 or 3 after it, etc. The next block's number is taken at random from the next table 1 next 2 , 2 next 1,2,3 , 3 next 4 , 4 next 1,3,4 , Before, all the blocks data was randomly generated, initially, and then saved. This data was then loaded and used instead of being randomly called. While working this way, I could specify what the next block would be easily and it would be saved for consistency. I have now removed this saving loading in favour of procedural generation as I realised that save whiles would get very big after travelling. Back to the present. While travelling forward (to the right), it is easy to limit what the next blocks number will be. I can generate it at the same time as the other data. The problem is when travelling backwards (to the left) I can not think of a way to load the previous block so that it is always the same. Does anyone have any ideas on how I could sort this out?
5
How to report bugs found on procedurally generated levels? There is many topics on how procedural generating works but I couldn't find any info on how to test and what's more important how to report bugs that may occur on procedurally generated levels. What is the best way to describe a bug, for example related to level design, on a map that will look different each time you play new game? What information should be included in bug report so reproducing it would be easier for level designer, level artist, etc. and then also during regression process? EDIT It is worth mentioning that the game, I am preparing to test, is in very early phase of developing and is constantly changing along with the systems responsible for generating levels. The purpose of this research is to learn how to describe bugs (what info to include in report) so the regression in a changing environment would be as less time consuming and as effective as possible.
5
Combining Minecraft and Dwarf Fortress Simulating autoplay in a pseudo infinite procedurally generated world? One of the interesting things about Dwarf Fortress (and other procedurally generated games like Civilization) is that the game simulates multiple AI factions interacting with each other over time (what might be termed "autoplay") to generate an evolving world which changes over time, even whilst the player is playing the game. On the other hand, simulating all the factions simultaneously is surely going to become a bottleneck as the map grows. With a bigger map and more factions, the performance requirements become exorbitant. Minecraft gets around this problem by simply storing the inactive chunk in memory as is as soon as the player leaves the area. The minecraft world is a static, never changing place. When a player comes back from a trip, the chunk is exactly as he left it. No world evolution occurs. Everything is always the same. The most straightforward approach to this, which is to just to make chunks remain loaded in memory even after the player is no longer in them, has the same performance issues as mentioned earlier as the player moves across thousands of blocks, you will sooner or later run into computation limits. Moreover, this does not solve the general problem of faction simulation factions can expand or contract through many chunks, whereas keeping one chunk loaded in memory would not affect its neighboring chunks, so that doesn't quite achieve the same effect as autoplay. The "solution" that I thought of is to come up with a closed form formula that simulates autoplay somehow. That is, a function f(time,coordinates), such that given the time and and coordinates of a block, will tell you what state that block should be in. The problem with this is that this assumes a truly predeterministic world evolution, in which players have control over only their local chunk and no others. In other words, no butterfly effect. Furthermore, when a player leaves a chunk, he has made some changes to it, but the function cannot take those changes into account when computing the state of the block the next time the player enters it, in other words all changes that the player made to the block are lost as soon as he leaves. This is obviously not ideal. Am I asking for something impossible?
5
How can I generate biome borders? I'm looking for ways to generate random biome borders (like what Minecraft has). One technique involves choosing specific biomes based on (eg) a rainfall map and a temperature map. But that just determines which biome to place, not where the borders between biomes are. I don't want to use quantized Perlin noise directly that would generate certain quantized values strictly within other zones, whereas I'd like finer control over which biomes can abut others. For example, in Minecraft one can see mountainous terrain, forests, plains, or deserts right next to the ocean. Many of the solutions to "the biome problem" propose computing the whole universe in a heuristic manner. I want to generate infinite terrain, and to me that suggests the algorithm be strictly functional given an X,Y value (and a world seed) the algorithm can easily spit out a biome value. So, my question what are some techniques for identifying random, non trivial sized, contiguous chunks of terrain to be of a given biome?
5
How irregularly shaped rooms should be placed in a dungeon I have made a procedurally generated dungeon that places every room successfully so it is accessible via at least one other room. A 'successfully' placed room is a room who's wall cells are right net to another room's wall cells. This is because there are no corridors in my dungeon, but doorways, 2 cells thick ......... Where ' ' is the Doorway. ......... ..... ......... ..... ..... However I have now moved on to procedurally generate irregular shaped rooms, such as 'L' shaped rooms, 'T' shaped rooms, and so on. I am wondering how I can place, for example, a square room next to an 'L' shaped room, without wasting any space i.e. ........ ........ ... ........ ... ... ... ......... ......... This is not possible with my previous algorithm because it only took into account the room's bounds, where as now an 'L' shaped room's bounds contains empty space that a square room could possibly fit.
5
What is the mesh generation technique shown in Chrome Music Lab? The Google toy of the day, https musiclab.chromeexperiments.com Spectrogram, features a continuously scrolling 3D render of a shape with cross sections that seem to equal the spectrograph of sound at a single instant. Assuming the frequency information is available as input, how does that information become a mesh that updates continuously?
5
How can I optimise a Minecraft esque voxel world? I found Minecraft's marvelous large worlds extremely slow to navigate, even with a quad core and meaty graphics card. I assume Minecraft's slowness comes from Java, as spatial partitioning and memory management are faster in native C . Weak world partitioning. I could be wrong on both assumptions. However, this got me thinking about the best way to manage large voxel worlds. As it is a true 3D world, where a block can exist in any part of the world, it is basically a big 3D array x y z , where each block in the world has a type (i.e BlockType.Empty 0, BlockType.Dirt 1, etc.) I assume that to make this sort of world perform well, you would need to Use a tree of some variety (oct kd bsp) to split all the cubes out it seems like an oct kd would be the better option, as you can just partition on a per cube level not a per triangle level. Use some algorithm to work out which blocks can currently be seen, as blocks closer to the user could obfuscate the blocks behind, making it pointless to render them. Keep the block object themselves lightweight, so it is quick to add and remove them from the trees. I guess there is no right answer to this, but I would be interested to see peoples' opinions on the subject. How would you improve performance in a large voxel based world?
5
Are there any methods for generating rivers on demand with Perlin Simplex noise? I'm aware of many methods for procedurally generating rivers, but they require an entire heightmap beforehand in order to work. For instance, they may require to find a high position on the map and find a path to the ocean. But when working with on demand on the fly procedural generation (generating the map around the player as he moves), those requirements are unfeasible. For instance, Minecraft doesn't have "true rivers" the river does not in fact have a start and end point, it is actually just dividing the two biomes, this means that it uses the distance between the point and the edge of the biome to determine how deep the water should be, with some variance of course. This mod seems to solve the issue, but how? Probably it takes advantage of the fact that entire chunks are generated and thus is not entirely on demand per position. So, the question is how can I generate rivers procedurally on demand? More preciselly, I want a function f(x, y) which tells me whether there is a river at (x,y) or not (and its flow direction). It seems pretty unsolvable for me, but maybe people have come with some solution.
5
How to structure a non rectangular maze I have built a few mazes and are familiar with maze algorithms however all examples I have learnt from are square or rectangular. In these mazes the code structure usally has a 2d array of maze cells and it is easy to navigate or test to adjacent cells. How do you structure the code for a say a Y or circular shaped maze to know what the avaliable joints between cells nodes in the maze are?
5
map world "decorator" algorithms patterns I've spent a lot of time working with perlin simplex noise for different styles of map gen, but I'm having a hard time finding advice resources on how to populate the map with "world decor" that have some patterns to them... not just a random flower or tree. I can control where on the map they spawn based on the height temp values, but what are some good ways to control "patterns" the items spawn in? For example, I want a specific plant to always spawn in clusters, but I want it to look natural and random a bunch all together in a cluster and some individuals further out. I don't want all spawn instances to look the same. A good reference is the Minecraft ore spawner they're always in random configurations with some min max size variations. Larger veins are even more rare.
5
How do "procedural" and "random" generation differ? To my understanding, everything that isn't directly created by a human is called "procedural". Procedural generation systems have different complexities and may consist of various algorithmic processes, some of which may be "random". Some games explicitly refer to their systems as "random", while others call them "procedural", as if indicating a distinct difference. Is there such a distinct difference? Where do you draw the line? For example, here are contrasting examples of RPG loot generation Type A Loot generation is ultimately left to chance, but it's based on a large intial factor of deterministic, specifically encoded knowledge. Boss characters drop loot, which type is determined by the boss' characteristics (e.g. species, character class, elemental affinity, ) and additionally influenced by the player's play style, to create more enjoyable gameplay For example, more likely drop a fire damage sword to a player who prefers fire based melee attacks, along with gold. Type B Loot generation is almost completely random, based on minimal explicit knowledge. Bosses have a randomised loot table (e.g. 1 legendary, 2 epics, 5 blues). If the roll is right to drop a legendary, random attributes are generated for that legendary, which may be high in value. Stuff like character attributes, player behaviour and such don't matter. Both designs qualify as procedural by the initial definition, since their output is automatic, but Type A is significantly more sophisticated in crafting player experience. Must an algorithm seem as if a person had designed its output by hand, to qualify as "procedural" rather than "random"?
5
Floating point determinism with respect to procedural generation, clustering and GPU offloading I've been designing a distributed procedural generation system for a while now in my spare time and one of the problem's I've been thinking about recently, with respect to the broader architecture, is that of floating point determinism inconsistency when you can't ensure that you have a homogeneous cluster of machines running a persistent world. Part of my design requires that any given machine can regenerate procedural content as needed, allowing for unimportant but resource hungry content to be destroyed and recreated as needed on whatever machine is available to do the work. I have been running on the basic idea that I will use high precision 32 64 bit integers for most things, and that generally works fine, but the standard coherent noise algorithms all use floating point values in their calculations. Do I need to implement custom non floating point versions of all those algorithms (i.e. using longs) or is there a better approach? Should I be using fixed point types for this kind of thing, and if so, how does that impact my desire to have the option to offload some of the PCG work to the GPU, when possible? Also, are fixed point types fast enough for heavy use within a game engine? Can I ignore floating point precision issues if I can get away with a maximum level of precision? i.e. If I'm happy to use no more than, say, six decimal places of a result, does that keep me safe across different machines and architectures? Note my engine is purely the simulation side of things. It doesn't matter to me if there are slight rendering inconsistencies when a user is playing the game all that matters is that the procedurally generated source data is consistently regenerated no matter which machine in a cluster is doing the work.
5
How can I optimise a Minecraft esque voxel world? I found Minecraft's marvelous large worlds extremely slow to navigate, even with a quad core and meaty graphics card. I assume Minecraft's slowness comes from Java, as spatial partitioning and memory management are faster in native C . Weak world partitioning. I could be wrong on both assumptions. However, this got me thinking about the best way to manage large voxel worlds. As it is a true 3D world, where a block can exist in any part of the world, it is basically a big 3D array x y z , where each block in the world has a type (i.e BlockType.Empty 0, BlockType.Dirt 1, etc.) I assume that to make this sort of world perform well, you would need to Use a tree of some variety (oct kd bsp) to split all the cubes out it seems like an oct kd would be the better option, as you can just partition on a per cube level not a per triangle level. Use some algorithm to work out which blocks can currently be seen, as blocks closer to the user could obfuscate the blocks behind, making it pointless to render them. Keep the block object themselves lightweight, so it is quick to add and remove them from the trees. I guess there is no right answer to this, but I would be interested to see peoples' opinions on the subject. How would you improve performance in a large voxel based world?
5
3D terrain generation with overhangs caves 3D terrain with 2D noise function as heightmap is kind of 'easy'. Make a plane and adjust height based on the noise. How would one start working on 3D terrain with overhangs caves? There are some older topics (for example related to Minecraft) on the thema, but non of them cover overhangs and in general techniques that can be applied to heightmap generated terrain.
5
Procedural generation of jagged peaks I would like to generate random cave type backgrounds similar to the one shown below. I doubt anything I generate will look as good as the image, but something with that feel of sharp, jagged peak should be possible. I don't have any experience in procedural generation and as such have no idea where to start.... Note I am using libGdx on Android
5
How to change chance of spawn based on distance? I am trying to make a cellular automate cave but want to keep the middle empty. How should I change the chance based on the distance from the middle? I don't want to completely deny it just want a small enough chance to keep it almost empty.
5
Procedural terrains in 3D what has been done ? Are there common algo and or theories about it? Besides programming, modeling an environment takes a great deal of time. I don't know about the work time involved, for example, in a WoW dungeon level, or other beautiful city like, future environment, jungles, fantasy, etc, but this kind of work is made from scratch by artists. What are the techniques involved in the TorchLight level randomizer, and does other titles have similarities with this ? Is there a family name for such techniques ?
5
Create Full Tile Map Zone in an Art Software, then generate corresponding tile name list? I'm completely new to tile map creation. I'm a programmer and I'd like to make life easier for myself. It's a bit long to explain the problem I think I have, but bear with me. The Scenario From what I understand, in my code I need an array which holds my tile information for a zone area in my game. Lets say for simplicity this zone was a 10x10 grid, so 100 indexes in the array. Now, lets say each index holds a number that corresponds to a specific tile. ex) Number 1 means grass tile. Number 4 means rock tile. etc. So far so good. From this array (and additional coding), my tile map will be generated on my game screen. The problem As it stands I have to individually type each tile identifier for each index in the array. Now let's say that I have already fully designed the visual tile grid map for my zone in a particular art software. Simply put, I am staring at my fully completed zone in my art software screen and it is my visual aid for creating my array. My strategy now is to look at each grid cell, see what tile I put in there, and type its identifying number into my array. Rinse and repeat hundreds of times, looking at each individual tile until I manually complete the array. This is an extremely tedious and long process. What I want So my full tile map is already in my art software. What I want is for the software to more or less generate the array for me! I press a button, and It will see what tile is in each grid square, and accordingly generate a list in a text document with each tile's identifying number that I give it. That's literally all I need. I can then copy and paste the list into my array in my code. It shaves off tons of time. The Question Notice that I have used the generic term "art software". Is there any art software that can do what I described? Is there any art software (e.g. adobe illustrator, photoshop, gimp, etc.) which upon having a fully completed tile map, will be able to generate a text file list of each tile's identifying name?
5
How can I generate biome borders? I'm looking for ways to generate random biome borders (like what Minecraft has). One technique involves choosing specific biomes based on (eg) a rainfall map and a temperature map. But that just determines which biome to place, not where the borders between biomes are. I don't want to use quantized Perlin noise directly that would generate certain quantized values strictly within other zones, whereas I'd like finer control over which biomes can abut others. For example, in Minecraft one can see mountainous terrain, forests, plains, or deserts right next to the ocean. Many of the solutions to "the biome problem" propose computing the whole universe in a heuristic manner. I want to generate infinite terrain, and to me that suggests the algorithm be strictly functional given an X,Y value (and a world seed) the algorithm can easily spit out a biome value. So, my question what are some techniques for identifying random, non trivial sized, contiguous chunks of terrain to be of a given biome?
5
Combining Minecraft and Dwarf Fortress Simulating autoplay in a pseudo infinite procedurally generated world? One of the interesting things about Dwarf Fortress (and other procedurally generated games like Civilization) is that the game simulates multiple AI factions interacting with each other over time (what might be termed "autoplay") to generate an evolving world which changes over time, even whilst the player is playing the game. On the other hand, simulating all the factions simultaneously is surely going to become a bottleneck as the map grows. With a bigger map and more factions, the performance requirements become exorbitant. Minecraft gets around this problem by simply storing the inactive chunk in memory as is as soon as the player leaves the area. The minecraft world is a static, never changing place. When a player comes back from a trip, the chunk is exactly as he left it. No world evolution occurs. Everything is always the same. The most straightforward approach to this, which is to just to make chunks remain loaded in memory even after the player is no longer in them, has the same performance issues as mentioned earlier as the player moves across thousands of blocks, you will sooner or later run into computation limits. Moreover, this does not solve the general problem of faction simulation factions can expand or contract through many chunks, whereas keeping one chunk loaded in memory would not affect its neighboring chunks, so that doesn't quite achieve the same effect as autoplay. The "solution" that I thought of is to come up with a closed form formula that simulates autoplay somehow. That is, a function f(time,coordinates), such that given the time and and coordinates of a block, will tell you what state that block should be in. The problem with this is that this assumes a truly predeterministic world evolution, in which players have control over only their local chunk and no others. In other words, no butterfly effect. Furthermore, when a player leaves a chunk, he has made some changes to it, but the function cannot take those changes into account when computing the state of the block the next time the player enters it, in other words all changes that the player made to the block are lost as soon as he leaves. This is obviously not ideal. Am I asking for something impossible?
5
How can I create beautiful, random, abstract images? To generate random, beautiful, abstract images which algorithms are not too complex and give good results?
5
Procedural Breakout level generation I am currently developing a Breakout game for a school project, and I've decided to use it as an opportunity to get started with procedural content generation. I took a quick look at some of the basic procedural stuff, but I wanted to know if there is a known good method to generate levels for this kind of game (block patterns, "power up" distribution, etc). Any articles or ideas are greatly appreciated.
5
How to pass the correct data into a continuous world I'm having a hard time implementing the player moving around my world of 2048x2048 tiles that is generated using a noise function. I'm in it for weeks, and I can not, I mess around with the coordinates, and there's always a bug. I was trying like this 1 I paint the map around the player (I'm using a tilemap) I paint a 64x64 area, with the player positioned in the center 2 create a rectangle and center it in the player, the rectangle has an equivalent size of 32x32, and each frame creates another rectangle that is compared with the old one, so I take the area that has not yet been painted, so I can paint. The problem is that when I reach the extremes of the map, when x 0 or x 2048 for example, I need that "x" equals 2048, and equals 0, respectively, as if the world had "turned" and I'm not sure how to deal with the world's data and the coordinates of the tilemap, because when I start by painting the map around the player, it will be in a position that would be 32.32, and the rectangle 16.16, I can not understand what I have to do it, I mess up everything with the coordinates, in this question, it helped me, I'm using the mod Make a 2d top down game with round map it works, but what I am not able to do is pass the x and y correct, there are always bugs of this type, where I struggle with the numbers, but no use, if I fix the floor to one side the bug appears on the other here was to be water, and it has a land line for example. I'm using Godot 3. Up 1 I'm not sure, but it seems everything is going very well, what I was wrong was forgetting that, for example, a 64x64 array starts from 0 to 63, I was really dumb. The image below shows what it would look like in a 64x64 world As I solved it was just doing this "map size 1" and decreasing and adding values to the left or right, 0, 31, respectively, since the rectangle starts at position 16, 16. but when I do this now, there is another problem when this happens which occurs because of the "map size 1", but without it it is still more messy. Up 2 I was able to fix the up 1 error, I was calling the wrong mod function, without adding the x and y, so it arrived at 33 and it is no more than the verification "map size 1", now it is working in the horizontal and vertical movements, however I'm still wrong to move diagonally. or Up 3 I think I got it, the problem if I was not mistaken was in the "stairs", so it works LEFT UP RIGHT UP DOWN LEFT DOWN RIGHT But I still have to hit the pieces of map that are behind, but I think it's in the "turn them off" function. I confess that I do not quite understand why this works, I would like to understand. Note 1 Still the rare cases that the map generates wrong, but actually abusing the keys, quickly clicking for all meaningless directions, such as varying up and down, pressing low, a very strange movement, but the failure happens.
5
How do I create a spherical world to explore? So to preface this question, I have done a lot of research on this, but most of it has proven unhelpful, possibly because I'm not sure the proper way to phrase what it is that I'm trying to ask, so I might make this a little long winded to get my point across. The basic idea that I am trying to explore is a small planet that can be navigated by the player, but I also want this planet to be similar, but different for each playthrough (hence the procedural generation tag). At first, I looked into doing this by simply creating a sphere which has it's own type of gravity (doesn't have to be too realistic), but research proved that this had many (too many) obstacles to overcome. Making the gravity work on this sphere would have been complicated, but doable, but then I read that the terrain tools wouldn't work properly and that could be a problem. The last issue that I saw for this, which makes me think that this idea is dead is how strenuous this might be for the systems, since I want the planet to be fairly full of interesting things to explore. This led me to the idea of a modular system of tiles (if I'm using that term correctly), where I could procedurally generate these tiles, and align them in a spherical shape. I could instantiate and destroy the tiles as needed to preserve system resources, and would make the procedural generation aspect of this easier for me as well (at least I think it will). The problem I see with this model is how to make square (or any other shaped tiles) form a sphere. I am attempting to build this in UE4. If this is impossible, or at least prohibitively difficult, to do in the engine, then I rather find out now before I get too far along in the project. And any help or resources on how I can do this if possible will be greatly appreciated.
5
Coherence between 2d tile maps In dwarf fortress, there are 3 levels of maps in the screen you pick your starting position, and they all coincide with each other perfectly. I am assuming that the top level tile accounts for lets say 36 smaller map blocks, and when the player spawns on the map, that is just a noise value at a different level or frequency of even more tiles. The selection screen looks like this How is such a level of coherence achieved? It doesn't seem like simply adjusting noise frequency octave values would work perfectly, or maybe it does, I am just not grasping the workflow properly?
5
Transitioning Heightmaps Using Voronoi Cells I'm partitioning a procedurally generated world into regions using voronoi noise. The goal is to create individual regions in a world each unique from each other. Each region has a distinct set of properties, one of which is having a procedurally generated heightmap. The issue I am having is transitioning from one region's heightmap to another. Each region's heightmap is composed of multiple 'layers' of simplex fractal noise. Because the regions are using voronoi cells, and each region has its own distinct heightmap, they do not smoothly transition into each other. Any guidance on how to solve this issue would be greatly appreciated!
5
How to vectorize a raster image edges into SVG paths? I'm having a lot of trouble figuring out how to convert a 2D list of points into an SVG Path representing a political map border. I have completed all parts of a 2D terrain generator, including climate simulation, rivers, lakes, rainfall, temperature, biomes, and finally territories. This last part is where the problem lies. The entire script is written in Python. I have a list of territories, which are represented as dicts with several properties. One of which is Color, used as an ID and to output a pretty map. Another is a list of Pixels, list of Borders, and list of Neighbors. Pixels refers to all points in the territory. Territories can be thought of a polygons. They have Border pixels, which are defined as any outside (meaning not part of the Pixels list) pixel not belonging to this territory (whether it be a River, Ocean, or Unowned pixel). I also keep a list of neighboring territories. Now, I can't store an array of 3000 coordinates in a database efficiently when I only really need the border. I aim to draw only the world map with the borders of each territory drawn in a layer above. So I need to convert the border to an SVG Path string. The Borders list is unordered when the generator finishes. For each border pixel, I go clockwise around the pixel and look for another, and progressively create a SVG Path string. I can't seem to efficiently parse the borders without getting stuck. Another problem is that there may be "lakes" in the middle of the Territory, and Borders are added around those as well. These don't have to be included in the path string. Territories can also wrap around horizontally (like Google Maps for instance), splitting the territory in two. So the final result of my algorithm would ideally be an LIST of SVG Paths, each representing individual parts of the territory polygons. But, how do I do this efficiently? Is there another way to efficiently store a list of potentially thousands of coordinates representing the shape of the territory? Each white line that sticks out from the coastline is a river. You can also see a lake in the middle of the lower green territory. PS I was unsure of a title, if a mod would like to change it.
5
Procedural generation of heightmap for non rectangular surface I'm working on procedural generation of terrain for a continent, meaning I need a wide range of hills, mountains and valleys generated around the continent. For mountains I've adopted Amit's algorithm for island generation, which produces quite good looking mountain with very clear ridges, slopes and everything else mountain tend to have. Now my problems is with some smoother hilly terrain. Due to a hexagonic nature of my continent, the mesh is subdivided into triangles. Also due to needing multiple mountains hills valleys I also split my continent into sectors, which are then stitched together easily due to the fact the edges of the sectors always have zero elevation. So the constraints are the following The surface is hexagonal, this actually is less of a problem, since I can still generate elevation for "square" grid and use bilinear interpolation on "real" hexagon verts. The surface is not a square, this I have absolutely no idea how to deal with. Now most of the terrain generating algorithms always generate the terrain on a square surface, midpoint displacement, noise, you name it. Also they don't generate zero values on the edges, which is a strict requirement for me. Now I would really like to adopt the double simplex noise approach, but once again, I need a way to force it to always generate zeroes outside of the bounds of my polygonal sector (which obviously varies), and smooth values inside the bounds, which would form nice hilly terrain. Question is... is it even possible, or should I be looking for a diferent approach?
5
How can I generate natural looking tree leaves in a Minecraft like world? I'm moving from working on 3D block world terrain to more specific features like tree leaves and ore veins (the ore veins will likely be done with my existing Perlin noise for the terrain). One thing I'm having with is properly generate clusters of blocks (for example, leaves for trees). I've tried looping through a radius and randomly skipping blocks so it seems more natural but this still doesn't look natural enough and also makes it based on a cube shape to start. I want some trees to have more of an overall sphere shape to the leaves, or some to have a cone shape. I haven't really found helpful info on how to loop through coordinates of shapes other than a cube. What technique(s) should I employ to generate natural looking clumps of tree leaf blocks?
5
How do I perform interpolation between noise values sampled at a lower resolution? I'm doing some experimentation with terrain generating using a method similar to that described in this blog post by Markus Persson, where I use 3D simplex noise as a "density" value. Like him, sampling every single position in a chunk was simply too much of a performance drain, so I sample at a lower resolution. This works perfectly fine if I just use the noise values sampled at a lower resolution as densities, but this obviously leads to very "chunky" terrain, like this The relevant code used to generate the noise values and the voxels that make up the above terrain looks like this Initialize the width, height and depth of the noise values map, and initialize the noise value map itself. int noiseValuesMapWidth (this.ChunkWidth this.HorizontalNoiseResolutionDivisor) 2 int noiseValuesMapHeight (this.ChunkHeight this.VerticalNoiseResolutionDivisor) 2 int noiseValuesMapDepth (this.ChunkDepth this.HorizontalNoiseResolutionDivisor) 2 float ,, noiseValuesMap new float noiseValuesMapWidth, noiseValuesMapHeight, noiseValuesMapDepth Fill the noise values map with noise values. for(int x 0 x lt noiseValuesMapWidth x ) for(int y 0 y lt noiseValuesMapHeight y ) for(int z 0 z lt noiseValuesMapDepth z ) float xSeed Mathf.Abs((x this.HorizontalNoiseResolutionDivisor) this.transform.position.x seed) float ySeed Mathf.Abs((y this.VerticalNoiseResolutionDivisor) this.transform.position.y seed) float zSeed Mathf.Abs((z this.HorizontalNoiseResolutionDivisor) this.transform.position.z seed) noiseValuesMap x, y, z Noise.Generate( xSeed this.NoiseScaleX, ySeed this.NoiseScaleY, zSeed this.NoiseScaleZ ) NoiseFalloff( this.FalloffACoefficient, this.FalloffBCoefficient, this.FalloffCCoefficient, (float)(y this.VerticalNoiseResolutionDivisor) (float)this.ChunkHeight ) Generate the chunk's terrain itself by iterating over every voxel position and generating simplex noise values at a lower resolution. for(int x 0 x lt this.ChunkWidth x ) for(int y 0 y lt this.ChunkHeight y ) for(int z 0 z lt this.ChunkDepth z ) int noiseValuesMapX (x this.HorizontalNoiseResolutionDivisor) 1 int noiseValuesMapY (y this.VerticalNoiseResolutionDivisor) 1 int noiseValuesMapZ (z this.HorizontalNoiseResolutionDivisor) 1 if(noiseValuesMap noiseValuesMapX, noiseValuesMapY, noiseValuesMapZ gt 0.0f) this.SetVoxel(new Stone(), x, y, z) Obviously, the solution to the "chunky" terrain is to interpolate between each of the sampled noise values, but I have no idea how to perform that interpolation. How is it done?
5
Generating a town layout in a grid I want to generate a town layout in a square grid (rendered isometrically, but that doesn't matter) using the following elements 2x2 Houses Roads, 1 unit wide Canals, 1 unit wide Sample layout I always have a specific number of houses, and as many roads and canals as necessary to connect them all. The houses need to have two pieces of road in front of their front door (which is always pointing to the right) It would be nice to have fields of grass (emptiness) inbetween. Is there a ready made algorithm for this? If not, what direction should I be thinking of to implement this?
5
Zooming into generated map I have generated a 1024 X 1024 heightmap using Open simplex noise. Now i want to zoom into a 64X64 area. Every pixel in the 64X64 is not 16X16 on the larger scale. I tried just generating the area, but problem is, that I want to also calculate normals from it, and the normals are different for the zoomed in area from the big map. The difference comes from the fact that on the big map the height difference between 2 pixels can be quite large, but when zoomed in, new pixels are place between the original 2 so if now normals are calculated, they are totally different. How can I zoom into an area of a generated heightmap but retain the normals? On the left is the large scale map and on the right is the zoomed in area. Zoomed in area is the upper left corner of the large scale map. As you can see the normals are completely different. Both of these images are textures. There are no meshes or anything only textures, and there will not be any meshes in future either. This is how I calculate normals from heightMap. u noiseValues x (y 1) width r noiseValues x 1 y width Vector3 up new Vector3(0, 1, (noiseValues index u) 100) Vector3 across new Vector3(1, 0, (r noiseValues index ) 100) normal across.Cross(up).Normalized() normal (normal new Vector3(1, 1, 1)) 2.0f After updating these lines in normal calculation Vector3 up new Vector3(0, 1 zoomFactor, (noiseValues index u) 100) Vector3 across new Vector3(1 zoomFactor, 0, (r noiseValues index ) 100) This is the result after adjusting normal calculation
5
How to paint regions of a map with visually different colors I'm learning some concepts of procedural content generation. Now I'm generating a map with regions and each region has a diferent colors generated in a pseudo random way. My problem right now is that most of times (more probably when more regions exists), some regions has colors that are visually similar. I want to control that adjacent colors are visually different, but still with some random component. What make colors different?
5
map world "decorator" algorithms patterns I've spent a lot of time working with perlin simplex noise for different styles of map gen, but I'm having a hard time finding advice resources on how to populate the map with "world decor" that have some patterns to them... not just a random flower or tree. I can control where on the map they spawn based on the height temp values, but what are some good ways to control "patterns" the items spawn in? For example, I want a specific plant to always spawn in clusters, but I want it to look natural and random a bunch all together in a cluster and some individuals further out. I don't want all spawn instances to look the same. A good reference is the Minecraft ore spawner they're always in random configurations with some min max size variations. Larger veins are even more rare.
5
How to generate a city street network? I would like to create a city generator for a game, but I am facing a problem at the very start of the generation the road system. As it is a medieval world, I don't want a grid plan like many modern cities. I would ideally prefer a pseudo random generation of large avenues and smaller streets, where it could be possible to get lost, but with still some logic not a complete labyrinth. Something that would look like a naturally grown town. In order to keep it simple, let's say my cities would be on flat and stable terrains, without any river crossing or relief problems. I could try to integrate it to a solution after. I didn't decide of a precise size or disposition for my cities, so if you have a solution that would work only with cities of a precise form (square, circle, rectangle etc), I would take it.