Forums

Chess Variant Creator, if you have questions.

Sort:
HGMuller

Well, I don't know which variants you had in mind, but Fairy-Max comes with pre-defined variants:

FIDE

Makruk (Thai Chess)

Seirawan Chess (B+N and R+N compunds introduced during opening)

Shatranj (ancient Arabic Chess)

Knightmate (K moves as N, N as K)

Capablanca (10x8)

Gothic (10x8)

Courier (medieval variant on 12x8)

Cylinder (h-file connects to a-file)

Berolina (Pawns capture straight, move diagonal)

Great Shatranj (10x8 without any sliders)

Spartan (blackplays with 2 Kings and Pieces / Pawns with non-standard moves)

Chess with Different Armies (all combinations of FIDE, Colorbound Clobberers and Nutty Knights)

 

Fairy-Max is open-source freeware, and the engine proper is only about 100 lines of C code, (plus a file with game definitions of similar size), so you could easily integrate it into another game. And you could have it play by an ever increasing number of nodes in its search tree to crank up the strength.

jessthor94

Thank you, that was more helpful than several hours searching on the internet. I also like the campaign game idea, but perhaps also having individual chess variant campaigns would improve it. I really like that idea. As for the variants I am using, mostly ones that are not already made into programs. Most of the variants will likely come from The Classified Encyclopedia of Chess Variants. I highly recommend the book to anyone who is interested in and enjoys chess variants. Suggestions and new games are welcome and thank you.

jtt96
jessthor94 wrote:

Most of the variants will likely come from The Classified Encyclopedia of Chess Variants. I highly recommend the book to anyone who is interested in and enjoys chess variants. Suggestions and new games are welcome and thank you.


 I concur.

Bozocow

What do you use to make your variants?  I have a great idea, but so far I can only play it physically because I don't know how to design one.

ColeMertz
I'm assuming chess.com allows you to play variants, but if using the app, is it still possible to launch and play variants with friends/AI?
HGMuller
Bozocow wrote:

What do you use to make your variants?  I have a great idea, but so far I can only play it physically because I don't know how to design one.

Do you mean you want to program the computer for a Chess variant? And if so, would you want to play against a computer opponent, or just use the computer as aconnection device to play against other people over the internet?

There exists software that can do both, and is highly configurable for a wide variety of Chess variants. WinBoard is a user interface that can handle Chess variants, and with the p2p adapter two WinBoards on different machines can communicate with each other. WinBoard can use Chess engines for thinking up moves, so you can play against the computer, and engines like Fairy-Max or Sjaak II can be configured for many variants, also for those designed by yourself (if they are not too crazy).

Bozocow

The second is what I want.  WinBoard is extremely counter-intuitive, so I'd rather not even try.  I've heard about Sjaak II, I'm going to check that out tomorrow.

HGMuller

You mean you want to play other people over the internet? There are two methods for doing that: peer to peer, where you directly connect to your opponent, and server based, where you (or someone else) sets up a server in a globally accessible place, to which both you and your opponent then have to connect to communicate with each other.

Peer to peer is rather difficult, because one of the players needs to accept an incoming connection from the other, and nowadays computers are usually armed to the teeth to prevent just that. So even an attempt to start waiting for the incoming connection request can lead to immediate deletion of the software for doing it from your computer, together with a lot of other stuff, unless you pre-condition your virus scanners, firewalls and what have you. And you have to instruct your modem and router as well to pass on the connection request to your computer.

So the server method is usually easier. There both players just need a client, which makes outgoing connections only, which are usually not hindered by any protection software. But not everyone has webspace available where he can set up a server or a website.

Apart from the connection method, it is also a matter of whether you want 'live' games (instantaneous transmission of moves between players that are both connected, timed by a clock), or 'turn based' (where players show up individually to check if it is their turn, and can deposit a move when it is, which the other then finds later).

I did develop some software for a turn-based server, which uses an ordinary web browser as client. That is, the server is just a web page, to which you can surf, and then deposit a move for your game there. It is an ongoing project, really. Perhaps I will even equip it with a possibility for 'live' games, in the near future. You can find a test page where I set it up at http://hgm.nubati.net/variants/elven or http://hgm.nubati.net/variants/werewolf . It can be easily configured for the variant it plays, by altering the list of piece types on the page.

final_wars

@HGMuller

I had a look.

Where is the server in the above set up?

I assume that you are running an engine somewhere in the background, to check for legal moves etc.

I mentioned before that I was splitting my code into Server+Client.

I need to rephrase that slightly, I should say:

Engine+Server+Client+XML

If you had a Final Wars Engine written in C# ...

If you had a Final Wars Server written in C# ...

If the main input/output for the engine is an XML file ...

If the main input/output for the server is an XML file ...

Could people play, say turn based?

:)

Not sure how you set up your web server

Not sure if you are using HTML5, CSS and JS on the client (too lazy to look at the web page source)

XML will be my main abstraction (interface) layer, the 3 components (Engine+Server+Client) will not be directly linked to each other.

The Engine will use bit boards on a 9x9 board in a way that has never been seen before :)

HGMuller

The server is a CGI 'script' (actually it is a compiled C program), which is completely agnostic about the game it plays. So it can be used for any variant. It handles user registration and move deposition, where a 'move' is simply a line of text that the client submits as a move, which is then added to the file for the indicated game. It keeps a status file that records for each game who is to move, or whether it is finished, and after deposition of a move it flips the turn.

So most of the work is done by the (JavaScript) client. This interacts with the server through GET methods, submitting moves, game number and player identity in the CGI-parameters suffix of the server URL, and processing the responses by either displaying them (if they are list of games or users) or loading and making the moves (if it is a game record).

The board display is based on my 'Interactive Diagram', which is a JavaScript code that generates the board as a HTML table of image files inside a HTML tag pair with id="diagram", replacing the description of the chess variant that originally was between those HTML tags. The description contains specification of values for general parameters (such as board size in squares, square size in pixels, location of graphics files for the pieces, type of graphics, promotion zone depth, number of promoting piece types...) and piece definitions (with a line for each piece specifying the name, the ID, the name of the image file, how it moves, and on which squares it starts). Based on that information the JavaScript determines pseudo-legal moves. (There currently is no rule enforcement, though, and not even turn eforcement. This would of course be trivial to add.) The diagram is described in detail at http://www.chessvariants.com/index/msdisplay.php?itemid=MSinteractivedia , including a wizard to create one. ([Edit] Oh well, don't bother looking there. They again completely corrupted it, interpreting all escaped < signs (i.e. &lt;) as if they start an html tag, rather then printing them.)

I can certainly recommend having a look at http://hgm.nubati.net/variants/diagram/ (which contains a bare diagram) and its page source. You will be surprised at how simple it is! (The complexity is of course in the .js file it links to, which can be shared by all pages containg a diagram, as it is completely generic.)

final_wars

@HGMuller

Ok, cool, got it.

Heavy client with a thin generic server with no real seperate engine.

Looked at the client source, surprised you did not obfuscate or compress it like

if (a == b)

to cut down the network traffic or make it hard for people to reverse engineer it, most web page code is like that these days.

Not a big fan of .js at all, I really don't like late bound code.

I am going for a different approach, a very, very thin client.

No game logic at all on the client.

To reduce network traffic this means that the Engine will pass the normal stuff like position to the Server + ALL legal moves as XML

Server passes to Client and XML only goes from Client to Server when legal move. Client can not make an illegal move. Client is basically code that reads and writes XML.

On the back end a heavy engine and heavy server doing all the grunt work.

The Servers job is to handshake clients so they can play.

The Engines job is to calculate the position, game over, list of legal moves etc.

Engine does no AI at all, its just person vs. person

Will look at that .js code in more detail another day, saved the page.

Saw some server code on your site written in C, thats going to be a real pain, list of players, blah, blah.

Server will do real time games.

Cheers

p.s

I play my game on the internet, just me vs. me (how sad)

I use the Unity3D Master Server, to hand shake, run 2 instances of the program 2 play and test the network code, code is set up as RPC (Remote Procedure Calls)

I did that ages ago, I also set it up so other ppl could watch, have to route everything thru the one players machine that acts as a Game Server, that code was a real mind .... to write :)

HGMuller

The server code on my website is the open-source FICS code, which implements a server similar to freechess.org. It is a hopelessly complex code, but has nothing to do with the turn-based server I am setting up now. It needs a dedicated client like WinBoard/XBoard.

If the purpose is to minimize network traffic it would be better to have the client just send any move to the server, and let the server refuse it if it is illegal. In some games the list of legal moves can get very long. Actually, code to check the legality of moves in the client might be smaller than the move list for 10 positions, and most games would last longer than 10 moves. Did you know that micro-Max, which is an engine for orthodox Chess that actually is a decent AI (rated around 2000 on CCRL), measures less than 2000 characters? How many characters would an XML list of 40 moves be?

At this stage I am not worrying about bandwidth too much. I am still developing the code, so I want it to look decent for my own sake. When it is finished I can always compress it.

One reason I opted for a heavy client is that I also want to make it possible for people to play against a (moderately strong) AI, and I didn't feel like burdoning my server with the task of thinking up moves. So eventually the interactive diagram will also get an AI built in to it, so that people run the search on their own machine.

final_wars

@HGMuller

FICS...

Once upon a time there were a bunch of guys at university, they made one of the very first internet chess programs, very basic.

Then along came a new guy, a student, wrote code for it, copyrighted it, caused a lot of problems, the ICC was born.

The original guys took the source and created FICS from it, the party was over.

Then later history repeated itself, another guy came along and nicked the FICS open source code and chess.NET was born

NOTE: chess.NET has nothing to do with chess.COM

Then the FICS guys got really flat, it happened to them twice, they took down the FICS code, it is no longer open source.

Funny old thing with chess, easy to make a client, not so easy to make an engine or a server, so they nick stuff.

How many lines of XML?

Err, how many lines of HTML does it take to load a web page that is text heavy?

HGMuller

Well, in my experience the engines are by far the simplest of all. Like I said, with 2K characters, (about 100 lines of code) you already have a console program that performs at the level of a strong club player.

final_wars

@HGMuller

I did actually look at that code.

Final Wars is different, empty board, sectors, spawns, covers, locks.

There are a lot more factors to consider when compared to chess.

My bit board logic is also different due to the 9x9 board.

Chess engines have been around for decades.

HGMuller

Sure, orthodox Chess has relatively simple rules. Most of the micro-Max code is general search logic, though, (which you might not need if you don't want an AI). I once throught about making a version that could handle drop moves too, (for Shogi), and it would easily be 30% larger. Micro-Max doesn't use bitboards, btw, so the board size is of little import. In fact Fairy-Max, which has basically the same AI, with just slightly extended capabilities of the move generator to handle the wierder fairy pieces (and which loads the tables for it from a file, rather than hard-coding them), can handle boards up to 14x16.

But all that is very small compared to what you need to implement a decent GUI with a chess board and manipulatable pieces.

final_wars

@HGMuller

I looked at the FairyMax code before.

If I remember correctly the board was just looped

for (r = 0; ...

    for (f = 0; ...

This was done this way to handle different sized boards.

The thing I was interested in was how they did the strange pieces, like combination moves

In input file create a piece N+R

It just calls 2 seperate functions

The even stranger, say that knight that makes consequtive jumps, you use a different syntax in the input file.

Making this up, not the real syntax

N*4;

The Knight move function is called 4 times, stringing the moves along.

HGMuller

Fairy-Max just uses a (zero-terminated) list of board steps, and a corresponding list of zero-terminated 'move rights' that specify what the piece can do with this step (slide/leap, capture, non-capture, hop). So a Knight needs a list of 8 steps (marked as leaps), and a Rook a list of 4 steps (marked as slides). A compound N+R would simply have a list of 12 steps, the 8 N steps marked as leaps, the 4 R steps marked as slights. (And all marked as both capture and non-capture.) It is this list of move rights that distinguishes Fairy-Max from micro-Max; in the latter the leap/slide issue was derived from the piece type (as orthodox Chess has no slider-leaper compounds), and the capture/non-capture issue for Pawns was hard-coded as an exception.

insadsal

Hi my fiends, i love mixed double chess, 2 vs 2 in a normal chessboard,

do you know :

is there any formal championship for it?

is there any website that i can play with another person against two ones?

and how can i find further information about it?

 

thanks in advance

Bozocow

Dark Chess is one of the most interesting games I've ever played.  Endgames are so weird when your opponent suddenly shows up with a queen...