19
Integrating a Cloud Service Joe Graf @EpicCog

Integrating a Cloud Service via HTTP

Embed Size (px)

Citation preview

Page 1: Integrating a Cloud Service via HTTP

Integrating a Cloud Service

Joe Graf@EpicCog

Page 2: Integrating a Cloud Service via HTTP

Overview

• Example from our games

• Support in UE4 to achieve that

Page 3: Integrating a Cloud Service via HTTP

Cloud Based Events

• Timed gameplay changing events

– The limited time draws players in

• Used to make your game “evergreen”

– Retains players longer

– Adds to the fun

Page 4: Integrating a Cloud Service via HTTP

Gears of War

• Gears of War 2– Used to make gameplay balancing changes

– Primarily, to create custom Horde events

• Gears of War 3– Added the ability to change standard game

modes• Restrict weapons or change which ones were present

– Allowed for custom playlists for matchmaking

Page 5: Integrating a Cloud Service via HTTP

Infinity Blade

• Infinity Blade 2– Used to support social challenges, ClashMobs

– Custom INI files detailing the challenges

• Infinity Blade 3– Added the ability to patch configuration settings

– Used to run special helmet events

– IAP sales

– The treasure chest in the Hideout

Page 6: Integrating a Cloud Service via HTTP

What’s Needed

• Cloud Service to deliver files

• Game support to download files

• Game support to merge files into game

Page 7: Integrating a Cloud Service via HTTP

Cloud Service

• System (game) cloud storage

– Upload of files with start/stop times

– Listing of files with full meta data

– Serving of files to game client

Page 8: Integrating a Cloud Service via HTTP

Game Downloader

• Reads list of files from the Cloud Service

– Verifies signatures to detect out of date files

– Catches tampered with files too

• Downloads any missing files

– Caches files to device with per device encryption

– Optimization to reduce server bandwidth costs

Page 9: Integrating a Cloud Service via HTTP

Game Merging

• Gets the list of event files

• For each file, determines how to merge

– INI & loc files get merged into the config

cache

– Content files replace/add to existing

Page 10: Integrating a Cloud Service via HTTP

Caveats

• Game must design for this

– Must make sure that game is data driven via

INI or DataTable objects

– Takes planning from the beginning

• Not everything can be updated

– E.g. very early engine config values

Page 11: Integrating a Cloud Service via HTTP

Game to Service Interaction

Cloud Service(s)

IHttpRequest

IHttpResponse

Page 12: Integrating a Cloud Service via HTTP

Class Overview

• FHttpModule

• IHttpRequest

• IHttpResponse

Page 13: Integrating a Cloud Service via HTTP

FHttpModule

• Module for generic HTTP management

• Performs ticking

• Handles lifetime management

Page 14: Integrating a Cloud Service via HTTP

IHttpRequest

• Abstract interface to a platform specific request object

• Contains– URL

– Verb (GET, PUT, POST, DELETE)

– Headers

– Payload

• Asynchronous submission to end point

Page 15: Integrating a Cloud Service via HTTP

IHttpResponse

• Abstract interface to a platform specific response object

• Created upon request completion

• Contains any headers & payload data

Page 16: Integrating a Cloud Service via HTTP

TJsonReader/TJsonWriter

• Base template classes for parsing/creating

JSON payloads

• Generally not used directly

Page 17: Integrating a Cloud Service via HTTP

OnlineJsonSerializer

• Macro based serialization for native types without reflection

• Facebook account serialization:

BEGIN_ONLINE_JSON_SERIALIZER

ONLINE_JSON_SERIALIZE("id", UserId);

ONLINE_JSON_SERIALIZE("username", UserName);

ONLINE_JSON_SERIALIZE("name", RealName);

ONLINE_JSON_SERIALIZE("gender", Gender);

ONLINE_JSON_SERIALIZE("locale", Locale);

END_ONLINE_JSON_SERIALIZER

Page 18: Integrating a Cloud Service via HTTP

FJsonObjectxConverter

• Used to serialize JSON to/from a UObject

• Uses UObject reflection system

• Easiest to use

Page 19: Integrating a Cloud Service via HTTP

Questions?

Documentation, Tutorials, and Help at:

• AnswerHub:

• Engine Documentation:

• Official Forums:

• Community Wiki:

• YouTube Videos:

• Community IRC:

Unreal Engine 4 Roadmap• lmgtfy.com/?q=Unreal+engine+Trello+

http://answers.unrealengine.com

http://docs.unrealengine.com

http://forums.unrealengine.com

http://wiki.unrealengine.com

http://www.youtube.com/user/UnrealDevelopmentKit

#unrealengine on FreeNode