Can I use API to create and play custom games

Finally I understood that as well :slight_smile:

And … if benjito is excited, then you are in luck, because he’s one of the best people you can get help from!

4 Likes

If it’s just a board representation you want, you may not need an API, and could write the board rules yourself for a fully offline game. I’ve done it before using ideas from this page: Implementing the Game of Go (Part 1)

I have a basic implementation with some unit tests in the Go programming language, if you’re interested.

1 Like

I think it’s not just board representation, but rather “play-on-the-physical-board and automatically-view-from-anywhere” that is key to the proposal.

1 Like

I’d personally consider storing the turns locally and synchronising them at a later point, but I don’t know how important the real time aspect is. A digitized physical board sounds cool though - I haven’t seen it done before.

Another interesting approach is using an actual physical board and using photo recognition to convert it into a digitized board state, but it wouldn’t really give you the turn history unless you did this conversion every turn. Kifu-Snap: automatic go-board image recognition

I’d be curious why?

If the purpose is to play offline but keep the board’s history for later, you wouldn’t be internet-dependent and could take your solution of choice anywhere. It would also widen the range of hardware you could run it on - it’s a lot easier to store a bunch of coordinates than it is to communicate them through an API.

Since OP mentions an Arduino, due to the amount of possible positions on the board you could store as much as 3 moves per 2 bytes of storage, enough for a game or two if you have EEPROM of any kind available.

Ah right - I thought the whole purpose was to share the spectating of the game… I guess it just depends what the goal is :slight_smile:

1 Like

I don’t follow… 3613 >>> 2562

1 Like

Oops, that should have been 2 moves per 3 bytes.

1 Like

I couldn’t reply earlier because I reached max allowed number of reply on the first day of creating the account XD

Having that offline capability would be a very interesting addition to the project. I didn’t know there are that kind of libraries available in the wild. I shrink the project down a bit because of my lack of Arduino and hardware knowledge XD right now the board’s job is to send coordinate string to a connected computer and the computer will take care of the rest, whether that be communicating with OGS server to do whatever it can or completing the game entirely offline with go libraries.

2 Likes

Sorry about that, generally Discourse does a good job of helping us maintain the community, but on occasion it gets in the way :smiley: I have bumped your account priviledges a bit so hopefully it won’t be a problem anymore. Nevertheless I did not reply further as you are getting more professional help than I could ever provide, but the project sounds very interesting, hope to hear more :slight_smile:

3 Likes

Do you need to code the go engine algorithm yourself if all you need is to convert sequences of move coordinates into sgf files? I think having the offline capability is great but not sure how straightforward it can be.

1 Like

You don’t really need a go engine to generate an SGF, but you might want to have some way to prevent illegal moves (ko, suicide, occupied intersections) from getting recorded, for which you’d need a go engine.

1 Like

That makes sense. Thanks for the info! There should be a lot of sgf writer tools out there. I’m currently exploring sgfmill python library. Hopefully this tool does what I need.

Hi I have yet another question for this project. At the moment, whoever wants to use the program has to create a new Oauth application to get the client ID. Is it possible that users don’t need to do that and simply provide their username and password? What are some of the negative consequences if I let people use the client ID I created? Is that even possible? Like are client ID bound to a username password credentials?

No, definitely not. You can use any user/password with the same Client ID.

It seems like this is low risk, but I’m not an expert and could be wrong.

From the oauth2 docs:

The client identifier is not a
secret; it is exposed to the resource owner and MUST NOT be used
alone for client authentication.

From the OAuth website:

The client_id is a public identifier for apps. Even though it’s public, it’s best that it isn’t guessable by third parties, so many implementations use something like a 32-character hex string. If the client ID is guessable, it makes it slightly easier to craft phishing attacks against arbitrary applications. It must also be unique across all clients that the authorization server handles.

Hmm I don’t quite understand why it shouldn’t be guessable if it can be public. If people can know what the client ID is then I guess I can hardcode it in the program. If not, people probably need to generate their own and store the value in the .env file.

1 Like

Hi folks I want to share the progress of this project because I’ve received so much help from this community and I’d like you to know without your helps the project cannot advance so fast

I am in the process of pushing the Arduino codes to my GitHub repo for those of you who want to have a look at the source code

This is just a prototype. It allows playing go in the upper left corner of a demo board, inside a tiny 4 by 4 area because I only have a 4 by 4 keypad. Someone from the Arduino forum helped me tweak the Arduino library to support 19 by 19 “keypad” so that’s what I will work on next.

This is the GitHub repo: GitHub - zoodiabloc/electronic-go-board

Here is the share link of the demo video: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

4 Likes

Wow this is amazing progess, thanks for sharing!

1 Like

The key in the explanation is ‘arbitrary applications’ - say if a security issue came to light where a website accepted any token, and the client ID was only 5 numbers, you could try every possible client combination in a few seconds at best, even if you don’t know what applications are using them. With long client IDs, it would take a really long time to hit multiple applications by just exhausting the possibilities.

You can kind of compare it to a user ID for applications.

It isn’t really a secret at all - try logging into any application with your Google account and its client ID will be right in your URL bar.

2 Likes