NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information Community Announcements v
« Previous 1 … 52 53 54 55 56 Next »
Solitaire Plugin Revised

 
  • 0 Vote(s) - 0 Average
Solitaire Plugin Revised
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#1
2005-02-04, 03:28 AM
http://www.bladerhq.com/pmwiki/pmwiki.ph.../Solitaire

- Better Shuffling
- Some display enhancements
- Optional external card image files (the embedded set is used as a failsafe)

Instructions for installing/configuring are in a readme file in the zip.
JasonF
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#2
2005-02-04, 12:41 PM
It will look for a "back.gif" file in the external card directory (i.e., the "card2" directory of images that I provided).  Otherwise, it will default to the image that I embedded.

To determine card sizes, the plugin gets the Ace of Spades image, and uses its dimensions for drawing all other cards.  Same is true for back.gif....  It can be any size, but will be scaled to the size of your AS.gif image.

Oh, one annoying thing for you graphics guys that I couldn't figure out: some of the card images have transparent corners, giving them a rounded look.  Most have white in that space.  I couldn't figure out using the tools that I have on-hand how to change the white corners to the transparancy color.  Anyone feel like taking this on?
JasonF
Pioneer4x4
Offline

Posting Freak

Posts: 926
Threads: 50
Joined: Jan 2005
#3
2005-02-04, 02:03 PM
Thanks, I posted a reply in the other thread. I will work on the back.gif, and the transparency thing.

I really appreciate you taking the time to update this.
You didn't happen to add an 'undo' button did you?

Also, I'm curious, what did you use for the shuffle routine? (or is it a secret)
3x MVPs (not used anymore)
XBMC
Hauppauge 150 via SVideo
Comcast Digital Cable
Motorola HD Cable box channel changed via Firewire
Vista Home Premium with RDP hack
AMD Athalon 64 5000+
340gig sata, plus 80SATA+3x160IDE Drives in XP machine for storage.
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#4
2005-02-04, 03:05 PM
I didn't do Undo in this release because I ran out of time. My real-life job in IT Consulting is finally picking up again (almost exploding) after the post 9/11 lull, so I'm finding less and less time to work on fun things.

The shuffle is now using a random index selection algorithm, combined with a cut algorithm.

I take all 52 cards and put them in an ArrayList in the order that they appear in the card stack. Then I pick a random number between 1 and the number of cards remaining. I remove that indexed card from the ArrayList, and push it onto the card stack. Repeat until there's nothing left in the ArrayList.

After each random shuffle, the deck is cut somewhere near the middle (26 +/- 5 cards, I think).

This is all repeated between 1 and 250 times (which was a carryover from the other method of shuffling).

Probably overkill, but hey, it should truly be random now!
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#5
2005-02-04, 03:08 PM
250 times, yeah i would call that overkill [Image: tounge.gif]

i use pretty much the exact same method for the shuffle in "my music" just without the cut, and i only run it once.
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#6
2005-02-04, 03:33 PM
250 should be fine. If you have ever been to a casino, and played blackjack or some other card game. When reaching the end of the deck, they typically will break the cards into stacks, and combine, shuffle, the cards, and repeat the process for up to 10 iterations. If this routine isn't followed, you don't get a true random shuffle, and some trends in the cards coming out can be seen.
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#7
2005-02-04, 03:37 PM
Due to abstraction, the deck is a class separate from Klondike (which encapsulates the rules of the game). I wanted to have good randomization in the deck class so that it could be reused for, say, a Blackjack game or a Texas Hold'em.

And that 250 number is the high-limit of a random number, so the shuffling is repeated somewhere between 1 and 250 times.
JasonF
cginzel
Offline

Member

Posts: 192
Threads: 22
Joined: Dec 2004
#8
2005-02-04, 03:37 PM
This is the first time I've tried the Solitaire plugin and it's pretty nice! Two requests I would have are, one to automatically flip the top uncovered card on a pile when the top care is removed and a quick deal button (like the green button) that would deal the next 3 cards and put the cursor on the top delt card regardless where the cursor is at the point when the deal button is pressed.

Those two optimization would make playing the game easier and quicker...

Thanks,
-Charles
[SIZE="1"]NextPVR v2.3.4 on XP Home SP2
Rig: Dual Core P4 2.8GHz, 3GB Ram + 230GB HD
Media: WinTV PVR-150/MCE (2) + Media MVP 1000 (1) vD3A
Tools/Plug-ins: Weather, ComSkip, NEWA[/SIZE]
Pioneer4x4
Offline

Posting Freak

Posts: 926
Threads: 50
Joined: Jan 2005
#9
2005-02-04, 06:38 PM
Well, I made a couple of backs, one a nice cute puppy, everyone say ooohhhhh.
And another one of a cool PT cruiser Convertible. Aaaahhhh.

I did notice a couple of glitches on where the selection box would end up in an odd place, like overlapping the deal from deck partly... But it worked fine. And I didn't get the A of Spades once as the last card! Woo hoo.

After you pick a card in the shuffle, is it replaced with the last card on the deck, then count reduced? If so, I bet the 2-3 cuts and re shuffles would be as throrough and random as ever needed.

Now a texas holdem over multiple MVPs in different rooms..... Hmm that would be cool. Or link two MVP's for a game of chess/battleship/ whatever turn based board game. That would be cool.

(That was one of my other TRS-80 programs I did, Battleship head to head over cassette I/O cables)
3x MVPs (not used anymore)
XBMC
Hauppauge 150 via SVideo
Comcast Digital Cable
Motorola HD Cable box channel changed via Firewire
Vista Home Premium with RDP hack
AMD Athalon 64 5000+
340gig sata, plus 80SATA+3x160IDE Drives in XP machine for storage.
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#10
2005-02-04, 06:39 PM
GIF primarily because that's the format that I found collection of cards in. My original plugin embedded the whole directory of card images into the DLL (the original images are in there still). I kept the "gif" extension on the name when I created the resource file, so that's why they're still GIF today.

Since the cards are supposed to have transparent corner knock-outs, to give that rounded corner look, it doesn't make sense to use JPG (no alpha channel).

cginzel: thanks. I'll keep those in mind for future revisions (like the Undo).
JasonF
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Any interest in a Spotify Plugin for NextPVR? McBainUK 39 14,571 Yesterday, 08:08 AM
Last Post: Sandybrewer
  New plugin - MovieTrailers imilne 11 6,335 2014-09-25, 08:16 AM
Last Post: imilne
  HD Logos for the NPVR WebRadio Plugin Lao Pan 3 3,442 2014-02-09, 01:32 PM
Last Post: Lao Pan
  Files plugin tmrt 13 7,541 2014-01-09, 11:16 PM
Last Post: mvallevand
  Plex Plugin - first release psycik 141 59,927 2013-06-16, 08:59 PM
Last Post: JonnyCam
  Web Cams plugin for NextPVR McBainUK 37 16,015 2012-10-19, 07:35 AM
Last Post: McBainUK
  PhotoFilter: New Photos/Videos plugin to browse using metadata cncb 1 2,053 2012-08-10, 04:06 PM
Last Post: cncb
  System Plugin - CPU Temperature Monitoring imilne 1 2,064 2012-03-28, 07:59 PM
Last Post: LegioX
  System Plugin - 2nd Test Release (4th Feb) imilne 31 11,111 2012-02-24, 12:22 PM
Last Post: Reddwarf
  System Plugin - New Test Release (29th Jan) imilne 38 11,539 2012-02-07, 08:38 AM
Last Post: imilne

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode