Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Creating a non-mobile poker(ish) application - what language to use ?

  • 24-02-2011 5:42pm
    #1
    Registered Users, Registered Users 2 Posts: 2,406 ✭✭✭


    Hi guys. I have a quick question. I want to create a poker (not actually poker but similar enough) application but was wondering what language to use. I was gonna do it in java. It's the GUI that I'd be wary of. I've no java GUI experience. Ai would be the fun/easy part. Would java be a good fit ?

    I have a few java books also.


Comments

  • Registered Users, Registered Users 2 Posts: 1,922 ✭✭✭fergalr


    brianon wrote: »
    Hi guys. I have a quick question. I want to create a poker (not actually poker but similar enough) application but was wondering what language to use. I was gonna do it in java. It's the GUI that I'd be wary of. I've no java GUI experience. Ai would be the fun/easy part. Would java be a good fit ?

    I have a few java books also.

    Depends on why you want to create it. If you want to have other users use it, and make it easy to deploy, you probably want either web, or native; but it depends.

    I'm going to assume its for your own personal use, for fun; in which case Java is a fine choice. Plenty of good GUI toolkits in java. If you just want to write a simple poker application, and spend your time working on the logic, Swing should be fine.

    If I was writing it, I'd probably use a faster-to-code-in language like python, but java would be fine.

    You mention working on the AI - do you mean the game logic? Poker AI - bots that play poker - is hard; very interesting, but hard.


  • Registered Users, Registered Users 2 Posts: 2,406 ✭✭✭brianon


    Thanks for that. It's just for personal use yeah. It's big actually poker bug a game called tichu. It's the bots/Ai I want to get coding on as that's the interesting bit. The GUI is just so it's a little easier to use. I want to be able to see in realtime what cards are being played (as well as log to a db or text file). I've no swing experience. Is it easy enough to display images and have mouse clicks register on images as an event (selecting the card) ?


  • Moderators, Technology & Internet Moderators Posts: 1,336 Mod ✭✭✭✭croo


    Sounds like this is a "for fun" project so don't want to spoil anything for you but since it's not actually poker you want to develop perhaps you might benefit from the ground work some open source poker games have laid. The best such project I know would be POKER TH
    http://sourceforge.net/projects/pokerth/
    It's developed in c++ with the QT libraries (I think).
    Just thinking it might be easier to put your own game AI into this than start from scratch


  • Registered Users, Registered Users 2 Posts: 2,406 ✭✭✭brianon


    Tichu and Poker AI would be very different. The reason I mentioned Poker was more for the GUI (displaying cards, selecting cards). The AI is the bit I want to focus on myself. I just want a basic gui really to start with so I can start on teh meat of the project :D


  • Moderators, Technology & Internet Moderators Posts: 1,336 Mod ✭✭✭✭croo


    brianon wrote: »
    Tichu and Poker AI would be very different ... The AI is the bit I want to focus on myself
    Yeah, I got this. I thought it might be possible to remove the poker AI and re-implement your own AI. Was just a thought, no worries.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭Freddio


    brianon wrote: »
    The reason I mentioned Poker was more for the GUI (displaying cards, selecting cards).


    If you are using a web language, you could implement "drag and drop" UI with jquery


  • Registered Users, Registered Users 2 Posts: 2,406 ✭✭✭brianon


    Thanks for the input guys. I'm looking at using the GridBagLayout with GridBagConstraints. Seems I might be able to get something usable without TOOO much work with this. Bit tricky to get my head around atm though.


  • Registered Users, Registered Users 2 Posts: 1,922 ✭✭✭fergalr


    brianon wrote: »
    I've no swing experience. Is it easy enough to display images and have mouse clicks register on images as an event (selecting the card) ?
    Yes, that should be very easy to do, especially if you are happy to have a scrappy development version.

    brianon wrote: »
    Thanks for the input guys. I'm looking at using the GridBagLayout with GridBagConstraints. Seems I might be able to get something usable without TOOO much work with this. Bit tricky to get my head around atm though.

    There's a lot to Swing; but just play with it for a bit, trying to build applications, piece by piece, and it'll soon come together.
    The dominant paradigm is model-view-controller http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller
    and once you get your head around how that is implemented in Java (with listeners, and listener interfaces etc) it all just sort of clicks together.


    brianon wrote: »
    Thanks for that. It's just for personal use yeah. It's big actually poker bug a game called tichu. It's the bots/Ai I want to get coding on as that's the interesting bit. The GUI is just so it's a little easier to use. I want to be able to see in realtime what cards are being played (as well as log to a db or text file).

    You know, if what you want to work at is actually the AI, I would spend very little time on the GUI at all. I think its generally worth building one as you write a bot, rather than just messing around with a command line interface; but you'd probably expect to spend more time building bot diagnostic visualisations than a GUI with which to play the game.

    Because you'll typically be interested in the bots performance across many more scenarios than you can hope to play with it by hand, in a card game.

    edit:
    Actually, out of interest, how are you going to write the bot?
    eg: A heuristic set of rules? Some sort of search strategy? (some varient of minimax?) Statistical learning? Some sort of temporal difference learning?

    I'm not familiar with the rules of the tichu game.


  • Registered Users, Registered Users 2 Posts: 2,406 ✭✭✭brianon


    fergalr wrote: »
    edit:
    Actually, out of interest, how are you going to write the bot?
    eg: A heuristic set of rules? Some sort of search strategy? (some varient of minimax?) Statistical learning? Some sort of temporal difference learning?

    I'm not familiar with the rules of the tichu game.

    Of that my friend I have NO idea :D

    Tichu is a partners trick taking game. The only thing that makes it like poker that you can play pairs, trips, full house and straights. But you get 14 cards each to start. 5 are worth 5 points. 10s, Kings are worht 10 points. Dragon is 25 points and Phoenix (wild card) is worth -25 points. There is card passing before the start of play and first team to 1000 points wins. So while it might 'look' like poker at times, it really isn't like it at all.

    I just know for my own motivation that I'd like to have a reasonable GUI. The AI can be plugged in then at a very basic standard and improved on incrementally.

    Have you any good links/resources for Swing ?


  • Registered Users, Registered Users 2 Posts: 1,922 ✭✭✭fergalr


    brianon wrote: »
    Have you any good links/resources for Swing ?

    Just whatever turns up in google.
    The official Java Tutorials (http://download.oracle.com/javase/tutorial/) are all out there, and should be more than enough to get started.
    But the internet is full of guides on writing java code, you shouldnt have any problem.


  • Advertisement
Advertisement