Manyland game crashed during creation3/19/2023 Marking Sub Islands and Culling Extraneous Islands ![]() Tiles within 2 lengths of the outer edge of the graph are automatically marked as water. If above, that tile is marked as land, if below, it’s marked as water (Note: no elevation data is considered at this point). On generation, the tile checks the noise source value at the location of the tile center to see if it’s above or below the water level. Each tile has a position, a list of corners (IslandTileCorner) and edges (IslandTileEdge). Once the voronoi graph structure is generated, that data can be used to create a set of island tiles (Island::GenerateTiles), one tile for each voronoi cell. This step involves translating the world noise to the island location, generating a set of random vectors representing the center of each voronoi cell, and then feeding those vectors to the voronoi library to get a graph structure with which to build a collection of map tiles. Island Generation happens in a few major steps:įirst, Island.cs generates a Voronoi Graph which will serve as the basis for the “cells” upon which the island will be built (Island::GenerateGraph). This source code includes a stripped down World class which interfaces with Coherent noise, but this is just a remnant of being pulled from The Rogue Sea codebase. In The Rogue Sea, the island generator communicates with a World singleton for its source of world noise. The Rogue Sea uses Coherent Noise, so that’s what we’ll use. We also need a good source for various types of noise. I found the following library online, and it seems to work well as well as having a permissive license.įortune’s Vornoi algorithm implemented in C# The math for doing so isn’t super complex, but there’s no need to re-invent the wheel when we can use some code that’s already written. So it’ll need to generate a Voronoi graph of some sort. ![]() I highly suggest reading through that article first, as it’s far more organized and coded than mine, and might illuminate some assumptions about the overall structure of the code. This approach looked promising, and served as the backbone to the solution I ended up with. After many failed attempts and much research, I stumbled upon this article about using voronoi graphs to create islands. It’s difficult to create islands that are both coherent, but also varied and interesting in their shape and coastline. This turned out to be harder than I had first thought it’d be. Within these worlds I needed the ability to create interesting looking random islands for the player to sail his or her pirate fleet to. The Rogue Sea draws inspiration from other rogue-lite games, and as such, it features randomly generated worlds. I also welcome any improvements others make. I’ll make a good effort to release a new build as I make significant improvements over the course of The Rogue Sea development. What is there now works for the purposes of The Rogue Sea so far, but there is a lot of improvement that can (and will) be done. It’s being released because some people expressed interest in seeing how it works and to compare to their own implementations. It’s provided very much as-is, and is held together with duct tape and magic values in some areas. Let me know if anyone has any questions or comments.īelow you’ll find the source code and some basic ruminations on the Random Island Generator that has been written to generate the islands in The Rogue Sea. ![]() I've pasted the blog post used to introduce it below. It's still rough around the edges, and has plenty of bugs and issues. I decided to open source it because some people had expressed interest in it and had some questions about how it was created. I just made the first release of the random island generator I'm using for my game ( The Rogue Sea).
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |