Integrating a Cloud Service Joe
Overview Example from our games Support in UE4 to achieve that
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
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
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
What’s Needed Cloud Service to deliver files Game support to download files Game support to merge files into game
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
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
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
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
Game to Service Interaction Cloud Service(s) IHttpRequest IHttpResponse
Class Overview FHttpModule IHttpRequest IHttpResponse
FHttpModule Module for generic HTTP management Performs ticking Handles lifetime management
IHttpRequest Abstract interface to a platform specific request object Contains –URL –Verb (GET, PUT, POST, DELETE) –Headers –Payload Asynchronous submission to end point
IHttpResponse Abstract interface to a platform specific response object Created upon request completion Contains any headers & payload data
TJsonReader/TJsonWriter Base template classes for parsing/creating JSON payloads Generally not used directly
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
FJsonObjectxConverter Used to serialize JSON to/from a UObject Uses UObject reflection system Easiest to use
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 #unrealengine on FreeNode