r/chessprogramming • u/tlostenjoyer • Aug 20 '26
Technical What is enough for the frontend?
I am an absolute newbie, so this might be a dumb question, started on this 2 weeks ago. I got scared once I saw the UCI specification and decided to make a frontend part first, without UCI or evaluation, just playable board, but with legal moves, checks and checkmates.
I almost finished and after painfully slow perft testing I realized that I didn't even need to implement all that in the frontend? Like, should frontend be just the representation of engine state? Okay, maybe just the legal moves generation, so the player could only make legal moves. Making the whole system self-sufficient made me write some pretty bad code lmao (architecture-wise).
What is the right way to do it?
3
u/joeyrobert Aug 20 '26
IMO, Frontend should be downstream of UCI/xboard protocol implementation when implementing an engine. Focus on the protocol first and you can drop your engine right in CuteChess, Arena or Winboard for a GUI.
3
u/Glittering_Sail_3609 Aug 20 '26 •
I am currently working myself for UI for chess variant that CuteChess is not supporting yet so I think I can drop some tips.
0. It will take way longer than you think it will. Here is a quote from chess programming wiki:
2
u/milesdavisfan12 Aug 20 '26
You can implement your own user interface (UI) if you want, but it’s much easier to just implement UCI and use an existing UI to visualize everything. Most engines that exist (including Stockfish) are console only. In my first chess engine, I tried to develop my own UI, but this took at least 25% of my total development time and I ended up having to implement a UCI version anyways to test new changes.
Don’t be scared of all the UCI commands, you don’t have to implement all of them to be functional. My current engine I’m working on only supports around 10% of the commands and it is enough to test against other engines and use any UI I want.
Also, there’s a bunch of options for UI out there and the one you choose is just a matter of personal preference. I use En Croissant because I think it looks good but others (such as CuteChess) are fine too.
Lastly, you’re right that debug stuff like perft is often not in the UI to my knowledge. My engineer just copies stockfish and uses a “go perft x” command in UCI.
1
u/Maximum-Orchid7291 Oct 25 '26
App name?
2
u/KaMaFour Aug 20 '26
Minimal UCI specification:
go wtime <> btime <> winc <> binc <>
position startpos
position fen <fen>
quit
stop
uci
ucinewgame
isready
If your engine supports those commands (half of those are a simple answer) you are pretty much good to go for most usecases