Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

22
ALBION ONLINE: A CROSS-PLATFORM MMO David Salz CTO / Co-Founder [email protected]

Transcript of Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

Page 1: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

ALBION ONLINE: A CROSS-PLATFORM MMO

David Salz

CTO / Co-Founder [email protected]

Page 2: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Page 3: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

What is Albion Online?

Albion Online is a modern

interpretation of EVE Online with

the skill based combat from

League of Legends

ABOUT ALBION ONLINE

Page 4: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• Sandbox MMORPG

• Cross-Platform (Windows/OSX/Linux/Android/iOS)

• One World (no „Shards“ or „Servers“, not even for different platforms)

• 4 years in the making

• Currently in Closed Beta w/ 100.000+ „founding“ players

• „Release“ in Q4/2016

ABOUT ALBION ONLINE

Page 5: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• Engine Selection: Unity

• powerful, accessible

• Cross-Platform was a „target of opportunity“

• Database Selection: Cassandra, Postgres

• One world need a very scalable database, NoSQL

• still use SQL for query-heavy problems

• Networking Middleware: Photon

• UDP (reliable/unreliable), TCP

• can use C# on server (like in Unity!)

• works with all Unity platforms

MIDDLEWARE SELECTION

Page 6: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• NoSQL Database

• Originally developed by Facebook

• Open Source (Apache-License)

• written in Java

• Concept: everything is a hash table

• in-memory (as much as possible)

• optimized for high throughput

• scales horizontally (just add servers)

• redundant (no single point of failure)

• CQL: SQL-like language (w/ massive restrictions – it‘s NoSQL)

CASSANDRA

Page 7: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• Server needs to work without Unity

• Ideally, client works without Unity, too!

• think: tools, stress-test-bots!

• Use Unity only as rendering front-end

• cannot rely on Unity features for basic functions!

• levels / game objects

• collision

• pathfinding

CONSEQUENCES

Page 8: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

ObjectFactory ObjectViewFactory

Object

+Position

+…

+RequestAction()

ObjectView

+Renderer

+AnimationCtrl

+HandleInput()

destroyed

changed

…etc..

created

Object

+Position

+…

+RequestAction()

Server Client Unity-Client

Interest-Management

changed

…etc..

obj-enter

obj-leave

manage create create

SEPARATION

Page 9: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

Game Server

Game Server

Game Server

Login Server

World Server

Marketplace Server

GoldMarket Server

Statistics Server

Ranking Server

BackOffice Server

Chat Server

Client

Connect to different game

server depending on

location in game world

Game DB

(Cassandra)

Accounts DB

(Postgres)

Market DB

(Postgres)

GoldMarket DB

(Postgres)

SERVER FARM

Page 10: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• game world split into unique „clusters“ of ~ 1 km²

• current world: ~600, next world: x2

• distributed among game servers

• player changes servers when travelling

• handoff done through database (even on same server)

• World Server

• responsible for everything „global“

• guilds, parties, coordination of guild battles etc.

SERVER FARM

Page 11: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Page 12: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

IO Thread IO Thread Network IO

Thread

Event

Queue

Logging IO

Thread

Event

Scheduler Cluster Thread

Event

Queue

Event

Scheduler Cluster Thread

Pathfinding

Thread

Database IO

Thread

Cluster Thread makes request

Events / Results get

put into Event Queue

Cluster polls Events from Queue and Scheduler

GAME SERVER – THREADING MODEL

Page 13: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• Players should only „see“ (network-

wise) what‘s on their screen

• important to reduce traffic…

• … and prevent cheating!

• Needs to be efficient!

• ~500 mobs / cluster

• > 10.000 game objects (e.g. trees)

• up to 300 players

player

GAME SERVER – INTEREST MANAGEMENT

Page 14: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

grid based hash (10x10m cells)

● cells contain list of objects inside

● list is updated by object itself when moving

● cells fire events:

● ObjectEnteredCell()

● ObjectLeftCell() player

● objects also fire events

● ObjectMoved()

● ObjectDestroyed()

● EventFired()

GAME SERVER – INTEREST MANAGEMENT

Page 15: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

player

Interest area

Moves with player

Subscribe to objects when they

enter inner area

Unsubscribe when they leave

outer area

Tell player when:

● an object enters / leaves interest area

● an object in the area fires an event

GAME SERVER – INTEREST MANAGEMENT

Page 16: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

Level consists of

„tiles“ (Unity prefabs)

Tile has 3d collider

(for mouse picking +

ground height

definition)

2d collision is painted

per tile

(blocks movement /

blocks shots / blocks

placement etc.)

Ground tile

Object (non-ground) tile

LEVEL DESIGN

Page 17: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

Collision

• TODO: pictures, demo

Collision of all tiles

is blended together

COLLISION

Page 18: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• Character + Equipment

gets baked into one

mesh (= 1 draw call!)

• parts of character mesh

hidden depending on

equipment

• Only one material for

character + all equipment

items

• Limit number of

characters drawn (esp.

on mobile)

CHARACTER RENDERING

Page 19: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Page 20: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

• .NET code is very accessible for analysis

• camera hacks (minior problem because of interest management)

• found internal tools, cheats in code (not working on live)

• extracted data from client

• maps, player rankings… lead to cool community projects!

• Users built bots directly into client

• Difficult to prevent

• Obfuscation – helps, but not much

• We are doing more integrity checks now!

• Future: Unity IL2CPP ?

CHEATERS

Page 21: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Page 22: Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)

THE END

Thank you!

Questions / Comments?

[email protected]