What makes a computer opponent feel alive? Are there any recommended blogs or whitepapers that talk about making the AI in an RPG game feel more real? (Specifically in turn based combat.) I know something must be out there, but I am only finding papers that talk about algorithms behind the AI. I am looking more along the lines of "this is what makes a computer opponent feel alive". Taking risks, going easy, retreating, etc.... So many awesome answers, and I wish I could accept several of them. Thanks everyone!


Puzzle design in Adventure games Creating interesting, original, logical, thoughtful puzzles is an art. What techniques and methods do you use to create good puzzles? Do you write storyline before designing puzzles or combine these 2 processes?


Qix diagonally adjacent movement I'm implementing a Qix clone game and I do not have any problems with implementation but rather with possible scenario. Is this a valid scenario for this game and if yes how exactly should gameplay go in this case? Black Filled, Red Current Player's Path, Blue Player If this is a possible scenario, then after completing the path player will end up with two diagonally adjacent rectangles. After that player can start moving from the bottom of the top rectangle to the right. In this case it should be immediately considered as a complete path and fill 1x1 square or player can create a path adjacent to the top of the bottom rectangle?


how to devise a scoring algorithm based on elapsed time and number of moves I want to devise an score algo for my game. I want to award high scores to players who achieve the goal in minimum time and least number of moves. I did this but its not going correctly var score ((finishSeconds moveCount).toFixed(2) 100).toFixed(0)


How to implement "identify item" feature in RPG In many games there is an approach that you can't use item that hasn't been identified. And usualy you can't identify it by just using it. While this approach simplifies a lot of things it just doesn't feel right to me. It doesn't make sense that I can't equip an armor or sword because I don't know if it has any magical features. I was thinking about some kind of "identification by use" system but I can't figure out a natural way to do it. What if I drink a potion that boosts my "Speech" skill for a period of time? Should my character instantaneously know that its skill have increased? Should it know the exact value? Or should I increase the skill behind the scenes but leave the displayed value intact and just give some subtle hint ("You suddenly (...)")? What about weapons and armors? It wouldn't make sense to know anything about it just by equipping it. One approach would be that attacking a target could update weapon's min and max damage basing on damage dealt but then it greatly depends on target's defense and resistances (I'm not sure if that's a bad thing though). Of course there are conventional ways like identification scrolls and I do have them but I was hoping for some alternative (not a replacement though, you probably can't know everything about every object only by using it). Has anyone ever thought about it and can share some insight?


Armor VS Weapon types I have these armor types LEATHER MAIL PLATE which are, basically, light, medium and heavy, and these weapon types BLADE PIERCE BLUNT I need a sensible 3x3 table which tells what armor type is succeptible to (and, possibly, good against, though it's not necessary) which damage type. In other words, how good the mail armour actually is against pikes arrows, etc... Any ideas? P.S. Wikipedia search and personal gameplay experience didn't help me too much, as both are mostly concluding the heavier, the better.


Tweaking incentives for lottery with a twist I have been developing a game which is a lottery where your chance of winning is proportional to the square of your bet. To prevent people from overbetting the pot (optimal strategy shouldn't just be to bet as much as possible, I think), and to make subsequent jackpots appealing, I've made it so the winner gets (current round bets past round leftovers) 2. 48 of the jackpot goes forward, and 2 of the jackpot goes to the house. This is generally working, but when there are not many people on the site, one person will sit there and drain the pot every round with the minimum bet. Though I think the concept is pretty cool, I have the feeling that some small tweaks could make a big difference. Any ideas how to get the pot to grow as big as possible? Apologies if this is not the right place to post.


Is there a site where people discuss game concepts and questions in general? I like making game concepts for fun, as a hobby. I don't think that all my game concepts are amazingly awesome and have to be created and would revolutionize the industry. I just want some people to talk to that have the same hobbies as I do. To be able to discuss ideas and point out the pros and cons.


How do I summarize a game idea into a short document? I have a lot of game ideas, but never the time to work on them. I don't want to lose these ideas, so I want to 'store' them somewhere to come back to in the future. Sometimes an idea isn't really that good, and coming back would help me decide whether a game idea is worth pursuing. I plan to keep these in some kind of catalog form. I would like to be able to capture the 'feel' of a game in as few words as possible. Even if looking back at the design a few years later, the feel and atmosphere of the game should be recoverable very quickly. This isn't really a full design document, but something like a 'one page' summary.


Is a Stamina Bar (ala Dark Souls) a good idea for a casual player target group? We all know the "Stamina Bar". For those who dont Its a "Bar" (usually right below your life bar) which prevents spamming the attacks as much as you want. Attacking will also reduce your stamina and you need a certain amount of stamina to use Attacks. Usually blocking , rolling and other things also require and reduce your stamina. Its a great way to balance the a real time action battle system. You can upgrade your stamina which is cool too because gives you a feeling of progress and add a little bit of fun there. Anyway The Question here is Is this "okay" for "Casuals"? I have a game which is open world ish and you can walk around and fight enemies and fight bosses too. But the game seems "too easy" now. You can basically just spam your attack button and every enemy is easy. Even the bosses. A way the fix this is the stamina bar. But wouldnt that overwhelm the casual players ?


How to deal with Character body parts from Design to Cocos2d I'm trying to figure out the pattern the game developers use together with game designers See the picture below with the independent parts Questions 1) Should I create different image parts from different body parts or keep frame by frame animaton? (I know both can be used, but I'm trying to figure what is commonly used in the industry) 2) If I'm going to generate different image parts from different body parts (which is I thing is more logical) how would I export that to Cocos2d (Vector or Bitmap)?


Anyone know of other unique playable archetypes? Well I like to play games that give me a wide breath of options. For most part I see games implementing certain archetypes like the usual RPG trinity (tank, DPS and healer). So far the most archetypes I've seen are in fighting, card and strategy games. Fighting games archetypes I've seen are Rush down (GG Accent Core Venom, Kof 2k1 heidern) Grappler (SF Zangief) Zoning (SF Dhalsim, KoF Billy Kane) Ranged(GG Dizzy) Trapper (GG testament) Well rounded (SF Ryu) Status effects (GG Baiken) Chance (GG Faust) Counter (GG Baiken) Time (Arcana Heart Anutpada, Psychic force Wong, Jojo's Bizarre adventure Dio) Positions control (Arcana Heart Dieu Mort). Card Games Burn, milling, OTK, counter, graveyard based, trapping (Yu gi oh), remove from play, restrict. Strategy games League of legends have a number of them so I'll just link to their wiki. Note not all are archetypes though, add to that builders as well. So any other that you guys might know that is worth mentioning?


Simultaneous game states I think I understand the basic idea behind a Finite State Machine based game loop. But I'm trying to write a little game in which the same object can simultaneously be in multiple, independent states. At least that's what I want to do. To give you an idea Robot may be in FleeState and FireLaserState at the same time, besides in each of them individually at any time. Would something like this be possible using the FSM pattern? Or ought I to look elsewhere? After all, does the whole idea make sense? Pasted from my comment below A little clarification of why I'd like states to be kept separate I want the player to have the ability to program simple state changes before a game... say "if (health is way too low) flee". But then I want multiple such rules to be active simultaneously in order to keep the game interesting, and cannot know beforehand which other states may be active.


Do players like holiday events? I remember back when I played runescape, they always had these really interactive holiday events. And players would be squirming all around trying to find where it was. After you would complete it (it was like a mini quest), you would be rewarded with some kind of item. I thought it was really cool, but if you missed the event you'd be pooped out. And now days, I play simpler games, such as parallel kingdom, and they just have boring items that you can buy for holidays. Is it worth making holiday events, or could you get by without them?


How can I handle the difficulty level between co op and single player? I'm working on an action adventure game, and I was considering adding a co op option. What I'm trying to decide is if when another player joins the game, if the game should get harder. On the one hand, I don't want the game to just get easier. On the other hand, I don't want to break continuity by making enemies suddenly stronger, eg I was able to take this down it two hits before, why does it take four all of the sudden. I do not want there to be an "AI co op" that comes with you in single player, I think that would make the game worse since it would detract from player agency. How can I handle this? How can I keep the game challenging when a second player joins in?


How can I know how big my game "world" should be? here is the world map (randomly generated) for a game I'm making The green rectangle corresponds to the size of one screen. Each pixel represents 3x3 tiles in my game, this makes the whole map be roughly 7,9 km (2,3 x 2,3). How can I assess if the game is too big or too small?


Factors to consider when building an algorithm for gun recoil What would be a good algorithm for calculating the recoil of a shooting guns cross hairs? What I've got now, is something like this Define min max recoil based on weapon size Generate random number of "delta" movement Apply random value to X, Y, or both of cross hairs (only "up" on the Y axis) Multiply new delta based on time from the previous shot (more recoil for full auto) What I'm worried about is that this feels rather predicable, what other factors should one take into account when building recoil? While I'd like it to be somewhat predictable, I'd also like to keep players on their toes. I'm thinking about increasing the min max recoil values by a large amount (relatively) and adding a weighting, so large recoils will be more rare it seems like a lot of effort to go into something I felt would be simple. Maybe this is just something that needs to be fine tuned with additional playtesting, and more playtesters? I think that it's important to note, that the recoil will be a large part of the game, and is a key factor in the game being fun challenging or not.


How can I discourage camping while still supporting a "sniper" style of play? I am trying to add features into a third person shooter that suit a sniper style of play, in addition to the current rush deathmatch style it was designed for. The current gameplay is similar in style to Gears of War and Battlefield, perhaps similar to Call of Duty in terms of combat ranges but a little slower paced. The levels are similar in size to large COD maps, or medium Battlefield maps. Two things which I was planning to add includes some long sight lines and also some "sniper nests". I am concerned though because these two features can open the door to a lot of camping. Sniping and camping are not the same things in my opinion, but it can be easy for campers to abuse such features for easy gain, when they were intended to promote tactical sniper use. That said, I don't believe in blaming the flaws of a game on a player's choice of play style. Sniper Uses long range rifles, may stay in a specific spot that is tactically advantageous at the time, but knows how to move to other locations good for sniping. Provides spotting and suppression for more offensive rush style team members. Camper May use any weapon, always stays in the one spot and waits for players to pass by, leading to easy low risk kills. Follows the same strategy regardless of what is happening in the game match. Is more focussed on own performance as opposed to supporting team members. So, I am trying to think of some ways in which to try to discourage camping while still allowing legitimate sniper play and preserving the original rush gameplay.


Procedural generation of semi correct planetary systems So there are lots of resources you can find via Google or using the search here on how to procedural generate a whole galaxy. But I couldn't find any good resource on how to generate planetary systems that follow these criteria The systems don't have to be accurate simulations of orbits but should be close to plausible orbits. I don't care about any simulation that cares about how the system might look in 200k years, the orbits could be rock solid. The main problem I'm facing is how to randomly generate a system that could be seen as plausible. This becomes especially interesting when you have a system with a binary star. Just randomly creating orbits won't make up a plausible system, you'll end up with obviously non working orbits. Yes, I'm aware of the N body problem ) but this doesn't help me, at least I think so, to solve the problem of generating a plausible system procedural? I think you could just randomly spawn planets on their orbit and give them a mass and then use the N body mathematics to calculate if they're more or less valid, if not start over and randomly generate new orbits until you get something that matches, but this would be very inefficient.


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!


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!


Linear Gradient with angle forumla EDIT Ok so the question here is how to you generate a linear gradient along a vector. Here is the function i'm looking for function CreateGradient(x,y, x1,y1,x2,y2) x and y are the point in our image we are looking to create the color for in grayscale x1,y1,x2,y2 is the vector in which the linear gradient should run Can be in any language What I have so far (that doesn't work) var width 2.0 var offset 0 var convX ((x RES) width width 2) offset var convY ((y RES) width width 2) offset var angle Math.atan(y1 y2, x1 x2) var rx Math.cos(angle) var ry Math.sin(angle) var here convX rx convY ry var start x1 rx y1 ry var end x2 rx y2 ry var lerpValue (start here) (start end) var val lerp(0,255,clamp(lerpValue,0.0,1.0)) RES is the total resolution of the picture. val in the value (0 255) which represents the R G and B values of the pixel Final Edit I have it now thanks code for the future var x1 0 var y1 0 var x2 255 var y2 255 var dx x2 x1 var dy y2 y1 var rx x x1 var ry y y1 var t ((rx dx) (ry dy)) ((dx dx) (dy dy)) return lerp(0,255,t)


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?


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...


How do Minecraft know where village's buildings are if the village is not generated yet? I'm trying to understand how chunk generation works in a deep level and all the information I found does not explain how the villages are generated properly without visual glitches during generation. I mean, if you are in an area where you should see some buildings from a village, how does Minecraft know that they must be rendered? Minecraft generates villages from a main "structure" that probably it is not generated yet. This video explains the village's generation properly. So with that in main what should happen is that you could see builds appear from time to time when the "village center" of a village is generated in a new generated chunk. Here you have a visual representation of the circumstances I'm describing. The buildings inside the loaded area shouldn't be shown if the village is not generated yet The only explanation I can think about is that Minecraft generates way more chunks than the ones that are visually loaded to avoid this problem. If this what happens, what is the generation area compared to the visual loaded area?


Working with 3D Noise I am using a simplex 2D noise to generate my worlds so far. This however was never the plan and has the downside that I basically can only generate a heightmap. Instead I want to aim for floating islands scattered in the sky, but I fail to see how I can utilize 3D noise properly for this. Based on a simplex 3D noise function I am currently generating noise like this float sc perlin noise3 ex(const sc perlin t perlin, float x, float y, float z, int octaves, float persistence, float base frequency, float base amp, float lacunarity) int i float freq base frequency float amp base amp float max 1.0f float total 1.0f for (i 0 i lt octaves i ) total sc perlin noise3(perlin, x freq, y freq, z freq) amp max amp freq lacunarity amp persistence return total max Problems start there first of all I think I got octaves wrong, at least the outcome is very unpredictable. Persistence would be a value smaller 1 that removes the effect of the higher octaves. Secondly however I have a general problem understanding how 3D noise works. From my understanding a value lt 1 could mean air, a value 1 would be solid and 0 is the thin line between them (the surface). First of all however I get a lot more values below zero than above zero, so I had to flip those two around. That seems odd, do I have the math wrong? The actual problem however is that I cannot locate "islands" properly. Say I have a container of 256 3 in size and I want to have one large island in there with maybe up to three smaller islands in there I have to ensure that no island is cut off at the edges that I only get two even sized islands in my block I have some better control of the actual appearance of my island. For instance it would be nice if it had an actual flat ish surface where I can put a heighmap on top of that for mountains etc. Based on that I have the feeling I am on the completely wrong track here. Can anyone give me some pointers on where to head now? Generally speaking I would like to have something that looks like this floating island


How can you procedurally place objects in a non gridded game? This is a follow up question to this question. I mistakenly worded the question, but got a good answer before I could correct myself, so I didn't want to delete it. Sorry! Now that I know that it is possible, I'd like to implement procedural world generation, but I don't want it to look gridded or blocky, where everything is obviously placed on an integer grid. I know that you can do this in gridded worlds by inputting a square's x and y into a noise function, or similar, but how can I generate a more natural looking object placement using procedural methods? This is in the context of an adventure game, if it matters.


How to do Marching Cubes Meshing in unity 3D I'm getting very peculiar results from my marching cubes based surface generator within unity and figured this must be a pretty common problem that has been solved already, so I thought I would extract this out as a tiny example project that only includes the broken generation code ... http ccoder.co.uk files mc.zip ... if you download and run the example you should get something like this ... ... so my question is How can I resolve the logic in the marching cubes meshing code to generate a complete mesh with consistent uv mappings all the way around? If someone can solve this I will edit the sample in this question with the solution so others can download this solution in the future. UPDATE So I figured out what was causing the vertex generation issue, it looks like paul burkes lookup tables however result in some cases returning the vertex data in different orders to others which appears to be the cause of this uv issue (see image, updated) I have updated the sample project too, anyone fancy debugging the marching cubes tri table?, something tells me this will be a long winded task!


How to form a sphere from Voxels I want to form a Sphere given radius from blocks given size. And can't figure out the code algorithm. Any help appreciated. Edit I dont wan't the Sphere to be filled, just the outer shell Edit I tried this function ds(r) for tx r, r do for ty r, r do for tz r, r do if math.sqrt(math.pow(tx, 2) math.pow(ty, 2) math.pow(tz, 2)) lt r 2 then Terrain FillBlock(Vector3.new(tx, ty, tz), Vector3.new(1,1,1), material) end end end end end But it's very much iterations and so slow and odes the filling that is extra calls.


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.


How can bays and straits be determined in a procedurally generated map? I've got a procedurally generated map using Voronoi cells, with a defined sea level and a believable height map. So far, I've been successful in labelling certain geographic features land, ocean, lakes, rivers, estuaries, confluences, mountains, and biomes. Biomes include tundra, boreal forest, grassland, and temperate forest. There are also a couple other biomes there but for my purposes they aren't important right now. I'd like to label bays, and straits next, but I'm at a loss on how to do this properly. A bay is a recessed, coastal body of water that directly connects to the ocean. A strait is a naturally formed, narrow waterway that connects two parts of the ocean. Basically, where two pieces of land almost touch and there's ocean on both sides. Also called a "channel". For determining features, I can loop through any feature by type like this for each (var feature Object in geography.getFeaturesByType(Geography.LAND)) loop through lands for each (var cell Cell in feature.cells) loop through cells for each (var neighbor Cell in cell.neighbors) loop through a cell's neighbors trace(neighbor.hasFeatureType(Geography.LAND))


Procedual terrain generation and biomes predetermined variation So I already have some (currently 2D possibly 3D later) simplex noise generation going, and with some experimenting I can make a map for plains, hills, mountains, etc The problem now is I want to combine those together to create a larger more interesting map. For each "pixel" in the height map I provide generate a biome type which has a bunch of parameters to define how the height value is calculated etc. i.e. I want to be able to say mountains here, river through there, flood plains next to it, etc and have them blend together. The problem is this leaves nasty borders since between them even the simplex input values change suddenly (due to the x z scaling being different, perhaps not the best way?). I considered just doing like a post process to smooth out the height values along the borders, but this would still leave often steep (and uninteresting near constant gradient) slopes since I could have a valley one side and a mountain peek the other side. I am sure there must be a better fairly standard way to do this, but have not found much searching around, at least for this sort of noise function (midpoint displacement can be seeded with initial values at a low resolution, but doesn't seem viable if not generating the entire map at once) double getHeight(int x, int z, Biome biome) double nx x double nz z nx biome.xzNoiseScale() e.g. 1 64 ny biome.xzNoiseScale() double noise fbm(nx, nz, biome.noiseOctaves(), biome.noiseLacunarity(), biome.noiseGain()) return biome.baseHeight() noise biome.heightVariation() double fbm(double x, double z, int octaves, double lacunarity, double gain) double amp 1 double freq 1 double sum 0 for (int i 0 i lt octaves i) sum amp noise(x freq, y freq) amp gain freq lacunarity return sum


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?


Procedural Turn Based Puzzle Generation? Alright, we have a large set of possible moves (what the player is allowed to do). We also have a well defined state of success that defines the desired goal. We want to generate a configuration where for the purpose of this question, only 1 set of moves leads to a victory within k steps. We also have a solver that can find all possible solutions for a given configuration problem. For example let's take Chess, how would you place a set of chess pieces on a board such that only a specific set of moves by White will result in Check Mate?


How to create polygons from tilemap areas? I'm currently working on a project which needs simple AI's to walk around using pathfinding. I'm trying to find a way to generate a polygon based on the connected tiles (explained below), an i'm wondering how to do this. I know about the flood fill algorithm, but have never used it before. This is what a map (could) look like (maps are created by the players) Basically, i wan't the yellow outline as one polygon (vector2 array) and the red outline area as another polygon (vector2 array)


Calculating distance in procedurally generated mesh LOD system I'm creating a procedurally generated planet mesh based on quadtree splitting to support LOD system. I cannot find any relevant info how can I calculate distance between the camera and LOD chunks. I have a surface view in my game where the camera is near at the planet surface and can move around the planet, it has also some zoom levels (elevation of the camera) but camera always looks in the direction to the surface like in strategy games. A Should I use simple distance calculation between the camera and the center of the chunk mesh or edge vertices of the mesh? B Is it better when I use Great circle distance? C How should I modify the calculation when camera's elevation can be changed? D How can I determine the distance limits for each LOD level? Does it depend on the project or does it have some basics? Update 1 Here is a sample when I use simple distance calculation between the center vertex of the meshes and the camera object the camera is right above the point A point A is the center of the level 0 mesh (it is not visible because it is already divided) when the camera reaches the distance limit of B (which is a level 1 mesh and it is already divided in the sample) then it will be divided into four meshes where the centers are C, D, E, F at this time the mesh where the center point is F will be also divided because the distance of the previously generated F point is under the current LOD level minimum distance So the base problem this after dividing a mesh the new submeshes can be also divided because the distance is under the current LOD level minimum distance. And I think it does not work like a normal LOD system because there is a level 1 neighbour next to level 3 mesh. Update 2 I tried some approaches to get the right distance calculation minimum distance between the corner edges (4) and the camera minimum distance between the edge center vertices (4) and the camera minimum distance between the corner and edge center vertices (8) and the camera Important thing I use great circle distance calculation. I got wrong results using these until I created a new algorithm to define transition distance limits. Maybe it is not a very well algorithm but currently this is the most acceptable result. Here is the algorithm Note ignore the heightmap (noise) during the calculation, only a simple sphere with radius R is used calculate the width of each meshes (arc length) decrease the distance limit in each LOD level float meshSphericalWidth 2 Mathf.PI shapeGenerator.Radius (90 (float)(CurrentLevelOfDetail 1) 360f) float currentTransitionLimit meshSphericalWidth Mathf.Pow(0.90f, CurrentLevelOfDetail 1) After this distance calculation change I didn't notice any significant difference when I use the corner or the edge vertices to get the minimum distance. And I got this. Green is LOD1, yellow is LOD2 and red is LOD3. It seems a good progress but we can see sometimes between two chunks the LOD level difference is 2. Can I fix it with another distance calculation adjustments or is it a different story? I want to solve the cracks between meshes.


Using QuadTree for Procedural Generation so I've been trying to start a new project that focuses on procedural room generation similar to what is seen in Binding of Isaac. I plan to have the code use a QuadTree to help determine where rooms should be placed. Each node in the quad tree represents any of the possible 4 directions the next room can be placed. The problem is this. I'm not sure where to start when trying to implement the QTree and haven't found good resources on the topic. Most implementations of QuadTrees in a procedural generation context use them for partitioning spaces and placing rooms within the partitioned spaces. Not sure if that's what I want to achieve. I'm also unsure of weather I should be going in this direction or if there's a more optimal solution?


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!


How does one generate mountains out of a Fourier transform? I am watching this IGN video of No Man's Sky in which the founder programmer of this game talks about how different is his game from other games. Here he talks about how mathematical equations instead of art is used to render graphic of planets and animals and even their behavior. Then he says that instead of seeing mountains he sees only equation like Fourier transform. I have no knowledge about game development and its intricacies, but I'm curious how one might use a Fourier transform or similar mathematical operation to generate terrain without art?


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).


Perlin Noise for generating terrain in a 2D side scrolling game. Is there a way to make variations in noise's amplitude? For example if my generated levels look roughly like this But once in a while I would like to have the "amplitude" rise say 10 times than the rest of the level, so that it would look something like That is, once in a while there are deep "trenches" in the level. Now I know that my terrain's Y values are always between for example 200 and 1000 pixels. I there a way for them to mostly be in that range, but once in a while there is a drop to for example 10000 pixels?


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.


Basic Random Tile Map Generation Currently I've got a map like this It's pretty simple but what I want is that area of tiles to be random, with the number of tiles present being random (Within a minimum and maximum amount of tiles of course) and the positions of the tiles being random (but still all connected to each other), but I'm not exactly sure how I should go about implementing that. I'm sort of looking for a system that will generate random sections of tiles, a bunch of tiles within a group at random positions around the screen with all these sections being connected to each other via a larger section of tiles. Like the example shown in this perfect drawing I've quickly done Each square would be a group of tiles, they're all of different shapes and sizes but all connected together via another large (or small) group of tiles in the middle. I have looked into grid map generation before making this post but all the information I found would tend to go over more advanced map generation methods that have multiple layers which is not really what I need for my game so I was wondering if someone would possibly be able to advice me on what the best method would be to do this? I'd very much appreciate it.


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


Godot Procedural map, Need help to avoid overlapping areas I have piece of code that using a tile set, i can draw an area of what is going to be a small town city. The code seed cities, make an X number of cities randomly on the map, whereas draw city just paints the city over the screen. My problem is that from time to time, 2 or more citites overlap in the map. func seed cities(num cities) var initial point var final point for i in range(0, num cities) initial point Vector2(int (rand range(0, screen size.x 10)), int (rand range(0, screen size.y 10)) ) range x randi() 10 5 5 being minium longitude range y randi() 10 5 5 being minium longitude final point Vector2(range x, range y) var city position initial point initial point, final point final point cities.append(city position) TODO check if there is another city before draw city(final point,final point) now, i tried to use the function line intersects line 2d , but the appears an error saying that line intersects line 2d is not declared on the current class, so i have another method of checking if the cities overlap. i was thinking of using that or creating an area2D with code to check if there is a collision. func draw city(initial point, final point) for x in range(0,final point.x) Objects.set cell(initial point.x x , initial point.y,4) Objects.set cell(initial point.x x, initial point.y final point.y,4) for y in range(0,final point.y 1) Objects.set cell(initial point.x, initial point.y y,4) Objects.set cell(initial point.x final point.x, initial point.y y,4) Any ideas on what i need to import to use line intersects line 2d? What other way i can check if 2 cities overlap before saving it's position and draw them on the map?


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.


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?


How to round points to an arbitrary grid on the surface of a cube? I'm making a PCG game where I have points scattered or projected onto the surface of a cube, which is centered on origin with a "radius" of 1. That surface is a grid and I want to associate each point to the center of each proper cell's grid. After detecting which face the point is by taking max(x,y,z) I used that formula halfTileSize floor (3dpositions gridDivision) gridDivision EDIT everything above work, everything below is useless, the problem was outside influence from obsolete code But it doesn't round the point to the correct grid cell on the surface. There is a problem where front and back don't return the same result, or it skips a row with some condition, and it also rounds to the wrong nearby cells. I tried to replace the floor with 3dpositions.xyz lt 0 ? ceil(3dpositions gridDivision) floor(3dpositions gridDivision) That didn't work either. It seems to work fine on a 2d planes, which I used to conceptualize the formula, but in 3D I'm at loss as to why it wouldn't work, since I basically reduce the problem to 2D anyway... Any help to create a formula that would round the points properly into the right cell?


How do you go about distributing resources procedurally in a game? What I mean by resource distribution is the placement of items in the game. More specifically "minable" items in builder resource gathering games like Factorio, Oxygen not included or and RimWorld. The games all place clumps of the same items around each other. For example in Factorio there will be fields of resources like coal, iron, copper, etc. which will spawn together in little clusters rather than there being single resource tiles being sprinkled around the map. See screenshot This is a similar behaviour in Oxygen not included, similar resources are more likely to be next to each other but depending on the rarity they can also be found alone as a single block. In the game there are also zones which denote what resources can spawn which appear to be preset locations and shapes as they are the same each game (with the types mixed up), but resources themselves are position procedurally. I grabbed a screenshot online and highlighted some of the resource types to make the distribution more obvious. The ideal answer will show what methods would work well to reproduce "clustered resource distribution", with advantages and disadvantages of a given method. It will not necessarily have code examples but rather the rough steps pseudocode that would have to be taken.


Perlin Noise Variations Currently I'm making a voxel survival game. About a month ago I embarked on procedurally generating terrain using Perlin noise. I understand how to use and apply it for the most part. However I do not understand how to vary terrain structure. Let me say that in a way you probably can understand because "me no grammar good". By changing frequency and amplitude I know I can change the resulting terrain, varying it from rolling hills to jagged peaks. However the end result will always be the same either never ending hills or never ending mountains. I don't understand really how I would mix those two "terrain structures" together to get area's of hills and area's of mountains.


Generate cave like Terrain in 2D I want to create 2D Terrain randomly. It should look like a connected Cave (Shown below). What is the best method or Algorithm to get similar results? The important part is the open area(green) and that it is fully surrounded by walls(brown). 4 Examples


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.


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.


How would you generate details like trees, water or caves in a 2D terrain? Yesterday I made a post about generating a 2D planet, which resulted in this I did it by subtracting a radial gradient from simplex noise (explained in my other post). Now of course thats a bit boring, what technique should I use to add details like trees, lakes or caves? Would be able to do something like this (but of course across the whole planet) I know doing it on a planet would make it a bit harder, because you would have to know if f.E. the tree is on the north of the planet or the south. To make it easier, if you want, just assume a flat 2D surface like this


Dungeon Generation with no corridors and room dependencies I'm making a game with a procedurally generated world created at the beginning of the game, consisting of several areas represented by grids (say, 8x8, 9x6, the sizes would ideally be arbitrary). These areas are supposed to be connected to each other through a dependency list. A connection exists when at least 3 spaces of that grid are exposed between those two areas. In the middle cell of that 3 space connection area is the doorway between areas I've been trying to figure out a way to connect them, but it becomes increasingly complex the more areas you need to consider at the same time. I've tried some paper prototyping and while it's a very simple process when doing it visually, I haven't found out a good set of mathematical expressions that allows me to place rooms with the same efficiency by code. Here's a "simple" example I'm struggling with right now Area 'a' needs to be connected to 'b' and 'c' Area 'b' needs to be connected to 'a' and 'd' Area 'c' needs to be connected to 'a' and 'd' Area 'd' needs to be connected to 'b' and 'c' Consider, for simplicity, we're placing the rooms by their order of appearance on the list (I've tried others). So I'm approaching this as your standard procedural Dungeon Generation algorithm. We place 'a' anywhere on the board, since it's the first area. Next, we pick a wall at random and, since nothing is connected to that wall, we can place 'b' there Now we need to place 'c', but 'a' is already on the board, and has an occupied wall, so we decide to put it on another wall. But not every placement will do, because 'd' is coming up and it needs to be connected to 'b' and 'c' too I tried a possible limitation that 2 rooms that have the same set of dependencies cannot be on opposite walls, but even that doesn't guarantee success And in other cases, where the areas have different sizes, being on opposite walls can work Also, not considering a used wall is a flawed assumption since it rules out valid solutions I've tried looking up research on other Procedural Generation algorithms or similar, such as Optimal Rectangle Packing and Graph Layout algorithms, but usually those algorithms don't take into account every constraint of this problem and are hard to mix together. I thought about a bunch of approaches, including placing an area and backtrack until a suitable placement is found, but they seem very dependent on trial and error and costly in terms of computation. But, given the extensive research on the last two problems I mentioned, it might be the only best solution? I just wanted to see if someone has had similar problems in the past or is willing to help me figure this out and give me a few pointers on where I should start with the algorithm. Or, failing that, I'll have to look into loosening the constraints I've set.


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.


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?


Filling a room with random furniture This is a rather complex question and I'm more hoping for general algorithms anyone might have heard of. I wish to generate randomly sized rooms. Each of these rooms has a type and a corresponding list of furniture to be placed inside it (ie kitchens can have fridges, both kitchens and living rooms can have TVs, etc). Each piece of furniture has it's own collider (cylinder, cube, mesh...). Are there any good algorithms to randomly lay them out? The best idea I've managed so far is to subdivide the room into a grid the size of the smallest piece available. Then I would randomly place the furniture until every grid square is at least partially filled. However, this is hardly ideal and the rooms would more or less look like warehouses. Optional How do I randomly place the furniture in such a way as to make it at least look slightly realistic?


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.


Do 2 state cellular automata exist? I'm trying to implement a zone system into my game that randomly sets chunks (the cells) to a certain value from a list and that would effect nearby chunks. It's basically a cellular automaton in which instead of the cells being on off, they would have multiple options, like red green blue yellow brown or such. Do this kind of cellular automata exist?


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.


1D Perlin Noise Game in Unity I'm working on a 2D side scrolling game in the Unity engine. I am using the 1 Dimensional Perlin Noise function and using pseudo code. I can't use two links so I'll provide a link to imgur with the images and the links in numerical order. First link in imgur links to the pseudo code implementation of perlin noise I am using. My implementation so far is showing good results. Here is a picture This image uses the values Persistance 0.7 Octaves 4 From the first article I linked, it states Now, you'll want several different random number generators, so I suggest making several copies of the above code, but use slightly different numbers. Those big scarey looking numbers are all prime numbers, so you could just use some other prime numbers of a similar size. This block of text is referring to this part of code which is an Integer noise function float Noise (int x) x (x lt lt 13) x return (float)(1.0 ((x (x x 15731 789221) 1376312589) amp 0x7fffffff) 1073741824.0) Another site I found the author adjusts the Integer noise function from discrete to continuous (allowing the range not to be limited). I've made this change although I am not sure if my implementation of both links I've provided is entirely correct. The results are promising but when you change these variables values to Persistence 1 Octaves 8 the terrain starts to have little gaps at the bottom like so I am not quite sure how to fix this, I know lowering the persistence provides smoother results resolving this issue but that makes the terrain's amplitude rather low for a side scrolling platformer. Here is the complete code void Start () objectArray new GameObject width, height for (int i 0 i lt width i ) float x PerlinNoise 1D (i, persistances, octaves) for (int j 0 j lt height j ) objectArray i,j (GameObject)Instantiate (gameobject, new Vector3 (i, j x, 0), Quaternion.identity) float Noise(int x) x (x lt lt 13) x return (float)(1.0 ((x (x x 15731 789221) 1376312589) amp 0x7fffffff) 1073741824.0) float CoherentNoise (int x) int intX (int)(Mathf.Floor(x)) float n0 Noise (intX) float n1 Noise (intX 1) float weight x Mathf.Floor (x) float noise Mathf.Lerp (n0, n1, weight) return noise float SmoothedNoise (int x) return CoherentNoise (x) 2 CoherentNoise (x 1) 4 CoherentNoise (x 1) 4 float InterpolatedNoise (float x) int integer X (int)x float fractional X x integer X float v1 SmoothedNoise (integer X) float v2 SmoothedNoise (integer X 1) return Cosine Interpolate (v1, v2, fractional X) float Cosine Interpolate (float a, float b, float x) float ft x (float)Mathf.PI float f (float) ((1 Mathf.Cos ((ft))) .5) return a (1 f) b f float PerlinNoise 1D (float x, float persistance, int octaves) float total 0 float p persistance int n octaves 1 for (int i 0 i lt n i ) float frequency (float)Mathf.Pow (2, i) float amplitude Mathf.Pow (p, i) total InterpolatedNoise (x frequency) amplitude return total Thank you for your help and time.


Procedual terrain generation and biomes predetermined variation So I already have some (currently 2D possibly 3D later) simplex noise generation going, and with some experimenting I can make a map for plains, hills, mountains, etc The problem now is I want to combine those together to create a larger more interesting map. For each "pixel" in the height map I provide generate a biome type which has a bunch of parameters to define how the height value is calculated etc. i.e. I want to be able to say mountains here, river through there, flood plains next to it, etc and have them blend together. The problem is this leaves nasty borders since between them even the simplex input values change suddenly (due to the x z scaling being different, perhaps not the best way?). I considered just doing like a post process to smooth out the height values along the borders, but this would still leave often steep (and uninteresting near constant gradient) slopes since I could have a valley one side and a mountain peek the other side. I am sure there must be a better fairly standard way to do this, but have not found much searching around, at least for this sort of noise function (midpoint displacement can be seeded with initial values at a low resolution, but doesn't seem viable if not generating the entire map at once) double getHeight(int x, int z, Biome biome) double nx x double nz z nx biome.xzNoiseScale() e.g. 1 64 ny biome.xzNoiseScale() double noise fbm(nx, nz, biome.noiseOctaves(), biome.noiseLacunarity(), biome.noiseGain()) return biome.baseHeight() noise biome.heightVariation() double fbm(double x, double z, int octaves, double lacunarity, double gain) double amp 1 double freq 1 double sum 0 for (int i 0 i lt octaves i) sum amp noise(x freq, y freq) amp gain freq lacunarity return sum


What methods are there for representing 3D terrain? I'm making a terrain system which needs to be procedurally generated and would like to know my options. So far I know of Height field terrain, Vector field terrain, and Voxel terrain. Is there anything missing from that list?


Do I need multiple perlin noise generators for different features in terrain generation? I have a simple perlin noise algorithm in my 2d game, I feed it x and y location of a tile and get some value between 0 and 1. I then use a bunch of if else statements to break these numbers into terrain types 0 is water 0.5 and less is plain 0.6 and less is hill Then there's features like forests, but in the current system a hill cannot have forest on it. I'm using only 1 perlin generator here, and my question is whether I need to have multiple perlin generators with random seeds to control elevation, vegetation and other terrain features?


Smooth Biome transitions with tile map? I'm using a simplex noise system to generate height maps for an "infinite" 2d world map. It works perfectly I can define which tile belongs at which height value, etc. However, I'm trying to add in biomes I want different areas of the map to use tiles exclusive to that "biome". I've tried generating a second noise value divided by a larger number so that I can generate very large areas. That noise value determines the biome, and the noise value for tiles determines the tile inside that biome. This works ok but when the same noise value means different tiles in each biome, then you wind up with very ugly cut off lines between biomes. I tried adding the biome noise and tile noise together and only selecting the tile based on those. The edges were smoother, but there really was no actual use of the biome code just tiles locked to unique noise values, never overriding each other. What's a better way to do this, so that biome boundaries follow "features" of the terrain? I want them to be fairly large, but not cut through a "mountain" the boundary should follow the natural curvature of the height map values.


How can I add biomes to my generated world? I need a way to generate a world realistically. I want to generate worlds similar to dwarf fortress. My current code for world generation is this worldTiles ' ',',','.','.' def generateWorld(self, x 40, y 20) world for i in range(y) row for z in range(x) row.append(random.choice(self.worldTiles)) world.append(row) return world with the worlds it generates being this The world is ok, however what I want is biomes, not just completly random generation. In case it helps, heres how the current generation works A variable called worldTiles has alls the tiles the world can have. This is used by the function. The function, creates an array, and appends a row to it. The row is then added to the world, as another array. A example world might be ' ', ',', ' ' , ' ', ',', '.' , ' ', ''., '.'


How do I make a natural looking map from some Voronoi regions? I'm using Voronoi regions to create a map for my game, much like this. However, the lines are too straight and perfect. How do I make the borders more natural looking? As in, less like US state borders and more like international borders in Europe or Asia.


Town generation algorithms In this RPG.SE post a long lost page with several online generators is mentioned. I'm particularly curious about the way towns were generated. Take this image for example Although a lot of things could be improved graphics wise, it was very good considering the tools available at the time (mid to late 90s) The road layout seems fairly organic (even considering all roads are placed in an orthogonal manner). Not all roads are necessarily connected, but it feels right. Buildings are placed in believable spots. Even trees seem to be placed in logical spots. I think it would be fun to give it a shot and try it myself. Especially since my previous attempts have been too quot blocky quot You'll notice that I'm describing many of the qualities with not quite measurable adjectives (seems, feels, believable, etc) so I'm having a hard time translating them to instructions and ultimately to an algorithm. Are there any tried and true algorithms for town generation? I understand this seems to be too broad, so consider this If I asked for an algorithm for generating maps of continental land masses, I'd get references to Perlin and other noise algorithms right away closely followed by Voronoi. I've seen questions like this one but they seem to have a more concrete idea already in mind (ie 2x2 houses, fixed number of houses, canal and road placement restrictions). What I'd like to have is something less constrained. Except maybe for the grid layout, which should be a lot easier for a first attempt than, say, L system.


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.


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?


How would you generate details like trees, water or caves in a 2D terrain? Yesterday I made a post about generating a 2D planet, which resulted in this I did it by subtracting a radial gradient from simplex noise (explained in my other post). Now of course thats a bit boring, what technique should I use to add details like trees, lakes or caves? Would be able to do something like this (but of course across the whole planet) I know doing it on a planet would make it a bit harder, because you would have to know if f.E. the tree is on the north of the planet or the south. To make it easier, if you want, just assume a flat 2D surface like this


Huge procedurally generated 'wilderness' worlds I'm sure you all know of games like Dwarf Fortress massive, procedural generated wilderness and land. Something like this, taken from this very useful article. However, I was wondering how I could apply this to a much larger scale the scale of Minecraft comes to mind (isn't that something like 8x the size of the Earth's surface?). Pseudo infinite, I think the best term would be. The article talks about fractal perlin noise. I am no way an expert on it, but I get the general idea (it's some kind of randomly generated noise which is semi coherent, so not just random pixel values). I could just define regions X by X in size, add some region loading type stuff, and have one bit of noise generating a region. But this would result in just huge amounts of islands. On the other extreme, I don't think I can really generate a supermassive sheet of perlin noise. And it would just be one big island, I think. I am pretty sure Perlin noise, or some noise, would be the answer in some way. I mean, the map is really nice looking. And you could replace the ascii with tiles, and get something very nice looking.


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?


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.


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.


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!


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.


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?


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?


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?


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.


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?


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.


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!


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


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?


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?


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.


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!


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.


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?


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?).


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.


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.