Posts tagged ‘XNA’

The Beginning of the End

So yesterday Microsoft announced it’s turning off XBLIG. It’s been a great 9 year run, but for those of us that have been keeping track, we’ve been expecting it for a while. Andy posted his thoughts at the end of the blog post, and people like Indie Gamer Chick have commented on it already, so I thought I should add my $.02 on the topic, seeing as how I was one of the guys there at the beginning.

After the announcement at GDC and seeing some of the videos MS released that supposedly showed what XNA was capable of, those of us who wanted to do game development for a living but not belong to a AAA studio got very excited. While what we ended up with in XNA Game Studio allowed us to create almost any game we wanted (except for the inevitable dev that wanted to make an MMO as their first game!) it wasn’t exactly AAA quality. A lot of the devs weren’t exactly AAA developers either and we ended up with a lot of junk released onto XBLIG that gave it a very negative reputation in the industry. There were a lot of great games there but very few gamers wanted to sift through the junk.

Microsoft announcing the first Dream Build Play was another first in the industry. Anyone had the chance to submit a game and win cash and a chance to get their game on XBLA, which meant major exposure. I think the several competitions were a relative success and made many developers’ dream of moving to full-time game development become reality.

While sales data that devs released were all over the place, many games brought in a ton of money for indie standards. Considering costs for indie games aren’t quite up to the 7 figure range that AAA titles hit, many devs seemed to be making out pretty well. I’m not quite sure why, but this didn’t seem to be enough for Microsoft. Support for XBLIG tapered off, both in updates to XNA GS and responses to issues that came up in the community. The XNA team dwindled to nothing and problems with payments and the release pipeline stacked up. For years we couldn’t get a solid answer to what was to become of the XBLIG community.  The writing seemed to be on the wall – XBLIG was dead. Many devs moved on to other technologies and platforms.

Personally, XNA has led to me becoming a twice-published author and tech book editor, Microsoft MVP, and conference speaker. I couldn’t have anticipated what has happened in the past 9 years. While I didn’t become one of the big XNA success stories, I’ve definitely benefited greatly from the existence of XNA and the XBLIG community. I’ve met a lot of great people, got to visit the Microsoft campus several times, and helped out the community in some small way I think.

Although XNA is dead, the community will move on and hopefully continue to create great games. I’ll be there, doing what I can and try to get my games out there for people to enjoy. Who knows, I may eventually become the next great indie game dev. 🙂

Once more into the breach!

So I got that email I was hoping I’d get this morning. I’m once more an XNA MVP. Seven years now. Now I have to figure out what to do this year to keep it. With XNA being the proverbial red-headed stepchild right now to MS, that’s going to be more difficult.

I’ve been planning on looking into other technologies for doing games on Windows 8 so that they would be able to be featured in the Windows Store. That’s probably going to take away some time from doing anything XNA related to maintain my MVP status.

I’m still planning on, and currently taking a break from coding to write this, releasing at least one game on XBLIG. That won’t really help with with maintaining my MVP status, but it could be a step towards becoming a full-time indie game developer.

Note to self: I need to work on some other New Years resolutions besides getting a game on XBLIG.

In any case, I think it’s going to be an interesting year now that we’ve survived the non-existent Mayan apocalypse. 🙂

Game Update and Other Stuff

Well, I didn’t quite get to where I wanted by the end of the month, but at least I made progress. The level editor is mostly done, although not fully tested. The “character” editor is probably 50% done. The plan is to get it completed for the next Dream Build Play, which I think is quite doable.

The squirrel did attack (see my previous post) and I opened up The Agency project when I realized the tileset I was using wasn’t going to work for all situations. I also took another look at Hero Engine to see how easy it was to work with. There’s a cute little bunny farming world that they set up to show how some things are done (quests, menus, area picking, etc.). I would need to read a lot more of the documentation to find out if it’s a truly viable solution for a spy game like I’ve been fooling around with, especially since it would be just me working on it at the moment.

A huge (to me at least) thing that’s happened since my last post is that I’m waiting for a phone interview to be set up with an actual game studio. I keep an eye out every once in a while for positions at various companies just to see how the industry is going and I happened to see positions for which I’m actually qualified! That’s extremely rare since I don’t do C++ anymore. I sent in my resume for a couple of positions and got a reply back from one. I’m hoping to hear back from the other as well but we’ll see. This would be life changing in that I’d have to move, but given my current job instability I’d have to seriously consider uprooting the family if they make me an offer that’s enough to support us, especially since it’s the opportunity of a lifetime. At least I’d have the hope of some potential for growth there. I’m slowly digging myself into a hole at my current job as we’re nowhere near current with technology.

I was excited to see that the local chapter of the IGDA is starting back up with a meeting Thursday. If you’re in the Baltimore area, come out and join in – 7 p.m. at The Green Turtle in Hunt Valley. There’s a ton of talent in the area and past meetings have been pretty awesome so I’m hoping for good stuff this year.

Yet Another Post About XBLIG crApps

Following the link in a review begging tweet on #xna I saw the following in the Notes of an XBLIG peer review submission:

“Here’s a quick and dirty Santa flying game I threw together.”

Time to put on the Grinch costume and respond I guess.

While I realize that holiday themed games usually do a little better on XBLIG, if you don’t care enough to take enough pride in your work to do a quality job why should I care enough to review the game? Yes, you might make a few bucks on the game due to holiday theme-ness, but is it really worth it in the long run?

What’s truly unfortunate is that there are enough crApp developers that games like this get passed with relative ease. If I or other developers that really care about the platform can’t find a reason to fail these crApps, there’s little we can do to stop them from passing. This is the downside to Microsoft “democratizing game development”; they obviously didn’t expect, or didn’t care about, people submitting things like flashlight apps, massager “games”, games that take 2 minutes to play through and don’t have any replay value, etc., ad nauseum.

Hopefully other devs that care about the platform will do the same and pass on submissions like this. Maybe I need to start an Occupy XBLIG! :\

Using the Windows Phone 7 camera in an XNA game

This came up in an AppHub forums post and it seemed to help the person out so I figured I’d post it here for posterity (and the fact that I haven’t posted here in ages 🙁 )

using System; 
using System.Collections.Generic; 
using Microsoft.Xna.Framework; 
using Microsoft.Xna.Framework.Content; 
using Microsoft.Xna.Framework.Graphics; 
using Microsoft.Xna.Framework.Input; 
using Microsoft.Xna.Framework.Input.Touch; 
using Microsoft.Xna.Framework.Media; 
using Microsoft.Phone.Tasks; 
namespace Camera_Test 
    public class Game1 : Microsoft.Xna.Framework.Game 
        GraphicsDeviceManager graphics; 
        SpriteBatch spriteBatch; 
        bool _cameraError = false; 
        SpriteFont _font; 
        Vector2 _errorLocation; 
        Texture2D _texture; 
        Rectangle _rect; 
        public Game1() 
            graphics = new GraphicsDeviceManager(this); 
            Content.RootDirectory = "Content"; 
            TargetElapsedTime = TimeSpan.FromTicks(333333); 
            InactiveSleepTime = TimeSpan.FromSeconds(1); 
            TouchPanel.EnabledGestures = GestureType.Tap; 
        protected override void LoadContent() 
            spriteBatch = new SpriteBatch(GraphicsDevice); 
            _font = Content.Load<SpriteFont>("font"); 
            _errorLocation = new Vector2(25, 25); 
        protected override void Update(GameTime gameTime) 
            GamePadState state = GamePad.GetState(PlayerIndex.One); 
            if (state.Buttons.Back == ButtonState.Pressed) 
            if (TouchPanel.IsGestureAvailable) 
                if (TouchPanel.ReadGesture().GestureType == GestureType.Tap) 
                    CameraCaptureTask cameraCaptureTask = new CameraCaptureTask(); 
                    cameraCaptureTask.Completed += new EventHandler<PhotoResult>(cameraCaptureTask_Completed); 
                    catch (InvalidOperationException ex) 
                        _cameraError = true; 
        void cameraCaptureTask_Completed(object sender, PhotoResult e) 
            if (e.TaskResult == TaskResult.OK) 
                _texture = Texture2D.FromStream(graphics.GraphicsDevice, e.ChosenPhoto); 
                _rect = new Rectangle(50, 50, _texture.Width, _texture.Height); 
        protected override void Draw(GameTime gameTime) 
            if(_texture != null) 
                spriteBatch.Draw(_texture, _rect, Color.White); 
            if (_cameraError) 
                spriteBatch.DrawString(_font, "Camera error", _errorLocation, Color.White); 


Tap the screen to allow a photo to be taken. That photo will be stuffed into a Texture2D object and rendered in the game.

Note: you’ll need to add a SpriteFont to the Content project called “font.spritefont”.

While the person that asked the question says this worked for him, I haven’t tested it. 🙂

XBLIG Games in Game Developer Magazine

Wow, I’m surprised they’re still even looking at the service, but the EIC obviously sees something there. It’s a shame MS doesn’t seem to feel the same way.

Here’s the latest list:

Dead Pixels
DLC Quest
Escape Goat
Four Winds Fantasy
Last Dragon Standing
Mega Shooter 11
Sins of the Flesh
Solar 2

I still think XBLIG could be a great service for indies, but MS has a lot of work ahead of them to make it so. With the recent news of Win 8 further relegating XNA games to red-headed stepchild, along with rumors of desktop apps not being supported at all on ARM devices in Win 8, it’s become more of an uphill battle to keep XNA alive at all, let alone get it improved to allow indies to be successful when using it.

I still remember back when XNA was first revealed and touted as a tool for both pro and indie. It’s fallen a long way since then and doesn’t appear to be making much progress back up the hill. It’s like climbing Everest without half the needed equipment. MS needs to either kill it completely and put us out of our misery or make it a real game development tool that indies can use without fear of wasting their time.

XNA Snake

So I was going through the App Hub forums, randomly locking and deleting threads like normal (well, maybe not so randomly and not really that often relatively despite what everyone says :D) when I came across a post asking how to do the classic Snake game. As so often happens, I thought “This might be interesting to see how quickly I could do this” and went off and started hacking together a basic snake game.

If you don’t know this game, read about it here.

I thought about explaining everything, but it’s relatively simple and you should be able to puzzle everything out rather quickly. If not, post a comment. 🙂

I will say that the one thing that’s likely to trip up someone that hasn’t done rotated graphics is the code to draw the snake sections. I’ll briefly talk about that portion of code.

I decided to have the snake head have eyes because a blind snake is a bit silly:

So if the snake is heading north, nothing special needs to be done. If the snake (or any part for that matter) is heading in a direction other than north, the texture needs to be rotated. This means using one of the overloaded SpriteBatch Draw calls that takes a rotation parameter:

SpriteBatch.Draw (Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Single, SpriteEffects, Single)

The parameters for this overload are: texture, screen position, optional source rectangle, color tint, rotation, origin, scale, effects, and sort depth. The last three we really aren’t going to worry about and will just get default values. The source rectangle will get a null since we’re always drawing the entire thing. The Color will, of course, be Color.White. The screen position, rotation, and origin are the tricky pieces here.

The screen position will depend on whether we’re drawing the texture rotated:

part.Location * 32 + new Vector2(GetOffset(part.PartDirection), GetOffset(part.PartDirection))

The Location member of the SnakePart class we use for each part is a Vector2. Each square of the area the snake can run around is 32 pixels square so we can just multiply the member by 32 and both X and Y values will be multiplied by 32. To that result we then add a Vector2 that will either have both X and Y values as 0 or 16 (the middle of the texture):

       private int GetOffset(Direction dir)
            if (dir != Direction.North)
                return 16;
                return 0;


The rotation parameter is done with a simple function call:

        private float GetRotation(Direction dir)
            float ret = 0.0f;

            switch (dir)
                case Direction.North:
                    ret = 0.0f;
                case Direction.East:
                    ret = MathHelper.PiOver2;
                case Direction.South:
                    ret = MathHelper.Pi;
                case Direction.West:
                    ret = MathHelper.PiOver2 * 3;

            return ret;

The MathHelper class gives us an easy way to get the value for the 3 compass points other than the default North.

The origin point of the texture is another direction dependent value:

part.PartDirection != Direction.North ? _vecOrigin : Vector2.Zero

_vecOrigin is a Vector2 with the X and Y members set to 16.

The complete draw Method of the Snake class that I use looks like this:

        public void Draw(SpriteBatch sb)
            foreach (SnakePart part in _parts)
                sb.Draw(_partGraphics[(int)part.PartType], part.Location * 32 + new Vector2(GetOffset(part.PartDirection), GetOffset(part.PartDirection)), null, Color.White, GetRotation(part.PartDirection),
                    part.PartDirection != Direction.North ? _vecOrigin : Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f);



A little unintuitive maybe, but that’s how it is when you’re dealing with rotated sprites. The big thing to remember is that if you’re rotating the sprite the origin needs to be the center of the texture otherwise the upper left corner. Likewise, the destination also has to be offset by half the width and height of the texture.

Here’s my result of a couple of hours of work. One thing I haven’t implemented is checking if the snake head collides with a part of itself. I had to leave something for you guys to do, right? 🙂 Also, a check should be done to see if the game is over and, if so, the Initialize method of the Game class should be called.

Both Gamepad and Keyboard (DPad and arrow keys respectively) can be used. The snake also increases speed every other fruit that’s eaten. I did this just for testing and it should increase speed a bit slower than that. See if you can figure out how to do that. It should be quickly obvious.

Another teaser

Coming along, should be ready to play in, ohhhh, a year or so. 🙁 Need more free time.



XNA Is Dead, Long Live DirectX

edit: I should have made it clear that the title for this post is a semi-joke. Yes, I know XNA isn’t dead and XNA games will run on Win8 and there’s still the 360 and WP7 platforms. My apologies for any confusion. 🙂

I’ve held off with this post until I had what I thought was enough information to speak intelligently on the topic. I know, that makes me unusual for someone ranting on the interwebz, but that’s the way I sometimes like to roll. 🙂

So XNA games on Windows 8 won’t be able to be Metro-style games. They’ll still run as desktop games so everything is good, right? Not really, in my opinion.

MS had the chance of making XNA a first class citizen on Win8 and finally make the “3 screens and the cloud” mantra that they’ve been preaching the past couple of years a reality, but instead it’s even more of a red-headed stepchild that it has been.

My hope for XNA over the past couple of years has been that the PC would get a shiny new coat of paint by MS overhauling Games For Windows LIVE to make it a Steam competitor and allow XNA games to be submitted to it just like WP7 and Xbox.

Given the sorry state of XBLIG with it’s bugs, shovelware, and lack of exposure that allows XNA games to actually make decent money and the newness of the WP7 Marketplace that means income from XNA games on that platform isn’t much better, I was looking towards the PC to receive some love that would make it the savior of XNA. Sadly, that’s not to be.

It seems there will be a marketplace, but XNA games, being that they cannot be Metro-style apps, will have a Marketplace entry that is just a link to a site the developer designates, which means we have to handle all the nasty business details that the other two marketplaces take care of for us. While that’s not impossible, it means extra work that we don’t have to deal with on the other two platforms, and possibly having to maintain an extra code base for whatever distribution platform is used. It also means that many gamers will probably see the off-Marketplace hosting and either worry about security issues (viruses, payment, etc.) or get the feeling that XNA games just aren’t up to snuff to be allowed to be on the real Marketplace. They probably won’t know, nor care, about the technical issues that don’t allow XNA games to be on the Marketplace. Perception is a killer when it’s negative.

Being Desktop apps on Win8 also means that XNA games cannot take advantage of whatever functionality exists only for Metro-style apps. What exactly all that is, is only speculation at this point, but I’ve found this:


Metro style apps

Native API access through C or C++ or through P/Invoke in .NET. Native APIs projected into C++, C#, Visual Basic, and JavaScript. Third parties can supply environments for additional languages.
Native common controls, with most UI support provided by added frameworks. Can also use DirectX for highly optimized graphics. Rich, native UI support (Windows.UI.Xaml), including direct use of HTML+CSS for JavaScript. Apps written in C++ can also use DirectX.
Full-trust; able to access any system resource, including all areas of the file system. Base-trust, isolated in individual app containers with brokered access to protected resources (those affecting user data, identity, and privacy), and no access to system-critical resources.
Written with the Classic/Desktop SDK using the full Win32 API surface area along with the WinRT API. Written with the Windows SDK for Metro style Apps using the Windows Runtime (WinRT; all languages) API and a small subset of Win32 and .NET (C++, C#, and VB only).
Run with the desktop environment with overlapping windows. Typically, run full screen, or might share part of the screen with at most one other app; operating system chrome appears as needed.
Continue running until user explicitly closes them; can easily run in the background without user interaction, and can be set to launch on startup. Are typically suspended when not in the foreground, unless an app specifically requests background tasks. Those tasks are still subject to user control.
Licensed per machine. Licensed per user with automatic roaming app settings via the cloud.
Open distribution: retail stores, web, private networks, individual sharing, and so on. Distributed through the Windows Store. Apps must pass certification so that users download and try apps with confidence in their safety and privacy. Side-loading is available for enterprises and developers.
Provide their own commerce engines to do trial versions or in-app purchasing. Can provide trial versions and in-app purchases directly through the Windows Store. Apps can also use a custom commerce engine to handle subscription or similar purchases.
Custom anti-piracy, commerce, licensing, updates, and analytics. Licensing, core anti-piracy, and updates provided through the Windows Store; analytics provided through the Windows Store developer portal.
Can generally access system devices such as webcams and microphones, and user data without restriction. Must declare access to needed hardware and file libraries. Unless specifically allowed by user action, such requests are otherwise denied.
Custom install/uninstall processes; allowed to alter the system. Declarative install/uninstall with no customizable steps and no ability to alter the system.
Maintains its own user authentication. Can share a single user sign-on across apps.
Static desktop icons and custom notifications. Live tiles, content tiles, and consistent notifications.
Custom code for cross-app features like search, share, and contact management. System search is limited to the file system. Integrated contracts that allow apps to provide services to each other and to the system, including search, share, contacts app-to-app file picking, Sent To, Play To, and more.


Exactly how much of the Metro-style functionality is useful is going to be up to the developer I guess. There are some things that are actually nice for Desktop apps, but overall the negatives outweigh the positives to me.

There is already talk in the community about ways around the outcast status of XNA games. My opinion is that workarounds shouldn’t have been necessary. For whatever reason though, MS thought that updating XNA to allow games to be Metro-style software just wasn’t important enough to be done. Could that change in the future? Sure, but that doesn’t help those of us that want to plan and be ready to take advantage of the market when Win8 is released.

As much as it saddens me, I’m seeing the announcement of Win8 as the last gasp of a dying technology. Hopefully my prophetic talents are completely wrong.

In-game Tutorial?

This subject popped into my head when I was thinking about what would need to be done in my (somewhat) hypothetical spy genre MMO that I’ve been fiddling around with the past couple of week.

When the player starts the game for the first time, their character has just joined the agency they picked and has entered that agency’s training facility. While this training is meant to get the player used to the gameplay as far as the types of missions, how the combat system works, how inventory and skills work, etc.

The question is, however, how much hand holding should the game do for the player? Are MMO players these days savvy enough to just be dumped into the game and expected to survive?

There are a couple of layers that I can think of (in no particular order):

  • A Help screen that labels the UI and provide screenshots of combat and other gameplay with tips on how to do things.
  • Specific missions that stop at points and say “Now do this” with arrows pointing to what needs to be interacted with to do “this”.
  • Tooltip type guides that pop up as the player is playing with an option to stop showing them.

The first bullet would probably be good to have no matter what. While I’d love to do both of the other bullets, the cost (time and effort) to benefit ratio may mean that I’ll have to let the player fumble through with just the first bullet to rely on.

I guess this is what playtest is for though. If I get to the point where I can let someone try the game out and they can’t figure out what to do I may have to revisit this. That means that I’ll have to try to ensure the game is designed to plug something like this in later.

Fun times. 🙂