Giter VIP home page Giter VIP logo

chessai.cs's People

Contributors

bonifatius94 avatar marcotroester avatar

Stargazers

 avatar  avatar

Watchers

 avatar

chessai.cs's Issues

Design HTTP REST Interface Requests

Define the RESTful Web API interface for the chess gameserver:

  • request for available endpoints and data exchange formats
  • request for matchmaking (including desired enemy strength)
  • request for making a draw (returns the opponent's draw if possible, may time out though)
  • request for receiving the opponent's draw (fallback after a timeout was encountered)
  • request for receiving the game log

Implement Security Concept

Implement useful Security Mechanisms

Encryption:

  • implement SSL for standard payload encryption, e.g. using Letsencrypt certificates

Authentication:

  • make sure that noone else can make a draw for a given player by providing a player token for each game session

Optional Encryption:

  • add triple diffie-hellman protocol (3DH) for end-to-end encryption on session creation; this heavy encryption overhead is reasonable because message payloads are rather small; disadvantage: the gameserver cannot see the draws anymore

Implement Gameserver Logic

Implement Matchmaking

  • match by elo / difficulty

Implement Creation of Game Sessions / Submission of Draws

  • use existing logic from Chess.GameLib package
  • add a little implementation of IChessPlayer interface, e.g. RemoteChessPlayer; this may be very similar to UIChessPlayer from WPF Chess Client project

Implement Storage of Game Sessions

  • first, store game sessions as static list (RAM)
  • then add a little file database to facilitate the purpose (e.g. SQLite), so the game sessions can be reloaded on service recovery after a server failure

Implement Stats and Gamelog Creation

  • Game Log: use the Chess.DataTools package and extend it with a PGN format serializer (not just a deserializer)
  • Stats: think of other useful stats and return them in a useful format (optional), e.g. time elapsed for making each draw, average gain / loss of draws

Restore Last Chess Game on Next Startup

Actions:

  • log the game on application close event / always log the current game after a new draw is applied
  • restore the logged game on next startup event

Game Log Contents:

  • all draws of the game
  • total playing time of the game
  • time of last draw if it was a human draw, otherwise reset the draw time to 0 and compute the draw again (optional)

Create GitHub CI/CD Workflow

Tasks:

  • create a well-defined build environment (e.g. using docker)
  • add the usual CI/CD tasks (build + test + release/deploy)
  • do this for all submodules:
    • game server: use a template for creating a dockerized ASP.NET service, add some component testing (send HTTP requests)
    • game ui: use the existing WPF project, try to port it to other OS using MAUI, add some UI unit tests
    • core lib: use the existing core project, add a publishing automation (release *.dll artifacts on GitHub)
    • gameplay core: use the existing project, get all interfaces right, add unit tests, add publishing automation (like core lib)
    • chess ai: add benchmark tests to measure training quality

Implement Business Logic for User Interaction

Menu Bar:

  • "New Game": start a new game, ask user when aborting a running game. Also set the difficulty level of the AI (optional at first).
  • "Exit": shut down the application

Main View:

  • "Choose Drawing Piece": Click the piece to be drawn, all possible draws are shown by highlighting the new positions, change the piece if another allied piece is clicked
  • "Confirm Draw": After choosing the drawing chess piece, the user clicks onto a possible target position. Then the draw will be applied to the board and the AI starts computing a good answer draw which gets automatically applied. In the meantime the user must not put any actions except aborting the game, reverting his last draw or starting a new game. (The screen may not freeze!!!)
  • "Revert Draw": An additional button that reverts the last draw of the AI and the player's draw. In case the AI already made a draw the draw just gets reverted. Otherwise the best draws computation for the old situation needs to be aborted.

Status Bar:

  • Show total game time
  • Show draw time
  • Show copyright / licence info

Restructure Project

Tasks:

  • split this project up into multiple projects glued together as git submodules
    • core package: basic draw-gen and game state logic
    • shared gameplay logic: chess agents and game environment (plus interfaces for extensibility)
    • game server: RESTful Web API for playing chess via network (AI vs. AI / human vs. AI / human vs. human)
    • game ui: desktop app for playing chess vs. an AI (offline)
    • chess AI: provide training / inference tasks for playing chess

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.