Category: Games


Launch: Amazon GameLift Now Supports All C++ and C# Game Engines

by Tara Walker | on | in Amazon GameLift, Amazon GameLift Server SDK for C#, Amazon GameLift Server SDK for C++, Games, Launch | | Comments

Calling all Game Developers! GDC 2017 was a blast in San Francisco a couple of weeks ago, so there is no better time to be inspired and passionate about learning and building cool games.

Therefore, I am excited to share that Amazon GameLift is now available for all C++ and C# game engines, including Amazon Lumberyard, Unreal Engine, and Unity, all with enhanced game session matching capabilities. For those of you not familiar with Amazon GameLift, let me introduce this managed service designed to aid game developers in delivering fun and innovative online game experiences.

Amazon GameLift is a managed AWS service for hosting dedicated game servers, making it easier for game developers to scale their game capacity and match players into available game sessions. With Amazon GameLift, you can host servers, track game availability, defend game servers from distributed denial of service (DDoS) attacks, and deploy updates without taking your game offline. The Amazon GameLift service powers dedicated game servers for Amazon Game Studios, as well as external game development customers, and is designed to support session-based games with game loops that start and end within a specified time.

The latest Amazon GameLift release enhances the current functionality of the service, as well as adding awesome new features to help simplify game development and deployment for developers. Let us review some of the cool features of the Amazon GameLift service:

  • Multi-engine support: Initially, Amazon GameLift service could only be used with the Amazon Lumberyard game engine. The service is now enhanced to integrate with popular game engines like Unreal Engine, Unity, as well as, custom C# and C++ game engines.
  • New server SDK language support: In order to support a larger set of customers and developers, the service provides an Amazon GameLift Server SDK available for C# and C++. This includes an Unreal Engine plugin, which is a customized version of the C++ Server SDK that is compatible with the Unreal Engine API for Amazon GameLift.
  • Client SDK language support expansion: The Amazon GameLift Client SDK is bundled with the AWS SDK, which is available in a myriad of different languages. This allows game developers to build game clients with an integration of the Amazon GameLift service in their language of choice.
  • Matchmaking: Amazon GameLift continually scans available game servers around the world and matches them against player requests to join games. If low-latency game servers are not available, you can configure the service to automatically add more capacity near your players. Amazon GameLift maintains a queue of waiting players until new games start or new instances launch, then places waiting players into the lowest latency game.
  • Player data handling: Game developers can now store custom player information and pass it directly to a game server. A game server or other game entity with an API call can then retrieve Player data from Amazon GameLift.
  • Console Support: Amazon GameLift supports games developed and architected for Xbox One and PS4.

Amazon GameLift does the heavy lifting of tasks once required to create session-based multiplayer games by simplifying the process of deploying, scaling, and maintaining game servers while reducing the time, cost, and risks associated with building the infrastructure from scratch.

The reference architecture of a gaming solution that utilizes the Amazon GameLift would look as follows:

 

Integrating Amazon GameLift into Your Games

The process of integrating Amazon GameLift into your game build can be broken down in a few simple steps:

  1. Prepare your game server for hosting on Amazon GameLift by setting up your game server project with the Amazon GameLift Server SDK and adding communication code to the project.
  2. Package and upload your game server build to the AWS region targeted for game deployment
  3. Create and build a fleet of computing resources to host the game.
  4. Prepare your game client to connect to game sessions maintained by Amazon GameLift using the AWS SDK with Amazon GameLift APIs and add code to game client for calls to Amazon GameLift service and identifying the player region.
  5. Test your Amazon GameLift integration by connecting an Amazon GameLift-hosted game session and verifying game sessions are being created.

Let’s get started putting these steps into practice by setting up the Amazon GameLift Server SDK in a simple game server project using the Unreal game engine.

Unreal Engine (UE)

We start with Epic’s Unreal game engine. For simplicity, we will create the sample Shooter Game project with online multiplayer functionality built-in, and save it locally on the computer.

Now that I have the Multiplayer Shooter Game sample downloaded and open locally on my machine, I will need to be able to manipulate the C++ code to add the Amazon GameLift service to the UE Online Sub-System to manage the online game sessions. The Shooter Game sample is leveraging the Blueprints Visual Scripting system in Unreal Engine. The Blueprints system is a gameplay scripting system based on node-based interfaces in the UE editor, which enables game designers and content creators to create gameplay elements and functionality within UE editor.

Since it is my goal to use the Amazon GameLift C++ SDK to include the Amazon GameLift service in the game and alter the game code, I will need to create Visual Studio project solution to tie in the game and correlate the source code and any binaries from the Shooter Game to the project. To accomplish this I navigate to the context menu and select the File menu option. In the menu dropdown, I find and select the Generate Visual Studio Project Files option.

Once the project has generated, I only need to return to the Context menu and select File, then Open with Visual Studio in order to open the project and view the source code.

In preparation for adding the Amazon Game Lift service to the Shooter Game as the game service and for game session management, you will need to enable the OnlineSubSystem module in your project. In order to do this, open the game build settings file in the Visual Studio project. Since this game project is named ShooterGame, the build file is named ShooterGame.Build.cs and is located in the Source/ShooterGame folder(s) as shown below.

Open your Build files and uncomment the line for the OnlineSubsystemNull module. Since I am using the sample that already utilizes a multiplayer online system, my build options are set appropriately, and the code looks like this:

public class ShooterGame : ModuleRules
{
	public ShooterGame(TargetInfo Target)
	{
		PrivateIncludePaths.AddRange(
			new string[] { 
				"ShooterGame/Classes/Player",
				"ShooterGame/Private",
				"ShooterGame/Private/UI",
				"ShooterGame/Private/UI/Menu",
				"ShooterGame/Private/UI/Style",
				"ShooterGame/Private/UI/Widgets",
            		}
		);
       PublicDependencyModuleNames.AddRange(
			new string[] {
				"Core",
				"CoreUObject",
				"Engine",
				"OnlineSubsystem",
				"OnlineSubsystemUtils",
				"AssetRegistry",
             			"AIModule",
				"GameplayTasks",
			}
		);
       PrivateDependencyModuleNames.AddRange(
			new string[] {
				"InputCore",
				"Slate",
				"SlateCore",
				"ShooterGameLoadingScreen",
				"Json"
			}
		);
		DynamicallyLoadedModuleNames.AddRange(
			new string[] {
				"OnlineSubsystemNull",
				"NetworkReplayStreaming",
				"NullNetworkReplayStreaming",
				"HttpNetworkReplayStreaming"
			}
		);
		PrivateIncludePathModuleNames.AddRange(
			new string[] {
				"NetworkReplayStreaming"
			}
		);
	}
}

Now that we are set with the Shooter Game project, let’s turn our attention on the Amazon GameLift SDK. I want to leverage the C++ SDK as a plugin for the Unreal Engine, therefore, I need to compile the SDK using the using a compilation directive that builds the binaries for this game engine.

With the SDK source downloaded, I can compile the SDK from the source based upon my operating system. Since I am using a Windows machine for this project, I will complete the following steps:

  • Make an out directory to hold the binaries generated from the code compilation:

mkdir out

  • Change to the previously created directory:

cd out

  • Use CMake to specify a build system generator for VS 2015 Win x64 and set UE compilation flag:

cmake -DBUILD_FOR_UNREAL=1 -G “Visual Studio 14 2015 Win64” <source directory>

  • Build C++ project to create binaries using selected Build System (MS Build for this project):

msbuild ALL_BUILD.vcxproj /p:Configuration=Release

With my libraries compiled, I should have the following binary files required to use the Amazon GameLift Unreal Engine plugin.

Linux:

* out/prefix/lib/aws-cpp-sdk-gamelift-server.so

Windows:

* out\prefix\bin\aws-cpp-sdk-gamelift-server.dll

* out\prefix\lib\aws-cpp-sdk-gamelift-server.lib

As you can see below, since I am on Windows, my compiled Amazon GameLift libraries, aws-cpp-sdk-gamelift-server.dll and aws-cpp-sdk-gamelift-server.lib, are located in the prefix\bin and prefix\lib folders respectively.

After copying the binaries to the GameLiftSDK Unreal Engine plugin folder, my Amazon GameLift plugin folder is configured and ready to be added to an Unreal Engine game project.

Given this, it is now time to add the Amazon GameLift plugin to the Unreal Engine ShooterGame project. I could use the Unreal Engine Editor to add the plugin, but instead, I will stay in the Visual Studio project and add the plugin by updating the game directory and project file.

In Windows Explorer, I add a folder called Plugins in the ShooterGame directory and copy my prepared GameLiftServerSDK folder into the directory as noted by the Unreal Engine documentation on plugins.

Now I will open up the ShooterGame.Build.cs file, which is a C# file that holds information about game dependencies.

Within the file I will add the following code:

PublicDependencyModuleNames.AddRange(
            new string[] {
                "Core",
                "CoreUObject",
                "Engine",
                "InputCore",
                "GameLiftServerSDK"
            }
       );

Just to ensure all is in sync with the changes made thus far, I close Visual Studio, go back to the UE Editor, and select Refresh Visual Studio Project.

Upon completion, I select Open Visual Studio and the Plugins folder I added in the ShooterGame directory is now included in the project and able to be viewed in Solution Explorer.

Next, I rebuild my entire solution to get the Amazon GameLift SDK binaries integrated into the project.

I’ll go back to the UE Editor and select Build from the toolbar to ensure the aspects of the Amazon GameLift plugin are included in my ShooterGame. Once compilation is complete, a quick visit to the Settings toolbar and Plugins option shows that the Amazon GameLift plugin is added and is recognized in the project. I will select the Enabled checkbox, which will prompt me to restart the UE Editor. I select Restart Now and allow the Unreal Engine to rebuild the game code files.

Upon completion of the build, the editor will restart and reopen my ShooterGame.

Now things are set for the use of the Amazon GameLift SDK in the ShooterGame project.

With the Unreal editor open, I’ll go into the Open Visual Studio menu option to get back to the ShooterGame code. This will open up Visual Studio and the game code. With Visual Studio open, I go to the ShooterGameMode.cpp file to add the code to initialize the Amazon GameLift SDK. Some key things I must do in order to correctly add the code for Amazon GameLift within my Shooter game project are:

  1. Enclose the Amazon GameLift code within a preprocessor condition using the flag WITH_GAMELIFT=1
  2. Build a dedicated server in Unreal Engine for my targeted server OS ex. Linux
  3. Ensure my build target is a game server type i.e. Type == TargetRules.TargetType.Server

You can find an example of the code needed to add Amazon GameLift in your Unreal Engine project in the documentation here. In addition, you can learn how to build a dedicated server for Unreal Engine by following the Dedicated Server Guide for Windows and Linux provided in the Unreal Engine wiki. With these resources in hand, you should be well on your way to integrating Amazon GameLift into a game project.

I just did a quick review of incorporating the Amazon GameLift SDK in the Unreal Engine game engine, but don’t forget you have the option to add the Amazon GameLift SDK into C# engines like Unity. By downloading the Amazon GameLift Server SDK and compiling the .Net framework 3.5 solution, GameLiftServerSDKNet35.sln. The GameLiftServerSDKNet35.sln solution will enable you to add the Amazon GameLift libraries your Unity3D project. Review the Amazon GameLift SDK documentation, Using the C# Server SDK for Unity, in order to learn more about setting up and using the Amazon GameLift C# Server SDK plugin.

Summary

We reviewed just one of the new aspects added of the Amazon GameLift managed service, but the service provides game developers and game studios with even more. Amazon GameLift enables the building of distributed games by making it easy to manage infrastructure, scale capacity, and match players into available game sessions while defending games from DDoS attacks.

You can learn more about the Amazon GameLift service by reviewing the Amazon GameLift documentation, the Amazon GameLift developer guide and/or check out the Amazon GameLift tutorials on the Amazon GameDev tutorial page in order to hit the ground running with game development with Amazon GameLift service.

Happy Gaming!

– Tara

Amazon Underground – New Business Model for Android Apps

by Jeff Barr | on | in Games, Mobile Development |

My friends and family members who build apps tell me that there’s a huge hurdle to cross on the road to monetization. Users are willing and eager to download new games and tools, but can be reluctant to pay to do so and expect a lot for free. While some apps make good use of In-App Purchasing (IAP) as a monetization vehicle and optimize for the (reported) 2% to 10% of the user base, many developers struggle to build an audience and a sustainable business model.

We aim to change things with the new Amazon Underground app for Android phones. This app builds upon the regular Amazon mobile shopping app, providing users with access to over ten thousand dollars in apps, games, and in-app purchases that are actually free. Underground apps and games are also available automatically on Kindle Fire HD and Fire HDX tablets.

As an app developer, you get paid $0.002 (1/5th of a cent) for every minute that a customer is using your Amazon Underground app. You can now focus on building apps that engage your users over the long term. You can build up long-term story lines, roll out additional content over time, and count on a continued revenue stream that is based on actual usage.

To learn more, register for a free developer account, read the eligibility and submission checklist, migrate to Amazon Underground, and submit your app to the Amazon Appstore and read this blog post.

Jeff;

 

 

Hosting Minecraft Realms on AWS

by Jeff Barr | on | in Amazon EC2, Case Studies, Games |

Minecraft appears to be the gaming and visual building environment of choice for today’s youth! Pretty much everyone I know in the 8-18 age range admits to spending a lot of time in-world. The game’s outward simplicity hides an environment of considerable richness and complexity, with many interesting emergent properties.

The game runs in single and multiplayer mode. In the latter mode, you can host and run your own server for you and your friends, or you can use a commercial or freely available multiplayer host. Running your own server brings with it all of the usual issues — maintenance, scaling, security, and upgrades. You can avoid these issues by using a multiplayer hosting service. The hosts remove the administrative burden and make it possible for more fans to enjoy and to play multiplayer games.

Minecraft Realms is a new multiplayer hosting service from Mojang, the creators of Minecraft. It was designed to help people who don’t want to deal with all of the technical aspects of hosting. Each realm can accommodate up to 20 friends, 10 of which can be playing at any given time. The service is offered on a subscription basis, and is currently available to players in Sweden, with plans to expand availability in early 2014.

In order to prepare for the expected onslaught of players, the development team at Mojang decided to host Realms on AWS. I chatted with Chief Architect Daniel Frisk (pictured at right) to learn more about why and how they did this.

The team was impressed by the ease with which they were able to get started on AWS. They enjoyed the fact that they didn’t have to make an investment in development or production hardware, and looked forward to being able to scale their systems as needed once they were in production.

Assisted by the AWS Solution Architects, the team decided to make use of the following AWS services:

The architecture is clean and simple, with three distinct types of servers:

  • Frontend – Handles communication with clients and serves dynamic web pages.
  • Manager – Manages the controllers, starting and stopping them as required; collects data & statistics.
  • Controller – Runs the Minecraft game servers.

Daniel was kind enough to share the architecture with me:

The architecture was designed for scalability and high availability. Controllers hosting the game are added and removed in response to changes in demand, and there’s no single point of failure.

The Minecraft client applications require low-latency access to the Realms servers. In order to meet this need, servers are run across multiple AWS Regions (see the AWS Global Infrastructure page for more information).

Minecraft worlds and game state are stored in Amazon S3. The system takes advantage of S3 versioning, giving the owner / administrator of a realm the ability to roll back to a previous state. The team implemented efficient transfers to S3 by using S3’s multipart upload capabilty.

— Jeff;

PS – If you are interested in building and hosting a game of your own on AWS, please take a look at our game hosting page.

Amazon Coins – Virtual Currency for App and In-App Purchases

by Jeff Barr | on | in Amazon DynamoDB, Amazon EC2, Amazon S3, Games |

Amazon Coins are a new virtual currency that will be made available to Kindle Fire users this coming May. They can be used to pay for apps and for most in-app purchases.

If your app runs on the Kindle Fire, it is eligible for Amazon Coins with no further work on your part. If it runs on another Android device and is already in the Amazon Appstore for Android, you’ll need to review the Kindle Fire Best Practices and then re-submit your app with the appropriate Kindle Fire devices checked in the Device Support section of the submission form.

For more information about how to use Amazon Coins in your app, read our new blog post, Taking Advantage of Amazon Coins.

I would also like to encourage you to take a look at some other AWS services that you can use to build and host mobile apps of all types:

  • The AWS SDK for Android lets you build Android apps that access and take advantage of AWS services.
  • Amazon EC2 makes a great, scalable host for your application’s backend processing and logic.
  • Amazon S3 is perfect for storing application assets, for low-latency worldwide distribution via Amazon CloudFront.
  • Amazon DynamoDB is a fully managed NoSQL service that can scale to any desired level of throughput.

You can also visit our Web, Mobile, and Social Apps page to get some ideas and to see how your competitors are already using these services!

— Jeff;

 

Facebook Developer Update: Meet RootMusic, Funzio, and 50Cubes

by Jeff Barr | on | in Amazon CloudFront, Amazon EC2, Amazon Elastic Load Balancer, Amazon RDS, Amazon S3, Auto Scaling, Customer Success, Developer Tools, Games, Mobile, Music |

In honor of today’s Facebook Developer Conference, I’d like to recognize the success of our existing Facebook app developers and invite even more developers to kick-start their next Facebook app project with Amazon Web Services.

Quick Numbers
We crunched some numbers and found out that 70% of the 50 most popular Facebook apps leverage one or more AWS services. Many of their developers rely on AWS to provide them with compute, network, storage, database and messaging services on a pay-as-you-go basis. In addition to Zyngas popular FarmVille and CafeWorld, or games from Playfish and Wooga, many of the most exciting and popular Facebook apps are also running on AWS.

Here are a few examples:

RootMusic‘s BandPage app (currently the #1 Music App on Facebook, and #8 overall app on Facebook) helps bands and musicians build fan pages that will attract and hold the interest of an audience. RootMusic enables artists to tap into the passion their fans feel for their art and keep them engaged with an interactive experience. More than 250,000 bands of all shapes and sizes, from Rihanna and Arctic Monkeys, to bands you haven’t heard of yet but may soon discover, have already made RootMusics BandPage their central online space for connecting with their fans. Artists use it to share music, release special edition songs/albums here, share photos, and list events/shows. BandPage now supports 30 million monthly active users from all over the world. Behind all the capabilities that ignite BandPages music fan communities lies a well-thought out, highly-distributed and highly-scalable backend, powered by Amazon Web Services:

In 20 seconds, we can double our server capacity. In a high-growth environment like ours, it’s very important for us to trust that we have the best support to give to the music community around the world. Five years ago, we would have crashed and been down without knowing when we would be back. Now, because of Amazons continued innovation, we can provide the best technology and scale to serve music communities needs around the world, Christopher Tholen, RootMusic CTO.


Funzio‘s Crime City is #7 in the top 10 Facebook apps, and its the highest rated Facebook game to reach 1 million daily users with an average user rating of 4.9 out of 5. Crime City currently has 5.5 million monthly active users, with 10 million monthly active users at its peak. The iPhone version was recently listed among the top 5 games in the Apple Appstore and #1 free game in 11 countries and counting. Crime City sports modern, 3D-like graphics that look great on both Facebook and iPhone, and has a collection of hundreds of virtual items that players can collect.

Powering this incredibly rich user experience across multiple platforms is their business acumen in promoting the app, as well as a strong backend that leverages many AWS products to serve their viral and highly active user base. Funzio uses Amazon EC2 to quickly scale up and down based on demand, Amazon RDS to store game and current state information. They use Amazon CloudFront to optimize the delivery to a global, widely-distributed audience and to meet Facebook’s SSL certificate requirements.

At Funzio, we use AWS exclusively to host the infrastructure for our games. When developing social games, you need to be ready for that traffic burst for a hit game in a moment’s notice. AWS provides us with the flexibility to quickly and efficiently scale our applications at all layers, from increasing database capacity in RDS, to adding more application or caching servers within minutes in EC2. Amazon’s cloud services allow us to focus our efforts on developing quality games and not on worrying about managing our technology operations. – Ram Gudavalli, Funzio CTO.


50Cubes, the creator of Mall World, is a startup that has developed one of the most highly-regarded and longer-running successful female focused social game on Facebook. With over 5 million monthly active users, Mall World has a track record of being not only one of the first but also the top game of its kind for the past 1.5 years and continues to entice users world-wide.

50Cubes powers Mall World and other games they developed with a suite of AWS products. Out of these, they value the Amazon Auto-scaling and EBS features the most these products helps them effortlessly scale up and down their exclusive use of Amazon EC2 instances with user demand. Their database clusters are a mix of MySQL and other key value storage databases, all hosted and managed by the team on Amazon EC2 using EBS for Cloud Storage.

One thing that impresses me the most about AWS services is that they have rapidly iterated and improved their products and services over the past year and half, executing almost like a startup of our scale.” – Fred Jin, 50cubes CTO.

Get Started: Your Facebook App, Powered by AWS
Doug Purdy, Director of Developer Relations at Facebook, said:

AWS is great for Facebook developers you can start small, test and prove your ideas. As your app grows, you can easily scale up your resources to keep your users engaged and connected. AWS allows developers to build highly-available, highly-scalable, cost-efficient apps that provide the type of rich and responsive user experiences that our global audience has grown to expect.

To make it as easy as possible for you to get started, we’ve updated our Building Facebook Apps on AWS page. We have also improved and refreshed our Facebook App AMI. The new AMI uses AWS CloudFormation to install the latest versions of the Facebook PHP SDK and the AWS SDK for PHP at startup time. If you want to learn more about developing AWS applications in PHP, feel free to check out the free chapters of my AWS programming book (or buy a complete copy).

— Jeff;