Space Rock Squadron Asteroids

As I continue with Space Rock Squadron, designing meteors started to become a problem.

I thought this was going to be one of the easier parts of the development of a voxel game. I just need some big random looking asteroids to float around in space.

Building voxel asteriods by hand turned out to be much harder than I expected. So, I ended up building a ‘nursery’ that bombarded the spheroidal asteroids with debris until they took on a natural look.

The process starts with a voxel model made into a sphere in Unity where every voxel inside the sphere is rendered. Particles of varying size are then fired from random directions to impact the model.

  • Small particles collide and on collision simply remove a few voxel.
  • Medium particles collide taking out more voxels and discoloring the surrounding area a bit gray.
  • Large particles take out the largest number of voxels and discolor the surrounding are a maroon highlight.

At the end of this process, there will be a few voxels that protrude from the asteroid unnaturally, a simple smooth algorithm is then run to knock down these highlights. The voxels are finally joined into a traditional 3D model for use in Unity.

The rotation of the asteroid in the video does not have a noticeable affect on the output but does allow the development of the asteroid to be better judged. This is necessary as the nursery process is ‘done’ when it subjectively looks good.

This game has subsequently been made available on iOS, Android and Windows, see https://www.spacerocksquadron.com/ for details.

Adrian Akison Written by:

Adrian is a serial CTO, hobbyist game developer, 3D printing enthusiast and all around maker.