Author Archive
I have to admit that over the last few months I haven’t been feeling the blog. I’ve redone my homepage and moved this blog to a subdomain to keep it around, but try to shove it out of the limelight of my existence. That said, I am hoping to start blogging a little bit more [...]
With the help of Jesse Chounard, I’ve made a lot of great changes to the library and put the whole thing up on CodePlex for everyone to enjoy: http://tiledlib.codeplex.com/. Enjoy.
There are times when making a game that you absolutely can’t be lazy. You need to focus and get things done if you ever want to ship. But there are times when being lazy is the best way to solve a problem. Today was one of those times for me.
I’ve started working on a new [...]
In my last post, I showed an extension method for resizing arrays. Today I decided to come up with some more extension methods that I find handy. First up: Fill.
Fill is an extension method I wrote because I’m sick of iterating over arrays to fill them in or alter values. Fill looks like this:
public static [...]
I started working on a new tile system and editor for my ninja game and realized I’m going to want the ability to change level sizes. I store my tile layouts in a basic 2D array which means that my resizing will have to do a bit of moving things around. After a little bit [...]
Today I checked in the first update to Sprite Sheet Packer in a few months. Inspired by a discussion post I somehow didn’t see for a few months and my own realization of the usefulness, I extracted the build process of the tool into a command line application and made the UI tool simply a [...]
A number of the built in types you load through ContentManager in XNA have a Name property. Most (all?) don’t actually set this at any point; it’s just there for you to use. I like to use these names for various things and I’m sick of setting them all manually. So I started out to [...]
Since my last update to my exception handling code that showed how to handle using GamerServices in the exception game after the first game uses it, I’ve found out a much, much better way to handle this scenario. The key here: don’t use the GamerServicesComponent.
The GamerServicesComponent is a very minimal wrapper on top of the [...]
For my new game, I still am sticking with a retro feel of blowing up sprites 4x their original size to give them that blocky look. However, unlike Pixel Man where I did this as a “post process” by rendering the whole game tiny and scaling that up, I want to scale up each sprite [...]
C# has this ‘yield’ keyword for all sorts of crazy voodoo. Maybe I’m just late to the party, but it seems like this is one of those tricks you learn from really smart people (as I did) and realize that there is so much you don’t know about a language. You might want to start [...]
Let’s talk tech. Presumably, because you’re reading this blog, you’re a geek like me. That means you like shiny new toys and the latest software that hasn’t even reached RTM yet. That means you probably have Visual Studio 2010 (beta or the recently released RC) and/or the Visual C# 2010 Express Edition and want to [...]
Yesterday I twittered out a quiz:
C# pop quiz. Without testing, what is the value of x here: ‘var x = 10; x += x--;’?
A lot of people guessed 19 while a few guessed the correct answer of 20. Looking at the IL posted by TehGrumpyDude, we can see what happens on the stack level when [...]
That’s right! Now that YouTube supports a nice high definition option that lets you actually read text, I went ahead and cut up all of the tile engine videos into segments less than 10 minutes (YouTube’s length limit which is oddly short considering their size limit is 2GB per video…) and put them all up [...]
After quite a lengthy Twitter discussion between myself and a bunch of other folks, I feel like I should use more than 140 characters to try and explain what I’m doing.
First of all, what am I going for with Shader Toy. The goal of Shader Toy is not to replace Render Monkey or FX Composer. [...]
I’ve spent a good amount of the weekend thinking up designs that would allow me to quickly add new UI types into Shader Toy to support all sorts of parameter types. I think I’ve finally got something that works fairly well. What I’ve done is create a very simple interface that represents what a given [...]
One thing I want to support in Shader Toy is the idea of formulaic parameters. For example, any float parameter might define itself in the UI as:
time * 2 + otherParameter^2
Where ‘time’ is a value supplied by my editor for the total running time of the editor and ‘otherParameter’ is some other parameter in the [...]
I made a bit of progress on my parameter editing today. I have the app fully parsing down parameters and retrieving their values from the shader, and have the starts of the UI for editing in place. I’m using attributes (specifically a UIType string) to instruct what UI should appear. I also plan to use [...]
Decided to add a little bit of extra features onto Shader Toy before plunging into the next big step of editing parameters. Basically those features boil down to your standard new/open/save File menu, options for choosing one of a few basic primitives for the model (eventually I’ll support imported meshes, but not yet), a split-pane [...]
Yesterday I started work on getting parameters and annotations from the shader in the hopes of eventually generating a UI with which one can modify them. Annotations will be used much like other shader apps giving hints to the UI such as min/max values, UI types, and other things.
So far it’s coming along, slowly but [...]
A few of my colleagues were discussing F# today and when/where/how it is/isn’t better than C#. I haven’t ever really used F# beyond a very, very brief look at the syntax, so tonight I decided to see what it was all about. As a little project, I decided to make Pong with XNA Game Studio [...]
Today I decided to start doing more with VS2010 and .NET 4.0. But I also wanted to do something with the XNA Framework. Sadly you can’t really use VS2010 to make a game using XNA Game Studio since it isn’t supported in VS2010. So I figured I’d make some sort of WinForm editor tool. I [...]
After seeing a post on the XNA forums about adapting an algorithm for generating random spaceships, I decided to give it a go myself. It was pretty fun and now I have to figure out whether I want to make a retro shooter using random spaceships. Here’s a video of my app generating a bunch [...]
I got an email request asking for help using my interpolator and timer code I’ve been posting. Since I never really wrote up how to use them, I’m going to take a quick few minutes to walk you through the process of using these two classes. Make sure you go to the original post and [...]
It’s been a pretty sweet ride but as of January 11, 2010 I will no longer be a Microsoft MVP. It’s been a great couple of years but I’m moving on to bigger and better things. I have accepted a position as an Software Development Engineer in Test (SDET) on the XNA team at Microsoft [...]
The more I work with these two classes, the more I find needs improvements. Today I decided to address a few issues:
Issue: All Interpolators and all Timers went into one big bucket (per type). This made it hard or impossible to conditionally update certain interpolators or timers. For example, perhaps your game screen is interpolating [...]
One thing that is quite common in games is to utilize multiple buttons for the same action. Most usually you’ll see something like this:
GamePadState gps = GamePad.GetState(PlayerIndex.One);
if (gps.IsButtonDown(Buttons.Start) ||
gps.IsButtonDown(Buttons.Back) ||
gps.IsButtonDown(Buttons.A) ||
gps.IsButtonDown(Buttons.B) ||
gps.IsButtonDown(Buttons.X) ||
gps.IsButtonDown(Buttons.Y))
{
// do stuff
}
That’s quite a pain just to see if one of those buttons are pressed. There must [...]
As mentioned in the comments for my last post on exception handling on Xbox, you can run into some issues with that code with the GamerServicesComponent. If your first game initialized it, you can’t initialize a second one. So how can we solve this issue without having to get rid of the nice message box [...]
What do your physics system and rendering system have in common? At first consideration you might think not much, but you quickly remember that the physics system sets up the position and orientation of every object and your rendering system needs that information to draw things. So how do we utilize a physics system with [...]
This is a quick post since there’s not a terribly large amount to it. I wanted to play around with split screen rendering with SunBurn and found that, as expected, it’s pretty easy to set up.
At this point in the series, we have a tank and a piece of ground being drawn with some shadows. That’s fine if you’re making a 3D model viewer, but games usually have things that move around and animate. This time, let’s go ahead and animate the tank.
In my last SunBurn post we set up a skeleton game for working with SunBurn. Unfortunately that left us with an ugly grey box, which is incredibly sad given what SunBurn can do. This time we’re going to actually get some things on the screen and start seeing just why SunBurn is such a useful [...]
Today I really dug in with Synapse Gaming’s SunBurn lighting/rendering engine for XNA Game Studio and I’m really happy with this product. At first I was afraid that this was one of those packages that required a lot of special code and would wind up with your game engine being highly dependent on and structured [...]
Today I really dug in with Synapse Gaming’s SunBurn lighting/rendering engine for XNA Game Studio and I’m really happy with this product. At first I was afraid that this was one of those packages that required a lot of special code and would wind up with your game engine being highly dependent on and structured [...]
It’s quite common for a game to desire a fixed aspect ratio. Most games on the Xbox 360 are fixed at a 16:9 aspect ratio because they assume you’re on a 720p or 1080p widescreen television. If you are on a television that isn’t 16:9, the Xbox 360 will automatically letterbox your game for you. [...]
I started working on a quick game for the latest XNA 7 Day challenge and wanted to simplify my input a bit. I knew I wanted to centralize it all to make things easier, but I also wanted to make the code simpler when I needed to check input. I’m only doing keyboard input, so [...]
This has been quite a week for game developers, specifically those of the financial constrained type. Two very nice tools have now released in free forms for indie developers:
Unity 3D
http://unity3d.com/
Unity is a great tool. You script in Boo, Javascript, or C# and most of what you do is drag and drop in their full 3D [...]
Echoes+. If you don’t have it, buy it. Yes it’s $3, but that’s nothing for what this game is. Why is this game so good? I’m glad I asked. Let’s take a look through Echoes+ and see why I think more indie developers need to wise up to some of the little things that add [...]
I happened to post an image on TwitPic a few days ago showing progress on a random cave generator I am working on. My task was then to take that 2D layout and start moving to 3D. Today I went at it and I’m quite happy with the results. There is still room for some [...]
We’re a few weeks into the life of ‘Pixel Man’ and we’ve had a number of reviews here and there. They either think it was a great $1 spent or the worst use of money in the history of mankind. So here are some links to various reviews and mentions categorized by whether they liked the game [...]
Microsoft recently launched the Zune HD as their next generation media player. Much like the last generation of Zune, this one comes with support for XNA Game Studio. This time around you need to install three things:
Visual C# 2008 Express (or any other edition of Visual Studio 2008)
XNA Game Studio 3.1
XNA Game Studio 3.1 Zune [...]
Since I designed the Sprite Sheet Packer to be as agnostic as possible in regards to what you might use the output for, some people may not know how to read that file in for use in their XNA GS game. So here’s a quick run down.
First, add both the outputted PNG and TXT file [...]
After a quick response from Cygon of Nuclex, I have been given permission to release his source code (the three files I used) under the MIT license. As such, the whole project is now up on CodePlex: http://spritesheetpacker.codeplex.com/. There’s a binary build in the Downloads section and the source is under Source Code. Let me [...]
Today I asked the Twitterverse if anyone knew of a tool for making sprite sheets. I got a couple suggestions, but none that were good enough for me (in fairness, I was linked this tool, but at that point I was already 90% done with mine). Ziggyware has a tool, but its placement of the [...]
I decided I wanted to do a bit of a tutorial on lambda expressions since someone on Twitter mentioned it. I’m not a master of the syntax, but I do use lambdas extensively in my code so I figured I can at least provide an introductory look at lambdas, their usages, and some examples of [...]
[Edit: Yes, this is #5. Where's #4? Think of #4 as the spoon and the cake. There is no #4; it's a lie.]
[Edit 2: Please read the first comment below. My profit figures are slightly (3 cents per dollar) too high. But they're still close enough that I'm not going to redo the math now.]
A general [...]
I’ll return to my Pixel Man post mortems in a few days. Need to take a break from that writing and do some other stuff. Stuff like coming up with ideas for new games. Which brings me to this lovely image right here:
This is how amazing things start. Or at least this is how my [...]
Once I had an idea and some initial levels, I needed to start rendering them out. My levels were all built to be 18×10 tiles per screen. My guy is 6×12 pixels. So I decided that each tile should ultimately be 12×12 pixels for ease. But I drew them all out where each tile was [...]
Much like your average programmer, whenever I start a project there is an inherent desire to reinvent every wheel possible, and then create some new wheels to invent. It’s a flaw I feel I share with lots of developers; the desire to create things you don’t really need, but think you might. The biggest one [...]
My latest game ‘Pixel Man‘ has been out since last Saturday and has been doing pretty well on the marketplace. I figured now that it’s done, I’ll go into various parts of the development and code for the game to try and help other developers out. I don’t feel like doing one gigantic post mortem, [...]
In a couple of previous posts I showed you how to create a nice little Timer class and Interpolator class that can really help speed up game development by making things like timing actions, performing animations, and adding delays much simpler and more declarative. However, both of those classes suffered from a few flaws. The [...]
I do a lot of my testing work on PC. I also like to take screenshots along the way to show off and just watch a project progress. One thing that isn’t so nice is taking screenshots. Sure there’s the good old printscreen, but that’s a bit annoying to me. I have to open up [...]
A common complaint in the XNA/XBLIG community is around the lack of exposure Indie Games get, especially when compared to other content on Marketplace like XBLA games, DLC, and even the new avatar clothes and accessories. While there is obviously no way to convince Microsoft to stop marketing those items (after all, they likely make [...]
After my last article and some more tweaking, I’ve released a new CodePlex project based on file saving for XNA Game Studio called EasyStorage. Stealing from that project page:
EasyStorage is a library for making it quicker and easier for XNA Game Studio developers to manage the StorageDevice without all the details. EasyStorage uses a simple [...]
Since I’m on a roll (read: all of my games keep crashing so I have nothing else to do) with blog posts, I figured I’d do another lengthy write up of my latest iteration of StorageDevice management code. My last long post was lost in the switch from nickontech.com to the new domain (odd since [...]
One thing I’ve been refining in my free time is my system for debugging games on the Xbox 360. Sometimes you have a debugger and want all uncaught exceptions to bubble up so you can handle them in Visual Studio. Sometimes your game is in the hands of playtesters and reviewers where having them know [...]
Let me start by getting what will be considered the “obvious bias” out of the way. I am an MVP. Probably everyone reading this knows it. If not, now you do. That said I have no obligation to like what Microsoft does with XNA or Xbox LIVE Indie Games. So when you read this, rather [...]
Apparently Boston fears hackers as much as they fear tornados, because their page on cyber security definitely has one bullet point that seems out of places:
If there’s one thing I’ve learned from my work on games, it’s that interpolation is the key to polish in games. What’s interpolation? Put simply it’s the act of changing a value to move from a starting value to an ending value over a period of time. What is interpolation useful for? Let me name [...]
It seems that for one reason or another I was never able to make a good base class for singletons in C#. They usually wound up with requiring that the derived class call some method to set itself as the static instance. Today, while working on building a fresh new library that I’m going to [...]
The best part of playing with other APIs and platforms is finding all the little gems you can bring back to your preferred platform. In this post, I’m bringing some of the NSTimer functionality found in the iPhone (and regular OS X) Cocoa Framework to the XNA Framework.
The NSTimer class is basically like any other [...]
One thing that I like to do is keep my unread posts down to 0 on the XNA forums. But it got really annoying to have to ctrl-click every link to get them all open in new tabs, read them (or just let them load), and then close them. Then repeat for the other pages.
I [...]
I figure one of the larger areas of confusion and trouble is around XML serialization. Lots of people don’t realize the power that can be had or get tripped up by little problems, so hopefully I can do a few of these and try to show some cool stuff that can be done.
The first big [...]
This is a little mini-series I’ve wanted to do for a while. I wanted to go through some common misconceptions about the way things work in .NET in order to help people get through problems instead of working around them. I have a few parts planned, but we’ll see how many I can come up [...]
To conclude my little series on finding closest points, I decided the best thing to do was make an extension method so I can stop writing the exact same code over and over. Plus extension methods are cool. So here’s what I came up with:
public static class Vector2ListExtensions
{
public static Vector2? FindClosestPoint(
this IEnumerable<Vector2> list,
Vector2 pointToCompare)
{
Vector2 v;
if [...]
So after the mess of my last post (see the comments for how it all plays out) it seems that while LINQ is really efficient for small data sets, ordering appears to happen at an O(n^2) rate (or close) of speed. Try sticking a list with a few million items in it through that and [...]
Recently there was a question on the XNA forums about finding the closest object to a certain point. Ultimately an answer was given using a for loop that is probably the best route to go. But I was curious about this and decided to try and write a LINQ query that would do the same [...]
One of the things I wanted to tackle for my framework is the idea of dynamically reloading assets that were altered while the game is running. The first step is just laying down the basic idea of how to accomplish such a thing. So here’s my first stab.
First we define a common base for all [...]
I’m pretty stoked right now. I have my first real render in D3D10. It took me a while to get things set up, but now I’m feeling a bit better. It definitely has shaken some of my conceptions of how things worked in Native Land, but I’m getting there.
So far the two main stopping blocks [...]
Don’t have time to write much right now, but I got myself a cornflower blue window running with Direct3D 10 tonight:
It’s not much, but at least it means my Win32 message loop is working, and all of my Direct3D 10 initialization is working.
I also spent time to make a GameWindow class which handles the window [...]
One thing about my MVP award that always bugged me is that I’m in the category of “XNA/DirectX”. The problem with that is I really don’t know DirectX at all. Sure XNA is a wrapper on top of it and I played around with D3D9 for all of a week or so a while back, [...]
One of the largest issues with XBLCG submissions is the inability to use any controller with a game. This seems odd to me because it’s such a simple thing to fix and is something that every game should support. I should be able to pick up any controller and operate your game given that I [...]
A common flaw in lots of games is reacting to people hitting the “Buy Game” option and not making sure that user can actually purchase content. Almost worse is the common response that all you have to do is make sure the user is signed in to LIVE. That is wrong.
Child accounts, for example, can [...]
While reading through the XNA forums, I noticed this quote. I decided to respond partly because they’re talking about my game, but also because I see two design “philosophies” that I rather disagree with:
I was really wanting more to be going on in Bloc, like the different colors doing different things. I’ve done enough design [...]
One of the trickier parts of starting out with XNA is figuring out what is called when and by whom and where you can put this or that without breaking something. It’s somewhat confusing at first. So I’m going to try to explain the flow of an XNA game as best I can. I can’t [...]
It was pretty exciting seeing Bloc up on the marketplace last week. To see something you made on the Xbox in a place where, literally, millions of people will be able to download and buy is just crazy. But now we’ve reached a new level. Bloc has gotten press coverage.
In a post titeld XNA Preview: [...]
Extension methods are a new feature in C# 3.0 that we finally have full use of in our XNA games now that we are using Visual Studio 2008 (or Visual C# 2008 Express). Extension methods are simply static methods that are able to be used to simulate instance methods of any type. Put another way, [...]
Thanks to Zman of The ZBuffer fame, I got some nice hi-res shots of Bloc in the NXE. I’m so thrilled to see something I made on the Xbox marketplace. It’s just amazing and fantastic. Hopefully you all enjoy it as much as I do next Wednesday when the NXE goes public and you can [...]
This post likely won’t be the most eloquent, but as I sit around playing all sorts of games in review and playtesting, as well as thinking of my own, I figured I’d gather my thoughts and write up the things I think are important when making a game for Xbox LIVE Community Games. These are, [...]
One of the tricks of network programming is simply sending all the data you need. Generally this involves one or more calls to a PacketWriter.Write method. For even a small packet you can wind up with three or four of these method calls everywhere you want to send a particular set of data. This quickly [...]
So Xbox LIVE Community Games is almost live. The submission process has been launched so you can get your game up and ready for the November 19th launch. There is, however, a key factor lots of people seem to forget about:
TESTING
Yes, that got bold and italics because it’s that important. We’ve already seen a few [...]
Lots of people are on the XNA GS 3.0 wagon (and really, why wouldn’t you be?) so a lot of people are starting to ask about XNA GS 3.0/XNA FX 3.0 and which version of .NET it requires. Is it 2.0? 3.5? 3.0?
The content pipeline in XNA Game Studio 3.0 takes advantage of .NET 3.5. [...]
I’ll be honest. As an XNA MVP and, more generally, a guy who spends a lot of time writing code, I generally pass up most XNA books I see. Sure it’d be nice to review them so I can recommend them (or not) to people, but it gets really hard to read through some of [...]
From http://creators.xna.com/en-us/xna_goes_live_october30th:
XNA Game Studio 3.0 Coming October 30!
By now you may have heard that The New Xbox Experience (NXE) will go live globally on November 19, 2008! Xbox LIVE Community Games is a new channel within NXE and will launch in the US, Canada, UK, France, Italy, and Spain at the same time. We’re currently [...]
Ziggy is at it again! This time, you could win an Xbox 360 Elite just for writing a tutorial. There are also Creator’s Club subscriptions up for grabs as well. If you’ve got some knowledge to share, Ziggyware is the place to share it. And while you’re helping out the community, you have a chance [...]
During a recent conversation in #xna, one n00b was whining about the default clear color in XNA Game Studio. Ridiculous, right? Who doesn’t love CornflowerBlue? Apparently this guy.
Anyway, I thought I’d take a quick spin at showing how you can edit the default XNA Game Studio project templates to suit your needs. We’re [...]
I was approached by the Coding4Fun blog to see if I’d be interested in writing an article for their blog. My response? Of course!
So I set off making an article for Zune game creation. Figuring that a lot of people were coming into the world of XNA Game Studio after the Zune game announcement, I [...]
Ok, so that title seemed shorter in my head.
A common theme around the XNA forums is that garbage collections are the most devastating thing on the Xbox 360. If you listened to some people you would think a single garbage collection would cause your Xbox 360 to implode, create a black hole, and be the [...]
Just to be on the safe side, let me preface my article with what this post is not. This post will not show you how to build content on a computer that does not have XNA Game Studio installed on it. This post will not show you the structure of the XNB file nor much [...]
A common issue when working on an Xbox 360 game is that inevitable time when you package up a CCGAME and send it to a buddy, only to have it crash and burn. Generally at this point you’ll feel a series of emotions including one or more of the following:
Annoyance
Anger
Frustration
Blind Hatred
The problem in this case [...]
When I started Bloc, there were only two classes in the game with Update methods: the blocks and the circle. Oh how quickly did I realize that doesn’t even come close to cutting it. Soon after I found myself adding powerups. Those needed an Update method. Orbs? Update method. Heck even the score wound up [...]