'Fairy' Piece functionality

Sort:
Unperceptive

Hopefully this is in the right place, this is the first time I've ever posted on these forums. 

So I'm not the greatest at chess in general. I'm not very good at remember openings or responses to them, but I still have fun. I've had several ideas for variants and I can't find anything quite like what I have in mind. I've been trying to find site or program that allows you to create new pieces and new movement abilities. I'm aware there is a custom variant feature, but does it allow you to:

Create a 'new' piece(or just combine abilities)

Add a new image for the piece

Add abilities like 'freeze or pull'

The 3rd one is the main factor. I've found places that give me some of these options, but nothing all together. I'm starting to realize I probably have to make my own engine, or modify an existing one. Do I just start learning how to code an engine and go from there? It's almost like the pieces I intend to add change the entire structure of the game itself, and It would only utilize a checkerboard and the idea of checkmating the king. I'm sure this question has been asked before, but none of the answers have really been what (I think) I'm looking for. 

Any help would be appreciated.

HGMuller

I guess it will be more important how good you are at programming than how good you are at chess. It is not entirely clear what your eventual goal is. Do you want to create an opportunity for human players to play these variants against each other on line? Or is it just that you want to play these variants against an AI? And in the latter case, what level are you aiming for: should it be a super-human 3000+ Elo monster, or an entertaining opponent that you can beat?

There already exist several engines that can be configured for playing variants with unorthodox pieces, and most downloadable user interfaces do allow arbitrary graphics to be used for the piece images. So that it is only a matter of whether the number of different piece types it supports is enough for the variant at hand. E.g. WinBoard / XBoard supports 66 different piece types.

Using pieces that move in unorthodox ways is usually no problem, but the 'abilities' you mention can be an issue. I suppose that with "freeze" you mean some kind of immobilizer, which would prevent adjacent enemy pieces from moving or capturing, but I am not sure what you mean by "pull". In general pieces that affect what happens on squares other than the two between which they move are very un-chess-like. The number of possibilities for this are unlimited, which makes it very unlikely that a configurable variant engine would offer exactly what you want as a standard option. There are very general programs for implementing games, such as Jocly or the commercial Zillions of Games, where you can basically implement anything, but this requires you to write part of the program yourself.

I developed a JavaScript program for including "Interactive Diagrams" on a web page, so they can be viewed through a web browser. This is very easily configured for a wide variety of chess variants, by embedding a description of the appearance and rules for the variant in the web page. Such a description consists of specification of the graphics to use for the pieces, and the color of the board, as well as the board format, a list of participating pieces, how each of these moves, which of those promote, and what they can promote too, how deep the promotion zone is, which pieces are royal, etc. This is enough for implementing a great many chess variants ( https://www.chessvariants.com/invention/variants-playable-against-the-diagrams-ai ). The diagram is equiped with a (rather weak) AI so it can act as a sparring partner for people who have just read the explanation of the rules for that variant.

Rules that are not implemented as a standard feature, so that it is not possible to merely switch those on, can sometimes be enforced by small user-supplied JavaScript functions, WeirdPromotion or BadZone. The former can take care of automatic changing of the piece type on some moves (e.g. for implementing pieces that move differently in different locations, or which promote when they capture something). While the latter was intended for enforcing confinement of pieces to part of the board (as in Chinese Chess), or restrictions on what can capture what (such as the ban on Cannons to capture each other in Korean Chess), by vetoing some of the moves that would otherwise be allowed.

This BadZone routine could conceivably be used to veto moves of a piece standing next to a piece of some other type, albeit in a rather inefficient way. It does require some programming in JavaScript, however. In general move definitions for the pieces allow the possibility to capture something on squares where you do not move to, and to 'unload' what you captured on another square, which in some cases would allow it to displace other pieces. There also is a possibility for a piece inducing new moves in others.

Unperceptive

You basically said everything I wanted to in a better way. I figured all the things I wanted were available except the unique ability. Funnily enough, I have that site in my bookmarks, I just wanted to confirm what I was trying to accomplish. I think you are correct in that I'll have to program in the additional abilities myself, which is fine, I've been learning c++/java off an on for about 3 years now, and I've been trying to finding something to start modifying rather than begin from scratch. I'm going to look into everything you said, but I'm going to copy past my ideas here so if anyone wants to use them, go ahead. Ideally it would cool if they could be implemented into an engine, but a simple board that you can play on that understands the moveset would probably the first step anyway. Thanks for the quick an thorough response, you gave me all the information I was looking for.

 

chess piece type

edge type: can only move along edge, or from edge to edge
magnet: can make certain pieces gravitate towards the 'magnetic' piece
freeze: can 'pin' pieces in place, the freeze piece must be destroyed or moved to negate the freezing effect

Freeze: MEDUSA: 
Medusae can move diagonally in any direction, but only 3 spaces. 
Once moved to a space, Medusae can choose to face in 1 of 4 directions, N, S, E, W. 
The first piece along the chosen file is 'frozen in place'. 
Queens are immune to the gaze. 
Medusae can capture any piece. 
Any piece can choose to block the gaze of the Medusae except the King.
The gaze of the Medusae puts the King in check. 
Pieces can cross the file of the gazing Medusa, but will be frozen if they stop within it.

Magnet: SIREN: 
Siren pieces can 'beckon' pieces toward them, but the piece can only move as it normally could. A Knight can only be beckoned if it is one jump away.* 
If a Siren captures a piece, it cannot beckon after. 
A Siren can beckon before moving, but the Siren has to move the direction it is facing.
Once moved to a space, Sirens can choose to face in one of 8 directions. 
The first piece along the chosen file is 'beckoned' towards the Siren, and is placed in the square directly 
next to the Siren. 
Sirens can move 2 spaces horizontally and vertically, and 1 space diagonally.

Edge: GARGOYLE: Gargoyle pieces can 'hang' upon the edge of the board. 
They can 'grab and hold' any piece within one square of them. 
They can fly along any file to the space directly across from them. 
They can crawl along the edge in either direction, but only 2 spaces. 
Gargoyles can only capture pawns, but can 'hold' any piece.
Gargoyles are placed on A2, A7, H2, H7

Sirens and Medusae replace one Knight and one Bishop respectfully.
The players choose which knight and bishop to replace. Black chooses first.
Medusas are locked to the color they are placed on. The players start without S, M, B or N on the board
Players take turns until all pieces are placed. White moves first.

Possible Arrangements:  
RSMKQBNR RNMKQBSR RSBKQMNR RNBKQMSR
GPPPPPPG GPPPPPPG GPPPPPPG GPPPPPPG

HGMuller

Some of the effects you mention are possible in the Interactive Diagram. You use the concept of oriented pieces, and this can be achieved by defining each orientation of the piece as a different piece type, and supply a function WeirdPromotion() to make each of these promote on every move they make, thus forcing the user to select a new orientation. I used that technique for Centennial Chess, which features a piece called Rotating Spearman.

Confinement to a board edge can also be achieved, because moves can be 'multi-leg' to describe complex paths, and some points on the path can be required to be outside the board. So a Queen that is only allowed to land on edge squares can be described as a 3-leg move that first moves as a normal Queen, but then must make a back-and-forth King step visiting an off-board square.

Freezing can be implemented by providing a BadZone() routine that would scan the board in all possible directions from which you can be frozen, to see if there indeed is a piece that freezes you there. But this would then be done on every move of every piece, as BadZone() is applied per move, and not per piece. Perhaps the move generator could be improved by defining a special return code of BadZone() that would not only veto the current move of the piece, but also dissuade it from attempting to generate any other move for that piece.

Unperceptive

Very interesting. I didn't realize that YOU made this site, that's awesome. I'm going to spend some time this week (hopefully, if I have the time) to try to run through the functions you mentioned. It'll take some messing around to fully understand your system, but this is pretty much was I was looking for. I'll try to post any progress or issues on that site. 

I've been trying to wrap my head around some of the specifics of OOP like polymorphism and inheritance. I get the concept, but in terms of actual programming (so maybe I don't heh) but this is the perfect project I think to finally get me past some of the issues. Again, thanks for the help and info, I'll try to see what I can come up with. 

evert823

One more relevant link:

http://talkchess.com/forum3/viewforum.php?f=7

 

HGMuller
Unperceptive schreef:

Very interesting. I didn't realize that YOU made this site, that's awesome. I'm going to spend some time this week (hopefully, if I have the time) to try to run through the functions you mentioned. It'll take some messing around to fully understand your system, but this is pretty much was I was looking for. I'll try to post any progress or issues on that site. 

I've been trying to wrap my head around some of the specifics of OOP like polymorphism and inheritance. I get the concept, but in terms of actual programming (so maybe I don't heh) but this is the perfect project I think to finally get me past some of the issues. Again, thanks for the help and info, I'll try to see what I can come up with. 

Well, I did not make that entire website, but I did develop the Javascript code Interactive Diagrams that are used on that site, but are free for use on any other website as well. Some other people that are contributing to the chessvariants.com website are making use of the script to dress up the pages they contribute with Interactive Diagrams of the variants they designed.

I visit that website almost daily, so discussing any issues with the code there is a good idea. I was actually thinking about creating a new article there for describing how to extend the script through some standard user-supplied JavaScript functions, for defining irregular promotions or piece-type-dependent capture rules.

Note that I am not really into object-oriented programming; I usually program in plain C, with a style that reminds people of assembly language. And I use JavaScript as if it was C.