SlideShare a Scribd company logo
1 of 25
Ditching the Server
How to create client-side only social games
Amitt Mahajan (@amittm)
Founder/CEO, Red Hot Labs
My Background
• Co-creator/Lead Developer
– FarmVille
– ExampleVille: Zynga’s game engine & framework
• CTO, Zynga Japan
– Develop mobile games for the Japanese market
• Developer, Unreal Engine/Gears of War
GDC2013 • @amittm 2
Client/Server Replication
• Client replicates commands to the server
– Mostly async, non-blocking, operations
• Server validates commands to prevent cheating
– Success: Update DB; Failure: Out-of-sync error
GDC2013 • @amittm 3
Client/Server Implementation
• Client-side code: ActionScript, Obj-C, Java, JS
• Server-side code: PHP, Ruby, C, JS
• Data storage: Relational DB, NoSQL, iCloud
• Communication via REST calls
GDC2013 • @amittm 4
The Problem
• Write code twice, maintain 2 codebases
• Server state needs to be in sync: leads to out-of-sync
errors
• Provision servers & deploy code for each game
• Game teams and server ops teams tightly integrated
• Complicated, hard-to-port, game-specific network code
GDC2013 • @amittm 5
Proposal: Client-only validation
• All game logic lives with client-code
• Trust player client state
• Server is a dumb-pipe to store data
• Use automatic validation to lazy check state
GDC2013 • @amittm 6
Benefits
• Split creating games from running server operations
• Reuse infrastructure in several games and platforms
• Better utilize server resources with reduced complexity
• Reduce development time and errors
• Reduce out-of-sync errors, potentially better for mobile
GDC2013 • @amittm 7
Limitations
• Prior server controlled variables are now insecure
• Player-to-player interactions made insecure
• Potentially complicated validation mechanisms
• Global leaderboards / ladders easily manipulated
GDC2013 • @amittm 8
Data Storage
• Schema-less DB offers greatest flexibility (e.g.
NoSQL)
• Object-based schema keyed using class-name and id
• Server does not validate data but keeps track of
properties
• Objects can have references to other objects
GDC2013 • @amittm 9
Example Object
{
_className:“User”,
_id: 25,
_acl: {“read”:”global”,”write”:[25]},
_version: 3,
level: 4,
coins:76,
games:[{_className:”Game”,id:45},{_className:”Game”,id:34}]
}
GDC2013 • @amittm 10
Example API
• Object.get(className, id)
– Returns object data based on className and Id
• Object.set(className, id, data)
– Sets data for an object
• Object.acls(newAcls)
– Changes the access permissions for an object
GDC2013 • @amittm 11
Data Security
• ObjectAccess-Control-Layer (ACL) system
• Permissions granted using access tokens
• Versioning / Conflict-resolution
GDC2013 • @amittm 12
Uses for ACLs
• Private or read-only user data
• Shared game state or game objects
• Static, developer-defined, game data
GDC2013 • @amittm 13
Example: AccessTokens
GDC2013 • @amittm 14
Client API
Server
1. Login using email/pass
2. Return AccessToken
3. Request game object with token
5. Return requested object
4.Verify access
token grants
permission
SPECIFICALLY to
requested object
AccessToken Levels
GDC2013 • @amittm 15
Access Token Level
None • No or invalid access token provided
• User only has access to global objects
User • User logged-in / authenticated
• User can access objects owned by their user ID
System
• Secret/private access token
• Game developer usage only
• Can modify any object on the server
Impact on Game Design
• Trust is now a consideration in game-design
• Some game-styles will not be possible without
additional validation
• May limit creativity of game mechanics in certain
cases
GDC2013 • @amittm 16
Best Use Cases
• Asynchronous is the intended use case
• Single player games that require cloud storage
– Plants vs. Zombies, Angry Birds
• Single player w/ multiplayer component
– FarmVille, Sims Social
• Limited PvP games
– Words with Friends, Draw Something
GDC2013 • @amittm 17
Cheating
• Modification of player stats/state
• Generating favorable outcomes
• Could potentially hurt revenue
• Non-technical players can cheat with tools
GDC2013 • @amittm 18
ValidationTechniques
• Analytics
• Secure token and separate service
• Unified scripting language
GDC2013 • @amittm 19
Example: How to hack XP
1. Player uses a proxy to examine network calls
2. Figures out what a save call looks like
3. Modifies game state to desired result
4. Executes a save call with modified state
Note:This isTRIVIAL and a big hole!
GDC2013 • @amittm 20
Example: Preventing XP Hacking
• Developer marks XP field in an object as being “rate-limited” or
“important”
• User modifies their local XP value
• On post-object-save:
– Store historical values of field
– Standard deviation rate of change flags account for manual review
– Tweak thresholds for false-positives
GDC2013 • @amittm 21
Example: XP delta over time
GDC2013 • @amittm 22
0
200
400
600
800
1000
1200
Day 0 Day 4 Day 8 Day 12 Day 16 Day 20
Suspicious spike outside
acceptable range,
flag account
Production Case: Bingo Blast!
• Head-to-head & solo game for iOS/Android
• Shared game objects
• Game requests / messages
• In-app purchases
• No server work required
GDC2013 • @amittm 23
Conclusion
• There is no one-size-fits all solution
• Server-side validation is good for absolute cheat
prevention and is proven to work
• Client-only validation provides performance boost, less
errors, and development time reduction at cost of security
• Automatic validation non-trivial and will improve over time
GDC2013 • @amittm 24
Thank you!
Email: amitt@redhotlabs.com
Twitter: @amittm
Web: amitt.com / redhotlabs.com
GDC2013 • @amittm 25

More Related Content

Similar to GDC 2013 - Ditching the Server: Making Client-side Only Social Games

Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
 
Mobile game architecture on GCP
Mobile game architecture on GCPMobile game architecture on GCP
Mobile game architecture on GCP명근 최
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and ApplicationsInnoTech
 
MMO Design Architecture by Andrew
MMO Design Architecture by AndrewMMO Design Architecture by Andrew
MMO Design Architecture by AndrewAgate Studio
 
Forecast: Cloud-y with Azure Skies
Forecast: Cloud-y with Azure SkiesForecast: Cloud-y with Azure Skies
Forecast: Cloud-y with Azure SkiesCharlie Oliver
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceESUG
 
Oracle 12.2 - My Favorite Top 5 New or Improved Features
Oracle 12.2 - My Favorite Top 5 New or Improved FeaturesOracle 12.2 - My Favorite Top 5 New or Improved Features
Oracle 12.2 - My Favorite Top 5 New or Improved FeaturesSolarWinds
 
Real-time analysis using an in-memory data grid - Cloud Expo 2013
Real-time analysis using an in-memory data grid - Cloud Expo 2013Real-time analysis using an in-memory data grid - Cloud Expo 2013
Real-time analysis using an in-memory data grid - Cloud Expo 2013ScaleOut Software
 
Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...
Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...
Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...DevGAMM Conference
 
Schemas Beyond The Edge
Schemas Beyond The EdgeSchemas Beyond The Edge
Schemas Beyond The Edgeconfluent
 
The Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need BackendsThe Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need BackendsJames Gwertzman
 
EM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM MetricsEM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM MetricsMaaz Anjum
 
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...Databricks
 
Video Game Security
Video Game SecurityVideo Game Security
Video Game SecurityCigital
 
Dojo Grids in XPages
Dojo Grids in XPagesDojo Grids in XPages
Dojo Grids in XPagesTeamstudio
 
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs PresentationADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentationprashant3535
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators liteSharon James
 
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Amazon Web Services
 
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)Alvaro Sanchez-Mariscal
 

Similar to GDC 2013 - Ditching the Server: Making Client-side Only Social Games (20)

Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
 
Mobile game architecture on GCP
Mobile game architecture on GCPMobile game architecture on GCP
Mobile game architecture on GCP
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 
MMO Design Architecture by Andrew
MMO Design Architecture by AndrewMMO Design Architecture by Andrew
MMO Design Architecture by Andrew
 
Forecast: Cloud-y with Azure Skies
Forecast: Cloud-y with Azure SkiesForecast: Cloud-y with Azure Skies
Forecast: Cloud-y with Azure Skies
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
Oracle 12.2 - My Favorite Top 5 New or Improved Features
Oracle 12.2 - My Favorite Top 5 New or Improved FeaturesOracle 12.2 - My Favorite Top 5 New or Improved Features
Oracle 12.2 - My Favorite Top 5 New or Improved Features
 
Real-time analysis using an in-memory data grid - Cloud Expo 2013
Real-time analysis using an in-memory data grid - Cloud Expo 2013Real-time analysis using an in-memory data grid - Cloud Expo 2013
Real-time analysis using an in-memory data grid - Cloud Expo 2013
 
Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...
Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...
Modern Data Stack for Game Analytics / Dmitry Anoshin (Microsoft Gaming, The ...
 
Schemas Beyond The Edge
Schemas Beyond The EdgeSchemas Beyond The Edge
Schemas Beyond The Edge
 
The Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need BackendsThe Future is Operations: Why Mobile Games Need Backends
The Future is Operations: Why Mobile Games Need Backends
 
EM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM MetricsEM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM Metrics
 
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
 
Online casino
Online casinoOnline casino
Online casino
 
Video Game Security
Video Game SecurityVideo Game Security
Video Game Security
 
Dojo Grids in XPages
Dojo Grids in XPagesDojo Grids in XPages
Dojo Grids in XPages
 
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs PresentationADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
ADRecon BH USA 2018 : Arsenal and DEF CON 26 Demo Labs Presentation
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators lite
 
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
 
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

GDC 2013 - Ditching the Server: Making Client-side Only Social Games

  • 1. Ditching the Server How to create client-side only social games Amitt Mahajan (@amittm) Founder/CEO, Red Hot Labs
  • 2. My Background • Co-creator/Lead Developer – FarmVille – ExampleVille: Zynga’s game engine & framework • CTO, Zynga Japan – Develop mobile games for the Japanese market • Developer, Unreal Engine/Gears of War GDC2013 • @amittm 2
  • 3. Client/Server Replication • Client replicates commands to the server – Mostly async, non-blocking, operations • Server validates commands to prevent cheating – Success: Update DB; Failure: Out-of-sync error GDC2013 • @amittm 3
  • 4. Client/Server Implementation • Client-side code: ActionScript, Obj-C, Java, JS • Server-side code: PHP, Ruby, C, JS • Data storage: Relational DB, NoSQL, iCloud • Communication via REST calls GDC2013 • @amittm 4
  • 5. The Problem • Write code twice, maintain 2 codebases • Server state needs to be in sync: leads to out-of-sync errors • Provision servers & deploy code for each game • Game teams and server ops teams tightly integrated • Complicated, hard-to-port, game-specific network code GDC2013 • @amittm 5
  • 6. Proposal: Client-only validation • All game logic lives with client-code • Trust player client state • Server is a dumb-pipe to store data • Use automatic validation to lazy check state GDC2013 • @amittm 6
  • 7. Benefits • Split creating games from running server operations • Reuse infrastructure in several games and platforms • Better utilize server resources with reduced complexity • Reduce development time and errors • Reduce out-of-sync errors, potentially better for mobile GDC2013 • @amittm 7
  • 8. Limitations • Prior server controlled variables are now insecure • Player-to-player interactions made insecure • Potentially complicated validation mechanisms • Global leaderboards / ladders easily manipulated GDC2013 • @amittm 8
  • 9. Data Storage • Schema-less DB offers greatest flexibility (e.g. NoSQL) • Object-based schema keyed using class-name and id • Server does not validate data but keeps track of properties • Objects can have references to other objects GDC2013 • @amittm 9
  • 10. Example Object { _className:“User”, _id: 25, _acl: {“read”:”global”,”write”:[25]}, _version: 3, level: 4, coins:76, games:[{_className:”Game”,id:45},{_className:”Game”,id:34}] } GDC2013 • @amittm 10
  • 11. Example API • Object.get(className, id) – Returns object data based on className and Id • Object.set(className, id, data) – Sets data for an object • Object.acls(newAcls) – Changes the access permissions for an object GDC2013 • @amittm 11
  • 12. Data Security • ObjectAccess-Control-Layer (ACL) system • Permissions granted using access tokens • Versioning / Conflict-resolution GDC2013 • @amittm 12
  • 13. Uses for ACLs • Private or read-only user data • Shared game state or game objects • Static, developer-defined, game data GDC2013 • @amittm 13
  • 14. Example: AccessTokens GDC2013 • @amittm 14 Client API Server 1. Login using email/pass 2. Return AccessToken 3. Request game object with token 5. Return requested object 4.Verify access token grants permission SPECIFICALLY to requested object
  • 15. AccessToken Levels GDC2013 • @amittm 15 Access Token Level None • No or invalid access token provided • User only has access to global objects User • User logged-in / authenticated • User can access objects owned by their user ID System • Secret/private access token • Game developer usage only • Can modify any object on the server
  • 16. Impact on Game Design • Trust is now a consideration in game-design • Some game-styles will not be possible without additional validation • May limit creativity of game mechanics in certain cases GDC2013 • @amittm 16
  • 17. Best Use Cases • Asynchronous is the intended use case • Single player games that require cloud storage – Plants vs. Zombies, Angry Birds • Single player w/ multiplayer component – FarmVille, Sims Social • Limited PvP games – Words with Friends, Draw Something GDC2013 • @amittm 17
  • 18. Cheating • Modification of player stats/state • Generating favorable outcomes • Could potentially hurt revenue • Non-technical players can cheat with tools GDC2013 • @amittm 18
  • 19. ValidationTechniques • Analytics • Secure token and separate service • Unified scripting language GDC2013 • @amittm 19
  • 20. Example: How to hack XP 1. Player uses a proxy to examine network calls 2. Figures out what a save call looks like 3. Modifies game state to desired result 4. Executes a save call with modified state Note:This isTRIVIAL and a big hole! GDC2013 • @amittm 20
  • 21. Example: Preventing XP Hacking • Developer marks XP field in an object as being “rate-limited” or “important” • User modifies their local XP value • On post-object-save: – Store historical values of field – Standard deviation rate of change flags account for manual review – Tweak thresholds for false-positives GDC2013 • @amittm 21
  • 22. Example: XP delta over time GDC2013 • @amittm 22 0 200 400 600 800 1000 1200 Day 0 Day 4 Day 8 Day 12 Day 16 Day 20 Suspicious spike outside acceptable range, flag account
  • 23. Production Case: Bingo Blast! • Head-to-head & solo game for iOS/Android • Shared game objects • Game requests / messages • In-app purchases • No server work required GDC2013 • @amittm 23
  • 24. Conclusion • There is no one-size-fits all solution • Server-side validation is good for absolute cheat prevention and is proven to work • Client-only validation provides performance boost, less errors, and development time reduction at cost of security • Automatic validation non-trivial and will improve over time GDC2013 • @amittm 24
  • 25. Thank you! Email: amitt@redhotlabs.com Twitter: @amittm Web: amitt.com / redhotlabs.com GDC2013 • @amittm 25

Editor's Notes

  1. Priorserver controlled variables are now insecureItem rarity and drop-ratesServer controlled randomnessPlayer-to-player interactions made insecurePvPTradingPotentially complicated validation mechanismsGlobal leaderboards / ladders easily manipulated
  2. Access-Control-Layer (ACL) systemAllows user and global level read and write permissions per objectData manipulation using access tokensProvide multiple levels of application securityVersioning / Conflict-resolutionSSL
  3. User protects their own account from writing but makes their profile info public read2 players are playing a game that only they can read/write state toDevelopers have protected static game data (such as items or level curves) that only they can modify but everyone can read from
  4. (Note: This will be made into a flow chart)User logs into system using email/pass and receives access tokenFor object.get user sends access token as a parameterAPI server checks access token and grants appropriate permissions to the requestOn object retrieval, request permissions are checked against object permissionsSuccess: Return object, Failure: return access denied error
  5. Modification of player stats/state Change coins to 1million Unlocked all achievements Generating favorable outcomes Slot machine always comes up as a jackpot
  6. AnalyticsExamine distribution of game properties for outliersSecure token and separate serviceSecure server that has global ACL access to dataScripting languageSandboxed script code that is ran on both client and server