Consoling over the Holiday

Posted 01/08/2009 @ 10:30:00 PM by Joseph Molnar
Filed under: Community Games , Games , Media , Xbox 360

Christmas was a bit crazier this year. Normally we travel to the Great White North (aka Canada), but this year we stayed in Palo Alto and had my wife’s family stay with us. This meant having a lot more people in the house than bedrooms. But I loved it. I love having people over and it was great to see the kids playing together.

I still find it amazing (and fantastic) how consoles are playing such a predominate role in entertaining a holiday crowd. Last year we played a ton of Guitar Hero. This year it was Scene It?: Best of Show. In fact, Scene It? was the nightly pre-bed ritual for four us.

The surprising Holiday habit, however, belonged to my sister-in-law’s husband. He isn’t a hard-core gamer but he does enjoy racing and sandbox games. So what was surprising? He was completely addicted to CarneyVale Showtime, the 400 MS Points Community Game. 

Rob doesn’t care about Indie developers or small versus large games. He cares about being entertained, and CarneyVale was something that very clearly kept him entertained. In fact, while we nearly finished the game during his visit he purchased it when he got home.

While most of the family left prior to the New Year, my father-in-law remained and has helped us with the move to the Seattle area. He isn’t a gamer (and no goading will change that) but the 360 did become a nightly video rental machine.

As for me, I didn’t have a lot of time to game over the Holidays but I did manage to play a few other Community Games and finish Gears of War 2. I also received a couple games as presents; first on my list to play is Fallout 3 … once I have at least 60 to 80 hours available.

So that’s how my consoles were used this past Holiday. I hope everyone had some restful time-off and have had a great start to the new year.

Joining Microsoft's Gaming Group

Posted 12/12/2008 @ 12:00:00 PM by Joseph Molnar
Filed under: Site News , Xbox 360

I’ve always made sure I enjoy my work whether it is at a company I start or a company I join. Loving what you do is even better and since Q3 2004 I’ve loved what I’ve been doing. Managing scanR’s engineering team and being the chief architect has been an absolute pleasure.

Why? Well, we have solved some amazing technical challenges, I’ve learnt a ton about the mobile space, my team is talented and great to work with, and everyone in the company is intelligent, hard working and a pleasure to be around.

But there is one thing beyond a job you love ... the dream job. My dream job is to work in the gaming industry where the work I do on a daily basis has the possibility of influencing the industry as a whole.

There are very few companies that can support such a position. Microsoft is one of them and through a series of serendipitous events I’ll be starting my dream job at Microsoft on Monday.

I cannot give many details of the position except to say it is an architectural role (called a Partner Architect) where I’ll be playing with various technologies and platforms, working with a variety of groups, and I’ll be working for Chris Satchell, the Chief Technical Officer of the Interactive Entertainment Business (aka ‘Gaming Group’ ... makers of Xbox 360, Games for Windows, XNA Game Studio tools, etc).

The decision to leave scanR and move to the Seattle area to join Microsoft wasn’t taken lightly, but when your dream job comes across your plate it is hard not to dig in. I know scanR is in good hands and I offer my sincerest wishes for great success.

In Support of Indie/Community Games

Posted 12/04/2008 @ 12:40:10 AM by Joseph Molnar
Filed under: Community Games , Games , Indie , Xbox 360 , XNA

In recent years I haven’t played much in the way of Indie games other than what is on Xbox Live Arcade. I’m essentially a console gamer yet a large portion of Indie games are Windows applications.

I’ve stayed away from running/installing games on a PC because I’ve had issues:

  • Dealing with hardware/drivers that caused problems in games
  • Trusting .EXE’s found on the ‘Net

So now that Xbox 360 Community Games are available to the public I’ve found myself once again revisiting the Indie scene.

I’ve mentioned my fondness for Blow, Bloc and Colosseum, but there are plenty of other great titles including Weapon of Choice, Biology Battle and Word Soup. Microsoft is also continually expanding the countries that are able to submit into the Community Games. As they do, many additional games, including those that were part of the Dream Build Play and Imagine Cup competitions, should be coming our way.

On top of that there are plenty of developers making games using XNA on Windows. I would love to see these on the 360. Have a look at the two examples below and then contact the developers and see if you can help me convince them to get the games onto Community Games.

Ultimately what I’m saying is that I’m super excited to see that Indie Game developers can tout their wares from a venue that is not only dedicated to their cause but also trustworthy for those wishing to play the games.

And if you can, support these developers with not only words of encouragement but the purchase of their games.

====

Blueberry Garden

Game Details: http://eriksvedang.wordpress.com/blueberrygarden/
Developer: Erik Svedäng

 

Carrion Re-animating

Game Details: http://www.zombie-cow.com/?page_id=375
Developer: Zombie Cow Studios and Lemmy&Binky

Thanksgiving Weekend Recap

Posted 12/01/2008 @ 04:00:00 AM by Joseph Molnar
Filed under: Community Games , Games , Xbox 360 , XNA

So the American Thanksgiving weekend has come and past. It was an enjoyable time where thirteen people consumed too much food, had too much merriment and are now well positioned, after some rest, to dive deep into the Holiday season.

Of course, for a group consisting of many video game enthusiasts, consoles played an active role entertaining the crowd. When the boys separated from the girls, gaming included Aegis Wing and the investigation of Community Games such as Blow, Bloc and Colosseum  (all of which I highly recommend). Unfortunately, Paulo’s motion sickness kept games like Gears of War 2 out of the equation. When the boys mixed with the girls gaming included Lips, Scene It! Box Office Smash, and a non-video game called Banagrams.

One of the weekend highlights was the mid-Friday visit to downtown Palo Alto’s audio-visual store. While the store was fairly busy, no one was playing the Rock Band setup. We fixed that. My pre-school daughter wailed on drums, Paulo tore through guitar and I screeched out vocals. We attracted a crowd, gained an additional participant and eventually even store employees swapped in to entertain the crowd.

Oh, and I finally understand why people want a browser on their consoles. There was a desire to social-browse, particularly through YouTube. Laptop screens and iPod Touchs are not ideal for group settings and sat in sharp contrast to the ease of watching The Guild through the 360.

I want to thank Dan, linda, Paulo, Gill, Pete, Todd and the Corbett crew for coming by. Without you it would have been just an ordinary, albeit turkey-saturated, long weekend.

Tales Framework for XNA: Technical Preview 1

Posted 11/06/2008 @ 08:01:00 AM by Joseph Molnar
Filed under: Programming , Tales Framework , Xbox 360 , XNA

Yes, it is true, I’m finally ready to release the first technical preview of the Tales Framework.

Summary

The Tales Framework is an extension library for XNA Game Studio 3.0 that adds hierarchical controls, input handling and easier network session handling to XNA.

The build of the framework is for Windows only. If you would like an Xbox 360 version or have any questions, please contact me at josephmolnar (at) hotmail.com.

Links

Link to version 0.56.26.0 of the framework, help file and the sample source code:

Previous blog posts that explain the features and limitations of Tales Framework version 0.56:

Sample Details

The sample is my 'real-world' test case for the framework. The sample isn’t quite what I would call production quality code yet, but it is fairly solid. As I work towards the final release of the framework I’ll be updating the sample code.

The sample is not a full working game. It is a working example of creating a menuing system and creating, find and joining a network game. In particular the sample has:

  • Full working menus for creating a new multi-player match
  • Full working menus for finding a multi-player match
  • Full working lobby
  • An example pause menu
  • A game screen (no actual game and networking isn’t 100% correct yet)

While the sample demonstrates the framework well, here are some of the more interesting places to look:

  • The pause menu shows binding a menu so input is only processed for the player that paused the menu.
  • Hitting the Start button or Enter key on the main menu demonstrates that moving a parent control moves all children controls within in.
  • The networking menus use the GameSessionHelper; you can hit the back button at any time.

Note: For the networking menus to work you must have a Games for Windows Live profile (local or network). If you don’t, when the sample starts hit the Home key and follow the instructions. This will initiate the installation of Games for Windows Live and the creation of a profile.

XNA Community Games are Amazing

Posted 10/30/2008 @ 07:01:39 AM by Joseph Molnar
Filed under: Games , Xbox 360 , XNA

Tonight I was in San Francisco at the XNA Community Games Party. I had a great time meeting various folks including games developers and designers, the media, and the team who made XNA Game Studio happen within Microsoft.

One of the people I spoke with was Nathan Fouts, the developer behind Dream Build Play 2008 3rd place winner Weapon of Choice. Nathan used to work for Insomniac Games. You can see why he was a good fit within Insomniac when you see the weapon designs in his XNA game. While I jokingly called him a defector (from Sony), it was clear he was impressed with what Microsoft built, and happy that XNA gave him an easy way to start his own gaming company.

While I didn't get to play all of the games, my two favourites were CarnyVale: Showtime and Battle Tennis. I wasn't surprised to hear these were the 1st and 2nd place winners respectively in Dream Build Play 2008. In fact CarnyVale was a game I saw XNA team members having trouble putting down.

What is abundantly clear is XNA GS is an amazing tool that allows developers to build games that rival and surpass games on Xbox Live Arcade. Congratulations and thank you to the XNA team for bringing this to the public and congratulations to the game developers for building some amazing games. November 19th (the release date of the new Xbox 360 User Interface and XNA Community Games) cannot come soon enough.

Tales Framework for XNA: Tech Preview 1 Limitations

Posted 10/26/2008 @ 06:00:00 PM by Joseph Molnar
Filed under: Programming , Tales Framework , Xbox 360 , XNA

I'll be releasing the framework soon so I wanted to share the preview's limitations. The items outlined below are essentially items on my improvement/to-do list. The high/med/low indicator is a priority rating; things marked high will be worked on first.

  • Layout and Rendering
    • (high) Poor use/sharing of SpriteBatches in controls .
    • (med) Use of Vector2d for size and position information. Vector2d uses floats so coordinate calculations that result in non-integer values can cause fonts to look blurred.
    • (low) No support for clipping.
    • (low) Labels do not support wrapping or multiple font types (developers can use the framework to create this ability).
    • (low) None of the layout handlers support control wrapping (developers can use the framework to create this ability).
    • (low) No support for table layout (developers can use the framework to create this ability).
  • Events, Callbacks and Input:
    • (high) Consistency between event types, delegates and input handling needs improvement.
    • (high) Spinners do not report the direction of a value change. Without this, sophisticated data validation isn’t possible.
    • (med) Only InputBinding events report the player that caused the event. Indirect events, such as MenuItem.Selected, do not report who caused the event.
    • (low) Keyboard input is currently bound to player 1 because in XNA 2.0 the USB keyboard reports its key presses across all gamepad keyboards.
    • (low) If a child is in focus, the parent isn’t considered in focus.
  • SystemDefaults:
    • (high) VisualDefaults presumes there are fonts called “Fonts/title”, “Fonts/normal”, “Fonts/small”, “Fonts/menu”.
    • (high) No support for overriding the various defaults.
  • Screen support:
    • (high) No generic support for a Screen with focusable elements; current implementation forces the use of Menus and MenuItems.
    • (high) The ScreenManager uses a push/pop mechanism for active Screens. I want to have better support for closing and not favouring pre-created Screens.
    • (med) Need additional Screen types (e.g. full-screen screens, dialogs/pop-ups).
    • (med) ScreenManager only supports a single Screen across all gamepads, instead of allowing one active Screen per gamepad.
  • Networking
    • (high) GameSession is largely a wrapper around NetworkSession and is missing some of the later's abilities. Need to reconsider what to do with this class.

Getting my Lips out for American Thanksgiving

Posted 10/25/2008 @ 06:00:00 PM by Joseph Molnar
Filed under: Food and Drink , Games , Music , Xbox 360

So looks like Thanksgiving is going to be great this year. I now have confirmation that we will have two couples from Toronto, a family of four from San Jose and a friend from Seattle joining us; that makes 12 total.

I must say, I prefer American Thanksgiving to Canadian Thanksgiving. Maybe it is because it starts a four day weekend so more people are able to get together, or maybe it is because it starts the Holiday season (Canadian Thanksgiving is in early October) ... either way, I love American Thanksgiving. We have been doing these Thanksgiving get togethers for 8 years and I think this will be the largest one.

With that many people and no room for Rock Band or Guitar Hero, I decided to pre-order Lips. It is a singing and quasi-dancing game (has motion sensitive microphones) that allows you to use your own music. The game is actually for my daughter (who loves to sing and dance) and I. I just decided to use a people-filled, party-game wanting Thanksgiving as a good excuse to get the game before Christmas.

I want to thank Dan and linda, and Paulo and Gill for taking the time-off to fly down and of course Pete for flying down too. Better get those singing voices and performance moves in place before heading here.

Tales Framework for XNA: Network Helper

Posted 10/24/2008 @ 07:01:01 AM by Joseph Molnar
Filed under: Programming , Tales Framework , Xbox 360 , XNA

The past two Tales Framework posts discussed UI elements. In this post we will move to networking. In particular I’m going to concentrate on the class I built to aid the finding, creating and joining of network sessions.

XNA GS’s built-in networking functions provide a great consistent way to handle both local networked and Internet networked games while allowing you to choose either synchronous or asynchronous mechanisms to find, create and join sessions. What I did was create a helper class to alleviate one of the remaining tricky parts in getting a networked session going ... providing a responsive and thread-safe UI.

The menuing system of a game should be as responsive as possible, so you definitely do not want to use XNA's synchronous network find, create and join methods in direct response to user input. Even if you put the find, create and join calls in a separate thread or you use the asynchronous calls (which use separate threads when calling your callbacks) you still need to synchronize access to any data you share with the UI thread and manage and ensure you never try to create a NetworkSession and AvailableNetworkSessionCollection at the same time.

The GameSessionHelper class handles these tricky parts for you. For example, users can start a find operation and then immediately start a create operation and not have to wait between these two steps.

If you are going to use the GameSessionHelper class, these are the important steps:

  1. Subscribe to the GameSession.Helper.XXXFinished and GameSession.Helper.XXXErrored events.
  2. Call the GameSession.Helper.XXXStart methods to start an operation.
  3. In the menu’s Update or Draw method, call the GameSession.Helper.Update method. If new network data is available the call to GameSession.Helper.Update will cause either the XXXFinished or XXXErrored events to fire.
  4. When you close the menu call the GameSession.Helper.Clear method.

Here are the complete details of what happens when following the above example  and steps:

  1. User Action: User goes to the 'find network game' menu and starts looking for a network game.
    • Game Code: When the menu is created you should register for the GameSession.Helper.FindFinished and GameSession.Helper.FindErrored events. When they start looking for a network game you call GameSession.Helper.StartFind. The menu's Update method should continually call the GameSession.Helper.Update method.
    • Tales Code: The helper class asks XNA to perform a find operation.
  2. User Action: Use goes back, closing the menu before the GameSession.Helper.FindFinished or GameSession.Helper.FindErrored events fire.
    • Game Code: When the menu closes you should call GameSession.Helper.Clear. You should continue to call the GameSession.Helper.Update method.
    • Tales Code: The helper is still waiting to hear back from XNA libraries so it queues the request to clear the data.
  3. User Action: User goes to the 'create game' menu and creates a network game.
    • Game Code: When the menu is created you should register for the GameSession.Helper.CreateFinished and GameSession.Helper.CreateErrored events. When the user creates the network game call the GameSession.Helper.StartCreate. In the menu's Update method you should continually call the GameSession.Helper.Update method.
    • Tales Code: The helper has not yet heard back from the XNA framework on the initial find call so it queues up the request to do a create.
  4. User Action: User waits for the create game to start.
    • Game Code: Continue to call the GameSession.Helper.Update method.
    • Tales Code: The helper will eventually hear back from the XNA framework for the initial find request. The helper clears out the data, in this case the AvailableNetworkSessionCollection. Then the helper starts the game session create operation. Once the session is created the CreateFinished event will fire.

The above shows the user only waited during moments when they initiated a network request. The UI was fully responsive; to the user it felt like they were canceling or starting a new operation when in fact the old operation was completing in the background.

 

This is a pretty detailed look at the GameSessionHelper class. Too much code is required to provide an example in this post but the sample I'll be providing with the framework should provide a good amount of reference code.

Tales Framework for XNA: Input and Focus

Posted 10/18/2008 @ 10:00:00 PM by Joseph Molnar
Filed under: Programming , Tales Framework , Xbox 360 , XNA

In my last post I talked about controls and the control structure within the Tales Framework. In this post I will go over the input handling. The two most important ideas to understand are a) input gestures, which represent things like button presses, and b) how focus impacts input handling.

Input Gestures

When building a GameControl that takes input you need to bind a method to one or more input gestures that implement the IInputGesture interface.

The IInputGesture interface looks like this:

public interface IInputGesture {
    /// <summary>
    /// This method is used to check if we have input in a particular state.
    /// </summary>
    /// <param name="thePlayerIndex">The index of player that we are 
    /// checking input for.</param>
    /// <param name="theGameTime">The GameTime for the input update.</param>
    /// <returns>True if the expected input occurred.</returns>
    bool MatchGesture( PlayerIndex thePlayerIndex, GameTime theGameTime );
}

A gesture’s MatchGesture method simply checks some state, like a pressed button, for the specified player and if the state is true the method returns true.

For example, this is a simple gesture that detects if a button was literally just pressed:

public class ButtonDownGesture : IInputGesture {
    private readonly Buttons _buttons;

    /// <summary>
    /// Constructor taking the buttons in question.
    /// </summary>
    /// <param name="theButtons">The buttons to check to see if they
    /// were pressed.</param>
    public ButtonDownGesture( Buttons theButtons ) {
        _buttons = theButtons;
    }

    /// <summary>
    /// The buttons to check.
    /// </summary>
    public Buttons Buttons {
        get {
            return _buttons;
        }
    }

    /// <summary>
    /// This method checks to see if the configured buttons were
    /// just pressed.
    /// </summary>
    /// <param name="thePlayerIndex">The player index being checked.</param>
    /// <param name="theGameTime">The GameTime for the checking.</param>
    /// <returns>Returns true if the buttons were just pressed.</returns>
    public bool MatchGesture( 
        PlayerIndex thePlayerIndex, 
        GameTime theGameTime ) {
        
        bool returnValue = false;
        int index = ( int )thePlayerIndex;

        if( InputManager.CurrentGamePadStates[ index ].IsButtonDown( _buttons ) &&
            InputManager.PreviousGamePadStates[ index ].IsButtonUp( _buttons ) ) {
            returnValue = true;
        }

        return returnValue;
    }
}

The MatchGesture method uses the InputManager. The InputManager stores the current and previous states for gamepads and keyboards.

Developers can create their own gestures but the framework includes the critical gestures. There are simple gestures for detecting that a gamepad button or key was just pressed or just released, and there is support for more complicated gestures that only return true periodically while a user holds a button or key down.

Binding Gestures

So how do you use gestures in your controls or menus? GameControl has a protected method called BindGestures that takes a delegate and set of IInputGestures. By default the framework will automatically call the MatchGesture methods on the bound gestures and if one of the gestures indicates a match the delegate is called. Advanced framework users can also manually check gestures by using the InputManager.

This snippet of code from a sample spinner control shows the binding of gestures.

public class SampleSpinner : MenuItem {
    // <snip> 

    /// <summary>
    /// Initializes the left/right analog stick/d-pad 
    /// as the mechanism to select next/prev option.
    /// </summary>
    protected override void InitializeInput( ) {
        //base.InitializeInput( );
        BindInputGestures(
            this.HandlePrevValue,
            new IInputGesture[] {
                new ButtonDownGesture( Buttons.DPadLeft ),
                new ButtonDownGesture( Buttons.LeftThumbstickLeft )
            } );

        BindInputGestures(
            this.HandleNextValue,
            new IInputGesture[] {
                new ButtonDownGesture( Buttons.DPadRight ),
                new ButtonDownGesture( Buttons.LeftThumbstickRight )
            } );
    }   

    /// <summary>
    /// Handler for requesting the next option.
    /// </summary>
    protected void HandleNextValue( 
        GameControl theControl, 
        PlayerIndex thePlayer, 
        IInputGesture theGesture ) {
        // <snip> 
        // make it go to the next value
        // <snip> 
    }

    /// <summary>
    /// Handler for requesting the previous option.
    /// </summary>
    protected void HandlePrevValue( 
        GameControl theControl, 
        PlayerIndex thePlayer, 
        IInputGesture theGesture ) {
        // <snip> 
        // make it go to the previous value
        // <snip> 
    }
 
    // <snip> 
}

Input and Focus

Another important aspect of input, and making sure that your registered delegates are called, is understanding focus. The framework doesn’t call every single registered gesture for every single control, instead it checks the gestures for the controls that are in focus, and if a gesture isn’t matched it will traverse up through parent controls checking the registered gestures.

I said ‘checks the gestures for the controls that are in focus’. This implies more than one control can be in focus. This is true, however only one control can be in focus for each player. More details on this are discussed below in Advanced Focus.

To put a control in focus, you simply need to set its Focused property to true. Some of the high-level controls will automatically set the focus. For example, the ScreenManager will set the focus on Menus as they are made active while Menus will set the focus of MenuItems as a user moves between the menu options.

Advanced Focus

One of the advanced features for focus and input is the notion of FocusScope. While the default FocusScope will accept input from all players, you can create FocusScopes that control which players’ input will be accepted and processed. This means not only must a control be in focus, but a FocusScope must exist that allows input from the player. This is best explained with the following example.

It is common during game play that if a player hits the Start button the game will load a pause menu that pauses the game and only that same player can hit the Back button to close the pause menu. Input from other players is ignored.

This advanced ability can also be used to bind certain controls of a HUD to particular players in local multi-player games. If you want to use this ability I recommend you have a look at the FocusManager.

The above hopefully has given a good overview of input and focus handling. Additional posts regarding the framework will be coming soon.