Sign in to follow this  

Fastest way to implement a chess-like game (cross-platform, preferable in Java)

This topic is 2632 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,
I want to implement a game with rules similar to chess (NxN board, chess-like pieces, different move rules though). Some features I want (and need) are:
ability to play vs human (locally, no need for online play)
ability to play vs AI (this is actually the main part, the main goal of the project is AI experimenting)
timing system
game loading/saving/reviewing

First I thought about some universal game framework which could allow me to only define game rules but I didn't find any framework of such type with sophisticated game control (notation support, jumping to any move, writing move comments).
Next idea I'm thinking of is to take some existing open-source chess program and modify it to support my game. Especially, when there is so little to tweak in my case: just notation and rule system.

So my question is: what good cross-platform chess programs do you know? Most things I've found on the Web are simple Java applets with just bunch of buttons but I need a much more serious program...

Thanks in advance for any suggestions/ideas/comments,
Sergei

Share this post


Link to post
Share on other sites
The strongest open-source chess program is Stockfish. Other strong open-source chess programs are Fruit and Crafty. I don't know what license they are under. You need to make sure the authors allow you to use their program the way you want.

How different from chess is your game? Large parts of those programs might be rendered invalid by small modifications to the rules.

Share this post


Link to post
Share on other sites
alvaro
Thank you for the answer but I think you misunderstood me. The programs you mentioned are just chess AI engines which don't have their GUI but instead implement some protocol which allows to connect them to any GUI supporting this protocol.

What I need is essentially such GUI which I should be able to modify to suit my game.

Share this post


Link to post
Share on other sites
Quote:
Original post by qyron
alvaro
Thank you for the answer but I think you misunderstood me. The programs you mentioned are just chess AI engines which don't have their GUI but instead implement some protocol which allows to connect them to any GUI supporting this protocol.


I thought your main concern was how to implement the AI. You should definitely consider separating the engine into its own process that communicates with the GUI through some text-based interface.

Quote:
What I need is essentially such GUI which I should be able to modify to suit my game.


I think you should probably roll your own. It can't be that hard to do.

Share this post


Link to post
Share on other sites
mrchrismnh, alvaro
Do you really think that writing chess-like GUI from scratch is easier than modifying an existing chess GUI?!
The board itself isn't hard thing to implement but why should I do it when there are hundreds of implementations on the Web? There many 100-line applets which do this and it's a deal of 1-2 hours to adapt them to a new game.
Also, game-loading/saving/navigating and timing has nothing to do with game mechanics, if implemented properly, so there's nothing to change there except may be for game notation.
Unneeded parts of the GUI (online play protocol) can just be deleted.
Actually my goal is just to find some decent well-written cross-platform GUI with not-so-many features (to reduce amount of work). Applets are too simple and full-featured GUIs like XBoard are too heavy so I need something in the middle :)

Share this post


Link to post
Share on other sites
Quote:
Original post by qyron
Do you really think that writing chess-like GUI from scratch is easier than modifying an existing chess GUI?!


My expectation:

It will be hard to find source for them, and most of them won't have been written to make it easy to modify. Or at least, the amount of work involved in modifying them won't be that much less than doing it from scratch, especially once you've got a solid understanding of how a particular GUI toolkit works.

Also, you really should make sure you can get the main logic written before you start worrying about a GUI. Also, do you actually have the move rules, board size etc. written out?

Share this post


Link to post
Share on other sites

This topic is 2632 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this