I was toying around with the idea of replacing hand made maps with computer generated ones and so I decided to take a trip over to:
http://www-cs-students.stanford.edu/~am ... eneration/
The first step of the puzzle is using Voronoi tessellation, which looks like:
I ported over an existing script to love and added some controls to play with it.
Keys
-: decrease number of points (fine tune)
=: increase number of points (fine tune)
Numpad -: decrease number of points (hold down)
Numpad +:increase number of points (hold down)
Space: generate new tessellation
I don't know if this is even the route I want to go down so I probably won't be developing this much further. It would be nice to have Lloyd's Relaxation or some other form of quasirandom distribution (not pseudorandom, quasirandom, as in "blue noise"), but I'm afraid most of the math requires way too much time for me to wrap my head around for a simple prototype.
Voronoi polygons (map generation)
Voronoi polygons (map generation)
Last edited by Lap on Tue Nov 15, 2011 11:42 pm, edited 2 times in total.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Voronoi polygons (map generation)
Your .love is incorrectly packaged. Make sure to zip the contents of your project folder, not the project folder itself. Also, you forgot to include inspect.lua.
Help us help you: attach a .love.
Re: Voronoi polygons (map generation)
Whoops, fixed.
If you don't like the clustering, the easiest way to do it is probably just to make a hex grid and add a random number to each coordinate.
If you don't like the clustering, the easiest way to do it is probably just to make a hex grid and add a random number to each coordinate.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Voronoi polygons (map generation)
I like the idea a lot but... why did it have to use canvas and framebuffers?
When I write def I mean function.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Voronoi polygons (map generation)
Oh no, not the same thing twice!kikito wrote:canvas and framebuffers?
Re: Voronoi polygons (map generation)
It's really fixed and re-uploaded? I'm getting NewCanvas nil errors.
Re: Voronoi polygons (map generation)
Was it required for me to do? No. Was it the laziest and most efficient way from a coding and computational standpoint: Yes it was.kikito wrote:I like the idea a lot but... why did it have to use canvas and framebuffers?
Since almost all the hard stuff isn't the actual drawing you can easily mod it to not use framebuffers by just storing the lines and points as tables and then drawing them all individually each frame *shudders*.
I also had to remove that terrible inspect.lua. WORST LIBRARY EVER .
It requires Love 8.0 if you aren't using that.coffee wrote:It's really fixed and re-uploaded? I getting NewCanvas nil errors.
Re: Voronoi polygons (map generation)
Oh sorry. Thank you, I really didn't noticed the warning. Well, actually I still waiting to find a 8.0 OSX compatible build, so I will have to skip give feedback on this one for now. Since you post the amitp link I also got interested in reading some articles. I'm finding very useful the ones about finding paths in maps.Lap wrote:It requires Love 8.0 if you aren't using that.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Voronoi polygons (map generation)
ok, now I feel like a fool. please ignore me.
When I write def I mean function.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Voronoi polygons (map generation)
This is very nice
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Who is online
Users browsing this forum: Ahrefs [Bot] and 241 guests