Sunday, May 11, 2008

Sprint 2 - It takes two

This sprint's theme was "It takes two". The goal was to have the multiplayer functionality (both single machine and networked) completed. Controller selection was also a feature that was assumed important to provide a valueable multiplayer experience.

Things that went well

Controller Selection

The controller selection screen turned out better than originally expected. It gives a player the opportunity to select their desired controller for the different modes of play (Singleplayer, Head-2-Head, and Networked). It remembers a player's last saved settings. It is also smart enough to know when selecting the controller types for Head-2-Head play, that player 1's controller should not be an option for player 2's controller, vice versa.

State Management Interface

I implemented a state management system to make transitions between game states more manageable. Once multiplayer was introduced, the script code started to become a little squirrelly. Fortunately it was early enough to introduce a system like this so the effort wasn't too time consuming. It will also lend itself to the networked multiplayer system that needs to be implemented as well. It's saving grace is how well it allows me to organize the different game states making maintenance more manageable.

Player Controllers

The player controller interface allowed me to organize the different controllers needed to control the player paddles (keyboard, mouse, ai, etc). This system allowed me to just identify the type of controller the player wanted to use and plug it in and the player has control. This also worked for AI controlled players as well.

Things that didn't go so well

Networked Multiplayer

There was a larger learning curve on how Torque Game Builder utilizes network play that forced the networked play stories out of the iteration. It was unfortunate because now the extended pong features will have to wait until this feature is complete possibly pushing the timeline an iteration.

Source Control

Issues with the stability of my source control machine ate too much time for troubleshooting. Alternatives will be investigated in the following iteration to get it setup. During Sprint 2, it was deemed not as valuable as some of the other stories so was put on the shelf till the next iteration. It still doesn't feel good to be coding without source control protection. Keeping my fingers crossed that nothing disasterous occurs.

Controller Selection

Even though the controller selection capability turned out well, it took a lot of time to handle lots of minor details that weren't accounted for in the original estimate.

Opportunities for next iteration


  • Setup Source Control

  • Networked Multiplay

  • Defect fixes



Iteration Deliverables

Inside the PowerPong root directory are too important files at this point: readMe.txt and console.log.

readMe.txt - Describes the controls because the in game input text was left generic because controls will be customizeable.

console.log - Log of what is happening in the game. Send this along with any defects to my email

NOTE: Mac version is still unavailable.

Monday, May 05, 2008

Sprint 2 delay

Sprint 2 (PowerPong project) has been delayed by one week due to life events. The scheduled sprint release date is 5/9. I will post the iteration review the following weekend.

OOH OOH EEH EEH

Saturday, April 26, 2008

More Agile Blogs

Here are a couple of high quality agile project planning blogs I've been frequenting. The authors are very knowledgeable, and present topics in a manner that is very easy to digest and start using.

all about agile by kelly waters
Succeeding with Agile

OOH OOH EEH EEH

Thursday, April 24, 2008

Sprint 1: Classics


So, I decided to start simple and make a game I know I could finish but would allow me to focus on process to help me produce my future projects. So I decided on a pong clone. The difference is I wanted to all elements that I think would make it fun(ner).

My development techniques are all agile based (SCRUM). I am targeting two week iterations to produce valueable functionality. My plan is to produce working demos that demonstrate the current state of the game as it is in development.

With that out, my first iteration is complete. It started on 4/11 and was scheduled to end 4/25. Fortunately, I am a day ahead of schedule which is good and bad. Good because I accomplished the items I committed to. Bad because my estimates were off, but will provide nice feedback for upcoming iterations.

At the end of each iteration I will provide links to that iteration's deliverables to give you all a chance to see the progress. I encourage everyone to provide all feedback. Any feedback is beneficial to help me make the best product I can make.

I also would like to touch on some of the things I thought went well and think that will need to be improved on. This will give me a chance to review what happened during the last iteration and also get insight from you guys on things that have happened in your projects.

Things that went well

Selected strong indie tools

  • Torque Game Builder: a fully featured 2D game engine that makes rapid development of games easy and fun. You can purchase an indie license for $100. Best price on the market for the power and efficiency you get.

  • Torsion: a Torquescript editor with a nice arsenal of debugging tools. It is a must for any type of Torque Game Engine develoment. It goes for $39.95.

  • RallyDev: an online agile project management application. It tracks product backlogs, iteration status, and provide agile metrics to know how far along you are in your project. Best of all there is a free version.



Created a testing process
I came up with a way to test new functionality and organize it in a way that would clutter or interfere with the application. This helped verify new functionality didn't break existing functionality. Taking the time to do that helped speed up my development time.

Things that didn't go so well

Stories too detailed: Initially I created stories that were too detailed. This pigeon-holed me into thinking of only one way to approach a requirement. This present an opportunity for me to refactor my existing stories in the product backlog.

Didn't setup source control: I should be slapped for this. I started the project without having any source control. There was a point where I felt the brunt of this when I performed a large refactoring that I almost had to roll back. Luckily I found my flaw and was able to proceed with the refactoring. Otherwise I would have been is a really bad situation.

Opportunities for the next iteration

  • Setup Source Control

  • Refactor User Stories so they are not implementation specific



Iteration Deliverables
Inside the PowerPong root directory are too important files at this point: readMe.txt and console.log.

readMe.txt - Describes the controls because the in game input text was left generic because controls will be customizeable.

console.log - Log of what is happening in the game. Send this along with any defects to me at charles_gibson_jr@hotmail.com


UPDATE: The issues regarding the Mac distribution has been identified. In the process of updating and redistributing a Mac version. Thanks for your patience.



OOH OOH EEH EEH

Another joyous addition


She's here! Her name is Simone Marie Gibson. She was delivered into this world at 1:27am on April 16, 2008. She weighed 5 lbs 11 oz and was 19.5 inches long.

It all started at around 9pm on April 15th. Katie, my wife, started having contractions. They were sporadic and didn't last very long. We decided not to worry too much about them but to start tracking and timing them.

Then at around 10pm, they started to happen a bit more frequent with increased intensity. These contractions were averaging around 7 mins. We called the hospital to get their advice on whether we should come in or not. They left it up to us. Since during our previous pregnancy Katie was in labor for 8 hours after her water broke we assumed we had time. So we decided to rest.

At around 12:30am, Katie woke me indicating it was time to go. Still in control, we begin what we practiced. She starts getting dressed and I start taking the bags downstairs to put in the car. Once downstairs, I hear her call for me. I race upstairs to see that her water has broke. Slight panic, but still in control. I mean with our first born, we still had 8 hours so surely we had time to make it to the hospital.

So I call my mother to let her know we are going to drop off our oldest daughter and go into the hospital. My wife motions she needs to go to the bathroom, and I follow suit. As I am handling my business, I hear her scream. I race back into the room to see her on all fours. There is slight spotting on the floor. She begins telling me the baby is coming.

Now I'm in freak-mode. I try to get it together. I tell her to get dressed. I frantically call my mother to tell her we aren't coming. Then call my sister who lives closer to come over immediately and to let herself in because we needed to race to the hospital.

While I was calling Katie has started downstairs to get into the car. Still on the phone with my sister, I hear another scream. I immediately hang up, and jump downstairs to see my wife on the floor by the door that leads to our garage. She is really emphasizing how the baby is coming any moment now. She asks if we should call 911.

In that brief second I decided against it because I think we could make it to the hospital in time, rather than having to wait for an ambulance to get to our house risking giving birth before they get there. So she quickly gets into the car, with me right behind her.

I race down the street, at points reaching 90 mph. While the entire time my beautiful wife is trying her hardest to fight the urge to push even though her body ignores her efforts.

We pull up to the Emergency Room entrance. I dart out of the cart screaming "We need assistance, my wife is pregnant!!" There were no doctors in sight. Only two night security guards. One lazily asks, "Do you need a wheelchair?" I wanted to strangle him, so I harshly reply "YES!".

I run back to my wife to help her into the hospital. As I get to her I see her legs are weakened from her trying to fight the pushing. I catch her before she falls. She then tells me "You need to carry me."

"What? I don't think I can do that..."

Comically she replies, "No, you need to carry me...". Thinking to herself, you have been working out you better get to carrying! :)

There was no time to continue this conversation so I scooped her up and started racing down the halls screaming at the security guards for directions to the birth center.

As we round the corner toward the birth center, I never felt so alone. The hallway grew endless and pitch black. It was as if the hospital was abandoned. My wife starts to scream in fear the baby was going to come out and fall to the floor.

We reached the double doors that lead to the birth center. My wife tells me to put her down on the floor because the baby was coming now.

As I laid her down, a doctor appeared along with two nurses, one pushing a wheelchair. My wife tells him the baby is coming, but in disbelief he replies, "No, the baby isn't coming. Let's get you to a room."

Out of frustration my wife starts pulling her pants down to prove it. While she was pulling we lifted her and put her in the wheelchair and raced to the staging room. Once there, the nurse grabbed Katie's right side and I grabbed her left. We hoisted her out of the wheelchair. At that very moment Simone's head appeared. In mid lift the nurse grabbed Simone's head to catch her as we lifted Katie to the bed. Once on the bed, it only took my lovely wife three pushes and our baby girl was here.

At that moment, a new life began for all of us. She's our special jellybean! Our Simone.

Wednesday, April 09, 2008

Agile Project Management Tool

I came across a slick Agile Project Planning tool called Rally. I am using it for my current game project "PowerPong". The makers of Rally also have a nice library of videos explaining how to use their tool for agile development. I highly recommend it to anyone needing a project planning tool to streamline their product backlog and iteration releases.

OOH OOH EEH EEH

Wednesday, March 19, 2008

XNA Testing

Finally, I've figured out a way to test my XNA rendering code.

I've created a small hierarchy. There is the GameTestBase class and the GameTester interface. My approach is very simillar to the Template Method design pattern where the flow is managed by GameTestBase and GameTester defines the implementation.

Instead of using functions, I used anonymous delegates. This allowed me to isolate the objects under test within each concreate GameTester without GameTestBase having to know about the inner workings of each test. Or have each concrete GameTester query the world from GameTestBase.

Program.cs provides entry into the application so the code to run a test is as follows.


new GameTestBase(new GameObjectRenderTester()).Run();


A GameTester is supplied as a parameter to the GameTestBase constructor to plugin the implementation of the test. Once the GameTestBase object has been constructed we tell it to run the test. And that's it! Woot! Now let's take a look at the GameTester (GameObjectRenderTester).


public class GameObjectRenderTester : GameTester
{
private GameObject ball;

public
GameTestBase.LoadContentDelegate LoadContentDelegate
{
get
{
return new GameTestBase.LoadContentDelegate(
delegate(GameTestBase game)
{
ball = new GameObject(
game.Content.Load("ball"));
});
}
}

public GameTestBase.UpdateDelegate UpdateDelegate
{
get { return null; }
}

public GameTestBase.DrawDelegate DrawDelegate
{
get
{
return new GameTestBase.DrawDelegate(
delegate(GameTestBase game)
{
game.SpriteBatch.Begin();
ball.Render(game.SpriteBatch);
game.SpriteBatch.End();
});
}
}
}


A concrete GameTester object is made up of three public properties: LoadContentDelegate, UpdateDelegate, and DrawDelegate. Each delegate is responsible for implementing a particular section of the application flow. The LoadContentDelegate is responsible for loading any content before the application enters the application loop. The UpdateDelegate is responsible for performing any object animations or prerender operations. Finally, the DrawDelegate delegate is responsible for rendering.

The cool thing about this approach is how the tester can have its own state and it be used within each delegate without any interference from the GameTestBase class. This greatly simplified my tests from prior. I was in static hell!

Now let's have a look at the GameTestBase class to see how it uses the GameTester to run a test.


public GameTestBase(GameTester tester)
{
this.drawDelegate = tester.DrawDelegate;
this.loadContentDelegate =
tester.LoadContentDelegate;
this.updateDelegate = tester.UpdateDelegate;
...
}

protected override void LoadContent()
{
...
if (loadContentDelegate != null)
loadContentDelegate(this);
}

protected override void Update(GameTime gameTime)
{
...
if (updateDelegate != null)
updateDelegate(this, gameTime);
}

protected override void Draw(GameTime gameTime)
{
...
if (drawDelegate != null)
drawDelegate(this);
...
}


First, GameTestBase inherits from the Microsoft.Xna.Framework.Game class. It then overrides the LoadContent(), Update(), and Draw() methods. These are the three methods that the GameTester will implement. As demonstrated in the GameTestBase constructor, the GameTester delegates are stored off and used from within the GameTestBase overrides.

And that's all she wrote folks. It is that easy. It even gives me a nice way to organize my tests. This type of testing is a step up from unit testing because now I can test logic such as collision detection to verify it is calculating and rendering properly. This does not replace my unit testing though, but provides a way to perform tests that don't lend themselves well to unit testing.

So, can I get a hell yeah???

Sunday, March 02, 2008

Krav Maga Videos

Here is a listing of some cool Krav videos. Enjoy!

Krav video 1
Krav video 2
Krav video 3
Krav video 4
Krav video 5

OOH OOH EEH EEH

Saturday, February 16, 2008

SQuba Car??

Bond...James Bond.

It's awesome yet crazy. The new submarine car is out. A car that drives on land and underwater.

Just make sure you are wearing your freshly tailored scuba suit before you decide to take a nice midday dive. :)

WHERE'S MY TELEPORTER???

Texture Cache

I created a texture caching system that separates the region definitions from the requesting a region. Below is a code snippet of it in action.

XmlDocument xml = new XmlDocument();
xml .Load("textures.xml");
TextureCache tc = new TextureCache<Texture>(xml, new CustomTextureBuilder());

The TextureCache object takes in XML and a TextureBuilder to load the textures appropriate to the application. The XML defines the regions within a texture. The TextureBuilder is an application specific object that performs the conversion of the XML data into the right Texture format. For example, in my Pong remake I am using XNA so my TextureBuilder converts the XML data into a Texture2D object wrapper.

The XML file is pretty straight forward, see snippet below. Each texture node has a collection of region nodes that define a portion of the texture that can be used in rendering. Each region is given a name that is used as a key in the texture cache.

<textures>
<texture name="textureName">
<region name="regionName" x="0" y="0" width="64" height="64" />
</texture>
<texture ...>...</texture>
</textures>

The power behind this interface is it's retrieval mechanism. Basically you ask for what you want.

Texture t = textureCache["textureName"];
TextureRegion tr = t.GetTextureRegion("regionName");

You just ask the texture cache for a texture, then ask the texture for the region you would like to render. It's that simple. Another powerful piece is the system relies on Generics so each application can have the texture cache provide application specific textures.

In the future I am looking to build a UI to create the XML definition file to simplify that process. Will keep you posted on the results of that endeavor.

Stay easy.

Sunday, January 20, 2008

Announcing my XNA game dev library

So, I am at it again. To learn how to use XNA I've decided to create a little game dev library using XNA as the foundation. For more information on XNA visit this link.

My first project will be a variation of Pong. Here is a link to a screenshot of the main menu. Pong is simple and something I know how to make. My plan is to use it as proof of concept for the ideas I will be implementing in my library.

Currently, I have a basic rendering and input system. At the moment the rendering system wraps XNA, but my input system provides the ability to map input responses to any kind of input type (i.e. keyboard, mouse, gamepads, etc). The menu system currently utilizes this feature.

I will post code examples once I have more done. I am will be providing significant test coverage to ensure a clean and solid set of interfaces. Stay tuned.

Thursday, January 10, 2008

Fathering 2...piece of cake?

I had assumed it would be easier to be a father to my second child. Interestingly I have been awakened by reality. Deep down I know it will be fine, but that doesn't stop me from wondering if I will be good enough to father two children.

I guess only time will tell.

Seeing my unborn child move and interact with us in the ultrasound was so fascinating. She has so much energy. I'm filled with so much joy when I feel her react to me poking the walls of her current home. That justifies these ridiculous feelings. All I want is to be the best Dad I can for her, and that she is assured by that.

Awaiting the life lessons she has in store for me.

April 24, 2008 my walk with Simone begins...

Good Programming Books

Just wanted to link a couple of books I think are must haves when coding.

Interface-Oriented Design

Refactoring


OOH OOH EEH EEH