2012-2013-Magnetodroid


Class Organization

Lab Sessions

Project Gallery

percent right percent edit SideBar

2012-2013-Magnetodroid

Magentodroid

by Diederik Jan Lemkes and Jente ten Hoeve

Talking sensors

(Ab)using sensors in our mobile phones was the first idea that came to us, probably because both having Android phones was the only technical device that we have in common. However, nearly all sensors have been used once before. Nearly all, have been abused before. Except for the magnet sensor that tells your GPS in which direction you're headed. This is where our idea came to life: why not create an application that is to be (partially) controlled by a magnet? What better way is there than creating a little game to demonstrate the ability to use a magnet as an input device. Building an Asteroids game became our goal, MagnetoDroids was its name. To make it more interesting, our second goal was to create a distributed multiplayer game that offered 'field-extensions'; positioning two phones side by side extends the field so that every object can fly from screen to screen.

Tech talk

Using Android means building your application in Java. Besides standard Android libraries and Gson to parse Json objects we did not use any other resource. Controlling the spaceships happens by first calibrating the magnet after which movements are mapped into 'control events' if applicable. Thrust, Left and Right events are being generated by the magnet. The Fire event is created by touching the screen. The movement events make the spaceship turn or move by a predefined amount of degrees/speed increase.

On the multiplayer part, we have a host and a client role. The host keeps track of the administrative part and the client sends out data if needed. The traffic created is based on events as well. We distinguish multiple events such as scoring, moving object to other screen, live in/decrease etc. This keeps the traffic as low as possible. However, it can become chaotic when a player is controlling its spaceship that isn't on its original phone. The created control events increase traffic significantly.

Results

In the end a fully functioning Asteroids game has been made. Controlling spaceship can done through both touch and magnet input. After playing a while, we concluded that it can be fun, controlling your game with a magnet, but that there is much 'noise' in the input data that needs to be dealt with; the earth is annoyingly full of magnetic sources. We have spent lots of time on dealing with extreme values, but we will never succeed in a 100% exact mapping.

As for the multiplayer, we started off with the idea that multiple players could place their phones side by side and could start playing without the need for a server. However, while designing, as a result of the distributed approach we came across such an amount of use cases that needed to be dealt with that we decided to restrict the distributed part to two players max. As a result of that design decision, we have been able to create the multiplayer gameplay as we initially wanted.

Recent Changes (All) | Edit SideBar Page last modified on February 26, 2013, at 02:48 AM Edit Page | Page History
Powered by PmWiki