GithubHelp home page GithubHelp logo

kittui-racer's Introduction

A terminal type racer

Play typeracer with your friends at the comfort of your terminal.

Server Architecture

Screenshot 2023-06-30 at 10 18 47 PM

The process

  • Client/Player opens the terminal application.
  • Websocket connection in established.
    • Server sends SuccessfulConnection message with the user_name that was assigned
  • Server sends an UserStatus message with the details of players who are currently online and their statuses ( if available or already in game).
  • The Player can choose any of the online players who are available and challenge for a game by sending a Challenge message. Currently only one vs one is supported.
  • The opponent can acccept the challenge by sending AcceptChallenge, if so, the game starts.

Starting of the game

  • Both parties are ready for the game.
  • Server picks a random quote ( either from an api or from its database ), this quote is sent to both the users, with the countdown timer. Ready(Text, start_time). It also spawns a task to handle the game after the countdown.
  • After x time ( game start time ), server sends GameStart message.

Communication when the game starts

  • Each user will share his progress.
  • The other user ( currently only one ), will get realtime update of the opponent.
  • The game ends when any one of the user completes typing the whole message.

kittui-racer's People

Contributors

narayanbhat166 avatar pixincreate avatar

Watchers

 avatar

kittui-racer's Issues

[FEATURE] add data persistence

In order to make the application blazingly fast, all the game data is currently stored in a kv store ( a simple hashmap ) in the application. If the pod goes down, it takes down the data with it. In order to avoid this, the data has to be persisted in a key value storage such as redis, with data persistence. A two level caching interface can be introduced, which will have hot data ( current game ) data cached in the application, and rest of the data in redis. The data in redis must be constantly updated.

[FEATURE] reduce the progress update interval during game

During the game, the progress is updated on every keystroke. This should be avoided, instead the progress should be updated whenever the progress increases by 5%. For the last 10% of progress update, the update to server should happen on every key stroke, this is in order have greater accuracy in determining the winner.

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.