Specific challenges of making cockpit-sharing WiFi co-op a reality.
The kudu is a large antelope found in southern Africa. They are popular game to hunt, especially because their shofar horns produce such majestic and beautiful trophies. But kudu are best observed alive and in the wild - if you are lucky enough to see one. These large animals are powerful, fast, nimble and extremely alert, which can make it very difficult to see one up close in the African bush where one’s smell alone will have them scatter at kilometer distances away. The logo for KuduQ Entertainment features a kudu in front of a large orange sun that also forms the letter Q. The reason for the Q is a story that will have to wait for another day.
When it comes to gaming, I personally always preferred realism, so realistic looking online multiplayer shooters have always been a favorite past time for me. I introduced my father to multiplayer gaming when he was already deep into his sixties. However, I quickly gave up on trying to get him to team up with me in competitive online multiplayer. It just frustrated him. Instead, I set up two sets of comfortable chairs in front of consoles with television monitors next to each other in my basement. We started enjoying competing against each other by racing cars or teaming up in fictitious missions in shooter games that had a built-in capability for cooperative mode over LAN. It worked out great. Just the two of us. In my basement having fun. In fact, we were bonding just like we bonded when he first taught me about fishing when I was only eight or maybe nine. Nowadays kids that age are more eager to spend time inside with an Xbox than outside with a tackle box, and by the way, so do their dads. And in the world of gaming socializing almost always happens remotely it seems. I always enjoyed interacting with people more when we’re in the same room. This online thing with a headset feels very lonely to me. I believe that even today there must be a place for local cooperative play. Why not? The idea of gaming over a glass of wine in the same room. I experimented with my co-op console stations in the basement and inviting and involving other friends. These evenings soon became institutions, similar to a regular poker night - yet, still different. I started building a rather large collection of games for consoles that now span a few console generations. I expanded my man-cave arcade to more co-op stations. For each generation of gaming console I own at least three console units. I also own at least a dual sets of games for each title that allowed cooperative play. I have been keeping a cooperative play arcade in my basement for about as long as the concept existed.
Sadly, cooperative play is quickly disappearing. On consoles, only a handful of those games existed to begin with and only the older ones are still playable. In modern games, cooperative play generally depends on server connections over the internet. The servers are eventually turned off when the game has aged sufficiently. Many of my games have been rendered useless as a result. It is too bad, but it is as if the gaming industry has decided that there isn’t place for cooperative play unless they can control it from start to finish. The other day I counted the number of games that I own and enjoyed that are still playable in local cooperative play mode over LAN. Only a handful remain and then mostly on older consoles. I have yet to find a single game for a modern console that supports LAN based co-op at all.
And so KuduQ Entertainment was born. It's core mission is based on the idea that there is a special place in the gaming industry for local cooperative play where two or more people can get together and immerse themselves together into another world without doing so remotely and without needing a headset, but do so in the flesh. I hope to offer other people the kinds of games to experience the same kind of bonding with their loved ones as I did with my 60+ year old dad.
The idea of creating a helicopter game wasn't difficult to come up with. I was already fascinated by helicopters as a child, and once forced my parents to drive me to the airport when news reached me that Airwolf (from the tv show) might be there. As it turns out, it was. The people in that hangar were very friendly and gave the curious kid photocopies of flight and service manuals and I was allowed to take plenty of pictures. So the first game that I ever created happened when I was a teenager. It was a helicopter game based on the black modified Bell 222 helicopter in the Airwolf tv series. It was a 2D game written in machine code and developed on an Olivetti M24 with 640k RAM, a 8086 microprocessor clocking at 8MHz, dual 5 1/4" 360k floppy disk drives and an amber 640x400 CRT monitor. (On a side note: this particular M24 is still very alive and well today.) I have to say in those days tools, books, languages were not in abundance. There was no such thing as the GPU we know today, GLES or .NET libraries. You counted clock cycles and you conserved bytes if you were doing anything in assembly language. Higher level languages weren't streamlined enough to deliver the performance needed for high quality games. Memory was precious and so were cycles per routine. That computer was also the one on which I flew tens of thousands of hours of Bruce Artwick's Flight Simulator - the original FS that was eventually aquired by Microsoft. My love for helicopters naturally lead to another hobby involving radio controlled flying. I still have one of my first gas engine driven RC helicopters. Nowadays they're mostly electric thanks to advances in battery, motor and electronics packaging technologies. Not long ago one could not get an electric helicopter in the air because the power and energy densities of batteries and small dc electric motors were too low. In other words, a battery-motor combination weighed too much to lift themselves into the air. That has changed. Hence, today we find ourselves in the drone era.
Later in life I became a pilot and eventually the proud owner of my own airplane. Flying is my most treasured hobby. Piloting small airplanes can be very rewarding, but let me quickly add that owning even a small GA aircraft carries no financial benefit whatsoever. One must have other reasons. I have also flown helicopters, and would love to have one. But owning one of these fascinating machines is amusingly expensive. Helicopters, in general, spend more than twice as many hours in hangars getting worked on than the amount of hours they actually spend in the air. It is said that a helicopter doesn't actually fly - the earth just rejects it.
Thus the concept for TeamThunder was born more than a decade ago and many years before the development of the game ever even started a few years ago. I did have a full time job (and still do) that has nothing to do with computers or programming. Learning all the ins and outs of creating an app and all the tools and techniques that go along with it, meant that I couldn't waste a minute of my spare time. Going to bed at midnight and getting up at 4am became routine. Well, not always. Sometimes I had to go to bed after 1 am or get up before 4am to work on the game while spending 50-60 hours a week working a full time job as well. It would not have been possible without a very understanding and supportive wife. But the point is that one should never underestimate the amount of time that one has at one's disposal to achieve one's goals. I always tell people 'you have plenty of time. You have 24 hours in each day and then there's the night too!".
The landscape of software programming has changed a lot since the mid to late eighties, which is when I last engaged in it before getting familiar with Unity. Not only are there new languages, the entire approach has changed. I had to learn about OOP and the event-driven way of thinking, the GPU and an entire suite of tools dedicated to it, languages and libraries to go along with it. It is wonderful. The abundance of information available at my fingertips on the internet is very different from those days when you either had to find the answer in one of the few books on the particular topic that so happen to be on your shelf, or, you had to figure it out yourself - perhaps make some phone calls in desperate situations. I may not have mentioned it before, but I grew up in a country that was placed under sanctions by the USA at the time. So I also had to work my way around embargoes to get my hands on hardware, technical books and software. There was a language barrier, and international phone calls to USA were too expensive to even consider. So, for me learning to use Unity as a US citizen in the USA was dreamlike. Having a Unity community to pose questions to was another new experience. Besides my own struggles to get used to a modern way of programming, the technical challenges that lay before me were plenty, so let me dig into those:
i. Graphics vs. Audience
Modern mobile devices are powerful and able to handle quite sophisticated graphics. I had a lot of confidence in the co-op feature, and since this was my first game for mobile, I decided to go for more modest graphics. The map was designed with great care having mountains as obstructions between map areas offering easy and natural occlusion objects. All assets are super low-poly and besides having to learn how to skin all the assets, the development involved a lot of baking and custom shaders. For example, the camouflaged tarp that covers the helicopter sitting in the main base consists of 18 vertices, and each of the the wooden guard towers consist of 16 vertices in total with ladders and all.
From the beginning, I perfected the technique of skinning awesome looking assets having very few vertices. The full game is playable on iPhone 4S and, believe it or not, runs quite well on iPhone 4 - although it does suffer some framerate drops on certain missions that have lots of vehicles and associated particles effects and physics.
Over 200 sound bites were recorded for the game. These include sound effects as well as spoken lines. The voice recordings were passed through custom sound filters to produce the distinctive aviation radio effect. It is not difficult to do, but it can be time consuming.
While there’s a lot of material out there on developing multiplayer capabilities, helpful literature on setting up networked cooperative play was almost non-existent. I didn’t purchase any plugins and developed my own networking code. TeamThunder connects automatically to a nearby device over the same WiFi connection. The user only has to specify whether he wants to host a game or join a game. Several co-op games can be run on the same WifFi network.
iv. Coop Feature
I felt (and still do) that it is the WiFi cockpit sharing feature that truly sets TeamThunder apart from all the other helicopter games out there. What’s attractive, is the ability for two people to sit in a room next to each other and play a game together, flying the same helicopter, each on his own device. One the pilot. One the gunner. Communicating. Blowing up stuff. One of my prime target consumer markets, consists of all those busy working dads who have little time during the day but want to have something mobile and fun to play together with their boys or girls, perhaps sitting in the dentist waiting room, or killing time while having the car’s oil changed, or right before delivering a bedtime story after a long commute home.
The co-op feature presents a unique set of challenges that are not evident at first. Of course, I had several choices on how to implement the co-op technically. I decided against the idea of a centralized game server since it made little sense to match people one-on-one thus serving and listing half as many games as there are players. Voice communication would have been a must for that scenario too, but virtually impossible on earlier generation devices with what I wanted to support. Coming back to my wider audience criteria, I decided to stick to WiFi LAN instead of internet, so that people can play when they are physically close enough to talk to each other.
v. Some of the Biggest Unexpected Challenges
I had to developed the co-op networking scripts from scratch and I can safely say it was the single most challenging aspect of the game. The game connects automatically requiring only as player input whether the device will host the game or join one. The simple, yet powerful interface doesn’t bother the player with IP addresses and port numbers unless he wants to, because I did leave the ability to manually connect intact. Getting the automatic connection apparatus to start and reset, or detect and handle a connection drop mid-game without crashing the app was no easy feat either.
The next big challenge when adding networking was the added burden of testing. When creating a single player game one already has a lot of testing to do - often by trying all kinds of combinations or possible outcomes to make sure that everything checks out and without crashing. For example, does everything work when this vehicle is destroyed while it is moving vs. standing still? In Team Thunder single-player mode there are three camera views: Pilot, Gunner and Chase Camera. But essentially, it emulates a pilot and a gunner as two independent controllers. When playing solo and switching to gunner, the heli must still keep flying, hovering, etc. without player input. Switching to pilot, the machine gun must still aim where it used to and so on. This means the number of permutations to test also double. Now add LAN co-op, with a client and a host that can choose who is pilot and who is gunner. Suddenly the number of possible permutations just quadrupled. Testing really became a huge time eater. At one point there was an elusive bug that haunted me for several months. It only happened when the client was the pilot and crashed while the gunner was aiming. I only discovered the remedy by accident.
Another big challenge that I wrestled with was synchronicity between all the parts with complicated dependencies on one another. At first glance it would seem that loading the scene, mission, helicopter, controllers, etc. would be simple and straightforward. In most WiFi multiplayer games contenders are identical units. The game can start when everyone is on board and ready. Not so in helicopter co-op. Synchronizing things turned out to be a major headache. A situation that could be catastrophic and must be accommodated for, for example, is when the host is loaded and ready to play and a script starts interrogating the client who has fallen behind and still busy loading the scene. This aspect about co-op gameplay was not obvious at first.
vi. Keeping up with Developer Tool Updates
Developing a game involves various 3rd party tools and plugins. One of the most frustrating challenges, as many developers will probably agree, is having this labyrinth of dependent parts working together in perfect harmony over the span of the app’s development. All of these tools also undergo their own individual updates and life cycles, not only to keep up with the ever changing and new hardware entering the marketplace, but also new developments in business models and in related industries, such as marketing, advertising, hosting, and so on. More often than not, this complexity is akin to a delicate balance of linked chains. If one changes or breaks, or maybe just moves a bit off center then many of the other pieces might break as well, or the app that you are developing might not work at all. For example, upgrading a test device’s OS might deem it useless if the SDK of the OS maker isn’t yet compatible with said company’s shiny new OS.
It took a few years to get TeamThunder on the app market and what a ride it has been. It plays well and connects beautifully in co-op mode, but there are still aspects that I’d like to improve. For example, it is not obvious to a new player that the tutorial missions may be skipped. Another flaw is the lack of a good reward system. The game will therefore still evolve for the foreseeable future before I will move on to something else. Expect more helicopters, missions, maps, rewards and features to come.
The question I've been asked many times is how did I ever find time for developing a game while married with a full-time job and with everything else that goes on in my life simultaneously. My answer to this question, that I get so often, is always the same and I suppose it will always remain the same. And I will share with you the same wisdom now: I have no idea whatsoever.