Latest Posts

Topic: Fractal based landscapes

staustelladam
Joined: 2011-11-24, 22:33
Posts: 70
Ranking
Likes to be here
Posted at: 2014-03-03, 19:33

I agree that a fractal map would look more aesthetically pleasing, and things like the "join" between terrain triangles being blended out would make the maps more realistic. However, I have no idea how to go about making these maps.

However, many years ago I used to play Simu Trans (http://www.simutrans.com/en) a lot ... a great deal in fact. For me (as a non-coder) the best implementation that Hajo ever made was to allow the import of grey scale images that created the maps. The level of grey, from black to white, determined the height/elevation of the terrain. This gave a base map that could then be populated with trees and stuff.

I particularly liked this approach because it meant I could make maps I liked from scanned images (playing the Faero Islands was a strange habit I had back then)

I know that Simu Trans has moved on a lot over the years, and I don't really play it any more, but you should be able to get plenty of ideas for this concept from his code.


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1187
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2014-03-03, 20:47

SirVer wrote:

I am more interested in the fractal based generation code than in the boilerplate to get it into Widelands. After all, this is where the juicy maps are generated from, right?

Here you are:

http://pastebin.com/UJ9pT5LN

Basically it is diamond-square algorithm....


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1187
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2014-03-03, 20:59

staustelladam,

if you suggest it a as a feature request, then I am not the right person because I am not a developer.

But I like the idea of taking real-world heightmap and converting it into wideland map... In fact it is very close to what I am doing now...

BTW, I used to play simutrans as well few years ago...


Top Quote
SirVer
Joined: 2009-02-19, 15:18
Posts: 1438
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2014-03-04, 06:27

Here you are:

Uhh, thanks. I looked over the code, but I do not really understand what it does though. I need to read up on this algorithm I guess.


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1187
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2014-03-04, 20:11

SirVer wrote:

I need to read up on this algorithm I guess.

I have to admit that my implementation of diamond-square algorithm is hard to read, but it works face-smile.png


Top Quote