Jump to content
  • Advertisement
  • 10/15/19 06:20 PM

    Unity
    Unity Addressables Hosting: Amazon S3 in 4 Steps

    General and Gameplay Programming

    Ruben Torres

    [The original post with its original format can be found here]

    Players want to play, they don't want to wait. Help them buying your game: reduce your game's download size with Unity Addressables Hosting. And a year later? Offer them a DLC based on, guess what? Addressables.

    Unity-Addressables-Hosting-Thumbnail.jpg

    Picture your potential player on a Friday afternoon.

    Your player has just left behind a hard week with long working hours. Their wife or husband is gone to their family's country house for the weekend along with the kids. The perfect time to go home, order pizza and browse through Steam with the wallet at hand.

    With or without kids, with or without partner, we all had these awesome weekends.

    Just videogames, please.

    Pizza-Laptop.jpg

    So your player comes across your newly released game in the Steam shop. They see all the effort you put into creating polished content.

    No need for convincing, they hand in their credit card details and buy two copies of your game. One for theirself, another for their friend / brother / sister.

    You get your 19.95 bucks, twice. Both users happily start installing the game.

    But wait...

    A wild Steam installation pop-up appears.

    Steam-Long-Remaining-Time.jpg

    The remaining installation time suddenly exploded to 12 hours

    What, 12 hours for over 30GB? What the #*@! is in this game?
    I'm not wasting my weekend on this shit, I'm out!

    What happens afterward is not uncommon.

    Your ex-player requests a full refund and purchase instead the next game in their wish-list.

    One of the pain points for players is the waiting time wasted on downloading all the bytes of the whole game and start playing. People do not have that much time. Nothing will burn a hole in your wallet faster than an angry player.

    Do you need to include in your installation package all these assets that are spawned in the level 5 of your game? Chances are, you don't.

    Players will need a couple of hours to play through the initial content of your game. Use that to your advantage

    The idea is simple.

    Provide the minimum content possible in your game installation package and download the rest while playing the initial levels of your game.

    Can you picture your player ready to play in a mere minute after purchasing your game? How different would the reviews be compared to the ones commonly found with huge games?

    Bad-Review-Space-5-150x20.jpg

    Bad-Review-Space-2-150x24.jpg

    Bad-Review-Space-1-150x24.jpg

    Bad-Review-Space-4-150x43.jpg

    Ideally, your game's download size should be below 100MB.

    But how?

    This is what you will get by the time you're done implementing the information of this article:

    • Ridiculously tiny installation sizes
    • A new Amazon S3 bucket to host your content online
    • Upload Unity Addressable Assets to S3 through the Unity Editor
    • Download the Unity Addressable Assets from the S3 bucket in your player builds
    • A high-five from your happy players

    Ralph-Simpsons.jpg

    Fox / Via mashable.com

    Level 1 Developer: "Storage is cheap, anyway"

    We started developing our game a few months ago and we have big plans for it.

    You and I worked endless hours into creating highly polished content.

    Not only that, we saw some great offers in the Unity Asset Store, so we bought several asset packs at heavily discounted prices.

    Now our game is full of content our players will love to play through. Those Sci-Fi modular parts, the exploding particle systems, the punchy soundtrack.

    It's all gorgeous. 

    And heavy.

    And slow to download.

    Now your Android APK is well over 2GB, so you need to start messing with expansion files, which adds another good week to your efforts. But it's fine, we all have time here.

    Or maybe you're publishing on Steam, so you can be at 30 GB, no problem. You just need a few hours for uploading it. And players? It's ok, people have a fast connection nowadays.

    So we released our game. Some players reported some bugs, so we make a 5-minute fix and we go through all the long process again. Build, wait for hours, upload to stores, wait for hours.

    And our players? They just re-download the whole thing again. Wait for hours, then start playing.

    It's not a big deal.

    Only that you are not recovering all the time you wasted on this previously. And a great deal of your players will stop downloading your game once they see how many hours they have to wait. That only gets worse with each update. Did I mention refunds?

    We can do better than this, now that we have the tools.

    Let's upgrade our skills to Level-2.

    459145-amazon-s3-logo.jpg

    Level 2 Developer: Unity Addressables Hosting

    Welcome to Unity Addressables.

    This package will allow you to efficiently manage your game assets. That, my friend, includes online distribution. For an introduction on this topic, visit my previous article on Unity Addressables Benefits for your game.

    These are the steps you and I will be following in the article:

    1. Set up an Amazon S3 Bucket for online distribution
    2. Mark our content as Unity Addressable Assets for online distribution
    3. Upload our content to the cloud
    4. Profit from tiny installation sizes (and others)

    Like granny said, a 2D sprite is worth a thousand times:

    Unity Addressables Hosting with Amazon S3 - Steps

    Unity Addressables Hosting with Amazon S3 - Steps

    Let's start with...

    1. Setting Up a Free Amazon S3 Bucket

    It's our lucky day. Amazon offers a free tier for their S3 service.

    That means, we're going to host our content for free. The limitations for their free tier is mostly storage space and the number data transfers. At the moment of writing this, you can store for free up 5GB and perform 20,000 GET and 2,000 PUT requests, but do double check it in the official site of AWS Free Tiers.

    What we are going to do here is to create an account for AWS so we are ready to upload our game content for further distribution.

    You and I will do this as fast as possible. No need to waste time in detail. No BS.

    Setting up Amazon S3 Hosting for Unity Addressables

    1.1. Create AWS account

    Navigate to the AWS Management Console and click on Create a Free Account.

    Create AWS account for Unity Addressables

    Enter your e-mail and bla bla bla. That will take you roughly a minute.

    Be aware that you'll need to give them your credit card info to verify your identity.

    1.2. Choose AWS Plan

    Unless you're going pro right from the start, we want to evaluate this in our game first.

    So, after confirming your account, choose the basic plan.

    Choose AWS basic account for Unity Addressables

    1.3. Create your first S3 bucket

    After a few minutes, your account will be activated (you'll get an e-mail). Then, sign in to your new console and open the S3 service panel:

    Find S3 Service

    You are now located at the S3 control panel.

     

    Now we are ready to create the bucket like shown below (change your bucket name and region!):

    S3 Bucket Creation

    AWS S3 - Creating Bucket Name (Step 1)

    AWS S3 - Creating Bucket Name (Step 2)

    Leave the permissions set to public for now, you'll have the chance to tweak them in the future.

    Your S3 bucket for Unity Addressables is now ready, congratulations!

    That was the most tedious step.

    The next step is a piece of cake: time to get your Unity Project to produce downloadable assets.

    Summary:

    • Use the AWS Management Console to create a Free Tier S3 Bucket
    • For starting, assign public permissions to your S3 Bucket
    • Alternatively, use another storage service based on the spreadsheet in the Resources Pack

    Unity Addressables - Build Player Content

    2. Unity Addressable Assets for Distribution

    Finally, we made it to Unity. That whole S3 process was getting old.

    I will assume you have some content marked as Addressable in your game. If that's not the case because you are new to this, don't worry, I have you covered with the previous Unity Addressables Tutorial I wrote.

    I'll show you the steps to get content uploaded in your newly created AWS S3 Bucket. We will do so based on a project I created for this purpose.

    Instead of following the whole story, you can also skip the line, get access to the code now and read later.

    Unity Addressables - Profile Settings

    Unity Addressables - Profile Settings

    A. Addressables Profile Configuration

    The way to start is to tell Unity where to load remote assets from.

    That we achieve by tweaking our Addressables Profile Configuration. In the Addressables main window, click on:

     Profile: Default → Inspect Profile Settings.

    This will redirect you to the settings we need to tweak.

    Here is a collection of funny toys you can play with, but for our purposes we just need to focus on the Profiles section.

    We want to make sure we set the Addressables RemoteLoadPath field to the correct URL.

    We form the RemoteLoadPath URL by concatenating our S3 Bucket URL with the Unity variable [BuildTarget], like below:

    The [BuildTarget] variable is left on purpose so Unity fetches in run-time the right assets for each of the platforms we build for. Android assets will be packed differently from Standalone, so each of these platforms will require a different directory.

    The way I found my S3 Bucket URL is by uploading a random file; if you then navigate to its details, you'll see the base URL of your file and hence your bucket.

    B. Addressable Asset Groups Configuration

    So, we just told Unity where to load the remote assets from through the RemoteLoadPath variable.

    Great. What is left is to tell which assets should be loaded remotely. Easy.

    1. Go over the heavy assets you want to be downloaded remotely and mark these Assets as Addressable. In our case, it's the skybox materials.
    2. Open the Unity Addressables Window and assign these assets to Addressable Asset Groups. If you are just starting with Addressables, assign them to a single group for now; e.g. Skyboxes. Eventually, you'll want them to be grouped in a way that makes sense (check my Level-3 guide on Unity Addressables Tutorial for more info).
    3. Navigate to the Addressables Group inspector settings by clicking on the group and make the following adjustments:
      1. BuildPath is set to RemoteBuildPath
      2. LoadPath is set to RemoteLoadPath

    You can see a graphical breakdown of this entire process below.

    Asset Groups for Unity Addressables Hosting

    Asset Groups for Unity Addressables Hosting

    Unity Addressable Asset Group Settings for Network Delivery

    Unity Addressable Asset Group Settings for Network Delivery

    We now have our skybox content assigned to a group that will be downloaded by your players in run-time.

    the-gamedev-guru-logo-me-transparent-sma Summary the-gamedev-guru-logo-me-transparent-sma

    • Set RemoteLoadPath to the base URL of your web hosting provider
    • Append the [BuildTarget] variable into RemoteLoadPath  to differentiate multiple platforms
    • Assign your Unity Addressable Assets to a group and tweak its settings to use the remote paths so it'll be downloaded from your web hosting provider

     

    Upload-150x89.jpg

    3. Uploading Content to Amazon S3

    All our settings are now in place. What about uploading our content to S3?

    This is a simple two-step process:

    1. Build player content.
    2. Upload it to S3.

    Building Addressables Player Content is straightforward. Open the Addressables main window and press the button that does just that. This will cook the assets for the current platform your editor is in. 

    Unity Addressables Tutorial: Level 2 - Build Player Content

    Unity Addressables: Build Player Content

    The output content will be stored in the path dictated by the RemoteBuildPath variable you happened to see early in the Unity Addressables Profile Settings. If you didn't modify it, it's likely to be in a subfolder of your project called ServerData.

    The second step involves navigating to that directory and dropping its contents into the website of your S3 bucket, as you can see just below:

    Unity-Addressable Assets - Uplaod to S3

    Unity-Addressable Assets - Upload to S3

    There you have it, it's that simple.

    However, this can quickly become tedious. It's a very manual task that could easily be automated. I did just that so now uploading all my assets takes the press of a button inside Unity Editor.

    To upload your Unity Addressable Assets directly from the Unity Editor, check my Unity Addressables Hosting Resource Pack at the end of the article.

    Unity Addressables Tutorial - Result Project

    4. Downloading Assets from Amazon S3

    This is the part we all were waiting for. You now have a game you can distribute that is significantly smaller. The remaining part is launching it and watching it download the assets on demand!

    If you want to make sure these assets are being effectively downloaded, delete the data from your S3 Bucket, disable the caching option in your Addressable Asset Group Settings, rebuild the content and your player. If you launch it, you should see a few error messages pop up, as you can see below.

    Unity Addressable Assets Download Error

    Unity Addressable Assets Download Error

    If you followed this tutorial on Unity Addressables Hosting, chances are, you will be totally alright

    By now, the asset groups you marked to be remotely downloaded are hosted in S3 and Unity knows how to fetch them.

     

    The Gamedev Guru's S3 Upload Tool

    The Gamedev Guru's S3 Upload Tool

    Level 3 Developer: Unity Addressables Hosting Resource Pack

    By now you should have your first Unity Addressables Hosting experiment up and running.

    You learned how to build player content specifically to target downloadable content.

    That's great, but there's more than just the basics. To help you further, I prepared a Free Unity Addressables Hosting Resource Pack just for you.  This bundle contains:

    • A spreadsheet comparing different hosting alternatives to the pricey S3
    • An extension to upload your Unity Addressable Asset to Amazon S3 directly from the Editor
    • The source code of this project; see it for yourself
    • Newsletter access with exclusive free content

    Level up your skills. Download your free Resource Pack now.

    Unity-Addressables-Hosting-Level-3-DVD.j

     

    Edited by Ruben Torres



      Report Article


    User Feedback


    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Advertisement
  • Advertisement
  • Latest Featured Articles

  • Featured Blogs

  • Advertisement
  • Popular Now

  • Similar Content

    • By joe123
      I'm a software engineer and i have entered game development field (Unity) for the last couple of months . I have made a couple of games on android using Unity that are only at concept stage now. And i mean by concept stage , that i'm focusing only currently on game play , not graphics and levels and anything else now. The games i have made are similar to (Color Switch) on mobile (The game has no levels , but gets harder with higher score or time). I'm making games with least resources now then decide which game i should focus on after getting feedback from users. I need guidance for the next steps that i should be doing. Like for example should i focus on one game and expand it ? Should i publish and market all of these games with their current state then get feedback with the best game then focus on it ? Should i use ASO (app store optimization) now  ....etc What i think i need is a game product manager , or an experienced indie game developer that can guide me what should i do for the next step. For anyone who has experienced a state similar to mine , can you share with us some knowledge about how to manage a game in means of marketing and everything else (not code related) ? To confirm my question , I'm not asking for example how to market my games , but i'm asking at which stage i should start marketing my games...etc I know answering this question could be big , but i need just some guide lines for now.
    • By khawk
      Lightstream, an innovator in cloud-native live streaming technology, today announced its IRL (In Real Life) plan for broadcasters who stream events from their phones or mobile live streaming setups. 
      Streaming out in the world away from a computer and without a strong internet connection can be a challenge. Lightstream’s new IRL plan provides capabilities that streamline setup time and gear required to produce a professional stream from any location, any device and any connection. 
      “Part of our mission at Lightstream has been to empower new creative possibilities and our new IRL streaming plan does just that,” says Stu Grubbs, CEO of Lightstream. “Lightstream Studio is powered by our cloud-native live video editing pipeline allowing creators to set up their production in advance, remotely control it, and have their streaming video automatically produced to their specifications from anywhere in the world while in-flight to their viewers.”
      With a Lightstream IRL plan, streamers set up their project and scenes via any browser-enabled device with their overlays, RTMP source and final channel destination. Broadcasting to Lightstream from any location will automatically layer on the media in that project on its way to their channel – whether that be Twitch, Mixer, YouTube, Facebook Live, or a custom destination. Similar to Lightstream’s unique integration with Xbox and Mixer, there is no need to have Lightstream Studio open in a browser window. 

      The new IRL Plan includes the following features:
      Customize with Overlays & Alerts
      Streamers can create multiple custom layouts, upload and position overlays, and use any integrated alerts service they prefer to easily personalize their mobile or IRL broadcast to better engage their audience.
      Auto Go Live
      Projects can be set to automatically start streaming to the broadcaster’s channel as soon as an incoming feed is detected.
      Auto BRB
      If connection is lost, the RTMP layer will go transparent until connection is re-established. Position an image directly behind your feed that will automatically appear to keep viewers updated.
      Disconnect Protection
      Lightstream Cloud will continue broadcasting and keeps the broadcaster’s channel live until signal is regained so the audience doesn’t leave.
       Remote Control
      Start, stop, and switch scenes on any mobile device.
      Stay Mobile with Headless Mode
      Go live without having Lightstream Studio open. Lightstream will automatically composite on your layers in the cloud.
      Max Quality & Duration Increase
      Stream at 720p 60 fps for up to 12 hours per broadcast.

      For more information and to sign up for the IRL Plan, please visit https://golightstream.com/irl.
      For more information about Lightstream and its products, please visit https://www.golightstream.com. Be sure to follow Lightstream on Twitter for the latest updates and community happenings.

      View full story
    • By khawk
      Lightstream, an innovator in cloud-native live streaming technology, today announced its IRL (In Real Life) plan for broadcasters who stream events from their phones or mobile live streaming setups. 
      Streaming out in the world away from a computer and without a strong internet connection can be a challenge. Lightstream’s new IRL plan provides capabilities that streamline setup time and gear required to produce a professional stream from any location, any device and any connection. 
      “Part of our mission at Lightstream has been to empower new creative possibilities and our new IRL streaming plan does just that,” says Stu Grubbs, CEO of Lightstream. “Lightstream Studio is powered by our cloud-native live video editing pipeline allowing creators to set up their production in advance, remotely control it, and have their streaming video automatically produced to their specifications from anywhere in the world while in-flight to their viewers.”
      With a Lightstream IRL plan, streamers set up their project and scenes via any browser-enabled device with their overlays, RTMP source and final channel destination. Broadcasting to Lightstream from any location will automatically layer on the media in that project on its way to their channel – whether that be Twitch, Mixer, YouTube, Facebook Live, or a custom destination. Similar to Lightstream’s unique integration with Xbox and Mixer, there is no need to have Lightstream Studio open in a browser window. 

      The new IRL Plan includes the following features:
      Customize with Overlays & Alerts
      Streamers can create multiple custom layouts, upload and position overlays, and use any integrated alerts service they prefer to easily personalize their mobile or IRL broadcast to better engage their audience.
      Auto Go Live
      Projects can be set to automatically start streaming to the broadcaster’s channel as soon as an incoming feed is detected.
      Auto BRB
      If connection is lost, the RTMP layer will go transparent until connection is re-established. Position an image directly behind your feed that will automatically appear to keep viewers updated.
      Disconnect Protection
      Lightstream Cloud will continue broadcasting and keeps the broadcaster’s channel live until signal is regained so the audience doesn’t leave.
       Remote Control
      Start, stop, and switch scenes on any mobile device.
      Stay Mobile with Headless Mode
      Go live without having Lightstream Studio open. Lightstream will automatically composite on your layers in the cloud.
      Max Quality & Duration Increase
      Stream at 720p 60 fps for up to 12 hours per broadcast.

      For more information and to sign up for the IRL Plan, please visit https://golightstream.com/irl.
      For more information about Lightstream and its products, please visit https://www.golightstream.com. Be sure to follow Lightstream on Twitter for the latest updates and community happenings.
    • By Conny
      STEAM WISHLIST LINK || HAYFEVER WEBSITE
      RELEASE IN: First Quarter of 2020

      About Hayfever

      Help Thomas the allergic mailman gather all his lost letters! In Hayfever, the player takes control of Thomas; a young postman with a strong sense of pride in his work. There is just one tiny little issue; Thomas suffers from terrible (and we mean TERRIBLE) allergies.
      His allergies are so strong in fact, that when Thomas was delivering his daily mail, disaster struck. A massive sneeze sent Thomas flying, and in the process, he lost all his letters! Thomas’ boss Harvey is an ill-tempered little monster of a man. And it is up to the player to help Thomas avoid his wrath by collecting all his lost mail. Together with his friend Carlie, Thomas will venture on an epic journey that spans the entire year, taking him through each of the four seasons.
      It is up to the player to use his allergies to help him traverse the dangerous world, turning Thomas’ weaknesses into strengths! Different allergens have different effects on Thomas - radically changing how he interacts with the world.
      Regular pollen allows him to build up a big sneeze to propel himself through the air. Smog, on the other hand, makes him swell up like a balloon. Peanuts… Well, peanuts are a WHOLE other story.
      About the Development & the Team

      The game was mainly made by two people, Jonas Roininen and myself (Conny Nordlund. We've been teaming up with Kristoffer Engman (aka Knasibas) for music, Pablo Sorribes Bernhard for sound, and Filip Andersson for tools programming. We are currently at the home stretch with porting the game. We're sending it off to certification in two weeks (fingers crossed!)
      The game has been in development for little over two years. I've been working on the game at night after work and Jonas has been on it full time for about a year. The journey has been really tough but also extremely exciting!
      This has been our first game together. We have previous experience with game development but this was our first go at making something from the ground up together.. and actually finishing it. It all started with an extended game jam where we gave ourselves two weeks to finish something polished, worthy of actually pitching and showing off. Once we were done, we started showing the game at local places and quickly realized that kids loved the game.

      So to try and make a long story short. We worked our butts off and we ended up pitching the game everywhere we got the chance to. We also entered every competition we could find. One of these competitions, we ended up getting first price and was awarded a booth at Gamescom 2018. We later got third place in Big Indie Pitch and was a Semi Finalist at Tencent's Game Without Borders. After all of this commotion, we bumped into a new publisher called Zordix. They loved the game and are now bringing the game to consoles.
      If you have any questions about the game or the development, I'd be happy to answer. 
      Hope you check the game out, I'll post another topic when the game releases It will be on consoles at the same time as the PC release.
       
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!