Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: Procedural vector map elements -- some experiments

  1. #11
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Post

    Quote Originally Posted by töff
    Can you feed a shape into your procedure, and generate complete trees within that shape? I mean, so the trees on the edges don't get cropped.
    I'm not certain what you mean about edges getting cropped; I can't see any of that in the examples above. Are you talking about an arbitrary forest shape, or an arbitrary tree shape? Both should be quite possible (and the edges should never be cut off); an arbitrary tree shape would be easier than fitting exactly to an arbitrary forest shape, if only because the shapes of the trees varies more than the shapes of component circles.

    Quote Originally Posted by töff
    What software are you using to generate trees with your procedure?
    I'm using Asymptote, which is designed for making technical diagrams, but can be coerced into doing stuff like this.

    Quote Originally Posted by töff
    Of course, Photoshop will rasterize vectors and PDFs. (Remember that a PDF is just a containter for vectors and/or rasters of any resolution(s) and/or type.)
    I'm sorry, I should have been more specific; Asymptote is giving me PDF-encapsulated PostScript, which I want to rasterize in some automatic fashion. Photoshop would, of course, work; I'm currently using Illustrator (they probably use the same engine, anyway). However, this means that I have to manually load and save every time; if I could use ImageMagick for the conversion, I could just put the final rasterization into my toolchain and have it done automatically at the end.

    In the end, it's not so much of an issue, I was just hoping that someone here might have some suggestions.

    Quote Originally Posted by Koor
    Can you add a chance of a dead tree or stump being generated into the product? Also random generation of a glade or underbrush could add to the end product.
    Hmmm... Could you suggest some examples of dead trees? I'm not certain how to express that in 2D. As for underbrush, though, that might be an idea. I'll have to look at it....

  2. #12
    Guild Artisan töff's Avatar
    Join Date
    Nov 2007
    Location
    Fresno, California USA
    Posts
    867

    Post

    Quote Originally Posted by gilgamec View Post
    I'm not certain what you mean about edges getting cropped; I can't see any of that in the examples above.
    Yes but you just filled a square with trees. Can you fill a circle ... or an arbitrary forest outline that you can feed into the procedure?

    Otherwise, the user will have to generate a big square full of trees, and then cut out his forest shape, carefully not cutting any trees in half.

    I'm thinking, here I am in Photoshop or Illustrator or whatever, and I need a forest. So I draw a vector path for the forest border, copy or save it, and then fire up your tree-pattern generator and give it that vector path. Then, voila, the procedure makes me the exact forest I need, full of (uncropped) trees, which I then drop into my map.

  3. #13
    Guild Artisan töff's Avatar
    Join Date
    Nov 2007
    Location
    Fresno, California USA
    Posts
    867

    Post

    Quote Originally Posted by gilgamec View Post
    Asymptote is giving me PDF-encapsulated PostScript, which I want to rasterize in some automatic fashion. Photoshop would, of course, work; I'm currently using Illustrator (they probably use the same engine, anyway). However, this means that I have to manually load and save every time;
    If you're in Illustrator, you're saving as .EPS anyway, which is vector, though it might have raster elements in it like PDF. Either way, if you want a raster, Illustrator will not give you one, except by export, which I find usually doesn't give as good results as rasterizing in Photoshop.

    In Ill. & PS both, you can place linked files, which will update on file open. I'm fuzzy on your workflow toolchain, but maybe links would be the answer ... get it, chain, link?

    I know how you feel, though. I love to automate stuff. But I often spend more time building automators than I save in doing it manually.

  4. #14
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Post

    Quote Originally Posted by töff View Post
    Yes but you just filled a square with trees. Can you fill a circle ... or an arbitrary forest outline that you can feed into the procedure?
    Sure.
    Click image for larger version. 

Name:	kidney.png 
Views:	464 
Size:	99.9 KB 
ID:	15712
    It's difficult to get a tight fit to the boundary; as I said in my last post, this is largely because trees aren't uniform in shape (so some are narrower, and thus too far away from the edge; if you account for this, the wider ones will intersect it). Also, the area I'm hatching is harder to compute (as it's no longer convex).
    Quote Originally Posted by töff
    Either way, if you want a raster, Illustrator will not give you one, except by export, which I find usually doesn't give as good results as rasterizing in Photoshop.
    I'm using Illustrator's "export for web" function. I'm still not certain that it's any worse than Photoshop's save functions; it's better for my purposes, though, because the procedure is just load-export; with Photoshop, vector images load with no background, and don't use the bounding box in the PDF, so I have to manually reposition them and add a background before saving.
    Quote Originally Posted by töff
    In Ill. & PS both, you can place linked files, which will update on file open. I'm fuzzy on your workflow toolchain, but maybe links would be the answer ... get it, chain, link?
    I hadn't thought of that; it may not be a bad idea. I'll look into it.

  5. #15
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Post

    Quote Originally Posted by töff View Post
    If you're in Illustrator, you're saving as .EPS anyway, which is vector, though it might have raster elements in it like PDF. Either way, if you want a raster, Illustrator will not give you one, except by export, which I find usually doesn't give as good results as rasterizing in Photoshop.
    I tried a direct comparison. On the left, exporting directly from Illustrator. On the right, the same image after loading into Photoshop, adding a white background, resizing to the same size as the Illustrator export (with bicubic sampling), and saving as a PNG. The only substantive difference that I can see is in the hatching; the darker one (Illustrator) certainly seems closer to what I see in my PDF viewer!
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	comparison.png 
Views:	169 
Size:	169.6 KB 
ID:	15713  

  6. #16
    Guild Artisan töff's Avatar
    Join Date
    Nov 2007
    Location
    Fresno, California USA
    Posts
    867

    Post

    Quote Originally Posted by gilgamec View Post
    Sure. Click image for larger version. 

Name:	kidney.png 
Views:	464 
Size:	99.9 KB 
ID:	15712 It's difficult to get a tight fit to the boundary
    AWESOME. Perfect! Exactly what I was hoping you could do. A tight fit is not necessary IMHO.

  7. #17
    Guild Journeyer msa's Avatar
    Join Date
    May 2009
    Location
    New York, NY
    Posts
    249

    Post

    Thanks for posting more of your work on this! I just adore your procedurally generated map techniques, and I can imagine this making it very useful in producing quick maps for a D&D game or something. Really great work here.

  8. #18

    Default

    Excellent job gilgamec. This is really cool. If you can generate trees, couldn't you also generate buildings for a town. What if you created a vector outline of a town and where you want buildings to be placed have filled with black. Could your generator then replace those black areas with a random assortment of building shapes like you've got for your trees? That'd save a lot of folks from having to draw town and city buildings or using mosaic filters which give you funky shaped buildings.

  9. #19
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Post

    Quote Originally Posted by dragonwolf View Post
    Excellent job gilgamec. This is really cool.
    Thanks!
    Quote Originally Posted by dragonwolf View Post
    If you can generate trees, couldn't you also generate buildings for a town. What if you created a vector outline of a town and where you want buildings to be placed have filled with black. Could your generator then replace those black areas with a random assortment of building shapes like you've got for your trees? That'd save a lot of folks from having to draw town and city buildings or using mosaic filters which give you funky shaped buildings.
    There's two problems with trying to use a similar technique for towns:

    1. How do we draw buildings? It took quite a bit of time to get a tree that looked like an actual tree, even a stylized one; I'm not certain how to visualize them. This is the lesser of the two problems, though.
    2. The harder problem is to capture the actual arrangement of buildings in cities. There's two things here, really. First, the arrangement of trees in the forest isn't meant to represent the actual spatial arrangement of trees in the actual forest; in fact, we intentionally try to space the trees out to give an impression of continuous tree-ness (actual forests, at least in my experience, are much more clumpy). In a city, on the other hand, we want to capture the actual spacial arrangement of the buildings. This means that we have to have some idea of the logic of building placement, whereas we can abstract out the logic of tree placement in a forest. In the case of cities, buildings are on streets, aligned with the street; they never overlap (or, if they do, they must follow some kind of architectural rules); there are rules about shapes and setbacks and yards and fences; and so on.
      Basically, there's a lot more that you have to know about the placement of buildings in cities that you don't need for trees in forests. (And I had to withdraw from the last Challenge because I couldn't figure out building placement. Cities are my kryptonite.)

    I suppose that if you could figure out a good way to draw varied buildings, and you already had a street plan, and if the placement rules could be explicitly described ... then you'd be ninety percent of the way there. But in that case, there'd be very little left for me to do.

  10. #20

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •