Contest 43: CyberClue

Online C++ programming contests.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard, raimo

Postby Ryan » Fri Aug 27, 2004 9:44 am

pheer wrote:
The suspect suggested, if one of the players in the game, is moved to that computer.


??


There are six suspects, but only 2, 4, or 5 of them are playing at any given time. If you make a suggestion including one of the suspects actually in the game, that player is moved to the location of the suggestion.
Ryan
Moderator
 
Posts: 323
Joined: Sat Jun 12, 2004 1:34 pm

Postby Togra » Sat Aug 28, 2004 8:16 am

About randomness: I seem to remember a man-page that advised using high-order-bits for a more random number, instead of operator%, or something like that. After playing a few games (under linux, built with gcc3.2), I was shocked by the similarity of all hands I had. It looks better under W98, but maybe it's a good idea anyway for Ryan to make a simple custom rand(). That would also make logging and reproducing a game far easier - just log the seed and the contestants! (unless a contestant makes system- or time-dependant decisions, which should be awkward)
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby Togra » Sat Aug 28, 2004 12:34 pm

Question/request: why is GameState not passed to beginGame? It would be logical and even more convenient to have info on the opponents at the start of the game, if you'd ask me. But maybe Ryan just wants to give us a hard time... :)
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby Jubulani » Sat Aug 28, 2004 4:49 pm

I just made a board and pieces from paper and played the game with my family. I was trying to get a feel for the tactics everyone used to see if I could adapt them to my player. Talking about it afterwards, the tactics everyone used were similar, and could probably, with a lot of work, be incorporated into a computer player. The interesting thing is that everyone finalised their accusations on the same turn because of the nature of the questions that were being asked. This meant that the actual skill level of the players (although eveyone playing had played before and knew what they were doing) mattered far less than who's turn it was when everyone found out the truth.

I think the situation would be the same for two skilled computer players who listened closely to the suggestions being made. All the players who take notice of what's going on around them would probably not find it hard to work out what is going on in the 'mind' of their opponent(s).

I would like to see if this is actually true or not. Will skilled computer players arrive at a result at the same time as eachother or not?

Part of the skill of the game definately lies in hiding your thoughts until you are ready to make an accusation. This would be easier for a computer than a human. A computer doesn't have to try to hide gestures and tone of speech from those people who know it best (ie. family). My Dad gets a certain glint in his eye when he is on the verge of discovering something very significant. If I notice this glint I can investigate the same things my Dad has just investigated, and, in all probability, find out what has excited him. If I don't notice this glint, I may choose to ignore that line of investigation, and pursue something less fruitful. That type of interaction cannot happen between computer players.

I guess what I am asking is whether (skilled) computer players will achieve the type of 'hive mind' that seems to be common when I play this game. Will a few computer players find the answer within a turn or so of eachother, or does the limited interaction of computer players limit this ability? And also, how does the game pan out when you play? Is the end usually fraught and frantic with everyone getting very close to the answer on the same turn (like when I play), or does someone usually win 'out of the blue' with no prior warning?

I will be very interested in how the best players in this competition interact with eachother, and if there can be one player that is significantly 'better' than others.

:D

Feel free to ignore my babblings and write me off as the local loony if what I said makes no sense :P
Jubulani
 
Posts: 23
Joined: Thu Aug 26, 2004 8:28 pm
Location: UK

Postby Yvanhoe » Sun Aug 29, 2004 8:42 am

Togra wrote:About randomness: I seem to remember a man-page that advised using high-order-bits for a more random number, instead of operator%, or something like that. After playing a few games (under linux, built with gcc3.2), I was shocked by the similarity of all hands I had. It looks better under W98, but maybe it's a good idea anyway for Ryan to make a simple custom rand(). That would also make logging and reproducing a game far easier - just log the seed and the contestants! (unless a contestant makes system- or time-dependant decisions, which should be awkward)


I agree, different games result in very similar results and card in hand while under linux. I haven't tried under windows, though. It would be nice to see an "official" fix but i will anyway make a quick hack in order to test my prog...
Yvanhoe
 
Posts: 8
Joined: Thu Aug 26, 2004 3:29 am
Location: Paris, France

Postby Guest » Sun Aug 29, 2004 12:59 pm

Well my player is not much smarter than the clueless player. But it is much more effective. It's not that hard to win against the clueless player, but to win against the other players I'll have to improve my player. Let's see if I have a chance or not.
Guest
 

Postby Reddyx » Mon Aug 30, 2004 1:41 am

As it turns out, my bot's required number of rounds to win is highly dependent on the rand() function, its initial hand and on the dice roll... In some games the bot needs more than 30 rounds, in some it wins after only 6 or so.

So, please Ryan, test the bots many many times and select the final winner by the total score of the players, if possible :) Otherwise it's sheer luck who will win...
Reddyx
 
Posts: 7
Joined: Wed Jul 21, 2004 3:43 am

Postby Ryan » Mon Aug 30, 2004 5:59 am

About randomness: ...

I wasn't planning on using rand() for the final judging, but I didn't want to write my own, so I was planning on using Boost. I didn't want to release the contest with such a dependency, but it looks like it's important enough to everyone's testing, especially with gcc.

So, I've uploaded a new version with both logging and a better rand available with #defines.

Jubulani wrote:I guess what I am asking is whether (skilled) computer players will achieve the type of 'hive mind' that seems to be common when I play this game.

Information is the currency of the game. When you make a suggestion, you have the opportunity to learn more information than your competitors are allowed to observe, since they don't get to see the card shown to you. Using your suggestions well will be the key, I believe.

Reddyx wrote:So, please Ryan, test the bots many many times and select the final winner by the total score of the players, if possible Otherwise it's sheer luck who will win...

Will do.
Ryan
Moderator
 
Posts: 323
Joined: Sat Jun 12, 2004 1:34 pm

Postby Zemalf » Mon Aug 30, 2004 9:14 am

This one goes under 'randomness' category as well...
I tried my bot.ver1 versus bot.ver2 in one-on-one match, and ver2 won every game. I then played one ver2 against 4 ver1's. The ver1's started to win more than their share... So just a thought, but what part will luck play here - that "dice roll" is random after all :)

Ryan: Could you put also "non-boost" versions available. My testing kind of stopped as I downloaded the new versions..
- Zemalf
Zemalf
 
Posts: 4
Joined: Fri Aug 27, 2004 2:22 am
Location: Finland

Postby Ryan » Mon Aug 30, 2004 12:42 pm

Togra wrote:Question/request: why is GameState not passed to beginGame? It would be logical and even more convenient to have info on the opponents at the start of the game, if you'd ask me. But maybe Ryan just wants to give us a hard time... :)

I missed this question the first time. Well, I do like giving people a hard time.. ;) I don't think this will change. At beginGame, you have your hand -- everything else you'll have on your first turn.

Zemalf wrote:Ryan: Could you put also "non-boost" versions available. My testing kind of stopped as I downloaded the new versions..

There is a #define in there that switches between using rand() and using Boost. I accidentally left the #include <boost/random.hpp> outside the #ifdef -- just move that inside to use the rand() without Boost.

I also just updated the current download to put the #include in the right place.
Ryan
Moderator
 
Posts: 323
Joined: Sat Jun 12, 2004 1:34 pm

Postby Jubulani » Tue Aug 31, 2004 12:44 pm

Is it safe to assume that the players will be given names corresponding to the numbers from 0 - (Number of Players) in a random order ie. If there are two players they will always be named MissPink and RevOrange, four players will be named MissPink, RevOrange, LadyRed and SgtBrown, although you don't know the order of the names?

(This is how it is currently.)
Last edited by Jubulani on Tue Aug 31, 2004 10:09 pm, edited 1 time in total.
Jubulani
 
Posts: 23
Joined: Thu Aug 26, 2004 8:28 pm
Location: UK

Postby Jubulani » Tue Aug 31, 2004 6:03 pm

One more thing: If you return an invalid move when asked for your move by the game, the game just ignores it and leaves you where you are. This can be very useful if, for instance, you throw a 3 but you want to investigate the room you are already at. The way I read the game rules was that you have to throw and move, and if that means you have to go somewhere when you really just want to stay where you are, thats tough. When I played the game with my family, it wasn't uncommon to have to move when you don't want to. If this is intentional, then I think it should be documented, and you should always be able to return the room you are at in order to stay there and not move. If it is not intentional you should be disqualified.

The rules do say that a player will be disqualified for an invalid move, but the sources suggest otherwise.
Jubulani
 
Posts: 23
Joined: Thu Aug 26, 2004 8:28 pm
Location: UK

Postby Guest » Tue Aug 31, 2004 11:13 pm

Speaking on what role randomness plays in the game, I have made a few observations.

The clueless player are easily beatable and cannot EVER win against even the simplelest AI:

While the clueless player should be just that, I think 1 common sense improvement could be added that would actually give it a few wins from time to time is the ability to recognize that it's suggestion was the Actual cards when everyone shows no cards(granted that it doesn't have the cards as well). I have seen the clueless players suggest the winning hand but because it does't accuse till it knows every card it is destined to lose to any AI that can do that.

My own bots have on occasion won in two rounds. Though I'd like to claim it was programming skill, the truth is they got lucky with an early suggestion. These quick "lucky" win skew the results and make it difficult to tell if one AI is better than another. Overall though in a test of 50 games my bot average is 9.76 rounds to win with highest being 20 and lowest 5

The base chance of guessing the 3 at random, like the clueless bots do is 420:1 - if you factor in the fact that you know as few as 4 or as many as 10 card to start, you chance goes way down from there.

Finally, something is strange with the Randomness(boost and non-boost) of the game setup, if I run several games quickly together, they get identical results (see below - logging off, only output is number of rounds and winner)

>clue
<<<<<<<<<<<<<<< Turns = 11
MrsViolet wins!

>clue
<<<<<<<<<<<<<<< Turns = 11
MrsViolet wins!

>clue
<<<<<<<<<<<<<<< Turns = 7
MrsViolet wins!

>clue
<<<<<<<<<<<<<<< Turns = 7
MrsViolet wins!

>clue
<<<<<<<<<<<<<<< Turns = 5
MrsViolet wins!

>clue
<<<<<<<<<<<<<<< Turns = 5
MrsViolet wins!

Peace,
Darryl
Guest
 

Postby Jubulani » Wed Sep 01, 2004 2:29 am

More importantly, who would ever put a computer in their veranda anyway? It would short circuit in every storm. Maybe its on wheels? Then you could wheel it out when you wanted to use it, and it was sunny. Someone should suggest the idea of a laptop. Seems to be easier to me.

:D :)
Jubulani
 
Posts: 23
Joined: Thu Aug 26, 2004 8:28 pm
Location: UK

g++ compile errors

Postby gamma » Wed Sep 01, 2004 2:55 am

g++ -v: <snip> gcc version 3.3.4 (Debian 1:3.3.4-6sarge1)
g++ game.cpp:
game.cpp: In member function `Player* Game::run()':
game.cpp:162: error: no match for 'operator<<' in 'log()() << "New game starting. Crime was committed by "'
<snip>

I haven't investigated who is wrong (g++/Ryan/whatever) exactly, but I have a quick fix (i.e. it compiles, $

Code: Select all
   
NullStream &log()   
{   
  static NullStream foo = NullStream();   
  return foo;     
}       
User avatar
gamma
 
Posts: 178
Joined: Mon Dec 01, 2003 9:16 am
Location: The Netherlands

PreviousNext

Return to Contests

Who is online

Users browsing this forum: No registered users and 0 guests