Maestro: a chess gui (wip)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Maestro: a chess gui (wip)

Post 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.
Last edited by netmaestro on Mon Jan 03, 2011 7:01 am, edited 3 times in total.
BERESHEIT
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Maestro: a chess gui (wip)

Post 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! :wink:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Maestro: a chess gui (wip)

Post 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 :twisted:
BERESHEIT
User avatar
Michael Vogel
Addict
Addict
Posts: 2807
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Maestro: a chess gui (wip)

Post 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
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Maestro: a chess gui (wip)

Post by ts-soft »

Image
looks very good!

I have win my first game today :mrgreen:

Image

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Maestro: a chess gui (wip)

Post by Vera »

fantastic: won in one stroke :lol:
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
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: Maestro: a chess gui (wip)

Post by TomS »

Looks good.
The graphics are not yet perfect.
Image
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. ;)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Maestro: a chess gui (wip)

Post 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.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Maestro: a chess gui (wip)

Post 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.....
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
buddymatkona
Enthusiast
Enthusiast
Posts: 252
Joined: Mon Aug 16, 2010 4:29 am

Re: Maestro: a chess gui (wip)

Post 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.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Maestro: a chess gui (wip)

Post 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.
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Maestro: a chess gui (wip)

Post by netmaestro »

Anyone getting problems with the resizing?
Is the crash-on-exit still happening?
Thanks for any feedback!
BERESHEIT
Little John
Addict
Addict
Posts: 4789
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Maestro: a chess gui (wip)

Post 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. :D
Last edited by Little John on Tue Jan 11, 2011 8:11 am, edited 1 time in total.
User avatar
IceSoft
Addict
Addict
Posts: 1694
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Maestro: a chess gui (wip)

Post by IceSoft »

A very good 3D chess board implementation is done with the MP3D engine:
http://www.purebasic.fr/german/viewtopi ... lit=schach
Belive! C++ version of Puzzle of Mystralia
Bug Planet
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: Maestro: a chess gui (wip)

Post 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
Post Reply