Skip to content

A simple Peer to Peer (P2P) distributed multiplayer game system (2D), that allows the players to connect with other players and explore an open grid world and collect rewards.

License

Notifications You must be signed in to change notification settings

harinda05/Strategiafi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strategiafi

A simple Peer to Peer (P2P) distributed multiplayer game system (2D), that allows the players to connect with other players and explore an open grid world and collect rewards.

About The Project

Product Name Screen Shot

Players have the flexibility to join and leave the system at their discretion, engaging in gameplay until they choose to exit the system. In this game, the strategy revolves around gathering reward points in a distributed game map. The ultimate goal is for the player to amass the highest score to secure victory.

(back to top)

Built With

  • java

(back to top)

Installation

  1. Clone the repo

    git clone https://github.com/harinda05/Strategiafi.git
  2. Install Maven packages

    mvn clean install

(back to top)

Getting Started

Bootstrap Server: Required to join the game network at the very first step. The newly joined server would receive connection addresses and ports, which then can be used to communicate directly with.

  • java -cp dist-sys.jar org.uoh.distributed.server.BootstrapServer

Peer Node: Actual local game node. Supports multiplayer gaming. All the players should be in the same network. *

java -cp dist-sys.jar org.uoh.distributed.game.GameWindow

Distributed Features

Shared distributed state:

In this game there are few entities managed globally across all nodes. The global map, their resources/coins and their availability on the map, scores of each player will be handled by each node but it will be globally distributed across all nodes. The global state is updated when new nodes join, player movements, and resource/coin consumption.

Synchronization & Consistency:

The state is synchronized with each player when they move or pick a coin. Player movements are synchronized across the global map by utilizing multicast messaging between the nodes.

Consensus

_Gameplay Scenario: It is a gameplay assumption that the coins in the player’s map can only be collected once by a single player interacting with the game. Once a coin has been collected it will disappear from the distributed map, and the player who collected the coin will have its score increased, by the value assigned to that coin.

Since the map is a distributed state maintained across the network and synchronized among all the player nodes, there can be situations where two players compete for the same coin and try to collect it at the same time. In that case, the network should reach a consensus on which player is allowed to collect the coin, and thus avoid a double spending scenario.

To facilitate this, a distributed voting mechanism based on a simplified version of Paxos algorithm was introduced and implemented in the system. We couldn’t find a compatible Paxos Java library for this and opted to write our own Paxos implementation from scratch.

License

Distributed under the Apache License 2.0. See LICENSE.txt for more information.

(back to top)

Acknowledgments

This was developed as part of a project assignment for the course Distributed Systems, Master's in Computer Science at the University of Helsinki, Finland. Focus was on demonstrating distributed aspects of systems rather than on solid game logics.

(back to top)

Contributors

About

A simple Peer to Peer (P2P) distributed multiplayer game system (2D), that allows the players to connect with other players and explore an open grid world and collect rewards.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages