Inspired by the physical building game Kapla, Kapl'AR brings Kapla to augmented reality on your phone. Kapl'AR is a physically simulated building game, where you can build any structure you want using rectangular planks. If you want more challenge, build a structure to reach the goal in one of our custom levels!
The motivation that all members share is the creation of a game where creativity can be enhanced through physics simulation in an AR environment. Moreover, the common interest in learning about AR technology and exploitation of the possibilities. This motivation brings us down to the main goal of the project which is the development of a visually pleasing, augmented reality based experience application, to life. The result of this is a physics simulated based building experience in the AR context, namely Kapl'AR.
The game’s core gameplay functionality is the manipulation of gravity so that the placement of the building blocks will interact as realistically as possible. For that reason a game engine that supports both physics simulation and libraries for AR was the best choice. Hence, Unity engine was chosen as the main tool. MS Visual Studio was used for IDE as C# is the main programming language for writing the scripts in Unity. The project consisted of four members, therefore the Trello project management tool was more than sufficient in order to keep track of the user cases and task delegation. Finally, different branches and versions of the code was handled by the git version control system.
KaplAR was built during the autumn semester of 2020 when Covid-19 was active and all KTH education was held at a distance. Group work at a distance proved to be a big challenge, especially for maintaining communication channels and motivation during a long project. Another challenge during the development has been interactively testing and debugging AR applications using Unity. A simple parameter change can take up to 6 minutes to test.
Our project took inspiration and was built on several other previous projects. Here are the three main articles that helped us for the development of Kapl'AR:
Of course, our main inspiration has been the original Kapla game.
There are several things we learned and wish we knew before we started the project:
When working with AR efficient debug tools need to be developed first to ease testing.
Especially when working remotely, meetings should be scheduled regularly and uniformly to keep the project
work active and progressing, and keep the members motivated.
Continuous testing and asking users to play the game is important and many times vital.
We succeeded in creating a fully functional single player building/construction game in the context of an AR application. A full game-loop from “start a game” state to a winning or losing state is present. Two stages are currently available with special features and setting in each of them (you can blow on your phone to create wind in the game in the first one and random earthquakes appear in the second). An inventory system has been created to allow custom blocks with special charateristics in each level. In addition, audio/music control is present. Other advanced physics, graphics and interaction features are present that we will let you discover in the game!
Unfortunately, we had to put aside some ideas, prototypes and non-functional features:
The mesh cut loads an Unity mesh into a half-edge data structure. Given a plane, the user can then cut, or clip, this mesh into two parts along the plane. This feature didn’t make it into the application due to the following reasons: it does not support UV-coordinates, the triangulation algorithm used introduces numerical instability due to skinny triangles, and it is not clear how it would be implemented in the app in a way that makes sense. See the video for a demo of the feature in the Unity editor.
The current version allows the user to place blocks by moving their phone and tapping the screen, but the initial idea was to allow the user to use their hand inside of the augmented reality to move and place blocks. We tried this using ManoMotion, which is a library for Unity which tracks and recognizes hand gestures. Unfortunately, the tracking had several issues of unknown reasons. After many attempts to integrate it into the application, we finally decided to scrap it, as it was taking more time than we thought would be better spent implementing more solid things for the core aspect of the game.
Edvin von Platen
edvinvp@kth.se
I worked with gameplay, interaction, and graphics programming. Including: Code for AR integration, AR interaction, shader for the sun in the first level, the plank cutting mode, and the initial demo and code setup. I also worked on a more general mesh cutting algorithm, allowing one to cut any convex mesh in half, this feature didn’t make it into KaplAR but a demo can be found under the What Didn’t Make It section.
Konstantinos Zioris
zioris@kth.se
During the project, the features that I worked with and ended up in the final demo of the game, was light estimation and audio control as well as continuous testing of the app. More areas I investigated were multiplayer implementation with Sockets but this turned out to be a very time consuming and difficult task to tackle in the given time frame. Also, during the first period of the project, much time was spent in recreating code for graphics programming and interaction of the app, as I wanted to be able to know more about areas that other members did before me.
Marius Lelouard
lelmarius18@gmail.com
My main task on this project has been to create all the 3d models and textures used in the game. I also worked on the implementation of the haptic feedback, the game interface, and the creation of some game mechanics like the inventory system or the winning system when the player reaches the target in a level. Finally, I implemented the special features of the two stages (you can blow on your phone to create wind in the game in the first one and random earthquakes appear in the second). I was also responsible of the creation of this website.
Ted Klein Bergman
tedber@kth.se
My contribution to the finished game was the jelly block, a simulated mesh that reacted to the movement of the block with physics material for the wood and jelly block. I experimented with an iron block as well, but it didn’t provide anything of value so it wasn’t included. At the start of the project I set up a base application in Android Studio running Kotlin integrated with C++ so we could use Google’s ARCore libraries among others. However, we decided to use Unity instead for faster development and easier collaboration. I also worked on bare-hand tracking using ManoMotion, which was scrapped (see What Didn’t Make It).