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

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂşjo
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

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