Thetaball, a study in AI

Thetaball, a study in AI

Written by Dave Gamble on 10/20/2017 for PC  
More On: Thetaball

There’s a maxim in IT that goes something like “The easier it is to use, the simpler it looks, the harder it was to develop.” You probably haven’t heard that one; I shamelessly just invented it, but it is based on personal experiences reaching back almost three decades. A tremendous amount of thought and effort goes into good user interface (UI) design, only to be discounted by the customer when the resulting UI is functional yet easy and intuitive to use. As a thought experiment, consider the app design constraints arising from having a single “do it all” button on an iPhone. Not easy, that.

User interface is not the only challenge that is underestimated by the consumer. Equally underestimated is the effort that goes into developing exceptional Artificial Intelligence, or AI. Examples abound, but to select a recent simulation that is currently being raked over the coals by players, Project CARS 2 is being enthusiastically maligned for its ostensibly “stupid” AI. It is a beautiful racing simulator that provides access to  massive list of real world cars and race tracks, it allows players to race in all kinds of weather conditions, it has a plethora of customizations to set an approachable difficulty level to racers of wildly disparate ability, but many consider it to be worthless because the AI drivers can’t seem to perform as well as a real human.

My not quite charitable suggestion to those folks is that they try their hands at iRacing, a similar racing sim that has no AI at all—you can either drive alone, or you can drive against other humans. As a side note, I do race in iRacing, and I see real live “drivers” do plenty of very stupid things. The point here is that what may appear to be stupid behavior has more to do with the complexity of the environment than it does the quality of the AI implementation.

Back in the day, AI was often nothing more than scripted behavior. In the case of racing games, this led to extremely predictable opponents. Knowing nothing more than the turns and speeds to take on any given track, which was often “taught” simply by recording the developer’s path around the track, which reflected only one person’s ability, it didn’t take much effort to learn the weaknesses inherent in a track. So, it was easy to win, but how much gratification came from beating a thoughtless recording?

These days, it is far more common for high-end sims like Project CARS 2 (and at least a half dozen other titles) to use a much more complex AI development model. I have no idea what methodology these sims use to generate their AI’s knowledge, but I strongly suspect that they are using something very similar to a simple looking, yet quite complex, game that I had an opportunity to look at prior to its release date. The game is called Thetaball and it is the result of a five-year development effort from a single developer. He refers to it as a passion project, and it is clear that a great deal of effort went into its development.

Upon first glance, one could be forgiven for questioning how it could have taken that long to develop. If so, I refer you back to the maxim I invented just in case this subject came up. Writ small, it is simply this: The simple is often complex. There, those five words are perfect for a coffee mug just waiting to be sold on CafePress. Have at it, but please do remember my 10% royalties. Seriously, though: take a look at this screenshot and take a stab at guessing the complexities hidden behind it:

 

What that screenshot shows is a single human-driven player (me) getting totally pwned by the AI players. How can that be?Well, unlike me, those players have been learning and playing this game for about 80 years, although computer speeds reduced that effort to about nine months of actual time. To be fair, those players were a whole lot worse players than I was on my first try, but still: 80 years of accumulated experience is bound to produce some very good players. The net result of this is the development of a truly physical (as opposed to a statistical model in which events are determined by the routines comparable to simply rolling dice) simulation. Outcomes are based entirely on knowledge gained by eight decades of experience gained through physical interactions between players. Nothing is animated; every single aspect is determined by interactions with the environment.

You would also note the tendency for some players to make offensive plays towards the goal while others are more attuned to defensive moves. How does that happen?

The AI methodology that was used starts with genetic AI algorithms. These are the very basis of Darwin’s theory of evolution, at least to the degree of a retired IT guy’s understanding. It is also more commonly known as “survival of the fittest.” Many confuse that with “survival of the strongest,” but that is incorrect. The definition of “fittest” takes far more than physical prowess into consideration; sometimes contemporaneous society values, for example, brains over brawn.

In the case of Thetaball, survivors were presumably selected from the pools of best scorers and best defenders. One could intuitively see how the selection of the best possible players at the two endpoints of a skills continuum could lead to a stalemate in which neither side can beat the other (see also: tic-tac-toe), but that would require willful disregard of the chaos inherent in complex systems. What actually happens is a more well-rounded game wherein the defenders don’t all cluster around the goal while the scorers take potshots from midfield—they interact with each other in ways very similar to humans.

I made reference to a collection of complexities hidden behind that simple screenshot. Having a deep, strong AI requires a lot of computational power. There are a number of ways of achieving that, chief among them being the acquisition of your own Cray supercomputer, but it’s pretty much incumbent on the developer to find more realistic solutions, the most obvious of which is code optimization. In many ways, finding a Cray on eBay is likely to be easier than code optimization. Code optimization is the kind of work Ph.D.’s are born for. Consider the incredible amount of search results Google can return in fractions of seconds. I just Googled "code optimization" and received about 234,000,000 results in 0.68 seconds. I remember a time in my career when I cut the time to load a 9-track tape into a SQL Server database from nine hours to 25 minutes. I thought I was a genius!

In the case of Thetaball, a number of optimizations went into lessening the CPU distractions of actually rendering the game. The graphics are all vector-based in the same way early arcade games like BattleZone and Asteroids were. Your smartphone has orders of magnitude more processing power than those venerable games could have even dreamed of. Code optimization was critical, and vector graphics were a large part of being to create smooth animations.

Another time sink is the computation of the physics involved in player movement, puck movement, collisions, etc. One of the best ways to optimize code is to strip out bloat that doesn’t directly participate in the specific goals of the application. In this case, the developer developed a custom, highly optimized, purpose-oriented 2D physics library in C++.

So, at the end of the day, does all of this effort necessarily lead to a good game? Well, no. No it does not. Consider again the ongoing saga of Project CARS 2. The AI could be as good as Sebastian Vettel, or Daniel Ricciardo if you want someone with a more sportsmanlike attitude, but if the program is constantly crashing or delivering five-frames-per-second screen updates, it’s going to be vilified in the market as a complete waste of time and money. While strong AI is an important facet in a competitive game, it isn’t anywhere near the only thing needed to provide a good gaming experience.

Where does this leave us with Thetaball? Fair question, but difficult to answer. I’ve only had a few hours of actual hands-on experience, during which I have become familiar enough with the game aspects to win a few rounds by pretty much staying out of the AI players’ way. There’s far more depth to this game, though. If you look at it as a team sports game that requires the player to develop a team that can defeat increasingly difficult challenges, you will have a better understanding of where the game is headed.

It's also worth mentioning that Thetaball can be played solo like I did, or in groups of up to eight players. You can even choose not to play at all (what I should have done to avoid being humiliated by a team of 80-year-olds) and act more as a team manager.

If you do choose to try it for yourself, Thetaball will be available for PC and Xbox in the Windows/Xbox Store on October 20, 2017.

* The product in this article was sent to us by the developer/company.


About Author

I've been fascinated with video games and computers for as long as I can remember. It was always a treat to get dragged to the mall with my parents because I'd get to play for a few minutes on the Atari 2600. I partially blame Asteroids, the crack cocaine of arcade games, for my low GPA in college which eventually led me to temporarily ditch academics and join the USAF to "see the world." The rest of the blame goes to my passion for all things aviation, and the opportunity to work on work on the truly awesome SR-71 Blackbird sealed the deal.

My first computer was a TRS-80 Model 1 that I bought in 1977 when they first came out. At that time you had to order them through a Radio Shack store - Tandy didn't think they'd sell enough to justify stocking them in the retail stores. My favorite game then was the SubLogic Flight Simulator, which was the great Grandaddy of the Microsoft flight sims.

While I was in the military, I bought a Commodore 64. From there I moved on up through the PC line, always buying just enough machine to support the latest version of the flight sims. I never really paid much attention to consoles until the Dreamcast came out. I now have an Xbox for my console games, and a 1ghz Celeron with a GeForce4 for graphics. Being married and having a very expensive toy (my airplane) means I don't get to spend a lot of money on the lastest/greatest PC and console hardware.

My interests these days are primarily auto racing and flying sims on the PC. I'm too old and slow to do well at the FPS twitchers or fighting games, but I do enjoy online Rainbow 6 or the like now and then, although I had to give up Americas Army due to my complete inability to discern friend from foe. I have the Xbox mostly to play games with my daughter and for the sports games.
View Profile

comments powered by Disqus