tag:blogger.com,1999:blog-5052387.post3596193779651612045..comments2024-03-17T16:13:55.262-07:00Comments on Blobs in Games: Simple map generationAmithttp://www.blogger.com/profile/12159325271882018300noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-5052387.post-55884343061070319492021-04-30T08:05:53.502-07:002021-04-30T08:05:53.502-07:00Deian: the game is called Realm of the Mad God and...Deian: the game is called Realm of the Mad God and you can find it on Steam. :-) However, it no longer uses this map generator, as we replaced it with a much better (and also open source) map generator. https://www.realmeye.com/wiki/maps-of-the-realmAmithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-91702147761131538902021-04-26T13:49:34.997-07:002021-04-26T13:49:34.997-07:00Is this project still active? Great maps! Wanted t...Is this project still active? Great maps! Wanted to see the game :)Deianhttps://www.blogger.com/profile/05922504313517122319noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-59217546784462398322014-10-17T09:54:41.316-07:002014-10-17T09:54:41.316-07:00Great post! I think this could serve as a base for...Great post! I think this could serve as a base for games where the envirnoment affects the gameplay. It wouldn't be too hard to extend this generator and implement a wheather system, am I right?Jorge A. Gomeshttps://www.blogger.com/profile/04989920516596748338noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-65291424690546853452013-06-20T19:35:45.166-07:002013-06-20T19:35:45.166-07:00Hi Anonymous, yes, from the code you can see that ...Hi Anonymous, yes, from the code you can see that I experimented with rivers, but I didn't get them to behave how I wanted them to. Rivers didn't get implemented until version 2, which you can <a href="http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/" rel="nofollow">read about here</a>.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-88069412707705353492013-06-20T12:08:28.065-07:002013-06-20T12:08:28.065-07:00what about dem rivers
I see you have a function c...what about dem rivers<br />I see you have a function carveCanyons, but you don't use it?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5052387.post-37068529158424116262012-04-24T19:04:55.096-07:002012-04-24T19:04:55.096-07:00Hi noizex, yes, I think it'd be interesting to...Hi noizex, yes, I think it'd be interesting to use the polygonal map approach to generate large scale data that then feeds into the <i>parameters</i> for the noise function, instead of directly generating biomes. I've tried a few experiments along these lines but didn't get something that worked well enough to share. I couldn't find your email address; feel free to contact me at amitp@cs.stanford.edu .Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-1940364992569036862012-04-23T14:40:50.835-07:002012-04-23T14:40:50.835-07:00Hi,
Thanks for quick reply! :) I'm very intere...Hi,<br />Thanks for quick reply! :) I'm very interested in this topic and I really like your approach. I'm thinking about utilising it somehow in my new project which is followup to PrEdiTer project (sample video: http://www.youtube.com/watch?v=J5mRKFzBHUI). We used combined Perlin noises there to first create biome "meta" information and then based detailed sampling on that information. <br /><br />I'm thinking about using your method to generate such large scale metadata, because pure Perlin makes it impossible to generate anything else than some terrain features - no rivers, no special things that can be placed procedurally. I'm still not sure how and what data to use from such voronoi bitmap and how to base Perlin detailed function on it. Additional difficulty is that I need 3D volume data for my voxel grid that is then extracted to form mesh that can have overhangs, caves and such. But for now I'll aim for something that is 3D but resembles heightmap more, because its easier and should be faster because I can determine highest point at any coordinates and generate air automatically above it. With 3D noise its not that easy because somewhere above there can be overhang and I wont know it until I process every possible block upwards at that coordinates :) <br /><br />Anyway, back to topic - if you have some ideas how to use your method with that kind of terrain I described, it would be great if we could contact via e-mail. I'll really appreciate any help on this topic.noizexhttps://www.blogger.com/profile/04064580251663138818noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-46284043349180868932012-04-23T13:12:16.270-07:002012-04-23T13:12:16.270-07:00Hi noizex,
Yes, this is something I want to do as...Hi noizex,<br /><br />Yes, this is something I want to do as well. The first trick is to use a non-linear elevation map. Normally I equalize elevations distributions evenly from 0.0 to 1.0 (see the redistributeElevations() function). Instead make low elevations much more common than high ones, using sqrt or some other function. In my (unpublished) experiments, the low elevations ended up much flatter, and the high elevations became much steeper.<br /><br />In my original code I had non-centered mountains, but switched it to centered because that's what Wild Shadow needed. In assignCornerElevations(), I was adding a variable amount depending on the direction; now I'm adding a constant amount. However I only had one mountain range; it was either on the left or the right. The next time I work on maps I'd like to generate more interesting mountain ranges.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-64901582308578372582012-04-23T04:18:17.509-07:002012-04-23T04:18:17.509-07:00Hello there,
I have a question - I've checked...Hello there,<br /><br />I have a question - I've checked the terrain generation demo (the latest one, using voronoi and not perlin). Everything looks cool but I have a problem with the altitude - whole terrain seems like a big iceberg starting from low (ocean-close coastline) to high (far from ocean, mountains). <br /><br />For my project, I need a terrain with more realistic feel, so I need vast flatlands (low hills or just mostly flat land), sometimes uplands and some mountain ranges, but not necessarily being generated in a "concentric" way from ocean to middle. Did you think of any algorithm that could be used with your method to create terrain that would look more like what I described? <br /><br />Thanks a lot for any feedback :)noizexhttps://www.blogger.com/profile/04064580251663138818noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-68515185969525151752012-01-03T09:55:13.567-08:002012-01-03T09:55:13.567-08:00Hi Anonymous — the polygonal map generator does su...Hi Anonymous — the polygonal map generator does support river flow, but the flow information isn't being used by any games (such as Realm of the Mad God). I agree, it would be nice to use that data in a game.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-80013299946417620532012-01-03T09:40:04.374-08:002012-01-03T09:40:04.374-08:00I'd love a feature for the rivers and streams ...I'd love a feature for the rivers and streams to "flow". Walking upstream will make you slower, but walking downstream will speed you up. :DAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5052387.post-28138677360583004302011-11-21T11:53:24.118-08:002011-11-21T11:53:24.118-08:00This is great. I've always had fun with Terrag...This is great. I've always had fun with Terragen and wanted to do something like it. This is a great post and I'll definitely try coming back.Rick Hendersonhttps://www.blogger.com/profile/08362226632058390544noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-88650806006373525082011-01-09T06:45:53.645-08:002011-01-09T06:45:53.645-08:00Hi Crirus: There's a .swf file at http://www-...Hi Crirus: There's a .swf file at http://www-cs-students.stanford.edu/~amitp/game-programming/mapgen-realm-of-the-mad-god/mapgen.swf and an .as file at https://github.com/amitp/mapgen . I don't use the Flash IDE so I don't have a .fla project file. I use free command line tools (Makefile, etc.).Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-28732797774642976852011-01-09T01:35:46.118-08:002011-01-09T01:35:46.118-08:00how can I run this AS code? There's not fla fi...how can I run this AS code? There's not fla file?Crirushttps://www.blogger.com/profile/04055124519475342717noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-66537711205886549922010-10-19T09:07:11.985-07:002010-10-19T09:07:11.985-07:00Thanks richtaur! Sorry about the broken link. Sinc...Thanks richtaur! Sorry about the broken link. Since August I've refactored the code and made <a href="http://simblob.blogspot.com/2010/09/polygon-map-generation-part-3.html" rel="nofollow">a series of blog posts</a> about it. The code is <a href="http://github.com/amitp/mapgen2" rel="nofollow">available here</a>.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-69642928071342371532010-10-19T00:51:44.735-07:002010-10-19T00:51:44.735-07:00Really cool! I've been wanting to play with pr...Really cool! I've been wanting to play with procedural generation and this is a step in that direction.<br /><br />FYI the link to the .as file on GitHub is a 404 :)richtaurhttp://www.lostdecadegames.com/noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-46572220166208499632010-08-10T11:09:11.329-07:002010-08-10T11:09:11.329-07:00Amit,
Thank you for the explanation, highly appre...Amit,<br /><br />Thank you for the explanation, highly appreciated.<br /><br />The new map generator looks extremely good, I'm sure to keep an eye on it! I especially like the way the rivers and lakes are represented, along with the natural-looking altitude. I'm curious to see how would it work in a more "massive" scale, i.e. with several large landmasses.<br /><br />Cheers,<br /><br />FredericoAnonymoushttps://www.blogger.com/profile/17277879613060150711noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-13174885351735203722010-08-10T09:37:26.572-07:002010-08-10T09:37:26.572-07:00Frederico, I believe the altitude and moisture lab...Frederico, I believe the altitude and moisture labels are correct in the demo. The moisture is white for the ocean/lake areas. Altitude is white for mountains and black for oceans. However, I didn't put in gamma correction so the altitude bitmap may look too dark (too many black areas).<br /><br />Initially the moisture map is completely separate from the altitude map. However the wind simulation uses the altitude map to influence the moisture map, so by the end of the simulation they are connected. I think it's fine to have them completely separate. Try setting the wind iterations to 0 in the demo to see the effect. I put in wind because it makes the maps more “realistic”, but when people played the game, it didn't seem to matter, so in my next map generation project I don't have wind. Having both altitude and moisture leads to more variation in terrain types (like forests in hills/mountains); it's an easy way to make the maps more interesting.<br /><br />I tried several different approaches to surrounding the map with water, but didn't find any that worked well when I started with Perlin noise. For my new project, I'm not using Perlin noise at all. Instead, I'm starting with a randomly drawn coastline, and then setting altitude to be distance from coastline, and moisture to be distance from river. You can see some initial results <a href="http://theory.stanford.edu/~amitp/_test/voronoi_set_5.swf" rel="nofollow">here</a> (click on the map to generate a new one). If you want to see the unfinished (Actionscript) code, it's in <a href="http://github.com/amitp/mapgen2/blob/master/prototypes/voronoi_set.as" rel="nofollow">prototypes/voronoi_set.as</a>.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-43450993982938277542010-08-10T09:27:21.434-07:002010-08-10T09:27:21.434-07:00Scott, an update: gravity-driven rivers worked rea...Scott, an update: gravity-driven rivers worked really well when I generated the altitudes to eliminate local minima, and ensured that there are oceans for the rivers to flow into. This is in a new map generation project, which I'll post soon.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-38441091118569276922010-08-10T03:42:46.290-07:002010-08-10T03:42:46.290-07:00Hi Amit,
Here I am again trying to pick your brai...Hi Amit,<br /><br />Here I am again trying to pick your brain, as it were.<br /><br />Am I missing something (possible) or are the "Altitude" and "Moisture" labels in the demo switched?<br /><br />Apropos, a small doubt: is the moisture map created completely separate from the altitude map or is it based on it? I'm asking because I'm planning to follow a similar approach now that I have my Perlin noise height-map working in order to produce different terrain type... a simpler way would be to just use some interval in order to create forests and the like, but that would not reflect stuff like "forests in hills" and "forests in montains", hence why I'm finding the moisture map interesting (even if I don't implement the wind).<br /><br />Just as a side-note I'm also struggling with the need to surround the map with water. While possible when I was using a method that used interpolation upon a provided "base noise" (since I could just tweak the base noise to have certain values at the borders) using Perlin noise pretty much destroyed this possibility since the value of each coordinate is completely dependent on the algorithm itself.<br /><br />Cheers, and thanks again,<br /><br />FredericoAnonymoushttps://www.blogger.com/profile/17277879613060150711noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-22771575376069803992010-02-21T12:02:50.703-08:002010-02-21T12:02:50.703-08:00Thanks, Scott — I did try gravity-driven water and...Thanks, Scott — I did try gravity-driven water and didn't get it to work. I'm somewhat afraid of working on that because it consumed me when writing SimBlob (http://www-cs-students.stanford.edu/~amitp/games.html) — so much so that I never got around to writing military, combat, game goals, and other things I needed to make it a game. Water flow is endlessly fascinating. <br /><br />Also, for Realm of the Mad God, we didn't have roads and bridges, so rivers were only for eye candy. In a future game we may revisit this, as rivers can have a huge impact on transportation (both because you can move along them, but also because it's hard to cross them), and that could be a fun game element.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-63324079293675204402010-02-21T11:59:47.178-08:002010-02-21T11:59:47.178-08:00Thanks for the pointer, Jotaf! It looks like Jice ...Thanks for the pointer, Jotaf! It looks like Jice not only has winds for spreading moisture, he also renormalizes altitudes (he uses x^3 and I use x^2). His maps look nice.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-52378416507915221552010-02-17T10:48:45.983-08:002010-02-17T10:48:45.983-08:00I really like the wind feature. I think that will...I really like the wind feature. I think that will give the map a more true-to-life look and feel. I'd like to try something like this but add gravity-driven water that forms streams/lakes.Scotthttps://www.blogger.com/profile/17575504118800036423noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-37969746138826976712010-02-10T19:08:57.371-08:002010-02-10T19:08:57.371-08:00Awesome read! This sort of detail is much more fun...Awesome read! This sort of detail is much more fun to us programmers than to the players, but I guess there's no harm done in indulging a bit hehe :) I think that, subjectively, a player can tell that the maps are of higher quality this way than with just noise; even though he can't really say why.<br /><br />Hm, it seems that you and Jice have been playing with the same stuff! Check out his post on the subject. [Roguelikes FTW!]<br /><br />http://doryen.eptalys.net/2010/01/improved-precipitation-map/Jotafhttps://www.blogger.com/profile/11804130701206652599noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-68230383254470245082010-01-31T19:22:12.895-08:002010-01-31T19:22:12.895-08:00Oddly enough, I was curious about the game's m...Oddly enough, I was curious about the game's map; I suspected that it was semi-randomly generated, but I wasn't entirely certain. Given the rushed nature of the rest of the game's content, I thought it was also vaguely possible that they had modified a real-world map for game use. This was an interesting read.Anonymousnoreply@blogger.com