Procedural Island Generation by loomy

View this thread on steempeak.com
· @loomy ·
$0.29
Procedural Island Generation
# Island generation
Today I took my first step in the vast domain of procedural generation. I tried to create a simple looking island.

![Selection_410.png](https://steemitimages.com/DQmXyXho24Ksvhw2g8nt1Ynxgbe1By7ud6JmiQSqMkSipKA/Selection_410.png)

# Generation of a heightmap
## Drawing a circle
An island as seen in the image above is simply some perlin noise where the highest values are concentrated in the middle. 
![Selection_405.png](https://steemitimages.com/DQmTL3fEiNTVk4HviQpK13rzBdDtjGJijUXYM23Rjy7asxc/Selection_405.png)
I started by creating a circle. You can used the distance between two points formula to have points getting darker as they get further from the center. This is how I did it.

## Adding noise
If you want to know how to create noise you should search the terms "Perlin noise" or "Simplex noise"
![Selection_406.png](https://steemitimages.com/DQmebYZpmBNMhxPqfELwcbksUQW4dNeP52FELwjhFSaddmV/Selection_406.png)

The noise blends with the circle making the map darker on the ends but lighter in the center.

## Smoothing
The noise is too hard in the picture above to have good results, we need to smooth our image. I smoothed my image by setting every pixel to the average of their neighbors. This smoothing function was iterated 300 times in my final Island image.

![Selection_407.png](https://steemitimages.com/DQmYxkLDLCyLQvCTwjD81q1iBm6pFWZnisn5m9abpnhDBBm/Selection_407.png)

# Adding colors 
I used a shader to color the island, but you can use what you want.

## Water
![Selection_408.png](https://steemitimages.com/DQmZKth4aPJLUkFjuERHU3ezkHRFuQ1emcUp2mxUnKxaNQn/Selection_408.png)

## Final result 
![Selection_410.png](https://steemitimages.com/DQmXyXho24Ksvhw2g8nt1Ynxgbe1By7ud6JmiQSqMkSipKA/Selection_410.png)

# Smoothing in realtime (300 iterations)
![smoothing.gif](https://steemitimages.com/DQmZQ2gUeqqao6nL9wLTV1xXi8BA3t61c9o7yRFyweoraUp/smoothing.gif)

# Raising Sea level
![flooding.gif](https://steemitimages.com/DQmY1pZ4nVCNjDa8BSevhRAV4Ww8Q49qJM6soedqESDKeAR/flooding.gif)

# Conclusion
It was quite fun to create an island. I will try to read about procedural generation to showcase more impressive generations. If you like my content make sure you follow me :)
👍  , , , , , , , , , , ,
properties (23)
post_id37,872,514
authorloomy
permlinkprocedural-island-generation
categorysteemstem
json_metadata"{"app": "steemit/0.1", "format": "markdown", "image": ["https://steemitimages.com/DQmXyXho24Ksvhw2g8nt1Ynxgbe1By7ud6JmiQSqMkSipKA/Selection_410.png"], "tags": ["steemstem", "programming", "art", "gamedev", "coding"]}"
created2018-03-10 20:37:36
last_update2018-03-10 20:37:36
depth0
children4
net_rshares87,842,697,856
last_payout2018-03-17 20:37:36
cashout_time1969-12-31 23:59:59
total_payout_value0.228 SBD
curator_payout_value0.058 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,216
author_reputation827,518,626,017
root_title"Procedural Island Generation"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (12)
@katamori ·
$0.04
Next step would be making a procedural *shape*, right? ;) otherwise, amazing demo.
👍  
properties (23)
post_id37,892,003
authorkatamori
permlinkre-loomy-procedural-island-generation-20180310t235635167z
categorysteemstem
json_metadata"{"app": "steemit/0.1", "tags": ["steemstem"]}"
created2018-03-10 23:55:03
last_update2018-03-10 23:55:03
depth1
children1
net_rshares12,607,886,515
last_payout2018-03-17 23:55:03
cashout_time1969-12-31 23:59:59
total_payout_value0.030 SBD
curator_payout_value0.010 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length82
author_reputation607,202,195,690
root_title"Procedural Island Generation"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@loomy ·
I could try, I would also like to make a better looking landscape with biomes!
👍  
properties (23)
post_id37,904,152
authorloomy
permlinkre-katamori-re-loomy-procedural-island-generation-20180311t015858347z
categorysteemstem
json_metadata"{"app": "steemit/0.1", "tags": ["steemstem"]}"
created2018-03-11 01:58:57
last_update2018-03-11 01:58:57
depth2
children0
net_rshares2,049,600,733
last_payout2018-03-18 01:58:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length78
author_reputation827,518,626,017
root_title"Procedural Island Generation"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@cpufronz ·
Nice project. What programming language/framework did you use?
properties (22)
post_id38,023,574
authorcpufronz
permlinkre-loomy-2018311t193843995z
categorysteemstem
json_metadata"{"app": "esteem/1.5.1", "format": "markdown+html", "community": "esteem", "tags": ["steemstem", "programming", "art", "gamedev", "coding"]}"
created2018-03-11 18:38:45
last_update2018-03-11 18:38:45
depth1
children1
net_rshares0
last_payout2018-03-18 18:38:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length62
author_reputation3,753,569,352,183
root_title"Procedural Island Generation"
beneficiaries
0.
accountesteemapp
weight1,000
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@loomy ·
I used C++ and SFML
👍  
properties (23)
post_id38,033,134
authorloomy
permlinkre-cpufronz-re-loomy-2018311t193843995z-20180311t195916265z
categorysteemstem
json_metadata"{"app": "steemit/0.1", "tags": ["steemstem"]}"
created2018-03-11 19:59:15
last_update2018-03-11 19:59:15
depth2
children0
net_rshares1,926,192,883
last_payout2018-03-18 19:59:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length19
author_reputation827,518,626,017
root_title"Procedural Island Generation"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)