Games

Animation Curves, the ultimate design lever

The row of spheres in the image above was created by positioning a sequence of Rigidbodies in a row and constraining their X and Z Freeze Position properties. An upward force was then applied using an Animation Curve based on the compression upward force, but with different curves for each sphere, positioned side-by-side for better visualization. You can use this technique to find the desired level of bounce for an object, or to tweak existing bounce to balance out characteristics. As a designer, being able to manipulate the characteristics of the upward force can help you create abstractions of more complex functions. Curves are a powerful XY chart data type, and though not technically perfect, they can help you prototype speedy damping solutions that can be visually edited in the Inspector and saved as presets at runtime. In this blog on the art of damping, Alexis Bacot highlights all the things that “depend on good damping. Camera, animation, movement, color gradients, UI transitions, and many many more… it’s used everywhere! Understanding damping is key to achieving great polish. Damping alone can make the difference between a bad or good experience.” In the same post, he demonstrates how Unity’s SmoothDamp can be used to create a beautiful ease in and out, and reacts to the target changing accurately. But it does not bounce like an “advanced spring damper that can oscillate, which is great for car suspension or fake ball physics” – an example of where Animation Curves provide a powerful advantage. Of course, curves have more uses than as an XY data type to manipulate gameplay. They can also be treated as an evaluation tool to capture data visually using AddKey via the Unity API. For evaluating a position over time, such as damping in the vehicle suspension example, or the falling spheres, use AddKey(elapsedTime, currentSpringCompression) in a method, and then call that method and pass captureResolution as the repeating rate via InvokeRepeating. A capture resolution of 0.1f means that, at every 0.1s, a key is added to the curve. View the mini result in the Inspector, or open the graph up to see the complete data.

Read More

How to create player-centric game economies

Having a firm grasp on the resources, currencies, sources, and sinks in your game is a great start to building a healthy economy, but understanding what behaviors exist within your player base will allow you to tailor your reward and progression design choices.  In this guide, we’ll dive into how you can design your economy around different types of players through the following topics: Payer vs. non-payers Different levels of engagement Player motivations Planning your player journey Using A/B testing to improve your in-game economy Learn about our suggestions for each player type and the variables you should test in Designing a balanced in-game economy. By developing a strong understanding of sources and sinks, currency and resource management, as well as the various types of players of your game, you’ll be fully equipped to create a healthy in-game economy that can drive player engagement.  Start learning today in the first of our introduction to economy series: What is an in-game economy, or skip to Building an in-game economy and Designing a balanced in-game economy. If you want to get started building your own game economy, Economy from Unity Gaming Services has everything you need to design and manage it. If you feel you’re ready for A/B testing, Remote Config lets you run different tests that target specific player segments without code changes or app updates.

Read More

Build your live game in a single modular platform with Unity Gaming Services

Let’s start with building your foundation. Building backend and multiplayer infrastructure early in production is vital for our developers – like InnerSloth, Riot Games, and Fika Productions. Pick what your game needs from multiplayer tools, player data management, and in-game content publishing.  Managing accounts Authentication, currently installed in more than 4,000 projects, allows you to assign an account to players and attach to them all the data generated by the backend products. Cloud Save lets you track and store player data including abilities, statistics, and more, enabling cross-device accounts for your players – the service saw over 14 million API calls over beta.  “Having the ability to link Economy and Authentication in one place to achieve synchronization across devices was literally a game changer for us.” – Mike Hardy, Lead Game Designer and UI Engineer, Line Drift Enabling multiplayer Lobby enables players to come together in either private or public lobbies before joining into the core game session. Lobby is already supporting over 400 unique game projects, including both in-development and live games. Relay enables developers to build peer-to-peer games without needing to tackle the complexities of dedicated game server hosting. Relay ensures security and privacy by never requiring IPs to be shared and encrypting all game traffic with DTLS. In addition, Relay can be set up with Netcode for GameObjects (beta) for small scale co-op projects, and works out-of-the-box with Unity’s Lobby service. Today, Relay is powering more than 2,500 unique game projects. 

Read More

How to A/B test game difficulty with UGS Use Cases

Perfecting your game’s design can be difficult when you can’t see how your players interact with it. By doing A/B testing, you can make design decisions based on how your players really play the game. The Unity Gaming Services (UGS) Use Cases are a collection of samples that implement typical backend game use cases and game design elements, show how to resolve specific development tasks, and highlight the efficiency you can achieve in your game backend by integrating different UGS packages in your project. One of these samples is about A/B Testing.This lets you segment players into multiple test groups in order to determine which version of a specific game element is the most engaging or intuitive to your players. The example we show is testing the amount of XP required for leveling up. This particular example is suited for something like alpha playtesting of a single-player game. But this is just one example, and there are many potential uses for A/B testing with UGS, even in published or multiplayer games.

Read More

Expanding the robotics toolbox: Physics changes in Unity 2022.1

Rigidbody uses both interpolation and extrapolation to give an impression of smooth motion while simulating at a comparatively low frequency. Internally, this is implemented by calculating the transform poses every update. In the case of interpolation, the last two simulated poses are used to calculate a new transform pose for this frame. In the case of extrapolation, the last simulated pose and velocity are used instead. Since it is designed to be lightweight, however, we don’t communicate these poses back to the physics engine. The poses are only presented to the systems outside of physics (e.g., graphics and animation). Because of that, for instance, a raycast won’t detect a body at the interpolated pose.  To keep physics from noticing the transform changes, the mechanism was to have a Physics.SyncTransforms() call each update right before pose write, followed by an internal method call to clear all transform updates for physics. That caused two classes of problems: If a scene has at least one interpolated body, all the transform changes to all the physics components were synced with the physics engine each update (even though they’re mostly needed once per FixedUpdate); and If a change was made to a transform that had a Rigidbody component with interpolation on it, interpolation for this object broke because the user-made transform change was propagated to the physics engine and effectively changed the last simulated pose (the pose is not stored separately – it’s just the pose that the physics engine uses currently). To address these problems, we updated the interpolation code so that it doesn’t need to sync all transforms for each frame. This change also improves performance; the new interpolation code runs faster than before (depending on the scene complexity).

Read More

Get Jurassic with Loady Dungeons: The new UGS sample game

Addressables The Addressable Asset System provides an easy way to load assets by “address”. It handles asset management overhead by simplifying content pack creation and deployment. The Addressable Asset System uses asynchronous loading to support loading from any location with any collection of dependencies. Whether you are using direct references, traditional asset bundles, or resource folders, addressable assets provide a simpler way to make your game more dynamic. Loady Dungeons utilizes the addressables package to handle the asynchronous dynamic referencing of different scenes and hats, which is necessary for CCD to provide the online models and textures, as opposed to a fixed reference that requires a local version of the AssetBundles in order for the game to function. Cloud Content Delivery Built for game development, Cloud Content Delivery (CCD) is an end-to-end service for live game updates combining powerful asset management, cloud storage, and a reliable content delivery network (CDN). CCD allows us to implement new levels or hats for our main character on the fly and host that data on the cloud. This means users won’t have to deal with the increased install size of all the scenes and hats available downloaded locally to their device.  Only when the game requires that content does it get loaded dynamically and delivered. This drastically reduces the pain points of bloated install sizes and patch download sizes, which is particularly useful for mobile devices. Cloud Content Delivery also enables developers to easily manage seasonal content – for example, the winter and Halloween levels in Loady Dungeons can be timed to only be available during certain times of the year.  Hats like the bunny ears could also be timed for spring, and once those periods are past, that timed content can be easily removed from the client to keep a smaller install size.

Read More

Our biggest e-book yet: 2D game art, animation, and lighting for artists

Unity’s suite of 2D tools provides creators with endless possibilities. This guide unpacks key decisions to tackle at the start of your project, as well as best practices for leveraging Unity’s 2D toolset. It’s specifically tailored to developers and artists with intermediate Unity experience who want to make high-end 2D games, independently or collaboratively with a team. The e-book was written by Jarek Majewski, a professional 2D artist, Unity developer, and creative director of our 2D demo, Dragon Crashers, together with input from several Unity 2D experts, such as Rus Scammell and Andy Touch.

Read More

Try out our battle pass sample using Unity Gaming Services Use Cases

For live games, especially multiplayer ones, the server should be the source of truth for most of the players’ data.  This prevents cheating tactics which may allow a player to have an advantage over another, or grant a player items or currencies that would otherwise need to be purchased or earned.  Similarly, in order for seasonal rewards or battle passes to be fair for all players, all data and decisions need to be managed server-side.  In the design of this battle pass sample, Cloud Code (beta) service does most of the heavy lifting in terms of handling the backend infrastructure. Cloud Code allows you to write and run your game logic away from the client. Other tools used in this sample include Cloud Save (beta), which allows you to store player data to the cloud. In this case, it allows the player’s season progress to be stored in a flat key-value system. A battle pass ownership flag for the current season is also stored with Cloud Save. Game Overrides (powered by Remote Config), which lets you create personalized in-game player experiences to determine the content of the current season and battle pass tiers. All of the tier rewards in the battle pass are either currencies or inventory items, which are all managed through Economy (beta). There is also one Purchase set up in Economy for exchanging gems for a battle pass. As with any game where player data is managed by an online back-end, each player will need to sign in to the game. For this, we’re using Authentication (beta). Once the user is signed in, all Unity Gaming Services SDKs will automatically know to send the player’s unique ID with every server request. Here’s how the sample works:  Seasonal reward configuration data is sent from Game Overrides to the client, and is also available in Cloud Code (read only). The game client will use this data to determine the UI. Cloud Code will use this data to determine which rewards to grant a player that claims a valid reward tier. Cloud Save is used to track the player’s progress through the reward tiers. The player will have an array of mutually exclusive tier states with three possible values: Locked, Unlocked, or Claimed. Cloud Save also stores a value indicating whether the player has purchased the battle pass for the current season.

Read More

Enter the Boss Room in 2022: Netcode for GameObjects, Relay, and Lobby

Boss Room is a multiplayer game, and as such, having a way to discover and join games is essential. Today, we have two options for players to find each-other and to connect to the game. The direct IP connection allows the users to connect to each other through their publicly exposed IP address. However, connecting to someone else’s computer is often not as straightforward as one would think due to computers being hidden behind NATs (network address translation devices) and routers.  Port forwarding can make it possible to create a connection, but it would still require the host to do extra work in order for other players to be able to connect. This solution also does nothing to facilitate game session discovery – players have to share the join information through out-of-game means. The upside is that this connection mode does not require internet connection and works in LAN environments.  However, Boss Room is a multiplayer experience that is meant to be also playable over the internet, with sessions that are easily discoverable and that don’t force the host players to perform port forwarding. This is where Unity Gaming Services come into play – a combination of Authentication, Lobby, and Relay is what allows us to make it easy for players to host and join games that are playable over the internet, without the need for port forwarding or out-of-game coordination. After integrating Authentication, Lobby, and Relay services into Boss Room, it became simpler to host and join games, cutting down on the need to do port forwarding and sharing the information needed to join a game externally.  Overall, it’s now a much smoother and quicker experience, which is nice in a sample and essential in a production game. Now let’s take a look at some of the learnings that we had!

Read More