Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play versus computer #1310

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

Play versus computer #1310

wants to merge 16 commits into from

Conversation

Boubou78000
Copy link

@Boubou78000 Boubou78000 commented Dec 25, 2024

Play versus Stockfish level 1-8.
I started the layout and I am working on making it functional. I am waiting for reviews
It's my first time contributing to the repo (and working with Dart and Flutter), so it may not be very good 😅

@Boubou78000 Boubou78000 marked this pull request as draft December 26, 2024 08:22
@HaonRekcef
Copy link
Contributor

Cool that you're starting to work on the app! :)

In the future, I imagine we’d want the 'Play Against Computer' feature to use the offline engine. That said, I think playing against the traditional Lichess Stockfish with levels 1-8 still has its place.

Maybe it could be better placed at the top of the 'Online Bots' screen? Challenging it could probably reuse much of the logic from the create_challenge_screen.

@veloce
Copy link
Contributor

veloce commented Dec 26, 2024

I also like the idea of having Stockfish at the top of the online bots list. Then you reuse the challenge screen and add the level here.

@Boubou78000
Copy link
Author

I also like the idea of having Stockfish at the top of the online bots list. Then you reuse the challenge screen and add the level here.

I've done the layout:
ScreenRecording4.webm

What should I add at the top of the online bots screen? Maybe a "play with the computer" button with padding?

@veloce
Copy link
Contributor

veloce commented Dec 27, 2024

What should I add at the top of the online bots screen? Maybe a "play with the computer" button with padding?

no you should add "Stockfish " as if stockfish was a bot.

@Boubou78000
Copy link
Author

Is it possible to get the full id of the created game without using /api/event/stream (which returns 403 unauthorized) ?

I looked a bit and it seems that a challenge doesn’t need this because the full id is sent via socket (idem for the lobby) .

Should I:

  • try to use /api/event/stream (maybe changing the OAuth part)
  • or am I wrong, and the full id can be received by socket or another API endpoint ?

@tom-anders
Copy link
Collaborator

You'll probably need a change similar to lichess-org/lila#16023 to get the API endpoint working

@Boubou78000
Copy link
Author

Boubou78000 commented Jan 18, 2025

You'll probably need a change similar to lichess-org/lila#16023 to get the API endpoint working

Thanks!

I created an issue on lila.

@veloce
Copy link
Contributor

veloce commented Jan 20, 2025

@Boubou78000 don't use the event stream but the socket API.

Look at create_game_service.dart also to see how it works for challenges.

@Boubou78000
Copy link
Author

Boubou78000 commented Jan 23, 2025

Good news:

This lila commit will make the /api/challenge/ai return the full id of the game.
Also I installed an Android Studio preview version that is working well.

@Boubou78000
Copy link
Author

Boubou78000 commented Feb 10, 2025

Hi,
Sorry for the PR's delay but the lichess.dev server became unreachable, so I had to wait some time.

I made the play with the computer screen functional and I adapted the code with the new changes.

Here is a linked screen recording:
ScreenRecording.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants