"High Stakes" is a game of Seven-Card Stud Poker that will be a fun and interactive experience for players.

What will make this stand out from all the other Poker videogames out there is the emphasis on a physical interaction as well as competition against smart, reactive opponents. The plan is to use both Nintendo's Wiimote and NaturaPoint's TrackIR head tracker for control to play against responsive, motion captured avatars for a truly immersive poker playing experience.
Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts

Wednesday, December 12, 2007

Design tradeoffs

Ref. : Key Concept in Core: Event Based System

1. It's easily extendable.
Base Object has already event handling mechanism.
You can create another object inherited by HSPObject. It already has event handing mechanism, so you just need to implement logic according to state diagram.

2. You have Timer
If you want to have timer, then you can create timer.
Timer is considered as system object, so Once you create timer, then it gives time tick to all created objects automatically.
It gives possibility to make real-time simulation either.

3. Clear Concept: Interaction Handler
Our system has Interaction Handling part as separate module.
It gives clear concept about input.
You can easily connect object with other different interaction device or AI module.

4. Objects process events on Thread
Using Thread can give advantage, but also disadvantage because of difficult debugging.

5. We consider Memory Clean
There were two factors why we made memory class.

  • Event can have parameter, and parameter type can be different.
  • While developing the poker game, we realized that it's very often to send event to all objects.

Therefore, we decided that we had better have own memory system for taking care about event parameters' creating and deleting.
You can create event, create paramater(type, size), and assign how many object will share the parameter.
Once object receives event and if it has parameter, it decreased reference count.
It guarantees that memory will be clean after reference count becomes zero.

Poker AI

1. Poker AI has sensor.
The sensor gets all possible information.
  • There are factors that sensor archives.
    • HSP_RISK_FACTOR
    • HSP_STRENGTH_FACTOR
    • HSP_OPPONENT_MOOD_FACTOR
    • HSP_OPPONENT_BET_FACTOR
    • HSP_ACTION_FACTOR - previous action
    • HSP_WIN_RESULT_FACTOR
    • HSP_LOSE_RESULT_FACTOR
    • HSP_MONEY_FACTOR
    • HSP_NEW_ROUND_FACTOR
    • HSP_STREET_FACTOR

2. Guessing emotion.
When those factors are updated, AI emotion(mood) is generated.
Currently generating emotion is fixed, not using script.
It considers all factors.

  • Currently AI generates the following emotions.
    • HSP_BORED
    • HSP_DISAPPOINTED
    • HSP_NERVOUS
    • HSP_PROUD
    • HSP_CONFIDENT
    • HSP_CAREFUL
    • HSP_CONFUSED
  • Emotion is effected to behavior.
    • HSP_HAND_OVER_HAND
    • HSP_REST_HAND_ON_CHEEK
    • HSP_FIST_UNDER_CHIN
    • HSP_YAWN
    • HSP_STRETCH_ARMS
    • HSP_ARMS_CROSSED
    • HSP_CROSS_FINGERS

3. Track opponent behavior.
  • AI keeps track opponent behaviors.
    • Look computer's card often
    • Look computer's card long time
    • Look computer's avatar face long time
    • Make no decision for long time
  • AI generates responses .

4. How AI decides action.
AI decides action based on Previous Action, Rate of Return and Statistic Data.

  • RISK factor
    • Pot Odds : The pot odds number is the ratio of your bet or call to the size of the pot after you bet. For example, if the bet is $20, and there is $40 in the pot, then the pot odds are 20/(20+40) = 0.333.
  • STRENGTH factor
    • Hand Strength : Hand Strength is the probability that you will win the hand, given your hole cards, the community cards, and the opponents who remain in the hand. Hand Strength is a floating point number between 0.0 and 1.0. For example, a HS of 0.33 means you have a 33% change of winning.
  • IQ/EQ factor
  • Rate of Return = STRENGTH * IQ / RISK * EQ.
  • Statistic Script Data
    • You can generate statistic script data. It's normally generated from result data of poker game play. However, you can generate by you self.

Example of Statistic Script Data :

#HSPOKER AI v0.1

IQ = 0.7
EQ = 0.7

RR <= 0.5 : FOLD = 5 CALL = 40 RAISE = 65 ALLIN = 0 BLUFF = 1
RR < 0.6 : FOLD = 5 CALL = 60 RAISE = 35 ALLIN = 0 BLUFF = 1
RR < 0.7 : FOLD = 5 CALL = 40 RAISE = 55 ALLIN = 0 BLUFF = 1
RR < 0.8 : FOLD = 5 CALL = 50 RAISE = 45 ALLIN = 0 BLUFF = 1
RR < 0.9 : FOLD = 5 CALL = 45 RAISE = 50 ALLIN = 0 BLUFF = 0
RR < 1.0 : FOLD = 10 CALL = 75 RAISE = 15 ALLIN = 0 BLUFF = 0
RR < 1.3 : FOLD = 0 CALL = 39 RAISE = 60 ALLIN = 1 BLUFF = 0
RR < 1.4 : FOLD = 0 CALL = 19 RAISE = 80 ALLIN = 1 BLUFF = 0
RR >= 1.4 : FOLD = 0 CALL = 1 RAISE = 19 ALLIN = 80 BLUFF = 0


5. AIGuide.

Thursday, November 29, 2007

Gameplay Design

* This document was written by Geoffrey Brown.

High Stakes Poker is a highly interactive game of Seven Card Stud Poker against a cunning and sometimes verbally abusive opponent.

Gameplay elements:
This game goes by the rules of Seven Card Stud Poker. The first two cards are dealt face down. Then next four cards are dealt face up and viewable by opponents. The final card of the round is dealt face down. To win a round, the opponent must fold or the player must have the best Poker hand. To win a game, you must win all of his chips.


.Look in “hotspot” areas to receive game information, or to generally annoy your opponent : The player's chip area: shows the players chip value and elicits a unique type of response from the opponent if looked at too long.
The opponent's chip area: shows the opponents chip value and elicits a unique type of response from the opponent if looked at too long
The table chips area: shows the pot value.
The opponent's card area: shows a closer view of the opponent's cards and elicits a unique type of response from the opponent if looked at too long The opponent's face area: elicits a unique type of response from the opponent if looked at too long
Looking at your hidden cards too often or waiting too long to do something during your turn will elicit unique types of response from the opponent as well.

Gameplay Controls (Geoff – Wiimote):
Look at your hidden cards: Swing Wiimote up vertically
Call/check/confirm: Press A
Raise: Hold B and swing Wiimote vertically
Decrease bet: Hold B and swing Wiimote horizontally
Fold: Hold c and move Nunchuk vertically to fold Bet
All In: Hold Z and swing Wiimote and Nunchuk at the same time vertically
Click on a menu button: Press the + button to while hovering over it
Pause Game: Press the home button while playing the game.
Use TrackIR head tracking system or the Nunckuck analog stick to move the “eyecon” over menu buttons and hot spots.

GlovePie allows the Wiimote functionality to be mapped to computer input.
The Wiimote does not interact with the sensor bar in this game. This is because the sensor bar could disrupt the TrackIR's detection of its own sensor. For this reason, the Wiimote controls were designed so that motion sensing would only be handled by the gyrometer and accelerometer.
At certain force and speed, the Wiimote would detect the wrong direction, so boundaries for the script had to be defined so that a vertical movement wouldn’t be mistaken with a horizontal one. An example from the GlovePie script of a “Raise”

//The If statement is designed to give a minimal force on the vertical motion, but allow for some small error in the other direction as the user will most likely not move in a perfectly straight vertical movement
if(Wiimote1.RelAccY >= 12 m per s per s AND Wiimote1.RelAccX < 12 m per s per s
AND Wiimote1.gy >= 2.00 AND Wiimote1.gx <> -2.00 AND Wiimote1.B)
then
ppjoy1.digital3 = 1
wait(0.1s)
ppjoy1.digital3 = 0
debug= "RAISED " //This is the debug information used to find the boundaries "gx: " + Wiimote1.gx + " gy: " + Wiimote1.gy + " gz: " + Wiimote1.gz + " AcX: " + Wiimote1.RelAccX + " AcY: " + Wiimote1.RelAccY + " AcZ: " + Wiimote1.RelAccZ
wait 700ms
debug= "IDLE" endif

Friday, November 9, 2007

Latest Transcript

Speech

Raise
“I’ll bet”
“I'll raise.”
“I'm not afraid to bet.”
“You got to be in it to win it!”
“Okay, I'll raise”
“Let's up the ante.”
“The look of fear in your eyes tells me... That it's time to raise!”
“What's money to a guy like me? I'll raise!”
“Can you match this?”
“There's no way you're taking this from me. Raise!”
“Lets make the stakes even higher.”
“I'm way too confident in my game not to raise.”
“I'll raise. I hope that doesn't make you too nervous.”
“I'm going to bet, can you afford it?

Call
“I’m in”
“Yep”
“I call this one”
“I’m gonna call”
“I’ll… Call”
“I have no problem calling this one.”
“Eh, I'll call.”
“I'll match that. Call.”
“Ha ha! Well I have no problem calling that one!”
“Wow, you actually bet? That's bold. I'll call.”
“I'm calling you out!”
“Okay, if that's the way it's got to be, I call.”
“You amuse me. I'll call.

Check
“Check it out”
“Hmm… Check”
“I’ll… Check”
“Yeah, I’ll check”
“Lets see what you're going to do next. Check!”
“Check please!”
“You'll probably get nervous and bail out if I bet, so I'll just check for now.”
“Ooooh, check out our waitress! Uh, I mean check!
“Check!”

Fold
“I’m out”
“Count me out of this hand”
“No thanks”
“That’s it for me”
“Fold!”
“Argh! I need playable cards!”
“Well, I have to fold”
“What am I supposed to do with these crap cards?”
“If our dealer knew how to shuffle, I'd have a chance.”

Win Hand
“Yeah!”
“Ha! I knew it!”
“Yes!”
“Who's the man?”
“Who's your daddy?”
“Ha Ha Ha! You never stood a chance!”
“I win. Of course I already knew that from the start!”
“That was like taking candy from a baby. Please don't cry like one.”
“Maybe you should leave the table. I don't want you to have to take out a second mortgage.”
“I like taking your money!”
“I loooovvveeee taking your money!”
“That really was too easy.”
“Wow, I think I'll buy you a drink with your money.”
“Hey, I could buy you dinner with what I just won. But I won't!”
“Did I win already? I wasn't even paying attention...”
“There's no shame in losing. Well, for you there is!”

Lose Hand
“Wow, you must have beginner's luck. And that's the only thing you have going for you”
“Ugh, I can't believe it!”
“Eh, take some of my money... You look like you need it!”
“What you have is luck, not skill. Luck runs out!”
“How could I lose this hand?”
“Well, that won't happen again!”
“I think that you're cheating! But I'll let you take my chips until I win them back”
“I don't like you.”
“Don't be so happy, the game isn't over yet.”
“Well, now you've just made me angry. Prepare to lose everything!”

Computer Loses all money
“How could this happen?!”
“You took all of my money!”
“Argh! I'll be back on payday!”
“I'm broke! It's all your fault!”
“I think I need a drink, can you spot me?”
“That was my money!”
“Noooooo!”
“Oh no! Oh no! Deeper into debt I go!”
“Stop laughing at me! I'm hurting right now!”
“I'm not crying, I just have something in my eye!”
“This is just humiliating.”
“H-hey, buddy! Can I ask you for a loan? No? You're very selfish!”

Player loses all money
“HA HA HA HA! Schmuck!”
“Ha ha! The rich get richer, and the poor get poorer.”
“Begone, peasant!”
“That was so easy. I almost feel bad. Almost.”
“Did you lose all of your chips? That's is so sad, and yet, I'm so happy!”
“I feel quite good about myself right now!”
“To the winner goes the spoils! To the loser goes... Well, nothing.”
“Get off of my table and let a real poker player play!”
“Please, go get some more chips so that I can beat you again!”
“Heh, so much for your kid's college fund!”
“Since you're so generous, next time why don't you bet your house?”
“Sucks to be you!”

All in
“You want High Stakes? Okay. lets go all in!”
“All in!”
“Eh, I'll put it all in!”
“There's no way you can beat my hand, so all in!”
“Let's put it all on the table. All in!”
“I'll go all in! Put up or shut up”

Trash talk
“You can’t win this, give up”
“You might get lucky this time. Heh, dumb luck.”
“You’re going to have to earn these chips”
“What are you waiting for?”
“This must be the tough part, making a decision.”
“Play or be played”
“You can’t bluff me!”
“You're not a very confident person, are you?”
“Okay, I'm bored now. Play!”
“Go!”
“Slow people make slow decisions.”
“Don't think too hard, I don't want you to hurt yourself!”
“Are you going to do something or should I go talk to that hot waitress while you think?”
“You're wasting my valuable time!”
“Silly rabbit, poker is for players!”

Player checks his cards too often
“Looking at your cards isn't going to magically change them.”
“What's the matter? Got a terrible hand?”
“You should just fold and save yourself the trouble.”
“Wow, you sure check your cards a lot. You must lack confidence.”
“If you had half a brain, your cards should've told you already that its time to fold.”
“Careful now, those cards may give you a wittle paper cut if you keep checking them.”
“If you just want to look at your cards all day, go play Solitaire!”
“If you have a bad hand, just give up.”
“I'm tired of watching you check your cards.”
“Do you know what the cards mean or do you need some help?”
Player looks at Computer's Cards for too long or too often
“My cards are fine, I suggest that you pay attention to your own.”
“I think that you think that my hand is better than yours”
“Don't you wish you knew what my hidden cards are?”
“These are my cards. You can't have them!”
“You've been looking at my cards a lot. Just give up if you don't think you have a chance.”

Player looks at Computer's Face for too long
“What are you looking at?
“I see you staring at me. I just want to let you know, I'm way out of your league.”
“You don't look very smart.”
“I look into your eyes, and it just seems like nothings going on. How do you function?”
“I know I'm good looking, but you have a poker game to lose.”
“Okay, now I'm uncomfortable.”
“You wish that you looked like me.”
“What, are you looking at me for some kind of confirmation?”
“You never have, you never can, you never will be like me.”
“Stop staring at me!”
“You're creepy.”
“Okay, if you keep looking at me weird, I'm calling security!”
“You don't look like a winner.”
“I just can't concentrate with you looking at me. You're scary.”
“Are you trying to intimidate me? Not working.”

Actions

Check
Tap table with fingers
Tap knuckles on table
Open hand on table

Call
Throw in chip(s)

Raise
Throw in chip(s)

Thinking
Cross fingers
Hand over hand
Arms crossed
Fist under chin
Rest hand on cheek
Smile

Win
Fists in air
Clap hands
Punch air
Laugh
Point and laugh

Fold
Just put down cards
Look at cards and slide onto table

Lose Game
Cross arms
Frown
Angry Face
Shake Fist

Trash talk
Point and laugh
Shake head
Roll eyes

Bored
Stretch arms
Yawn
Look around

Thursday, November 8, 2007

Sound Design

* This document was written by Geoffrey Brown.

With the exception of the shuffle effect, found at the Free Sound Project (http://freesound.iua.upf.edu) all other sound effects were recorded a sound free room in the UIC EVL.
Sound effects for the cards actually had to be done on the floor, since the table I was working on was metal and bumpy. The sound effects were done multiple times so that the best contender could be edited in Audacity. I used real cards for card sound effects, but for the sound that plays when the camera zooms in to the player's hidden cards, I made a sound that imitated what I thought the zoom should sound like, then edited it in audacity by adding normalization and a “phaser” effect.
The background music, “Vegas Glitz” by Kevin McLeod is borrowed from at the royalty free site Incompetech.com. This was chosen because it fit the gambling scene so well. I had to find the perfect “looping point” and cut it in Audacity, so that it would repeat well.

A lot of voice acting was recorded in the sound free room, for the over 140 interesting comments I had written in the transcript for AI reaction. For each type of response you can get from certain gameplay actions, there are around 10-15 comments that may come out of the opponents mouth. I recited each line multiple times so that I could choose from the best sounding samples. When editing, I would sometimes take the first part of a sentence and combine it with the last part of a repeated part of the sentence because it sounded better. By doing that, I also had to make sure that it flowed in the best possible manner.

Unfortunately, in the end, we couldn't use any of those recordings, Since they were recorded before the motion capture, they didn't sync up correctly with it. Fortunately, sound was recorded during the video of our motion capture session and we were able to use that instead.

Friday, October 26, 2007

GUI Design

I used Crazy Eddie's GUI (http://www.cegui.org.uk/wiki/index.php/Main_Page) to build the GUI ad Menu systems. CEGUI is a very nice system using a combination of XML based files and its C++ library. The great thing using the XML is that you can make code independent changes to a lot of the aesthetic components of the GUI and test without having to recompile the program. For the XML part , I had to write the following types of XML files:

IMAGESET files: Used to load images from an image file(tga, jpeg, etc) into the system, based on their leftmost and topmost positions, in pixels, on the screen. Their width and height in pixels must also be specified as well as if they could be scaled or not. For each imageset file, you may load any piece of an image file in, so it is advantageous to have many images in one image file if possible.

LOOKNFEEL files: Used to define skins/frames/text colors for windows or buttons

SCHEME files: A simple and less time consuming way to tell the system which imagsets, looknfeel types and fonts you will be using.

LAYOUT files: Indicates the layout of a particular GUI sheet. Here, you name and specify window types (button, static image) to be on a particular sheet. Each window may have nested windows inside of them.

However, the while the XML files can be changed independently from the code, C++ code must be written to load them into the system initially and give them advanced features.

There are 4 main GUI component types in High Stakes Poker: menu screens, images, buttons, information containers and invisible “look areas” :

Images: just a static image which can be a background or a nested image like the how to play menu images.

Buttons: an interactive window, that changes the image on mouse/TrackIR hovering over the area and trigger calls to change menu screens or other game functions when pressed. The buttons in High Stakes Poker are flippable cards, to fit the theme.

Information containers: hold real time information to be echoed to the user in game such as betting/turn information or images of your opponents visible cards.

Look areas/hot spots: these areas, invisible to the user, can indicate whether they are looking at a particular area of the screen that may show an information container,or cause an event to be triggered. For example, if you are looking at the area around the opponent avatar Alex's face, a call can be sent to trigger a timer that will cause him to say something if you've been looking in that area too long. Or, looking at the users chips will pop up the info container that shows the user's chip value.

For each of these GUI component types, in the layout files I had to specify their placement. I also had to choose whether this positioning would be relative (screen percentages) or absolute(exact pixel placement) Knowing that our game runs in different resolutions and after fixing a pixel placement problem with our debug overlay being cut off, I decided to use relative placement if only for the reason so that components wouldn't get cut off the screen when resolution is decreased.

The percentages where determined by taking a screen shot of our game at a certain resolution, i.e. 1650x1080, drawing boxes around the area of the screen where I wanted the component to be seen, and finding the left, right, bottom and topmost pixel boundaries. Then I was able to calculate percentages based on those values. In example, if the top of a component was 650 pixels from the top of a 1650 x 1080 screen shot, I would get it's starting y position percentage by calculating 650/1080 = .6019 and putting that into the appropriate part of its layout file.

On the C++ side of things, I used CEGUI's window management library functions to load the scheme into the system and layout files into variables so that I could manipulate when to show them them. I also made variables for each one of the buttons and look areas so that I could subscribe event handler functions for them to call other functions.

For example, for the player chips looking area :
Declaration:
CEGUI::Window* playerChipsArea; //Hotspot window for player's chips area
Initialization:
playerChipsArea = (CEGUI::Window*)wmgr.getWindow("InGame/PchipsArea"); //get the window specified in the layout file by the name “InGame/PchipsArea”
Subscribing an event handler:
playerChipsArea->subscribeEvent(CEGUI::Window::EventMouseEnters, CEGUI::Event::Subscriber(&HSPokerApp::HandleEyeOnPlayerChipsArea, this)); //triggers HandleEyeOnPlayerChipsArea() funtion when mouse cursor enters window area

HandleEyeOnChipsArea() after being declared could now be given code to do whatever it needed to do whenever the cursor is in that area by myself or my teammates. For the buttons, handler functions were created to switch GUI sheets, or call functions to quit or restart.

Variables for each info container had to be created as well so that the information contained could be dynamically change in updateStats(), which updated in game variables as they changed. Most of the info containers were just text, so I just had to update each one with CEGUI's setText call. The cards info container, which needed to echo the opponents visible cards as images when the user was looking at the area was a little more sophisticated. Luckily for me, a very good naming system for each card in the computer's hand had been implemented by my awesome teammates, so that made things easier. Inside the imageset file that loaded a ,tga containing images of all 52 cards, I just named each card by the same name as it would have in the opponent's hand array:

Then, in our HSPSceneManager class I was able set the visible cards names to variables while it updated like so:
oppCardSize = (int)m_vPlayer2Cards.size();
if(oppCardSize <= 2){ visCard3 = "empty"; visCard4 = "empty"; visCard5 = "empty"; visCard6 = "empty"; } else if(oppCardSize <= 3){ visCard3 = m_vPlayer2Cards[2]->getNode()->getName();
visCard4 = "empty";
visCard5 = "empty";
visCard6 = "empty";
} else if(oppCardSize <= 4){ visCard4 = m_vPlayer2Cards[3]->getNode()->getName();
visCard5 = "empty"; visCard6 = "empty";
} else if(oppCardSize <= 5){ visCard5 = m_vPlayer2Cards[4]->getNode()->getName();
visCard6 = "empty";
} else if(oppCardSize <= 6){ visCard6 = m_vPlayer2Cards[5]->getNode()->getName();
}

Then I could use those variable names to grab the correct image at the correct time in update() using:
//update visible cards
if(m_pHSPManager->visCard3 != "empty")
VisCard3->setProperty("Image", "set:AllCards image:" + m_pHSPManager->visCard3); //if not empty, show appropriate card
else VisCard3->setProperty("Image", "set:Transparent image:EmptyWin"); //if empty, show a transparent window

if(m_pHSPManager->visCard4 != "empty")
VisCard4->setProperty("Image", "set:AllCards image:" + m_pHSPManager->visCard4);
else
VisCard4->setProperty("Image", "set:Transparent image:EmptyWin");

if(m_pHSPManager->visCard5 != "empty")
VisCard5->setProperty("Image", "set:AllCards image:" + m_pHSPManager->visCard5);
else
VisCard5->setProperty("Image", "set:Transparent image:EmptyWin");

if(m_pHSPManager->visCard6 != "empty")
VisCard6->setProperty("Image", "set:AllCards image:" + m_pHSPManager->visCard6);
else
VisCard6->setProperty("Image", "set:Transparent image:EmptyWin");
}
This way, only visible cards on the table will pop up when looked at.

For the menu system, what was shown on screen is triggered by show functions which essentially just show a GUI sheet defined by the loaded layout file. Since I am not an artist by trade, I tried to make use of as many pre-made graphics as I could, but I also had to do much image editing in the free image editing program, GIMP. The info containers are made from GIMP's button generator, the background for the main menu, how to play and credits menu are from the table texture that James had already made with a clothify bump mapped effect on it. The images for the controls page are from the storyboard images that he had created for our original presentation with a neon effect put on them. I also used GIMP to put together some image files with multiple images in them for imagesets.

I had to make sure that each menu shown on screen was the correct one, especially in the case of the How To Play and quit confirmation menus, which could be accessed from both the main and pause menus and had a back button. For instance, on the How To Play controls screen, the back button had to know if it was going back to the main or pause menu, so I simply set a boolean gameInProgress set to false until he play button on he main menu was pressed, making the main menu no longer the primary menu since it is only supposed to show before the game play is started. Then it was a simple task:
bool HSPokerApp::HandleHTPControlsBackButton(const CEGUI::EventArgs& e){
//If previous screen was the pause menu, go back to that. Otherwise, go back to main menu
if(gameInProgress)
showPauseMenu();
else showMainMenu();
return true;
}

Wiimote interaction

  • The sensor bar is not needed for the current control scheme. All motion detection is done using the accelerometer and gyroscope.
  • To determine the boundaries of any given action movement, the debug in the GlovePie script was set to output the x, y and z values of the accelerometer and gyroscope values and pause long enough to write down values. Then tested against new boundaries if a value was too far off in the wrong direction.
  • The boundaries are set in such a way so that a horizontal movement won’t be mistaken for a vertical movement as speed increases and vice versa.

High Stakes Poker Wiimote controls

  • New game: Press 1 Button
  • Check your hidden cards: Move Wiimote in vertical direction
  • Call/Check/Confirm: Press A Button
  • Raise: Hold B trigger button and move Wiimote vertically
  • Decrease bet: Press B trigger button and move Wiimote horizontally
  • Fold: Press C Button and move Nunchuk vertically
  • Go all in: Hold Z trigger and move Nunchuk and Wiimote together vertically.

Music/Sound Effects

  • The background music, "Vegas Glitz" by Kevin MacLeod is from the Royalty Free music site incompetech.com.
  • The sound effect for shuffling is credited to deathpie from the Free Sound Project
  • The rest of our current SFX was created in the EVL sound room by Geoff Brown (Who?).
  • Music and Sound Effects in High Stakes Poker are handled by OpenAL and ALUT.

Key Concept in Core: Event Based System



HSPObject has HSPEventHandler.
HSPEventHandler has Queue for HSPEvents, and run based on thread.
HSPEvent has HSPMemory for additional parameter. It's for memory clean management.
It adapts "reference counting" method, so Events can share parameters.

HSPInteractionHandler handles sending event to Object.
It can identify object with type like "HSP_MAIN", or object id. and you can also send event to all Objects.
User can generate Events such as checking your card, fold, check, call etc.
HSPAI can generate Events after AI processing.
HSPGuideAI is for giving tips to User.

There are four different HSPObjects.
  • HSPDealer
  • HSPokerPlayer
  • HSPTimer : object for generating time tick
  • HSPVisManager : object for connecting logic and visual
Poker logic part(state digram) was implemented in HSPDealer and HSPPokerPlayer.
Instances were dealer(HSPDealer), player1(HSPokerPlayer), player2(HSPokerPlayer), timer(HSPTimer), vismanager(HSPVisManager).

Transcript v0.1

Speech

Raise
“I’ll bet”
“I’ll see that bet”
“You got to be in it to win it!”
“Okay, raise”

Call
“I’m in”
“Yep”
“I call this one”
“I’m gonna call”
“I’ll… Call”

Check
“Check it out”
“Hmm… Check”
“I’ll… Check”
“Yes, I’ll check”

Fold
“I’m out”
“Count me out”
“No thanks”
“That’s it for me”
“Fold!”
“Argh! I need playable cards!”
“Well, I have to fold”
“What am I supposed to do?”

Win
“Yeah!”
“I knew it!”
“Yes!”

Trash talk
“You can’t win this one”
“You have to bet if you want to see my cards”
“You have something good? Prove it!”
“You might get lucky this time”
“You’re going to have to earn a win”
“What are you waiting for?”
“This must be the tough part”
“Play or be played”
“You can’t bluff me this time”

Actions

Check
Tap table with fingers
Tap knuckles on table
Open hand on table

Call
Throw in chip

Raise
Throw in chips

Thinking
Cross fingers
Hand over hand
Arms crossed
Fist under chin
Rest hand on cheek
Smile

Win
Fists in air
Clap hands
Punch air

Fold
Just put down cards
Look at cards and slide onto table

Thursday, October 11, 2007

Class Diagram v0.2







State Diagram v0.2

Current Event Types
  • HSP_GAME_START
  • HSP_GAME_PAUSE
  • HSP_GAME_RESUME
  • HSP_GAME_STOP
  • HSP_NEW_GAME
  • HSP_DONE_PREPARATION
  • HSP_NEW_ROUND
  • HSP_NEW_CARD
  • HSP_DISTRIBUTED_CARD
  • HSP_GOT_CARD
  • HSP_BET_TURN
  • HSP_PLAY_TURN
  • HSP_CALLED
  • HSP_RAISED
  • HSP_CHECKED
  • HSP_FOLD
  • HSP_ALLIN
  • HSP_CLOSE_ROUND
  • HSP_ROUND_RESULT
  • HSP_CHIP_RESULT
  • HSP_DONE_CLOSE
  • HSP_TIME_TICK
  • HSP_TOO_IDLE
  • HSP_TRANSCRIPT
  • HSP_ACTION
  • HSP_ADVICE_TALK

State diagram :
Poker game continues until that user presses stop button or one of player lose all money.
Game starts from new_game.

Dealer gets "new_game" with number of players.
Dealer creates player information table, and registers players.
Dealers sends "new_game" to the players.

Player gets "new game" with number of players.
Each player initializes its status and creates guessing table for archiving opponent's status in future.
Player sends "don_preparation" to all objects with player number, money, hand eval value.

Dealer gets "done_preparation", and update player table.
If Dealer updates all player information into table(dealer has number of players info, so dealer waits till receiving "done_preparation" from all players), it sends "new_round" to itself.

Player gets "done_preparation", and updates guessing table.

Dealer gets "new_round", then it initializes card, randomly select cards, distributes it, and update player table.
First two cards to each players don't update to player table.
Dealer sends "new_card" to dealer and each player.

Dealer gets "new_card", then it calculates rank of players, make turn queue, and sends "play_turn" to all with the player number. Then pop the player number from the turn queue.

Player gets "new_card", then it sends "got_card" to all with card number if it's not hidden card.




Player gets "play_turn". If it's your turn(comparing with player number and your id), decide action, and send the action to all.

Dealer gets actions from the turn player. If turn queue is not empty, it sends "play_turn" with next player number.
The turn queue is empty and street number is less than 7th street, go back to "new_card" state.
The turn queue is empty and show down flag is active, then it sends "close_round" to itself.
The turn queue is empty and street number is 7th street, then it sends "close_round" to itself.


Player gets actions. It updated guessing table.

Dealer gets "close_round". It evaluated all cards, find highest hand value, and sends "round_result" to all with winner id.

Dealer gets "round_result", and it sends "chips_result" to each player.

Player gets "round_result". If the winner id is same with your id, then you win. otherwise you lose. It update guessing table.

Player gets "chips_result. It updates players chips adding/minus the number.
It sends "done_close" with players chips amount to dealer.

Dealers gets "done_close", and it updates player table with chips.
If dealer gets "done_close" from all player, then check all player's chips.
If one of players have 0 chips, then it sends "game_over" to all.
Otherwise, it sends "new_round" to itself.