寻找一个好世界地图生成算法 [英] Looking for a good world map generation algorithm

查看:326
本文介绍了寻找一个好世界地图生成算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个文明般的比赛,我正在寻找一个好的算法,用于产生类似地球的世界地图。我已经尝试了几个备选方案,但都没有击中一个真正的赢家呢。

I'm working on a Civilization-like game and I'm looking for a good algorithm for generating Earth-like world maps. I've experimented with a few alternatives, but haven't hit on a real winner yet.

一种选择是使用 Perlin杂生成高度图,并在一定的水平加水,使约30%的世界是土地。而Perlin杂(或类似的分形为基础的技术)经常用于地形,是合理的现实的,它并没有提供多少在控制的方式通过的数量,大小和所得到的大洲,我想的位置,以有从游戏性的角度来看。

One option is to generate a heightmap using Perlin noise and add water at a level so that about 30% of the world is land. While Perlin noise (or similar fractal-based techniques) is frequently used for terrain and is reasonably realistic, it doesn't offer much in the way of control over the number, size and position of the resulting continents, which I'd like to have from a gameplay perspective.

第二个选择是开始一个随机定位一瓦的种子(我工作的砖的网格),确定大陆所希望的大小和每回合加砖是水平或垂直相邻现有的大陆,直到你达到所希望的大小。重复其他大洲。这种技术是在文明4的问题在于,将第一几个大洲后,有可能挑选的四周其他大陆的起始位置所使用的算法的一部分,并因此将不适合新的。此外,它有一种倾向,催生大陆太近,导致一些看起来更像是河床比大陆。

A second option is to start with a randomly positioned one-tile seed (I'm working on a grid of tiles), determine the desired size for the continent and each turn add a tile that is horizontally or vertically adjacent to the existing continent until you've reached the desired size. Repeat for the other continents. This technique is part of the algorithm used in Civilization 4. The problem is that after placing the first few continents, it's possible to pick a starting location that's surrounded by other continents, and thus won't fit the new one. Also, it has a tendency to spawn continents too close together, resulting in something that looks more like a river than continents.

没有人知道发生了良好的算法生成逼真的大陆上一个基于网格的地图,同时保持控制它们的数量和相对大小?

Does anyone happen to know a good algorithm for generating realistic continents on a grid-based map while keeping control over their number and relative sizes?

推荐答案

您可能需要从自然的提示和修改你的第二个想法。一旦你生成你的大洲(这些都是差不多大),让他们随意移动和旋转以及碰撞和变形彼此互相疏远。 (注意:这未必是一件简单的事情不断实现)

You could take a cue from nature and modify your second idea. Once you generate your continents (which are all about the same size), get them to randomly move and rotate and collide and deform each other and drift apart from each other. (Note: this may not be the easiest thing ever to implement.)

编辑:的这里的另一种方式做这件事,完全与实施 - 的多边形贴图生成的游戏

Here's another way of doing it, complete with an implementation — Polygonal Map Generation for Games.

这篇关于寻找一个好世界地图生成算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆