Caves using Marching Cubes

Hey everyone, I hope you’re all doing well! I thought it would be cool to try and implement the marching cubes algorithm on Roblox in Lua, and I’m here to share the results! Feel free to take this and learn from it, or use it in a future game idea you may have cooking up! :smile:

You can try it out online here: https://www.roblox.com/games/5070286107/Marching-Cubes
Or you can download the place file here (38.5 KB)
Or you can clone the git repository here: https://github.com/Imaginaerume/MarchingCubeCaves

Marching cube caves

A Roblox Lua implementation of the Marching Cubes algorithm, in this case used to generate cool triangular caves and ore veins with Perlin Noise.

Videos and screenshots

Controls

E: Throw light
Q: Throw sticky light
G: Connect grapple to point
Hold right click: reel in grapple
Spacebar: Stop grappling

Learning sources

Sebastian Lague

Paul Bourke

10 Likes

I think this is especially cool! Made me realize that you can probably solve some real-type fluid dynamics in Roblox with a voxel grid and some marching cubes for rendering.

Definitely a problem on the back of my mind for a while. Very cool.

2 Likes