Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Heard on .NET Rocks!: Frank Savage on Programming the Xbox 360 : Page 2

Carl Franklin and Richard Campbell talk with Frank Savage about his work in gaming software in general, and the XNA Game Studio in particular.




Application Security Testing: An Integral Part of DevOps

NET Rocks! (continued)
Carl Franklin: What confused me was MechCommander and Wing Commander, even though they have "commander" in the name, there is no relationship there company-wise, right? Frank Savage: Correct. Yes, apparently I am doomed to work on commander titles for the rest of my career. So, one of the reasons that I got out the game business, was I [felt that I had said everything] in the Commander genre and I really wanted to kind of move on to something else and…

Carl Franklin: Oh, that's funny. You've made your peace. Frank Savage: That's right you know, and I guess, I said what I needed to say.

Carl Franklin: I love it. Frank Savage: I have explored it.

Carl Franklin: All right let's fast forward to XNA. How did that all come about and how does it relate to .NET? Frank Savage: So, when we started in XNA at Microsoft, now this was back in 2004, when Jay first announced it at Game Developer's Conference…

Carl Franklin: Jay? Frank Savage: Jay Allard, who was head of the Xbox division actually. He had this vision for making game development easy, or easier at the very least. And what could we do to help core game developers, people like EA, Activision, UbiSoft, people like that, to get their games faster, easier onto the platforms that we had, and we realized that while you can make the hardware as easy to work with as you possibly can, it's all about the software. It's all about the tools and the compilers and being able to connect and debug and get profiling information and that kind of stuff readily from the console. Otherwise it's extremely difficult to get any kind of good game done on it. So, initially our task was trying to figure out how to help these guys and what technologies did Microsoft have to bring to bear to be able to do that. As we began investigating that, we actually did a bunch of work on build systems and we did our first kind of hobbyist and enthusiast thing and that we actually bundled up MechCommander 2 all the source, all the content, and posted it as a shared source release and you can still download that from Microsoft today. It's about a gigabyte in size, not small by any stretch of the imagination, but it is the entire game and you can compile the entire game with Visual Studio 2005, using the 8.0 version of C++ compilers.

Carl Franklin: This is MechCommander you said, right? Frank Savage: Right, this is MechCommander 2 that we did here at Microsoft. So, when we released that we found that there was this enormous hobbyist and enthusiast community that was very excited about being able to get their hands on a game, but the number one piece of feedback we got from them was [that getting the game was] cool but real big. They just wanted to do something kind of small…you've given me the Titanic and I need a robot. So we heard that loud and clear from the customer base. [Meanwhile] the .NET Compact Framework Team, who at that time was being lead by Mike Zintel, came to us and said, "Hey, wouldn't it be great if the .NET Compact Framework ran on Xbox 360?" And we said, "Yeah, that would be really nice. Why are you asking us that?" And they said they'd like to divert some resources to doing that. [They wanted a] way to get some alpha kits or whatever, and I said, "You know what? I will drive them to your building." So, that was in August, 2005. By November 2005, they actually had it working on the Xbox 360 alpha kits, and basically…

Carl Franklin: When you say "it" .... Frank Savage: So, they had .NET Framework—a subset of the .NET Framework though Managed DirectX—ported to work on both, on the .NET Compact Framework and the Desktop CLR, running on Windows, a Pocket PC, and the Xbox 360, with almost exactly the same code.

Carl Franklin: Wow. Richard Campbell: It's pretty exciting.

Frank Savage: This excited a lot of people over here as well, and we went, "Huh. Maybe we are going the wrong way on this. Maybe there is something to this whole hobbyist, enthusiast, community thing and maybe we really can't crack it open." Because the biggest hurdle we had, which was the technology, seems to be well on its way to being solved. So, we went back and did a prototype on the actual release, Xbox 360 hardware and that was significantly more challenging than the alpha kits because the release hardware had a very tight security model. On a console we don't people going in and hacking and stealing games and running their own stuff without going through our certification process. So we had to make sure that in putting the .NET Compact Framework on it that we didn't inadvertently, make the Xbox really easy to hack and you can run anything you want on it. Carl Franklin: Yeah, that was a first concern, right? [You don't want] people to stop buying PC's and start buying the low cost Xbox 360s.

Frank Savage: Exactly, so we made sure that the security model was such that the interface to the Xbox title libraries, or what the Xbox hardware can actually do, was very, very, tightly controlled by us and by the .NET Compact Framework team. So, for example today, you can't actually get to the networking at all. There is no multiplayer connectivity right now. That's coming actually in the Fall, but there isn't any right now. So we did that on purpose because we wanted to make sure that we open it up in a way that supports the [Xbox] LIVE business model, you know, meets all he business and political and socio criteria that exist here. Technically it's not hard to do—it's just making sure that we don't ruin people's business models.

Richard Campbell: Doing it in a way that doesn't actually break live or introduce a new class of virus or all kinds of things that go terribly wrong with that. Frank Savage: Yup, exactly. So, they have the user mode Sandbox pretty much up and running so that that CPU that's in the Xbox 360—there are actually three CPU's—there's three power PC cores—each one is running at three gigahertz. There are two hardware threads on each core. All of those can run in a couple of different modes. The mode that the game runs in is essentially kernel mode—it's the boss—it can do anything it wants. We keep the games from doing anything malicious to other games or to LIVE or anything else by going through our certification process. It's a large part of what that does, but again, if we are opening it, it's up to the community. If a bunch of community people can go and create games using the .NET Framework, we want to make sure they can't inadvertently or advertently do anything malicious to people. So, we created the user mode Sandbox that we had a very clearly defined way of getting out of. Part of the charter was also to find a way to make an API that isn't Managed DirectX, which was actually, at the end of the day, a pretty thin wrapper over the existing DirectX functionality in managed code. But let's make an API that's really cross-platform. We had a goal of being 95% compatible between Windows and Xbox, so there was a very high probability that your game would recompile and just run on Xbox 360 after you'd gotten it working on Windows or vice versa.

So, we started off down that line. We also decided, "Look, let's make a framework that's extremely .NET-oriented. One that smells and feels like the rest of the .NET Frameworks do. And let's make sure that we target it for the right audience and the right audience for the first release is the very serious, hobbyist and enthusiast and also the academics and students." So, we've actually had a fair amount of adoption from universities. I'd like to talk about that a little bit later on, but there is a ton of universities already using this stuff. In fact, they were using our beta bits—that's how eager they were to get their hands on it. So the framework component was being built while we were actually finishing out the .NET components and—this is the thing to keep in mind—[there was a] Herculean effort that went on with an incredibly small number of people. That shows you what you can do when you stand on the shoulders of giants. Literally. In March of last year, we had the prototypes up and running and that was it, and we went back and not from scratch but standing on all of this technology that we had lying around, we were able to go from March to December and ship a working version for both Windows and Xbox 360 that allows you to run games on your retail Xbox 360. You don't need any special hardware. You can go to the store and buy one today and connect it to your PC. Your PC can upload your games to your Xbox 360. It can play them. You can debug them on your PC using C# Express. All of that is fully functional and available, and it's been available since December. Carl Franklin: Now is that the XNA Game Studio Express, or is that something else?

Frank Savage: Yes. So, that's the Game Studio Express piece and to run that you need to C# Express first and then we install into C# Express and extend it. Carl Franklin: So, now why only C#? Just curious.

Frank Savage: C# was the most obvious choice for our customer base. We were talking about game developer hobbyist and enthusiasts, which were typically shallow C++ users. So it seemed to map to the C# universe more easily than things like Visual Basic or any of the other .NET languages that exist today. Carl Franklin: So, but it's Visual Studio. Aren't we talking about API's? Aren't we talking about a framework or are you talking about a boat load of source code?

Frank Savage: So, there was actually—Visual Basic actually isn't quite, as .NET-y as it should be. For example, it requires other DLLs to be present from the old VBRun days. Carl Franklin: Like what?

Frank Savage: There is no Visual Basic support on the .NET Compact Framework, for example. Carl Franklin: Wait a minute now. So what exactly do you mean by that? I can write programs in VB.NET for the .NET Compact Framework.

Richard Campbell: I can do that. Frank Savage: But the .NET Compact Framework itself doesn't support Visual Basic as it exists today in the 2.0 iteration.

Carl Franklin: Are you talking about like writing code on my PDA? Frank Savage: Yeah!

Carl Franklin: Oh, well who would want to do that? I mean, I want to write code for the PDA but I don't want to write code on my PDA. Frank Savage: Well, that's the problem, right? We want to run the code on the Xbox 360 and that required DLLs that just weren't present.

Carl Franklin: Do you mean, you want to run Visual Studio on the Xbox 360? Frank Savage: No. The VBRun OCX, DLL, and stuff like that has to be present on the operating system and they are on the PDAs but they are not on the Xbox 360 and we didn't have anyone to port those to power PC …

Carl Franklin: I understand. Frank Savage: ... to make that go. So, Visual Basic got less interesting from that perspective as well and that there was a lot more technical work to do and again we were under a very constrained timeline. We wanted to ship last December if at all possible and we had the tech for C# pretty much done. And again it mapped to the customer a little bit better as well.

Richard Campbell: Now, it's pretty impressive to think this is all Express. So if you want to develop on your Xbox, you don't need to buy anything except an Xbox. Frank Savage: That's correct. And the subscription.

Carl Franklin: So, what kind of stuff can you do and what kind of stuff can't you do with Game Studio Express? Frank Savage: So with Game Studio Express today, the limitations are basically mostly around the networking code. We have APIs that do all the graphic stuff. The graphics APIs are identical between Windows and Xbox. We have input APIs that are identical between Windows and Xbox. You can plug in an Xbox 360 controller's USB into your Windows PC. It will recognize and download the driver and that controller will behave and act exactly like it does when it's plugged in the Xbox 360.

Carl Franklin: So basically you can take a C# DirectX program and port it to the Xbox. Is that what you are telling me? Frank Savage: No. Right now if you use the XNA frameworks that are in the Game Studio Express, they will simply recompile and run on the Xbox.

Carl Franklin: Okay, so the XNA Game Studio Express APIs are kind of like using the DirectX APIs. Is this what you telling me? They are sort of similar. Frank Savage: They are sort of similar but they have been somewhat simplified for our target audience and we've removed or at least hidden away somewhat the functionality that is confusing or hard for people to really wrap their heads around. For example, creating a device in Windows is actually a fairly long and drawn out process today. We'll have to get at the 3D hardware and its magic in our universe. It simply creates the device and maps it to the current resolution of your screen and sets everything up and you are ready to go and you can just start calling update and render.

Carl Franklin: So you took it up a level basically—a couple levels. Frank Savage: Exactly. Yup. We wanted people to not have to worry about it. And again, one of the biggest problems on the Windows side is that there are scads and scads of different kinds of hardware configurations. We've abstracted away a lot of that as well. So there again you don't really need to worry about the hardware configuration. The only thing you really need to worry about today is the shader model implementation on the video cards. We only support 3D cards and we only support 3D cards that have at least Shader Model 1.1 on them.

The conversation continues online at http://www.dotnetrocks.com/default.aspx?showNum=0234

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date