AI Competition!

Posted by ludamad on Oct. 3, 2008, 8:16 p.m.

Hello boys and girls. If you know me, you would know that I am very interested in artificial intelligence, and game theory. So I decided to create a competition combining the two! Horribly complicated? Nope. Let me explain.

THE TASK: To create a GML script that plays the most effective strategy - against other entries - for the game described below.

THE GAME:

Every turn you have three options:

DEFEND: You gain 1 point this round and stop the opponent from stealing.

STEAL: You take 2 points from your opponent (added to your own score). This does not work if your opponent chose to defend.

BANK: You gain 2 points.

Every AI entry plays against other AI entries for 200 rounds. Your goal is to have the highest score at the end of all the playing. That is, you add the total score from all the rounds.

THE ENGINE:

http://64digits.com/users/ludamad/AI-Engine.gm6

To add a script to the players there, create a new script, and alter both the constant NUM_PLAYERS and the create event of object Arbiter.

Sample AI's are provided.

The script has the following rules:

-You may only access local variables, and constants.

-You may create any local variables you need. These are wiped after the 200 rounds against an AI are played.

-You may not use functions I deem dangerous. Use common sense and don't try to cheat.

To use the engine, load the game and press space. It will then show the scores for each script.

Additional Stuff:

-Up to two entries, I will make sure they are not explicitly cooperating however. You will win if either of your AI's is on top.

-The game is not rock paper scissors. Banking is inherently more useful.

-Try to make a script that beats the preset examples. However, remember your AI cannot fully expect what the other AIs will be like.

Any questions, just ask. I wrote this rather sketchingly.

Writing a good AI:

This is obviously your task to figure out, but the sample AI's can give some insight. Although stealing looks all nice and fancy, you gain AND remove, it can be seen that the Thief performs quite miserably. This is simply because stealing fails against both stealing and defending.

Here are some preset things you can use:

SCRIPTS TO HELP YOU:

X represents BANK, DEFEND, or STEAL

counter( x ) : Returns the best possible move against move x, good for fighting predictability.

simulate( x1, x2 ) : Returns the value (for the player who played x1) if x1 is played against x2. Good for analysis.

STORED VALUES TO HELP YOU:

Move - the index of the last move, starts at -1. Use Move==-1 to check if it is the first move.

MyMove [] - the array of moves you have played

TheirMove [] - the array of moves your opponent has played

Score - your current score (nothing about your opponent's) for this game

DEFEND - 2

STEAL - 1

BANK - 0

Comments

s 16 years, 1 month ago

Kilin, your opinions have been proven false through observation. Let's not try pull a Plato, shall we?

Juju 16 years, 1 month ago

Kilin, you cannot judge effectively the complexity of a system by looking at its most fundamental parts. Are not a brick and a bucket of cement simple? Look how they make complex shapes and architecture. Are not the fundamental forces of the universe blindingly simple? Look how they make complex patterns and species. Are not the moves in Chess simple? Look how they form intricate webs and layers of strategy. The best complexity is unexpected complexity born of simple rules.

Castypher 16 years, 1 month ago

And there goes my comment.

As I stated in that comment, I don't remember ever saying anything offensive in my comments here, so I don't know what the big deal is.

And serprex, an opinion is an opinion, and is not your responsibility to attempt to fix.

Also Juju, nicely said. Since I'm not exactly arguing with you, I don't suppose you expect me to retort?

Juju 16 years, 1 month ago

It all depends on how you define "interesting." If you want AI that'll hunt you down in an FPS, then looking at the Prisoners' Dilema (Deluxe version) isn't going to get you very far.

Shork 16 years, 1 month ago

steal every round. they can't all defend every turn.

Castypher 16 years, 1 month ago

@Juju: I've already talked to Ludamad about this. There was no misunderstanding; he's focusing on the results of a simpler AI and I tend to be more interested in life simulation AI, where every crossroads has endless possibilities.

I don't see why everyone thinks I was trying to correct or insult something in this blog.

EDIT: Also, Shork, the thief has the lowest score.

Cesar 16 years, 1 month ago

Shork: OMGWTF ARE YOU DOING ON 64DIGITS?!

Also, Stealing every turn is the lowest of all AIs

Shork 16 years, 1 month ago

so steal more often. It works for the zerg.

Juju 16 years, 1 month ago

Hehe you crazy foo' Shork.