The first thing on my list if the map so lets get on to it.
And yes ! It`s time for another wonderful diagram :
And then :
Now the map is the first milestone of my little project. As said in my little graph the map is a grouping of classes that I call Tile. They hold a background sprite for the terrain they have room for an NPC or object to occupy the tile. I'm not sure yet if the tile has a reference to objects on top of it or the object on it has a reference to the tile, or both. Loading a sprite on a tile (and thus, loading the whole grid with tiles) is another thing I'm not sure about. My first reflex is to throw an 2d array at it and translate the integer values to images. Lets say :
{ 3, 2 }
{ 3, 1 }
3 is a road, 2 is grass and 1 is water. When the array is sent to the Grid it assigns a sprite depending on the value received. Of course this is a cheapo solution, a better way would be of creating a custom data structure that contains lets say an array of sprites. The way the sprite array is created is by using technique that I didn't figure out yet. Now that the structure is filled with images I send it to the grid at generation or I use a function to replace the current grid and render the grid again to reflect the changes. In the end I think that whatever technique I use I'll have to translate an array to images anyway. The big difference is what I send to the grid. If I send an array the grid needs to do the translation, if not an external module does the translation and send the already constructed structure to the grid and it simply replace the structure with the one I sent. I need an idea.
In my last game I used the array of int technique to create my maps. A simplified version looks like this :
{ 3, 3, 3, 1, 3, 3, 3, 3, 3,
3, 3, 3, 1, 3, 3, 3, 3, 3,
2, 2, 2, 1, 3, 3, 3, 3, 3,
2, 2, 2, 1, 3, 3, 3, 3, 3,
2, 2, 2, 1, 1, 1, 1, 1, 1,
3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3 }
It looks pretty simple, lets say the 1's are roads, 3's are grass and 2's represent water. Just by looking at the array you can see a rough outline on how the map will look. Road starts from north goes to the center of the map next to a little pond and veers right to the east. The problem comes from the fact that there might be a hundred of sprites used and I need a number for each. After a while the map might look like this :
{ 33, 33, 33, 2, 33, 33, 33, 33, 33,
103, 3, 3, 2, 33, 33, 33, 33, 33,
6, 3, 3, 2, 33, 33, 33, 33, 88,
33, 33, 33, 2, 33, 33, 33, 33, 33,
46, 45, 9, 2, 2, 2, 2, 2, 2,
33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33 }
Thats pretty much the same map as above exept I added a house and replaced the lake by a river. Can you make sense of this array now ? Not me, at least not with a quick glance. Last time I ended my project by trying to create a program, some kind of map-editor, on which I placed tiles and I it returned the array that I could copy & paste on my game and use. This was a semi-good idea in the sense that it kind of worked but it was a pain to create the external program and it took my attention off of the main project.
*Idea*
One way I could use is to create a .png of the map and import it to my game, the game will now take this image and turn it into a instance of a Grid readily available. Pros and Cons are:
Pros :
It's fairly easy to create a map in paint.
Importing it is extremely easy and fast.
Cons :
I need to make a custom content importer.
I need to make sure the map is 32 * MapSize.X and the tiles need to be spaced exactly on the right spot or the content importer will get the wrong tiles. For example if the first tile is at (0,0) and 32 in size, the tile to the right of it needs to be placed exactly at (33, 0) or I'll lose part of the tile. If my hand slips and I place the tile at (32, 0) I'll lose the one line of pixel. When the content importer takes the image and divide it by blocks of 32x32 it will not grab the right tiles, like everything's going to be offset by one pixel.
In the end I think I''ll try it, for lack of a better idea.
This is a blog to talk about programming. I am a student in IT currently working with the C# language.
Tuesday, November 8, 2011
Step one : Map
Labels:
.net,
.png,
grid,
image,
Logical Stucture of the world,
Map,
Night of Lurnia,
Sprite,
spritesheet,
tileset,
Zone
Monday, November 7, 2011
The man, the plan and the plan and the plan and more plans.
Since I want to do things the right way, I decided that the planning phase would take a greater amount of time this time than my usual projects. It's been 3 days since I started this project and I still haven't started programming. I think this is a new record.
I made a small Dev plan and here is what's included :
I made a small Dev plan and here is what's included :
- Generate a map
- Make a character
- Create the camera system
- Implement movement
- Make NPC's
- Give properties to the tiles
- Integrate actions, that is actions you can execute on tiles or NPC's
- Start generating screens. The intro, the game scene, options...
- Make character screens, inventory/map.
I might shuffle things around so be prepared for an edit. Or just another post.
Saturday, November 5, 2011
The tools I will use
Since my new project is starting and I aim to start it the right foot. The right foot being planning before jumping down in the mud. In this post I will document some of the tools I will be using during development. The list might grow and I probably will make another post in the end[sic] explaining the tools I ended up using after all.
First and most important : The very humble and well respected Visual Studio
It's simply the best IDE I've ever used. First because it is very complex (which I like) and when you get to know it it is very easy to use. The IDE really completes the programmer, IntelliSense works like a charm. You can also add extensions which can be very useful. In the screenshot above you can see I'm using ReSharper, this extension is a little manager that looks at your code and gives you advice on how you can optimize your code. It's a really good extension and really helps me when I need to refactor a piece of code or make it more readable. Check it out here, unfortunately it's a paid product and you need to pay a hefty sum to use it. I only have 8 days left on my trial, after that I'll have to get back to normal.
ZScreen, the screenshot application.
ZScreen is a very good application when you need to take screenshots on the fly. You don't need to press print screen and open paint, paste it and modify it. Just press the a hotkey and it will execute what commands you told him to do. I chose to save it automatically in a folder when I press [prt scrn] so I can browse my screenshots of the day and modify them. In the end, they probably get sent on this blog ! It's freeware so I encourage you all to give it a try.
GitHub and GitExtension
As you all probably know I usually use Git as my preferred source control provider. It's really useful to have a repository of code on projects, even the smallest ones, because it gives you an overview on what has been done and how. Having a complete history of the project's changes is awesome and being able to revert back any changes is always useful. I don't need to comment 200 lines of code just because I don't need it or might need it in the future. I can safely erase it and get it back from the repository when I need that piece of code.
Github is a host server of repositories and GitExtensions is my GUI of choice. I can see the timeline very clearly and any branches can be inspected at ease.
So there we go, those are the tools I plan on using immediately. Among them, not tools but technologies I should mention is that I am using C# now with the XNA framework. This makes creating games much easier and streamlined. Big change from vb.net I know, but it's for the best. Giving visual basic up was one of the best decisions I could have made. So keep up with me, I'll try to make the code as easy to follow as I can.
First and most important : The very humble and well respected Visual Studio
It's simply the best IDE I've ever used. First because it is very complex (which I like) and when you get to know it it is very easy to use. The IDE really completes the programmer, IntelliSense works like a charm. You can also add extensions which can be very useful. In the screenshot above you can see I'm using ReSharper, this extension is a little manager that looks at your code and gives you advice on how you can optimize your code. It's a really good extension and really helps me when I need to refactor a piece of code or make it more readable. Check it out here, unfortunately it's a paid product and you need to pay a hefty sum to use it. I only have 8 days left on my trial, after that I'll have to get back to normal.
ZScreen, the screenshot application.
ZScreen is a very good application when you need to take screenshots on the fly. You don't need to press print screen and open paint, paste it and modify it. Just press the a hotkey and it will execute what commands you told him to do. I chose to save it automatically in a folder when I press [prt scrn] so I can browse my screenshots of the day and modify them. In the end, they probably get sent on this blog ! It's freeware so I encourage you all to give it a try.
GitHub and GitExtension
As you all probably know I usually use Git as my preferred source control provider. It's really useful to have a repository of code on projects, even the smallest ones, because it gives you an overview on what has been done and how. Having a complete history of the project's changes is awesome and being able to revert back any changes is always useful. I don't need to comment 200 lines of code just because I don't need it or might need it in the future. I can safely erase it and get it back from the repository when I need that piece of code.
Github is a host server of repositories and GitExtensions is my GUI of choice. I can see the timeline very clearly and any branches can be inspected at ease.
So there we go, those are the tools I plan on using immediately. Among them, not tools but technologies I should mention is that I am using C# now with the XNA framework. This makes creating games much easier and streamlined. Big change from vb.net I know, but it's for the best. Giving visual basic up was one of the best decisions I could have made. So keep up with me, I'll try to make the code as easy to follow as I can.
Labels:
.net,
C#,
Git Extensions,
github,
tools,
Visual Studio,
ZScreen
The makings of a new game
I've always wanted to make games, couple of years back when I was programming with VB.net I started to make a small RPG. It was just a small practice project because I wanted to build something much bigger but it was a start. Back then I didn't really fully understand the task at hand and I believe now I know enough stuff to create one damn game. Simple or not I'm ready for it, so here I am launching myself headfirst into another time-consuming, probably useless in the long run and a project that will probably be abandoned in a few weeks. why do it then you ask me ? Well theres always the off-chance that I will actually push it further this time and I believe it is a worthy endeavor. So wish me luck !
Also, this time I'll try to take more pictures alongside my work. I'll try to better document my work, I think it helped last time.
Also, this time I'll try to take more pictures alongside my work. I'll try to better document my work, I think it helped last time.
Thursday, May 5, 2011
Turns out SQL server is awesome.
Well its not. I messed around with it a bit and I'm amazed. Being a feature crack addict I just can't resist the interface with all its menus and functionality toolbars.
The code editor is great and offers IntelliSense and bla bla, the usual Microsoft development'ish features you would find in any other product. You can schedule publications to subscribers and manage remote servers.
So there goes my craze placing images. I'd like to get more code sample but with school killing us I won't be coding anything really fun for a while. Just 20 more days and I'm outta there. Can't wait.
Wednesday, May 4, 2011
Back from the dead ! (Again)
Yes I did it again ! I fled the clogging world and now I'm back ! Actually I've taken a detour at tumblr and since it sucked so much here I am again !
I've moved from VB.net to C# and overworked with school. So expect better and rarer posts (at least until school is over) so why do I bother to tell anyone at all ? Nothing really.
I've moved from VB.net to C# and overworked with school. So expect better and rarer posts (at least until school is over) so why do I bother to tell anyone at all ? Nothing really.
Tuesday, February 15, 2011
A small find : Labyrinth algorithms !
I've been looking at this guy's blog and it struck me as extremely interesting. He shows several algorithms to generate mazes, while fairly useful and fun. I don't know how to implement this kind of logic so I am researching hard on the matter. Expect a post about it soon !
Here is the blog I'm talking about, go check it ! http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
Here is the blog I'm talking about, go check it ! http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap
Subscribe to:
Posts (Atom)







