Hey guys I figured it was about time I upgraded my presentation quality with this game and starting recording some actual "gameplay" for you to see. So without further ado, here is the first in-game video for my Adventure Resource game:
I apologize for the low framerate, I'm still getting use to this new video capture program. I assure you the game runs plenty fast.
Showing posts with label crafting. Show all posts
Showing posts with label crafting. Show all posts
Monday, June 27, 2011
Game Demos on YouTube
Labels:
C#,
cave generation,
code,
crafting,
demo,
game development,
gathering,
generation,
inventory,
Perlin Noise,
platform,
platformer,
player,
resources,
terrain,
video,
XNA Game Studio,
youtube
Saturday, June 18, 2011
How to add a Basic Inventory
Hey guys it's been a great week here, I have a couple of new things added to my game and I thought I would share them with you. I admit that I have been spending a lot of time this week playing Terraria but I was still able to get some good progress made on my game. The two things I have added this update are
- A basic way to add different blocks into the game (still has a long way to go before I'll call it good)
- Very basic player inventory showing the block last mined (which I'm going to explain with code in this post)
Now I'm sure a lot of you have read, or been told, or know just from personal experience that when implementing something new into a game, or any software really, it's usually a great idea to create the most basic form of whatever it is you are trying to create. This way there is something to build on and improve on, as opposed to it remaining just an idea inside of your head.
The player inventory is a perfect example of this (in my mind). Instead of trying to create an elaborate inventory system from the start (since I have never made one before), I decided to simplify it and make my inventory (for now) consist of one block (the last block that the player 'mined'). This way I don't have to worry (yet) about managing a list of different items (which I don't even have in the game yet). The way that I do this is simply to add a:
public Block Inventory;
In my Player class. This allows me to add other lines whenever I click the left mouse button or right mouse button that (for example) look like this:
Inventory = TileLayer.blocksDictionary[TileLayer.GetBlock(mouseCell.X, mouseCell.Y).Name + "SingleTop"];
For the case of left mouse click (which adds the block the player clicked on to the inventory). When the player clicks the right mouse button, I simply have pass the block in the player's inventory to the method that I use to place a block:
TileLayer.PlaceBlock(mouseCell.X,
mouseCell.Y,
Inventory);
This very simplistic version of a player inventory is my starting place to expand upon later and add more functionality to it.
And that's the basics of adding in a player inventory. The only trick left to do is display it on the screen (which I do in the Game1.cs file). Basically, I added an itemBackground Texture2D variable with a rounded transparent rectangle as the item background texture. After that I simply told the spriteBatch to draw the item Background and the player's inventory's texture at the top right corner of the screen, thereby displaying a pretty cool new feature in the game. Here's some of the drawing code for a reference:
And that's the basics of adding in a player inventory. The only trick left to do is display it on the screen (which I do in the Game1.cs file). Basically, I added an itemBackground Texture2D variable with a rounded transparent rectangle as the item background texture. After that I simply told the spriteBatch to draw the item Background and the player's inventory's texture at the top right corner of the screen, thereby displaying a pretty cool new feature in the game. Here's some of the drawing code for a reference:
spriteBatch.Draw(
itemBkgd,
hudLocation + new Vector2(titleSafeArea.Width - 42, 10.0f),
new Color(48, 48, 48, 100));
if (tileLayer.Player.Inventory != null) {
spriteBatch.Draw(
tileLayer.Player.Inventory.Texture,
hudLocation + new Vector2(titleSafeArea.Width - 42 + 16, 26.0f),
tileLayer.Player.Inventory.SourceRectangle,
Color.White,
0.0f,
new Vector2(8, 8),
1.0f,
SpriteEffects.None,
0.0f);
}
I hope this has helped you understand that you don't have to have the biggest and best anything when you are first developing it. For most things, it's better to start off with the very basics and add to it as you go along. This helps keep you motivated as well as encouraged to put more things into your game.
And just in case you thought I wasn't going to show the "finished" product:
Check back soon for more updates to my game. On a side note, if you have an idea for a name for this game, leave me a comment because I think it's about time I started calling it something other than 'my game'. Thanks everyone!
And just in case you thought I wasn't going to show the "finished" product:
Check back soon for more updates to my game. On a side note, if you have an idea for a name for this game, leave me a comment because I think it's about time I started calling it something other than 'my game'. Thanks everyone!
Sunday, June 12, 2011
New Block Type
Hello everyone, I have a game update to share with you. As of tonight, I have a rudimentary way of random inserting a new block type into the game world. Right now, I'm only using dirt and coal (new) blocks. I'm pretty excited about this newest addition to the game, as it will allow me to begin work on other things such as the player's inventory.
My method for putting coal blocks in the game is pretty simple at this point. First, I loop through all the blocks in the map, looking for the first non-null blocks (meaning that this block is theoretically the ground level for this particular column). I then loop through the current column and have a set of 'if-then-else' conditions that check if the column block in question is at a certain depth. Based on the depth there is a chance that the block will be a coal type, otherwise it is a dirt type.
I'm sure there are many other more sophisticated ways to randomly put different block types into the map, but for now this method will do just fine for me. I appreciate everyone who is following this game's progress and I will continue to provide updates as I make changes and improvements to the game.
My method for putting coal blocks in the game is pretty simple at this point. First, I loop through all the blocks in the map, looking for the first non-null blocks (meaning that this block is theoretically the ground level for this particular column). I then loop through the current column and have a set of 'if-then-else' conditions that check if the column block in question is at a certain depth. Based on the depth there is a chance that the block will be a coal type, otherwise it is a dirt type.
I'm sure there are many other more sophisticated ways to randomly put different block types into the map, but for now this method will do just fine for me. I appreciate everyone who is following this game's progress and I will continue to provide updates as I make changes and improvements to the game.
Labels:
C#,
cave generation,
Cellular Automata,
crafting,
game development,
gathering,
generation,
platform,
platformer,
resources,
terrain
Thursday, June 9, 2011
Dynamic Block Texturing Is Up
Great success! After too many days of struggling with the code to get the blocks updating their textures based on what blocks are neighboring around them, I finally have a working build that looks really good. The main trouble I was originally having was that I was trying to test for too many cases, which overcomplicated the entire thing.
What I first tried to do was test a block's eight neighbors to determine which texture should be used for that block. This was over-complicating the process; not only did I have to have the six textures for the simple left, right, top, bottom scenarios, but I also had to have textures for all of the possible corner cases. This left me very frustrated and in need of something else to do.
The solution to my problem was very easy in fact. What I did was shrink the block size from 32 x 32 to 16 x 16 and dropped the corner cases / corner textures. Please note that when I say corner textures I'm referring to a piece that has a corner cutout of it. I also created new textures for the blocks with edges that seemingly run together. This makes the cases in which there is an L-shape still look good in the corner spot because the top and right textures almost run together.
Other things that I did include changing the resolution to classic 800 x 600, changing the player sprite from a square to a thinner, taller rectangle (to more closely resemble the final sprite's size), and am running an UpdateBlock() method every time the player removes and adds a block (which updates the surrounding blocks' textures based on which action the player made).
The game is coming along nicely in my opinion. Next things on the list include better terrain generation, more types of blocks, player inventory, and many more things that I don't want to list for fear of getting overwhelmed by it all.
For now, please enjoy a screenshot of my small (but big to me) victory.
What I first tried to do was test a block's eight neighbors to determine which texture should be used for that block. This was over-complicating the process; not only did I have to have the six textures for the simple left, right, top, bottom scenarios, but I also had to have textures for all of the possible corner cases. This left me very frustrated and in need of something else to do.
The solution to my problem was very easy in fact. What I did was shrink the block size from 32 x 32 to 16 x 16 and dropped the corner cases / corner textures. Please note that when I say corner textures I'm referring to a piece that has a corner cutout of it. I also created new textures for the blocks with edges that seemingly run together. This makes the cases in which there is an L-shape still look good in the corner spot because the top and right textures almost run together.
Other things that I did include changing the resolution to classic 800 x 600, changing the player sprite from a square to a thinner, taller rectangle (to more closely resemble the final sprite's size), and am running an UpdateBlock() method every time the player removes and adds a block (which updates the surrounding blocks' textures based on which action the player made).
The game is coming along nicely in my opinion. Next things on the list include better terrain generation, more types of blocks, player inventory, and many more things that I don't want to list for fear of getting overwhelmed by it all.
For now, please enjoy a screenshot of my small (but big to me) victory.
Thursday, June 2, 2011
Mouse input is now a reality
I'm happy to say that last night's dev session resulted in the game now having a decent mouse input handler in which the player can remove blocks and place blocks in the map. For now, the player can only place 'ground' blocks because I don't have any inventory system in place (yet) for the player.
I have also started making simple artwork for the different types of blocks found in the game. This is a very exciting game for me to make because I feel like I'm making great progress on it and these little successful additions really make the development process more fun and rewarding. This also gives me motivation to continue my efforts in making this game.
Also, I'm going to need a title for the game (maybe not right now, but soon). I don't want to keep calling it 'the game' or 'my Minecraft clone'. So if you have a suggestion for a name that would go along the lines of a 2D Resource gathering Rpg, please leave it in the comments :)
I'm really looking forward to the weekend because I'm going to work on changing over from the simple red and green tiles to some actual artwork. This is more of a challenge than it might seem because I will need to change my current map generation system. Basically, I will need to take it from a purely random generation to a more structured generation system that looks at the blocks next to the one it is currently generating in order to decide which block to place.
Check back and see how I do.
I have also started making simple artwork for the different types of blocks found in the game. This is a very exciting game for me to make because I feel like I'm making great progress on it and these little successful additions really make the development process more fun and rewarding. This also gives me motivation to continue my efforts in making this game.
Also, I'm going to need a title for the game (maybe not right now, but soon). I don't want to keep calling it 'the game' or 'my Minecraft clone'. So if you have a suggestion for a name that would go along the lines of a 2D Resource gathering Rpg, please leave it in the comments :)
I'm really looking forward to the weekend because I'm going to work on changing over from the simple red and green tiles to some actual artwork. This is more of a challenge than it might seem because I will need to change my current map generation system. Basically, I will need to take it from a purely random generation to a more structured generation system that looks at the blocks next to the one it is currently generating in order to decide which block to place.
Check back and see how I do.
Labels:
C#,
crafting,
game development,
gathering,
Minecraft,
resources,
XNA Game Studio
Wednesday, June 1, 2011
A New 2D Resource Game
Over the past few days I have begun creating a new XNA game that I am quite excited about. This game is a resource gathering game with rpg elements. I have found a new love for Minecraft and have discovered how much fun 2D resource games like Terraria can be. Truth be told, the fact that Terraria is written in C# using XNA Game Studio gave me new inspiration and motivation to create my own game.
The problem I usually face when creating a game is finding the motivation to finish it. It's true, I've only finished one game really (a space shmup) and have dozens of unfinished games lying around. I am determined to make sure this new game will be different though and I'm using this blog to help me accomplish that.
The basic premise of the game is to survive by gathering resources and building things (i.e. crafting weapons, constructing buildings, etc.) while monsters try and attack you. Later on there will be a day/night cycle and monsters will only come out at night, but that's for later. As for now I will focus on building the game in small increments. This will allow me to focus on the pieces of the puzzle as opposed to looking at the whole (and incomplete) picture itself, thereby keeping me more focused on the features in the game. One element of the game that will make it different from other games like Minecraft and Terraria is that the player will have skills that they must level-up in order to (for example) craft better tools, cook better food, make better potions, gather rarer resources, etc.
So far the things I have in the game are:
Please check back for updates about the game and feel free to offer any comments about my game. Oh, and here is a screeny for your viewing pleasure.
The problem I usually face when creating a game is finding the motivation to finish it. It's true, I've only finished one game really (a space shmup) and have dozens of unfinished games lying around. I am determined to make sure this new game will be different though and I'm using this blog to help me accomplish that.
The basic premise of the game is to survive by gathering resources and building things (i.e. crafting weapons, constructing buildings, etc.) while monsters try and attack you. Later on there will be a day/night cycle and monsters will only come out at night, but that's for later. As for now I will focus on building the game in small increments. This will allow me to focus on the pieces of the puzzle as opposed to looking at the whole (and incomplete) picture itself, thereby keeping me more focused on the features in the game. One element of the game that will make it different from other games like Minecraft and Terraria is that the player will have skills that they must level-up in order to (for example) craft better tools, cook better food, make better potions, gather rarer resources, etc.
So far the things I have in the game are:
- Random world generation
- Platformer-style physics (modeled after the Platformer Starter Kit on the XNA site)
- 2D camera that follows the player and does not allow him to leave the map (modeled after Nick Gravelyn's camera in his Tile Engine Tutorial)
- Map saving and loading with the player's position saved as well (modeled after Nick Gravelyn's saving/loading in his Tile Engine Tutorial)
- Items, gatherable and creatable
- Enemies with basic AI
- Block gathering / placing
- Basic inventory
- Menus
- Crafting
- And more...
Please check back for updates about the game and feel free to offer any comments about my game. Oh, and here is a screeny for your viewing pleasure.
Labels:
C#,
crafting,
game development,
gathering,
Minecraft,
platform,
platformer,
resources,
Terraria,
XNA Game Studio
Subscribe to:
Posts (Atom)