Surprises Unwrapped: The Untold History of GizPoker.rpg

Write and read reviews of games that have been uploaded to Slime Salad.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Gizmog
Metal King Slime
Posts: 2615
Joined: Tue Feb 19, 2008 5:41 am

Surprises Unwrapped: The Untold History of GizPoker.rpg

Post by Gizmog »

God damn, am I proud of this one. It's not perfect. I had to rush to get it out by the holidays (Just like a real game developer!), and that meant some sacrifice, especially in the realm of the AI. I've never written an AI for anything before, let alone something as abstract as Poker. People have complained that the final result is a bit too quick to fold, and they're right. I based it on my (basic) knowledge of Texas Hold 'Em, a game where contrary to the name, most good players sit out most of the hands. That doesn't fly so well when it comes to one on one five card draw. There's also a bug that I only found today, but the less of that I say the better. Gotta save something for everyone else's review, right?

I'd love to gloat about all the parts I like now, but I think it would be better to go back and look at the steps it took to get here. Here's some screenshots from development, notes I recorded, and comparisons between this release (Xmas 2013) and the original late 2007 demo that was shown to a few people.

Comments from a defunct .hss, late 2007. Probably the first notes I took. Notice how I don't understand how ties are broken in Poker. Notice too that I'm using 3 global variables (Value (0-51),Suit (0-3),FaceValue (0-12?) for each of the ten cards in the Player/AI's hands.

Slices made Value obsolete, Suit is determined by SpriteFrame and Face Value by Spriteset Number in the modern version.

Code: Select all

#Suits: Clubs, Diamonds, Spades, Hearts
#Suits: 0,     1,        2,      3
#Suits: Divide by 13 to find suit and value.
#Suits: x/13 = suit
#Suits: The remainder (x,mod,13) is the value of the card.
#Test: For the test, you need to have buttons for increasing and
#Test: decreasing card value. Another button will select which 
#Test: card you're modifying, another will sort the cards by value
#Test: then suit. A final button, will ask the computer to take
#Test: appraisal of the current hand, and estimate it's value.
#Hands: Royal Flush 9
#Hands: Straight Flush 8
#Hands: Four of a Kind 7
#Hands: Full House 6
#Hands: Flush 5
#Hands: Straight 4
#Hands: Three of A Kind 3
#Hands: Two Pair 2 
#Hands: One Pair 1 
#Hands: High Card 
#Hands: If the hands are of equal value, check either the suit or 
#Hands: or highest relative card. 
The War Against Duplicating Cards Script excerpt from the 2007 version. Had to check like a million global variables to make sure you didn't discard a card and get the same card back, and that no player in the game had a copy of the card you'd just drawn.

Make note, that at this point in time graphical effects were still done with NPCs.

Again, slices simplify the modern version. This whole thing could be replaced with like two lines, simply changing a card sprite's parent.

Code: Select all

script,CompDrawFive,begin
setvariable (CCardFive,random (0,51))
if (CCardFive==CardOne,or,CCardFive==CardTwo,or,CCardFive==CardThree,or,CCardFive==CardFour,or,CCardFive==CardFive,or,
CCardFive==CCardOne,or,CCardFive==CCardTwo,or,CCardFive==CCardThree,or,CCardFive==CCardFour)
 then (CompDrawFive)
 else (CompSortFive)
#setvariable (CCardFiveFace,CCardFive,mod,13)
#setvariable (CCardFiveSuit,CCardFive/13)
#alternpc (14,npcstat:picture,CCardFiveSuit)
#alternpc (19,npcstat:picture,CCardFiveFace+4))
end
Comparison of Sort Procedures For my script to be able to determine the strength of a given 5 card hand within a reasonable amount of questions, I had to sort the cards in question by value.

In 2007, it looked like this to sort for one particular instance:

Code: Select all

script,CompSortFive,begin
if (CCardFive,mod,13>=CCardFour,mod,13)
then (
 setvariable (CCardFiveFace,CCardFive,mod,13)
 setvariable (CCardFiveSuit,CCardFive/13)
 alternpc (14,npcstat:picture,CCardFiveSuit)
 alternpc (19,npcstat:picture,CCardFiveFace+4))
else (
 if (CCardFive,mod,13>=CCardThree,mod,13)
 then (
  setvariable (VCSort5,CCardFour)
  setvariable (VCSort4,CCardFive)
  setvariable (VCSort3,CCardThree)
  setvariable (VCSort2,CCardTwo)
  setvariable (VCSort1,CCardOne))
 else (
  if (CCardFive,mod,13>=CCardTwo,mod,13)
  then (
   setvariable (VCSort5,CCardFour)
   setvariable (VCSort4,CCardThree) 
   setvariable (VCSort3,CCardFive)
   setvariable (VCSort2,CCardTwo)
   setvariable (VCSort1,CCardOne))
  else (
   if (CCardFive,mod,13>=CCardOne,mod,13)
   then (
    setvariable (VCSort5,CCardFour)
    setvariable (VCSort4,CCardThree) 
    setvariable (VCSort3,CCardTwo)
    setvariable (VCSort2,CCardFive)
    setvariable (VCSort1,CCardOne))
   else (
    setvariable (VCSort5,CCardFour)
    setvariable (VCSort4,CCardThree) 
    setvariable (VCSort3,CCardTwo)
    setvariable (VCSort2,CCardOne)
    setvariable (VCSort1,CCardFive))
   )
  )
 setvariable (CCardOne,VCSort1)
 setvariable (CCardTwo,VCSort2)
 setvariable (CCardThree,VCSort3)
 setvariable (CCardFour,VCSort4)
 setvariable (CCardFive,VCSort5)
 setvariable (CCardOneFace,CCardOne,mod,13)
 setvariable (CCardOneSuit,CCardOne/13)
 setvariable (CCardTwoFace,CCardTwo,mod,13)
 setvariable (CCardTwoSuit,CCardTwo/13)
 setvariable (CCardThreeFace,CCardThree,mod,13)
 setvariable (CCardThreeSuit,CCardThree/13)
 setvariable (CCardFourFace,CCardFour,mod,13)
 setvariable (CCardFourSuit,CCardFour/13)
 setvariable (CCardFiveFace,CCardFive,mod,13)
 setvariable (CCardFiveSuit,CCardFive/13)
 alternpc (10,npcstat:picture,CCardOneSuit)
 alternpc (11,npcstat:picture,CCardTwoSuit)
 alternpc (12,npcstat:picture,CCardThreeSuit)
 alternpc (13,npcstat:picture,CCardFourSuit)
 alternpc (14,npcstat:picture,CCardFiveSuit)
 alternpc (15,npcstat:picture,CCardOneFace+4)
 alternpc (16,npcstat:picture,CCardTwoFace+4)
 alternpc (17,npcstat:picture,CCardThreeFace+4)
 alternpc (18,npcstat:picture,CCardFourFace+4)
 alternpc (19,npcstat:picture,CCardFiveFace+4))
end
And in 2013, it looks like this to sort ALL of them:

Code: Select all

script,SortHand,WhatHand,CalcValue=0,begin
settag (tag:Working,on)
variable (TempSort)
TempSort := firstchild (WhatHand)
while (TempSort) do (
	setsortorder (TempSort,getspritesetnumber (TempSort))
	TempSort := NextSibling (TempSort)
	)
sortchildren (WhatHand)

settag (tag:Working,off)
end 
Attachments
Sneak Peek!
Sneak Peek!
OHRPoker20056.png (3.35 KiB) Viewed 1468 times
At one point late in development, this cluttered layout was almost what I went with.
At one point late in development, this cluttered layout was almost what I went with.
OHRPoker20043.png (10.1 KiB) Viewed 1469 times
I'm actually not sure why the creepy guy is made out of Gold in this screenshot. Bonus mystery!
I'm actually not sure why the creepy guy is made out of Gold in this screenshot. Bonus mystery!
OHRPoker20052.png (5.65 KiB) Viewed 1469 times
As seen here, the deck of cards is a slice collection, with each card being a hero sprite. This set-up makes shuffling, dealing, all kinds of things really easy.
As seen here, the deck of cards is a slice collection, with each card being a hero sprite. This set-up makes shuffling, dealing, all kinds of things really easy.
OHRPoker20008.png (7.57 KiB) Viewed 1469 times
The original tech-demo release from like 2007. There's like a million debug keys I put in years ago and I don't remember what they all do. It works, but is very primitive.
The original tech-demo release from like 2007. There's like a million debug keys I put in years ago and I don't remember what they all do. It works, but is very primitive.
RMTD0002.png (5.91 KiB) Viewed 1469 times
Post Reply