Psychic Deducer

Advanced game related topics
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Psychic Deducer

Post by heartbone »

Fellow programmers, if you're looking for frenetic action containing gorgeously explosive eye candy, then this is not the game for you. I offer you no smoothly zooming or fading menus, no professional voice acting, no ear soothing music, no powerups, no medals to earn, and absolutely no unlockable content. Not a single shiny, glowing, or see through button. Although a long time programmer, I am not accomplished in graphic design, computer animation, or music composition. As a result I went for a minimalist implementation, so that I could focus on the game's design. Containing a dirt simple interface, Psychic Deducer can be considered entertainment only by those who take pleasure in thinking. That probably includes most of you. Intellectually inclined people such as college seniors pursuing a Bachelor of Science, or anyone who is psychic, might find it to be an enjoyable diversion.

Mainly because my parents gave me MATTEL's Lie Detector Game back in the day, I'd never played HASBRO's Clue until this past October. I found myself rather intrigued with the basic deductive activity that is at the core of Clue. However, I felt the dice throwing and moving pieces around the board was a rather pointless addition to the gameplay. In my opinion a detraction, but I'm sure that many would disagree. The cynical in me presumes the dice throwing based pawn movement was included in Clue so that it would play more like a boardgame. I also didn't much like the objects (characters, weapons, and rooms) that were used in the deductive (murder solving) process. My idea of using an "animated" combination lock with three tumblers was a wee bit harder to mentally keep track of, so I decided to go with combining familiar, easy to remember, yet diverse and more politically correct objects (colors, shapes, and numbers) which could easily be mentally mapped to the Clue paradigm for those so experienced.

The game can be played using only a gamepad controller, and the best way to interact with Psychic Deducer is when reclining or laying in bed while using a gamepad. Deducing from this position may allow the user to perceive the solution's vibrations more easily.

The game includes a factor lists editor*, which can be accessed when playing on the expert level. When playing on novice level, the factor lists are automatically maintained for you, so there is little need for any note taking. The artifical intelligence opponents maintain their factor lists using the same data accumulation and deduction method used for the novice player's lists.

The Psychic Deducer program was designed to support networked play in a future release. This initial version was created to implement and optimize the AI routines, and to provide a platform for people to develop and practice a game strategy while waiting for the networked version.

Because the AI has no psychic ability, I had to design algorithms to implement effective strategies to analyze the factors revealed by the other players in order to make sensible guesses.
I may have done such a good job that some players will feel that the AI cheats. That is the main reason why I implemented the post game review, so that you may examine the AI factor lists used during its decisions. From the post game review screen (shown below) one can also examine the game's guess history. Even with all of that available, it is impossible for you to determine that every AI guess is honest without seeing the program's source code. My response to that would be for you to wait for the networked version, and play that with two trusted friends. I will state for the record that no AI peeking of the solution ever happens. In my opinion releasing a game that includes cheating computer AI would be stupid and create bad karma.

I just played a game where the AI beat me in three rounds. During the game I was trying very hard to use my psychic powers, and I had guessed the yellow and diamond in the third, and was working on the digit. Being comfortable with numbers, I usually go with the flow, and seem to do OK.

Image

I had just (unknowingly) missed the solution by one, but still feeling very positive about my progress.... when.... BAM!! :!: :?: :?:

I know it sounds crazy, but that AI win was very disconcerting for me. It was such a concentration disruptor that for a moment I thought... dare say even wondered, if somehow the AI was cheating and had looked at the answer!!! Yep, crazy. I know. But understand human nature. Then I realized that it happened because I was playing against the novice AI, something that I had not been doing much while developing the expert AI level, and I wasn't used to the behavior. The novice AI makes a lot of random guesses, and sometimes it even gets lucky!

Overall the expert AI will win more than the less logical novice AI. Both levels of AI opponents can win on any round, although it would be less likely for the expert AI to win in the first round than the more randomly guessing novice AI. For the longest, I mistakenly believed that the expert AI was incapable of winning in less than three rounds, and I figured that I was going to need to change it to make it play more realistic. However when it won in two rounds I had to closely re examine the algorithms to find that, if *everything* went right, it was indeed possible for the expert AI to win in two. I then added code to increase the possibilities for the expert AI to win in two rounds or less by tweaking it to allow deviation from the normal rigid algorithm that made it impossible to have a first round win, by allowing a first round random guess from the possible solution factors. The first round random guessing will occur 50% of the time the expert AI has five factors of each type remaining in the possible solution factors. When that first round guess happens there is a 1 out of 125 (1/5³) chance for it to match the solution. A subsequent round random guess can also occur 33% of the time it has four factors of each type remaining in the possible solution factors.

The Psychic Deducer factor lists editor is simple to use, and saves on printer ink and paper. The factor lists editor is operated by using the keyboard's four arrow keys, or a gamepad's D-PAD.
> DOWN moves the focus to the next lower level, or changes the data in the lowest level.
> LEFT/RIGHT changes focus to the previous/next item on the level.
> UP moves the focus up one level.
To have a decent chance of keeping up when playing on the expert level, I need to use the factor lists editor or a cribsheet. Only the most intelligent of smart people can effectively play on the expert level without some sort of note taking. I know that my brain does not work well enough to remember everything needed to make the logical deductions for guesses good enough to win when playing on the expert level.

Also included in the game zip are two cribsheets for you to print, should you desire to use something other than the factor lists editor to keep track of the information while playing. One version of the cribsheet is to be used with pencil or pen, while the other version is to be used with colored pencils, markers, or crayons. The chat messages can also be used to take notes in conjunction with, or in lieu of, using the factor lists editor or a cribsheet.

NOTES:
The top scores table and persistent game attributes are automatically saved into and loaded from a file named "psydedata". Besides the top scores, saved are the player's name, the three difficulty level settings, and the game's audio volume level setting. As you develop a winning strategy, if it is difficult for you to win because the AI is too smart, it can be disabled, but that setting is not saved in the "psydedata" file.

The gamepad D-pad is mapped to the arrow keys.
The gamepad button 10 (START) is mapped to the Escape key.
Gamepad buttons 1-9 are mapped to the down arrow key.
All frontend input commands (keystrokes) will be displayed in the frontend menus until the first game is finished.
When playing as a novice, that occasional popping sound is a factor deduction that's being applied to your lists based on an AI validation or invalidation of a guess.

The Linux version will look best when using the font UnDinaru, included in UBUNTU 13.10.
The Windows® version will look best when using the Corporate Rounded (Regular) font.

So send me with a PM if you want me to email you the BETA version of Psychic Deducer which represents 5 weeks 6 days of PureBasic programming. The zip is less than 1/2 megabyte. At this point, no bugs AFAIK. What I need is feedback about knowing how it runs on the newer flavors of Windows and Linux, and about any problems that you might encounter. I want to email v1.0 to my people for Christmas, and I do not want the embarassment or hassle of a v1.1 release.

*Notetaking
One reason the game is enjoyed by many ages and skill levels is that the complexity of notetaking can increase as a player becomes more skillful. An amateur may simply mark off the cards he has been shown; more advanced players will keep track of who has and who does not have a particular card, possibly with the aid of an additional grid. Expert players may keep track of each suggestion made, knowing that the player who answers it must have at least one of the cards named; which one can be deduced by later events. One can also keep track of which cards a given player has seen, in order to minimize information revealed to that player and/or to read into that player's suggestions.
Keep it BASIC.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Psychic Deducer

Post by heartbone »

Image

I'm more of an engineer than a mathematician, and more programmer than statistician.
I made a guesstimation to move on at the time, and now its time to get a possible answer to this question I have been pondering.
My operating assumption is about 1 out 6.
If that's wrong, I might need to make an adjustment.

Deal a randomly shuffled deck of 18 cards,
containing 6 spades, 6 clubs, and 6 diamonds,
into three equal sized stacks.

Considering only one of the three stacks,
what is the probability of having 2 spades, 2 clubs, and 2 diamonds in that stack?


Looks like I may need to create a program to brute force that answer. ;)
I've been especially sharp today!
I got one in two and one in three rounds. 8)
Keep it BASIC.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Psychic Deducer

Post by heartbone »

OK, I've moved on to creating the next thing, and haven't made any changes for a couple of days, so I'm sure that the beta is stable if you'd like to give it a try.
After further reflection and analysis of what this software is, I've decided to add tracking of the total number of games attempted (to produce the high score table) and that will be included in the e-mailed beta.

These are the high score tables from the various machines and OS versions that I was using to develop the game.
These four screen captures
represent about 80 games in all.

My question is am I more or less psychic than the average person?
I like to think that I'm more psychic.
Keep it BASIC.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Psychic Deducer, time for some feedback.

Post by heartbone »

Anyone who tells you to think out and detail and commit to the entire design BEFORE starting to work on it,
probably never programmed computers and completed anything of significance.
I recently realized that I once again need to change the save file format, this time to allow the preservation of version 2 data when used by the version 1 executable.
I will simply add another word containing the length of additional file data, buffer stash the binary data if the length is non-zero, and append on saves.
One must think ahead, but too far ahead can be detrimental to progress and productivity.
Anyhow with this save file change, the beta is as stable as I think it will get.
Just in time for Christmas.
Image
version 1 top score display

That tiny white line of text will only show up once enough data is accumulated for it to make sense to display it.
The screen may look a bit cluttered at first glance, but the text is introduced one line at a time as game play progresses, and the player should not get confused.
In version 2 there will be a second networked top scores display, with its tiny white line containing LOCAL: ONLINE: ARTIS: stats.
Keep it BASIC.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Psychic Deducer

Post by heartbone »

I believe that once you play enough games, any luck factor is eliminated from the statistics.
After completing 8 games you will begin to see your stats reported on the frontend top scores screen.

The following chart represents how I think that you should interpret your results.

# rounds win avg. __ mental capacity
-------------------------- ---------------

1 - 1.9 -------------------The Amazing Kreskin
2 - 2.9 -------------------strong psychic abilities
3 - 3.9 -------------------excellent deducer with strong psychic abilities
4 - 4.9 -------------------excellent deducer with moderate psychic abilities
5 - 5.9 -------------------good deducer with moderate psychic abilities
6 - 6.9 -------------------good deducer with some psychic abilities
7 - 7.9 -------------------good deducer
8 - 8.9 -------------------basic understanding of winning strategy
9 - -----------------------novice

After playing the game and becoming close to an expert, now I know exactly what to add, if I needed to add more to the AI to make it even better.
But my sense of game design tells me that I've made it just about right to prepare most people to play against NI, which is one of the main reasons for it to exist.
Plus I want to be able to beat the AI, but only if I play (mentally work) hard, which I think I've accomplished.
Keep it BASIC.
User avatar
heartbone
Addict
Addict
Posts: 1058
Joined: Fri Apr 12, 2013 1:55 pm
Location: just outside of Ferguson

Re: Psychic Deducer

Post by heartbone »

This is definitely a nerd's game, for nerds. If you don't enjoy thinking logically and you don't believe in psychic perceptions, then this is not the game for you.

I'll probably add a more difficult to beat artificial intelligence level to version 2, and then you'll be able to select from NOVICE, EXPERT, or COMPUTER level artificial intelligence opponents. That new more difficult AI will not be participating in any two player networked games, as it would probably dominate.

If you have any questions or comments, feel free to leave them here, or send them to the email address that is contained within the game.

PSYCHIC DEDUCER v1 for Windows®

PSYCHIC DEDUCER v1 for Linux x64

PSYCHIC DEDUCER v1 for Linux x86


What I wrote in the readme...
TIPS:
► Analyze the contents of the history list to make additional factor deductions.
► Consult the "DON'T HAVE" factor lists to make a higher probability guess.
► If no one can invalidate a player's guess, and the guessing player does not follow up with a final guess, then you know that one or two of the factors in that guess is part of the solution.
That last tip is only true for this version. Unless the human player does something absolutely stupid like make a guess containing all three factors from the human's set, which would invalidate the tip from the AI's perspective. ;) However, in the next version when multiple humans get involved, doing that occasionally might be a valid diversionary tactic.
Keep it BASIC.
Post Reply