Jump to content

[Random Map] Realistic Terrain Demo


FeXoR
 Share

Recommended Posts

Here's just another approach to generate terrain in Random Map Scripts.

Aim
- Realistic Terrain
- Great Variety (see screenshots or better try it yourself)
- Fast Generation (about 10 sec for a Giant Map)
- Parameters to tweak (For a more general purpose of this approach)

Parameters easy to tweak and fast to implement with this method:
- General Terrain Shape (Island, Islands, Highland, Continent, Lake, ...)
- Terrain Smoothness (Already implemented)
- Water Coverage
- Max. Water Depth
- Amount of Plains/Mountains
- Amount of Resources close to the start positions
- Amount of Resources in total
- Wind Speed/Direction (Changes Erosion, could also change cloud speed, water (e.g.) waviness and (if implemented) how far/fast trees swing)

Other things that could be tweaked but are to slow yet (or not implemented at all):
- Water Erosion forming riverbeds (implemented for RMS but to slow, see here, No ingame implementation).
- Water actually flowing ingame or at least forming lakes at different hight (No ingame implementation).

With an interface implemented to choose (some of) those parameters before game creation (then given to RMGEN) this could also be used to generate more "random" random maps.

Task of this topic and the actual RMS
Since there is some (reasonable) doubt that this can lead to playable maps at all the task of this topic and the map (hopefully) evolving here is to demonstrate that a well playable realistic random map can be generated this way (and even faster than the average random map as is now).
So it's only meant as a proof of concept to later (hopefully) add support to choose parameters from the GUI and then generate the map according to those parameters.


First fast actualization
The first implementation mainly generates a realistic hightmap (well, more realistic than the average random map or scenario).
Then some simple and fast global erosion functions smoothen the hightmap (decay (gravity, sun, low seismic activity) and wind).
I just added some terrain textures from the random biome system and some actors (this is far from final - I just threw them in).
So the focus is ATM the realistic hightmap which can be later improved for playability.

Screenshots
Some random screenshots to show the vast variety (already - without any parameter changed):
post-14196-0-86715300-1379857545_thumb.jpost-14196-0-95527900-1379857554_thumb.jpost-14196-0-37836600-1379857562_thumb.jpost-14196-0-15251800-1379857570_thumb.jpost-14196-0-48905300-1379857578_thumb.jpost-14196-0-59496700-1379857588_thumb.jpost-14196-0-63606700-1379857601_thumb.jpost-14196-0-41072600-1379857612_thumb.jpost-14196-0-95968200-1379857620_thumb.jpost-14196-0-48968400-1379857630_thumb.jpost-14196-0-45426900-1379857639_thumb.jpost-14196-0-48484700-1379857648_thumb.jpost-14196-0-95144900-1379857659_thumb.jpost-14196-0-44584400-1379857670_thumb.jpost-14196-0-16222300-1379857680_thumb.jpost-14196-0-56086600-1379857691_thumb.jpost-14196-0-74646700-1379857701_thumb.jpost-14196-0-30687000-1379857714_thumb.jpost-14196-0-04401600-1379857724_thumb.jpost-14196-0-63667300-1379857735_thumb.jpost-14196-0-34735600-1379857745_thumb.jpost-14196-0-86703300-1379857756_thumb.jpost-14196-0-37808400-1379857767_thumb.jpost-14196-0-38111600-1379857777_thumb.j

The map: RealisticTerrainDemo2013-9-22.zip

NOTE: This is an old version of the map! Later ones are added to later posts.

Edited by FeXoR
  • Like 8
Link to comment
Share on other sites

A superbly good approach for a real "Unknown" map (Apart from other potential uses). The part about playability: maybe we could pick the starting locations from the beginning (again, randomly, not some pre-picked ones like the current approach) and build the map around them.

Indeed adding start locations could be much simpler than in Belgian Uplands due to the different hightmap generation (Diamond-square algorithm) capable of presetting the general shape of the heightmap (including mid level relatively flat player locations I hope).

I'll try this after implementing a gaussian terrain smooth tool (for the start locations to be used after global heightmap generation).

Oooh those are gorgeous maps!

Thx much!

Edited by FeXoR
Link to comment
Share on other sites

Indeed adding start locations could be much simpler than in Belgian Uplands due to the different hightmap generation (Diamond-square algorithm) capable of presetting the general shape of the heightmap (including mid level relatively flat player locations I hope).

Maybe we can also include some constraints in the generation part (lines 197-198) to prevent it from making a very jaggy terrain around the player base. It is also possible to use a larger "beginning" map to ease the matter although it might decrease the current level of beauty. I'd like to experiment with the map as soon as I can get my desktop fixed.

Link to comment
Share on other sites

Maybe we can also include some constraints in the generation part (lines 197-198) to prevent it from making a very jaggy terrain around the player base.

Yes, we could scale the randomness/roughness depending on the distance to the start locations.

It is also possible to use a larger "beginning" map to ease the matter although it might decrease the current level of beauty.

Yes. Thats how Island or Lake type maps would be defined for example (examples in line 357 and 358).

I'd like to experiment with the map as soon as I can get my desktop fixed.

Enjoy ^^

holy moly

there needs to be a way to save such maps are generated!

You can. Just generate them in Atlas and save them as a Scenario. Than you can manually tweak things and add start locations and stuff.

Edited by FeXoR
Link to comment
Share on other sites

The tree disbursement is very very nice. I also like the shapes of the shorelines. Terrain texture blending needs a lot of work, but I do like how they fit together thematically. I also like the large "forests." We need more of that.

For instance, I can see having 2 players, one on each side of this forest: http://www.wildfireg...&attach_id=6192

Also, make sure to support round maps. :)

Link to comment
Share on other sites

Those are impressive!

With some more terrain texture and prop variations it would be perfect.

Good job FeXoR!

Thx! It might take a while though until I focus on terrain texture and props. First some general problems have to be solved.

The tree disbursement is very very nice. I also like the shapes of the shorelines. Terrain texture blending needs a lot of work, but I do like how they fit together thematically. I also like the large "forests." We need more of that.

For instance, I can see having 2 players, one on each side of this forest: http://www.wildfireg...&attach_id=6192

Also, make sure to support round maps. :)

:thank_you2:

Circular maps will be supported, yep.

Wow, I can run this piece of art ? Good work flexor I want stole a pic to my fb but I don't which the best screenshots.

Fell free to use everything as you see fit. If you have a better graphics card you can make better screenshots on your own.

I don't think a number (like 11001011...) can be stolen at all. In my world such things are not "owned" by anyone. Nice of you to ask though!

I'm not as flexible as your spelling of my name might hypothesize. But sometimes I'm a bit inordinate so my name is fexor (more like Latin ferox or English ferocious).

Edited by FeXoR
Link to comment
Share on other sites

  • 2 weeks later...

I don't have much time right now but I'm on it.

A terrain smooth painter is implemented and I'm trying to get the terrain generated initially be smoother at predefined start locations.

The start locations are the main problem IMO so I try to solve this first before I continue with terrain texture and additional props.

For this I fear I'd like to discuss with Spahbod first to slightly change the random biome code.

Also there is a quite fundamental question concerning how heightmap changes should be applied before it becomes an rmgen library.

http://www.wildfiregames.com/forum/index.php?showtopic=16242&page=10#entry274907

  • Like 1
Link to comment
Share on other sites

Progress

Start locations are now added quite sane (players in one team might not be next to each other yet).

The terrain around the start locations is smoothed (though on tiny maps the incline might still be to high for satisfying results).

Trees and decorative props density is lower in the surrounding of a start location (This drastically increases generation time so I'll think of a faster range check).

The Iberian civ bonus walls are not placed at all yet due to the lack of space (I'll think of something to at least add them on medium or greater maps).

Coming soon (hopefully)

Next step will be to add resources to the start locations and distribute some stone and metal among the map to make this map playable.

Then I'll hope to change the random biome system with Spahbod to enhance terrain textures and decorative prop placement on this map.

(In general the RMGEN libs are quite chaotic and should be cleaned before adding further libs IMO)

RealisticTerrainDemo2013-10-3.zip

Edited by FeXoR
  • Like 2
Link to comment
Share on other sites

Playability reached!

Resources at start locations are now added (though wood/food not according to the biome yet).

Further stone and metal mines are distributed among the map.

Optimizations: Terrain smooth functionality and distance check much faster and no distance check needed for all tiles any more.

So this map should now be playable.

Further suggestions for playability very welcome!

Yet to come

Clear the code of inconsistent code (e.g. a point might be [35,726, 197,758] or {"x": 35,726, "y": 197,758} or just x = 35,726 and y = 197,758).

Remove use of functions just calling other functions returning a "fixed" value as far as possible.

Remove the need of any other library as far as possible (to keep it easy to debug and change).

Add support for circular maps.

Change the random biome system and chose better fitting textures and decorative props.

RealisticTerrainDemo2013-10-4.zip

Edited by FeXoR
Link to comment
Share on other sites

I generate a map in Atlas and all I get is a blank grass map with hundreds of "spikes" in the terrain grid.

Maybe you have the version I posted once to the IRC channel (if so the peaks should be lower in the center of the map - test of the terrain smooth function)? This should be listed as "Base Terrain Diamond Square Test" in Atlas AFAIK.

The 2 latest versions should be listed as "Realistic Terrain Demo" and should add start locations.

Edited by FeXoR
Link to comment
Share on other sites

I tested some maps, and they look very nice. Some remarks though:

For playability, all players should be able to reach each other. Even via land if you don't want to list it as a naval map. Currently, it's possible (and happens sometimes) that a player is locked in by a dense forest. Where no soldier can pass, and certainly no siege engines. To solve it, I propose the following, after choosing the starting positions.

For every starting position, you sort the other starting positions in one of the four quadrants. For each quadrant, if it contains other starting positions, you create a 'path' to the closest starting position in the quadrant (unless it already has a connection due to an earlier step in this algorithm). That path is elevated to a certain height (depending on the height of the connected CCs), the profile is smoothed or completely flat, all obstacles along that path for a certain width are removed (or re-positioned if important), and the texture is changed to a road like texture.

To create a random path, you can take some random points (2 or 3, depending on distance) between the two CCs (not exactly on one line), and connect them with something smooth like splines. You can also add some paths to other random places (like edges of the map) to fool players so that not every path leads to a CC.

For visuals, I think the random stone and metal mines are placed a bit strange. I think they'd look better near the edge of forests, or near water, I don't know if that's easy to do. And forests are still too dense I believe.

Your maps are also missing huntable animals (they also need a logical starting place) but I don't think that will be too hard, as the forests just depend on the height map.

Link to comment
Share on other sites

Thanks for testing and your comments sanderd17.

Paths

Yes, I plan to do this (I'll try paths as used in Deep forest first - with some changes). The height will be set to a certain, fixed level at the center of the path and softly merge into the original height at the sides (similar to how start locations are smoothed ATM). A little concern of mine is that sometimes the paths will go through water as well and that might look ugly (but we'll see).

Expansion mines

I plan to give a different decoration to them (as well as start locations). That's somehow breaking the concept of textures/actors mainly by height (and only change the probability of placement in some conditions though ATM it's not used because it works well without and is quite slow - even with the faster distance check - because it's checked for every tile). I might try to change the placed texture dependent on the distance to an expansion mine (which would also need distance checks but would at least need only one texture placement for each tile).

I might change the height they are placed closer to the forest/water. I agree on that in general but I'll first try how it looks with further decoration first.

Link to comment
Share on other sites

On 7.10.2013 at 2:29 PM, FeXoR said:

Paths

Yes, I plan to do this (I'll try paths as used in Deep forest first - with some changes). The height will be set to a certain, fixed level at the center of the path and softly merge into the original height at the sides (similar to how start locations are smoothed ATM). A little concern of mine is that sometimes the paths will go through water as well and that might look ugly (but we'll see).

It's it possible to raise the terrain so it's certainly above water level? As a bonus, you could even add bridge models to the sides of your roads ;) But that's only when you run out of tasks to do.

  • Like 1
Link to comment
Share on other sites

Is't it possible to raise the terrain so it's certainly above water level? As a bonus, you could even add bridge models to the sides of your roads ;) But that's only when you run out of tasks to do.

Oh, sorry, that was misleading. I meant the paths will be at a specific height (above the water) but might break the coastlines and may sometimes be unrealisticaly long.

Not that much of a better explanation but I hope you get it ^^

@ Bridges: Yes, at the very end I might think of that ^^.

Indeed I plan to add entity placement by functions (given to the placement function) to the wall builder lib. If that is finished it'd be quite easy to place bridges on paths through water if the paths shapes are given by a function.

Edited by FeXoR
Link to comment
Share on other sites

OK I played with the code a little. But There are still problems to be solved. The high tree/fish density is an issue. Height based terrain textures are another one. One way to solve these would be using the existing rmgen functions but that would certainly be awful both in terms of speed and the beauty. I have recently been experimenting with a new kind of placer that looks better than the current "clump placer" but is also much more unpredictable and I still have not determined if it is faster than the current approach.

Another way could be using a similar way you used with the height map. Only this time the value represents the textures. For example, values between 2 and 3.5 could represent grass, the ones between 3.5 and 7 dirt, 7-9.5 trees, etc.

Link to comment
Share on other sites

To be on the same page I'm adding my current version (though not much changed: Less extreme start position smoothing, lower fish density):

RealisticTerrainDemo2013-10-8.zip

@ Fish/tree density

To change that just change the last value in lines 482-393 (the probability of the actor to be placed).

Code:

textueByHeight.push({"height": heightRange.min + 1/3 * (waterHeightAdjusted - heightRange.min), "texture": rbt15, "actor": [rbe9, 0.1]});

However, I don't see problems with dense wood if paths are added to connect players.

@ Hight based terrain texture placement

That's part of the idea of this map. What's the problem with that?

Edited by FeXoR
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...