Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Extending Gosu / Ruby HeightMap generator
- - By chase4926 Date 2012-12-22 05:11 Edited 2012-12-25 05:08
So this is as the title says, a heightmap generator written in Ruby.

It also includes a visualizer (which uses Gosu), which lets you see the Perlin-noise-esque stuff it generates.

Check it out on GitHub: https://github.com/chase4926/Ruby-Heightmap
Or should I write, clone it.

Here's a nice timelapse of a 64x64 heightmap. http://www.youtube.com/watch?v=QmzJFEP1JIM
Parent - - By Spooner Date 2012-12-22 23:53
You might not be aware of it, but my Perlin (C extension gem) already does Simplex/Classic Perlin noise and has a simple gosu-based visualiser. I'm sure your implementation is fine, but I'm guessing it is about 100x slower if it is pure Ruby ;(

Ashton also supports noise-generation via shaders which I'm guessing is 100x faster than even Perlin can manage. Perlin is better if you don't want to just generate a noisey-image (for example Ashton is great for creating dynamic textures, but less so for heightmaps).

Sorry, Github is down right now, so I can't confirm how your gem works. It is possible you might be adding heightmap-specific stuff that isn't supplied by Perlin, in which case you might consider using the Perlin gem as a backend for the grunt-work...?
Parent - - By chase4926 Date 2012-12-23 01:21
Wasn't aware of it, but I plan on adding a ton of customization methods to allow developers to really make the heightmap that is generated tailored for their purpose.

Such as:

- A function to generate static, so the heightmap wouldn't start out flat
- A function to "average" the grid (take the average height of all the cells, and move the actual height down that distance)

My main goal at the moment is to load it with features and make it work, past that, a C version isn't out of the question.
Parent - - By Spooner Date 2012-12-23 02:00
Sounds like it adds a lot of heightmap specific stuff, so that sounds grand. Really try to avoid reinventing wheels on the Perlin stuff though.

Don't write a C version unless the Ruby one is actually too slow for what you need. I'm guessing you aren't generating super-dense heightmaps, so maybe it is fine (assuming you use Perlin gem for the noise generation, perhaps, to give it a bit more speed).
Parent - By chase4926 Date 2012-12-23 04:37
GitHub is back, feel free to check it out.
I added the previously mentioned features aswell.

Next on the chopping block: A function to smooth out the grid
Parent - By chase4926 Date 2012-12-24 03:44
New commit, added contrast feature.
Made positive heights green, negative blue. Darker = lower, lighter = higher.
Parent - - By chase4926 Date 2013-09-16 01:18
Just doing the finishing touches on procedural generation, attached is an example screenshot containing 4 heightmaps generated procedurally.
Parent - - By jlnr (dev) Date 2013-09-16 02:50
Looks natural to me. :)
Parent - By chase4926 Date 2013-09-16 03:08
Thanks :D, now to find a use for this...
Parent - - By ml Date 2013-09-28 16:43
Hey I just checked this out for the first time. Bonus points for loading on the first try on my system without any errors.

For me this serves as a good general overall Gosu and Ruby tutorial, as many of the games on this forum do.

It reminds me of the Sinking Islands Ludum Dare Game, which I found on the Showcase by way of the daily featured projects.
Parent - - By chase4926 Date 2013-09-28 18:21
This reminds me, I never did sync the latest version to github. So the version you have doesn't actually have the procedural stuff. Oops!
Parent - By ml Date 2013-09-28 18:52
Well, at least the contrast worked. :)
Up Topic Gosu / Extending Gosu / Ruby HeightMap generator

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill