Scallact Posted August 28, 2022 Report Share Posted August 28, 2022 (edited) Hi! I'm currently coding a python plugin for GIMP to help create elevation maps with mountains. The aim is not only to picture realistic mountains, but also to make them suitable for interesting game-play. I think that mountains and relief should not just serve as obstacles, but as tactical features where one can use elevation to it's advantage. Right now, the plugin only creates one type of mountains, mainly rocky / faceted mounts, but with a lot of possible variations inside that type. I'll soon add some erosion factors which will allow to make hills and older mountains. The first version of the plugin should also have an option for symmetrical height-maps. For now, the process is mainly random, i.e. procedural. But a lot of parameters are tweak-able (although I'm trying to simplify things a bit for the interface). Most notably, you can let the plugin choose it's seeds for the random generator well... randomly, and once it produces an interesting configuration you can fix some seeds and let the generator explore other variants inside that particular configuration. If that sounds complicated, it'll become clearer once you can try it. :-) Please note that the plugin only creates the height-map, it doesn't do any import into the Atlas. See this thread for that part, and scroll down to my tutorial for best quality import. But enough explanations, here are a few raw shots from 0 A.D's Atlas. Most mountains shown here are climbable. Edited August 28, 2022 by Scallact more precise title 5 Quote Link to comment Share on other sites More sharing options...
smiley Posted August 28, 2022 Report Share Posted August 28, 2022 Cool stuff, I tried using some fractal generators with pretty boring results some time ago. Just ended up being a bit too "rolling hilly" instead of mountainy. I personally would suggest porting the code over to our Javascript map generation library, or at least publishing the scripts. Those mountains look better than handcrafted ones currently existing and we have basically no procedurally generated ones.. 1 Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 2 minutes ago, smiley said: Cool stuff, I tried using some fractal generators with pretty boring results some time ago. Just ended up being a bit too "rolling hilly" instead of mountainy. I personally would suggest porting the code over to our Javascript map generation library, or at least publishing the scripts. Those mountains look better than handcrafted ones currently existing and we have basically no procedurally generated ones.. Thanks for your feedback! Of course I will share the script! It's a fully readable python plugin. However, it's a GIMP plugin, and makes use of GIMP procedures. Furthermore, it requires the G'Mic-QT plugin as well, in fact some of it's advanced capabilities are the basis of the height-map creation method. So, a direct JavaScript implementation might be tricky, because one would have to grab the internal GIMP and G'Mic algorithms. Or have GIMP and G'Mic as dependencies for the Atlas, which I'm not sure is a good solution. I'm certainly not able to do that. But 'm ready to share and describe the algorithms I used if someone feels brave enough to implement it. All of this is open source anyway. 1 1 Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 (edited) Symmetry mode in progress. The pre-visualization is rendered by the plugin itself. Â Edited August 28, 2022 by Scallact Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted August 28, 2022 Report Share Posted August 28, 2022 2 hours ago, smiley said: I personally would suggest porting the code over to our Javascript map generation library, or at least publishing the scripts. I'm afraid generating good mountains in JS might be very slow, especially if try to simulate an erosion process. Using precomputed assets (like heightmap mountain brushes) might work though. Quote Link to comment Share on other sites More sharing options...
smiley Posted August 28, 2022 Report Share Posted August 28, 2022 I don't think we can do anything more complicated than some sort of sheet erosion (which does exist currently). But that can't make mountains, only just smoothen the map. Even if we could simulate rock erosion in < 1 minute or so, that still seems very inefficient and that time can be spent on making more natural forests or creating more natural looking decoratives (markov chain based grass patterns or something perhaps). 12 minutes ago, vladislavbelov said: Using precomputed assets This is the current plan. Make some nice mountains in Atlas and import the heightmap. Or using an actual actor mesh like in AoE2 (but that always looked a bit weird, like it was glued on or something). We did this for the Jebel Barkal map. 3 hours ago, Scallact said: G'Mic algorithms Not worth to reimplement any fancy image processing algorithms. Players can't wait too long. But if the underlying thing is some sort of gradient noise based, it might be doable. Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 2 minutes ago, vladislavbelov said: I'm afraid generating good mountains in JS might be very slow, especially if try to simulate an erosion process. Using precomputed assets (like heightmap mountain brushes) might work though. FYI, I don't use an iterative erosion process at all. But: The base noise is generated by the "solid noise" GIMP algorithm Then, some random pixels are spread with the "Poisson disks" (blue noise) algorithm (G'mic) Those pixels sample the values on the noise layer The main render is then computed by the "Solidify" G'Mic algorithm. It computes a Delaunay triangulation between the pixels and fills the triangles with the interpolated gradients. These above are the main ideas. Some operations are done twice and combined with specific layer modes. Some "distance map" from GIMP is used for more regular mountains. A general "sea sedimentation" layer is added to have different levels through the map. So yes, all of this would be quite involved to implement in JavaScript, and probably not very fast. To give you an idea, the script runs in ~13 sec on my machine (i7-6700K @ 4Ghz, Geforce GTX 1080) Apart from layers operations, apparently the most computationally intensive is the "Solidify" algorithm. BTW, those algorithms could be implemented (if possible) separately, and then used in by the map script itself. Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 (edited) 18 minutes ago, smiley said: Not worth to reimplement any fancy image processing algorithms. Players can't wait too long. But if the underlying thing is some sort of gradient noise based, it might be doable. See above! TL;DR : yes, I use some advanced image processing algorithms ! ;-) At least, the "Solidify" G'Mic algorithm is the basic concept of it all. Edited August 28, 2022 by Scallact Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 If you're looking for some simpler algorithm, I also made experiments with the "Distance map" one. Gives some nice, if not slightly "too regular" results. Maybe that would fit your requirements. Basically, it computes for each pixel the distance to the nearest black pixel. This give cute mountains with constant slope. Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted August 28, 2022 Report Share Posted August 28, 2022 16 minutes ago, smiley said: This is the current plan. Make some nice mountains in Atlas and import the heightmap. We can add slow brushes/algorithms to Atlas. And add a heightmap export function. 17 minutes ago, smiley said: Or using an actual actor mesh like in AoE2 (but that always looked a bit weird, like it was glued on or something). I think using an actor mesh gives the best quality. But it requires an experienced artist to adopt to avoid things you described. Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 5 minutes ago, vladislavbelov said: I think using an actor mesh gives the best quality. But it requires an experienced artist to adopt to avoid things you described. Pardon my ignorance - what is an "actor mesh" ? Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 @smileyHere is a height-map produced with the "distance map" algorithm. Those mountains are too huge but it gives you an idea. Quote Link to comment Share on other sites More sharing options...
Stan` Posted August 28, 2022 Report Share Posted August 28, 2022 He means an actual 3D mesh made in Blender. 1 Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted August 28, 2022 Report Share Posted August 28, 2022 1 minute ago, Scallact said: Pardon my ignorance - what is an "actor mesh" ? In Atlas you can place entities (simulation objects, units you can control, etc) and actors (just visual objects without interaction). So you can make a 3D model, import in the game as an actor and place on a map. 1 Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 2 minutes ago, vladislavbelov said: In Atlas you can place entities (simulation objects, units you can control, etc) and actors (just visual objects without interaction). So you can make a 3D model, import in the game as an actor and place on a map. So we are back to the "external software - mesh import" model. Which is exactly what I do with my plugin. You know what would be extremely useful ? An Atlas mesh import function which doesn't crush the heightmaps to 8bits. :-) Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted August 28, 2022 Report Share Posted August 28, 2022 2 minutes ago, Scallact said: You know what would be extremely useful ? An Atlas mesh import function which doesn't crush the heightmaps to 8bits. :-) I have some ideas to fix the heightmap import to allow 16-bits grayscale images. 1 Quote Link to comment Share on other sites More sharing options...
Scallact Posted August 28, 2022 Author Report Share Posted August 28, 2022 2 minutes ago, vladislavbelov said: I have some ideas to fix the heightmap import to allow 16-bits grayscale images. That would be huge! Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted August 28, 2022 Report Share Posted August 28, 2022 All I know is that there should be a couple of automated tools to optimize the generation of details in the current build. 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.