This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2012-04-25 12:05:41

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

MoreGamesNow wrote:

I'm a little concerned that this game might be simple enough that almost every game would end in a tie.

Nope! It has been proved that all completed games must end in a win.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#27 2012-04-25 12:13:29

schusteralex2
Scratcher
Registered: 2011-09-17
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

What would be really cool is if you played Strategery  big_smile


http://i44.tinypic.com/2uj37ds.gif

Offline

 

#28 2012-04-25 13:22:07

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

roijac wrote:

come back to me when you wrote one...

Okay, sounds fun!  big_smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#29 2012-04-25 13:59:36

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Hey, hey, hey, my challenge first, alright?  tongue

Midecah has already done a Chess engine in Scratch, if you're curious.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#30 2012-04-25 14:03:30

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Hardmath123 wrote:

Hey, hey, hey, my challenge first, alright?  tongue

Midecah has already done a Chess engine in Scratch, if you're curious.

Weeelll...  tongue
I saw that, I think. It was very slow, iirc; but rather impressive.  smile

...see, Chess would be easy!  big_smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#31 2012-04-25 14:08:28

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Let's see... 10x10 grid gives 100 possible first moves, right? Followed by 99 for player 2, 98 and so on. So that gives 100! (100 factorial) possible games, right? (Less than this, though, as some would finish earlier when a player wins.) Either way, that's a rather large numbertongue
So we can't just use a straight Game Tree, then... Need a way of evaluating the game state at any point. Hmm...

Last edited by blob8108 (2012-04-25 14:09:09)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#32 2012-04-25 16:58:26

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: AI Strategy Tournament: Rescheduled to June 1st

I hate to just barge in and criticize your tournament idea, but I think it would be interesting to try a Tetris AI match.  Hardmath123 could generate a long list of blocks types, and each person would then have to write an AI (without knowing the order of blocks beforehand) to play the game autonomously.  As long as each AI plays against the same sequence of blocks, there is no advantage, and the winner is the one who lasts the longest.  Just chipping in my opinion here.

Offline

 

#33 2012-04-25 18:23:48

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

amcerbu wrote:

I hate to just barge in and criticize your tournament idea, but I think it would be interesting to try a Tetris AI match.  Hardmath123 could generate a long list of blocks types, and each person would then have to write an AI (without knowing the order of blocks beforehand) to play the game autonomously.  As long as each AI plays against the same sequence of blocks, there is no advantage, and the winner is the one who lasts the longest.  Just chipping in my opinion here.

I'm not sure a game-tree would be necessary to play this effectively (is the point of this to utilize a game-tree-based AI?)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#34 2012-04-25 18:35:02

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

roijac wrote:

no, it's not complex at all...
just think about a good algorithm to find all available next moves, that includes:
pinned pieces
check
castling
promotion
en passant (we could leave this out)

come back to me when you wrote one...

Castling and promotion aren't easy, but they're do-able.

Checks are more difficult, since they, in effect, require the user to think two ply deep.  One solution is to have a "can this square be attacked" function (I might actually have already written such a function on my other computer, but I'm in New Mexico right now and can't check).  Alternatively, if the computer is searching any amount of depth, it simply won't play any move that ends in its king being taken; you can basically ignore them.

I might also have a movement function done (no promises though).

I would recommend forcing the teams to write the movement functions as well though, as the efficiency of the function is important to the depth that the computer can search, and how the function returns possible moves greatly effects how the rest of the code is written (notably the "make move" and "unmake move" functions).

En passant is tricky, because it requires knowledge of prior moves.

A method of movement that I have found effective is to have an array and every two elements represents one move.  The first is where the piece is coming from, the second is where the piece is going.  To store whether or not a piece is taken, the second item can be incremented by 100 based on the piece (this is important for "unmaking" a move.  So:

0, 4 moves the piece on square zero to square 4.
3,104 means the piece on square 3 takes the pawn on square 4.
34,423 means the piece on square 34 takes the rook on square 23.

Promotion is indicated by whether the first item is between 99 and 200.
Castling is indicated by whether the first item is between 199 and 300.

Of course, this is a rather complex system and requires a totally different "make move" and "unmake move" function than an alternative movement-generation function.

My point is, since the movement function is such an integral part of the script, each team should be forced to code it.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#35 2012-04-25 18:59:16

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: AI Strategy Tournament: Rescheduled to June 1st

MoreGamesNow wrote:

amcerbu wrote:

I hate to just barge in and criticize your tournament idea, but I think it would be interesting to try a Tetris AI match.  Hardmath123 could generate a long list of blocks types, and each person would then have to write an AI (without knowing the order of blocks beforehand) to play the game autonomously.  As long as each AI plays against the same sequence of blocks, there is no advantage, and the winner is the one who lasts the longest.  Just chipping in my opinion here.

I'm not sure a game-tree would be necessary to play this effectively (is the point of this to utilize a game-tree-based AI?)

I'm not exactly sure whether the competition is meant to focus on game-tree AI's.  But you could implement something similar to a game tree: your function assumes there is an even distribution of pieces.  If it adds up the previous pieces that have been sent, it can guess the likelihood that the next piece will be of a given type (or the piece after next, if the next is provided, as in a standard Tetris game).  You're right that it isn't the same as being able to calculate every possible outcome, but the same is true of any multi-player game.

Last edited by amcerbu (2012-04-25 19:00:11)

Offline

 

#36 2012-04-26 01:53:57

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Hey amcerbu,

A critical part of this idea was pitting two programs together, because:
a) You have to react to moves by an opponent rather than random ones
b) It's kinda cool  big_smile

Tetris is single-player. Also, it doesn't need much of a game tree, or for that matter much strategy programming, only problem solving. So, I think we'll stick with 10x10 Hex.  smile

For all Chess lovers, we could hold a second round with Chess if the Hex challenge works out.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#37 2012-04-26 02:19:34

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Hardmath123 wrote:

For all Chess lovers, we could hold a second round with Chess if the Hex challenge works out.

It's a deal  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#38 2012-04-26 09:13:43

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

So when is this starting?


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#39 2012-04-26 10:18:02

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

May 1st, we're advertising and making teams until then. So you're joining? If you do, you'll be in the Red Team.

Blue Team
Roijac
bobbybee
Red Team
blob8108
(Hardmath123, if there are an odd number of players when we need to start)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#40 2012-04-26 10:51:38

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: AI Strategy Tournament: Rescheduled to June 1st

Well I'd like to play.


http://i.imgur.com/zeIZW.png

Offline

 

#41 2012-04-26 11:33:45

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Sure!

Blue Team
Roijac
bobbybee
Red Team
blob8108
rookwood101
(Hardmath123, if there are an odd number of players when we need to start)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#42 2012-04-26 11:54:02

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Hardmath123 wrote:

May 1st, we're advertising and making teams until then. So you're joining? If you do, you'll be in the Red Team.

Sorry, I really can't.  AP exams begin on May 7th, and I have to study for them (as well as catch up on homework after a week-long trip to New Mexico and after procrastinating on an online class).  If there will be a second one I'll probably do that though.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#43 2012-04-26 12:36:04

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

May 1st - 31st is the end of the school year for everyone, so people will be studying for the End-of year tests and stuff. I suggest either doing it sooner, or waiting till summer vacation starts up.  smile

Last edited by Magnie (2012-04-26 13:48:22)

Offline

 

#44 2012-04-26 13:16:47

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Magnie wrote:

I suggest either doing to sooner, or waiting till summer vacation starts up.  smile

I second this. Do it it over the summer!  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#45 2012-04-26 13:35:07

roijac_test
Scratcher
Registered: 2011-08-31
Posts: 49

Re: AI Strategy Tournament: Rescheduled to June 1st

yep ^^
AT's own collab camp  big_smile


http://gigabyte.50webs.com/funnyerrormessages/work013.jpg

Offline

 

#46 2012-04-26 15:11:13

LEGOengineer261
Scratcher
Registered: 2011-11-16
Posts: 100+

Re: AI Strategy Tournament: Rescheduled to June 1st

I might join, but I'm not sure, it depends on the game. I wouldn't do chess, cause I'm not very good at the logic for it compared to people who study the game.


http://i1156.photobucket.com/albums/p562/LEGOengineer261/IronmanSERIOUSBOSS.jpg

Offline

 

#47 2012-04-27 03:29:38

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Magnie wrote:

May 1st - 31st is the end of the school year for everyone, so people will be studying for the End-of year tests and stuff. I suggest either doing it sooner, or waiting till summer vacation starts up.  smile

Good point, Magnie. How about June 1 to June 15th?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#48 2012-04-27 09:58:22

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Hardmath123 wrote:

Magnie wrote:

May 1st - 31st is the end of the school year for everyone, so people will be studying for the End-of year tests and stuff. I suggest either doing it sooner, or waiting till summer vacation starts up.  smile

Good point, Magnie. How about June 1 to June 15th?

I think that would work.  smile

Maybe the whole month of June and then judge the projects in July? (Not sure which day would be "perfect" though)

Offline

 

#49 2012-04-27 12:17:28

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

Ok. I'll ask a mod to rename this to "Rescheduled: June 1st". 'till then we can discuss the game, etc.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#50 2012-04-27 13:18:44

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: AI Strategy Tournament: Rescheduled to June 1st

And make the library, with Canvas and everything!  big_smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

Board footer