Sunday, January 31, 2010

Daily Developer: Day 30

Whew! Finished off the remainder of the StyleCop issues. Tomorrow I should be able to start looking at any number of more interesting things. Will probably work on making the menu options save to disk.

Duration: 00:45:53

Saturday, January 30, 2010

Daily Developer: Day 29

A very painful hour of wading through StyleCop issues. I think the lesson here is that I needed to install this at the beginning, before the issues could accumulate to over 600. I am now down to about 100 left. Probably another day to finish that off.

Also, during my daughter's swim class, I spent some time just thinking about elements of the game, and took some notes.

Duration: 01:50:00

Friday, January 29, 2010

Daily Developer: Day 28

Just lots and lots of StyleCop issues. Some of it is painful, but it really helps organize the code. Also, I am finding areas that aren't used anymore or need to be adjusted.

I am under 400 warnings now, and hopefully will be able to plow through the rest tomorrow.

Duration: 00:54:26

Thursday, January 28, 2010

Daily Developer: Day 27

Most of today was spent correcting StyleCop warnings. In fixing them, I've refactored and commented quite a bit, so it is a useful exercise.

Also looked up and installed Cool Commands. It is an old add-in for VS2005, but with a tweak it works in VS2008 as well. It allows the copying of references, but the part I love is the "Locate in solution explorer" option that you get when right-clicking on the file tab.

Will probably keep slogging through the StyleCop warnings over the next couple days. Then, I'm considering installing Nunit. As for development, I'll need a way to keep score and the menus need some help as well.

Duration: 01:12:05

Wednesday, January 27, 2010

Daily Developer: Day 26

I have redistributed my game to some friends after realizing I had missed a couple of files. I have been getting some feedback and recording the notes.

Since I was interested in hearing more from people before I made additional changes, I went for a low-thought day and downloaded and installed StyleCop. Started going through the long process of correcting the code to match the rules. Also installed GhostDoc to help with generating the headers.

No additional "real" developments occurred.

Duration: 01:47:53

Tuesday, January 26, 2010

Daily Developer: Day 25

Finished hooking up the options settings to actually interacting with the game. Test played for a bit, and then uploaded the demo game to some friends to test.

Duration: 01:07:49

Monday, January 25, 2010

Daily Developer: Day 24

I spent a bunch of time adding options to the options menu in anticipation of letting some others take a look at it. I wanted them to be able to mess with the various options until they could find a "fun" setting. I added support for several of these in-game, but will need to spend some more time hooking up the rest before it is ready to be shared.

Duration: 02:05:21

Sunday, January 24, 2010

Daily Developer: Day 23

The game is fully included in the menu system now. By quitting the game and then re-selecting "Play Game" it starts over properly. I also added keyboard support as well as a menu option that toggles between keyboard and gamepad. Did some minimal refactoring as well.

Tomorrow, I think I will focus on adding some extra options to the menu and then try to support them in-game.

Duration: 01:02:51

Saturday, January 23, 2010

Daily Developer: Day 22

I modified my game to be part of GameStateManager, as a separate screen class. It wasn't hard, but it was time consuming. And, now I have a lot of clean up todo, both on the old game.cs file as well as the new screen file. But, it was worth it, as I now have a menu that controls the game, allowing for quitting and restarting without issue.

Duration: 00:50:02

Friday, January 22, 2010

Daily Developer: Day 21

I found an example for "GameStateManagement" that would allow for menus and pausing. I ran the demo and was pleased. I grabbed the files and included them in my game, but do not have things hooked up properly. As it is, it still goes directly to my game. I think it looks like I'll need to insert the screenmanager code at a higher level, that will then call into my game play. I might experiment with replacing the code in the sample where their "game" is with something else just to see how my stuff might fit in.

I will probably be moving my game into a "screen object".

Duration: 00:37:13

Thursday, January 21, 2010

Daily Developer: Day 20

Wow, have I really been doing this for 20 days straight? Well, right at the beginning, on Day 2, I had fallen asleep early accidentally and didn't have time to work on it until the next day at lunch. But, I tried to double up on that day, and haven't faltered since. It is neat to see the kind of progress that can be made with only 15 minutes to one hour of work per day.

Today, I fixed the targets to grow along the same grid, so that they mesh properly when they meet up. Conveniently, this also resolved the collision issue. I then added support for different levels and a health system for the targets. It is now set to expand and then upgrade to the next level. And, it now takes four hits to destroy a target, but it will drop levels and only be destroyed at level 0.

The collision detection came much faster than anticipated. I have a couple of things in mind that I can work on. I need to work on a scoring system. I also need to create an actual beginning and ending to the game. Adding in menu support would be a good way to manage some of this, so I might do that first.

Some more complicated things involve the actual game play itself. As the game currently stands, it really is pretty boring. I have a couple of ideas that I will probably play around with, but I think this will come after the other items.

Duration: 01:00:12

Wednesday, January 20, 2010

Daily Developer: Day 19

I updated the GridManager to use centers instead of positions and corrected boundaries. This helped with collision detection. Updated target expansion to not overlap other targets. This mostly works, but I have not completely updated the collision detection, and there are occasionally targets that overlap.

Also, the BoundingSphere I am using is quirky: sometimes sharing the same point counts as intersecting, and sometimes it doesn't. I'm going to have to look at that. Since I am doing this as a 2D game, I might abandon the BoundingSphere and write my own bounding code.

Within a couple days, I hope to have the collision and expansion down. I think I might experiment with forcing the targets to use integers only for coordinates, so that it doesn't look as sloppy at the point where one group bumps into the other.

Duration: 01:08:49

Tuesday, January 19, 2010

Daily Developer: Day 18

I decided that the easiest way to solve the lag issue with collision detection was to break the game field up into a grid of 100x100 boxes. Whenever a new target was created, I would associate it with the appropriate box. Thus, each projectile only has to be checked against the targets in it's box.

I implemented this with a quick class that I called the GridManager. I was able to reuse my existing collision detection code with only a reordering of the loops (I was looping through the targets first, with the projectiles being checked within) and a call to the GridManager to get the appropriate, smaller lists to search through.

I anticipated that there would be some flaws in my quickie algorithm, and I was not disappointed. As expected, there were some targets near the edges of the boxes that were not being checked for collisions. I will need to check the current box, plus the boxes next to it if the position of the projectile plus the radius of the targets would place it near the edge.

I also was using the position by default, which is just the upper left corner of the sprite I am using. I think I will need to store this using the center of the objects to get more accurate results. Most of the objects already can return their centers. I just need to make sure that they are being used instead of position.

Duration: 00:34:50

Monday, January 18, 2010

Daily Developer: Day 17 part 2

I spent a second round this evening adding expanding to the target spawning phase. The concept behind the game is that there are targets that spawn randomly, that if left untouched, grow additional targets to the north, south, east and west of them. This was implemented effortlessly, partly due to the TargetManager I implemented yesterday.

The issue now is that there is a clear need to optimize my collision detection. Getting the basic elements of the game in place, I used simple methods that I knew I would need to refactor later. The collision detection works fine for small numbers of projectiles and targets, but not as well when there are larger numbers of both objects.

I spent some time browsing the XNA forums and found some suggestions. Most of them involve dividing the objects into groups that need to be checked for collisions, and those that don't. For what I am doing, probably the easiest to do would be to use a grid, dividing the gameboard into much smaller sections. Then, each object will be sorted into the box it is in prior to collision checking occurring.

Working on optimizing the collision detection will be my goal for tomorrow.

Duration: 01:07:29

Daily Developer: Day 17

Ran home at lunch today and spent a little bit of time finishing up the initial refactor of my ProjectilesManager. Everything now works like it did before, with hidden better internal stuff. The next task will be to work on the more complicated spawning pattern I want the enemies to use.

Duration: 00:18:57

Sunday, January 17, 2010

Daily Developer: Day 16

Less exciting, yet still important, work today. I decided there was a need to have manager objects for the targets and the projectiles.

I completed the creation of the target manager and moved most of the handling of the target creation and destruction there. Then, I made sure the game still worked.

Then, I started moving stuff over for the projectile manager. But, it is going to be more than a simple copy-paste of what I did with the target manager. Hit the hour mark and decided that it would have to wait until tomorrow.

Duration: 01:00:45

Saturday, January 16, 2010

Daily Developer: Day 15

Messed around with adding sound effects and playing music in the background. Started the complicated task of thinking about the best way to handle the complicated spawning pattern I want for the targets.

Duration: 00:52:36

Friday, January 15, 2010

Daily Developer: Day 14

Today was even more exciting since I actually had someone else other than myself "play" the game. My six year old daughter saw it and wanted to play. Really, there isn't much to it right now, but she had fun moving the guy around and shooting the blobs. I was inspired at that moment to make the target generation random so that we wouldn't need to keep restarting. I also added the ability to spawn more at the push of a button. Fun.

Spent a lot of time talking with a friend and working out the calculation for accurately specifying the speed of the projectiles. Finally got that working.

Did a little refactoring. Created a quick bitmap for the targets instead of just drawing circles. Added that into the game, but now collision detection is off a bit. Will need to investigate, but will save that for tomorrow.

Duration: 01:00:04

Thursday, January 14, 2010

Daily Developer: Day 13

Today was actually very exciting. Well, as exciting as software development gets. Hey, it excited me, anyway.

I created a simple "projectile" sprite and a simple class to support it. I added support to fire using the right thumbstick, firing the projectile in the direction pressed. I also added support to destroy both the projectiles and targets upon collision. So, it is a real shooter now in that you can actually shoot and destroy stuff. Almost time to put the achievements in.

Things I need to work on next include:
  • Destroying the projectiles when they collide with the boundaries of the game (right now they last forever or until they hit a target.)
  • Making the creation of new targets more random, instead of the diagonal line they spawn in now.
  • Fixing the speed of the projectiles. I currently support firing in all directions with the right thumbstick. However, it uses the severity of the push on the stick to determine speed. So, there are faster and slower projectiles.

Duration: 00:58:14

Wednesday, January 13, 2010

Daily Developer: Day 12

Finished check to ensure shooter stays within bounds. Calculations are interesting since the size of the sprite is bigger than the size of the shooter and I needed to account for this.

I also did some basic, minor refactoring.

Tomorrow, I am ready to start with the actual projectiles the shooter will be firing at the targets. Should be interesting, but not too hard, I don't think.

Duration: 39:37

Tuesday, January 12, 2010

Daily Developer: Day 11

I picked up where I left off yesterday: trying to figure out how to detect if the shooter was moving off the edge of the window. After struggling with this for a little bit, and realizing that it shouldn't be this complicated, I decided that it was now a good time to start refactoring.

I have been keeping track of almost everything in the main game object. I do have a target object that I had created early on, but had been keeping track of a number of shooter properties separately. So, I created a Shooter class and moved over all the code pertaining to it from the game class.

It also occurred to me that there were a number of elements that were going to be shared between the shooter and the targets, like Position, for instance. I created a base class, as well as an interface, and started moving shared elements into the new structures.

I will continue with my refactoring tomorrow, and maybe I will eventually get back to calculating the boundary, now that it should be easier. I am also thinking about creating the "ammo" object for the actual shooting part of the game.

Was on a roll today and had to pull myself away as I started to exceed an hour. I don't want to burn myself out, and a good motivator is to stop when you already know what is coming next.

Duration: 01:03:30

Monday, January 11, 2010

Daily Developer: Day 10

Spent a bunch of time jotting notes in my notebook while hanging out at my daughter's gymnastics lesson. Have a solid idea of the things I want to work on next.

Duration 00:23.38

Did some calculations to correct the collision detection. I was using the upper left corner of the object as the center my BoundingSphere, and the collision was off. Added support for making sure the shooter stays on the screen, but need to apply some additional logic to again use the center instead of the upper left corner.

Duration: 00:17:16

Sunday, January 10, 2010

Daily Developer: Day 9

I continued development on the 2D shooter. I found some information about BoundingBoxes and BoundingSpheres. Since I wanted a round hit area, I used the BoundingSpheres with the z coordinate set to 0, so it is essentially just a circle to me. Using this, it was pretty easy to assign one to the shooter and the enemies. Then, I just had to check if the spheres intersected, using BoundingSphere.Intersects(). For now, I just throw up a message when there is a collision, but it should be easy to replace that with whatever I decide later.

The most notable thing about today, however, was that I didn't have any interest in doing any work on this. The whole structure of the 365, however, helped with a little self-made peer pressure. And, since it only has to be a minimum of 15 minutes, it made it easier to convince myself I could do it. I've also been doing really good at creating a "chain" of days where I do this, and I really didn't want to break the chain. Once I started, though, I was interested enough to work longer than the 15 minutes necessary.

Duration: 00:32:59

Saturday, January 9, 2010

Daily Developer: Day 8

The things I accomplished today are more in line of what I think of when I say I "did work."

I worked on the shooter. I found some code that allowed me to easily create circles that I am going to use as my targets, at least temporarily. The way I am defining things, it should be easy to use a sprite or a 3d object later without much effort. I setup objects to spawn at regular intervals, and created a way for them to be maintained and drawn easily.

I made a simplistic bitmap that I could use as the player avatar (the shooter) and stuck that into the game. I hooked it up to the left thumbstick and played around with moving my little guy around. It was surprising just how intuitive it was to get it working.

I'm not sure exactly what my next step will be. I'll probably work on getting bounding boxes set up, since currently the shooter can walk over the other objects. I also need to implement the actual shooting part, and I will need to do some investigation for this. Also, I need to work on how the objects are destroyed when shot, but I can just make them disappear to start with. The objects that are shot at are have some growth properties to them that I need to implement. And, I need to get the random spawn portion working, since I am spawning predictably right now.

Duration: 01:18:14

Friday, January 8, 2010

Daily Developer: Day 7

Today, I was planning on working on some basic elements for my 2D shooter, which I am going to call "Toxic Growth". Before I started with that, however, I wanted to finish getting the tools necessary to develop properly.

The one thing I realized that I was missing was source control. I'm not too concerned about losing files to HDD failure (since I have RAID 1 configuration), however, I like having the luxury of willy-nilly changing files and trying things without having to worry about making a backup in case it ends up being a horrible idea. So, I grabbed TortoiseSVN.

I have used TortoiseSVN at work, but have never actually needed to create my own repository. It ended up being very easy to do so, but I still had to muck about figuring it out. In the end, I was able to get it all configured and a base project into it.

It ended up taking about an hour or so. The exact duration is unknown, since installing TortoiseSVN required a reboot and I neglected to note the time on my Time Tracker before it was shut down.

Tomorrow, I am going to work on getting the basic shapes into the game. I might also take a look at the 3D example, but I am thinking that I want to write this shooter as a simple 2D, so I might hold off on that.

Thursday, January 7, 2010

Daily Developer: Day 6

Started going to through the "Your First Game: Microsoft XNA Game Studio in 2D" tutorial provided in the XNA 3.1 help. It is amazingly simple to do stuff in this framework. After playing with the tutorial, I am tempted to write a simple 2D shooter game. I think I might do this as part of my journey.

I might fool around with the 2D example a bit more, but following that, I am going to walk through the "Going Beyond: XNA Game Studio in 3D" that appears to be a bit more complicated. It might be worth doing the shooter in 3D.

Tomorrow, more 2D fun and then I'll start the next tutorial.

Duration: 01:06:33

Wednesday, January 6, 2010

Daily Developer: Day 5

I updated some details in the Google Wave, but also started a mind-map at MindMeister. Worked on the mind-map a couple of times away from computer, so exact time duration is unknown. Many of the details are more spelled out, but there are some things that remain foggy.

I think I might have enough of an idea now that I can return to developing. My goal for the next couple nights is going to be to research and create a 3D environment that I can move another object around in.

Duration: 32:50 + about 30 minutes

Tuesday, January 5, 2010

Daily Developer: Day 4

A friend (shunoshi) gave me a link to a menu displaying example as well as a book he recommends. While I cannot immediately make use of the book (as I do not currently have a copy) I was able to download the example code.

I ran the menu example and read through the code, and then browsed through some of the other examples there. While I don't think I have all the info necessary to make the graphics, I am confident that I can weed through the examples and piece it together when the need arises.

However, I think I need to return to brainstorming that actual game itself. Once I have a better idea of exactly how I want it to play, it should be easier to determine exactly what I need to learn. I tend to be better at learning via doing rather than reading, so knowing what I am trying to accomplish will direct my studies.

I've also shared some of my preliminary notes with yeti as well as another friend who expressed interest in assisting. I intend to try to coordinate most of this project via Google Wave, so I've posted all of my notes there.

Goals for tomorrow: I am going to focus on brainstorming the various game elements and the actual way the game will be played. I may also work on the story, since that might have a direct impact on how it would make sense for the game to be played.

Duration: 44:32

Monday, January 4, 2010

Daily Developer: Day 3

Technically, this took place during the same day as Day 2, but I worked on this a couple of times today, looking at different things for different durations, so I think it counts.

I started by creating a new XNA 3.1 Windows project in VS 2008. Ran it and saw it popped open a window with a blue rendered background. It now occurred to me that I don't really know anything about XNA, other than I installed it on my computer.

So, I joined the XNA Creator's club. From the site there, it suggested looking at the help available via VS 2008. I started reading the "Getting Started with XNA Game Studio" in the help. Decided that the "Programming Guide" and then the "XNA Framework Class Library" and "Content Pipeline Class Library" sections would be worthwhile reads. Will probably spend several days reading this. Additional steps include looking at tutorials and examples at the XNA Creator's club.

Duration: 33:04

Daily Developer: Day 2

Though I didn't work on it yesterday, I am counting my little lunch time update as my daily work for yesterday. I will work on this further after work today.

I spent 18:55 working on writing a brief explanation of what the game concept is and shared it with Yeti, who is going to be working on the art. I also sent him an invite to Google Wave to coordinate our stuff together better. I even got to use my quick little time tracker.

Tonight, I think I will focus on expanding the game concept, writing my back story and thinking of the puzzles / game elements I'd like to include.

Saturday, January 2, 2010

Daily Developer: Day 1

Today is the start and began with my decision to pursue this. To get things started, I began by starting up my copy of Visual Studio 2008 that I had sitting around. I hadn't installed any of my helper apps, so I downloaded and installed Sonic File Finder 2.1 and Code Rush Express. I use both of these at work and know I would feel lost trying to navigate my projects without them.

After getting those installed, I decided that the best way to start would just be a quick time tracking app. Ideally, it would be useful for tracking this type of project, but could be useful in a number of different tasks I do. As part of the app, I am going to include an option to notify the user that a specified amount of time has been spent on the project.

The basic app now has a start and stop button, a combo box to allow multi-project support and an output window to display the time taken. It is quick and crude and I think I will spend some time refining it tomorrow.

Accomplishments:
  • Decided to participate
  • Mucked with blog to get it "just right"
  • Installed my utility add-ons to VS 2008
  • Started a new project and put in some basic functionality.
Overall time spent: about an hour.

Daily Developer: Intro

This is my attempt at the "365 Day" project as described and discussed in this thread.

Something I have been meaning to get to forever is to make that video game. Which one? No specific one, but the whole reason I became a software developer in the first place was because of my love of video games. I have always meant to make one "in my spare time" but found I was always so busy playing them that I never took the time to actually use that "spare time" to create one.

So, my 365 is going to be software development. I am going to brainstorm ideas, write plot / dialog / scripts, write code, test code and research things I don't know how to do for the 15 minutes to 1 hour suggested per day. I think I am going to start with just writing utility programs at home until I can get into the habit of daily development. I'll record my progress via my blog here.