随机2D瓦片地图生成算法 [英] Random 2D Tile-Map Generating Algorithm

查看:4087
本文介绍了随机2D瓦片地图生成算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我一个方法来生成岛状结构或小山结构,比如在我的世界?

Can anyone tell me a way to generate island structures or hill structures like in minecraft?

我只是在寻找一个合适的理论是随机的形状发生,但它应该保持一个定义的基本模式。

I'm just searching for a proper THEORY for that random-shape generating, but it should keep a defined base pattern..

像:海岛schould是圆形的,但变动内容的形状和规模(最小/最大宽度和放大器;高度)

like: islands schould be rounded but variate in shape and scale ( min/max width & height ).

或:河流schould不是直线,他们应该有曲线和随机宽度

or: rivers schould not be straight lines, they should have curves and a random width.

甚至是:产生某种形式的森林,那里的树木被放置的方式,用户可以通过森林仍然走的(这是一个简单的,我认为,只是说在树上的一些块应该保持空白,如果$ C $Ç试图把周围的最后一个更多的树)

or even: generating some sort of forest, where trees are placed in a way that the user can still walk through the forest (that's a simple one I think, just say that some blocks around a tree should remain blank, if code tries to put more trees around the last one )

我可以使用什么样的数学题做这种事情?

What kind of math can I use to do such things?

我很乐意为一些链接的教程或引用。我已经搜索各地的网站了几个小时,但我能找到的是一些书籍购买,如数学游戏什么的,但我的预算设置为零。

I would be glad for some links for tutorials or references. I've searches all around the web for hours, but all I could find was some books to buy like "game mathematics" or something, but my budget is set to zero.

编辑:

首先,我对不起我的坏englisch。

First of all, I'm sorry for my bad englisch.

次级我要感谢你们所有人对你的答案。这些都是很好的推荐,我会花很多时间去在更深了。

Secondary I want to thank all of you for your answers. These are great references and I'll spend much time to go deeper in that.

推荐答案

我强烈建议看 Amit的游戏编程信息以及其他博客文章了。他有一个全系列与河流,海岸等创建逼真的地图。

I strongly recommend looking at Amit’s Game Programming Information and other blog posts by him. He had a whole series on creating realistic looking maps with rivers, coastlines, etc.

建筑世界

虽然程序映射生成可以应用到非网格世界,   它最常用于电网。在一个单一的时间点上观察时,   生成的游戏地图是很少像你一样手工制作的世界。   然而,它们有三个优点:(1)每世界成本较低,如果有   被许多世界来进行,(2)更重玩的价值,因为下一个   通过世界时间是不同的,(3)潜在的世界   不断发展的同时,在游戏的过程。

Although procedural map generation can be applied to non-grid worlds, it’s most often used with grids. Viewed at a single point in time, generated game maps are rarely as nice as hand-crafted worlds. However, they have three advantages: (1) lower cost per world if there are many worlds to be made, (2) more replay value because the next time through the world is different, and (3) potential for the world evolving while the game progresses.

      
  • 阿密特世界地图生成
  •   
  • 在程序内容生成:生成地形,城市,建筑
  •   
  • 地下城代Unangband
  •   
  • 带锁和键结构,使得某些房间需要从其他房间的对象生成的游戏世界
  •   
  • 在算法的建筑河流
  •   
  • 添加河流随机生成的地形
  •   
  • 在原来盗贼算法生成的地牢
  •   
  • 在11迷宫生成算法与演示和code
  •   
  • 使用噪声函数生成的洞穴,如在泰拉瑞亚和我的世界
  •   
  • 在形状不规则的房间,简单的算法
  •   
  • 可调整大小的内部空间的区域
  •   
  • 掘洞算法挖掘地窖中DungeonMaker
  •   
  • 指南随机地形生成技术
  •   
  • 百科指南,程序内容生成
  •   
  • 在模拟大型虚拟世界
  •   
  • Amit’s World Map Generator
  • Procedural Content Generation: generating terrain, cities, buildings
  • Dungeon generation in Unangband
  • Generating game worlds with a lock-and-key structure so that certain rooms require objects from other rooms
  • Algorithm for building rivers
  • Adding rivers to randomly generated terrain
  • The original Rogue algorithm for generating dungeons
  • 11 Maze Generating Algorithms with demos and code
  • Using noise functions to generate caverns such as those in Terraria and Minecraft
  • Irregular shaped rooms, simple algorithm
  • Resizable interior room regions
  • Tunneler algorithm for digging dungeons in DungeonMaker
  • Guide to random Terrain Generation techniques
  • Wiki guide to procedural content generation
  • Simulating Large Virtual Worlds

Amit的多边形贴图生成的游戏 (列表中的第一项)是谈论发生体感形海岸线,岛屿,河流,山脉,工作等巨大的IM pressive位的逻辑一个巨大的IM pressive文章!

Amit's Polygonal Map Generation for Games (first item in list) is a hugely impressive article that talks about the logic of generating sensible shaped coastlines, islands, rivers, mountains, etc. Hugely impressive bit of work!

了一种'成长'里弗斯在随机生成的世界 [包括在上面所列内容]相当简单的算法,在地图上,如产生基于对方的瓦片'河流的路径它们的类型和高程。

A Method For 'Growing' Rivers In A Randomly Generated World [included in above list] fairly simple algorithm for generating a river's path based upon the other 'tiles' in the map, e.g. their type and elevation.

这篇关于随机2D瓦片地图生成算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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