Jump to content
  • Advertisement
Sign in to follow this  
Extrarius

RoShamBo Programming Competition

This topic is 5017 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!