Adam Foltzer's Blog

Posts Tagged ‘Minecraft

New Minecraft save format; HaskellNBT on hold for now

leave a comment »

Looks likeĀ Minecraft will be getting a new save format:

notch: Btw, top minecraft priority turned out to be a better save file format, followed immediately by modding.

Hopefully my library-in-progress, HaskellNBT, won’t be completely useless after this change. Thankfully, notch has helpfully agreed to document the new format:

acfoltzer: @notch will the new save format be documented for 3rd party devs? // notch: @acfoltzer oh.. yes, thanks for reminding me. It will be now.

Thanks to the excellent Data.Binary machinery, a new format should be straightforward to support. All one must do to change the binary representation of a type is update the get and put methods on the Binary instance declaration for a type. This class similar to java.io.Serializable from the Java Serialization API, but doesn’t make the programmer worry about streams and exceptions. It only requires functions to and from a ByteString.

Written by Adam Foltzer

January 6, 2011 at 9:19 pm

Posted in Code, Games

Tagged with , ,

Minecraft data API for Haskell: HaskellNBT

with 4 comments

I’ve lost my fair share of hours to Minecraft over the break. If you ever had fun with Legos, you owe it to yourself to check it out. I made a T-Rex:

Of course, I couldn’t just stop at playing the game, I had to start something even nerdier: a Haskell library for manipulating Minecraft data. Minecraft saves worlds in a simple binary format, Named Binary Tag.

The specification is simple, and I was able to throw together a prototype in a couple hours. It’s up on GitHub now: https://github.com/acfoltzer/nbt

I’m still figuring out idioms for Haskell libraries, but I plan to add higher-level interfaces for manipulating entire worlds, rather than just the low-level NBT representations. What sorts of applications might be fun to see after that?

Written by Adam Foltzer

December 28, 2010 at 10:06 pm

Posted in Code, Games

Tagged with ,