The official website for The Settlers of Catan

How Good Should an Artificial Intelligence in an Electronic Catan Game Be?

 
June 22, 2009
Klaus Teuber

If someone had asked me this question roughly half a year ago, I would have answered: Of course it has to be as good as possible. A computer opponent can never be a substitute for a human player in a Catan game on a real game board, so it should at least be able to play well.

What’s missing in a game against computer opponents are emotions: the complaints when the robber comes, the noisy haggling over resources or the pointed remarks used to make the game partners turn against the alleged leader.

ErsteInsel 220x270 How Good Should an Artificial Intelligence in an Electronic Catan Game Be?

Catan - Die erste Insel (The First Island)

In the first version of Catan for PC (Catan – The First Island), initially published by Ravensburger Interactive in 1999 and later by USM, an attempt was made to provide the computer opponents with human characteristics. The AIs were nicely animated and contributed their wisecracks in a variety of situations.

They sounded funny in the first few games, but with time they became rather monotonous because the computer opponents’ repertoire was, of course, limited.

Siegfried 1999 How Good Should an Artificial Intelligence in an Electronic Catan Game Be?

Siegfried - 1999

Back then, many players complained that the wisecracks were bugging them, and that they were switching off the sound when playing.

Marlene 1999 How Good Should an Artificial Intelligence in an Electronic Catan Game Be?

Marlene - 1999

To make up for its flawed “human touch,” an artificial intelligence should at least be able to play a clever game in terms of strategy and tactics and thus be a challenging opponent for the human player.

Catan SuR 200x270 How Good Should an Artificial Intelligence in an Electronic Catan Game Be?

Catan - Städte & Ritter (Cities & Knights)

In the PC game “Catan – Cities & Knights,” published in December of 2008, we thus focused on developing a good AI. We refrained from including spoken comments made by the computer opponents – the criticism of “Catan – The First Island” was still very fresh in our memory.

I for one put over six months of work into the concept of the AI, the fine tuning of the AI together with programmer Sebastian Mellin, and into countless tests. We published the program with an “easy” mode and a “normal” mode, and we wanted to provide an add-on with a “difficult” mode later. The “normal” mode was designed in such a way that an experienced player should have no problem playing the games. Testing and refining of the “normal” mode continued until the point where we at Catan GmbH lost some Campaign games too; then we were satisfied and also a little proud of our work.

Siegfried 2009 How Good Should an Artificial Intelligence in an Electronic Catan Game Be?

Siegfried - 2009

What made us proud as well was the fact that our artificial intelligence worked completely without tricks. There was no manipulation of the dice roll sequences, and the computer opponents were not targeting the human player. When placing the robber or trading, the AIs only saw opponents and made no distinction between the human player and other AIs.

Marianne 2009 How Good Should an Artificial Intelligence in an Electronic Catan Game Be?

Marianne (Marlene) - 2009

So we were looking forward to feedback from the gamer community regarding our strong AI. The feedback came, but it mostly wasn’t what we had hoped for. Sure, we also received praise, but unfortunately, many players had problems with the strength of our AI. Some of them purportedly needed more than 10 attempts to win the first game of the Campaign. It seemed that many players skipped training in “easy” mode and immediately hurled themselves into the Campaign adventure in “normal” mode.

The following mail is representative for some letters we received:

“The alleged random dice roll in the Catan PC game is anything but random. I’m really asking myself what induces someone to be so – please excuse the expression – antisocial that he writes a program in a way that you simply cannot win.”

 

In my answer I assured him that I usually do not behave in an antisocial fashion and gave him my word that the dice are not manipulated and the computer opponents don’t gang up against the human player either, and that the computer opponents were just playing well.

The reply was short:

“Do you actually believe the crap you are writing me?”

 

Also, people often mentioned the predecessor “Catan – The First Island” as the better alternative, although the computer opponents of this original version are very weak. It would appear that players who are repeatedly defeated by a computer doubt the program’s trustworthiness more than their own playing skills. And if someone thinks that the program is “cheating,” he or she feels betrayed and doesn’t like the game. That’s something I can understand.
So, if someone would ask me today how good a “normal” artificial intelligence in a Catan game should be, I would answer: As good as required for an occasional Catan player to win against a computer opponent.

Klaus Teuber

Share


Related Games

Comments

Programming a good AI can be very difficult, but I tend to agree with some of the other players. I have been playing Catan for many years against very good strategy game players and win my fair share. I have also played the old computer version and the iphone version. These versions i found a little too easy. My win ratio was approx 3 out of 4. This version however i find somewhat frustrating. I have played approx 30 games in the campaign so far and my win ratio is about 1 in 6. Even if first timers play the easy campaign first they must be having a difficult time. The computer players are very difficult to near impossible to trade with. I have witnessed the computer collect 6 of one resource and when asked to trade for that resource at 3 to 1 it refused (no i wasn't close to winning). After trading all my resources to the bank the computer then trades they're resource 3 to 1 to the bank for the same resource i offered. No human player would do this. When i play on this version i go for the ports because its the only way i can trade. The trading aspect is almost completely gone even though it is one of the main factors of the game. Or you have to take the trades the computer offers which are rarely what you need. As far as the robber goes, i have checked the stats at the end of every game and 4 out of 5 times i have been robbed the most and some times by as much as 5x the computer players. Even if a computer player is getting close to winning the other players don't use the robber against them. Again this is not what a human player would do. I have been analyzing my games trying to understand why the computer perceives me as such a threat but have had no success and it seems unlikely that i have the only resource they are looking for that often. I do expect to be challenged and as an experienced player I am ok with only winning my fair share of games as i enjoy a challenge. However the way it is now it is like playing a different game than the original. I will continue for now to play the game but so far the experience has been more frustration than challenging entertainment. Thank you for your time.
I also have some thoughts about how random the dice really are. I've noticed when playing that the throws - mostly when you're leading - are at times working against you. There are several examples - and I don't think it's only plain paranoia or just a case of bad luck! One of the classic examples is when it's really obvious that you really need a specific resource, and you have a settlement on that specific resource with the highest statistical rate -a 6 or an 8 on it - and you just won't get it! Round after round after round the dice are throwing all numbers but 6 or 8. And after a while, when the rate of the dice must follow a somewhat statistic curve, and finally hit a 6 or an 8 -well - then that throw is proceeded by a 7! And the robber gets placed by the computer opponent on your specific resource with 6 or 8 on it- and as a result you won't get that specific resource anyhow. Now that has happened too many times to be just random. It's like the aggressiveness of the game, in many cases, lies in the throws of the dice, and therefor the throws could not be a 100% random. As far as I can see, I believe that the throws actually are trying to even out the individual points between the players, especially if the human player is in lead. I think that the computer is trying to somewhat controll the outcome with the dice at some points during the game, to compensate computer opponents if they're not doing as well as the human player. But to be clear - I don't think the computer opponents are ganging up against the human player. There's no need - because the throws of the dice already controll the number of points the players have, by controlling the amont of different resources in play. If I'm right in my perception of how the throw of the dice are controlled at some points during the game, it would be very interesting to know how you actually made that work, programing it. Anyhow - I still think Settlers is the most entertaining game I've ever played. And maybe it's why I get so frustrated when it seems like the throws of the dice sometimes are following a pattern that is disadvantaging you. But either way - I love the game and can't stop playing it : ) Thank you! Emilia
Gero Zahn
@Emilia If you promise not to tell anyone – as you were asking how we programmed these conspiratorial dice rolls. Well, let me tell you: We did not. There is no evil algorithm behind the dice rolls, favoring one player over another, one resource output over another, one hand of more or less than 7 cards that will or will not be robbed. I reckon that you won't believe me - but this is how it is.
Hi! So Gero - you're telling me that the dice really are random and that they're not conspiratory in any way? Well - I can't promise not to tell anyone :) if that's what your asking. But do tell me about the algorithm. Is it connected to a specific setting of the actual resources? Alright - not gonna make a fuzz about the dice. For a while anyway. Thank you for answering me though. Ok, but now Gero - please tell me about the development cards. How are they operated? My beliefe is - since I'm a bit, as you noticed, suspicious - that when the computer opponent is drawing a card it's not yet decided which one it actually is. It is later decided by the actions of the game - and not in the exact moment when it has been drawn. Simply when there's an opportunity that really would favour a computer opponent and requires a specific card - wham! - it has it and use's it. Or isn't it how it is Gero? :) If this is not the case - something tells me that you'd say it's not - but then I would like to know how you're actualizing every characters individual skills and unique way of playing. If it's not in the algorithms and everything is just random - is it just a case of the computer opponent delaying or not at all using the cards on your hand if you're a passive player and vice versa. Or that the aggressive c.o. is making moves only for ruining possibilities for others? Please Gero - how is it really? Thanks/Emilia
Gero Zahn
@Emilia The most crucial element of games containing random decisions is the random number generator. Our programmers use the Mersenne Twister random number generator – you can find out more about this here: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html – it is a very common and widely renowned algorithm. The other (please excuse my words) conspiracy theories you plot: The AI mimics a real player. If it buys a development card, then it is drawn from the top of a simulated stack of shuffled development cards – like all other players would draw the topmost card during a real physical game. The AI won't later magically replace the card that it got for some other card that it might find more convenient in a certain game situation. Let me tell you: The foundation of the AI's strength comes from careful developments done by Mr. Klaus Teuber himself. The programmers then implemented it in a way that he intended it to be. During the extensive subsequent test runs, he personally checked that the AI behaved as it is supposed to do. During these kinds of tests, we carefully look into the AI's cards and “brain”. Rest assured: If the AIs would cheat in a way that you described, Mr. Teuber would never have given green light to publish the game.
Hm, interesting... just to point it out - I don't think of it as cheat, not at all, but as a way to acutalize the computer charecters uniqeness. So I'm not talking about it in an ethical perspective. Which it would be if it were human players in a physical game with actual cards or dice, manipulating the dice or deck - of course that would be cheating. But I'm more interested in understanding in which way the c.o. actually operate - since I know that the dice are following an exact pre-decided algorithm :) How do they work and how is their game built up? I want to know ways for the c.o. to express aggressiveness or a more laid back way of playing. I'll definitely check out the page you recommended. Again - thanks Gero! /Emilia
Gero Zahn
I am sorry, this would certainly go beyond the scope of this blog post discussion. Only one last thing: The dice rolls are not “pre-decided” in a way that the computer could look up what number will be rolled in three turns. – I think that I have certainly explained a fair bit of the AI's mechanism: They try to mimic a human player in a regular board of Catan, with certain strategic variations, which leads to different “computer characters”. This is all that is to it.
I agree with the comment that the dice roller is anything BUT random. I have played almost 800 games and the dice roller seems to be gaining intellect. Too bad because this would otherwise be much more fun to play. I have logged a record of the dice roller's bad habits, it's uncanny yet undeniable. Is there any chance of a patch to fix this? Almost every time the robber lands on my number, the next roll is that exact number and maybe on two or three of the next four rolls. There is also what I call 'the catch up phase', whenever you get a significant lead the next few rolls are 7's, this effect is doubled when the opponents play a robber followed by a 7, thus giving the opponents time to catch up. I also play this as a board game with friends, what a huge difference in the randomness when the machine is not 'CHEATING' ?!?!!!!
Then what you are admitting is that the AI dice roller is beyond the designer's capacity to understand. That somehow it got away from you and is self-learning? Maybe you should playtest these things once in a while. Why would anyone ever buy another electronic version from you if can't deliver a patch or something to fix this? I know I won't. The larger issue here is your stubborn refusal to even admit it !!!
Gero Zahn
@Forreal918 Why do you say that we admitted that the dice rolls are beyond comprehensibility? They are not: We are using a Mersenne Twister random number generator. http://en.wikipedia.org/wiki/Mersenne_twister It's certainly high mathematics, so it's not for everyone, but it's certainly no black magic. Rest assured, it is not self-learning, it is not “evil”, and it is not manipulated; it is following its algorithm. Everything else you might be experiencing is, please excuse me being frank, somewhat of a self-fulfilling prophecy: You are determined that the algorithm is “rolling against you”, and by that you tend to overvalue the cases where the dice fall against your favor, while you ignore those cases where they don't. ... You can read more about man's tendency to see these kinds of “meaningful patterns” that are simply not there in Wikipedia under “Apophenia”: http://en.wikipedia.org/wiki/Apophenia
I am an avid Catan player. So when I found Catan for OS X, I was pretty happy. After downloading, though, I soon learned that this is the worst game I've ever seen for bugs. It is nearly impossible for the human player to win in any but the easy levels. The boards are always the same, at every level, so nothing random here. There is nothing random about die rolls that favour the computer player time after time, flying in the face of any proper odds. In fact, there is very little about this game that is random. Except the crashes. You can expect this to happen nearly every session. Mine has crashed so many times that Apple must be tired of getting error messages. Worst computer game ever. At under $17.00, its not worth the money. I've deleted it from my iMac.
Gero Zahn
@Bill Thank you for your message. Please contact our licensee United Soft Media who is mainly responsible for the Mac version: hotlinework [at] usm.de
I just stumbled on this even though I closely follow the development of the franchise quite closely. Having been working directly with Klaus Teuber on the first PC adaptation of the game ("Catan - The first Isle") as the lead programmer, I can tell you that he's a very pleasant guy to work with. It's not really astonishing that this first adaptation is still considered being quite good for the occasional player. We had tested several different approaches of the AI (most of which completely failed) before considering some very good Excel sheets Klaus had developped as a proof of concept for a possible AI. What made the development of the AI interesting is the fact that the different maps (and different rulesets that came with them) needed special adaptation to the AI and the way it played (i.e. special handling for Volcanos). Also, dependent on the difficulty level and the current game phase, the AI had to act differently. As Klaus mentioned in this post, the AI wisecracking was considered being a factor to push in a more "we're all sitting at the table and we're making comments on current situations"-direction. Unfortunately, the development time was quite short for a game of this scope and thus we couldn't give the love we wanted to give to the AI players.
Hi, I have only played the board game a few times but loved it so when I got a chance to play on PC it was great. I was suspicious of the random dice throws when 'every' time I had more than 8 resources I threw a 7 and got robbed but of course when I stepped back from the personal feelings I could see other throws were 'lucky' for me. I am not an experienced player and after about 20 games at the difficult level I have won a couple and see I am getting closer. I would think the AI players are very well balanced except as mentioned above they are not inclined to trade 3 to 1 even when one would feel a human player would. Finally a question I find the screen to be very small and cramped so I am only using half of the possible area on my pc screen and the display is shown too large so I have an unpleasant view/interface Thanks for a great job well done.
I don't know about this AI. Maybe it's good. I've been playing medium difficulty, and it seems fine. However, it seems to me that the problem is the dice. They're not very random at all. When I see the same numbers coming up so frequently, sometimes 5 in a row, numbers like 8, 6, 7, 4, while other numbers are barely ever seen in the game, I've learned that victory depends less on strategy and more on getting your settlements on those numbers before the AI's do. Then, the thievery system is broken. 8/10 times, they send the thief after the player, especially when the player has more points than everyone else. Then it's like you're the only player on the board whenever anyone rolls a 7. I've even had several times where the thief was sent after me when I had no resource for him to steal. Then the dice seem to get stuck on a few numbers, making any settlement on those numbers rich with the resource. That can be tempered a bit by the player having settlements on those numbers because then, for some reason, wherever the player is, the liklihood of the dice hitting those numbers decreases.
Gero Zahn
@Ferny I am sorry that you experience it this way. All I can tell you is: We've been closely supervising the production of the licensed editions of our games for various electronic platforms, and we are convinced that our licensees have not implemented a dice roll algorithm that favors the AI opponents over the human player in any way. As a matter of fact, the AIs' playing paradigms derived from notes and theories that Klaus Teuber created himself. And while you need to believe me that Mr. Teuber certainly did not request for cheating AIs nor unfair dice rolls, the programmers of the respective licensed editions could note have put in something like that without us noticing in our dozens and dozens of test games. — You see: Dice randomness will show the “expected” triangle distribution (where the 7 is the most frequent number, 2/12 the least frequent, etc.) only when rolling the dice close to infinite times. In Probability Theory, this is known as the Law of the Large Numbers. http://en.wikipedia.org/wiki/Law_of_large_numbers ... In a comparatively short board game with 4 players and (e.g.) 20 game rounds, we have 4x20 = 80 dice rolls, which is far from “large” or let along “infinite”. And about your problem that the AIs will steal from the player who is in the lead: Well – if you were sitting at a table with your fellow human players, and if every one of them was trying to win the game, what would be wrong with trying to stop the one with the most victory points? I agree: Friendly games among family members, especially with children, often follow other rules, simply trying to have a great time together, perhaps letting the kids win. But if you're thinking about a “serious” game in perhaps a World Championship tournament situation, the AIs are not doing anything wrong: If you play better than them, they follow the game rules and try to stop you.
i never get tired of this game, but since i started playing vs the AI this year, i found myself getting really frustrated. I get the robber even if i have no resources, then the blocked number gets rolled. Despite probability familiarity, the AIs have gotten up to 20+ resources on 3s or 11s, while none of mine get rolled, then the build a road, city, several roads or ships. After my numbers come up, before i get to build, im robbed, leaving me at 0 progress sometimes up to 10 rounds. Not that ive never won, but it gets really frustrating, as these never happen to me with real players, and those guys are heartless in the game.

Add new comment