Tuesday, December 18, 2012

Water

So I started to mess around and add something more than just grass, decided to try water. I started off by simply changing every block that was under a certain height range to a WaterTile, which in the first screenshot consisted of just a sprite change to a kind of underwater sand type tile.


After this I added the water at waterlevel. I decided to try and make the water transparent dependant on it's depth ... but it didn't turn out too well and looked too blocky. I think I might be able to get away with doing it like this if it were more blended (less variance in alpha amounts) but I decided to scrap it all together and see what it looks like if the entire water was the same alpha value (75%)


Although it looks plain, I decided to keep the water as one alpha value, it serves its current purpose (which is to resemble water) and looks decent enough. I randomised the seed to grab some extra screenshots of different areas, to see what the water looked like.




From these screenshots I ended up getting some feedback from a friend, who suggested that the water level was too high (since it was at an exact block height) and looked like it blended with the grass too weirdly. I ended up lowering the water level 40% the block height and ended up with the below image


Saturday, December 15, 2012

Terrain Generation!

After several silly problems, I have basic terrain generation working.


I started off with Perlin Noise to adjust the heights of the tiles, which turned out pretty good but it didn't look like it fit the isometric style so I snapped each height to the nearest 16px, which resulted in theabove screenshot.

As you can see something else is wrong now, the terrain generation is fine but there are gaps left if an adjacent tile has a much higher or lower height than its neighbour.

In order to solve this, a tile would check it's neighbouring tiles, and if they leave gaps, it will draw in extra dirt-stacks underneath itself. I had to change the dirt-stack image to tessellate better since it would be a repeated image. I ran into several problems but it turned nicely one again, shown in the screenshot below.



Now this looks fine ... to an extent, but I didn't like that the grass from high tiles would seem to blend with those 1 level down but north of the tile. It's hard to tell that the edge of the tile exists. In order to get around this I first tried just adding an edge to each tile to define the edge.



But this didn't turn out how I wanted it either, it'd draw edges on each tile which (although it doesn't look too bad) isn't what I wanted. Instead once again similar to the gap problem, I checked the neighbouring tiles of each tile to determine whether to draw each edge. Finally I ended up with the following.


Friday, December 14, 2012

Pixel art is hard :(

Added in my own sprites, didn't spend too much time on them (and I'm not an artist) but I think they turned out decent enough for place holder images.

I spent a lot more time actually coding some low-level code which doesn't actually show anything now but will help a lot once the game gets bigger. Last post I just had everything in 1 class/file to test things out, but now I've sorted everything appropriately.

For starters, I made a simple way to group up sprites so that I can load/unload groups of sprites. This will help if I ever plan on making it run on mobile devices (need to unload things when not needed due to low-memory). So now it's just a matter of grouping sprites appropriately and loading them when needed, for example, if the game was going from one area to another, we may want to load the groups of sprites containing characters/enemies used in the next area as well as the terrain tiles used. This is how I've set things out since it should make loading/unloading large amounts of sprites easier.

Another thing I created was an abstract Map class with only 1 child for now (the map in the image below) but I plan on having subclasses which are stuff like LoadedMap (a map loaded from a file) and GeneratedMap (a map with random generated terrain). Plan is to have random generated maps (terrain and perhaps more) and then classes extending GeneratedMap which will customise the generation (water, mountains, deserts, etc). I hope to have at least a little to show in terms of random maps next post.



Wednesday, December 5, 2012

First post!

First post! This blog will be primarily used for posting progress as I go along developing small games as a hobby.

I decided to start games programming again in my spare time and this time decided to use XNA, which I'm am only slightly familiar with and haven't used in a long time, so should be interesting. I haven't too much of an idea for a game but I've always wanted to do something isometric, so I've started off with the following