QDiep.py

Introduction

  • Implements famous web game diep.io

  • Server: python

  • Client: Qt

Game Feature

  • Multiplayer

  • Realtime shooting game

  • Self host like minecraft

  • Upgrade system( passive tree )

  • Chatting and broadcast

  • Reborn system

  • Low hardware requirment

  • support multiple platform

Architecture-Server

  • Python 3.5, naitive coroutines

  • Use tornado library to handle requests asynchronously

  • Use Cython C extensions to do physics computing

Architecture-Client

  • QJsonObject(Qt5.0~)

  • QWebSocket(Qt5.0~)

  • qUncompress

  • QGraphicsView

  • QGraphicsScene

  • QGraphicsObject

  • QPainter

Physics Engine

  • 30 ticks per sec

  • Decide pos by velocity

  • Decide velocity by Acceleration

  • Decide Acceleration by collision or user control

Serialize evolution

  • Use json to send game information

  • lots of info and frequently send recv, needs lots of bandwidth

Benchmark

Demo

diep.io

By zlsh80826

diep.io

  • 531