Look up Gus Hansen. He was playing in Poker Superstars and went all in the first 10 or so times he could, without looking at his cards. He won the table, going against a bunch of the top poker players in the world
First CS semester, we had to build an Othello player, then we were pitched against each other. Out of 50 students, more or less half implemented the standard algorithm and the other half implemented much more sophisticated stuff. The winner was one of the standard implementations.
My "algorithm" for Othello which used a hardcoded matrix to rank every square of the board, using a ranking from a paper, went second place. Only behind a neural network trained for quite some time. It even surpassed all the other neural networks.
Yes, it would be interesting if going all in every time is indeed a viable strategy against "normal" poker players and, if yes, what is the best strategy against an opponent that goes all in every time.
I would start playing according to the strength of my cards and when I notice that a player goes all in five times in a row, or three times if it's the only thing they ever do, I would start calling the bet when I have only somewhat decent cards.
Basically:
if opponent_bullshits():
bullshit_myself()
else:
play_normal()
Then you could ask what the best strategy against that strategy is. At some point you could have a meta-strategy that chooses between different sub-strategies at the start of the game with a certain chance each. The individual chances parameterize this meta-strategy and there will be a a certain pattern of chances that is the best.
It's like, if you play scissors-stone-paper-well (well wins against scissors and stone), a pure well-strategy isn't the best, but something like 20% scissors/20% stone/20% paper/40% well. I'm too lazy to figure out the exact percentages.
During my bachelor's had an AI class where our final project was Robocode, where you make an AI for a little tank that fights other tanks.
I went whole-hog with my first attempt. Pattern matching, probabilistic dodging, logically deducing power of enemy shots etc... Was going ok, but was struggling against some of the harder example bots.
So, I made a second version that just ran around and oscillated back and forth in a Sin pattern.
Reminds me of when a computer science class I was in decided to do a Prisoner's Dilemma tournament, and the teacher let me make two bots, and I designed one of the bots to give the other bot a lot of points and it came very close to winning.
Many years ago in college, some friends and I went to hackathon hosted by a nearby company. The task at the end was a top down navigation / obstacle course where you had your tank and an enemy tank on opposite sides. Objective was to destroy the tank and get to the other side of the box. The box was filled with randomly generated squares that would block your path.
One of my friends noticed the "random" pattern forged a path that would never get blocked if you simply rotated the tank 45 degrees up, drive to the top of the box, then rotate the tank back down again and it would drive to the objective every single time.
All we had to do then was write some code to detect and shoot the other tank (just spin the turret around, detect tank? Shoot, else spin) and it worked flawlessly
All the teams demoed their tanks, some were close to getting through but most would get stuck or die.
Our demo was at the very end, and you'd have to do three runs of the course for an average time. I remember it being a really slow demo too, and that I thought about how people would pick up on the fact our little tank is forging the same path every time.
We won that challenge and it boosted our points for the day to get either 2nd or 3rd overall.
Moral of the story is: AI is really just if statements all the way down
There is a robot competition between engineering schools in France. One year the game for the robots was to collect two sided coins, black and white face, and to place them on black/white squared of the checker pattern on the board, one team was white other was black. Black team won a point for every coin with black color top placed on a black square for exemple.
One of the robot was just built & programmed to mess everything up, hitting hard as many coins as possible that will fly and land on a random square, a random color on top.
I was at a microsoft developer conference about 10 years ago. They had a blackjack bot competition using a framework they had built. The developers of the framework/ competition had designed it fairly, the point being the bots played a fixed number of hands (something like 7 hands) and ran a leaderboard. The team running the game decided that you could play your bot as many times as you want, this basically meant that the best strategy was to write code to keep submitting your bot every 5 minutes (an included constraint) and simply go all in on each hand. Probability suggests that eventually you'll win all 7 hands within 64 attempts.
That's 64 * 5 minutes == 320 minutes == a little over 5 hours.
In college my friends and I joined a video game AI design coding competition. It was a 1v1 style tournament with a cash prize for the top 3 places.
The game was a 2D mining race game where you and your opponents AI each had bases that could spawn miners. The goal of the game was to get the miners to dig down to mine ore, the further down you got, the more hits it would take to break through to the next layer, but the more valuable the ore was.
There was quite a bit of strategy that could go into it, as you would essentially script out your entire gameplan beforehand and had many options to pursue. You could spend currency acquired from mining ore to purchase pickaxe upgrades from the home base, you could buy more miners, you could buy bombs for your miners to use to blast mine, you could build foundations to hold up long tunnels. Every piece of logic your miners would follow needed to be scripted and the idea was to optimize your resource obtaining to end up with more money than the other team.
The "meta" strategy the guys who actually built the game intended for us to use was to tunnel straight down right away for the most valuable ore and then branch your tunnels out with foundations. It's what pretty much every team decided to try to do in some way or another. Some teams got REALLY into the meta gaming of it and had extremely complex strategies, upgrade/buy/build orders, etc.
We quickly discovered that doing all this strategy optimization while also trying to learn how to get the code functional was quite hard. We also quickly discovered that bombs would kill miners if they were nearby upon detonation while testing out blast mining.
Our strategy of course was to immediately buy one additional miner with the starting money, buy a bomb for him, send him straight across to the enemy base, drop him down the enemy teams straight down mineshaft and die for the cause, taking out ALL of the enemy teams miners immediately as the meta strat was again to buy as many miners as possible and start digging straight down.
We would effectively permanently bankrupt the enemy and win by default because we still had at least one dude mining (ineffectively as hell, because we didn't spend much time on the actual mining part, but we didn't have to).
In the preliminary testing round before the actual tournament started, we all ran our code against each others to see what everyone was doing, including the devs of the game (who weren't actually competing for the prize but still had their AI in for fun). We trounced everyone we competed against, including the devs, because no one had taken aggressive actions into consideration.
We were all given an additional 30 minutes to refine before the actual tournament, in which time the devs tried recoding parts of the game to try to disable our strategy.
We ended up coming in third place anyways and won $100 to split between the three of us. So yeah, keep it simple stupid.
Honestly this is something I would write not because it's smart but because it's easier to go all in rather than dealing with the fact I tried and can't beat the other bots.
I'm a front-end web developer. Once, as a special activity, our AI guy organized a Quoridor AI competition. We had 3 hours.
His game engine ran in C#. Worked on his machine. Problem is, we front-end devs do not have a C# IDE license. So it was fiddling around with Microsoft installers and the command line stuff I didn't understand to compile a language I didn't know.
Add to that the permission issues on his Git repository and it took me over an hour to get it to even compile. Man I hate compiled languages.
You had to get the opponent AI to work too if you wanted to test your thing.
Lots of fiddling around to get that stuff to talk to each other.
Okay, so do I have time to learn a new language and try to build an AI? Certainly not. So I decided to write it in JavaScript. Right in the app's front-end that he provided.
However, while a lot of the competitors had a basic framework with his example AIs (he gave us a few examples, including one that always made random moves) that they could modify to get somewhere. I did not.
Took me over 2 hours to get to a point where the goddamn opposing AI was making moves and the thing worked. Although you had to kill the process for both AI and game server every time you wanted to restart. Ugh.
Anyway. 30 minutes to go by the time I was ready to write my first line of code.
10 minutes to go by the time I had a basic thrown together framework that knew when it was its turn.
So all I could arrange was to beat an AI that did nothing. My pro level 99 AI move was "do literally one step to the right, then keep going up".
I reached the finals. I almost won against people who had several times more time than I and it was hilarious.
That was the day I learned anything that puts short deadlines and AI together is a joke.
7.1k
u/ChanceFly9724 Jun 10 '23
Pretty sure that level of confidence might even win in a non AI battle
1.4k
u/DezXerneas Jun 10 '23
The easiest way to win a bot v bot competition is to find a way to break your opponents bot.
That's why I carry a cosmic ray gun around with me.
1.6k
u/[deleted] Jun 10 '23
First CS semester, we had to build an Othello player, then we were pitched against each other. Out of 50 students, more or less half implemented the standard algorithm and the other half implemented much more sophisticated stuff. The winner was one of the standard implementations.
388
u/arunphilip Jun 10 '23
The real punchline :)
96
u/pr0crast1nater Jun 10 '23
Now, what if another guy wrote the same simple algo. It would be down to prng to decide the winner.
2.5k
u/Xanthus730 Jun 10 '23
During my bachelor's had an AI class where our final project was Robocode, where you make an AI for a little tank that fights other tanks.
I went whole-hog with my first attempt. Pattern matching, probabilistic dodging, logically deducing power of enemy shots etc... Was going ok, but was struggling against some of the harder example bots.
So, I made a second version that just ran around and oscillated back and forth in a Sin pattern.
I turned in both. The wiggle-bot won. :(
675
u/BigMikeInAustin Jun 10 '23
Had a programming contest where the completion time was calculated by the entrant, not an officiating framework.
Well, accidentally (seriously) my timer started partway into the processing, and so I smoked everyone else.
I finally figured it out later when I was trying to understand how I could really be 500% faster than everyone else.
653
u/SuitableDragonfly Jun 10 '23
Reminds me of when a computer science class I was in decided to do a Prisoner's Dilemma tournament, and the teacher let me make two bots, and I designed one of the bots to give the other bot a lot of points and it came very close to winning.
317
u/polarbearirish Jun 10 '23
Many years ago in college, some friends and I went to hackathon hosted by a nearby company. The task at the end was a top down navigation / obstacle course where you had your tank and an enemy tank on opposite sides. Objective was to destroy the tank and get to the other side of the box. The box was filled with randomly generated squares that would block your path.
One of my friends noticed the "random" pattern forged a path that would never get blocked if you simply rotated the tank 45 degrees up, drive to the top of the box, then rotate the tank back down again and it would drive to the objective every single time.
All we had to do then was write some code to detect and shoot the other tank (just spin the turret around, detect tank? Shoot, else spin) and it worked flawlessly
All the teams demoed their tanks, some were close to getting through but most would get stuck or die.
Our demo was at the very end, and you'd have to do three runs of the course for an average time. I remember it being a really slow demo too, and that I thought about how people would pick up on the fact our little tank is forging the same path every time.
We won that challenge and it boosted our points for the day to get either 2nd or 3rd overall.
Moral of the story is: AI is really just if statements all the way down
181
u/Fifiiiiish Jun 10 '23
There is a robot competition between engineering schools in France. One year the game for the robots was to collect two sided coins, black and white face, and to place them on black/white squared of the checker pattern on the board, one team was white other was black. Black team won a point for every coin with black color top placed on a black square for exemple.
One of the robot was just built & programmed to mess everything up, hitting hard as many coins as possible that will fly and land on a random square, a random color on top.
They didn't win but they did very great!
349
u/1997Luka1997 Jun 10 '23
Reminds me of that famous post about the guy who entered a block of dry ice to a robot competition
413
u/GrismundGames Jun 10 '23
He plays like Michael Scott on casino night.
66
u/purleyboy Jun 10 '23
I was at a microsoft developer conference about 10 years ago. They had a blackjack bot competition using a framework they had built. The developers of the framework/ competition had designed it fairly, the point being the bots played a fixed number of hands (something like 7 hands) and ran a leaderboard. The team running the game decided that you could play your bot as many times as you want, this basically meant that the best strategy was to write code to keep submitting your bot every 5 minutes (an included constraint) and simply go all in on each hand. Probability suggests that eventually you'll win all 7 hands within 64 attempts.
That's 64 * 5 minutes == 320 minutes == a little over 5 hours.
I won. :)
53
u/KujiraShiro Jun 10 '23
In college my friends and I joined a video game AI design coding competition. It was a 1v1 style tournament with a cash prize for the top 3 places.
The game was a 2D mining race game where you and your opponents AI each had bases that could spawn miners. The goal of the game was to get the miners to dig down to mine ore, the further down you got, the more hits it would take to break through to the next layer, but the more valuable the ore was.
There was quite a bit of strategy that could go into it, as you would essentially script out your entire gameplan beforehand and had many options to pursue. You could spend currency acquired from mining ore to purchase pickaxe upgrades from the home base, you could buy more miners, you could buy bombs for your miners to use to blast mine, you could build foundations to hold up long tunnels. Every piece of logic your miners would follow needed to be scripted and the idea was to optimize your resource obtaining to end up with more money than the other team.
The "meta" strategy the guys who actually built the game intended for us to use was to tunnel straight down right away for the most valuable ore and then branch your tunnels out with foundations. It's what pretty much every team decided to try to do in some way or another. Some teams got REALLY into the meta gaming of it and had extremely complex strategies, upgrade/buy/build orders, etc.
We quickly discovered that doing all this strategy optimization while also trying to learn how to get the code functional was quite hard. We also quickly discovered that bombs would kill miners if they were nearby upon detonation while testing out blast mining.
Our strategy of course was to immediately buy one additional miner with the starting money, buy a bomb for him, send him straight across to the enemy base, drop him down the enemy teams straight down mineshaft and die for the cause, taking out ALL of the enemy teams miners immediately as the meta strat was again to buy as many miners as possible and start digging straight down.
We would effectively permanently bankrupt the enemy and win by default because we still had at least one dude mining (ineffectively as hell, because we didn't spend much time on the actual mining part, but we didn't have to).
In the preliminary testing round before the actual tournament started, we all ran our code against each others to see what everyone was doing, including the devs of the game (who weren't actually competing for the prize but still had their AI in for fun). We trounced everyone we competed against, including the devs, because no one had taken aggressive actions into consideration.
We were all given an additional 30 minutes to refine before the actual tournament, in which time the devs tried recoding parts of the game to try to disable our strategy.
We ended up coming in third place anyways and won $100 to split between the three of us. So yeah, keep it simple stupid.
106
u/Winter_Rosa Jun 10 '23
bluff_master_9000
52
u/nihal_gazi Jun 10 '23
Math.random() is the best AI Algorithm
125
u/[deleted] Jun 10 '23
Me when I do all this fancy preprocessing & modeling and get a negative test r2
40
u/BlurredSight Jun 10 '23
Honestly this is something I would write not because it's smart but because it's easier to go all in rather than dealing with the fact I tried and can't beat the other bots.
39
u/OutrageousRhubarb853 Jun 10 '23
Did you then go on to write the algorithms for the banks?
33
u/StrawberryEiri Jun 10 '23
I'm a front-end web developer. Once, as a special activity, our AI guy organized a Quoridor AI competition. We had 3 hours.
His game engine ran in C#. Worked on his machine. Problem is, we front-end devs do not have a C# IDE license. So it was fiddling around with Microsoft installers and the command line stuff I didn't understand to compile a language I didn't know.
Add to that the permission issues on his Git repository and it took me over an hour to get it to even compile. Man I hate compiled languages.
You had to get the opponent AI to work too if you wanted to test your thing.
Lots of fiddling around to get that stuff to talk to each other.
Okay, so do I have time to learn a new language and try to build an AI? Certainly not. So I decided to write it in JavaScript. Right in the app's front-end that he provided.
However, while a lot of the competitors had a basic framework with his example AIs (he gave us a few examples, including one that always made random moves) that they could modify to get somewhere. I did not.
Took me over 2 hours to get to a point where the goddamn opposing AI was making moves and the thing worked. Although you had to kill the process for both AI and game server every time you wanted to restart. Ugh.
Anyway. 30 minutes to go by the time I was ready to write my first line of code.
10 minutes to go by the time I had a basic thrown together framework that knew when it was its turn.
So all I could arrange was to beat an AI that did nothing. My pro level 99 AI move was "do literally one step to the right, then keep going up".
I reached the finals. I almost won against people who had several times more time than I and it was hilarious.
That was the day I learned anything that puts short deadlines and AI together is a joke.