[IMG]http://i.imgur.com/J6AaT.png[/IMG]
Hey guys, I recently just started working with the LOVE engine and I have a fairly above-average knowledge of Lua.
What confuses me(and quite a few other people) is how I would tweak the sample map tile generator to create biomes?
This is a really broad question, so I'm going to give a really broad answer/opinion. Regions that generate different types of tiles than other regions, thus creating a "biome" effect, should be defined prior to generating tiles. When tiles are generated, they should check what region they're in to see what type of tiles it could be according to their region. Regions can be defined as randomly generated polygons that do not overlap. You could then use collision detection algorithms to check, when generating the tiles, what individual region each tile is in.
Alternatively, you could generate the tiles as all grass or some other default tile. Then, for each region type you want to add, paint some of that region on your blank, grass canvas. This could be accomplished by picking a random tile and extending from that origin tile in random directions. You could even make the order the regions are painted on to the tiles random in order to get worlds that sometimes have more desert (because it was painted last).
If you were looking for a specific step-by-step tutorial on one way to add this to the sample, then I'm not your guy.
Use noise to create a field across your entire map (can be done procedurally)
When said values are within a range, generate a particular type of biome for that area
Ie
Say you have noise scaled between 0 and 100
When its between 0-20 - grass, 20-40 snow, etc
Thank you for the input. Both replies made me look at this from different perspectives. except
If I'm going to create regions separate from the tiles, any idea how I would do that procedural-wise? I could pick a random tile and set it as a region and then pick tiles adjacent to it, but what algorithm could help me make it look like a blob?
I like the noise idea a lot, but any idea how I would get LOVE to read the noise?
You need find/write an implementation of the type of noise you want in lua. Perlin Noise will give you some nice blobs.
Yeah I figured I'd use perlin noise, but how do I generate and read perlin noise from Lua?
[editline]8th January 2012[/editline]
Will provide source code if requested
Please think about things before asking questions! The post before yours already answers your question.
"You need to find/write an implementation" .. "in Lua"
Perlin noise is a well-documented (google for exact specifics and implementations) way to compute numbers that gradually change pseudo-randomly.
If you were thinking that you wanted to read images of this type of noise in order to create your maps, you were thinking about what they were saying wrong.
The numbers are what is important. The images are just a visual way to represent the numbers' gradual change (blob structures).
Determine the average "height", humidity, etc. Map a range to a specific biome.
[QUOTE=WiZzArD;34120794]Please think about things before asking questions! The post before yours already answers your question.
"You need to find/write an implementation" .. "in Lua"
Perlin noise is a well-documented (google for exact specifics and implementations) way to compute numbers that gradually change pseudo-randomly.
If you were thinking that you wanted to read images of this type of noise in order to create your maps, you were thinking about what they were saying wrong.
The numbers are what is important.[/QUOTE]
Oh, Gotcha! Thank you
Sorry, you need to Log In to post a reply to this thread.