Tabletop Simulator

Tabletop Simulator

30 ratings
Mastermind Challenge AI
   
Award
Favorite
Favorited
Unfavorite
Game Category: Board Games, Strategy Games
Number of Players: 1, 2
Assets: Scripting
File Size
Posted
Updated
159.228 KB
6 Mar, 2016 @ 8:20am
11 Mar, 2016 @ 11:21am
3 Change Notes ( view )

Subscribe to download
Mastermind Challenge AI

Description
New solitaire version with scripted AI,
The computer-AI acts as codebreaker and codemaker simultanously (with autoplay option).
Try to beat it!!

Players: 1 - 2
Suggested Ages: 8 and up
Playing Time : 10 minutes

Gameplay & Rules:
https://en.wikipedia.org/wiki/Mastermind_(board_game)

The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert. It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more.

In this 'challenge' version each player plays the codemaker and codebreaker simultanously.
The mod includes a custom model for the board (a replica of Mastermind by Parker/1972) and many marbles. If you like the game please support it by buying it, thank you!

I programmed a relative easy AI calculation with a random guess method of all remaining code variations. It breaks the code within 2-8 turns (average 4.6). This is beta - so please report any errors in the comments !
Maybe I script the minimax algorythm (see wiki) in the future, which breaks the code in max. 5 turns. But this has bigger and very time-consuming calculations and I think would be too hard to beat.
To play against the AI: See the instructions in the game chat window

PS: To proof that the AI is not cheating, you can set a hidden code of white key-pegs and write down your real code;)

Also take a look at my other TTS-mods. See my profile (workshop objects and screenshots)
8 Comments
Miraglyth 20 Jun, 2021 @ 8:41pm 
I'm rating this down based on the AI but I feel that deserves explanation.

The description claims the AI solves codes in 2-8 turns. After a few dozen games I have not once seen it take more than 5. I've also let it run on auto for several dozen games more and it has never happened either; every game that makes it to 5 turns without exception sees both AIs guessing correctly with the game ending as a draw.

It's possible the mod was updated to use the minimax algorithm, which would explain it. If so then I can respect the effort just as I can appreciate all the automation. If this mod was meant to showcase scripting ability I'd certainly rate it up.

But as a game to play it makes the AI almost pointless; when it is employing the theoretically optimal strategy, the only way to beat it is to be lucky and guess the code while other possibilities existed. That's neither a challenge nor satisfying, so the description saying the AI could take up to 8 turns feels deceptive.
Beer Virus 4 Apr, 2020 @ 11:27pm 
This game is BROKEN... It does NOT give the right B+W pegs... I checked.
Riddix  [author] 9 Apr, 2016 @ 12:54pm 
Another try: :steamhappy:
Look at the 2nd screenshot on this mod page: Here you see the chat window, where you must click on the 'Game' TAB. In this window you see the text: Please set your code on the left board and click the Start button (or click Start to use a random code) .... and so on.
If you dont know the rules of the game please read the wiki at the tablet.
Osmosis_Ghost 9 Apr, 2016 @ 9:15am 
No help at all. Everything is checked, In game chat, but still nothing appears.
Riddix  [author] 9 Apr, 2016 @ 2:18am 
Hi xThat1Daddy, the chat window is on the lower left side of the screen. You have to switch the tab from Global to Game to see the instructions. If you don't have that chat window you must activate it in Menu/Configuration/UI.
Hope I could help
Osmosis_Ghost 8 Apr, 2016 @ 9:36pm 
"To play against the AI: See the instructions in the game chat window "
Where is it? I am not finding it at all
Dan 9 Mar, 2016 @ 11:35am 
This is how SkyNet started. What have we done...
Riddix  [author] 9 Mar, 2016 @ 10:57am 
Hello,
I made some scripting improvements:
- The key (blach/white) for the AI-player is now set automatically (if you didn't set it)
- There is a new button 'AUTO', which let the AI play against itself (autplay:steamhappy:)
To stop it just click the AUTO-button again.
I hope you like it :roll: