Menu

All posts in “algorithm”

The meander algorithm is a combination of using mazes to allow a meandering with bresenhams line. Below you can see the actual algorithm in simplicity. Obviously you could use noise maps to created heighted terrain based on the river to make it look pretty.

Meander Algorithm:

Choose a starting map edge and ending map edge, acquire
the terminal points based on those edges. Usually this would be a random point on those edges. Maybe you'd want to weight it so it's predominately in the center, or you could restrict it to a certain part.

While creating algorithms for random continent generation, I came across an old algorithm I had worked with called Coupled Map Lattice. Using that to create a continent was hard but I was able to accomplish it doing layers of filters:

generate map with noise between -1 and 1

apply CML using Spatiotemporal Intermittency settings

(a = 1.75, ε = 0.6)

I found that using something too chaotic didn't have a noticeable affect compared to just generating noise in general.

I ran across a great article today by Christer Bystrom that talks of the difference between Quadtree's and Spatial Hashing at implementation and subsequently alludes at the performance implications. I've made a more appropriate demo (in my opinion,) than the confusing code in the spatial hashing implementation on the page to make it more simple to see and understand. I thought that it was worth taking a look at. In my code example I do not show his spatial mapping library. You'll have to use this link to gain access to that. I merely show how I implemented the library.

The Other Experiment Studio Newsletter

Subscribe here to get our latest updates

About TOES

The Other Experiment Studio is all about understanding complexity by
breaking problems down into small and composable solutions. TOES focuses
primarily on video games or open source projects, but also assists others
in contract work in frontend web development ranging from complex WebGL to
single page applications or generic data visualization.