Wednesday, 24 August 2011

Minecraft .obj exporter part 2

My Minecraft .obj exporter can now export more than one chunk at a time. It took quite a bit longer than I hoped since the increased scale really brought to light the fact that I hadn't really paid a lot of attention to performance yet: things like parsing the regions lazily and building up the output as one giant string initially caused memory use to skyrocket. So I've spent the past few days learning a lot about Haskell performance, and it now performs much better. Memory isn't O(1) since I have to keep chunks in memory until all their neighbours have been processed, but since 3D Studio needs about 7-10 times as much memory to import the scene as I do to generate it it's of no practical concern anymore: if you run out of memory exporting a scene there's no way you would've been able to render it.

The main things still on the to-do list are:
  • Implementing the remaining materials
  • Implementing non-block geometry
  • Adding command line arguments so you can actually use the program with recompiling it
I've uploaded the project to GitHub:

Below are two current WIP shots of an area of 32x32 chunks:

Sunday, 21 August 2011

Minecraft .obj exporter part 1

For the renderings that have appeared on this blog so far I've been using mcobj, which is the de facto standard for exporting Minecraft worlds to 3D packages. Unfortunately, it has two main drawbacks:
  • It doesn't auto-apply any textures or generate any texture coordinates
  • It only outputs blocks, so anything with a different geometry (fences, railroads, torches, etc.) will show up as a block instead of using the correct geometry
Since it was last updated on May 15th, I don't foresee these issues being resolved any time soon. I therefore decided to take matters into my own hand and since I had no particular desire to learn Go I started writing a Haskell version from scratch. A couple minutes ago I managed to export my first full chunck.

There's still plenty of stuff to do (currently it exports each face of each block even if it has a neighbour on that side, there's no geometry other than blocks yet and only a subset of materials are implemented yet), but it's a start.

Saturday, 20 August 2011

Concept art - Coral Harbor

Coral Harbor is the port of Sapphire Island. As you can probably tell it is based on the city of Venice, with waterways being the main mode of transport. The architecture is based on Greek fishing villages. The river that runs through the center of town originates at Amber Falls.

Monday, 15 August 2011

Rendering test part 2

Spent the day playing around with rendering and materials. This time I used Vray instead of Mental Ray. I must say I'm rather pleased with how the water turned out, particularly in the second shot (as usual, click the images to see the full-size versions). It does take a while to render though (just over an hour for the second shot and I believe about 15-30 minutes for the first one). The only problem is that this is about as large as I can make the scene, since larger ones quickly exhaust the 2GB of RAM I have and subsequently bring my computer to its knees. Maybe I should start looking into getting a new one.

UPDATE: Looks like I spoke too soon. I tried rendering a scene of 640x640 blocks again (the first two are 272x272) and this time it worked just fine. Interestingly, this render only took 26 minutes. Guess zooming out helps. This render is also a good illustration of the scale of Sapphire Island. I think Coral Harbor is going to have about the diameter of this entire scene. And since Coral Harbor is only a small part of the island, you can see it's going to be a fairly large project.

Saturday, 13 August 2011

Rendering test

Since the island is going to be rather large, taking ingame screenshots isn't going to be very useful, given the rather limited view distance in the game. Fortunately, there's a tool called mcobj that can export a Minecraft world to an .obj file, which you can import into a 3D rendering package such as Blender or 3D Studio. I spent some time and made a test render of my previous SMP world to see how well it works. It's not exactly perfect (torches become yellow blocks, for example), but I think it will suffice for the overview shots.

Concept art - Amber Falls

Amber Falls, named for the giant amber-colored crystal that illuminate the city, is carved into the tallest mountain on the island. Most of the houses lie around the central pillar of rock. The spiral staircase that is carved into this pillar provides access to the different levels of the city. Below the city lies a giant cavern.

Sapphire Island overview

The map below shows the approximate geography of the island, the locations of the five towns and roughly where the different biomes are going to be.

A whole new world

I'm a big fan of the game Minecraft. If you've never heard of it before, it's pretty much the ultimate sandbox game: you are given a world that you are free to reshape in whatever way you wish. Do you think that mountain would look better five feet to the left? You are free to move it. Think that valley would look better with a town in it? You can build the town. It's like having a gaint LEGO set, but you can actually walk around in it.

A couple months ago, I built some stuff on a SMP server I shared with some colleagues. I made the video below to show my progress after one month.

This was around the time of Minecraft version 1.2. There have been a number of versions since then (we're currently at 1.7.3), but none of them have significantly expanded the possibilities for creating your own world, which is why I haven't played much of it in the past few months. With the release of version 1.8 and the API sometime later this year, though, this is set to change. Some of the more important changes are:

  • With the API, we will be able to increase the world height beyond the default 128 blocks. This means we can start making some actual mountain ranges.
  • User placed leaf blocks will no longer decay. This increases the types of vegetation that can be used, allowing things like palm trees and ivy.
  • Adding custom blocks will be much easier once the API is out, which means there is pretty much nothing stopping you from making your world exactly the way you want to.

In preparation for this, I've started planning my next project, entitled "Sapphire Island". It will be a fairly large island, probably something in the order of 2000x2000 to 4000x4000, with five cities and a bunch of different biomes on it. On this blog I'll be posting concept art and, once the new version is released, WIP shots of construction.