Webcraft is a MMORPG made with JS and websocket through channels and using Django framework as back-end.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
chat
communication
conf
game
trisdanvalwen
user
.gitignore
LICENSE
README.md
install.sh
manage.py
requirements.txt
run.sh
test.py

README.md

Trisdanvalwen

Trisdanvalwen is a MMORPG made with Django framework, Channels (websocket) and Javascript for client rendering. It's a minecraft like game with cute pets, we made all models with Magicavoxel to save time, you can chat with everyone and build creative constructions by your own hands.

It's a school project made during last year of bachelor's computer science from "Université du Maine" in France for "Web architecture" class.

It's still in development so be free to signal any issues with demo on github.

screengit maison maison-int

How it works

Trisdanvalwen make use of Channels for real time part, websocket are used for chatting app and game app currently, we should update this projet to use WebRTC (UDP packets) as a layer for any packets sent or received by game (excepting chat).

Gunicorn is used as WSGI server because of its lower latency for http requests compared to daphne ASGI server Daphne is default ASGI server used by channels to handle any websocket request. Django-redis-cache is used as session backend cache and as application cache for sharing map informations through each worker and save recurrent changes on map's chunks.

Nginx is used as proxy-server to redirect requests on correct services and for serving static files furthermore it's enable gzip compression and cache for request.

And PostgreSQL is DBMS chosen for this project for low latency and high throughput.

Demo is running on a server using Docker containers for each service (nginx, postgresql, redis etc...).

Installation

This repo make uses of postgreSQL and redis-server so be sure to have them installed on your machine.

Once you have them installed use pip to install any requirements:

pip install -r requirements.txt

Before starting, set a new database for running this project then make necessary changes in trisdanvalwen/settings.py file.

Do migrations to create table structure with following command:

python manage.py migrate

Once you have set up your new installation, you can load some fixtures for testing purpose:

python manage.py loaddata user/fixtures/user_data.json

python manage.py loaddata user/fixtures/initial_data.json

python manage.py loaddata game/fixtures/initial_data.json

Running

Once you have all requirements you can run server executing:

$ ./run.sh

in root's project directory, it's a tiny shell script that run daphne, initialize runtime server and run workers using gunicorn.