ejona86 / quarry

A multi-purpose GUI for Go, Amazons, and Othello (backup of https://gitorious.org/quarry/quarry/)
GNU General Public License v2.0
0 stars 3 forks source link

GTP needs more documentation #1

Open jmspaggi opened 5 years ago

jmspaggi commented 5 years ago

I know this project is unfortunately probably dead but I build a Othello/Reversi player and I would like to plug it into Quarry. Therefore I need to implement GTP but have no idea how it works. Might be good the have that documented in the project.

ejona86 commented 5 years ago

This is more of a mirror of what once was. http://home.gna.org/quarry/ was the original development location, and it died with 0.2.0 in 2006. It was then thankfully revived at https://gitorious.org/quarry/quarry in 2011 with 0.3.0, but then died again. I did look at what it would take to update to GTK 3, and there was a considerable amount of effort, so to date I haven't modified the repo at all.

I didn't know whether Quarry supports GTP version 1 or version 2. Taking a quick glance at gtp-client.c it appears it supports both. It appears version 2 is documented at http://www.lysator.liu.se/~gunnar/gtp/

jmspaggi commented 5 years ago

Thanks for replying. I tried to implement this protocol but I'm stuck in the "list_commands" reply. Quarry never stop waiting for the end of my list of commands and I don't know why. Also, I tried to build the last version (to add logs) and it fails on "undefined reference to `association_list_find_association'" (Maybe should be on another issue report) The build application (Debian package) works pretty well the way it is. Any idea what's wrong with the list_commands? It expects a list, but Nowhere I found how to end the "end of list"...

jmspaggi commented 5 years ago

The protocol says this:

Multiline list An x& is an LF separated list of entities of type x, where x may be any of the entities specified so far. The multiline list can have an arbitrary number of lines and goes on until two consecutive LFs are encountered.

But The double-LF ending doesn't terminate the "list_commands" call. I tried double-CR, and many others, without any success yet.

jmspaggi commented 5 years ago

Ok. I think I got it working. Might be nice to have better logs (option?)

ejona86 commented 5 years ago

I don't see any special logic for list_commands. It seems it just does send_command() and processes the results after the command completes. Reading the results seems to be done in gtp_client_grab_response.

I just re-built the package for Archlinux and it worked fine. I remember a different error (complaining about "inline"), but it appears it may be the same that is resolved by inline.patch.

jmspaggi commented 5 years ago

This patch definitely does the job! I tried to build on Debian without it and failed. It works with it. Might be nice to have it integrated on the branch. Thanks a lot for sharing the link.