Lua Perlin Terrain Generator

By ROllerozxa – Custom level – uploaded 3 Apr 2025 from Linux
PlayEdit 2 players liked this.
Issues trying to play levels? Troubleshoot issues playing levels

Generates a 2D terrain using perlin noise and renders it as a sprite. It's quite slow, especially for higher resolution (the bottleneck being the perlin noise calculations which are done in Lua). I wouldn't recommend running this on mobile.

Depending on your device and the resolution you pick it will hit against the Lua halt limit sometimes. But the halt limit resets for each step and it will just pick up where it left off in the next step and finish generating the terrain within due time.

The LuaScript object is located in the bottom left corner of the level. Open it in the sandbox if you want to experiment with the values.

The code is based on an old perlin terrain generator I've written in plain Lua that writes the result to an image instead: https://github.com/rollerozxa/lua-perlin-terraingen

Views: 69 - Downloads: 44 - Level ID: 1199

Comments

No comments have been posted. Be the first to comment!