[Monthly Challenge #1] - Pirate map using CA
My entry for the monthly challenge. It was pretty fun to try out things until they gave a pleasing result. It's the first time I used cellular automata for something other than just experimenting with life rules. I had found some rules that would generate some blobs and smoothed corners before (there's a whole bunch of rules on the life wiki) but I never combined them until now. It's also the first time I used poisson disc sampling extensively for a real purpose. The step by step text is probably the weakest part of the entire algorithm, it's really nothing more than a lookup of random descriptions with some randomization of verbs. I programmed most of it in an asynchronous way, so I could update the image as it went along (and draw debug info on the overlay), which might make the code a bit harder to read, but I tried to abstract away most of those things in a separate Async class, a bit like PLINQ in C# so it didn't became a christmas tree
Language: Typescript written with my own online Typescript IDE
Screenshots: http://i.imgur.com/IXaf6aD.png, http://i.imgur.com/QUqpWkL.png
Source code: https://github.com/drake7707/piratemap
Demo: http://drake7707.github.io/piratemap/ (add ?seed=number for a fixed seed)
Features:
-
Diamond square algorithm for the map background
-
Cellular automata rules for the actual island generation (something I hadn't tried before)
-
Depth first search for determining the different islands
-
Poisson disc sampling for finding the longest traject, for placing down adornments in the sea and for placing terrain features
-
Some randomness to the description of landmarks for a textual step by step guide
Frameworks used: none! I wrote everything myself though I had implementations lying around, like diamond square, cellular automata and poisson disc sampling which I converted to typescript
It works smoothest in chrome, it's a bit laggy in firefox.
Looking forward to the next challenge! And as always suggestions, comments or improvements are always welcome!
Posted Jan 2, 2016, 2:58 PM UTC · edited