'Xbox 360' Articles

Dashboard Widgets - Reach Challenges and Xbox Live Gamercard

,

A few months ago I finally gave in and bought a MacBook Air, and I haven’t looked back. At this point I’m using my Mac for most of my day-to-day computing, and I’m very happy with it. It’s certainly much friendlier to the predominantly Ruby-based web development I like to do. As a first dip of the toes into Mac programming, I decided to try to make a couple Dashboard Widgets. Dashboard is the Mac widget platform, sorta like Windows Sidebar only it came first and it’s a much better platform. Dashboard widgets are relatively full-featured, built on Webkit using HTML and JavaScript, and can be authored with the free DashCode IDE. I found working with Dashboard to be a little frustrating, and it’s clear that Apple isn’t investing much in that space anymore, but it’s still miles ahead of the excruciating experience of developing Windows Sidebar gadgets.

My first widget was an ultra-simple Xbox Live Gamertag widget, which was basically a straight port from the Windows version. Aside from the preferences, which are now on the “back side” of the widget instead of a fly-out panel, not much is different.

The second widget is a bit more complex - it shows the current challenges available in Halo: Reach. Every day (and week) there are new challenges players can meet in order to get credits to buy in-game armor. This widget helps keep that info a keypress away.

Anyway, if you have a Mac, please head on over to my Dashboard Widgets page and give them a shot!

Update: Since Bungie has discontinued their Reach site, I’ve removed the Reach gadget.

360Voice.com Challenges Windows Sidebar Gadget

,

In my post introducing the Bungie Card Windows Sidebar Gadget I mentioned that I was making one more gadget that would be of somewhat more limited interest. Well, I’m finally finished with it: the 360Voice.com Challenges gadget! 360Voice.com is a fun little site that started off by giving your Xbox 360 a blog that would summarize each day’s gameplay. It’s since grown far beyond that, but the feature I like most is the “challenges”. Challenges are a little meta-game where you get some friends together and see who can win the most gamerscore via unlocking achievements over a set period of time.

I do a lot of these challenges, so I wanted to be able to keep track of their progress on my sidebar. The gadget shows you the time left in the challenge, the current standings, and the “live score”, which is the gamerscore each player has earned that day that hasn’t been counted in the official standings yet (gamerscore is sampled by 360Voice.com at midnight PST each day). Once the challenge is over, the winner is given a little crown and the gadget waits for the next challenge.

Fortunately, the 360Voice.com developers had the good sense to provide an XML web services API to their challenge data (and a lot of other stuff too!) so it’s not too hard to make cool things like this gadget that tie into their site. For this project I went ahead and included my favorite JavaScript library, jQuery, and a neat jQuery-based databinding library called chain.js. Using these made development a lot smoother - the old familiar Sidebar bugs and Internet Explorer weirdness was still there, but overall it wasn’t too bad. I’ve specifically designed it to be as light as possible on 360Voice.com’s API too, so hopefully it won’t impact their service.

I think this is the most attractive gadget I’ve made - it’s certainly the most data-rich. I’m really proud of how it came out. I hope everybody enjoys it, and if you haven’t ever done a 360Voice challenge, go start one! Also, if you like it, please rate it at Windows Live Gallery.

P.S.: While I was monkeying around with gadgets, I’ve made some minor changes to my Top Process gadget - the text-fade option is no longer there since it really didn’t add anything, and I may have fixed a couple minor bugs.

Bungie Card Windows Sidebar Gadget

,

I suppose I’m a glutton for punishment. After writing my last two Windows Sidebar gadgets, I really meant to swear them off entirely. They’re really a pain to develop. But when my favorite video game developer, Bungie (recently of Halo fame) launched their new “Bungie Cards”, I knew I had to support them. Bungie Cards are basically like Xbox Gamer Cards, but for Halo 3. I assume when new Bungie games get released, they’ll feed into the Bungie Card system as well. My new gadget is not terribly complicated - it just displays your Halo 3 Bungie Card, in either the small or wide form.

Bungie Card Gadget (thumbnail)

When it’s floating, you can choose either form of the Bungie Card. It’s a little weirder when it’s docked to the sidebar. First, it scales down to fit the sidebar. Then, to see the wide version, you just click on the gadget and the wide card shows up in a flyout. It’s a nice way to keep track of things without taking up too much space. As a bonus, double-clicking on either form will take you to your Halo 3 stats page.

Like the other gadgets I’ve done, this was much more difficult to develop than it should have been. The hardest part was getting the scaled-down card for when the sidebar is docked. At first I just zoomed out the page, like I had done for my Xbox Live Gamercard gadget, but it looked absolutely awful. With the exception of newer browsers like Firefox 3 and Safari, “resizing” an image by just changing the HTML element’s dimensions has always used nearest-neighbor filtering, resulting in a truly horrid image. My first instinct was to try and use the MS-proprietary “filter” CSS property to apply a Matrix DXImageTransform that would do the scaling, since that transform has an argument that’ll get it to use bilinear filtering, which is at least decent. However, Sidebar seems to think that that is a dangerous “active content” operation and blocks it. I tweaked it around for a while before stumbling on a workaround - the BasicImage filter was not blocked, and if I applied any transform at all, the basic zoom scaling would filter the image in a more pleasant way. So right now I’m using an opacity filter set to make the image completely opaque. It’s silly, but it works, and I guess this is what I should expect at this point. Trust me, you wouldn’t have liked it before - the image on the left is the way it looks now, the image on the right is with the original smoothing method:

I actually have another Xbox-related Sidebar gadget in development which is more complex but of limited interest. I hope everyone enjoys the Bungie Card gadget - feel free to send me feedback directly, and please rate the gadget at Windows Live Gallery.

Setting up IIS7 (with bonus PHP instructions!)

, , ,

Every time I try to set up IIS7 on a Windows Vista machine I run into the same series of problems. You’d think I’d have learned by now, but I usually just struggle through the cryptic error messages and get it working one way or another, then forget about it until the next time I need IIS7 on a machine that doesn’t have it. Finally I’d had enough and so I decided to write myself a little guide here so I won’t waste as much time next time. These instructions are basically the same as these, but with additional detail and screenshots.

The first step is to actually install IIS7. Unlike in Windows XP, IIS isn’t installed by default. That’s great, but it can be kind of hard to find it when I need it.

Add or remove Windows features

You’ve got to click this link that says “Turn Windows features on or off” which will (after some time) bring up a big tree of features you can check or uncheck.

Windows Features - IIS

You’re going to want most of “World Wide Web Services”. If you are also interested in installing PHP, make sure everything I’ve circled in red is checked. I just added everything to be safe. What’s important is that you have the ISAPI and CGI stuff. I also checked the IIS6 compatibility bit so that installers for things like PHP might have a better chance at automatically configuring things (fat chance).

At this point you can start dropping things into C:\inetpub\wwwroot and everything should be peachy. I don’t put my sites there since I have them checked out into various folders in my Documents folder. So I need to create some virtual directories to point to my sites. This probably won’t work off the bat - you’ll get 403 errors that complain about wrong permissions or something. You need to make sure that the “IIS_IUSRS” and “Authenticated Users” users have read access to the directory. I’m not sure why “Authenticated Users” needs to be there but it made it work. Make it look like this:

Setting permissions for IIS7

At this point your folder should be accessible from the virtual directory, and any ASP.NET stuff will probably work. If you’re not interested in installing PHP, you can stop here.

Installing PHP on IIS7

PHP doesn’t really play well with IIS. However, we can get it going good enough for local testing of your PHP code. First, go install PHP5 from php.net. Choose to install it as an ISAPI extension for IIS, but don’t worry too much, since it won’t work anyway. Now open up IIS Manager. If you’ve followed the steps above (specifically, selecting the correct “Windows features”), your IIS manager should look something like this:

IIS Manager with ISAPI and CGI

What’s important is that you have the parts outlined in red - the “CGI” icon, the “ISAPI Filters” icon, and the “ISAPI and CGI Restrictions” icon. Those mean the right bits are installed.

Now double-click the “Handler Mappings” icon, and click “Add Script Map…” Fill out the form like this:

Add PHP script map

Make sure it’s pointing to your real copy of php5isapi.dll. At this point your Handler Mappings screen should look like this:

IIS handler mappings

Also make sure that your “ISAPI Filters” screen looks like this:

ISAPI filters

If not, add PHP like this:

Edit ISAPI filters

If you’re running the 64-bit version of Vista like I am, there’s one last thing to do in IIS Manager. Since the PHP ISAPI extension is a 32-bit app, you’ll need to set your app pool to run in 32-bit mode. I’ve already written one blog post on this (to get MySQL working with ASP.NET), and the instructions are the same. Basically open up the app pool’s advanced settings dialog and flip it to 32-bit mode:

IIS 32-bit app pool

If you forget this you’re likely to get errors that look like “Calling LoadLibraryEx on ISAPI filter "C:\Program Files (x86)\PHP\php5isapi.dll” failed".

If you load up your PHP files you’ll probably get something like “failed opening required” blah blah. This is because the PHPRC environment variable isn’t set correctly by the PHP installer. We’ll have to do it ourselves. Go to the Control Panel and search for “env”:

Environment variable link

Now add a System environment variable like this (point it at the directory PHP is installed):

PHPRC env variable

At this point you must reboot your computer to get the environment variable to take effect. Annoying but true. At this point PHP should work, more or less.

I still have some problems with PHP the way I’ve described configuring it. The most obvious is that the IIS worker crashes every once in a while:

IIS worker crash because of PHP

I suspect reconfiguring PHP to be run as a CGI handler instead of an ISAPI module would help here, but it hasn’t been annoying enough to make me go change it. Another avenue to investigate is the new FastCGI support that’s available for IIS7.

The other problem I’ve had is that I have a handful of image files in one of my sites that are managed by Subversion and get locked and unlocked pretty frequently. After I’ve committed an image, it loses its permissions and can’t be served from IIS anymore, and I need to go reset the permissions. That’s pretty annoying, and I’m not sure if it’s a bug in Subversion or in one of my SVN clients (TortoiseSVN and Subclipse).

At least this setup works enough to try things out quickly. I hope it helps anyone else who’s struggling with one of these setups.

Update: You might want to try out the new Microsoft Web Platform Installer which purports to set up PHP along with anything else you might need.

MSN Messenger needs to be able to sign in from multiple locations at once

,

Like most Americans, I’ve been using the AOL Instant Messenger IM network for the last 10 years or so. As I’ve made more friends who prefer other networks, I expanded to multi-platform IM clients that let me sign into all the major IM networks at once. I’ve used Trillian, Adium, Meebo, and Pidgin over the years, and I have active screen names on AIM, MSN, Yahoo, GTalk, and various Jabber services. So when it was announced that the Xbox 360 would include an MSN Messenger client with the Spring update, I was excited. I’m already signed in to MSN all the time, so I thought this would just be another great way to stay connected.

Unfortunately, MSN has a pretty big problem. Whenever you sign in to your MSN account from one location, it signs off, all the other locations. If I’m running Pidgin on my desktop and I open Meebo on my laptop, my desktop gets signed out. And when I start my Xbox, it automatically signs on and knocks everybody else off. The end result is that I’m almost never signed in to MSN, which pretty much defeats the purpose. My buddy list reflects this - my friends are online only when their Xboxes are on. It’s worth pointing out that Yahoo Messenger suffers from this problem too, but it doesn’t bother me as much since I don’t have many Yahoo friends.

MSN getting kicked off

With more and more devices getting IM capability, I can’t see how this restriction can continue. My desktop is always on and signed in to my IM client. My phone will have an always-on IM client. Another one on my Xbox. Another on my laptop. Another at work. And I’m switching between them all the time. And with more and more people using multi-protocol clients, they’re less likely to notice the one account that’s decided to sign itself off. It’s especially frustrating on the Xbox, since it means I can’t just use my laptop to send IMs to my friends while I play and still get notifications on my TV. IM has the potential to be awesome on the Xbox, but not as long as it’s stuck with a one-device-at-a-time protocol.

Xbox Live Gamercard Windows Sidebar Gadget

,

I guess I didn’t learn my lesson with the TopProcess Sidebar gadget, because today when I got home from work I was itching to make another. This time I figured I could stick to something much simpler. I had looked around for a Sidebar Gadget that would display an Xbox Live Gamercard, but none of the ones I wanted fit the bill. So I quickly whipped up my own.

This one is pretty standard. It lets you set which gamertag to use, and you can drop any number of them on your sidebar. When the gadget is docked, it scales down to fit into the sidebar, but when it’s undocked it displays at full size. Really, there’s not a lot to it. Once again, please check it out at my Sidebar gadgets page and go rate and review it at Windows Live Gallery.

Trouble downloading the new Halo 2 maps from an Xbox 360

The new Blastacular map pack for Halo 2 launched today, and being a huge Halo fan I raced to pick them up. I’m happy to see new content coming out for a game that’s over two years old, and Hang ‘em High (remade as Tombstone) was easily my favorite Halo: CE map. I’m also really glad that Bungie decided not to make the maps Xbox 360 exclusive, a move that would have greatly simplified purchasing and downloading the maps at the expense of fragmenting the player base between Xbox 360 players and original Xbox players.

Blastacular Map Pack - Tombstone

I chose to download the maps to my Xbox 360 (I love the 720p upsampling), but the purchase process was not particularly smooth. When I tried to buy the maps, I got this message: “Premium purchases are not enabled for this Xbox Live account”. This was a confusing error since I’ve bought plenty of things through Xbox Live Marketplace before without any problem, and I knew I had no parental restrictions in place. My friend Mark figured it out though, and clued me in. Like many Xbox 360 users, we’d created Xbox Live Silver accounts in non-US regions to get access to foreign game demos. This came in really handy back when the Chromehounds demo came out everywhere but in the US. However, for some reason it messed with the backwards-compatibility-mode Xbox downloader. I’m not sure if it’s because the accounts were from a different region, or because they were Silver accounts and the original Xbox has no concept of Silver accounts. Anyway, the solution was to sign in with the Silver account and attempt to purchase the maps. This will fail, but then you can sign in with your regular Gold account and download the maps. Hopefully this fix will let more people enjoy these great maps.

Getting Windows Media Center to stream DivX/XviD to an Xbox 360 from Vista x64

,

I’ve been spending the past couple weeks playing with a brand new machine I made for Windows Vista, and it’s been great. One of the things I’ve been looking forward to the most is Windows Media Center. Aside from the fun I can have developing WMC addons, I’ve been meaning to try out the Windows Media Extender functionality of my Xbox 360. Hooking up my laptop to my TV every time I want to watch things just doesn’t cut it. Unfortunately, I have one problem - most of what I watch is already encoded in XviD format, which the Xbox 360 lacks a codec for.

But that’s not my only roadblock. Being a sucker for the bleeding edge, I decided that my shiny new Core 2 Duo, being a 64-bit processor, should run Windows Vista Ultimate x64. Right off the bat this presented a problem - after installing DivX and XviD, Windows Media Center would complain that any file I threw at it was unreadable. This didn’t make any sense, since those same videos played just fine in Windows Media Player. Perplexed, I happened upon Task Manager, where I noted that Windows Media Center was running in native (64-bit) mode, while Windows Media Player was running in 32-bit mode. The problem was that I only had 32-bit video codecs, and Windows Media Center couldn’t use them from its 64-bit ivory tower.

However, no problem is a problem for very long. Both of my issues can be resolved with freely available software, and here’s how it works. First, you need to install the ffdshow Vista Codec Package. This will put video codecs for just about every known video format onto your machine. No worrying about downloading this codec and that codec - they’re all here. Next, install the ffdshow x64 components. This makes all those codecs usable from 64-bit programs, as well as giving you a handy shortcut that will set Windows Media Player to always run as 64-bit, too!

Now all your videos work in Media Center. To close the gap with the Xbox, you need Transcode360. This app will transcode your videos, on the fly, into a format the Xbox 360 can understand. It takes a hefty machine, but you’ve got a 64-bit processor anyway, right? Once this is installed, just fire up Media Center from your Xbox, navigate to a movie, hit “Info” on your remote, select “More…”, and select “Transcode 360”. It’ll pause for a while as it crunches through the first few minutes of your video, then it’ll start. Voila!

No Xbox Live Arcade Demos - Greasemonkey Script

,

Last night I hammered out a quick Greasemonkey script (poetically called “No Xbox Live Arcade Demos”) to solve one of my pet peeves in the otherwise awesome Xbox.com website. The problem is that while you can check out the list of games you’ve played, and all your achievements in them, it will also include Xbox Live Arcade demos that you’ve played but not purchased. Since you haven’t purchased them, you can’t earn achievements or gamerscore, so it’s kind of useless to have them in the list. All my script does is go and look for games with “0 of 200” points - indicating an Arcade game you haven’t played (or a new one, which is a problem but unfortunately that seems to be the best way to find them). As a bonus, the script also removes these games from your “total games” count, and removes their score from your total possible gamerscore. The total gamerscore thing in particular annoyed me, since you’d have to buy every demo to realize that “potential”. The script also works on the “Compare Achievements” page, removing any Arcade games that neither you nor your friend have played from the list. I hope everybody enjoys this!