kinh nghiệm phát triển captain strike

20
Captain Strike Release Date: 9-4-2014 Platform: IOS, Android Total Download: 2M+ Peak DAU: 30k Peak CCU: 3k

Upload: gamelandvn

Post on 17-Jul-2015

36 views

Category:

Entertainment & Humor


0 download

TRANSCRIPT

Page 1: Kinh nghiệm phát triển Captain Strike

Captain Strike

Release Date: 9-4-2014Platform: IOS, AndroidTotal Download: 2M+Peak DAU: 30kPeak CCU: 3k

Page 2: Kinh nghiệm phát triển Captain Strike

Game Loop

• Action Phrases • Activities

- Buy and Upgrade items

- Lottery

- Quest, Event, Achievement

- Leaderboard competition

- …….

Page 3: Kinh nghiệm phát triển Captain Strike

Part 1

Backend Architecture

Page 4: Kinh nghiệm phát triển Captain Strike

Backend Architecture

Database

Cache

API ServicesRoom

Controller

Room

Room

Room

Room

Server1 Server2

Page 5: Kinh nghiệm phát triển Captain Strike

Databases

• MongoDB- NoSQL with dynamic query

- Good performance on big data

- Predefine index on Schemaless data

• Redis- Blazing fast

- Store rapidly changing data and caching recently query

Page 6: Kinh nghiệm phát triển Captain Strike

API Services

• HTTPS - The security capabilities of SSL/TLS to standard HTTP communications

- Easy to develop and deploy

• Python- Widely used general-purpose, high-level programming language

- Multi Platform

- A huge number of frameworks and modules

Page 7: Kinh nghiệm phát triển Captain Strike

Game Room

• Standalone Application - Standalone process under managed of Room Controller

• Forwarder- Synchronize player game ‘s world with others

• Referee- Watches a game closely to ensure that the rules are adhered.

Page 8: Kinh nghiệm phát triển Captain Strike

Room Life Circle

• Load Configuration

• Waiting for match start

Initializing

• Game Logic Processing

• Synchronize game world and collecting data

Playing• Calculating score

• Update User Profile via API Service

Scoring

Page 9: Kinh nghiệm phát triển Captain Strike

Distributed Room

Database

Cache

API ServicesRoom

Controller

Room

Room

Room

Room

Server1 Server2

Page 10: Kinh nghiệm phát triển Captain Strike

Part 2

Working Flow

Page 11: Kinh nghiệm phát triển Captain Strike

Design Principles

• Client just a “Display Screen”

• Online configuration

• Focusing on active user

Page 12: Kinh nghiệm phát triển Captain Strike

Authenticate

• Token base authentication.

- API Service generate an opaque string that identifies a user ( Token )

- User must provide Token to API Service when make request to server

- Token have a lifetime of about an 4 hours

Page 13: Kinh nghiệm phát triển Captain Strike

User Profile• Client Read-only

– Client don’t have authorize to change/modify user profile

– User send action to server. Server check valid and update user profile according to that action

Ex:Client: “Buy a gun id=10”Server: Check money, level, …. Perform transaction

and update user profile

Page 14: Kinh nghiệm phát triển Captain Strike

Quests and Events• Action and Target ID

– Quest is an accumulate number of Action and TargetID. Quest Complete when acc number equal or greater than requirements

– Each Quest/Event has their own requirement to activated

• Competition Rewards– Competition rewards do not automatically delivery to user.

User should call API to check and receive it after login complete

Page 15: Kinh nghiệm phát triển Captain Strike

Part 3

Lessons Learned

Page 16: Kinh nghiệm phát triển Captain Strike

Connection

• Minimize long live connections

• Transmit data as quickly as possible Using UDP instead of TCP for real-time multiplayer

• Be careful with packet loss

• Ping is not constant!

Page 17: Kinh nghiệm phát triển Captain Strike

Request/Response

• Minimize number or request to limit the impact of pingEx: Instead of send 3 api ( /getprofile, /getemail, /getconfig )

We can combine them together using Batch API

• Not all requests can be processed in parallel!

Page 18: Kinh nghiệm phát triển Captain Strike

Online Parameters

• Online parameters are very important. It can help you balance/configuration your game without update your application

• Use DNS instead of IP address for server URL

• Using Cache to improve server performance

Page 19: Kinh nghiệm phát triển Captain Strike

Tracking System

• Always track critical information ( User purchase, User Profile change, … )

• Pay attention to your tracking record design

• Analyze data to understand your audiences

Page 20: Kinh nghiệm phát triển Captain Strike

Q&A

Thank you for your time!