> On 24 Sep 2019, at 23:07, Philippe Michel <[email protected]> wrote:
> 
> The current GUI is probably inadequate for a phone or a tablet, but it 
> would be nice if gnubg would be usable this way (even with some 
> limitations) on chromebooks or on platforms where building it is 
> getting complicated (like Macs...)


At the risk of being off-topic I would like to share some experiences I have 
made with a somewhat similar project for chess: https://github.com/gflohr/lisco 
<https://github.com/gflohr/lisco>

Lisco is a chess UI completely written in JavaScript. The UI is using Electron 
(like Microsoft Visual Studio Code) and is therefore truly cross-platform. With 
truly I mean that it not only works everywhere but also looks nice everywhere, 
for example on my Mac but you can also run it in a web browser. At its current 
state, lisco is only a proof-of-concept but you can already play a game of 
chess against the open-source engine Lozza. If you look in the source code, you 
see how you can change the settings to play against other engines embedded into 
lisco like Stockfish or Tomitank or even let them play against each other.

Doing this for chess is trivial compared to backgammon. You mostly have to wire 
together chess engines transpiled into JavaScript with your view via protocol 
adapters. On the engine side you have the Universal Chess Interface UCI and the 
Xboard protocol aka CECP. Both protocols are pretty bogus imho but they are 
universally supported and implementations (protocol adapters) exist for a wide 
range of programming languages including Javascript. In other words, you don’t 
have to write the ugly telnet stuff yourself.

On the UI side, almost all chess analysis programs just use UCI, CECP or both 
and this is a well-established technique. Lisco is just one example for this.

Back to backgammon: I know that it would be very hard to cleanly separate the 
UI and the engine part of GNU backgammon. Most of the code was written at a 
time, when MVC or MVVM patterns were still unknown.

But it should be feasible to add preprocessor directives and change the build 
so the so that you can conditionally compile and build a headless version of 
the engine. I know, there is already a telnet interface to gnubg. Only from my 
experience with another project https://github.com/gflohr/BaldLies 
<https://github.com/gflohr/BaldLies> I remember that the telnet interface is 
not exactly nice to use. It probably needs some polishing and formalization in 
order to turn it into a protocol that is easy to use.

I would even go as far as saying that throwing the gnubg UI away altogether is 
also a viable option. Yes, it is nice and there is a lot of work in it. On the 
other hand it suffers from bit rot and it is an obstacle to porting gnubg to 
other platforms, where the UI may not even be needed. To boot, it only works on 
the desktop and will probably never work on mobile devices (unless somebody 
does a major rewrite).

Look at chess where you have the choice between hundreds if not thousands of 
different engines that you can use to analyze your play or let different 
engines compete. I am sure a lot of people would happily trade the 3D board for 
such options, especially when it is easy for UI developers to code a new user 
interface. And what about a11y, by the way?

Remember the now discontinued iOS version of gnubg? It was a great success 
although it replaced the UI completely and lacked a lot of features compared to 
the desktop version. But it had made gnubg available to zillions of iOS users. 
The author seemed to be unable to maintain the project so that now there are 
tons of other apps that look fancy but play lousy backgammon. And that 
situation could really be improved, also for Android, as the strength of the 
gnubg project is imho on the AI side, not on the UI side.

Cheers,
Guido
— 
Cantanea EOOD - We are hiring!
http://www.cantanea.com/careers/ • facebook.com/cantaneacom • 
twitter.com/cantaneacom

_______________________________________________
Bug-gnubg mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-gnubg

Reply via email to