Monday, May 30, 2011

Modding Minecraft for 3d Automata: First Attempt

I like messing around with Minecraft. I went through a phase of actually playing it, but I now mostly just enjoy looking at what other people make. I love the mutability of the world. What bores me about it, however, is the lack of dynamics. In the basic game there is essentially no way to move blocks in an automated way. The in-game redstone wiring mechanic is interesting, but limited. Adding such functionality doesn't seem to be a priority for the developers, which is their right, of course. However, the game has a thriving community around engine modifications.

So, I thought I would implement 3d cellular automata (CA) in the game and see where that goes. Interestingly, although a huge amount of research has been done on 2d CA, e.g., Conway's Game of Life and that book by Stephen Wolfram, fewer things seem to be known about 3d automata. To get started, I implemented a couple of the rules in this paper by Carter Bays in the journal Complex Systems. The paper discusses totalistic CA, where the state of one cell depends on how many of the adjacent 26 cells are occupied. Bays uses a notation E1, E2, ... / F1, F2, ... where the En indicate the sums which lead to an extant cell continuing to be occupied, and the Fn indicate which sums cause an empty cell to become occupied. I tried out the 6,7,8/5 and 2,3/5 rules.

The video below shows the result of the 2,3/5 rule. Note that this isn't really "proper" because I'm not stepping everything forward at once. I am depending on the block-wise updates that Minecraft already implemented. I've appropriated the mossy cobblestone block. I've also set it up so that it cannot evict any cell other than air. So it cannot grow into the ground and other objects in the world. It basically takes over the game to such an extent that it becomes unplayable.



Here's a rendering of another 2,3/5 run:


Next up: 1) making the CA update in lockstep to allow gliders, 2) enabling interaction with other blocks in the environment.

2 comments:

  1. Very interesting. I look forward to the addition of gliders.

    ReplyDelete
  2. This is awesome! Any chance you'll post the source (just new files and files you've modified)?

    ReplyDelete