ericfaller.com Pithy Quote Goes Here

30Oct/06

Monome Apps

Here's a video (below) of a few of the more interesting monome apps I've made so far (see this post for an explanation of what a monome is).

  • "Grid" game: I haven't thought of a better name, but this game is sort of like Othello or Go. Players play as "light" or "dark" and try to capture the opponent's territory by toggling his/her pieces and then capturing any surrounded squares. It's interesting to play at first, but after playing several people without finishing a game, we determined that it's probably not actually winnable as long as both players always make intelligent moves. But, interestingly enough, a "greedy" AI that plays against itself will often end up winning (and losing), as long as it doesn't get stuck in an infinite loop.
  • "Raindrop": this is a raindrop ripple simulator. You can create ripples by pushing buttons - the more you push, the bigger the ripples. It's pretty cool.
  • Pong: the classic. The resolution (8x8) is a little low, but it actually works pretty well since the computer simulates the board at higher resolution. The main problem I see with Pong is that each player has only 2 inputs (up and down), so it's not using the full power of the 64 buttons, which it seems like good monome apps should.

Here's the YouTube video:

18Oct/06

Monome 40h

I recently got a Monome 40h, which you might recognize from Engadget or Maker Faire. It's a USB grid of 64 backlit buttons (40h, 64, get it? ..is it sad that I do?).

The best part is that it doesn't come with any software in the box, no CD or even a slip of paper with a download URL on it. You have to write your own software from scratch to use it. How awesome is that? It pops up as a USB serial port when you plug it in and it uses a dead-simple 2-byte protocol so it's pretty easy.

So what does it do? It doesn't do anything ... in particular. It does whatever you make it do. It seems that most of the apps people have written so far deal with using it as a sort of MIDI sequencer (see this video for an example).

I have a ton of ideas for cool little games for it, but I'm not yet sure how well they'll work. The main problem I see is that there are only 2 states for the LEDs: on or off. So even a simple 8x8 game like checkers wouldn't work, since you need at least 3 states (5 with kings). "Blinking" could be used as a third state for those kind of games, but I think it would get kind of distracting.

I'm going to start off by making an Othello/Go-type game and a Pong game and go from there.

If I played WoW it could be useful as a gigantic macro pad or something like that, but I don't (fortunately?).

Monome 40h

7Aug/06

Synchronizing Media Center TV shows to an iPod Video

Part of my justification for getting a new iPod would be that it would have video support, and I could use it to watch recorded TV shows while I'm on the bus or waiting in line somewhere. I figured that somebody in the world must have written some software to automatically synchronize TV shows recorded on a Media Center PC to an iPod Video. I mean, right?

Apparently not. Or at least I couldn't find any software to do that, free or commercial. Sure, there are various tutorials for converting MCE videos to iPod-compatible files, but they all involve manually running 3 different programs and then importing the video into iTunes by hand. There must be an untapped marked for an MCE plugin that automatically converts and syncs TV shows to an iPod. Somebody could make a killing here!

In the meantime, it looked like I would have to write my own program to do this. These were the requirements I had:

  1. Plop the iPod into the dock
  2. Go to bed
  3. Wake up, the iPod automatically has all the TV shows I recorded the day before

I wrote a small C# program that does the following things:

  1. Check if I have deleted any recorded shows from the Media Center PC. If so, delete the iPod versions out of the iTunes library.
  2. Find all of the new TV shows that the MCE recorded since last syncing to the iPod.
  3. Take each new show and convert it from a .dvr-ms file to a .mpeg2 file using DVRMSToolbox.
  4. Convert the .mpeg2 file to an MPEG-4 file using ffmpeg, shrinking the video to 320x240 at 512 kbps.
  5. Delete the temporary MPEG 2 file.
  6. Save the .mp4 file into the iTunes video library folder.
  7. Force iTunes to update its library database and sync to any connected iPods (using iTunes Library Updater).

Next I created a Scheduled Task to run MCEiPodSync every day at 3:00 AM:

MCEiPodSync

Now all I have to do is plug in the iPod and go to bed. Sweet! Here is a pic of the iPod playing Full House (it was on while I was testing):

Full House

Here's a link to the source code for my little program if anybody's interested: MCEiPodSync.cs. You just have to switch the const strings at the top to point to the correct path to your Recorded TV and iTunes library folders.

Filed under: General, Programming Comments
30Jun/06

The Adventures of Bruto

The Adventures of Bruto

Amber commented on a previous post, expressing interest in playing the game I mentioned there. Here is a link to download it:

You will need to have the Isis Game Engine installed in order to play. Unzip bruto.zip and double-click bruto.iss to launch it (if you didn't use the Isis installer, run bruto.iss with the 'ivmconsole' program).

You control the dragon and must protect your hometown from marauding invaders. Fly around using the I, J, K, and L keys. Spacebar breathes fire, and the F key sucks in air in order to shoot fireballs (if you don't like those controls, you can edit dragon.iss in notepad and change them). You win after defeating 20 ships, or you lose when your town and castle are destroyed.

If you don't want to download the game but still want to see it in action, here is a WMV video of me playing. Note that the video has no sound because the game has no sound. Here's a low-quality YouTube copy of the video:

Filed under: Games, Programming Comments
30Jun/06

Isis

A couple of people were curious about the game engine behind Osiris, so I have written up a little page about it:

There's not much on that page yet, but it has an introduction to IsisScript and a couple of sample games. There are also links to the installer as well as the source code if you are interested in checking it out.

Filed under: Games, Programming Comments
17Jun/06

Osiris

I've been asked a few times for a copy of Expedition: Osiris, an educational computer game I worked on while in college. Unfortunately some of the images of Egyptian artifacts that are in the game are copyrighted by the university, so the game cannot be distributed publicly. But, I did get permission to create a "public domain" version of the game, as long as all the artifact images were obscured. Today I finally got around to doing it. Here are download links: (they are about 17 MB each)

The system requirements are pretty modest: a 1 GHz processor and a 32 MB video card should play the game just fine.

Here is a medium quality WMV video of me playing the game for a few minutes: Osiris Video. It's a big file but it should stream OK. Here's a low-quality YouTube copy:

The purpose of the game is to teach the basics of a freshman 'Archaeology 101' class. You play the role of a college professor who organizes an Egyptian dig and are supposed to learn how to do the following things:

  1. Acquire funding
  2. Create a team of graduate students, specialists and local workers
  3. Manage the digging process to maximize efficiency and minimize artifact breakage
  4. Fend off attacks from mummies, crocodiles, scorpions, thieves and evil genies
  5. Manage team morale and energy while keeping within the budget
  6. Interpret your findings
  7. Publish your results in respectable journals to increase your prestige

Here are a couple of screenshots:

Osiris 1

Setting up the team

Osiris 2

Managing the dig

Filed under: Games, Programming Comments
11Jun/06

FSAA mini-benchmark

Have you ever looked at the FSAA settings in the control panel for your graphics card and wondered what the real visual difference is between them?

FSAA Settings dialog

I was curious myself and decided to do a mini benchmark test. I pulled up a game I wrote a while ago called "The Adventures of Bruto" where you fly around as a dragon and fend off a naval attack. All of the graphics in the game are vector images, so it is a good visual test case for FSAA:

The Adventures of Bruto

I took screenshots of the game at each FSAA setting level for a comparison. Here are closeups of the castle at 0x, 2x, 4x and 8x:

FSAA 0x

0x

FSAA 2x

2x

FSAA 4x

4x

FSAA 8x

8x

Overall the screenshots seem to confirm the idea that "more is better" when it comes to FSAA, but once you get past 2x the improvements don't seem to be that noticeable. I'll probably leave games on 2x or 4x and bump up other settings like model/texture detail if I need to make a tradeoff.

Filed under: Games, Programming Comments
5Jun/06

LEGO Robot

A few weeks ago I was at the mall and I walked by a LEGO Store. I had heard of these, but I did not realize that there was one nearby. Naturally, I had to go in. When I came out, I had $200+ worth of LEGOs, and a membership in their "Loyalty Discount Card" program.

The most interesting thing I got was a Mindstorms kit. The Mindstorms kit lets you build little LEGO robots out of electric motors, wheels, gears, and things like that. Somehow I missed out on them when I was a kid, but I have them now.

I always wanted to make a wireless rover bot that could drive around the floor and take pictures of things. I was able to make a robot like that in college, but it had a bunch of wires hooked to it for power and control, so it wasn't as cool as it could have been. Now, with the Mindstorms kit I realized I had everything I would need. I could build a little robot out of LEGOs and attach my cell phone to it. The cell phone would direct the robot and send pictures back to my laptop, where I would be controlling the whole thing.

It ended up being more difficult than it sounded, primarily because the LEGO computer could only communicate via infrared, and it was a proprietary protocol (not IrDA), so the IR port on my cell phone would not work. I solved the problem by ripping the IR PCB out of the Mindstorms transmitter, attaching it to a handy Bluetooth serial port, and hooking it up to a RC car battery pack. Unfortunately the IR transmitter required 9V and the Bluetooth receiver required 5V, so I had to add a regulator into the mix, but it turned out OK:

IR Transmitter

Now my phone could communicate wirelessly with the LEGO controller over Bluetooth. Luckily the protocol had already been previously reverse-engineered by a Stanford student with far too much time on his hands, so I didn't have to do that too.

The next thing to do was to build a robot that could house the battery and hold the cell phone up. I wanted it to be able to turn around and rotate in place, so I came up with a 3-wheeled design:

Robot 1
Dragon wings make anything cool
Robot 2

It ended up being a bit top-heavy, but it works pretty well.The last thing to do was to get a video-conferencing program to run on the phone and transmit video back to my laptop. I figured this would be the easiest part of the project, but it ended up being the most difficult, because I had to write my own by hand. I was shocked to find that there were no Pocket PC video conferencing programs that worked with Windows Mobile 5.0 over WiFi. Microsoft Portrait was almost exactly what I needed, but unfortunately it had not been updated in several years and did not work with my phone's camera.

I started from an SDK sample that captured JPEG images and made a little program that sends a stream of images to a PC over WiFi. It's a bit slow since it doesn't use a real video codec, but it's still surprisingly fast. It updates at about the speed of a USB webcam. Here's a screenshot of the PC half of the software:

PhoneCam

Finally I had everything in place and was able to drive the robot around and see where it was going from my computer. Awesome!

Here is a video of me driving it around:

31May/06

Phone SNES

Last weekend I became distressed that the 500 MHz processor in my cell phone (i-mate Jasjar) was going to waste for most of the day, so I decided to do something about it. I searched around a bit and came across PocketSNES, a Super Nintendo emulator for Pocket PCs (in a strange twist of fate, PocketSNES is maintained by somebody who works for the same company I do). When I was a kid, I was (still am?) a huge SNES fan, so this sounded perfect.

Unfortunately PocketSNES was built for PocketPC 2003 (not 2005), and was hard-coded everywhere for portrait-mode 240x320 screens. After fixing a lot of bugs and recompiling with the latest SDK, I was able to get it to work in 480x640 mode:

Legend of Zelda

Now it was more or less usable, but it was very slow. I debugged it and discovered that Windows Mobile 5.0 was using an emulated framebuffer for GAPI games, which was slowing everything down considerably. After poking various memory addresses (and crashing the phone several times - so much for Windows CE memory protection..), I found that the video memory for the Intel PXA embedded video begins at virtual address 0xA87AA000, and is laid out linearly (480x640x16). Replacing the GAPI code with direct video memory access and turning on compiler optimization made PocketSNES run quite fast (even the sound worked pretty well).

Now the only problem was that it was a huge pain to play using the little on-screen keypad. Using the phone's keyboard didn't work too well either since it had a hard time accepting multiple simultaneous button presses. After some more searching, I came across the Chainpus BGP100 Bluetooth gamepad (yeah, they need a new name for it):

Bluetooth Controller

It looks hideous because it's designed to fit around a cell phone (my phone was too big). It was surprisingly easy to set up and associate it with the phone using Bluetooth. The software for it, on the other hand, was very poorly implemented and translated. It had also not been recompiled for Windows Mobile 5.0 either. As a result, there was almost a 1-second delay between a button press on the gamepad and when it was recognized by the game (this was mainly because PocketSNES was using 100% of the CPU). Unfortunately the source code was not available, so I had to re-implement its functionality by hand in order to fix that problem. The gamepad implements the Bluetooth Serial Port Profile (SPP), and it sends sequences of 3 bytes for each button press & release event, so it was actually extremely easy to work with. I just had to create a virtual COM port using the Bluetooth control panel, open the 'file' COM3 and read bytes from it when it was input time.

When that was all done, I was able to play at a comfortable distance from the phone:

Super Mario World

This should be very useful for boring meetings at work :)

Here's a video:

About Me

Eric Faller

Eric Faller

Software Engineer at Facebook
Palo Alto, CA
Facebook Link

Photos

DSC_4215 IMG_0903 IMG_1673 IMG_2532 DSC01973 IMG_1137 IMG_2779 IMG_2441 IMG_2799 IMG_0170 IMG_2051 DSC01178
More Photos..

Recent Posts

Topics

Archives

Site Tasks