Events

Deployment Target: Planetarium

Topics
planetarium, asteroids, futubileet, fanfare, chilicorn, space

There's a lot of possible targets for deploying your software: clouds, stores, (IoT) devices, wearables, not to mention the traditional servers and desktops.

We at Futurice had a chance to try something completely new, a planetarium!

Futurice organized its annual birthday party, Futubileet, at Heureka Science Center and its 17.5 meter(!) dome was in our disposal. Childish geeks as we are, we saw no other option than to create our own ultimate Space Invaders experience.

Photo by Sami Mikkola.

Hmm, wait... How do you actually do that?

The gaming part is easy. Back in the day you would have polished your good old vector math books and started drawing polygons with OpenGL, but nowadays bootstrapping a game development project is as easy as downloading Unity3D. There are other great options as well (most notably Unreal Engine and CryEngine), but Unity offers excellent tools with a low learning curve for part-time game developers. Despite its ease-of-use Unity has a built-in physics framework and efficient rendering pipeline along with the possibility to tie all the knots using a UI editor.

The second part requires you to find the correct team. Find the nerdiest 3D designer within the company, the hippest audio guy and you also need one graphics wiz and designer pair, who will add the finishing touch (in this case a flying Chilicorn with a rainbow trail).

And the rest is just build and run, right?

The way digital planetariums work is quite simple in principle, yet complex in detail. They have high-resolution video projectors which each cover part of the dome. Using custom lenses, bespoke calibration and possibly some mirrors the outputs are blended to form a seamless picture that covers the entire dome.

What we had was one Macbook Pro with two outputs. How does this add up? Where can I plug it in? Well, just plug it in. But – because of the asymmetric layout of the projectors and the curved projection surface (dome) – the picture will look distorted. Very distorted in fact!

Calibration. Photo by Sami Mikkola.

Luckily all these distortions can (theoretically) be corrected using a technique called projection mapping which basically means applying some pre-distortion to the picture that “undoes” the distortion generated by the physical surface. And while this sounds like a simple thing to do, in practice there are many variables to take into account. Luckily we found an open source project that was made for "artists" like us: Omnidome. Without getting too much into the details, the software these Berlin wizards have created allowed us to calibrate and blend the projector outputs of the Heureka dome.

So we're cool? Let's deploy already

There's one more catch. How to apply the calibration to the game? What we have is two video outputs and two completely different applications, Futurice Space Academy, our Unity-based game, and Omnidome. How do the frames end up on the wall?

Welcome another open sourced technology: Syphon, and its Unity implementation Funnel. This framework allows us to share frames between processes in real-time. And it worked. Like a charm.

As a finishing touch our sound designer Tuomas Ahva created a triumphant opening fanfare for the game. It can be found as an open source asset in Freesound.

In the end we had eight simultaneous players steering their ships using wireless XBox controllers in this 17.5 meter dome, with their eyes gleaming like little boys and girls on Christmas Eve! Or just spectators lost in the colourful chaos, waiting for the the next asteroid to attack. Either way, it was a lot of fun!

Space Academy in action.

As we were able to build our work on top of the others, we are glad to share what we have created as well. The full source code with setup instructions can be downloaded for free: https://github.com/futurice/space-shooter-heureka – as part of our open source Spice-program. The repository also contains the 3D models created by our designer Suvi Numminen.

Now it’s your turn, off you go Space Cadets!

BR, Captain Markus, on behalf of the whole Planetarium team: Markus, Suvi, Tuomas, Joonas and Maria

PS. Unity can also be used to build Your next platform-independent mobile app. Just ask us, we've already done it.

The Planet of The Chilicorns