Page 1 of 2
Maestro: a chess gui (wip)
Posted: Mon Jan 03, 2011 4:02 am
by netmaestro
It's early goings with this one. All I have so far is the basic framework for drawing the current state of the game and rudimentary moving of the pieces around. No legality verification is done at all so far. Basically in its current state this program will let you do exactly what you could do if you physically set up a chessboard and started moving the pieces around. Nobody would tell you "you can't do that" or anything.
All the graphics are drawn using the basic techniques of "simple screenless animation" found here:
http://www.purebasic.fr/english/viewtop ... 12&t=18587 with all objects rendered to ImageOutput using the Windows gdiplus library. No screens or sprites a la DX or OpenGL are used. I'm a huge fan of gdiplus as it's one of the finest pieces of work Microsoft has ever produced. It is small, very fast and it all "just works". Collision testing is done with Windows Regions created using this tool:
http://www.purebasic.fr/english/viewtop ... 12&t=27740 which several forum members here helped me to create. Many thanks to them.
If you could download the program and play with it, I'd like any negative feedback that might arise regarding the general quality of rendering and smoothness of moves. Please let me know of any flickering or jumpiness.
Btw, you don't hold the mouse down on a piece while moving it. The upclick picks the piece up and it follows your mousepointer until you drop it without your holding any buttons down. I find this, once you get used to it, much less work than common dragging.
Here it is, thanks for any (especially negative) feedback:
http://www.lloydsplace.com/maestrochess.exe
btw, en passant, castling or promotions are not implemented yet.
Re: Maestro: a chess gui (wip)
Posted: Mon Jan 03, 2011 4:29 am
by IdeasVacuum
Well, I really like the way you pick/release the chess pieces, that is excellent. Graphics are very very good on my PC, not a hint of a problem anywhere. WinXP 32bit, Screen 1280 x 1024 x 32bit, nVidia GeForce 7900GT.
Concerning the list of moves, would be nice to prefix each move with white/black, piece name, move number.
Top Quality!

Re: Maestro: a chess gui (wip)
Posted: Mon Jan 03, 2011 4:57 am
by netmaestro
Thanks for the feedback, it's appreciated. The movelist will become a ListIcon soon and will be functional to the extent that selecting any move in the list will rewind the game to that position with the appropriate player on move. For now I'm only using it as a sort of debugger to make sure that it's recording the moves accurately. Future (very near future) plans include connecting the gui to Bob Hyatt's Crafty chess engine (strong GM level), the implementation of a clock and (medium future, say 6-8 weeks) peer vs. peer network play. In network play mode the gui will transmit whether the sent move was generated by the player or the engine

Re: Maestro: a chess gui (wip)
Posted: Mon Jan 03, 2011 8:09 am
by Michael Vogel
Hey,
looks quite fine here, remembers me, I wanted to write a small chess server some years ago, which allowed to do multiple games for human players -- never had enough time to finish my work
Just two observations:
• the chess board size is to large for my tiny netbook resolution here (1024x600), so (automatic) scaling of the bitmaps would be a cool thing, but resizing the images smoothly AND keeping the transparent info could be a challenge.
• after doing some moves, the program has crashed -- I don't expect, that a demo is bullet proof -- if further tests should be done, tell me
Michael
Re: Maestro: a chess gui (wip)
Posted: Mon Jan 03, 2011 9:17 am
by ts-soft

looks very good!
I have win my first game today
Greetings - Thomas
Re: Maestro: a chess gui (wip)
Posted: Mon Jan 03, 2011 10:12 pm
by Vera
fantastic: won in one stroke
netmaestro wrote:Nobody would tell you "you can't do that" or anything.
Best chess I've ever come across since I've been tortured with it when I was a child - so thanks for that
Besides it renders fine without any strange occurrences and the handling is very obvious/natural. Besides I like the dropping sounds and presume they'll be varied as the developement progresses.
and yes - I'd also appreciate a smaller main interface
idea: as right now, one can set the figures where one pleases, you might supply a kind of
'free position modus' to start from, so chess-fans can put up classic matches / positions manually ...
greetings ~ Vera
Re: Maestro: a chess gui (wip)
Posted: Mon Jan 03, 2011 10:34 pm
by TomS
Looks good.
The graphics are not yet perfect.

Click to zoom.
But that's a minor issue for a demo and presumable has to be done by the end-user, should you release it as a lib.
I also second the smaller interface. With 1366 x 768 there are 60px of the window hidden behind the taskbar.
And thirdly, I'd prefer if I can select a token by clicking on its field not only the icon. If you click the queen on the top half, there's like a 50% chance, that it's not selected because of the shape of the icon.
@Vera: Show me how you won at first move. The aim of the game is to check mate the opponent's king, not to strike him. I don't think there's a way you could do that with just one move.

Re: Maestro: a chess gui (wip)
Posted: Tue Jan 04, 2011 2:37 pm
by Trond
What I noticed:
- Some black pieces on black squares have white fringes
- Some white pieces on white squares have black fringes (these are also on the screenshot from ts-soft)
- I too would like a click rectangle rather than a pixel accurate hit test.
- I don't like the handling of the pieces. In particular it looks odd that the piece follows the cursor while the cursor is still visible. Maybe hide the cursor and highlight the piece "in air" with a glow?
- It would be nice to have squares which are legal moves highlighted (and highlight the current square with a different colour) as shown here:
http://img82.imageshack.us/img82/2071/glchessuq0.jpg
- The board is much too big for my taste. If you could make it freely scalable while preserving the good graphics quality it would be cool, but i imagine that will be difficult.
- The pieces (especially the castles) are not horizontally centered on the squares.
- When closing the program it crashes.
Re: Maestro: a chess gui (wip)
Posted: Tue Jan 04, 2011 5:38 pm
by IdeasVacuum
idea: as right now, one can set the figures where one pleases, you might supply a kind of 'free position modus' to start from, so chess-fans can put up classic matches / positions manually
That is a very good idea from Vera.
Mine is less good, but it is an idea: Permit the loading of alternative chess piece graphics from a folder. That way, though I may never win a chess match, at least I can lose using different sets.....
Re: Maestro: a chess gui (wip)
Posted: Thu Jan 06, 2011 5:28 pm
by buddymatkona
The quality of rendering and smoothness of moves is fine here with Win7. If you are thinking commercial, I would say the look is perfect for eBooks, puzzles, and articles. People in the market for an online or AI player might prefer more traditional looking pieces.
Re: Maestro: a chess gui (wip)
Posted: Sat Jan 08, 2011 11:05 pm
by netmaestro
I made some changes to the program, the board is now resizable, the window is smaller, the pieces are better centered in the squares and the exe is much smaller as I'm drawing the board as opposed to catching it. Hopefully the crash-on-exit problem is gone as well as I'm disposing all the images before shutting down gdiplus, I wasn't before. If it's still happening I probably missed something else. Btw, it never did that here on Windows 7, maybe the new os handles memory mistakes on program closing more gracefully.
If you resize the board slowly, you will notice that it doesn't size smoothly. There's a bit of jump. This seems unavoidable as each resize must be a multiple of 8 in order to keep the 64 squares all the same size. I tried resizing smoothly and then snapping to an 8-pixel grid on WM_EXITSIZEMOVE but when I did that the image was enlarging only the outer squares and man that looked awful. So I guess I have to live with the jumpy sizing.
Apart from these changes, there's no new functionality yet. It's important to me to get this part right before building on it. Any bugs you can find will be much appreciated.
Re: Maestro: a chess gui (wip)
Posted: Tue Jan 11, 2011 2:36 am
by netmaestro
Anyone getting problems with the resizing?
Is the crash-on-exit still happening?
Thanks for any feedback!
Re: Maestro: a chess gui (wip)
Posted: Tue Jan 11, 2011 8:02 am
by Little John
Looks very good here (display 1280x800 pixel). Rezising works fine, all piecces are well centered. I was not able to produce a crash here (Win XP Pro SP3 x86).
Regards, Little John
And no, there is no way to win a chess game with only one move. 
Re: Maestro: a chess gui (wip)
Posted: Tue Jan 11, 2011 8:04 am
by IceSoft
A very good 3D chess board implementation is done with the MP3D engine:
http://www.purebasic.fr/german/viewtopi ... lit=schach
Re: Maestro: a chess gui (wip)
Posted: Sat Jan 29, 2011 6:42 pm
by rsts
Had a bit of spare time and gave it a shot.
Slick. I didn't notice any problems at all.
Are you planning on fleshing it out with some ai or just testing graphics?
Nice work.
cheers