We have a guest blog post today by Claus Höfele, an Engine Programmer at Team Bondi, an independent game developer based Down Under. He has a detailed article featured in Gamasutra.com about how to integrate YouTube upload into a game, much like how it's integrated in Spore. In addition to working with game consoles, Claus has a long history in developing software for mobile devices and is the author of Mobile 3D Graphics: Learning 3D Graphics with the Java Micro Edition.
For some time now, I've been interested in how social networks can be incorporated into games. With the rise of multiplayer games, I believe this will be the next big thing for network-enabled games. Watching videos on YouTube is a favourite pastime of mine, so it didn't take long for me to decide that I wanted to check out the steps necessary to add a video recording feature to my games and share the recordings on YouTube.
Games are often written in C/C++, which allows a programmer to structure the code in a modular way, but also to program to the bare metal when needed. Although YouTube announced a partnership with Sony in which it offered its APIs on the PLAYSTATION 3, there's no publicly available C/C++ API to access YouTube. Fortunately, with the help of the developer documentation, YouTube's HTTP based protocol is straightforward to implement yourself. I used libcurl (HTTP processing), OpenSSL (HTTPS), and TinyXML (XML parsing) to help me with this task.
Wrapping my head around the available authentication options was probably the most difficult task. In the end, ClientLogin was the method of choice because my game demo is distributed as a standalone desktop application.
I was glad to see support for videos encoded in the Theora format on YouTube. Because Theora is a free and open video compression format, it avoids the licensing issues usually involved with video codecs.
I expect more games to follow in the footsteps of Spore's Creature Creator, PixelJunk Eden, and Mainichi Issho, which already include YouTube support. The code that comes with my article on Gamasutra.com [http://www.gamasutra.com/