This is the second and final round going through level theme terrain. The first theme is the island and for that I decided to completely rewrite the island creation. The previous version had weird way to create the island using pieces of ellipses which was a crude and easy to way to create the island, but it did not scale well to different sizes.
For the pieces of island there already was a routine ready, the same used to create caverns. It's a simple seed fill routine with a random changes occasionally to make the blob more irregular. It just works, but sometimes it does create small "pockets" of water inside the island. It's not bad actually, because they are transformed into low water by the shallow water routine.
The way I made the mountain range and beach is quite smart I think. The routine is first scanning the coastline, then using those points to create a path (with new Topology_Path class). That shape can then moved and transformed by couple of ways. The nice thing about the path is that you can pick a point along the path to find stuff like entrances to dungeons, there is no need to manually scan for the mountain range.
The island is now easier to scale to different sizes, but I'm still keeping the size of island pretty much static at least for now. If there are bigger sizes there must be some kind of scale to food generation as well.
No comments:
Post a Comment