What's a good way to generate random clusters and paths?

后端 未结 5 1853
星月不相逢
星月不相逢 2020-12-28 19:51

I\'m toying around with writing a random map generator, and am not quite sure how to randomly generate realistic landscapes. I\'m working with these sorts of local-scale map

5条回答
  •  甜味超标
    2020-12-28 20:18

    You could start reading links here. I remember looking at much better document. Will post it if I find it (it was also based on L-systems).

    But that's on the general side; on the particular problem you face I guess you should model it in terms of

    • percentages
    • other rules (clusters and paths)

    The point is that even though you don't know how to construct the map with given properties, if you are able to evaluate the properties (clustering ratio; path niceness) and score on them you can then brute force or do some other problem space transversal.

    If you still want to do generative approach then you will have to examine generative rules a bit closer; here's an idea that I would pursue

    • create patterns of different terrains and terrain covers that have required properties of 'clusterness', 'pathness' or uniformity
    • create the patterns in such a way that the values for deep bog are not discreet, but assign probability value; after the pattern had been created you can normalize this probability in such a way that it will produce required percentage of cover
    • mix different patterns together

提交回复
热议问题