Howdy folks. What with christmas being a time of fun and relaxation you may not be surprised to find that I haven't done an awful lot of work! That isn't to say that I've done nothing however. My annual visit to the grandparents on boxing day let me start off making the engine for the game. Or...at least that was the plan. I got side tracked looking at the new features of XNA 3.0 (well...I guess they're actually old features seeing as the latest version is 4.0) It seems I can use MP3's in the sound engine! Booya!! This is good news as it's gonna reduce the size of the game by a lot!
I didn't actually get round to making a lot mainly because I was researching these new features. It seems they come with there pro's and cons. Some of which were solved in 3.1, but if my memory serves, I've been making the libraries in 3.0 which means I'd have to recompile everything....that'd be a pain...
Look for more updates in the new year!
Wednesday, 29 December 2010
Monday, 29 November 2010
Overdue
Well it seems that I completely forgot about making a video and went straight on to making more parts of the project! Thankfully a certain James Boote was there in a pinch to shout at me for not making said video. Things like particle effects and shaders are still missing along with the ability to save entire projects, but most stuff is covered. Have a butchers:
Saturday, 13 November 2010
Time for a video?
Yayyy, drawing features are done, menu's are done and saving and loading is done. As promised, when I get the chance I will make a quick video so you can all see what the hell I've been talking about these past few months. Some bits of the program you will see are not yet finished, but it will give you a nice little glimpse of what's to come
Thursday, 11 November 2010
Moving on up
Bit more progress to report ladies and men folk. Not a lot but the program is getting incredibly close to a milestone where I can make a video and start showing off what it is I've actually been doing all this time. Objects can now be re-scaled, moved to any layers above or below where it was originally placed and can also be sent to the front or back of the draw queue for that particular layer. Just one more draw option (drawing to a user defined rectangle) and maybe some additional menu's and project management features to be done and I'll post something on youtube.
Monday, 8 November 2010
Natural Selection
There's nothing like a good old case of flu (I think it was flu at least?) to make you lay in bed for 17 hours with nothing to do but ache, succumb to fever and think of all the things you'd rather be doing. Well, given my lengthy thinking time you'll be glad to know that I did indeed think about doing some work once more!
Tonight's been pretty productive to be honest. Mostly creating stuff and not running into many bugs. It's now possible to scale objects using the mouse wheel to scale up and down before placing an object and it's also possible to select items already placed as well. Being able to select things makes room for lots of new functionality. Moving them up and down layers, fine tweaking their position, resizing them or just deleting them.
At the moment re-positioning and deleting is implemented all complimented by a handy selection box shown around the object in question. Just scaling and draw order to work on next.
Tonight's been pretty productive to be honest. Mostly creating stuff and not running into many bugs. It's now possible to scale objects using the mouse wheel to scale up and down before placing an object and it's also possible to select items already placed as well. Being able to select things makes room for lots of new functionality. Moving them up and down layers, fine tweaking their position, resizing them or just deleting them.
At the moment re-positioning and deleting is implemented all complimented by a handy selection box shown around the object in question. Just scaling and draw order to work on next.
Thursday, 28 October 2010
Yarrrr!!! and stuff...
Ok, so the mini mini project was actually completed on time, however there were a few slight changes to what I had originally planned. Because I always want to do one better than myself (yes you read that right, I compete with myself...) I decided to create a completely new game somehow related to the school rather than remaking something I new I could already do.
When I came up with this idea I thought I had maybe an entire week to get things done. However, work was super busy making me incredibly tired and/or ill, turning my week into a mere 2 days. (I like a challenge but considering my "I feel dead" state, I didn't really want to make an entirely new game in my spare time). But I kinda shrugged it off and came up with this:
There's also a funky character selection screen that I won't show because it uses actual people who I modified to look like pirates. I'm not sure they would appreciate me putting those pictures on the internet...
Considering it took a grand total of 12 hours over the course of 2 days, there's a considerable amount of stuff in this "mini" project. It's also given me some insight into some problems I'm gonna have with water in the RPG...fun times.
Speaking of the RPG, I'm currently working on scaling objects. This is a bit tricky considering that an object is made out of many tiles that have been "placed" in a specific position to create the illusion of it being a complete object. Each tile must be scaled and moved appropriately depending on it's position and size. Good fun...
But yeh, I'm still going folks
When I came up with this idea I thought I had maybe an entire week to get things done. However, work was super busy making me incredibly tired and/or ill, turning my week into a mere 2 days. (I like a challenge but considering my "I feel dead" state, I didn't really want to make an entirely new game in my spare time). But I kinda shrugged it off and came up with this:
The title screen uses 3D models/water (the water moves/reflects and looks very cool) |
The game screen is 2D (the water still moves and still looks cool). Check it out, my particle engine is in there ;) |
Considering it took a grand total of 12 hours over the course of 2 days, there's a considerable amount of stuff in this "mini" project. It's also given me some insight into some problems I'm gonna have with water in the RPG...fun times.
Speaking of the RPG, I'm currently working on scaling objects. This is a bit tricky considering that an object is made out of many tiles that have been "placed" in a specific position to create the illusion of it being a complete object. Each tile must be scaled and moved appropriately depending on it's position and size. Good fun...
But yeh, I'm still going folks
Thursday, 14 October 2010
Silence...
You may have noticed I've not updated for a while. This is actually due to the fact I have nothing to update you with! Parental units have gone to Cyprus for 2 weeks, leaving me with an empty house! This means loud music and access to the TV! So you can imagine why I haven't been doing much work in this time ;)
Though, for a small change of pace I'll be updating you on a mini mini mini project I'll be working on. I've been asked to give a presentation to year 6 about careers in the game industry. Out of curiosity I was asked "is there anything you've made that we can run in the background?"
To which I replied "nothing really appropriate...I made space invaders, but instead of there being space invaders there were birds, and instead of them shooting you they were shitting on you."
"Oh, they'll love that!"
...right! ok then! time to dig out the old uni code and polish it up a bit! Hopefully you'll also see a nifty presentation posted here as well. This is to be done by Thursday next week, so stay tuned!
Though, for a small change of pace I'll be updating you on a mini mini mini project I'll be working on. I've been asked to give a presentation to year 6 about careers in the game industry. Out of curiosity I was asked "is there anything you've made that we can run in the background?"
To which I replied "nothing really appropriate...I made space invaders, but instead of there being space invaders there were birds, and instead of them shooting you they were shitting on you."
"Oh, they'll love that!"
...right! ok then! time to dig out the old uni code and polish it up a bit! Hopefully you'll also see a nifty presentation posted here as well. This is to be done by Thursday next week, so stay tuned!
Wednesday, 6 October 2010
Fills me with confidence
I really should stop punning with my blog titles...
Well if you haven't figured it out from that, I've implemented a 'fill' function that lets you fill the map with a certain object. As an example and to show off some upcoming shiny's I selected a grass object 1x1 tiles's in size and used the fill function to fill the entire map (size in pixels can be seen in the bottom right) with that grass object
The GUI will more than likely be changed once the bulk of coding is done but you can see in the lower right some things that have already been implemented (Map resizing, Map preview draw methods, Adding and removing additional layers and being able to set the collision map)
The whole thing is nearly finished, just a few things left on my to do list and unless I think of things to add along the way, these should be the last! Check it out:
The additional option of using a tile based collision system instead of texture based
Water effects (water effects will be applied to a selected region/s of the map)
Atmosphere effects (day/night/fog)
Weather effects (rain/snow/storm)
Managing multiple maps in one project (that's what the big white box at the bottom is for)
Draw to rectangle (like the fill function, but only fills a region specified by the user)
Map Saving/Loading
Eraser and undo functions
Well if you haven't figured it out from that, I've implemented a 'fill' function that lets you fill the map with a certain object. As an example and to show off some upcoming shiny's I selected a grass object 1x1 tiles's in size and used the fill function to fill the entire map (size in pixels can be seen in the bottom right) with that grass object
Click to enlarge |
The GUI will more than likely be changed once the bulk of coding is done but you can see in the lower right some things that have already been implemented (Map resizing, Map preview draw methods, Adding and removing additional layers and being able to set the collision map)
The whole thing is nearly finished, just a few things left on my to do list and unless I think of things to add along the way, these should be the last! Check it out:
The additional option of using a tile based collision system instead of texture based
Water effects (water effects will be applied to a selected region/s of the map)
Atmosphere effects (day/night/fog)
Weather effects (rain/snow/storm)
Managing multiple maps in one project (that's what the big white box at the bottom is for)
Draw to rectangle (like the fill function, but only fills a region specified by the user)
Map Saving/Loading
Eraser and undo functions
Tuesday, 5 October 2010
In between work and play
Ooooo! look! an update!
That's right folks, in between work and Fifa and FF14 I have salvaged some time to do some more stuff on the map maker. Collision maps can now be applied to normal maps. I've not done the logic behind it yet cus I've not started to implement the live testing phase yet. By that I mean you cab have a character walking around the map even as you build it. Ideal for testing collisions and occlusions and generally getting the feel of a map. I've also implemented a few drawing options for maps such as:
being able to draw the entire map to a specified opacity
being able to draw the entire map to semi transparency, except the layer you are currently working on which is drawn at full opacity
being able to draw the entire map at full opacity, representing a preview of what it will look like in game.
Speaking of which, I've also made a few changes to the map so that there can be an infinite number of layers. I can't see any immediate use for more than 2 layers, but just in case, the option is in there. It's just a case of implementing the GUI for all these things. That and saving of course. Not a lot of use if we can't save a map...
That's right folks, in between work and Fifa and FF14 I have salvaged some time to do some more stuff on the map maker. Collision maps can now be applied to normal maps. I've not done the logic behind it yet cus I've not started to implement the live testing phase yet. By that I mean you cab have a character walking around the map even as you build it. Ideal for testing collisions and occlusions and generally getting the feel of a map. I've also implemented a few drawing options for maps such as:
being able to draw the entire map to a specified opacity
being able to draw the entire map to semi transparency, except the layer you are currently working on which is drawn at full opacity
being able to draw the entire map at full opacity, representing a preview of what it will look like in game.
Speaking of which, I've also made a few changes to the map so that there can be an infinite number of layers. I can't see any immediate use for more than 2 layers, but just in case, the option is in there. It's just a case of implementing the GUI for all these things. That and saving of course. Not a lot of use if we can't save a map...
Thursday, 23 September 2010
Save it for a rainy day
So the other day I bought a PS3. Shocking, I know. So far I've only got the one game: Heavy Rain, but I'm playing it with every spare minute I have. Also next week I get FF14 and Fifa 11 to distract me even more! Things are not looking good on the Marc being focused horizon! If things start to go quiet, you know where I am...but you also know I'll be back just as soon as I've played these games to death ;)
Sunday, 19 September 2010
Collision detection
Making a map with lots of objects can cause problems in terms of detecting collision between scenery and the player character. Each update, every object on the map must be checked to see if the player is about to walk into it or not. If you're on a world map, that's a lot of things to check every time the player moves just one pixel! So I figure the easiest way is to have something that I'm going to dub a "collision map".
Take this small map for example (made in the map maker! woo!)
Take this small map for example (made in the map maker! woo!)
This map is tiny (10x10 tiles) and yet there are 7 objects in this scene that will need to be checked for collisions:
The tree
The tree stump
The archway
The building
Three separate rock objects moved close together to give the impression of a rock cluster
The idea behind the collision map is to allow a single check to be performed for collisions rather than one per object. To do this I'll need something that looks like this:
Black regions indicate solid areas while white regions indicate passable areas. As the game runs I can check the player position and the direction they are moving and then check to see if they will end up in a black region. One check that encompasses all objects on the map. Handy! Combine the collision checking with the graphics side of things and no longer are we restricted to checking "collision bounds" (rectangles). We can have any shape we want.
I'll have to add this functionality into the map component, so give me a few days to get it sorted =)
Friday, 17 September 2010
Bug fix update
Things are looking good. A lot of bugs have been fixed and I'm nearing the stage where I'll be working on the maps themselves. The tree is now sorting everything alphabetically which makes things nice and tidy. Copied objects are now working. There was a problem where copied objects "forgot" their name which kept popping up time and time again, even after I thought I had fixed it. Seem's I've squashed that one for the last time. There were also a few problems with tilesets not being loaded in time for objects to be drawn. All these have been sorted.
The only thing really left to do is to tidy up the GUI. I've begun work on the object preview panel which shows a picture of the object that has been selected in the tree. I figure it just makes things easier to find, especially when you have a lot of variations of the same object (Tree, Tree2, Tree3 etc...)
We'r getting close to some creative map creation people!! The sprites are coming along nicely as well, courtesy of James Boote. Will have some posts dedicated to the cast once I begin work on the game engine, cus that won't be fun to write about...
The only thing really left to do is to tidy up the GUI. I've begun work on the object preview panel which shows a picture of the object that has been selected in the tree. I figure it just makes things easier to find, especially when you have a lot of variations of the same object (Tree, Tree2, Tree3 etc...)
We'r getting close to some creative map creation people!! The sprites are coming along nicely as well, courtesy of James Boote. Will have some posts dedicated to the cast once I begin work on the game engine, cus that won't be fun to write about...
Wednesday, 15 September 2010
This working hard is hard work =(
I've not had a chance to do an awful lot toward the map maker in the last few days. In fact truth be told, since my last update I have fixed a grand total of 1 bug. Actual work has been so crazy lately it leaves my head exhausted and I can't think straight. I went to bed at 10 o'clock the other night....10!!! I haven't done that for about 2 years! But as things quieten down (they feel like they are anyway...) I can get the ball rolling again.
Naturally; as I've fixed one bug another shows it's face. It was the case that copied objects are pasted under the name of "copy of
Naturally; as I've fixed one bug another shows it's face. It was the case that copied objects are pasted under the name of "copy of
Sunday, 12 September 2010
Bugs live in tree's...
While working on some additional options for the tree (the object browser thingy) I seem to have stirred up a nest of bugs. Some of which seem to only appear at random. Something tells me the next few day's will be nothing but cleaning up some of the stuff that already exists. Doesn't look like there will be many updates over the next few days =(
Saturday, 11 September 2010
Booya!
Hooray!!! After days of headaches trying to figure this thing out I've finally got the tree structure saving and loading the way I want it. Objects and folders are loaded into their correct parent folders, with the correct names, with the correct icons. Objects within the tree also save and load the objects data, booya!
Because I am using custom tree classes I had to learn how to write some custom serialization and deserialization to get things working properly. Not to mention a few recursive for loops to get things displaying correctly!
consider the fact that a for loop...well....loops...It does the same thing over and over again. Then consider in terms of programming recursion is the process of something running it's code again. I've essentially made something that loops...then half way through the loop it runs another loop....which runs the same loop under different circumstances...and so on. Even if you don't understand what I'm talking about you can understand where my headaches came from! I mean that alone sounds complicated. Imagine trying to figure out some of the numbers that you get after all those loops have been run! Crazy stuff!
But still, the reward is that I've learnt some new stuff. Hoorah! Knowledge is power you know. There's still some things I'd like to sort out, namely the ability to right click a folder and create a new folder/object directly within the folder that has been clicked. Also at the moment although objects and folders can be moved to different folders, once they are inside a folder, the order of them can't be changed. I'd like either some automatic sorting or manual organisation within folders. But for now I'm gonna go rest my poor head =(
Because I am using custom tree classes I had to learn how to write some custom serialization and deserialization to get things working properly. Not to mention a few recursive for loops to get things displaying correctly!
consider the fact that a for loop...well....loops...It does the same thing over and over again. Then consider in terms of programming recursion is the process of something running it's code again. I've essentially made something that loops...then half way through the loop it runs another loop....which runs the same loop under different circumstances...and so on. Even if you don't understand what I'm talking about you can understand where my headaches came from! I mean that alone sounds complicated. Imagine trying to figure out some of the numbers that you get after all those loops have been run! Crazy stuff!
But still, the reward is that I've learnt some new stuff. Hoorah! Knowledge is power you know. There's still some things I'd like to sort out, namely the ability to right click a folder and create a new folder/object directly within the folder that has been clicked. Also at the moment although objects and folders can be moved to different folders, once they are inside a folder, the order of them can't be changed. I'd like either some automatic sorting or manual organisation within folders. But for now I'm gonna go rest my poor head =(
Friday, 10 September 2010
We've gotta save the tree's man!!
Alrighty folks, some progress has been made regarding browsing objects. I've created the tree so that it supports restructuring. For example:
Objects can be moved from folder to folder. Folders can be moved in and out of folders carrying all of their contents with it. You can NOT move a folder into an object or move a parent folder into one of it's child folders.
The only problem I'm having now is creating a class that can hold the information needed to save the current structure and load it again once the program starts back up. Once I've figured this out, I can tidy up a few things like creating folders inside other folders. Slow progress, but progress none the less. Saving these things are a pain! Now I know how the hippy's fealt...
Objects can be moved from folder to folder. Folders can be moved in and out of folders carrying all of their contents with it. You can NOT move a folder into an object or move a parent folder into one of it's child folders.
The only problem I'm having now is creating a class that can hold the information needed to save the current structure and load it again once the program starts back up. Once I've figured this out, I can tidy up a few things like creating folders inside other folders. Slow progress, but progress none the less. Saving these things are a pain! Now I know how the hippy's fealt...
Monday, 6 September 2010
Planting tree's
Time to update you on why there have been no updates for the past couple days. I'm struggling with tree's...That's right, you heard me. I figure the best way to view/manage the large amounts of objects I need to create is to view them in a tree. That is to say place them in a folder, but have the ability to have folders within folders separating objects into sections and sub sections. Normally this is easily done, however I also want to be able to add new folders on the fly and rearrange existing objects so they can be moved around. This is proving significantly difficult to implement, but I'm on the ball and powering through it...Updates to come once I've figured it out!
Wednesday, 1 September 2010
Yay! Progress!
So it's the last day before I go back to work, kinda lookin forward to it actually...I'm sure that feeling will disperse when I have to wake up...Anyway's, I made the most of it by sorting out a few optimizations and finalizing the object maker. Aside from a few GUI tweaks the job is done! Check it out.
You can now select any portion of a tileset and draw it to a base layer (layer 1) or a height layer (layer 2). Anything drawn on layer 2 is drawn on top of the player character making it seem as though he has moved behind it. In the example above you can see I have drawn a pillar, however the top half is semi transparent. This is because it has been drawn to the second layer but I am currently drawing to the first layer. This means it's possible to see both layers while working. Makes things a lot easier!
Another feature you can't see here is that when you have tiles selected and you move the mouse over the drawing area you will get a semi transparent preview of the object you are about to draw so that you can see what it looks like before you draw to the object.
Objects can be saved and loaded correctly (although I have not implemented loading properly yet, but I have tested it to make sure it doesn't blow up). Better still I've also made optimizations to the tileset manager so that saved files do not take up as much space. The optimization also means that when you load a tileset, the file is copied in the programs directory so that it doesn't have to keep looking for where the file is hidden on your computer. Thinking ahead, it also makes it easier for me to load resources once I begin working on the game itself.
Other features that have been implemented allow you to resize the size of the object (i.e how much space you have to draw stuff), the ability to snap your tile placements to a grid, as well as the ability to toggle grid drawing, tile placement previews and the snap to grid function on/off.
I'll begin working on a browser for all saved objects soon so that we can begin making maps!
Also as promised the solution to the puzzle from my last post:
You can work out the number of tiles that go across the tileset easy enough by doing
Tiles Across = Tileset Width / Single Tile Width
We can also find the row and column of the first tile ID that is selected
First Tile Column = X Position of Selected Tiles / Single Tile Width
First Tile Row = Y Position of Selected Tiles / Single Tile Height
From which we can get the ID of the first selected tile
First Tile ID = (First Tile Row * Tiles Across) + First Tile Column
Now all we need is the total number of tiles selected down and across
Selected Tiles Across = Width of Selection Box / Single Tile Width
Selected Tiles Down = Height of Selection Box / Single Tile Height
Now we have to use for loops to make numbers increment every time we run this next equation.
ID = (First Tile ID + Incrementing Number 1) + (Tiles Across * Incrementing Number 2)
Incrementing Number 1 is constantly incremented, until it is equal to the number of Selected Tiles Across at which point it is reset to 0.
Incrementing Number 2 remains at 0 until Incrementing Number 1 is reset. When this happens Incrementing Number 2 is incremented.
The process is repeated until Incrementing Number 2 is equal to the number of Selected Tiles Down
For any programmers looking for the solution here it is in C#
int TilesAcross = (m_Texture.Width / m_TileWidth);
int FirstTileColumn = (m_SelectedTile.X / m_TileWidth);
int FirstTileRow = (m_SelectedTile.Y / m_TileHeight);
int FirstTileID = (FirstTileRow * TilesAcross) + FirstTileColumn;
int SelectedTilesAcross = m_SelectedTile.Width / m_TileWidth;
int SelectedTilesDown = m_SelectedTile.Height / m_TileHeight;
List list = new List();
for (int y = 0; y < SelectedTilesDown; y++)
{
for (int x = 0; x < SelectedTilesAcross; x++)
{
int i = (FirstTileID + x) + (TilesAcross * y);
list.Add(i);
}
}
return list;
Another feature you can't see here is that when you have tiles selected and you move the mouse over the drawing area you will get a semi transparent preview of the object you are about to draw so that you can see what it looks like before you draw to the object.
Objects can be saved and loaded correctly (although I have not implemented loading properly yet, but I have tested it to make sure it doesn't blow up). Better still I've also made optimizations to the tileset manager so that saved files do not take up as much space. The optimization also means that when you load a tileset, the file is copied in the programs directory so that it doesn't have to keep looking for where the file is hidden on your computer. Thinking ahead, it also makes it easier for me to load resources once I begin working on the game itself.
Other features that have been implemented allow you to resize the size of the object (i.e how much space you have to draw stuff), the ability to snap your tile placements to a grid, as well as the ability to toggle grid drawing, tile placement previews and the snap to grid function on/off.
I'll begin working on a browser for all saved objects soon so that we can begin making maps!
Also as promised the solution to the puzzle from my last post:
You can work out the number of tiles that go across the tileset easy enough by doing
Tiles Across = Tileset Width / Single Tile Width
We can also find the row and column of the first tile ID that is selected
First Tile Column = X Position of Selected Tiles / Single Tile Width
First Tile Row = Y Position of Selected Tiles / Single Tile Height
From which we can get the ID of the first selected tile
First Tile ID = (First Tile Row * Tiles Across) + First Tile Column
Now all we need is the total number of tiles selected down and across
Selected Tiles Across = Width of Selection Box / Single Tile Width
Selected Tiles Down = Height of Selection Box / Single Tile Height
Now we have to use for loops to make numbers increment every time we run this next equation.
ID = (First Tile ID + Incrementing Number 1) + (Tiles Across * Incrementing Number 2)
Incrementing Number 1 is constantly incremented, until it is equal to the number of Selected Tiles Across at which point it is reset to 0.
Incrementing Number 2 remains at 0 until Incrementing Number 1 is reset. When this happens Incrementing Number 2 is incremented.
The process is repeated until Incrementing Number 2 is equal to the number of Selected Tiles Down
For any programmers looking for the solution here it is in C#
int TilesAcross = (m_Texture.Width / m_TileWidth);
int FirstTileColumn = (m_SelectedTile.X / m_TileWidth);
int FirstTileRow = (m_SelectedTile.Y / m_TileHeight);
int FirstTileID = (FirstTileRow * TilesAcross) + FirstTileColumn;
int SelectedTilesAcross = m_SelectedTile.Width / m_TileWidth;
int SelectedTilesDown = m_SelectedTile.Height / m_TileHeight;
List
for (int y = 0; y < SelectedTilesDown; y++)
{
for (int x = 0; x < SelectedTilesAcross; x++)
{
int i = (FirstTileID + x) + (TilesAcross * y);
list.Add(i);
}
}
return list;
Monday, 30 August 2010
Defeating Math
This is one of the reasons I love programming, pure problem solving!
I have just finished the drawing part of the object maker. Apart from the fact objects can't yet be saved, we can now create any object we want from multiple tilesets if needs be (which by the way is not a feature you find in most map makers. In fact, I've never seen that feature at all before...go figure).
But at what cost? Well aside from various other trixy problems I've had to solve, this one was fun because it was pure number crunching. My favourite type of puzzle! Yeh, I know, I'm a big geek. Sue me.
The puzzle is as follows:
The program has been designed so that tiles from a tileset have a specific ID. For example:
I have just finished the drawing part of the object maker. Apart from the fact objects can't yet be saved, we can now create any object we want from multiple tilesets if needs be (which by the way is not a feature you find in most map makers. In fact, I've never seen that feature at all before...go figure).
But at what cost? Well aside from various other trixy problems I've had to solve, this one was fun because it was pure number crunching. My favourite type of puzzle! Yeh, I know, I'm a big geek. Sue me.
The puzzle is as follows:
The program has been designed so that tiles from a tileset have a specific ID. For example:
This is a typical tileset. Notice the grey square in the bottom right of the image. This is the size of a single tile and therefore each bed takes up 2 tiles; one above the other.
Each tile has it's own ID, as an example I've drawn this nifty diagram:
Now keep in mind that computers work with pixels, so we must specify the dimensions of a tile...which could be different for every tileset, so the dimensions of a single tile must be able to change. The number of columns and rows per tilesheet may change. The tilesheet itself has dimensions that may change and the tiles that we have selected may also change. For example in the case above I may have selected a square of tiles (5, 6, 9, 10). Now what series of mathematical equationa can I perform for a tileset with X, Y dimensions on a selection of A,B dimensions at position P, O when a single tile is of I, J dimensions so that I get the result of the 4 numbers I just mentioned.
And you thought it was as simple as "take this and draw it" ;)
Enjoy!
P.S.
You can use incrementing numbers (or for loops if you're reading this ogre). By this I mean the first time you do the equation the number is 0. the second time you do the equation the number is incremented to 1. Do the equation again and it becomes 2 etc.
Solution will be posted when I make the next post, whenever that may be...probably tomorow
P.S.
You can use incrementing numbers (or for loops if you're reading this ogre). By this I mean the first time you do the equation the number is 0. the second time you do the equation the number is incremented to 1. Do the equation again and it becomes 2 etc.
Solution will be posted when I make the next post, whenever that may be...probably tomorow
Sunday, 29 August 2010
Back on track
The holidays are coming to an end and my mood for doing work is slowly increasing...In short, I'm getting back into the swing of things! Visual studio blowing up in my face repeatedly certainly made my enthusiasm drop, but the source of the problem has been sorted and even better, I've finished that particular part of the map maker. A grid is now draw on top of tilesets of any size the user defines. I'm also half way to being able to select parts of the tileset to be drawn.
At the moment clicking on the tileset will draw a red box around the tile clicked (the size of the box depends on what the user has specified the size of a tile to be). Clicking and dragging selects multiple tiles and unlike my previous map maker, you can now drag in any direction and the correct tiles will be selected.
There's still a few more things to do since at the moment the only thing happening is that a red box is drawn around the "selected" tiles (they are not truly selected, it just looks like they are). Next step is to move these selected tiles into a map or object space
Thursday, 26 August 2010
Particles in action
Okay, so I've finished the particles system (or at least the testing of it) which means the code can be bundled up and stuck in a library ready to be part of the map maker and game. It seems that uploading the video directly to the blog isn't an option due to lazy servers or something...
I'm currently uploading the video to youtube so check back for the link. The video isn't of the best quality and doesn't get the best FPS but rest assured that the particle system itself runs smoothly and looks very pretty =)
Monday, 23 August 2010
Drawing the line
Seeing as I don't have time to do any actual coding, I figured I would attempt to debug the exploding visual studio problem. The problem occurred with some code that was simply trying to draw lines. Once this bit of code is run once, visual studio cannot seem to recover even after several computer restarts. I did however manage to fix get visual studio working properly again by removing the entire form that contained the fragment of code. Once removed I could then re-add it to the project (I made a backup of course) remove the buggy code and run the program again normally.
This means that when I get the time, I can continue where I left off. Yayyyy!
This means that when I get the time, I can continue where I left off. Yayyyy!
Thursday, 19 August 2010
Holy Smokes Batman!
Alrighty, been doing some freelance work recently and haven't had any time to work on games'y stuff, but just so's you know I'm still here and haven't given up on it here's a quick screenshot of the particle system I was talking about. Hopefully I'll have a bit more time once September kicks in. Also the freelance work I'm doing may find it's way into this project...you'll just have to wait and see what/how...
Thursday, 12 August 2010
All the small things
It seems that restarting things has given me an opportunity to blow things drastically out of proportion (like I usually do). By this I mean the addition of a particle effects engine. I was going to be using particles for various spells and special effects during the game, but it has just dawned on me that I can use particles for various effects on the map as well. Rain, snow, chimney smoke and waterfalls to name but a few. It also means I don't have to start redoing everything I just lost right away as well! Always nice to have something fresh to get you motivated again! So it seems my first video will be of pretty pretty flashing lights, something to keep people happy at least ;)
Wednesday, 11 August 2010
Next iteration please...
Well it seems that visual studio has officially gone 'blegh' as far as the project goes. I can't build/run the program without it freezing and some of the GUI aspects aren't updating. I always new I was going to start from scratch (just to keep things neat and tidy by re-factoring a few things) but it seem I'll have to start the next iteration earlier than I really wanted. It seems that I'll now be working throughout the rest of the holidays as well which gives me very little time to work on this. Be prepared for a long haul....
Monday, 9 August 2010
They're coming outa the god damn walls!!
Squashed a few more bugs today. A load seem to appear every time I add something new to the program! Calling it a day for the moment as every time I seem to try and run the program visual studio dies on me. Bug with the program or with visual studio? Find out in the next post 'cause I can't be bothered to restart my computer to find out =p
The object maker window is now split into 2 panels to make it easier to resize the object but still have access to the required tilesets. The form resizes controls appropriately based on if the form has just been resized or if the tileset is to big/small for the current control size. I'm in the midst of drawing a grid over the top of the tileset preview and object for use of a 'snap to grid' option when drawing
Sorry for the slow progress! I watched the batman movies the other day and it put me in the mood to play batman arkham asylum again...what a game! Can't put it down!
Thursday, 5 August 2010
I see the future...and it is problematic
Not had a lot of time to tinker today, but I've finally got a few bugs out of the way and I can now load mulitple tilesets. Once loaded the file name will appear in a list. Clicking any file name in the list will display that tileset ready for drawing. In the event that you accidently add the wrong image, you can also remove tilesets. Although doing this to a tileset that has already been used in a map would NOT be a good idea.
Anywho, as I was squashing some bugs it started to dawn on me, just how many bugs I'm going to find in the initial stages of this project. It is not going to be fun...
Anywho, as I was squashing some bugs it started to dawn on me, just how many bugs I'm going to find in the initial stages of this project. It is not going to be fun...
Tuesday, 3 August 2010
Can't we all just get along?
This is the second time I've had an error that was nothing to do with my code being wrong. Makes it particularly difficult to debug!! It seems that certain versions of certain frameworks don't like playing with certain versions of certain builds. Yeh, I don't understand what that means either. Luckily Shawn Hargreaves over at the XNA forum has indirectly come to my rescue after someone else posted the same problem. Gotta be the 4th time he's helped me out now? damn he's good.
For all those who stumble here from google due to this error:
The "Message" task could not be instantiated from the assembly "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Unable to cast object of type 'Microsoft.Build.Tasks.Message' to type 'Microsoft.Build.Framework.ITask'.
The "Message" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name
You can get the solution here:
http://forums.xna.com/forums/t/15214.aspx
Now that I've fixed that bug I'm now able to load images and store them inside the TilesetManager. Not going to do any more tonight because trying to fix that bug took a lot out of me! More to follow.
For all those who stumble here from google due to this error:
The "Message" task could not be instantiated from the assembly "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Unable to cast object of type 'Microsoft.Build.Tasks.Message' to type 'Microsoft.Build.Framework.ITask'.
The "Message" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name
You can get the solution here:
http://forums.xna.com/forums/t/15214.aspx
Now that I've fixed that bug I'm now able to load images and store them inside the TilesetManager. Not going to do any more tonight because trying to fix that bug took a lot out of me! More to follow.
Sunday, 1 August 2010
Beware the fast moving slug
Ok, so it seems that despite my last post I've done quite a bit. The only thing left to do is create the map classes. Which despite it's name making it look like it is the bulk of everything is actually quite a small part...but not small enough that I can be bothered to do it now. Once that's done I can start hunting down bugs, followed by showing off some funky pictures of how things are coming along!
Next steps will be setting up the GUI (graphical user interface) to sort through the mass amounts of objects I'll be creating, Sorting out maps and objects being drawn in layers (I.E the player walks behind the roof of a house and not on top of it) and of course saving and loading!
Give it a few weeks and I should have video ready to show off what the hell I've been upto!
Next steps will be setting up the GUI (graphical user interface) to sort through the mass amounts of objects I'll be creating, Sorting out maps and objects being drawn in layers (I.E the player walks behind the roof of a house and not on top of it) and of course saving and loading!
Give it a few weeks and I should have video ready to show off what the hell I've been upto!
Thursday, 29 July 2010
Moving at the speed of a striking slug
Well things are moving verrrrrryyyy slowly. Mainly due to the release of starcraft 2. Watching 'the story so far' as the game installed got me wondering exactly what had happened in the first game. So for the past 2 days I have been playing the original starcraft rather than programming. Now I just need to finish the expansion pack and I can play starcraft 2...
That's a lot of hours spent gaming and not programming! Hence the title. Things will quicken in pace after a few days but as it stands the Tileset class and TilePlacement class are complete (in theory). The good news is that after I completed these classes I got a better idea of how things are going to come together, which gave me a bit of umph! But until I've had my fix of games, expect not a lot to be happening.
Update:
Ok after writing that it seemed my head kicked into work mode and I seem to have done quite a bit tonight. I have a few ideas for optimization as well...Who knows, by next week we may be seeing some tilesets being loaded!
Update:
Ok after writing that it seemed my head kicked into work mode and I seem to have done quite a bit tonight. I have a few ideas for optimization as well...Who knows, by next week we may be seeing some tilesets being loaded!
Sunday, 25 July 2010
Thinking ahead...
Yet another reason I don't plan things. I'm constantly changing my mind. Originally the idea was to save maps in XML. The only reason for this was that it would make it easier to mod the game once it had actually been completed. However, now that I've started making things it had dawned on me that I will be needing to store various instances of the same object with various properties. By this I mean: on any particular map I may use a tree. On the same map I may make another tree...which is actually the same tree I used before, just scaled to look slightly bigger. Saving this sort of information in XML is simply not as easy or convenient as saving it inside a custom file type. For this reason I have started making the Tileset, Tileset Manager, Object and Object Manager classes with this in mind.
This is the bit I hate the most. I'm constantly coding and there is nothing to show for it until the whole lot is done and they start working together. Nothing to see as of yet, but rest assured I'm doing stuff ;)
This is the bit I hate the most. I'm constantly coding and there is nothing to show for it until the whole lot is done and they start working together. Nothing to see as of yet, but rest assured I'm doing stuff ;)
Thursday, 22 July 2010
Sizing things up
I don't believe in plans. Never have and can't imagine I ever will. I think they are the most pointless things I've ever been constantly told to do by teachers, lecturers, employee's, parents, etc. Why confine yourself to a single course of action? But hey, there's always Plan B right? Forget it...You can't possibly know what will go wrong with Plan A and therefore you can't possibly know if Plan B is a viable option. Forget plans, just think dynamically or "on the fly". The point of a plan is to be prepared for the future, which changes with every act you take. That's a pretty hard thing to be prepared for! Screw it, if you can come up with a plan for something that hasn't happened yet, then you can most definitely come up with a plan for something staring you in the face.
That being said, I do believe in blueprints. You can't build a house without blueprints. You need to know what size the plot of land is, just like you need to know the size of the house and every room in it. Try making a house without a blueprint and the whole thing comes tumbling down. Same goes for a program.
In the map maker I am building there are a lot of things going on inside the form and they're all different sizes. Worse still, my plot of land (the size of the screen) varies from monitor to monitor. I have two monitors, one uses a "1768x992" resolution while the other uses a "1280x1024" resolution. I know some people still use "1024x768" resolutions and not knowing which one to cater for is a real problem. But like plans, we shouldn't restrict ourselves to one line of thought. I have just made the blueprint of the map maker, and things will shift around depending on the size of the screen...or on the size of the window if you don't want it full screen.
As you can see there will be a typical menu bar at the top. Currently holding "File, Edit, View" others will be added as features are implemented. Below that is a toolbox holding the bog standard "New, Open, Save" icons and a few others. Again this toolbox will grow with features as they are added.
The panel taking up the majority of the screen will be where the map is viewed and made. The blue colour indicates that this panel is an XNA panel (this means that what is seen in this window will be identical to what is seen in the game). Also notice the scroll bars to the left and bottom of this panel. These scroll bars ensure that the map is not restricted to the size of the panel. Maps will be saved using the XML format and you can just about see the tab labelled "XML" to the top left of the panel. Choosing between the "Map" tab and the "XML" tab will switch between the graphical representation of the map and the XML code which can be altered directly.
The blue panel to the right of the screen is essentially the "pallet" of the map maker. From here we will be able to import tilesets and create objects. This panel will have a great number of modes, some of which are: importing tilesets, creating new objects and selecting existing objects.
The long white panel at the bottom of the screen will show the projects working directory. By this I mean all maps created by the user under a single saved file. Maps can be organised into folders and this panel will show the hierarchy in a tree format.
Finally, the small box located to the bottom right of the screen will show the properties of the currently selected item. Whether this be the map itself or an object from the list of available objects, you will be able to change it's properties and see the results in the map window. This will allow features such as adding weather, resizing objects, rotating objects, naming the map or objects and a lot more. All at the touch of a button.
That being said, I do believe in blueprints. You can't build a house without blueprints. You need to know what size the plot of land is, just like you need to know the size of the house and every room in it. Try making a house without a blueprint and the whole thing comes tumbling down. Same goes for a program.
In the map maker I am building there are a lot of things going on inside the form and they're all different sizes. Worse still, my plot of land (the size of the screen) varies from monitor to monitor. I have two monitors, one uses a "1768x992" resolution while the other uses a "1280x1024" resolution. I know some people still use "1024x768" resolutions and not knowing which one to cater for is a real problem. But like plans, we shouldn't restrict ourselves to one line of thought. I have just made the blueprint of the map maker, and things will shift around depending on the size of the screen...or on the size of the window if you don't want it full screen.
As you can see there will be a typical menu bar at the top. Currently holding "File, Edit, View" others will be added as features are implemented. Below that is a toolbox holding the bog standard "New, Open, Save" icons and a few others. Again this toolbox will grow with features as they are added.
The panel taking up the majority of the screen will be where the map is viewed and made. The blue colour indicates that this panel is an XNA panel (this means that what is seen in this window will be identical to what is seen in the game). Also notice the scroll bars to the left and bottom of this panel. These scroll bars ensure that the map is not restricted to the size of the panel. Maps will be saved using the XML format and you can just about see the tab labelled "XML" to the top left of the panel. Choosing between the "Map" tab and the "XML" tab will switch between the graphical representation of the map and the XML code which can be altered directly.
The blue panel to the right of the screen is essentially the "pallet" of the map maker. From here we will be able to import tilesets and create objects. This panel will have a great number of modes, some of which are: importing tilesets, creating new objects and selecting existing objects.
The long white panel at the bottom of the screen will show the projects working directory. By this I mean all maps created by the user under a single saved file. Maps can be organised into folders and this panel will show the hierarchy in a tree format.
Finally, the small box located to the bottom right of the screen will show the properties of the currently selected item. Whether this be the map itself or an object from the list of available objects, you will be able to change it's properties and see the results in the map window. This will allow features such as adding weather, resizing objects, rotating objects, naming the map or objects and a lot more. All at the touch of a button.
Labels:
C#,
Layout,
Map Maker,
Windows forms
Wednesday, 21 July 2010
"Could not load file or assembly" - Solution
Today's task had just been completed...finally. I'm going to start talking compucrap for a while now so if your just interested in the RPG scroll down to the bottom of this post!
What should have taken an hour has taken me the best part of five hours. The aim of today was relatively simple: create the classes needed to work with XNA inside a windows form. "What the hell does that mean?" I hear you cry.
Well to avoid a lecture on what's what, for now just imagine that I'm trying to make a game run inside the "My Documents" browser. As you can imagine; this type of thing isn't meant to be done and requires a bit of work around to get these types of results. A game needs to be updated as quickly as possible (a minimum of 30 times every second to keep up with the human eye). A windows form sits there idly until it is moved or interacted with.
After an hour and a half I had written code that would enable me to have as many games as I wanted running in a single window. Upon testing the code all I saw was a window that showed a big red cross. It was like the computer had just looked me dead in the eyes and said that all to common word: "Denied!"
Obviously something was wrong, but what? I had hundreds of lines of code and the only hint of error the computer showed me was:
Could not load file or assembly 'Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' or one of its dependencies. The system cannot find the file specified
You what? What the hell does that mean? I sifted through the code for hours, thinking I must have made a mistake. But no, apparently I do know what I am doing, but my computer does not...
Here's the solution for all those directed to this page by google while trying to fix the same problem, because lord knows there's a lot of you!
If you are running a 64bit system, be sure to compile the program for a 32bit platform. By default visual studio selects the Debug folder and "Any CPU" as it's build preferences. You need to change "Any CPU" to "x86". This can be done by clicking:
Build -> Configuration Manager
Click the combo box under in the 'Platform' column
Choose
Under 'New Platform' choose 'x86'
Copy settings from AnyCPU
Well that didn't take long for the first tutorial...
As for the RPG:
As mentioned, I can now run multiple XNA games inside a windows form. This means that I can run a simulation of the game while the map is being created. No need to save the map, no need to compile anything. I can start walking around the map as soon as I place the very first object (preferably the ground, else I won't be walking far)
Better still, I have also implemented something that allows XNA to compile resources after the programs initial compilation. This means I can use any tile set at any time to create anything. This may not sound amazing, but if you know how XNA works with resources, I think you'll agree, that's pretty nifty! Next step is to start creating the code that will let me import tile sets and draw to the screen. I'm hoping for less trouble with that...
Labels:
C#,
Could not load file or assembly,
XNA
Saturday, 17 July 2010
Old ideas, new methods
"I'm going to make a game!" - Marc Stoate (2001)
Ah yes, those six words that I would say over and over again for the next nine years without them ever coming close to reality. Until now! Nine years on and I have finally got the knowledge and mindset to make anything my mind can conjure up. Through this blog you will witness the birth, life and death of my first ever game. You will see my triumphs and failures. My high's and low's. My problems and their solutions. Not only is this blog intended for those whom I promised this game to all those years back, but also for any C# and XNA developers out there looking for inspiration or a few quick 'how to' guides for some not so common problems.
The game itself will be an RPG starring myself and as many of my friends as I can logically fit into it. Seeing as this is my first project (or at least the first one I intend to finish...) I'll be keeping it simple and using the style of ye olde RPG's. By this I mean it will be a 2D top down sprite based game, similar to that of the original Final Fantasy's or Chrono Trigger. Naturally I'll be throwing in particle effects and maybe a few shaders for good measure but if your looking for mind numbingly good graphics and advanced shader techniques, you're in the wrong place!
As of next week I'll have six weeks holiday to start my tinkering! First up on the agenda: the map maker. May the madness begin!
Ah yes, those six words that I would say over and over again for the next nine years without them ever coming close to reality. Until now! Nine years on and I have finally got the knowledge and mindset to make anything my mind can conjure up. Through this blog you will witness the birth, life and death of my first ever game. You will see my triumphs and failures. My high's and low's. My problems and their solutions. Not only is this blog intended for those whom I promised this game to all those years back, but also for any C# and XNA developers out there looking for inspiration or a few quick 'how to' guides for some not so common problems.
The game itself will be an RPG starring myself and as many of my friends as I can logically fit into it. Seeing as this is my first project (or at least the first one I intend to finish...) I'll be keeping it simple and using the style of ye olde RPG's. By this I mean it will be a 2D top down sprite based game, similar to that of the original Final Fantasy's or Chrono Trigger. Naturally I'll be throwing in particle effects and maybe a few shaders for good measure but if your looking for mind numbingly good graphics and advanced shader techniques, you're in the wrong place!
As of next week I'll have six weeks holiday to start my tinkering! First up on the agenda: the map maker. May the madness begin!
Subscribe to:
Posts (Atom)