How we test?

Testing is the most crucial step in software development. In test-driven development you even start with the tests and do the implementation independent of the test development. In every professional project you can find following test forms:

  • Unit Test – A black box test, where the public API is tested against the specification
  • Integration Test – Several units are combined to a system and in/output and intermediate states are tested
  • Automated UI Test – The UI is operated from an automatic system by injecting events or operating emulated input devices

C# and Unity are offering unit test frameworks, but testing should not be limited to unit tests. For that purpose, we created a submodule in our HAN Lib. It supports unit, integration and automated UI tests. In the first release version we have been concentrated on verification, integration and output. This enabled us to create all tests using the same API structure and even mix tests: for instance, an integration test can be triggered and manipulated by the automated UI test. By observing each unit’s state via the public APIs, the specification and expectation can be verified in detail.

The integration part allows us to hook into our HAN Lib and observe and filter calls and signals. For instance, each test is installing a filter into the Logger to determine if warnings, errors or assertion messages have been outputted to the log. The tester has to explicitly mark each message es expected, else the test will fail.

Our Input abstraction integration allows us to inject input events into the system. This allows us to create Automated UI Tests without messing around with touch and mouse emulation. However, emulation has also its legitimation and we still create also tests with input emulation, as some errors can’t be triggered when the UI is bypassed. Imagine a transparent object that consumes touch events.

In future we want to include reflections and combine it with generic templates to implement a gmock like method, to verify and expect method calls and parameters.

In the next post I will be explaining our Jenkins integration and CI setup.

Movies based on video games – hits and misses

Making movies based on video games has always been a tricky slope to negotiate. There are numerous obstacles that the film makers have to contend with. Firstly, the common notion that some video games simply can’t be made into movies. They are too complex for that and are better left alone. Believe it or not there’s even a legend that states out of 10 movies made on video games only 2 succeed. Second reason is ardent video games fan who don’t like live action rendition of their favorite game but for every such fan there’s one who does want to see such a movie. So without further ado here’s a list of the hits and misses countdown of such movies:

Mortal Kombat – 1995

Loosely based on the mega hit fighting game of the same name, the movie did surprisingly well considering it had a cast of virtually unknown actors at that time expect for Christopher Lambert who played Raiden. If you see the movie now the special effects look quite dated and quaint but back in 1995 they managed to thrill the audience. The movie reached number one spot in American theaters and managed to rake in big bucks for the producers. It was well liked by game fans and critics alike.

Mortal Kombat: Annihilation – 1997

Remember the legend mentioned before? Well it struck and struck hard the second installment of Mortal Kombat named Annihilation. Released two years after the original with a different director helming the project, Annihilation was shredded by critics for its shallow characters, cheesy special effects and mindless action sequences. Even having two of the lead actors reprise their roles wasn’t enough to save face. From a personal perspective I think the decision to cast James Remar as Raiden was the biggest flaw. Remar is a good actor but is not cut out to play the god of thunder and lightning. Financially the movie did manage to make good money but is also responsible for ending the movie franchise altogether.

Hitman – 2007 

The 2007 movie starring Timothy Olyphant as the titular bald assassin was well made and captured the essence of what made the video game so beloved. It was shot on very scenic locations in Russia, Europe and Africa and had the signature action sequences that fans have come to associate with the series. The story was well written and executed on screen and the actors all played their parts quite well. As for critical reception, the response was a mixture of lauding to panning. The movie did quite well financially raking in $99 million against a budget of $24 million. 

Hitman: Agent 47 – 2015

The second outing of the bald assassin raised by the shady “organization” wasn’t a success. Stepping in for Timothy Olyphant this time was Rupert Friend. The plot of the movie though impressive suffers from bad acting and over the top action which ventures far from the essence of the video game. The critics were kind on the movie giving it a low score and calling it a forgettable experience. Suffice to say that Agent 47 has also proved to be a franchise killer for the hitman series.

Silent Hill – 2006

The adaptation of Konami’s world famous video game was a mixture of success in certain departments and failure in others. The film starred some recognizable names from Hollywood and was praised for its eerie visuals, atmosphere and design while panned for meaningless dialog and overly long duration. On the box office the movie did manage to reach the number one spot and grossed a good amount of money. Personally, I think the movie embodied the ghastly and equally horrific town of silent hill perfectly.

Silent Hill: Revelation

The second installment of Silent Hill was a critical flop despite starring big names from Hollywood. Fans and critics alike disliked the movie claiming it to be a mediocre effort with weak character development devoid of scares the first movie had. Commercially the movie was moderately successful raking in more than what was spent on its making.

The above proves that movies based on video games even though very luring are a risky proposition.

Remnants of Naezith

Game development is complex. Over years, thousands of man hours, not ending over hours and grousing partners you will develop your vision.

I am proud that one friend of mine has finished developing his dream. In Remnants of Naezith you are flying with your hook through dungeons. The game will accelerate until your fingers are melting and your eyes are exploding. If you like fast paced games, this is the game you are looking for:

Get it on Steam!

VR is no Rocket Science

VR is the big topic in this decade. Seeing and hearing in third dimension maximizes the immersion of the user. He passes to a new word, a virtual world, so real that somebody with a fear of height should never start a Mount Everest simulation. This next generation of storytelling will change the known media landscape, so that experts are already talking of post-VR depressions, which will be caused after leaving the reality (the virtual one…).

VR is not new. Big companies have tried to establish VR headsets before. One of the best-known products is the Virtual Boy of Nintendo from 1995. With a monochromatic (red-black) display the Gameboy was extended to the virtual reality. But the reality was that nobody wanted it.

Technology evolved and are now able to show more than one color. With high technology, which can be found in every smartphone today, the new headsets are conquering the hearts of the consumers. But this time support is guaranteed. Big companies invest many billion dollars in the development of VR devices and content.

So, you will say: ok that’s great but even a nerd with a Star Trek uniform will not wear this giant VR-glasses. Trust me we do. But what is with the usual consumer? The first generation of VR headsets are mainly made for early adapters and pro-gamers. And in this fields it is a huge success. Especially Sony sold a lot of PS VR devices. The important aspect is that the headsets become smaller and smaller and in a few generations, it will be in the size of your sun glasses (maybe more like you grandfathers glasses with -10 diopter).

VR (and especially MR) will become an important technology in the future. Think about the internet, before 30 years nobody thought that everybody will have it in his pocket. And that even a 3 years old child will use it. And now, if your internet connection breaks you will have withdrawal symptoms after 5 minutes. A same technological jump is awaited for VR, AR and MR. You can imagine it as the technological advancement of the monochromatic television to the unlimited color 3D OLED screen.

So, what is it good for? I don’t play games (if my boss is starring at my screen). Not only games, movies and other entertainment mediums will benefit from this technology. Imagine you customers could see your products, touch them, rotate them, use them digitally before they buy them. Imagine you could see your living room, choose your furniture and move your lawn before even your house would be build. And what if you could take your next vacation to the mars? And I will not mention the ill virtual relationships, that you are thinking about. Everyone, which knows the holodeck of Star Trek, knows that we need it.

VR is already here and every smart research and development facility tries to find ways to use it. The question is not for what, it is how much cost it. We live in a time with smart tools and optimized development cycles. With the right tools, good ideas and some technical expertise you could create your own virtual world without any expenses. It is no rocket science. But this will be topic of my next blog entry. Stay tuned.

Web 2.0 on Steroids -2-

The name of Unity3D may implies that it is only a 3D engine, but Unity is much more. It can be used even without any interface, for example as a background service or a game server. The 2D and 3D capabilities of Unity are sharing the same technology. Your output is rendered in 3D, even if you target only 2D. The hardware acceleration of 3D makes it so fast, that its worth it to render everything in 3D. On 2D output the z-value of the game objects are neglected, so all objects are appearing on a plane. Most modern games are mixing 2D and 3D content.

User interfaces in Unity are rendered through a separate system. This system is optimized for GUIs and organizes output and user input events. With animation support this objects can be structured and presented in a beautiful way. Every UI element are drawn onto a canvas element. This can be in screen space or even in world space. The drawing process will not differ, but the resulting texture will be positioned according the chosen space.  For static UI elements the screen space will guarantee, that the interfaces will be on the same position, even if the used camera will move or rotate. A world space canvas will result in a user interface, that is positioned in the scene and will only be visible, if the camera is looking at it.

The important question is: Why should I consider using this, if I could use HTML as in the good old days? Do you remember WebGL? You do not need 3D? OK, so it is a question of what are you needing. The usage of Unity worthens only from a certain point. If you reach this point you will benefit from the possibilities of this great engine. But if not, you will hunt dugs with your bazooka. So this article will only be useful if I can provide some numbers and cases, but this will happen next time…

Web 2.0 on Steroids

Emerging new technologies are changing the web from its usual 2D in- and outputs to 3D and virtual worlds. Even smartphones have enough power to project new worlds on the go.  Instead of forming a new web standard, known technologies are recycled to support this kind of spectacular output. This is a blessing or a curse. While developers have not to change tools and their habits, the available possibilities are limited by the legacy. For usual stuff this is enough, but for performance demanding application, as VR, this bottleneck is an important motive to develop platform dependent non-web content.

This weekly blog series will try to discover possibilities and spot on challenging bottlenecks and limitations. I will try to lighten the world of WebGL and Unity3D from a non-technical perspective.

Our first entry will review the technology used to project 3D spaces onto you 2D screen. WebGL is the key technology, that enables the usage of OpenGL in your browser. While OpenGL was the first widespread standard, that enabled 3D on your computer since 1992, WebGL is an extension in your browser, that enables the usage of OpenGL ES 2.0 (WebGL 1.0).

OpenGL is a well-known rasterizer API that generates graphical outputs mainly through a state machine. You set the OpenGL state to the right behavior, set your matrices, send geometrical information, textures to your GPU and start the rasterization, which will be influenced by used shaders. Shaders are really fast GPU programs that changes the visual output nearly instantly.

At the first view, you will detect, that this process is fundamentally different from the dynamic REST approach, where you mainly use events to create the right behavior. And for this event-driven approach JavaScript was designed for. With WebGL two different worlds collides. This is one of the main reasons why this standard is not so popular among web developers. Most times only a graphics programmer can handle the complexity of an OpenGL program.

At this step Unity3D (and other great engines) will come to rescue you from the dark voids of mathematical programming. Unity3D is cross platform engine, that can generate all kinds of visual stunning output in a convenient way. The asset store will help you to build your own development stack and will shorten your development cycles. For implementing custom behaviors, you can use C# or even a modified JavaScript version. This called scripts are attached to game objects, that are your actors in your scene graph. This organization structure will be translated into OpenGL commands and JavaScript logic on your WebGL output.

With bypassing direct WebGL you are able to develop 3D content in a fast, cheap and convenient way. Without to knowing details of the rendering pipeline or mathematical backgrounds of the rasterizing process. This does not mean, that this knowledge is useless if you are using Unity3D. But you can achieve great results without this expertise. And if you need more, there are really good specialists out there, which can help you with your projects.

 

In our next blog entry I will try to show some great use cases for 3D (or even 2D) with Unity3D on user interfaces and on the web.