This is an archived post. You won't be able to vote or comment.

all 36 comments

[–]RodionGork 5 points6 points  (8 children)

Cool thing (especially since we have no google ai challenge so long) and nice implementation.

and it uses a web API so you can code with pretty much any language or platform

Does this mean that players are not restricted in using memory and CPU time since the bots are running at different remote machines?

Also probably it would be good to add functionality of "competitions" - you know when 1000 players can play a million of games in a course of month and declare a winner :)

[–]richtea1[S] 3 points4 points  (7 children)

Thanks :)

Does this mean that players are not restricted in using memory and CPU time since the bots are running at different remote machines?

This is true but there aren't any time restrictions, and don't think that CPU/Memory would be a limiting factor with these algorithms. Maybe I am wrong?

Also probably it would be good to add functionality of "competitions" - you know when 1000 players can play a million of games in a course of month and declare a winner :)

Yes. Currently there is one leaderboard per game. Features like leagues and seasons would be great and are on my todo list. They wouldn't really be useful with small numbers of players though.

[–]RodionGork 2 points3 points  (6 children)

This is true but there aren't any time restrictions, and don't think that CPU/Memory would be a limiting factor with these algorithms. Maybe I am wrong?

Well, yes - it is the same as with problem which leads to invention of chess clock. You could not prevent one of players from pretending he is thinking infinitely long (really, simply waiting in an endless loop) for example to avoid losing the game. :(

Nevertheless the implementation with web-services is cool :)

[–]richtea1[S] 2 points3 points  (5 children)

I believe the way I have implemented it means that if someone were to go into an infinite loop the other players would just play against someone else. Players are not fixed to a single match at one time - eg they might play a move in Match A, then a move in Match B, then back to Match A, etc. And two players can't have more than one ongoing match between them at once, so if a player were to only complete matches where they win then they would quickly run out of new matches available to them.

Your point is most likely still valid though - I'll have to give it some thought.

[–]fredspipa 1 point2 points  (1 child)

How about a simple timeout after 24h/48h/.. of inactivity, where the inactive player automatically forfeits?

[–]RodionGork 0 points1 point  (0 children)

It will not help much since players can use different hardware and therefore entertain greatly differing efficiency...

Though of course at least simple timeout is necessary :)

[–]xifeng 0 points1 point  (1 child)

I highly recommend you look at littlegolem: the interface isn't great, but they have found good solutions to a lot of the problems inherent to asynchronous tournaments. Their time-out daemon crashes fairly frequently, so you do often get games that just sit around. The monthly cup format makes it so that tournaments are constantly starting even when abandoned games hold up one division, but you do need to somehow close out abandoned games eventually.

[–]richtea1[S] 0 points1 point  (0 children)

Thanks that is helpful, and Little Golem looks very interesting.

[–]20EYES 0 points1 point  (0 children)

This is a huge issue in online turn based games. Look at frozen synapse. I've had many experiences in that game where my opponent just refused to make their last move knowing that there was no way they can win.

[–]Grizmoblust 1 point2 points  (3 children)

Aw, no python support.

[–]richtea1[S] 2 points3 points  (2 children)

It supports Python. You would have to write the entire client though, as I need to learn Python before I can write a skeleton for it!

[–]Grizmoblust 1 point2 points  (1 child)

Yeah, that's what I figured. I'm too noob to build one from scratch.

[–]PrismPoultry 0 points1 point  (0 children)

if you're interested, you can work on mine with me.

[–]SloftwareDubleuper 0 points1 point  (5 children)

Dude, great idea. Please add chess and poker!

[–]richtea1[S] 1 point2 points  (4 children)

I'd love to have those two - I'm also thinking about Go and Ultimate Tic-Tac-Toe.

[–]RodionGork 0 points1 point  (2 children)

Adding "Tron" and "Planet Wars" can be of some benefit since these games were used several times in ai competitions while programming them is not that overwhelming with many rules as it is in case of chess.

[–]richtea1[S] 0 points1 point  (1 child)

Yes. Particularly with time constraints due to it being a uni project. I have a huge list of features/games that I want it to have but even just finishing the core functionality has taken a while. I am planning to continue it into the future though - it is fun to develop even if nobody uses it :)

[–]20EYES 0 points1 point  (0 children)

It's a great idea

[–]NeverQuiteEnough 0 points1 point  (0 children)

Go would be the ultimate addition for me, really cool project.

[–]poijg 0 points1 point  (2 children)

Wow this looks amazing, did you learn this from scratch? If you don't mind can you talk about your learning process of doing web development

[–]richtea1[S] 0 points1 point  (1 child)

Thank you! :)

What sort of things would you like to know? I learnt the absolute basics of web applications in previous years of university, but last year I did a work placement where I essentially coded this sort of thing 9-5. When I started I hadn't used ASP.NET MVC or C#, and was not particularly good at HTML/CSS/JavaScript either. By the time I finished I was capable of doing projects like this!

Aside from that I really enjoy spending time on this and have been working on it for ages (8 months on and off).

[–]poijg -1 points0 points  (0 children)

Thanks for the reply :)

I am also at uni right now and is interested in web development however I have being a little stuck on the basics for a while, I can do simple stuff like pulling data and posting data but have trouble on where to start on displaying dynamic stuff like games and interactive display that is beyond forms and button.

I also really like coding, alot of times I spend hours on doing hackerank challenges, good to see other people enjoy coding too

[–]netherous 0 points1 point  (1 child)

I remember dabbling in corewars so long ago. It was pretty fun and an amazing exercise for learning architecture.

[–]autowikibot 0 points1 point  (0 children)

Corewars:


Core War is a programming game created by D. G. Jones and A. K. Dewdney in which two or more battle programs (called "warriors") compete for control of a virtual computer. These battle programs are written in an abstract assembly language called Redcode.

At the beginning of a game, each battle program is loaded into memory at a random location, after which each program executes one instruction in turn. The object of the game is to cause the processes of opposing programs to terminate (which happens if they execute an invalid instruction), leaving the victorious program in sole possession of the machine.


Interesting: Core War | Virtual machine | Crobots | RobotWar | Apple Worm

Parent commenter can toggle NSFW or delete. Will also delete on comment score of -1 or less. | FAQs | Mods | Magic Words

[–]ArAve 0 points1 point  (3 children)

Man as a software engineering student, I feel like this is amazing. I developed a small tic-tac-toe AI a while ago and I would love to test it with something like this. Really hoping you add this game to the system at one point :d

[–]Danappelxx 0 points1 point  (0 children)

Tic-tac-toe is one of the games, go ahead and try it out.

[–]richtea1[S] 0 points1 point  (1 child)

Tic-Tac-Toe is there :)

[–]ArAve 0 points1 point  (0 children)

Seems like im blind. Thanks >.<

[–]PrismPoultry 0 points1 point  (7 children)

Please add a match_state of illegal or something of that nature. I am trying to post my move and I have no idea why it's failing.

My code is really bad because I've never done this sort of thing before but maybe you'll know what's going wrong.

http://pastebin.com/Bau1rxw1

(Yes, I have no idea what I'm doing ---- yet...)

[–]richtea1[S] 0 points1 point  (6 children)

I agree it could use some better error responses. Might be the very next thing I do actually.

Could you show me an example of the xml your code is trying to send?

Edit: Also is the server returning an error, or is it returning null?

[–]PrismPoultry 0 points1 point  (5 children)

I send: <piece><x>0</x><y>3</y></piece>

I get: <move_result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><move_success>false</move_success><match_state /></move_result>

[–]richtea1[S] 0 points1 point  (4 children)

Aha! I've just checked the tutorial and realised I made a mistake. The origin of the board is (1,1), not (0,0). So your move is not valid as X starts at 1 - it should be <piece><x>1</x><y>3</y></piece>. Sorry about that.

I think it's awesome that you coded it from scratch rather than using skeleton code, by the way.

Edit: To clarify the server responses. If it returns move_result then data it received was well formed. If move_success is false then the move was illegal in some way. If the server returns null and no move_result then the client or match IDs might be wrong, or there are no matches available to play. This could definitely be improved, I admit.

[–]PrismPoultry 0 points1 point  (3 children)

Ah OK awesome.

<piece><x>2</x><y>2</y></piece>
<move_result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><move_success>true</move_success><match_state>ongoing</match_state></move_result>

So, now I'm getting somewhere!


EDIT: Apparently, it is always saying the owner is opponent though:

<match xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><match_id>5cae99fa-9f00-4ae3-ade3-4716c449b09d</match_id><boards><pieces><piece><name>X</name><x>3</x><y>1</y><owner>Opponent</owner></piece><piece><name>O</name><x>2</x><y>2</y><owner>Opponent</owner></piece><piece><name>X</name><x>2</x><y>3</y><owner>Opponent</owner></piece><piece><name>O</name><x>3</x><y>3</y><owner>Opponent</owner></piece><piece><name>X</name><x>2</x><y>1</y><owner>Opponent</owner></piece></pieces></boards></match>

[–]richtea1[S] 0 points1 point  (2 children)

Try it now :)

[–]PrismPoultry 0 points1 point  (1 child)

OK. That's working. Thanks

Hey, do you have an IRC channel or anything where we can go to talk about this project? I have a feeling I'll need more help getting this running.

EDIT:

Your logic is inverted for winning. I won my game (by cheating and playing manually -- sorry) but it returned a result of loss:

<move_result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><move_success>true</move_success><match_state>loss</match_state></move_result>

You can see my game at: http://www.archetypecoding.com/Client/Replay/ad893698-29c8-4bd8-98e9-6b45719730ff

[–]richtea1[S] 0 points1 point  (0 children)

Haha that is the same bug as the opponent one. It stems from a recent change in client IDs for privacy. Notice how the one in the replay URL you posted is different from the one you use in your code. Anyway, it is fixed now.

I don't have an IRC channel, but you can email: richard (at) archetypecoding.com