clisk icon indicating copy to clipboard operation
clisk copied to clipboard

Possible to set a seed value?

Open Folcon opened this issue 11 years ago • 6 comments

Would it be possible to add the ability to set or pass an optional seed for the noise generators?

Folcon avatar Jan 09 '14 04:01 Folcon

Sounds like a sensible enhancement. Happy to accept a PR for this!

Otherwise I'll add it when I next get round to revamping this part of the code base

mikera avatar Jan 09 '14 10:01 mikera

First I'm trying to work out if I can use this to generate 2d terrain a la libtcod heightmaps >_<...

Been reading your blog so this has been useful for creating a starting point with voronoi

(show (v+ voronoi-function (scale 0.2 (rgb-from-hsl [noise 0.8 noise]))))

v voronoi

(show (render-lit (v+ vnoise (scale 0.2 (rgb-from-hsl [noise 0.8 noise]))) (v* 6 plasma)))

v vnoise

or

(show (render-lit (v- vnoise (scale 0.2 (rgb-from-hsl [noise 0.8 noise]))) (v* 6 plasma)))

v- vnoise

But still getting to grips with it, changing the way it behaves and how to go about doing things like simulating rain erosion or placing hills and mountains :)...

Kudo's for this though, the lib is pretty fun to use, if I work out how to do some of this, I'll see if I can write up a tutorial or something!

Folcon avatar Jan 10 '14 04:01 Folcon

Cool, glad you are making some fine creations with it!

I found that multiplying a plasma with some other noisy function (e.g. another plasma with a different scale/offset) is pretty good for heightmaps.

mikera avatar Jan 10 '14 10:01 mikera

Also did you find the heightmap example in clisk/samples/gallery.clj?

mikera avatar Jan 10 '14 10:01 mikera

Actually I didn't thanks! I assume you mean the :fractal-landscape? Also wow, I've also been looking over your other repo's, I'll probably be trying out the orculje and looking over alchemy in my quest to build my own roguelike :)...

Folcon avatar Jan 14 '14 22:01 Folcon

Yep that's the one. Should be fairly easy to customise with other terms etc. And you can remove the render-lit if you just want the colours.

Have fun with Orculje etc.! I'm still maintaining/patching these from time to time, if you see anything you particularly want to enhance then let me know (or PRs welcome!)

mikera avatar Jan 15 '14 04:01 mikera