Results 1 to 10 of 13

Thread: GIMP script: Random cave generator

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default

    Well, your scheme coding skills are waaay better than mine... I'm assuming you actually know scheme!

    The only thing I don't get is what this bit a the end is for:
    Code:
          ; Magic!
    
          (gimp-invert layer)
          (plug-in-sobel  RUN-NONINTERACTIVE image layer 1 1 1)
          (gimp-invert layer)
          (let ((select-point (screen-coordinates '(0 0))))
    	(gimp-fuzzy-select layer
    			   (car select-point) (cadr select-point)
    			   1 CHANNEL-OP-ADD TRUE FALSE 0 FALSE))
          (gimp-selection-invert image)
          (gimp-edit-bucket-fill layer FG-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
          (gimp-selection-none image)
    I think the same could be done with a simple erode and invert.

    One other suggestion would be to have the user specify the brush size rather than using the 12 px brush.... You'd also have to space the random walk step size proportionately, of course.

    The code to programmaticly define a hard edged brush is:
    Code:
        ;Set up Brush	
        (set! brushTemp (car (gimp-brush-new "MyBrush")))
    	(gimp-brush-set-shape brushTemp BRUSH-GENERATED-CIRCLE)
        (gimp-brush-set-hardness brushTemp 1)
        (gimp-brush-set-radius brushTemp varRadius)
        (gimp-brush-set-spacing brushTemp varSpacing)
        (gimp-brush-set-spikes brushTemp 2)
        (gimp-brush-set-aspect-ratio brushTemp 1)
        (gimp-brush-set-angle brushTemp 0)
        (gimp-context-set-brush brushTemp)
    and then destroy after use by:
    Code:
    	(gimp-brush-delete brushTemp)
    (Of course this would also let you vary the brush size in a random walk itself! just call the gimp-brush-set-radius whenever)

    -Rob A>

  2. #2

    Post

    Quote Originally Posted by RobA View Post
    I'm assuming you actually know scheme!
    I like Lisp, and Scheme's just a dialect -- they have a lot in common.

    The only thing I don't get is what this bit a the end is for:
    ...
    I think the same could be done with a simple erode and invert.
    Ah, you're right -- that stuff follows the process I used to use when I first started playing with this sort of thing, and it's basically redundant now. I've replaced it with an erode. Thanks

    One other suggestion would be to have the user specify the brush size
    I've been thinking about that; it'll probably make it into a future version.

    Of course this would also let you vary the brush size in a random walk itself!
    That's definitely worth investigating.

    Thanks for the advice; I've updated the zip file in the first post to remove that redundant code.
    Last edited by isomage; 12-10-2008 at 10:07 PM.
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  3. #3

    Post

    Added color, brush sizing, optional grid. Default settings will still work as input for RobA's script, but it can now make blue, gridded TSR-style maps as well.
    Last edited by isomage; 12-11-2008 at 06:29 AM.
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  4. #4

    Post

    Fixed a bug with the grid toggle.
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

Posting Permissions

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