Page 2 of 2

Re: [Library] luaFortune: Libraries for producal generation.

Posted: Tue May 10, 2016 8:12 am
by Rishavs
Sorry for the thread necromancy, but I need some help with the procedural map generation as done in Amit's article.
I am pretty newb so need some handholding.

I have generated a points field and created a vrornoi diagram around it, using this library.

What next?
I understand that I need to define faces as objects now (made up of vertices and having ids).
How can I create an object for each face ?
The polygons seems to have arbitrary number of corners (some have 4 others have 9)


Then i need to find neighbors.
How do I do that?
can someone give me a rough flow to follow?

Re: [Library] luaFortune: Libraries for producal generation.

Posted: Wed May 11, 2016 5:54 am
by TheRedRaccoon
This article should explain it rather efficiently.

http://www-cs-students.stanford.edu/~am ... eneration/

Re: [Library] luaFortune: Libraries for producal generation.

Posted: Wed May 11, 2016 7:12 am
by Rishavs
Hi

Thats the same article by Amit I am (and apparantly half the gamedevs) following.
But i am not sure how to do the next step.

I need to generate a list of neighbors for each polygon. No idea of achieving that. :/

Re: [Library] luaFortune: Libraries for producal generation.

Posted: Wed May 11, 2016 3:26 pm
by pgimeno
Maybe you can take a look at this one instead?

https://www.love2d.org/forums/viewtopic ... 26#p171426
I have added some new stuff: polygon detection, neighborhood calculation. See attached the new demo.