diff --git a/concept/00-Implementation.md b/concept/00-Implementation.md new file mode 100644 index 0000000..0d3e6b8 --- /dev/null +++ b/concept/00-Implementation.md @@ -0,0 +1,24 @@ +# Implementation + +This document goes into detail about the implementation of the game and the tech-stack used. + +## Tech-Stack + +* Vue for the frontend (except for the tilemap) +* Go for the backend +* gorilla/websocket for real time connections +* Postgres + +## Architecture and Networking + +Ecosim uses a simple client-server architecture where the client runs in the browser and is connected to the server using a web socket. The client only connects to running games using a web socket. A REST API is used for everything else, like the registration, login, setting up a game, and so on. + +Should a player join a running game, for example after losing the connection, the game will be paused until the client has catched up to the current state of the game. The state is simply represented by the current ingame date and time (timestamp). + +Games are started by a player and automatically closed and saved when the last player leaves. It's possible to configure this behavior. When a new game is created the player can decide whether he would like to wait for all players to be present, pause the game when someone loses the connection, or make it open so that player can hot join and leave whenever they want. Games can be protected by passwords and are browsed on a global list. + +The server and client communicate through a simple TCP (web socket) and JSON protocol. The client receives updates to the game state and sents commands that are validated on the server. This will prevent anyone from cheating. The state updates contain the current ingame date and time (timestamp), that can be used to validate that no state updates are missing. While the game is running a new state will only be produced once a tick has been calculated. The game speed can be configured when creating a game. The default will be set to one ingame hour = one second, so 24 seconds represent a ingame single day. + +### Authentication + +For authentication oAuth with a refresh token will be used. Clients need to authenticate themselves when connecting to a game. diff --git a/concept/01-Overview.md b/concept/01-Overview.md index cc426cc..9335da5 100644 --- a/concept/01-Overview.md +++ b/concept/01-Overview.md @@ -2,6 +2,8 @@ Ecosim is a browser-based multiplayer game about running one or multiple successful companies on a tile-based map in real time. +> Everything related to the implementation and technology of the game is described in a [different article](00-Implementation.md). + ## Goal of the game Players take on the roles of investors. After creating a profile, they can start building production companies, invest in existing companies from other players, or trade resources to become richer.