开发者

2D terrain generation

How is the terrain in games like "Moon buggy", "Route 960" or similar made ?

I dont't mean the "Scorch" or "Worms" like terrain with many peaks, but I lo开发者_JAVA百科ok for a way to generate smooth terain with hills and ditches, smooth enough to let a vehicle drive over it.


Initiate array of random heights

Blur:

foreach height in heights:
  new height = mean of all heights in radius N and center in current height

blur will satisfy your condition of smoothing


You want to look for a space-filling-curve, or a spatial index, for example a hilbert curve or a z-curve. It recursivley subdivide the surface into tiles and reduce the 2d problem into a 1d problem but it is basically a reordering of the tiles. You want to look for Nick's spatial index quadtree hilbert-curve blog.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜