World Gen

Thoughts on the further development of Haven & Hearth? Feel free to opine!

World Gen

Postby Peter » Sat Jun 06, 2009 6:48 am

Let's see, my last two posts where: Complaining about foxes, and: Complaining about a griefer.
Now that the Fauna is out of the way, let's talk about geology.

I was looking at the world map and I realized that it could be improved with only a few turbulence patterns and some variety. I like to play with texture generators and I figured I might be able to make a nice looking height map or two.
So, here's my world map:

Small version: click for full size-version (4000x4000,about 3,500 Kb)
Image

Got some nice islands and mixed terrain that would be interesting to explore, I think.
Each color means something different; yellow brown areas are swamps, the darker green areas are a variety of forests. Naturally, the blue is water. There are some red brown areas that are dry and inhospitable, potentially good sites for mines.

It's made up of several different layers: Rockiness (type of dirt), Nutrients (type of plant), and Moisture (plant/dirt ratio). There's finally a Elevation map that defines the lakes and can give more direction to cliffs.

Rock:
Image
Nutrient:
Image
Moisture:
Image
Elevation: (with blue line showing shoreline and red lines showing elevation lines- draw cliffs parallel to these.
Image

A slightly clearer map that contains mostly current terrains:
Image

In the future, this map could include more interaction between levels- especially if shoreline areas where moister, for instance. Other improvements would be temperatures, but this is not implemented in the game and isn't very realistic over a small area like this. Then there's such things as erosion of hillsides and even rain-shadows, but this would require much more long-term work.
Last edited by Peter on Sun Sep 13, 2009 4:41 pm, edited 1 time in total.
Surprise.
User avatar
Peter
 
Posts: 1491
Joined: Thu Jun 04, 2009 3:36 am

Re: World Gen

Postby Devour » Sat Jun 06, 2009 8:17 am

On the note of this: I'm hoping that, in world gen, there will be some certain points of interest that the developers put in. Like, I don't know, stone circles, dungeons or something.
Image
User avatar
Devour
 
Posts: 326
Joined: Mon Jun 01, 2009 10:13 am

Re: World Gen

Postby kaka » Sat Jun 06, 2009 10:30 am

It does look good, but there are some problems with generating a map this way.
I also map a simple program that did this long ago and it was turned down by Loftar.
Mainly because it barely gives you any control of how an area look, nor does it
provide any information about a single area.
I also remember that Loftar gave the edges of areas some kind of special treatment
to make them look good.

Another problem is that while it does look more natural(and better) than the existing map,
it looks like a map on a much larger scale, but that may be fixable.
User avatar
kaka
 
Posts: 673
Joined: Fri Apr 03, 2009 8:31 am
Location: Château de Gâteau

Re: World Gen

Postby loftar » Sat Jun 06, 2009 2:26 pm

Indeed. Both your program and the program that kaka made create beautiful maps, but there are several reasons why it is hard to make them work in the game. The greatest problem is actually that of continuity at the edges; the map is supposed to be extended on-demand in all directions, and with a program like that, I've just no idea how the make the edges at which extension happens look continuous.

Also, as kaka points out, there is no high-level information about boundaries and other terrain features at which it would probably be good to create some points of interest of various types. There are also a couple of other planned features for the map generator that would be hard to realize under such conditions.

As kaka also points out, it does indeed seem to be a bit too "zoomed out", so to say. Kaka's maps also had that feature, and when we tried to put them into the game, they had too many really small-scale features that looked very weird when they were just a few tiles in size, even though they looked good in the pre-fabricated image.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9045
Joined: Fri Apr 03, 2009 7:05 am

Re: World Gen

Postby Peter » Sat Jun 06, 2009 8:19 pm

I see!
My map above is procedurally generated, so it can be expanded out infinitely. However, the program I use would be impractical for automated map expansion. What could be done is take the basic algorithm and implement it into something more portable- the basic idea is very flexible and can be put together easily enough.

About what you said about extension; that's the nice thing about this algorithm, that it can be extended infinitely and configured, or even given a different seed number to get a totally different world with similar attributes. The server itself could call the generator function for each tile and still generate a consistent world map.

Changing scale and such are trivial problems; I can change a few values and have this world be ten times more crowded or ten times opener, and I can make it entirely islands or high in the mountains. I can even change the relative percentage of things like forests and swamps with just a few number changes.

To demonstrate, I've gotten a few new maps. I've also added beach generating and a nice little system that makes coasts tend to be moister than inland areas.
Here's some more info maps:

From the earlier series, this map can easily pick out water from land and give a Boolean value.
Image

Newer world map after changing the settings:
Image

And a narrow map segment:
Image

And I've included a short 20 second clip here that shows what the algorithm can do in terms of variety; it runs thrugh different values of rockiness, nutrients, and moisture, as well as elevations. It also scrolls around a bit to show that it can extend out infinitely.

Of course, I can't develop this more without knowing how you currently make maps- it looks like there's a program that draws vectors somehow, but is there ever a bitmap or other stored data thingie where maps can be imported?
Surprise.
User avatar
Peter
 
Posts: 1491
Joined: Thu Jun 04, 2009 3:36 am

Re: World Gen

Postby Peter » Mon Jun 08, 2009 10:43 pm

I rebuilt my generator to be a lot clearer and more efficient. You can see the large version (5000x5000 px, equal in size to the current world map.) here

Smaller images:
ImageImage

And an earlier version:
Image

You can easily change small values to change the prevalence of any terrain type.
This version now allows for coast-following swamps, and dry areas up in the highlands, something I'm very pleased with.
Finally, it can be expanded with new terrain types as needed; for instance, I've added deep water here, which presumably is impassable.
Surprise.
User avatar
Peter
 
Posts: 1491
Joined: Thu Jun 04, 2009 3:36 am

Re: World Gen

Postby theTrav » Tue Jun 09, 2009 6:39 am

Please get it to generate a very small map, one that will only fill a 2x2 screen when translated to single tiles

Then please get it to draw those tiles in a single continuous image. Look around for a bit, see if it looks reasonable.

Next step would be to generate another 2x2 segment that has to attach to the left side of the map you originally generated. Again translate it to real isometric tile view, look around and see if the join makes sense.

Next repeat that for each side twice so you've basically got a big plus symbol of 2x2 map segments.

Next generate up and then down, left and right from the outer edge of this plus symbol until you've got something that looks like a window.

Next generate 2x2 segments to fill in the holes in the window.


Getting the map to generate appropriately to fill in those gaps on demand is the biggest problem loftar is talking about.
The smaller problem is translating it to a tiled isometric view that looks reasonable when players are walking around.

One that he hasn't mentioned is that when you keep generating in that fashion for a long time and end up with a really big map, does the big map look reasonable? This last one isn't going to be much of an issue with players in game so long as their view is reasonable, but will likely be an issue long term
User avatar
theTrav
 
Posts: 3464
Joined: Fri May 29, 2009 11:25 pm

Re: World Gen

Postby kaka » Tue Jun 09, 2009 11:36 am

But still, one of the main problems with generating a map this way is that you have no information
about the different areas, you can't separate one forest from another.
User avatar
kaka
 
Posts: 673
Joined: Fri Apr 03, 2009 8:31 am
Location: Château de Gâteau

Re: World Gen

Postby Peter » Tue Jun 09, 2009 5:12 pm

TheTrav: This is a procedurally generated map; given the same X,Y coordinates, it will always produce the same tile type for that square. This means that larger patterns are also continuous, and thus there are no seams, no matter in what order tiles are uncovered. In fact, the server doesn't need to save the map data at all; it can just regenerate terrain as people pass (though this places a demand on the server and more conventional storage is necessary to save items and changes.
I can make this map as large or as small as is wanted, then come back later and add an area, an do so perfectly flexibly. Further, the video above shows that infinite variation is possible by just changing some parameters.

Kaka: You have a very good point; as they are generated now, terrain features are not understood to be separate areas, unlike, for instance, dwarf fortresses' named landscape. I didn't realize that this was part of the current world, but perhaps this has something to do with biomes or something. It is possible to export a black and white map showing only forests and then have a separate program identify them, but this would be rather inefficient. The best way I can think to implement this is to have each different biome forest be generated as a separate layer, which would allow you to at least recognize the different types.

Again, let me stress that one of the greatest strengths to this mapgen method is that maps can be expanded seamlessly, and in fact, in real-time. My poor old 1.8 Ghz laptop gave me that 5000x5000 map in under 9 minutes while running a couple other programs. I'll admit that Kaka has a very good point that you can't identify whole features very effectively, but depending on what this information is to be used for, there are other ways to get this information.
Surprise.
User avatar
Peter
 
Posts: 1491
Joined: Thu Jun 04, 2009 3:36 am

Re: World Gen

Postby Vattic » Tue Jun 09, 2009 6:58 pm

I was going to post something on world generation when I first saw the lake/sea on our current map :P.

I have seen it a number of times in games where fractal landscapes have scaling problems where on the tile scale view you get odd looking formations and its a valid concern.

I wonder though if this is not simply because you are generating complex terrains and then displaying that with tiles. The world gen wasn't really made with turning it into tiles in mind and so you get compression artefacts of a sort. Can you not generate things with tiles and mind and keep lines to the 8 directions the tiles support and generate it tile at a time rather than pixel at a time? I at least know this is possible with the world gen method I was going to suggest, I'd imagine you'd of head of fractal islands? you can easily use them to make lakes/seas also hence why I was going to suggest it after seeing the current one.
User avatar
Vattic
 
Posts: 232
Joined: Sat May 30, 2009 1:47 am
Location: United Kingdom

Next

Return to Critique & Ideas

Who is online

Users browsing this forum: Claude [Bot], Meta [Bot] and 1 guest