fuego-on-ios
fuego-on-ios copied to clipboard
help integrating
Hey Herzbube! I am working on a 3D game of Go for ο£Ώ Vision Pro, and I'm looking into integrating Go AI. I'm trying to use this library for that purpose!
I'm experienced in Swift coding, but still new when it comes to integrating C++ libraries via headers etc.
Is there any way we can connect on Discord so I could reach out if I get stuck? : ) My Discord username is mesqueeb.
PS, one issue I'm having:
git submodule update
gives
Cloning into '/Users/empidornis/ghq/github.com/herzbube/fuego-on-ios/boost/modular-boost'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:boostorg/boost.git' into submodule path '/Users/empidornis/ghq/github.com/herzbube/fuego-on-ios/boost/modular-boost' failed
Failed to clone 'boost/modular-boost'. Retry scheduled
Cloning into '/Users/empidornis/ghq/github.com/herzbube/fuego-on-ios/boost/modular-boost'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:boostorg/boost.git' into submodule path '/Users/empidornis/ghq/github.com/herzbube/fuego-on-ios/boost/modular-boost' failed
Failed to clone 'boost/modular-boost' a second time, aborting
I'm also wondering about the syntax I can use to send the board state and get a move from the AI (especially if I wanna do this in Swift : D). But this is something I plan to try and find the relevant examples from your implementation on https://github.com/herzbube/littlego. Could you point me into the right direction? πΌπ»
Apologies for not answering any sooner, the email GitHub sent me for this issue was filed in an unexpected place, so I saw it only just now.
Is there any way we can connect on Discord so I could reach out if I get stuck? : ) My Discord username is mesqueeb.
I sent you a friend request.
I'm experienced in Swift coding, but still new when it comes to integrating C++ libraries via headers etc.
And I have no experience at all with Swift, I'm still an old-school Objective-C, so I won't be much help here.
I am working on a 3D game of Go for ο£Ώ Vision Pro, and I'm looking into integrating Go AI. I'm trying to use this library for that purpose!
In case you didn't check up on Fuego, let me say that Fuego is not an AI. It's just a plain old C++ library that implements the Monte Carlo tree search algorithm. So if you want to use a shiny new AI library then I suggest going for something like KataGo.
PS, one issue I'm having: git submodule update gives [email protected]: Permission denied (publickey).
Looks like you are trying to clone via SSH. For that you need to configure your GitHub account with an SSH public key, under Settings > SSH and GPG keys (https://github.com/settings/keys).
I'm also wondering about the syntax I can use to send the board state and get a move from the AI (especially if I wanna do this in Swift : D). But this is something I plan to try and find the relevant examples from your implementation on https://github.com/herzbube/littlego. Could you point me into the right direction? πΌπ»
I'm using the GTP protocol for communicating with Fuego. You can find some research I did on that in the Little Go repo in the file doc/Research (look for the headings "GTP - Go Text Protocol" and "Fuego"). The way how the communication is implemented is described in doc/NOTES.Architecture, and the implementation itself you can find in the folder src/gtp.
- send the board state - this sounds like you want to have a look at
SyncGTPEngineCommand - get a move from the AI - I guess the command you are looking for is
ComputerPlayMoveCommand.
Dear @herzbube
Thank you for your help so far.
I was able to set up SSH, and continued to set up Littlego.
I have reached a new error and am not able to figure out how to continue π
During 3rd party setup: https://github.com/herzbube/littlego/blob/develop/doc/NOTES.Build.3rdparty
executing ./script/build-3rdparty-software.sh
I get error:
Begin libsgfc++ simulator build ...
CMake Warning:
Ignoring extra path from command line:
"/Users/empidornis/ghq/github.com/herzbube/littlego/./script/../3rdparty/src/SgfcKit/libsgfcplusplus"
CMake Error: The source directory "/Users/empidornis/ghq/github.com/herzbube/littlego/3rdparty/src/SgfcKit/libsgfcplusplus" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Do you have any ideas to nudge me into the right direction? Thank you very much!
What is the content of the folder
/Users/empidornis/ghq/github.com/herzbube/littlego/3rdparty/src/SgfcKit/libsgfcplusplus
?
Among other things it should contain the file CMakeLists.txt. The error message you pasted indicates that this file is mssing. The only way that I can think of how this file could be missing is if you forgot to initialize the Git submodules of the Little Go repository, or if the initialization failed for some reason. This is the command to initialize Git submodules (must be executed while the current working directory is the root folder of the Little Go repo):
git submodule update --init --recursive
Did you perform this command? And if you did, was there any output that might indicate the command failed for some reason?
@herzbube thank you for your reply.
I did git submodule update --init --recursive it showed nothing in my terminal.
After trying to reason about it and trying out multiple things, it seems there were staged changes in my git for some reason, unstaging and reverting everything, and now finally git submodule update --init --recursive actually worked!
I have now successfully launched it on the simulator! :tada:
There's 2 questions I now have:
- I now also realise that the branch it chose after the local clone was the
developbranch. Is this the one we should use to try and build and run littlego locally? - I saw that 3 months ago, Fuego on iOS was updated to support Apple Silicon architectures. Is there a littlego branch I can switch to that already uses this latest Fuego on iOS compatible with Apple Silicon? If so, could you share which branch? Since it ran on mine, I think perhaps
developbranch has the apple silicon updates already ;)
personally my quest continues to try and figure out which code LittleGo uses to start the AI engine and send & receive moves.
I have now successfully launched it on the simulator! π
Congratulations!
I now also realise that the branch it chose after the local clone was the develop branch. Is this the one we should use to try and build and run littlego locally?
As is usual in many projects, develop is the development HEAD, which means that there may be times at which not everything works 100% of the time. If you want to have a stable environment, then you should use the master branch.
That being said, the master branch can become quite out-of-date because there are sometimes years between releases of Little Go. If in the time since the last release Apple has made important changes in their development environment you may be unable to run or even build the master branch. With the introduction of Silicon Macs right now this is such a time.
So in general it is probably best to start with the develop branch, and only if you can't get it to work and I am unresponsive to queries you can try to go back to master.
I saw that 3 months ago, Fuego on iOS was updated to support Apple Silicon architectures. Is there a littlego branch I can switch to that already uses this latest Fuego on iOS compatible with Apple Silicon? If so, could you share which branch? Since it ran on mine, I think perhaps develop branch has the apple silicon updates already ;)
You are right, the develop branch is the correct branch to use. If you had tried master it would most probably not have worked.
At the moment develop is also somewhat safe to use because I'm getting very close to a new release, so there should not be any destabilizing things going on anymore for the next few weeks.
personally my quest continues to try and figure out which code LittleGo uses to start the AI engine and send & receive moves.
The NOTES.Architecture file has some notes which may or may not be helpful. That being said, the AI is started in GtpEngine.mm in the method mainLoop. The following line works similarly as if you would call Fuego on the command line:
FuegoMainUtil::FuegoMain(argc, argv, &inputStream, &outputStream);
Once the engine is running, Little Go sends GTP commands to the engine and receives the responses via the GtpClient class.
- You can set a breakpoint in
GtpClient.mmin the methodprocessCommandto find out how things work during runtime. - You can search the source code for
GtpCommand.hto find places where GTP commands are submitted. - Within the Little Go app that is running in the simulator you can go to the Diagnostics tab and select the "GTP log" item - here you see all the GTP commands that are being sent to Fuego and their responses.
Hope this helps.
Thank you once again for all the information.
Was able to successfully create a text input that talks to Fuego!