Tag Info

New answers tagged

0

Following on vrinek's idea, how about growing the land (or shrinking the water) so parts you would originally be connected would be disconnected after the land is grown? This could be done like so: Define how much do you want to grow the land: 1 hex? 2 hexes? This value is n Visit all land nodes, and set all their neighbors up to depth n to land nodes ...


3

Typically the strategy is not to produce a spherical height map, but instead to produce a normal height-map and wrap it around a sphere. You can find some questions on the site already about this process. There are a number of strategies for doing this, some of them as simple as mapping the Cartesian coordinates to spherical coordinates, or warping the 6 ...


4

Here's a complete algorithm that I think should produce good results. Perform morphological erosion on the water area — that is, make a copy of the map on which each tile is considered water only if it and all of of its neighbors (or a larger area, if you have rivers wider than one tile) are water. This will result in all rivers disappearing entirely. ...


3

A quick and dirty way to identify a separate but connected body of water would be to shrink all water bodies and see if gaps appear. In the example above I think that removing all water tiles which have 2 or less water tiles connected to them (marked red) would provide you with the desirable result plus some edge noise. After you have labeled the bodies, ...


0

Do you have an rough idea of where the gulf is? If so, you can modify your flood fill to track the number of neighbouring but unexplored cells (along with a list of visited cells). It starts with 6 in a hex map and whenever that value drops below a certain point, then you know you are hitting a "opening".


6

What you're describing is the Segmentation Problem. I'm sorry to say that it's actually an unsolved problem. But one method I would recommend for this is a Graph-Cut based algorithm. Graph-Cut represents the image as a graph of locally connected nodes. It subdivides connected components of the graph recursively such that the border between the two ...


1

As Savlon suggested in comments, create the red objects first. You probably want to split your array into red prefabs and non-red prefabs. Your CreateGrid function will look like the following pseudocode: Repeat four times: place a random red object at a random point on the grid. Repeat for each grid square: if the grid square is empty (does not contain a ...


3

Here are four options that you can try: A) Scale & threshold existing output You can ensure that the gradient saturates at some maximum value before reaching any of the cell borders. This will tend to make small holes of uniform size, but you can introduce size variation by assigning a random scale factor to each seed point and scaling distances to ...


1

I have also implemented a chunked engine. The best way to think of it is to just think of the chunks as memory storage locations rather than as actual structures of the world. Then, whenever you generate content, generate it as though you had a giant array of arbitrary size. Just implement some functions like Voxel* GetVoxelAt(int x, int y, int z); Which ...


3

The BSP method is apparently the most popular method for generating dungeons, but it's not the only one. For completeness I'll explain the generator that worked for me. I have to admit that I don't recall where I read about this so I'll just say that it's not my invention. A maze with rooms The basic idea is that a dungeon is a maze with rooms, sort of. ...



Top 50 recent answers are included