开发者

2D terrain generation

开发者 https://www.devze.com 2023-02-23 06:21 出处:网络
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 genera

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

精彩评论

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