The Slopey Squares Algorithm

When I was trying to think about how I would implement the generation for my game where you are a goblin living in the bones of a giant, I was considering using marching cubes. There's only one problem with that. Marching cubes as an algorithm SUCKS TO IMPLEMENT. The solution? Dumb it down. I found an algorithm that gives me the same visual aesthetic as marching cubes with half the hassle. At least I think I did. I call it the Slopey Squares Algorithm!!! Now you may be wondering why it's slopey squares and not slopey cubes; That's because I'm actually only implementing it in 2D for now while I figure out if it would work how I need it to. Now onto the algorithm.

They way slopey squares works is by checking a few boxes to decide what tile to draw. If a square has a square either above it or below it but not both, It is a candidate for being slopey. The square also needs to have only one square bordering it horizontally. Essentially, all corner squares will be rendered as wedges instead. Now I'm going to try to code this thing in JavaScript.

The Algorithm

Now, this is nowhere close to even being what I'm aiming for at the moment. I need it to be 3D. The problem with making it 3D is that in order to acheive any kind of good performance I need to write a 3D engine essentially from scratch; which I have done before, but it was in a competely different language than I would use for the game and it also had a lot of bugs that I don't even know how to fix.

Edit: Check out the 3D version here.

Copyright ©2026 goblinpizzas.org All Rights Reserved. Contact Us.