tag:blogger.com,1999:blog-5052387.post706780387597400711..comments2024-03-17T16:13:55.262-07:00Comments on Blobs in Games: Map rendering: cutting cornersAmithttp://www.blogger.com/profile/12159325271882018300noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-5052387.post-64901164955446529632010-08-31T08:15:10.290-07:002010-08-31T08:15:10.290-07:00Looking forward to it; it seems like you solved ma...Looking forward to it; it seems like you solved many problems, which makes vectors an attractive approach again :)Jotafhttps://www.blogger.com/profile/11804130701206652599noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-38917540051014370072010-08-29T20:58:47.519-07:002010-08-29T20:58:47.519-07:00I've had good luck starting small and growing,...I've had good luck starting small and growing, instead of starting big. I wish you luck :-)<br /><br />As far as vectors go, take a look at <a href="http://www-cs-students.stanford.edu/~amitp/game-programming/grids/voronoi-grid-parts.png" rel="nofollow">this diagram</a>. You can see that polygons have neighbors, edges, corners, just like the squares/hexagons/triangles in a grid have. It's just that they don't all have the same number of neighbors. Sometimes variable sizes get in the way (for example, artwork), but many algorithms can work with the abstract graph structure without using the actual geometric layout. This is one of the topics I'm writing up for the map blog post.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-39470093834433752142010-08-29T17:53:41.097-07:002010-08-29T17:53:41.097-07:00By the way, I really admire the folks on tig-sourc...By the way, I really admire the folks on tig-source and other communities, who output lots of little games every year. Some day I'll give that a shot, but for now the slow hogging of another epic roguelike is just the perfect thing to work on on my spare time ;)Jotafhttps://www.blogger.com/profile/11804130701206652599noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-14253462251128442010-08-29T17:51:06.468-07:002010-08-29T17:51:06.468-07:00Yes it's a roguelike, how did you know? :D
My...Yes it's a roguelike, how did you know? :D<br /><br />My previous game had also been eaten by the dreaded bloatmonster (and so did several years of my game-dev-life, although I learned a lot) so I decided to scale back too!<br /><br />I switched to a high productivity environment (python and libtcod), and set on the following plan: I'd first make my game playable in a small setting, a subset of what could be a much larger game world, and only think about bigger things after that. So far so good! :) I still spent a lot of time on the maps but IMO they look very nice :P Of course, this is all talk, since I've been experimenting with combat systems for a few weeks and I'm still not happy with them; so I guess I haven't escaped the monster yet!<br /><br />About vectors, it's hard because you can't borrow a lot of the concepts from tiles. How do you define neighbors? With tiles it's easy, here... you have to find a custom solution for every situation. It's kinda like using a CAD program; you have a rough layout in your mind but then everything has to be defined in terms of tangents, intersections, you simply can't fake anything!<br /><br />I'd still love to do it, it would surely be an epic feat, but when I considered these algorithms I really was (and still am) in a state of mind where I just wanna finish something I can be proud of and show off for my many years in game dev :D<br />(and not let it interfere with the day job/PhD by the way :P )Jotafhttps://www.blogger.com/profile/11804130701206652599noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-52049282897404048752010-08-27T22:18:18.412-07:002010-08-27T22:18:18.412-07:00The underlying code for roads in the new map gener...The underlying code for roads in the new map generator is generic (supporting curved sections and intersections in any configuration), but the Realm of the Mad God authors wanted isolines so that's what I put in for now. :) The code is open source (MIT license) and hosted <a href="http://github.com/amitp/mapgen2" rel="nofollow">at github/amitp</a>.<br /><br />I think subdividing regions would be very nice! As wilderness areas get settled with farms, you'd want to subdivide the forests and grasslands. As agricultural areas get settled into towns, you'd want to subdivide to make houses, etc. Are you working on a roguelike? <br /><br />I wanted to push myself to work with vector data for this project but I do miss tiles. I've tried making some features in the polygon map that turned out to be hard to make without tiles. The rivers are expressed in vector format, as a polyline, but anything I want to do that interacts with that river has been difficult. For example, placing boulders in the river, or making bridges that cross them, hasn't worked very well because I don't have a representation of the “interior” of the polyline.<br /><br />In my previous big project (Simblob) I spent way too much time (years) working on maps and never got around to combat. :( This time I've put an informal time limit on myself of three months, and I have a little over a week left. I'm trying to do more small projects to avoid getting stuck on one giant never ending project.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-4775776550816561702010-08-27T12:56:05.285-07:002010-08-27T12:56:05.285-07:00Hm, are those roads or isolines? ;) The demo looks...Hm, are those roads or isolines? ;) The demo looks pretty slick, a lot of game developers I know would be jealous :P (Myself included!)<br /><br />My plans were for further subdivisions, eventually reaching the player's level of detail. There would be farms, houses around road intersections, and other medieval/fantasy stuff. I ended up integrating the same ideas into my current game project, though it defines arbitrary regions over tiles, instead of polygons (yes I wimped out!). It's a nice distraction from labwork and I spent waaay more time coding the map generator than unimportant stuff like, oh, the most bare-bones of all combat systems.<br /><br />I really wasn't expecting that 3D view :D The "Blob" was also a nice touch, hehe.Jotafhttps://www.blogger.com/profile/11804130701206652599noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-65330068243550262482010-08-26T11:43:49.853-07:002010-08-26T11:43:49.853-07:00Jotaf: the black dots are the seeds for the Vorono...Jotaf: the black dots are the seeds for the Voronoi step, but after Lloyd relaxation, they tend to be near the center, so it looks like cells :). I agree, I should keep the 2nd iteration to get rid of some of the leftover weird cases.<br /><br />I placed rivers along the polygon edges and roads between polygon centers. I tried both edges and centers and found that rivers worked better on edges, both because edges are the topological “folds” (valleys and ridges) and also because the edges support more meandering. Roads worked better center-to-center, both because they should link up important points (which are the centers) and because they looked better crossing rivers than moving alongside them. Click on “Polygons” in <a href="http://theory.stanford.edu/~amitp/_test/voronoi_set_10.swf" rel="nofollow">this demo</a> to see the placement of roads and rivers.<br /><br />I'm not currently planning to subdivide the cells. I think it makes sense for some games. Fortune's algorithm should work for building Voronoi cells inside an existing Voronoi cell. However, I've been working on the maps for a few months now and am ready to finish up and move on to something else. If a future game needs the subdivision, I can come back to it, but for now, I want to clean up the code, make it available, and write a blog post about the project.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-12387770154024977132010-08-26T09:34:45.396-07:002010-08-26T09:34:45.396-07:00Wow awesome! You put the black dots in the center ...Wow awesome! You put the black dots in the center on purpose, so they looked like cells, right? :P<br /><br />You say the 2nd iteration may not be needed, because most cells don't even change, but it seems to help a lot those rare pathological cases where cells are initially very close together; I think you should keep it :)<br /><br />What's the next step? The cells' edges would make for some great spots to place roads and rivers. Also, are you planning on sub-dividing the cells once more to get one more level of detail?Jotafhttps://www.blogger.com/profile/11804130701206652599noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-73668610102439028372010-08-23T21:20:49.641-07:002010-08-23T21:20:49.641-07:00Jotaf, I love large improvements with small costs!...Jotaf, I love large improvements with small costs! :) I haven't tried the trick you described but I may for the next project.<br /><br />My current map project / next blog post is about generating a tile-less map with polygons. Here's a preview: http://friendfeed.com/amitp/56e6eb85/sunday-afternoon-project-learning-about-blueAmithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-78234051252149093432010-08-23T20:35:59.807-07:002010-08-23T20:35:59.807-07:00Nice to hear that, I'm also looking forward to...Nice to hear that, I'm also looking forward to that post ;)<br /><br />That's a nice trick, it's not perfect but compare it to the original blocky map -- a huge improvement at a small cost! A related technique that is very simple has each tile's graphics bigger than the tile, and with some alpha variations or an irregular polygon it can yield smooth borders with no post-processing (if you don't mind a bit of overdraw). It only works if the borders don't look bad over the same tile type, which will eventually happen; so they can't have different colors, like shading.<br /><br />About the wavy borders on odd angles, it's very hard to mask that; it's a problem with tile maps. But generating a tile-less map with arbitrary polygons would be a much harder task!Jotafhttps://www.blogger.com/profile/11804130701206652599noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-22701034234513115122010-08-21T15:38:12.196-07:002010-08-21T15:38:12.196-07:00Yes, I agree, 1x1 areas get squeezed into tiny cir...Yes, I agree, 1x1 areas get squeezed into tiny circles. I'm not sure if this is good or bad :-)<br /><br />I haven't been blogging as much because I've been coding quite a bit on a new game map generator. The project is coming to an end and I'll have a blog post about it.Amithttps://www.blogger.com/profile/12159325271882018300noreply@blogger.comtag:blogger.com,1999:blog-5052387.post-59061705761022870512010-08-21T12:45:03.811-07:002010-08-21T12:45:03.811-07:00Looks nice, but when theres a 1x1 area of sand, su...Looks nice, but when theres a 1x1 area of sand, surrounded by grass, the sand be squezzed to much tinier tile.<br /><br />Oh btw. finally a new Blog post from you :DAnonymousnoreply@blogger.com