Text

Marching Cubes

Marching cubes is essentially a series of tables and algorithms that turn chunky Minecraft-esque voxel based models into smooth organic models.  I recently re-re-re-re-restarted a voxel terrain generation engine in GameMaker, this time using the powerful YoYo Compiler addon to give an extra performance boost since such an engine is very mathematical and involves hundreds of thousands of calculations to be done as fast as possible.  Ever since I started this ongoing project around two years ago I’ve wanted to get a fully detailed 3D terrain using voxels, but avoid the blocky shapes.  After many failed attempts to do this I found Marching Cubes, which is a beautiful example of how powerful working with binary numbers can be (more on that later)

Here are shots of the current generation (raw noise for the most part) as it goes from voxels, to marching cubes, to weighted marching cubes:

http://imgur.com/YvH0mpb

http://imgur.com/8EoAxaF

http://imgur.com/mIXtxNE

[Pardon the frequent changes in contrast]

Now, as nice as the cubes look I think everyone can agree that seeing complex caves. mountains, and cliff walls with smooth surfaces allows for a much more visually pleasing game in the end.  At least this is what I hope to achieve.

Now, on to Marching Cubes themselves.  I won’t go too in depth, but basically this is how Marching Cubes works.  Imagine a cube that has a flat surface cutting through it at some obscure angle.  Now, remove the half of the cube that is in front of this surface.  What’s left is the marching cube.  Each cube consists of 8 vertices.  Each of these vertices are either 1 or 0 to represent ground or air.  This creates an 8-bit binary integer.  Now, as mentioned at the top Marching Cubes relies on a set of predefined tables.  These tables contain every possible combination (256) of 8 vertices.  So, after the 8-bit binary is generated it is fed into the Edge Lookup table to find which of the 12 edges are being intersected by the surface (known as an isosurface).  This generates a 12-bit integer which is fed into the Tri Lookup table.  This generates the coordinates of each vertex in the series of triangles needed to create the actual marching cube.  It’s all very clever in that no if’s and else’s are involved.  It’s just pure math and tables.  Here’s the source code I used to reference during my experiment if you would like to learn more: http://paulbourke.net/geometry/polygonise/

Photo
Small update to the editor.  Added visuals for instantiated models, objects, terrain, and sound.
This will obviously be able to be edited later.  What you see now are the defaults.  Pardon the Z-fighting between the terrain and grid.  I asked them to get along for the photo, but they wouldn’t cooperate.
In other news, follow me on Twitter for smaller updates, and miscellaneous stuffs.  @SChaseGarrett

Small update to the editor.  Added visuals for instantiated models, objects, terrain, and sound.

This will obviously be able to be edited later.  What you see now are the defaults.  Pardon the Z-fighting between the terrain and grid.  I asked them to get along for the photo, but they wouldn’t cooperate.

In other news, follow me on Twitter for smaller updates, and miscellaneous stuffs.  @SChaseGarrett

Photo
So, a while back I started work on  a 3D room editor/IDE for GameMaker: Studio.  It didn’t get too far because I got involved in other things, but it definitely wasn’t a lost project.  Recently I started work on it again, cleaning up the project a bit and redoing the GUI to make it more user friendly and easier on me to program as well.  Currently you can create resources and instantiate a few of them.
Plans for the IDE include full GML support, plus extra functions and changes to enhance and simplify building a 3D game such as 3D room and GUI editors.
This editor is heavily inspired by Unity3D.

So, a while back I started work on  a 3D room editor/IDE for GameMaker: Studio.  It didn’t get too far because I got involved in other things, but it definitely wasn’t a lost project.  Recently I started work on it again, cleaning up the project a bit and redoing the GUI to make it more user friendly and easier on me to program as well.  Currently you can create resources and instantiate a few of them.

Plans for the IDE include full GML support, plus extra functions and changes to enhance and simplify building a 3D game such as 3D room and GUI editors.

This editor is heavily inspired by Unity3D.

Text

Looking for composer for indie game project!

squarebit:

We’re looking for a composer for our game. No previous experience needed. Just shoot us a sample of your talent and we’ll get back to you!
Click here for a summary of the game project.

Contact:
Tumblr: http://squarebit.tumblr.com/
Twitter: https://twitter.com/sqrbt
Email: daniel_stigsjoo@hotmail.com

Please reblog for signal boost!

Photo
I might have accidentally built the most beautiful terrain generator ever.  It produces massive mountains that are eroded at the bases so there’s lots of space and water under them.  I also added very basic lighting and sand.  Sand forms around water on the base noise.  The lighting is pretty straight forward: either a block is lit, or it’s in a shadow.  These new features brings the average chunk generation time to roughly 1.25 seconds.  Chunks will save themselves after building and if the file exists it will reload the model, but not the data (currently) which means that any lighting calculations will be off around the edges of the new chunk, and the game may throw an error.  Unfortunately all of this epicness uses 1.68GB of RAM, so if I add anything else or try to generate more land it will run out of memory and crash.  I guess the next step is improving performance again.

I might have accidentally built the most beautiful terrain generator ever.  It produces massive mountains that are eroded at the bases so there’s lots of space and water under them.  I also added very basic lighting and sand.  Sand forms around water on the base noise.  The lighting is pretty straight forward: either a block is lit, or it’s in a shadow.  These new features brings the average chunk generation time to roughly 1.25 seconds.  Chunks will save themselves after building and if the file exists it will reload the model, but not the data (currently) which means that any lighting calculations will be off around the edges of the new chunk, and the game may throw an error.  Unfortunately all of this epicness uses 1.68GB of RAM, so if I add anything else or try to generate more land it will run out of memory and crash.  I guess the next step is improving performance again.