Sunday, March 6, 2011

Switching projects

So I've been playing Minecraft. That game eats hours. It's lots of fun, but I find myself wanting more. The Nether/Nexus doesn't work in multiplayer. Textures aren't mipmapped when minified. The set of movable objects is very limited. Redstone is cool, but could be used for so much more. And what does a developer do when existing software isn't quite perfect? Roll your own!

The core mechanics of Minecraft are very simple. The world is an expansive cubic grid of blocks, 128 blocks high but almost unbounded in width and depth. Most blocks are static until modified by outside influences. The potential data set of a world is huge, so it is divided into 16x16 chunks (spanning the full 128 blocks vertically). These chunks are generated procedurally on demand and are persisted to disk.

This I could do. My physics sandbox project has gone into full-on analysis paralysis, and (let's admit it) reinventing wheels in a fresh codebase is just fun.

Possible extensions:

  • 4D coordinate system: Entering the Nether/Nexus would just be a coordinate transformation. Shift x/y/z to align with the new world and update w.

  • Free blocks: Detached blocks become physically simulated. Every collision is between two unit cubes!

  • Stress and fracture: Collisions trigger a local static stress analysis. Nothing ever bends, but world blocks can be freed and free blocks can be separated.