Giter Club home page Giter Club logo

card-captor's Introduction

Check it

Hey I'm Jake, aka "Ragnyll". I'm a software engineer who loves working with Rust and making Linux desktop and shell tools. My language of choice is Rust. I'm also a bboy representing Arch Enemies Crew since 2017.

Check Out:

Check the Stats

Top Langs Anurag's GitHub stats

card-captor's People

Contributors

ragnyll avatar

Watchers

 avatar

card-captor's Issues

What is a card game?

I think as a mental exercies it's important to explain what a card game really is in order to scope what needs to be done for this framework.

Create test TCP Client

In order to test the server we need a bot player that will communicate with the NGS application. It needs

  • to perform the handshake with the server
  • send delta object
  • resolve deltas with its own internal game state
  • fall back to server game state if it cant resolve the delta

The below set up is gonna sound like it's a lot of work and it, especially to someone who does not yet know rust. However, I think we can bypass that with some clever sub issues, but this is a brain dump on everything this bot-rs project will need

  • create a handshake request with the following attributes.
#[derive(Serialize)]
struct JoinRequest {
    /// The clients username
    username: String, // could proably use &str to be super mem efficient, but for this POC its not woth it yet
    /// The name of the opponent to request to play against. A Value of None indicates that a random opponent may be accepted
    opponent_requested: Option<String>
}
  • The server will respond with a waiting when the join request is proccessed
{ "queue_status" : "WAITING", "opponent" : null }
  • then an accept when the opponent requsted is ready to play
{ "queue_status" : "ACCEPTED", "opponent": "opponent_name", "player_number": u8 }
  • The game will then begin with an initial state supplied by the server. This initial state will be a collection of entities received by the server as a "FAT" delta.
{
    entities: [
        entity { },
        ...
    ]
}
  • When the turn entity matches the player number the player may play, otherwise delta requests received by the server during this time will be denied.

  • A single entity can be updated in a given delta request sent at the server. Once the server accepts the delta request more can be be made.

a delta request will be responded to by the server with one of the following response:

enum ServerResponse {
    /// entity will effectively be a revert to be enacted by the client
    DENIED { entity: Entity },
    /// any valid delta request will be responded to by the server with a list of entities to be updated on the client side
    UPDATE { entities: Vec<Entity> },
    ///  I'm not exactly sure how this would work yet, but it would be when your action creates a prompt for a response from your opponent
    WAITING { }
}

when the game is complete the outcome entity will be updated with the winner. when this entity is set the clients should not send or receive any more deltas from the server.

  • create a game delta request struct that can be serialized and sent to ngs using TCP. The NGS server will respond with an echo if it has been accepted by the server's validator engine (yet to be created) and can be applied to to the Local Game State. if it does not the delta request will be discarded, and the localgamestate should be refreshed against the the server's game state

Questions we need to figure out:

  • What if the local game state diverges from the game state maintained by the server? How do we know when said divergence occurs?
  • Do we need to design out entity specifics now? I imagine certain parts need to be planned out now.
  • Under what rules could a delta request be denied?

Component Level Diagrams

Draw Diagrams for each submodule of the card captor framework and a high level diagram that shows the interaction between all components

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.