Code Monkey home page Code Monkey logo

unity_mmo_demo's Introduction

Unity MMO Demo

This project is a client authoritative event based multiplayer implementation. The idea is to keep the server load as light as possible and divide the load across multiple servers. Instead of having one big server doing all the work we have multiple servers as shown in this picture:

concept illustration

Client

The client is a unity package made with unity 2018.1 but should worlk with all the recent versions of Unity. It is inspired by Unet's implementation as we wanted to use it in the same way. Each server is a scene loaded as an additive scene. The idea is that the connection to the server is linked to the world and not the player.

For now we only provide spawning and moving player objects but this project could be extended for objects and other messages, the next messages that would need to be added would be RPC's, SyncVar and NetworkedAnimators.

The result on a scaled down world with 4 clients is shown on the next screenshot:

concept illustration

Setup

Just clone the repo and open the Client folder with Unity

Server

The current Server architechture is a simple 2 servers side by side implementation with a lot of hardcoded values. The clients are only connected to one server at a time and if the player is on the border to the other server it's messages are sent by the server to the other server.

concept illustration

To this project in a live environment we would need to add some flexibility on the placement and number of servers. In order to do that we would need to make an hypervisor in charge of distributing id's and creating/stopping servers using a cloud API. This would allow us to optimise the server time and manage player id's and databases.

concept illustration

Setup

The Server is Unix only, it was made on Ubuntu so it should work on all debian distros but i'm nut sure about other os's (Windows go away).

Compile: make

Start server 1: ./Server 9501 9502

Start server 2: ./Server 9502 9501

technicly you could add server and change ports of the server but the border managment is hardcoded for server 9501 and 9502. This is due to the fact that this project was a short term school project.

concept illustration

Licence / Contribute

This is all free to fork/use with no licence do as you want. You can fork, improve and do pull requests as you want and give us a shoutout if you use this.

unity_mmo_demo's People

Contributors

saarg avatar y3lousso avatar gamenite avatar

Watchers

James Cloos avatar

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.