So I began working on something I had motivation for instead: some sort of achievement component (they can't actually be called achievements). I figured it would take a few hours at best, or maybe a day. That was 3 days ago. In total, I've probably spent about 15 hours on it. There's a lot to think about.
First, the UI:
- The award notification that pops up/animates at the bottom of the screen
- An awards screen that lets you see all your awards, and the ones you haven't received yet.
- An awards summary on the player selection screen (so online players can see your awards)
Other than the standard tedious pixel-pushing, that's all pretty straightforward. I considered trying out one of the ready-made XNA achievement components found on the web. But the implementation was fairly minimal - just UI. Another one, "Goal Component", was more complete but lacked some features I wanted and didn't include source code (so if there were deal-breaking bugs, I was out of luck).

My main concern was making sure I don't block the UI thread. I don't have any background threads in my game at the moment other than some content preloading at startup. So I thought about implementing a task scheduler of some sort, until I found one made by jwatte on the XNA forums. It seemed solid (and so far so good).
I wanted the process to be as transparent as possible for the rest of my game. So here's how it works.
There is a class that describes all the awards, along with the icon that goes with them. This class also holds other persistent player data such as flags that - when combined together - may yield an award (these flags may be set across play sessions, so they need to be persisted). The class also contains the smarts for figuring out when particular flags turn into awards. I'm kind of breaking OOP principles here - the award class is doing double duty (I've lumped other persistent player data in here).
There is a DrawableGameComponent that shows the animated notifications. It's always around, so it also serves as the logic for responding to "new award" requests, and scheduling load/save tasks (IAwardService).
When a player signs in, the following happens:
- A component is responsible for showing the StorageDevice selector for this player. It has a queue, since multiple players may get signed in at once (the device selector will be shown sequentially in this case). Having a StorageDevice connected is a precondition for doing anything awards-related.
- The IAwardService monitors SignedInGamers until it sees a StorageDevice has been selected for one. At that point, it schedules an award LoadTask (to load persisted awards from disk)
- At some point later, the LoadTask completes and communicates the information back to the main thread.
- Up until this point, any "receive an award" requests have just been queued up. Before starting a SaveTask for them, we need to wait until we have completed our first LoadTask. This way the awards we know about at runtime can't stomp the awards saved on disk. They are merged the proper way.
This seems to work so far.
Next up are the other places in the UI where awards are shown. These are the two screenshots you see here. Originally I based the awards system on my PlayerProfile class. But then I realized this only exists in the context of a NetworkSession (which I use for local games too). But I want awards to be visible before you have entered the lobby. So I had to change everything to be based off of SignedInGamer (which makes much more sense).
Finally, I had to transfer award information to other network players. This was pretty straightforward - just an extra int in the "player info" I send around in the lobby.
I still need to do a little UI polish. And implement some of the remaining awards.

