Direkt zum Hauptbereich

AI Learns to Play Computer Games

Let's take a look at an off-topic issue in this article: gaming. Why is it even worth to talk about gaming? First of all, gaming is the first decision driven activity a human can do. Second, gaming is a huge economic factor of today's digital business. Third, everybody loves to play. So, let's take a look at challenges to the developers of computer games.

One big challenge to the game developers of modern computer games is to create opponents that are challenging the player - but never too far. Always matching a grade of difficulty that evokes a kind of thrill to the player without being hopeless to beat the computer player. But why is it a challenge? Well, it is something that affects the player directly - and a frustrated player will be a hard judge to the game developer or publisher. We could say: adequate opponents in games are a kind of game quality.

Computers can always easily defeat up to 98% of human players


For a computer, it is no problem to beat a human player today. In the 1990s and early 2000s, computer opponents run with a simple scripted artificial intelligence, persisting of a simple script language. All actions were scripted in an if-then-else construction with support of a couple of timers and way points. (I have seen those scripts as part of the former Genesis game engine and they were awful).

Today, computers could (I guess) defeat up to 98% of human players with today's new kinds of navigation and self-learning algorithms. But those opponents are way to strong to entertain the human player of the game, because they would always defeat him. Unfortunately there is no way to tell the computer, to be only half as good, because failing is caused by errors which can be the consequence of a lack of experience of a human. But a computer can not simulate missing experience when he knows the whole game world or all possible tactics or how to use his actions most effective. Of course, the developers could tell the computer to use always 50% of effectiveness or 70%. But the player could be bored very fast of this. The challenge turned from creating stronger virtual opponents in the late 1990s to creating weaker virtual opponents - or more adequate opponents that are always just (for example) 4% weaker than the player? This is one of the challenges of the gaming industry.

It starts with simple games


The discussed problem is not just a challenge in highly complex games. Actually it concerns also the most simple kind of game. For example, let's take a look at Pong. Pong, one of the first computer games, was a simple Ping Pong simulation for two players. The challenge for both players was to hit the ball and avoid points for the opponent (the other human player).

Screenshot of a Pong-like game
Currently, lots of attempts are taken to teach computers to play games - and to win them. The most famous one happened in 1997, when IBM's super computer "Deep Blue" defeated the world champion in chess, Garri Kasparov, in a chess tournament.

Since 1997, a whole couple of games have been learned to play by computers. For example, Google's artificial intelligence learned to play Atari games in 2015. Recently, an AI called "Alpha Star" defeated the world champion in Star Craft II, one of the most complex computer games.

Learning to play


It looks like the topic of the day in artificial intelligence is "learning to play". Not without a reason. As we could see, playing is very complex in decision-making. If an AI can play, it also can start handling more complex problems - maybe air surveillance or rail system traffic?

This facts are interesting enough to learn a little bit more about AI and playing computer games. 

Kommentare

Beliebte Posts aus diesem Blog

Pi And More 11 - QMC5883 Magnetic Field Sensor Class

A little aside from the analytical topics of this blog, I also was occupied with a little ubiquitous computing project. It was about machine learning with a magnetic field sensor, the QMC5883. In the Arduino module GY-271, usually the chip HMC5883 is equipped. Unfortunately, in cheap modules from china, another chip is used: the QMC5883. And, as a matter of course, the software library used for the HMC5883 does not work with the QMC version, because the I2C adress and the usage is a little bit different. Another problem to me was, that I  didn't find any proper working source codes for that little magnetic field device, and so I had to debug a source code I found for Arduino at Github  (thanks to dthain ). Unfortunately it didn't work properly at this time, and to change it for the Raspberry Pi into Python. Below you can find the "driver" module for the GY-271 with the QMC5883 chip. Sorry for the bad documentation, but at least it will work on a Raspberry Pi 3.

How to use TOracleConnection under Lazarus for Win64

Lazarus Programmers have had no possibility to use TOracleConnection under 64 Bit Windows and Lazarus for years. Even if you tried to use the TOracleConnection with a correctly configured Oracle 11g client, you were not able to connect to the Oracle Database. The error message was always: ORA-12154: TNS:could not resolve the connect identifier specified Today I found a simple workaround to fix this problem. It seems like the OCI.DLL from Oracle Client 11g2 is buggy. All my attempts to find identify the error ended here. I could exclude problems with the TNS systems in Oracle - or the Free Pascal file oracleconnection.pp though the error messages suggestes those problems. After investigating the function calls with Process Monitor (Procmon) I found out, that even the file TNSNAMES.ORA was found and read correctly by the Lazarus Test applictaion. So trouble with files not found or wrong Registry keys could also be eliminated. Finally I installed the Oracle Instant Client 12.1c - aft

Lazarus IDE and TOracleConnection - A How-To

Free programming IDEs are a great benefit for everybody who's interested in Programming and for little but ambitious companies. One of these free IDEs is the Lazarus IDE . It's a "clone" of the Delphi IDE by Embarcadero (originally by Borland). But actually Lazarus is much more than a clone: Using the Free Pascal-Compiler , it was platform-independent and cross-compiling since it was started. I am using Lazarus very often - especially for building GUIs easily because Java is still Stone-Age when a GUI is required (though there is a couple of GUI-building tools - they all are much less performant than Delphi / Lazarus). In defiance of all benefits of Lazarus there still is one Problem. Not all Components are designed for use on a 64 bit systems. Considering that 64 bit CPUs are common in ordinary PCs since at least 2008, this is very anpleasant. One of the components which will not be available on 64 bit installations is the TOracleConnection of Lazarus' SQLDB