Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature proposal: height maps #412

Open
calebh opened this issue Jan 5, 2025 · 0 comments
Open

Feature proposal: height maps #412

calebh opened this issue Jan 5, 2025 · 0 comments

Comments

@calebh
Copy link
Contributor

calebh commented Jan 5, 2025

I would like to propose a new feature for goxel: creating voxel maps from 2D heightmaps. Using a heightmap was often the first step in map creation back when Ace of Spades was popular. Back in the day I implemented this feature in the pyspades map editor, although there were command line tools to accomplish the same thing prior to the pyspades work.

The basic workflow for AOS maps was to create a 512x512 color image, and a grayscale 512x512 heightmap. The map would be generated by extruding columns of solid colored blocks up to the specified height. Since AOS maps were always 64 blocks tall, the height could be calculated by the formula height=floor(v/4) where v=floor((r+g+b)/3) and r, g, and b are the channel values of the heightmap. A heightmap pixel value of (0, 0, 0) would correspond to the bottom layer of the map, and (252, 252, 252) would correspond to the top layer of the map.

In the pyspades map editor I introduced a new feature - the subtractive heightmap. The subtractive heightmap worked the same as the regular heightmap, except that there was no color image required, and the heightmap subtracted blocks instead of adding them. This was useful for adding things like tunnels to your map.

I would be interested in contributing a heightmap feature to goxel. We could generalize the heightmaps to allow the user to make maps up to 256 voxels tall (ie, utilize the complete channel range of the images).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant