XSim : XInputSimulator

Track and Field was released to XBLA today – how did I get such a score the day of release? True, we did get copies internally for testing before it went live to the public, but I didn’t practice. I didn’t even use a controller. I used my PC.

Yes, this is one of the technologies I’ve been working on for XNA: XInputSimulator, more commonly known as XSIM. It shipped in this month’s Xbox Development Kit and it – as you probably have already guessed – simulates controller input without having to have a human touch a controller. Very useful for developers. Very useful for testers.

Another couple of Pwnage screen shots after the jump along with the “you can’t use it on retail games” disclaimer…

The screen shots for this post were taken from an Xbox 360 Development Kit.

Why do I stress this? Because I can’t use XSIM on the retail kit at my house. In fact, I can’t even use my regular Randy No Arms Live account on my Development Kit at work. Microsoft is extremely careful in what is retail and what is not. For example, an Xbox Development Kit can’t use any retail Xbox disc. Trust me, if I could, I’d have a 6-digit Gamerscore, because I’d be Achievement-whoring at work! Along the same lines, when we get games in pre-release for testing on Xbox Live Arcade, we can’t take them home or use a retail Live account.

And that brings me to XSIM. What exactly is it? And why would people want a development tool on their home boxes?

XSIM is a combination of two different libraries: one for a PC and one for an Xbox. The PC-based library has five components that allow you to write code into a PC application that will send commands to an Xbox 360 Development Kit. Simply put, say you tell your PC to tell your 360 that Controller 3 presses Up, Up, Down, Down, Left, Right, Left, Right, B, A, Start – the 360 acts like a human grabbed the controller and press that. And yes, we do use that exact sequence in part of our test bed. Each of the five XSIM components serve a different purpose, with regards to input simulation:

  • Random Input Player: The button masher. Turn this component loose on an application and it will randomly press any or all buttons on a controller, based on the parameters you’ve set for it. Excellent for random blasts of input (and for causing chaos in menus and game play – with the right settings I swear XSIM plays Geometry Wars better than I can.)
  • Random State Player: Model based styled of running. You create a file that lists one or more states that a running title can have – the game can then change the state of the player, which causes the player to behave differently, based on the new state. For example, you can have a Text Sequence Player active when a particular menu is showing but have a Random Input Player running during other parts of the game. Very sophisticated but it also needs notification from a game, which may or may not be available during testing.
  • Text Sequence Player: Character-based strings driving a controller. There are 19 digital and 4 analog controls on a 360 controller: this player makes it easy to use them all, based off a fixed format of character-based commands. Great for UI navigation.
  • File Recorder: Records any input on a controller and writes it to a binary-based file. The PC-based version of this component simply talks to its counterpart on the 360; it has the ability to record input from a human or one of the other XSIM players. Very useful for keeping a record of what has been pressed.
  • File Player: Plays back the binary-based files recorded by the File Recorder. Like the File Recorder, this component talks to a File Player module on the 360; it has two different modes of playback which makes it very adaptable, particularly with games that varying frame rates. We often use this for regressing bugs that were originally found – and recorded – with XSIM.

What does all this mean? Here’s the FAQ that just came into my head, when I tried to forget that I’ve worked on XSIM for the last bunch of months:

Can any game be used? Yes! One of the design goals for XSIM was to make it part of the Development Kit’s bits, so game developers wouldn’t have to include any special libraries or worry that our players were consuming game allocated memory. True, if they want to use some of the more advanced features of XSIM (like the Random State Player) or run XSIM without a PC to drive the automation, then there is some custom work to be done… but any title on a 360 Development Kit can be controlled by XSIM. That includes the Dashboard and the Guide! [in fact, we had a running pool to see how long it would take for someone to let the Random Input Player loose in their Dashboard and accidentally change a setting they didn’t expect, like video settings – it happened before we got out of Alpha!]

Can XSIM record game play and if it can, can play it back? In some cases yes, but in most cases no. One of the trade offs made by supporting “any game” without source integration is that XSIM really has no idea what the title is doing. So if frame rate changes, if game play changes, even if the network throughput changes – all of this can throw off a File Player. Obviously we were able to drive parts of Track and Field – we’ve had some success with other games internally as well, but we consider this to be an added bonus. We expect File Player/File Recorder to be used to drive game navigation, especially around menus, rather than driving players in game scenarios.

Will this ever come to retail boxes? Not that I can see. We designed XSIM to be a tool for developers and testers; we haven’t heard of a reason to bring it to retail boxes… aside from illicit Gamerscore boosting, of course. At this point it will not run on any retail box and that is our long term plan as well.

How can I get it? If you’re an Xbox developer with the August release of the XDK, you’ve already got it. There’s a new application included called XInputSimulator Utility – that gives you an idea of what XSIM can do. The source code for this tool is included in the Samples as well; we see the Utility as a good starting point for XSIM and not “the whole thing”. After all, XSIM is a library, rather than an application. It will be up to individual testers and developers to consume it and apply the components to their own custom tasks and test suites.

You should see what it can do with the other Track and Field events… or how it can navigate the Auction House in Forza 2…. and how the Random Input Player acts in a completely different way in Geometry Wars, sometimes lasting 30 seconds and other times lasting for over a minute. Oh wait, I forgot the original reason I was posting this: my team and I will be demoing this technology at next week’s Gamefest.

If you’re attending, stop by the booth in the Expo area and give it a look – we’ll be showing off most of the XSIM components as part of our demos, along with a couple of other things that my team has worked one.

Jump in… but this time, with no hands.


One thought on “XSim : XInputSimulator”


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.