Hello i've been using love2d on and off and have recently come back to it and love it!
I made a basic tile system (Using code from a tutorial i found but i understand it) and have been scratching at my head trying to figure out how to do random tile terrain generation.do i use love.math.random() or how do i do it.Sorry if this is a noob question.
How would i be able to create random tile generation?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Tue Dec 13, 2016 12:44 am
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: How would i be able to create random tile generation?
Look into love.math.noise. There's also a lot of resources on the internet if you Google. But basically noise is your starting point.
Re: How would i be able to create random tile generation?
Dungeon (or terrain) generators are fun and difficult. There are a lot of hidden challenges in getting computer generated worlds to look at least somewhat natural, and there are many approaches to do so. Variety is so immense it can't be comprehensively covered even in extremely large article, so you'll just have to prod around individual solutions. Look up dungeon and map generators related articles on the web, try to come up with your own generators.
Note that love.math.noise is a simplex noise specifically, not just any kind of noise; it is perlin noise for 3 and 4 dimensional noise.
Note that love.math.noise is a simplex noise specifically, not just any kind of noise; it is perlin noise for 3 and 4 dimensional noise.
Re: How would i be able to create random tile generation?
You can check out these fiddles for some inspiration (not heavily commented).
http://lovefiddle.com/H56HHtA4mCJnEM5pY (Random dungeon generator) This one is very well ilustrated in that it actually shows how its working visually.
http://lovefiddle.com/cNr47LHZn4vLJm44t (Simplex terrain height map) This one (a bit bloated cuz its made by me), lets u play around with some vars to create a randomly generated heightmap with the noise function.
I take it both have code that could be of use.
I've since optimised the code for the simplex map a fair amount but cba to rerwrite it for a new fiddle xD
Since a lot depends on the perspective you want to use and the scope of the game, the math will look a lot different depending on your actual game.
http://lovefiddle.com/H56HHtA4mCJnEM5pY (Random dungeon generator) This one is very well ilustrated in that it actually shows how its working visually.
http://lovefiddle.com/cNr47LHZn4vLJm44t (Simplex terrain height map) This one (a bit bloated cuz its made by me), lets u play around with some vars to create a randomly generated heightmap with the noise function.
I take it both have code that could be of use.
I've since optimised the code for the simplex map a fair amount but cba to rerwrite it for a new fiddle xD
Since a lot depends on the perspective you want to use and the scope of the game, the math will look a lot different depending on your actual game.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 9 guests