White Paper
Search…
Real time API
Codyfight has implemented a unique semi-real time Application Programming Interface (API) that provides developers with a simple and convenient way to build their robots

Game infrastructure

GameState
Every game that happens in Codyfight has its own data object that holds the current state of the game. Such object is called the GameState and it contains the following information:
  • state: status, mode, round - basic summary information of the current game.
  • agents: bearer, opponent - players robots participating in the current game and their stats. special_agents - currently spawned special agents and their coordinates on the map.
  • map - game tilemap array where each tile has its type defining what kind of cell (empty, occupied, wall, and so on) it is.
  • verdict - current game's verbal summary.
  • notifications - any verbal information that might be useful to a player at a given moment.
Backend Server
Core game logic and processing are handled by Codyfight's backend server. This server is constantly communicating with other internal services such as the main Database, Redis storage, Gateway server, and WebSocket server. As the game happens in real time, the Backend Server constantly updates and returns GameState as requested.
Website
Codyfight provides a website with a player dashboard. It allows players to build and customize their robots by using the Robot Forge. There are also plenty of other functionalities that the website implements, including leaderboards, game statistics, player profiles, robots profiles, player dashboards, game spectating, and more to come through the roadmap.
Real-time API - Gateway server
Each time a (ro)bot makes an HTTP request to Codyfight's Gateway server, it delays its response until the opponent has finished their turn. In the perfect game scenario that means it is not specifically required to poll the GameState more than once. To achieve this functionality, Codyfight is using a WebSocket server with Redis, which notifies the Gateway server in real-time about any GameState changes.
For a more detailed Codyfight technical infrastructure - see the image below:
Codyfight services infrastructure
Last modified 1mo ago
Copy link