Followers 0

# ChessFEN (Updated 13 July 2008)

## 15 posts in this topic

Confession: I'm a chess nerd :oops:

I'm regularly drawing chess boards and chess diagrams for analysis and I thought to myself "wouldn't it be cool if I could do this in Paint.Net?". Well, now you can!

Introducing ChessFEN (Updated 13 July 08)

Description and function of the plug-in:

Parses a FEN* string & draws the resultant chess position using the Chess Merida font. It is therefore ESSENTIAL to have Chess Merida font installed before running the plugin! You can get the Chess Merida Font here: http://www.enpassant.dk/chess/fonteng.htm#MERIDA

*Forsyth-Edwards Notation (FEN) is a notation for describing chess board positions. The purpose of FEN notation is to provide all the necessary information to restart a game from the given position. Wiki FEN for more information: http://en.wikipedia.org/wiki/FEN

The FEN string for the initial position of a chessboard looks like this:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

Here’s a sample positron for you to try (White to move and win):

r3k2r/pb1nqppp/1p2p3/8/P1BN4/2P5/5PPP/R2QR1K1 w kq - 0 0

Configuration of the plugin couldn’t be easier:

Board Size: sets the size of the board – obviously!

Show Coordinates: Toggles the algebraic coordinates around the board on & off

Show Game Info: Toggles additional game info (who is to move, castling rights, ep square) on or off.

Use Initial Position: When checked, the initial chess position is shown. When unchecked, a FEN string is parsed from the window below.

New 13 July 08! Draw Board Only: Draws a blank board, with or without coordinates.

[/edit]

Ya just gotta see it in action don't ya? Well, here you go...,

First off, showing the initial chess position:

Secondly, showing a FEN string in action:

Previous incarnation of ChessFEN would break if you tried to build a FEN string by typing it directly into the textbox. This is no longer the case!. I have rebuilt the plugin as per the suggestions from Rick and Simon below. So now you can build a FEN string from scratch by typing directly into the textbox. Thanks guys for your suggestions.

[/edit]

Thanks to BoltBait for your encouragement, and of course, codelab

Enjoy :!:

Note: This plugin is now housed in my plugin pack http://forums.getpaint.net/index.php?/topic/110145-eers-plugin-pack/

0

##### Share on other sites

I have played chess many times , but i didn't know about this FEN stuff. Where can I get more FEN strings?

Thanks for the plugin!

0

##### Share on other sites

I must agree with Icefusion, this could be very useful. But is there a way of generating FEN strings? (FEBGEN? )

P.S Dont be afraind, you are not the only chess player

EDIT: :shock: :shock: :shock: MINE DOESNT WORK All it shows is letters and numbers (the top line is as follows: t Mv WI V m T. The second line: O o O o O o O o.) Any idea why?

0

##### Share on other sites

You have to install that font

0

##### Share on other sites

Oh yes I tend to get into the habit of not reading the whole post :oops:

0

##### Share on other sites
Note: if you try to "build" a FEN string by typing it into the window, don't be surprised if the plug-in breaks. You have been warned! I suggest you paste in complete FEN strings and then uncheck the "Show Initial Position" checkbox.

I'd suggest putting your parsing of the string around a try/catch block, and if an exception is raised just default to string.Empty. You can actually use the static Do.TryCatch() method to simplify this.

0

##### Share on other sites
Note: if you try to "build" a FEN string by typing it into the window, don't be surprised if the plug-in breaks. You have been warned! I suggest you paste in complete FEN strings and then uncheck the "Show Initial Position" checkbox.

I'd suggest putting your parsing of the string around a try/catch block, and if an exception is raised just default to string.Empty. You can actually use the static Do.TryCatch() method to simplify this.

Or simply do not parse the string if there is an error.

0

##### Share on other sites
I have played chess many times , but i didn't know about this FEN stuff. Where can I get more FEN strings?

Thanks for the plugin!

You can build FEN strings from scratch, but its a bit of a pain. Many chess software programs will allow you to export a given position as a FEN string. This is how I get them:

Chessbase Lite: [with your selected position showing in the game window] Game menu>Setup position>Copy FEN string (This is now held in an internal format, so you need to paste into a move comment. Now you can select the text and copy/paste it into any text editor)

EPD strings should also work as they Extend the basic FEN string structure. I'm sure if you did a quick Google you would find many positions available.

0

##### Share on other sites
Note: if you try to "build" a FEN string by typing it into the window, don't be surprised if the plug-in breaks. You have been warned! I suggest you paste in complete FEN strings and then uncheck the "Show Initial Position" checkbox.

I'd suggest putting your parsing of the string around a try/catch block, and if an exception is raised just default to string.Empty. You can actually use the static Do.TryCatch() method to simplify this.

I'm using this technique to perform some error checking, but its a bit flaky. E.G. if you paste in a FEN string and remove a random character from the middle, the parsing routine will give you an error (in RED text no less :shock: ).

Is it possible that my attempts at more global error checking were thwarted by attempting to nest Try/Catch blocks?

@ Rick & Simon: Thank you for your suggestions which have been incorporated into the new version of ChessFEN (see original post).

[/edit]

0

##### Share on other sites

It would be nice, if the black fields of the board would have a different color from the black pieces and be solid. So everyone could more easily do individually styled images. The colors of the pieces are also not so easy editable if you would for example want a texture to fill them, you would want to select all white pieces at once and do a photo flood fill. But I don't know a good solution for that atm... white pieces just should be white maybe white rgb(254,254,254) in contrast to the white of the board rgb(255,255,255)

I also like chess

0

##### Share on other sites

So, if I understand correctly: I can now play chess through Paint.NET? Awesome.

0

##### Share on other sites
So, if I understand correctly: I can now play chess through Paint.NET? Awesome.

From what I can see the plugin renders a chess diagram from an FEN string.

0

##### Share on other sites
It would be nice, if the black fields of the board would have a different color from the black pieces and be solid. So everyone could more easily do individually styled images. The colors of the pieces are also not so easy editable if you would for example want a texture to fill them, you would want to select all white pieces at once and do a photo flood fill. But I don't know a good solution for that atm... white pieces just should be white maybe white rgb(254,254,254) in contrast to the white of the board rgb(255,255,255)

I also like chess

We're working with the Chess Merida font here, so all we can choose is the colour of the font. The pieces and squares are not individual images which are able to be edited. Change the color of the diagram by selecting a different primary color before running the plug-in.

I suppose if you were really clever you could draw the board only on another layer, and then use this as a mask to change the squares under the pieces. This is a bit out of my league..,

@ Mike: No, Simon has it correct. ChessFEN just draws diagrams.

0

##### Share on other sites

Source of FEN strings for many openings: www.chessgames.com

0

##### Share on other sites

The version of this plugin in my Plugin Pack has been updated (Plugin Browser preview image).

You can now select which font to use from within the plugin (I'm still recommending Chess Merida )

0