Class Diagram & MoSCoW Requirements

MoSCoW Requirements

Based on the MoSCoW requirements, we have reached 90% completion of our project and importantly, completed all of the must requirements for our Proof of Concept. With more time to develop the project we could refine the placements of game levels by not allowing it to be placed in invalid positions.
Two key highlights of this project were providing improvements to the HoloLens community while using the Toolkit in this project. Miron Zelina had improved Spatial Mapping using unscaled time. Previously when physics in Unity were paused, the spatial mapping would also stop, which is undesirable as it would be useful to gather spatial mapping data while the game is paused.
Another key change was great improvement of the function which removed surface vertices that intersects the spatial mapping mesh. This improvement was vast, taking the time for completion from 10+ seconds down to 1-2 seconds at most. Please refer to these links to see the changes:
https://github.com/Microsoft/HoloToolkit-Unity/pull/552
https://github.com/Microsoft/HoloToolkit-Unity/pull/566

Work Packages

Here is how we distrubuted our work packages

Class Diagram

Design Pattern

We are utilising several common design patterns in our application – some borrowed from the frameworks we are using, some stemming from our experience. They help other developers recognize our code and us to abstract information away into more extensible concepts as opposed to reinventing the wheel with suboptimal design choices.

Singleton pattern

HoloToolkit-Unity (by Microsoft), the library we are using for developing in Unity for the HoloLens, uses singletons extensively. As such, we also follow their ideology with using their singletons. The singleton pattern is useful for avoiding supplying a long list of references to each object that needs a big manager class. That class can be made a singleton (if it makes sense to do so – i.e. it must be singular and perpetual) and the reference can be accessed statically.

Observer pattern

This is a very common pattern, that we have also employed. Mainly used for event/action listeners, and our project was no different. The HoloToolkit input manager design uses custom interfaces for classes that want to listen to input events from the HoloLens, for example “tap” events, or “manipulation” gestures. This uses a system of global and modular listeners, which objects can use to subscribe to the input manager singleton instance to receive events accordingly to their needs. Also, our game uses events like onGameReset, onPlayfieldPlaced and so on, that objects can subscribe to and dictate their behaviour.

Factory pattern

We have used the weaker version of the factory method pattern, where we utilized functions for automatically generating instances depending on the input arguments to the factory function. This is useful for abstracting away implementation details of how the instances are set up. That in turn helps to maintain a cleaner codebase.

Composite pattern

Unity uses the composite pattern for all its GameObjects. These can contain components, which can provide rendering, collision, animation, or scripting functionality (among other things). This helps to treat collections of objects as a single entity. The advantages include modular behaviour for the objects and a tree hierarchy for the level, where increasingly complex structures can be slowly built from simpler ones.

Prototype

Another design patter borrowed from Unity’s design is that of a prototype – called a prefab in Unity. This allows a prototypical theoretical instance of a GameObject to exist, which can then be copied and it has all (or most) of the required functionality set up. This is supported by the Instantiate function in Unity, which takes as an argument an instance of a GameObject and then copies it with all its components. We use this for example for creating our UI buttons, setting up the basic level with all the prerequisites, for highlighting places suitable for playing our game (like tables), and for quickly designing our levels in the Unity editor.

Testing

Our testing was largely manual due to the nature of our project – a large amount of the features and functionality we desired in our demoes had to have a working actual HoloLens device to be tested. We did also conduct manual tests using the emulator, but we have not yet found a part of the code which could be automatically unit tested. This should change in the future as the project progresses, since we will have a larger codebase, which will also use functionality which is not centered on what the user of a HoloLens sees in front of them. In addition, each of our demoes had a specific set of problems that it faced.

For the asteroid demo, we had to explicitly gauge the user experience – how did the asteroids coming towards the player feel, how did the score look (font, size, etc.), therefore obsoleting most automated testing.

For the rotation-translation demo, we also had to judge mostly the user experience – how did the navigation gestures feel, how did the objects in front of the user respond... However, now it was to a smaller degree. In the future we could verify the rotation matrices between the user space and the object local rotation matrices by unit testing, although that phase of development is yet to come.

A large part of the testing for the marker tracking had to be performed manually, since the tracking has to work in a real-time context. However, some automated testing can be facilitated by passing a still image to the tracking algorithm, together with fake positional data of the HoloLens, and validating that it will track the marker correctly and calculating the right position for it in the virtual world.
We are also planning to do this with a full video to control both the correctness of the code and the performance of the system.

For testing the chess game, the majority of the testing will be conducted under manual testing, it will require checking weather the object (Chess pieces) interact with the board how they should. This will mainly involve unit testing, in making sure each piece of the chess board moves how it should according the rules of Chess. This may be automated by testing the pieces to see if the end up in any illegal positions, but the issue of whether automated testing is viable, will be considered once the chess game structure is fully designed.

Lets Get In Touch!

Feel free to get in touch if you have any questions

Contact Us