Skip to content

About

A simple distributed game using Linux`s native sockets and OpenGL.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project

A distributed Small Game using OpenGL and Linux native Socket connections.

In this project was implemented software tests using CMake (CTest).

The Game

A simple triangle controller game. Each player will be a triangle running in a 500x500 screen. The player can move up, down to the left and right (🡑 🡓 🡐 🡒). The important thing here is the distributed part, where there's not going to have a main serve, every user will connect to each other and talk his place to everyone.

To achieve this Goal the programmer has two ways to implement it:

  1. Centralized Option:
    • One of the players will be a coordenator and each moviment will be sent to it. So the coordenator have to send every connect_to the changed position.
    • This opion includes having a voting algorithm (Bully or ring) in order to choose the next coordenator if one of them fails to respond.
    • This option will help when having a shared resource.
  2. Full distribuited option:
    • Won't have any coordenator, each change in places should be spread across every connect_to (see distributed algorithms).
    • The places should be acted as a resource, so it can be the same across the clients.
    • Will be slower, but won't need the voting algorithm.

For both the implementations will be needed a "start" point. Which means a connecting point to enter to that distribuited group.

The implementation

Each player will have a serve code and a connect_to code, so it can reach out to other players and communicate it's position.

Will be needed a main serve to act as a "DNS" serve, so this brings a questions, since it's necessary a DNS serve, why don't use a centralized option?

  • The method will be a Fully distributed game. Each service will know the port of the other services.
  • Later on will be implemented a voting system and remove the necessity of the prev knowledge of all the services.

Main Modules:

  1. Player
    • The player itself
  2. Game
    • The game implementation
  3. Client:
    • Involving how the communication will work, centralized or not.
    • Clients will warn other services it's existence.
  4. Server
    • Involving how the communication will work, centralized or not.
    • For now the services will use the serve and receive the players update as a protocol.

TODO:

  • What about create a docker with it?

About

A simple distributed game using Linux`s native sockets and OpenGL.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages