Jump to content
How to Install Plugins ×

ChessFEN (Updated 13 July 2008)


Ego Eram Reputo

Recommended Posts

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.

[edit]

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:

 

Chess_FENUI.png

 

Secondly, showing a FEN string in action:

 

ChessFEN.png

[edit]

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 :D

Enjoy :!:

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

Edited by toe_head2001
Fixed broken Postimg image
Link to comment
Share on other sites

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

Thanks for the plugin!

EliteOverride25.png

:) Visit-> My Website <-Visit :)

Please Call Me Elite Override

The trick to flying is throwing yourself at the floor and missing.

Link to comment
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 )

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

EDIT: :shock: :shock: :shock: MINE DOESNT WORK :cry: 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?

"Confusion is the welcome mat at the door of creativity." -Michaul Gelb

My Gallery Check it out!

Link to comment
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.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
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.

KaHuc.png
Link to comment
Share on other sites

I have played chess many times :mrgreen: , 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.

Link to comment
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?

[edit]

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

[/edit]

Link to comment
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 :P maybe white rgb(254,254,254) in contrast to the white of the board rgb(255,255,255)

I also like chess ;)

Link to comment
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.

KaHuc.png
Link to comment
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 :P 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.

Link to comment
Share on other sites

  • 1 year later...

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

Link to comment
Share on other sites

  • 7 years later...

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 ;) )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...