In the ever-expanding world of Virtual/Augmented Reality technologies, we wanted to create something that would show how quickly an application could be put together with impressive results.
Any fans of the Yu-Gi-Oh franchise will appreciate how cool it was seeing projected monsters fighting, especially wanting one of their own. Sadly, I never did manage to create a full-scale monster fighting stadium in my backyard.
Our group being collective fans of card games all have too wanted to experience virtual monster battles.
We set out to create a relatively small AR wizard fighting game. Here are a few of the features we managed to include in just 24 hours:
- Three ‘types’, Fire, Water, and Earth (think pokémon) would form a combat triangle, allowing for more strategic gameplay
- 6 playable characters
- A basic attack and two special abilities for each character
- Live health, displayed alongside the character
- Attacks bound to character rather than as an overlay
- Active player detection
- Round management for turn-based fights
- Live hot switching!! Swap out a character at any time
Through the magic of the AR framework, Vuforia, we implemented tracking fairly quickly, leaving most of the work down to the actual mechanics/player systems.
For Vuforia to track an image well, there must be a high amount of distortion in the image. For example, compare these two cards:
Fig A: No background, basic model and stats
Fig B: Background to both model and card
Due to the tracking data being based on the grey scale histogram of the image, there must be sufficient variation in tone/texture.
Another issue I ran into was determining which player was which. Originally, the plan was to allow a battle to take place at any angle, allowing for repositioning at any point. This poses the issue of detecting who owns who; there would be no way to determine this without verifying the player’s “deck” at the start of each game, adding a delay to every match.
To circumvent this, I gave ownership of the characters based on world position. This generic assignment meant there was never an official owner of the model, resulting in the need for a constantly static playing field.
Adding a few world-positioned canvases to the characters was the only other step and bam, we have summonable models!
Round management was pretty simple after this; it ensures two players are on the field, waits for both to select an attack move and fires away. If a player selects a move and ‘disconnects’, their status is revoked and cancels the turn, preventing the other player from getting any free hits in.
This project was a bunch of fun to work on and came out looking somewhat polished.
We were honoured to win gold sponsor Capgemini’s prize for innovation, receiving a fancy new Raspberry Pi in the process. Here’s an awkward photo: