Keyhunter Documentation

Keyhunter Documentation.

Keyhunter is a hide & seek multi player game for your smartphone.

Description

In Keyhunter each player starts with one unique key, and has to steal the keys from other players. Only if they collected all keys they can finally hack the central computer and win the game.

Players in range (~ 5 m) are visible to other players, and can be attacked or robbed. If so, the attacker has to wait for the key download to be finished. As long as the download or robbery takes, the victim will be informed and can run away and avoid losing a key. After each attack, even if it failed, the attacker can't attack for ~15 seconds. This is the right time for revenge! The players also should be aware that other visible players in range may not have (a) a single key (b) the keys they need.

If a player stole every key, she or he still has to find the central computer, so she or he is not save from other attacks. Once the central computer has been hacked, the game is over.

Our recommendation

The game we implemented, only takes three players, but we think that the game will make more fun with some more players. We would suggest 10 – 12 players, to make the game more dynamical.

Keyhunter would also be a great massive multi player game, only the key distribution should be fixed, so that each key is present multiple times in the game.

The place were the game should take place is also one important aspect, depending on the number of players the size of the place should vary.

Technical Setup

The Keyhunter app is build with the Ionic Framework. Ionic is an open source, front-end targeted framework that allowed us to build a hybrid iOS and Android app using PhoneGap togehter with AngularJS and HTML5.

The communication with our Estimote Beacons is handled with very handy PhoneGap plugin. The plugin wraps the functionallity for the Estimote iOS SDK.

Setting up the plugin is done by just adding the plugin files. Accessing any beacons in range can be done with some native JavaScript:


    // start looking for beacons
    window.EstimoteBeacons.startRangingBeaconsInRegion(function () {
        //every now and then get the list of beacons in range
        setInterval(function () {
            window.EstimoteBeacons.getBeacons(function (data) {
                //do something cool with the list of beacons
            });
        }, 1000);
    });
            

Further, setting up the devide as beacon can be simply done by calling window.EstimoteBeacons.startVirtualBeacon(). While working with the Estimote beacons, we disovered some inaccuracies. However, if the devide is set up as a virtual beacon, the distance is accurate and in general very robust.

For persistance a CouchDB fork hosted by IrisCouch is used. IrisCouch provides a hosted SASS solution for CouchDB. CouchDB is an easy to use document database that simply can store JSON objects.

By using pouchdb, an open-source JavaScript database that can work offline and automatically synch online with a CouchDB, the Keyhunter app does not require and server-side hosted backend.

The source code is available on GitHub.