RoShamBo Programming Competition

Started by
26 comments, last by Extrarius 19 years ago
Edit: Official Competition Website: here In the thread on Rock Paper Scissors, a person linked to The International RoShamBo Programming Competition, which I thought sounded like a really nice competition because the game itself is very simple but the possible strategies in a programmed version are numerous and range from the impressively simple to the astoundingly complex. I was saddened to see that the page had last been updated in 2001, and the last competition was in 2000. How about we have our own competition here on gamedev? I've already created a simplified C++ framework, which you can download here. The files are: roshambo.h - includes the definition of some helper functions and the abstract bot class randgen.h/cpp - a random number generator to help standardize the framework across platforms sampbots.h - 3 sample bot implementations that are very simple main.cpp - the actual tournament code It's still very simple right now. I plan to add timing around each NextThrow call because timing will be a rule (can't have the competition last years =-). I also plan to do some further fixups later, but I've been up to long so I don't want to touch it anymore right now. The idea is that you create a concrete child class of RoShamBo::Bot using standard C++, with the RandGen:: functions for random numbers (no rand/random calls please) and it will have to compete against all other entries. The bot should be self-contained, exposing no symbols outside it's class' namespace so that it can easily be plugged in without worrying about name conflicts. Naming the file and class the same thing would probably be a good idea as well. For those that don't know, RoShamBo is essentially a game where on each turn two players select a move which is in this case represented by the number 0, 1, or 2. If both players select the same number, it is a tie and 0 points are awarded. Otherwise, a selection of 1 wins versus a selection of 0, a selection of 2 wins versus a selection of 1, and a selection of 0 wins versus a selection of 2. The winning player scores one point, and the losing player scores minus one point. After several throws, the person with the highest score wins. As far as contest rules: No entries larger than 30720 8-bit bytes (30KB) total and no more than 3000 lines total in the source code. Comments are required to explain at LEAST the basic strategy of the bot. The code must be licensed in such a way that I can freely distribute it. No calling ResetRandom or otherwise interfering with other bot's functionality. Reading/writing from files and other 'system access' is strongly discouraged, and may be a cause for disqualification. The bot's behavior must be deterministic so that multiple executions of the tournament program will result in the same outcomes if the same random seed is used (and it always is in the current setup). The code should compile with Visual Studio .Net 2003 and run in a windows console program. The bot can take no longer than an average of 5 milliseconds to process one entire turn (a single call to RegisterResult and a single call to NextThrow) such that a call to 'DoThrow' should, on average, take no more than 10 milliseconds. I reserve the right to modify the rules whenever and however I choose to do so. I'd like to have the code purely standard C++ (with a few assumptions like a 32-bit integer for sake of convenience, and that multiplication overflow causes no problems). If you notice anything not at all standard or portable, please help me make the corrections so everybody can see the bots in action =-) What is there to win? Well, nothing unless somebody wants to sponsor us and donate something. For now, its for fun and the challenge only. [Edited by - Extrarius on March 25, 2005 6:59:42 PM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Advertisement
Quote:Original post by Extrarius
For those that don't know, RoShamBo is essentially a game where on each turn two players select a move which is in this case represented by the number 0, 1, or 2. If both players select the same number, it is a tie and 0 points are awarded. Otherwise, a selection of 1 wins versus a selection of 0, a selection of 2 wins versus a selection of 1, and a selection of 0 wins versus a selection of 0. The winning player scores one point, and the losing player scores minus one point. After several throws, the person with the highest score wins.

I assume you mean that 0 wins versus 2.

Sounds fun. Spring Break just started, so maybe I'll participate. No promises.

*edit: At the very least, if anybody who does play doesnt have access to VS, I'm willing to help verify that the code compiles properly. Obviously you'll just have to trust that I won't cheat.

CM
Quote:Original post by Conner McCloud
[...]I assume you mean that 0 wins versus 2.

Sounds fun. Spring Break just started, so maybe I'll participate. No promises.

CM
Indeed. You'd think being too tired to program would be a hint to me that I'm too tired to post such a long post error free, but apparently not =-) Fixed
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
How is it possible to devise a strategy? There doesn't appear to be one. This would essentially select the winner of the competition by an elaborate prize draw.
Quote:Original post by furby100
How is it possible to devise a strategy? There doesn't appear to be one. This would essentially select the winner of the competition by an elaborate prize draw.

You play a lot of rounds against a specific opponent, and the challenge is to learn its strategy. Initially, you are probably right. But after a few rounds a good bot should pull ahead.

Thinking about it, this may take me more than a week to do properly [sad].

CM
Quote:Original post by furby100
How is it possible to devise a strategy? There doesn't appear to be one. This would essentially select the winner of the competition by an elaborate prize draw.
If every bot played random, introducing one with some kind of strategy wouldn't make any different. The reason stragies are possible is that there will be some bots that don't play random (2 existing sample bots at the very least, and possibly more in the future). If you can find ways to take advantage of their strategies, you can get a greater than 1/3 win chance against those bots which will put you ahead of bots that don't take advantages of weaknesses.

Quote:Original post by Conner McCloud
[...]Thinking about it, this may take me more than a week to do properly [sad].[...]
Well, there is a lot of source code on the international competition site with comments on the ideas behind it, so you could start by just rehashing what has already been done.
I don't have any deadline in mind, and perhaps it could even be an on ongoing 'competition' where there is just a webpage that ranks submissions that is updated every few weeks if new entries come up. I haven't really decided on the exact format I'd like to persue for the competition.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
I uploaded a new version of the framework. Changes include:
Bots no longer fight themselves or matches that have been fought with opposite sides.
The random number generate has become a class so it doesn't matter which bot's code is called first since they modify only their own generators now instead of the global one.
New sample bots added with more comments for each bot and a possible difficulty analysis on beating each one.

The link is the same: Extrarius's RoShamBo Competition Framework.

[Edited by - Extrarius on March 17, 2005 3:46:46 PM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
That is awsome. A great idea.

I think having an ongoing tournament on some webiste is a great idea, as there is no time restrictions and authors can update their bots and such. Maybe all new entries are accepted by Sunday at midnight, the battles take place Monday, and that leaves the rest of the week to update code. Just an idea :)

But if it is going to be ongoing, definently count me in!
damn, what a fun idea, im glad i thought of it :-D
er, seriously, thanks for taking my insane interest in the problem one step further and attempting to set this up. an ongoing tournament? has that been done before? count me in.
When's the deadline?

Oh, and for the prizes, I'll donate an entry in my journal to the winner to explain their winning strategy...

This topic is closed to new replies.

Advertisement