I was able to implement the ability to save heightmaps and colormaps in the new world editor pretty quickly. This is just a quick draw in the editor, so it’s definitely not a finished product and it doesn’t even look exactly like the game because it’s rendered by the editor, but check it out:
You can see here that I was able to draw some green for grass, put in a very basic path, and then put some snow on those little mountains in the background to the left. You can also see the weird orange color I used as a base and didn’t draw over in the background to the right. I’m really excited about this because I can now easily make terrains that are interesting and colorful, and that should allow me to really start fleshing out the world a little better. Without a tool to mock things up, it’s sometimes hard to even imagine how the world will work, but now I can make assets for the world then just place them in an area and tweak both the asset and the world around it. Super exciting.
I made progress on the tools to paint colors onto the terrain tonight. Right now you can select the terrain then press ‘p’ to enter paint mode, then use a color picker to select the color you want to paint, then just left click and drag the mouse to paint wherever you like. It really works quite well. You can pick as many colors as you want and the editor stays interactive, although I did discover that if you make the selection circle very large it bogs down quite a bit. That’s not really a problem, and could probably be optimized in the future if there’s ever a reason to do so. You can’t save the color map for now, but that should be easy to implement. I would like to add some simple convenience features soon. For instance, I would like a toggle that allows you to paint with each face randomly different from the picked color by a very small amount. That way when I paint, for instance, a large expanse of grass, each triangle should be a slightly different shade of green and I think that will make it more interesting. Also, it would be nice to be able to temporarily hide the non-terrain features on the map, like buildings and trees. It’s just easier to paint terrain without stuff in the way. There are probably other features I will think of later, but for now I’m just super excited to have a toolset that is really coming along. Once I can save the color map, I’ll really be in business.
I’ve been rewriting the editor but also adding in new features and the most exciting thing so far is what I’m calling a color map. This is an image that defines the color of each individual triangle on a piece of terrain in the world. Right now the editor will load in a color map and color the terrain appropriately, but I have to use an image editing tool like GIMP to actually create the image. The next step is to add in some terrain painting tools so that I can change the color of the terrain right in the editor, then just save it. This is really fantastic because it maintains the flat-shaded, low polygon look, but allows me to make terrains that are very varied in terms of color. I can make paths, snowy peaks, beaches, meadows, etc. without textures. The color map images are very small. The world terrain consists of right triangles. The short sides of those triangles are 8 meters long. So, a 1,024 m x 1,024 m chunk of terrain consists of 256 x 128 triangles. (Think about it. Each row of squares in the terrain will have two triangles per square, but there are sill only 128 columns.) Each triangle needs just one pixel to store the color of the whole thing, so my test color map is 256 pixels x 128 pixels and right now is less than 18KB as a .png file. That size will probably grow as I add more variation to the map, but in any case we’re looking at some pretty tiny files to produce a (hopefully) interesting looking world.
I had created a decent amount of content in a wiki some time back but at some point I removed the wiki. I reinstalled today, and fortunately it looks like I was able to recover all of the content saved in the database. This doesn’t include any images, but that’s ok. There weren’t many anyway. The wiki looks like garbage right now, but I think that’s an important resource to have for me because creating a world is a complicated task and putting everything into a wiki as I’m making it helps me stay organized, and also gives users a peek at what the world will entail eventually, plus it could be a resource once the game is actually playable. The wiki is publicly viewable, but you can’t edit anything right now. That will probably change eventually, but it works this way for now.
I’ve slacked off the last few weeks as far as development goes but I got back into it tonight and made some good progress. The world editor needed to be rewritten from the ground up and I’m still in the middle of that. Even though that’s not done, the rewrite has already provided some better organization so I was able to add in a few small upgrades during the process. Specifically, when you move an asset around in the world now there is no need to pick an axis along which to move. Just right click on an object then move the mouse around and the object moves like you would expect it, regardless of how the camera is oriented. This is a major improvement because moving trees and such before was a pretty big pain. Also, when you move an object it automatically stays on the ground. You can then specifically move it along the Y axis if you need to, but generally most things are going to be on (or near) the ground.
Tomorrow I’ll continue cleaning up and reorganizing the world editor but the next major improvement I need to add is a simple terrain painting tool. That will actually be really fun because once that’s done I should be able to make some content that’s actually worth seeing.