FeXoR Posted September 22, 2013 Report Share Posted September 22, 2013 (edited) 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 RMSSince 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 actualizationThe 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.ScreenshotsSome random screenshots to show the vast variety (already - without any parameter changed):The map: RealisticTerrainDemo2013-9-22.zipNOTE: This is an old version of the map! Later ones are added to later posts. Edited October 3, 2013 by FeXoR 8 Quote Link to comment Share on other sites More sharing options...
LordGood Posted September 22, 2013 Report Share Posted September 22, 2013 Oooh those are gorgeous maps! Quote Link to comment Share on other sites More sharing options...
kosmo Posted September 22, 2013 Report Share Posted September 22, 2013 holy molythere needs to be a way to save such maps are generated! Quote Link to comment Share on other sites More sharing options...
Spahbod Posted September 22, 2013 Report Share Posted September 22, 2013 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. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted September 22, 2013 Author Report Share Posted September 22, 2013 (edited) 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 September 22, 2013 by FeXoR Quote Link to comment Share on other sites More sharing options...
Spahbod Posted September 22, 2013 Report Share Posted September 22, 2013 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. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted September 22, 2013 Author Report Share Posted September 22, 2013 (edited) 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 molythere 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 September 22, 2013 by FeXoR Quote Link to comment Share on other sites More sharing options...
Enrique Posted September 22, 2013 Report Share Posted September 22, 2013 Those are impressive!With some more terrain texture and prop variations it would be perfect. Good job FeXoR! Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted September 22, 2013 Report Share Posted September 22, 2013 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=6192Also, make sure to support round maps. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted September 22, 2013 Report Share Posted September 22, 2013 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. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted September 22, 2013 Author Report Share Posted September 22, 2013 (edited) 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=6192Also, make sure to support round maps. 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 September 26, 2013 by FeXoR Quote Link to comment Share on other sites More sharing options...
Jubalbarca Posted September 30, 2013 Report Share Posted September 30, 2013 Beautiful work! Excited by the much faster loading time too. 1 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted October 1, 2013 Report Share Posted October 1, 2013 when we can , enjoy this? is a great feature. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 1, 2013 Author Report Share Posted October 1, 2013 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 1 Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 3, 2013 Author Report Share Posted October 3, 2013 (edited) ProgressStart 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 October 3, 2013 by FeXoR 2 Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 4, 2013 Author Report Share Posted October 4, 2013 (edited) 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 comeClear 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 October 4, 2013 by FeXoR Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted October 4, 2013 Report Share Posted October 4, 2013 I generate a map in Atlas and all I get is a blank grass map with hundreds of "spikes" in the terrain grid. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 4, 2013 Author Report Share Posted October 4, 2013 (edited) 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 October 4, 2013 by FeXoR Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted October 6, 2013 Report Share Posted October 6, 2013 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. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 7, 2013 Author Report Share Posted October 7, 2013 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. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted October 7, 2013 Report Share Posted October 7, 2013 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. 1 Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 7, 2013 Author Report Share Posted October 7, 2013 (edited) 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 October 8, 2013 by FeXoR Quote Link to comment Share on other sites More sharing options...
Spahbod Posted October 8, 2013 Report Share Posted October 8, 2013 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. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted October 8, 2013 Author Report Share Posted October 8, 2013 (edited) 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 densityTo 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 placementThat's part of the idea of this map. What's the problem with that? Edited October 8, 2013 by FeXoR Quote Link to comment Share on other sites More sharing options...
WhiteTreePaladin Posted October 8, 2013 Report Share Posted October 8, 2013 It's OK if forests block the players off as long as every player is always blocked off like the Black Forest map in AoK. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.