PDA

View Full Version : [WIP]Internet Sppoker



klange
January 17th, 2009, 08:38 PM
Alright, first I need to say that I'm not going to just offer a download for this, because one: Most people won't care, and two: legal reasons; but if you're actually legitimately interested, pop me an IM on MSN or AIM, and I'll probably dish out the goods.


Sppoker (http://sppokercards.com) is a card game that combines poker and scrabble that happens to have been invented by my old Algebra II teacher's dad and his friend's family ~4 years ago.

When I first heard about it (a week ago?) I felt I had to make this.

1530 lines of Python, lots of threading, SocketServer and asyncore.dispatcher, PyGame (SDL) GUI, PyEnchant for spell check on the server. One week of work.

Still has a number of bugs, but it works well enough.

http://og.ogunderground.com/~klange/screenshots/sppoker.png
http://og.ogunderground.com/~klange/screenshots/sppoker2.png
http://og.ogunderground.com/~klange/screenshots/sppoker3.png

Download:
Ask me on AIM or MSN, as I can't release this due to copyright.

Rob Oplawar
January 18th, 2009, 01:05 AM
I can appreciate the complexity of such a game. :)

MetKiller Joe
January 18th, 2009, 08:13 AM
This game will be perfect for my casino Java programming assignment for the 1st semester (doesn't get released, the teacher reviews it though).

L0d3x
January 18th, 2009, 09:26 AM
That actually sounds like an interesting card game.

klange
January 19th, 2009, 09:55 AM
Thanks for the positive feedback.

Can't seem to edit [WIP] into the title, meh.

Anyway, lots of updates. Fixed a bunch of bugs, added AI, fixed it up to support 6 players and added a nice big chat box in the middle.


http://og.ogunderground.com/~klange/screenshots/sppoker/sppoker_ai5.png

More on the AI:
The AI can be added to a local game. You can have AI and host normally, though, you just need to be running the client (I'll work on that, it's a fairly simple matter, done, btw). The AI basically is just another client. It ignores almost everything except being dealt cards. After being dealt, it pushes off to a separate thread so that it can keep receiving PONGs and not lose its connection. It then finds every last word (three letters or longer) it can and its best possible 5-card hand. It then does some comparison based on the length of the best word and the value of the hand to determine what to do. That needs a bit more work and maybe some randomness thrown in, but it works.
The AI is good, but not unbeatable (I wasn't having a very good game when I took that pic).

With optimizations, new stuff and AI, it's up to 1750 lines.

BobtheGreatII
January 20th, 2009, 09:25 PM
I was told to post here... So... hi.

But srsly. Nice work Bacon.

nick3d
January 21st, 2009, 06:54 PM
wow looks fun

Rob Oplawar
January 22nd, 2009, 01:04 AM
i keep reading that as "internet strip poker". DO IT.

would be played with webcams. could be awesome, but more likely it would be a bunch of fat bald yet otherwise hairy 40 year old guys.

klange
January 24th, 2009, 11:33 AM
Not much new to show, but I do have some updates. New features:
- Searches for games on the local subnet (ie, 192.168.1.*) through a broadcast packet.
- Pulls a list of games from http://ogunderground.com/sppoker_games (still working on the server-side for that)
- Fixed a number of speed issues, and I have yet to have a crash despite playing for long periods of time with AI.
- New server interface allows changing of server name, adding AIs, booting players, etc.
- A lot of console output has been removed (ie, server chat messages, chat in general, the hand you're being dealt, etc.)
- Card display when selecting black cards for a poker hand have been changed to white to make them more readable. (Please, no racism jokes)
- Sppoker cards are now represented by a unicode star character instead of an asterisk.
- Title screen has been added.

Known bugs:
- AI is very slow on Windows, most likely due to the dictionary lookups. I'm still looking for a fix.
- The poker hand comparison engine still doesn't break a number of ties properly.
- Server may still have some issues, it takes a while to hit a bug. Just fixed one after posting this where if one player had a winning hand and the word winner was a double, it would get caught in an infinite loop because it wouldn't reset the word player... >_>

e: Obligatory line count: 2052

ToDo:
- Keep fixing bugs
- Make AI faster on Win32
- Simple automatic updates
- Server list improvements

e: YouTube video
pgDybjeszBQ

klange
January 25th, 2009, 11:50 AM
Bump for more fixes, and because I don't think anyone looked after I added the YT video:

- Fixed a few more lurking errors in the card hand ranker (still needs to beak ties, working on it!)
- Fixed a few things related to going double-down.
- Attempted to fix issues with the call buttons not showing up even though all seven cards are present.

Limited
January 25th, 2009, 12:43 PM
Very interesting stuff admiral. Loving the work so far, although I suck at poker, would that mean I have a disadvantage in this game?

2,000 lines of code is pretty reasonable considering the amount of networking you have involved, one of mine is around 1,500 (last count) but that has alot of collision checks.

Maybe we can talk on aim, wink wink.

klange
January 31st, 2009, 11:37 AM
Well, I'm here with more updates. Been a few days, and I've added some things. Working on some minor bug fixes at the moment, but I pieced together a little web interface last night:

Enjoy this game between two AI (http://oasis-games.com:2009) (Note: Only works properly on browsers that support transparent Iframes, that is, NOT IE, because I'm extremely lazy in my content refreshing methods.)

The interface is served through a small web server that's part of the main game server. It does slow the AI down noticeably, so it's going to be optional and possibly easy to start/stop from the server console. It uses Python's BaseHTTPServer to handle the finer details of serving content. The background is simply a base64-encoded PNG. Two Iframes have refreshing content in them. I'll probably replace it with some javascript later.

Current line count: 2277

e: If the server isn't up and you're really that interested, hit me up on MSN/AIM