Showing posts with label shape. Show all posts
Showing posts with label shape. Show all posts

Tuesday, September 9, 2014

Cutting Corners

Couple of things. First, I've officially started my new job! I've never had to clarify this before, but this blog is strictly for side projects and personal ramblings. I will never make posts about anything I do professionally. While I'm happy and excited to be working again, it does mean I'll have significantly less time to work on side projects. Thus, the already infrequent updates are likely to become even less frequent. I'll also be moving this week, cutting down on my free time further.

Second, I don't think I've ever put out this disclaimer: I did not make the textures currently in use. I took them from the Dokucraft texture pack for Minecraft. The skybox I found with a Google search. These are obviously not the final textures, and I fully intend to make my own some day.

Now to reveal what I was working on last week. I've modified the game to support more block shapes!

Before
After
The new scheme includes all the old shapes, plus some new ones like like half-blocks and half-slopes, as well as many more complex shapes. This change forced me to rework how textures are applied, which is why everything is dirt rather than grass. I had already planned on switching to decals for grace, but that'll require me to modify some art assets.

Tuesday, January 21, 2014

Perlin Hills

This week has been unusually productive. I've been working on terrain generation. Already the results are much better than previous attempts of mine. Thanks to researching the topic, I've finally come to decently understand Perlin noise. For generating and storing pieces of a massive world, I plan to adopt some of the methods used by Minecraft. Specifically, I'll be using a file format similar to the Anvil file format, which Minecraft currently uses.

I've spent some time reconsidering the previous block shape scheme I planned on implementing. For the time being, I've largely given up on finding the 'perfect scheme'. Every system I've considered has drawbacks of some kind, and all would have been a huge headache to implement. So, for now, I'm using a simplified scheme. The shape of a block is simply defined by which of the eight corners are present (256 total block shapes). In the future, I will likely consider more complex schemes, but until I find a better one, I'm just going to move forward with what I have now.

As an optimization, no hidden faces are included when the meshes are generated. This is done simply by checking if two adjacent blocks have matching corners on the touching sides.

Here are the next few things I'm going to be working on:
  • Adding textures to give the world some color.
  • Saving and loading sections of the world dynamically so you can move around.
  • Some simple physics so that you can walk around.