fredag den 8. februar 2013

Bees, Rain and more.

So video 10 has been out a little while, so I wanted to write a little about it, before it gets too old. But before I delve into video 10, I want to tell a bit about my newest video. The video is focused more on the work I do, instead of just showing the results and commenting on them. I will still continue the Phantobra - The Game series, but I figured I'd throw in a "Behind the scenes" video now and then, when I feel I have something to show. With that out of the way - Lets take a look at the 10th video.

This video includes the new Beehive mob, scrolling backgrounds, throwable snowballs, rain, wooden bowls, and a few more things, that the observant viewer might see :-)
Also, thanks to Dennis Panduro Hess for making an original music track for the game.
Check out his music at www.soundcloud.com/Panduro

What's New

- New Beehive and Bee mob
- Scrolling backgrounds (Work in progress)
- Throwable weapons - Snowball
- Rain
- Wooden bowls
- The first music track for the game!

Beehives and bees

When I sat down to design my next mob I wanted to use some new mechanics. This ended up with me taking a trip down memory lane, back to when I was like 8-10 years old, maybe a bit younger. Back then I was fascinated with bees, partly because I played this game where you helped a train full of cereal through some levels, where you controlled a bee that was responsible for adding honey and such to the cereal, but also because I loved honey back then. (Today I'm not so fond of it though :P )
So I decided that my next mob should be bees. Early in the design process I realized that having bees appear randomly didn't work for me. I then thought of having bee swarms appear as one mob, but that didn't agree with me as well. So I started thinking out of the box, and got the idea that, maybe the mob shouldn't be a bee, but a beehive, that shoots bees. Initially that was the way I decided to go, but I quickly realized that beehives would then turn out to be nothing but a cannon sitting in a tree shooting at you. The next logical step was then to make both beehives and bees as mobs. This way of thinking made things interesting. So I ended up with making the Beehive mob send out bees, whenever a player gets too close. The bees then follow the player until one of three things has happened:
1. The bees hit/sting the player
2. The be is killed.
3. The player hides under water.
If either 1 or 3 happens, the bees will return home to their hive. I decided on this behavior since bees usually only stings once (and usually dies from tearing off their stinger as far as I know), and they can't follow you under water.
The bees themselves do not drop any loot. To get anything you need to destroy the hive. The hive then drops  some honey, and occasionally some honeycomb. Honey can be consumed, which reduces hunger slightly. I am considering making it possible to bottle the honey for increased hunger satisfaction. If you gather enough honey comb, the plan is that you can create your own beehive, that produces honey over time. You might have to feed the bees something else, like sugar water or something.

Scrolling Backgrounds

Any platformer with respect for itself will have a background, and in most cases scrolling backgrounds. As with most things in this project, scrolling backgrounds is something I've never done before. I read up on it on the web, and it is, for the most part rather simple. The further away the background layer is, the slower it moves. Currently I only have two layers (not counting the sky), but I think I will be adding a third, possibly a fourth. The real challenge for me here was drawing the background. I am somewhat satisfied with the mountains I've made, but sometime in the future I might remake them. The hills in the foreground are undoubtedly going to be replaced, partly because they really aren't that great, and partly because I would like to have the hills separated into two layers. I will also change the backgrounds so that the react to vertical movement, at least to some degree. This way I could have a layer that might only be visible from a certain height. Small things like this adds to the depth and dynamic of the world.

Throwable Weapon - Snowballs

The first throwing weapon has been implemented. This, of course, also means that the throwing mechanism has been added. Snowballs are collected by harvesting snow with a shovel. One tile gives one snowball. This means that snowballs are easily replaced during winter. Snowballs deal very little damage, and are currently ineffective against everything, but bees. A bee that gets hit by a snowball, dies immediately. Snowballs are used off the quickbar, like every other item, and are thrown in the direction of the mouse cursor. I really like how they turned out, both visually but also on a physics level. There's no reason to try and explain how they behave, since the video does a good job of showing it.
Now that the throwing mechanism has been created, it's only a question of me designing new throwable weapons, like grenades, dynamites, darts, etc. I might have to add a weight value to the throwing weapons, which will allow me to limit the range of very heavy, or very light weapons.

Rain

Last time it was snow, now it's rain! Codewise rain is using most of the same code that snow uses, which made it extremely easy to implement. The sound for the rain, is just a placeholder, but it just felt too tame without any sound at all. As shown in the video, rain will increase the volume of water in existing water tiles, but won't create new ones. There's really not much to say about it. I am considering adding more weather effects like thunder, and maybe hail. I also need to create a "grey sky" for when it rains. It looks rather weird that it's sunny when it pours down (At least when no rainbow is present).

Wooden Bowls

The first "bucket" item has been implemented. The bowls, are able to pick up water, so that you can either drink it, or pour it somewhere else. I am still working out how much water, compared to a full tile, a bowl can hold, but this will be an easier task when I decided to add buckets and bottles.
Bowls stack in stacks up to 255, when they are empty. A filled bowl is not stackable. The reason for this, is to make better water containers worth more. Let me try to explain this further:
Lets assume that a bowl and a bottle can hold the same amount of water- Why would you spend your hard to come by glass on making bottles, when you can simply use wood to make a bowl? The reason is that bottles stack, bowls don't. If you decide to go on a large trek, you need to stock up on water. Let's say you decide that you need to bring 3 supplies of water. The bowls would take up 3 inventory slots, where the bottles might only take up one. This way I get to increase the quality of certain water containers over others, even though they can carry the same amount. Maybe crystal bottles can be stacked in stacks of 10, which makes them better for long treks. The same may be true for certain kinds of food. They might be equally satisfying, but the "better" food would stack in larger amounts.

Music!

The game has gotten its first exclusive music piece. This was made by Dennis Panduro Hess - Check out his music at www.soundcloud.com/Panduro
You will be able to hear the track in the video.

I think that was most of it covered for the 10th video. Thank you for reading. I know I've been behind with the blog for a while, but I am catching up. The next post will be a supplement to the new Phantobra Behind The Scenes series. The first video is already up, where I show off my level editor, and explain why I even have a level editor, for a supposedly randomly generated game. But enough from me, enjoy the 10th video, and again, thank you for reading!
Please do share this with friends, and the same goes for the video, if you know someone who might be interested in reading/watching any of this :-)
Enjoy!

Phantobra - The Game - Part 10: Bee Careful, It Might Rain





tirsdag den 15. januar 2013

Natural Look and Particles!

It's been a while since my last post here, but a lot has happened.
This post will cover the changes shown in video 8 and 9. Video 10 will be covered soon.

All of the natural tiles have been given a more natural look- This includes: Dirt, grass, sand, stone, and all the ores(3 Types of ore have also been added). World items has been introduced, like Workbench, furnace and anvils. Even chests have been implemented.  On top of that I finally got around to making particle effects.. and I think some of the results are pretty nifty. Effects include particles from mined tiles, plant particles when plants are destroyed, blood splatter and snow.

What's New?

- Natural tiles have received a more natural look.
- Three new ore types have been added - Copper, Iron, Gold.
- World items have been added - Including the furnace, which is used to smelt the ore into ingots.
- More craftable items have been added to make use of the newly added materials.
- Chests have been added- It is now possible to store items and saving loading of items works too.
- Equipable Items & equipment slots
- Particle system has been implemented. Various new particles have been created.
- Weather has been implemented. Currently only snow is available.
- Some extra christmas related stuff (See video 9)

Natural Look

All natural tiles, including background tiles have received a more natural look. This complicates the way backgrounds work though. When building a wall (background tiles) the edges only cover about half the outer tile. Part of the reason for this is to make doors more realistic looking, so that when you place a door, there will be wall on one side, but not on the outside. This works very well for the "artificial" tiles, but for natural tiles this was quite a challenge, one that I still haven't decided if I have "owned". I didn't show any of this off in the video, since I'm still not sure I will keep the result. I might make a little video about it in the future to better explain the issues.

Copper, Iron, Gold

With the first three ore types added to the game, a new level of depth has been added to the game.  Part of the goal in the game is to gather resources, and use them to craft various objects. There will be a difference in the rarity of the ores. Gold will be much more rare than both copper and iron, but copper will be more common than iron. A lot games handle resources in tiers. So that copper in this case would be Tier 1, iron Tier 2 and Gold Tier 3, increasing in effectivity. What I wish to do is to follow this direction some of the way, but I would like to keep every material you find usable, no matter how advanced you are. Thus recipes for items created with gold will still require some components based in copper and iron. This way copper or iron won't have to be "yet another ore deposit" you come across when you explore, but instead provoke a small feeling of success.

World Items

"World Items" have been added to the game. Currently this include a Workbench, furnace, and the anvil. These three items are all involved in crafting. You need the furnace to melt your ore into ingots, and the anvil to craft them into weapons. The workbench are used to create various items, including the furnace. In the future world items will also include things like chairs, tables, beds, candles, and other furniture. Currently a word item occupies four tiles, 2X2. The orientation of a world item tile is fixed, su 2X2 tiles will include "UpperLeft, UpperRight, LowerRight and LowerLeft. When I draw the tiles I simply only draw it if it has the UpperLeft orientation. That way I stay true to the tile grid, while at the same time avoid drawing the same thing four times.

Chests

The chests works mostly like the World items, the only difference is that a chest has an inventory. A chest (or a containerTile) also occupies 2X2 tiles, and are drawn in the same way as the world items. Each containerTile can potentially hold one baseItem array (The inventory), but only ContainerTiles with the UpperLeft orientation will actually have one. This means if you right click the chest to access its inventory, the tile you actually click, will point towards the UpperLeft tile and then access the inventory there.
GUI elements has been added for the chests as well, so they are fully implemented in the game.

Equipable items

I've finally gotten around to making the equipment slots, and thus added a few equipable items. Currently there's the Copper armor (Looks more like a leather armor, so that might change), and a few other things you can see in video 9. Currently there's only armor, but it is represented visually on your character.
Things like jewelry and trinkets, will not have a visual effect on the player, except in some rare cases. Currently the armors does give some protection, but I won't go into detail with the mathematics behind that, since currently they are more or less untested, and rather simple.

Particles

Particles.... Finally. Something as small, and fairly simple as particles can really add some feel to the game, and I think my first attempts are pretty decent. Currently there's blood when hitting mobs with weapons, plant particles, when you destroy plants, mining particles, movement dust and snow particles. Overall I am very happy with the results, and I am surprised of how simple they actually were to make. - At a later time I might tell a bit about how I am making and handling particles.

Weather

Snow! What better type of weather to start out with in the holly days. Having the particle system in place it was a small matter to create snow, but after that I felt something was missing. I wanted the snow to have an effect on the world, thus I create the snow tile. Everytime a snowflake collides with a tile, there's a 1/100 chance that it will place a snow tile on top of that tile. There was one issue with this though- Since I've just made all tiles look more natural, there would, in some cases, be small pockets of air under the snow, due to the fact that the tile under the snowtile wasn't filling out the entire square. I fixed this by drawing the snow tile, a few pixels lower than its actual position- So basically The snow is pushed a few pixels down, to give the illusion that the snow has filled the small gabs in the tile below. Snow can then be harvested with a shovel, which gives you one snowball pr snow tile. As of video 9, snowballs aren't yet usable (They are in video 10, but I'll get to that in the next post).

I've also added a few extra christmas goodies, as you will see in the video. All of the christmas stuff (including snow) was something my daughter inspired me to do, since she asked me to make something related to christmas. So everything christmas related had to be approved by her, before I added it to the game.

Again I apologize for the long delay, and I will be posting my next two blog entries within the week. The first one, related to my 10th video, which is already out. The other post will be more about how I do things. The intention with this blod initially was to show the process, and I think I haven't quite lived up to that.

Anyways - Below are the videos - Please enjoy them and share them if you like:
Phantobra - The Game - Part 8: More Tiles, Less Tiley

Phantobra - The Game - Part 9: Here's The Season To Be Jolly

Thanks for reading / watching - See you soon!