<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Improbable Engineering - Medium]]></title>
        <description><![CDATA[How we’re building the future — and other stories. - Medium]]></description>
        <link>https://medium.com/improbable-engineering?source=rss----86a5bdd78a4b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Improbable Engineering - Medium</title>
            <link>https://medium.com/improbable-engineering?source=rss----86a5bdd78a4b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 11:06:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/improbable-engineering" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Thinking spatially: using dynamic interest management to create revolutionary game designs.]]></title>
            <link>https://medium.com/improbable-engineering/thinking-spatially-using-dynamic-interest-management-to-create-revolutionary-game-designs-80ed0fe7693?source=rss----86a5bdd78a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/80ed0fe7693</guid>
            <category><![CDATA[improbable]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[spatialos]]></category>
            <category><![CDATA[interest-management]]></category>
            <dc:creator><![CDATA[Dan Griliopoulos]]></dc:creator>
            <pubDate>Fri, 01 Feb 2019 14:38:07 GMT</pubDate>
            <atom:updated>2019-02-04T17:43:27.794Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LAWq7BJPVb2qoeNU1nZ0TA.jpeg" /></figure><p>In multiplayer games of all kinds, it’s important for technical designers to consider the data load on the server, network and client. To avoid replicating all data across each server and client, designers establish areas of interest for each — and put in place interest management systems. With SpatialOS, where there can be multiple servers managing different elements of the simulation, effective interest management is critical.</p><p>Yet, with earlier versions of SpatialOS, there was very little flexibility to control what each client saw — what data was streamed to it. Each client had interest in regions of a SpatialOS world that was tied tightly to a square grid overlaid on that world. Everything was measured in terms of squares on this grid — what we call ‘chunks’. This interest region was fixed. And the interest region was the same for all participants in the world.</p><p>With <a href="https://docs.improbable.io/reference/latest/releases/upgrade-guides/upgrade-runtime">the new Runtime</a>, all that’s changed. We now support a whole range of types of interest for each worker, which we call query-based interest (QBI). This allows developers to specify a subset of entities or components in the world, selected by proximity to locations or through a query, that are relevant to the client’s current need. For example, a developer might specify that only entities that have a health component and are within fifty feet of the player are displayed on a client’s mini-map.</p><p>We should make it clear, though, that the initial release of the new Runtime won’t have all these interest management elements straight away — we’re going to unlock them over time.</p><p>Let’s walk through a longer design example, so you can see what has changed and what will be unlocked one day soon.</p><h3>Design Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*EViqKzNZo6G0WQ-5" /></figure><p>So, your player’s character is in a multiplayer world. Currently, they’re working hard on a small physics puzzle on an in-game tabletop. Their friend is also in-game, crafting an item in the next room. In this example, all the objects in the world are constituted of entities, which themselves are made up of components that describe their different characteristics. These are changing frequently, and the player’s interest is only in their immediate surroundings.</p><p>By setting a high fidelity of interest with a very short area for this local environment, we can make it so that each player’s simulation can be updated from the server frequently enough to maintain the simulation, without overloading the Runtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*990KiuYuGF2QT-rB" /></figure><h3>Distant and wide.</h3><p>Now, let’s say the player finishes playing with their puzzle and walks out onto a balcony. We reveal that they’re at the top of a tall tower, looking over some woodland.</p><p>Here, their client only needs low fidelity updates for objects they can see but not interact with. The developer can set more distant environments to have lower fidelity updates for a large set of entity components — so everything that should be visible is, but its canonical position and relevant status (health, etc) is updated less frequently.</p><p>You could also do other interesting things with this. For example, when a player equips a weapon, you could set this to trigger the player client to start receiving updates about the health of nearby creatures. This could even be a <em>dynamic </em>change, added to the Runtime whilst the game was live — something that only SpatialOS allows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*8j9M6fhjVdXSgAX4" /></figure><h3>Distant but relevant.</h3><p>Now our player finishes admiring the scenery and walks around the tower’s top, revealing that it’s a lighthouse, overlooking the ocean. They walk over to a telescope fixed to the railing and scan the distant sea, looking at ships, mermaids, islands and seagulls. Sailors on one ship spot the telltale glint of the spyglass, and wave at the lighthouse. The player sees them and waves back.</p><p>Using our previous Runtime, this example would have been prohibitively resource-hungry and impossible without very clever design — players would need to have interest in every chunk, not only in the direction of their view but also in a large cube extending equally all around themselves.</p><p>With Query-Based Interest, the developer can allow players to not only see distant objects but also have them interact so that the distant sailor’s interest also extends to the glinting telescope.</p><p>In more violent games, one can imagine a developer using QBI like this to build sniper rifle or archery functionality over long distances, or in situations where the player needs high fidelity updates at distance, but without needing any updates on the intervening space.</p><p>Ideally, this would be done as an extended cuboid, so the player’s view could be blocked by intervening objects, but in this case (where the player is high enough that objects can’t intervene) a distant circle could also do the job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*a_1JI5uvfNZ-wWIM" /></figure><h3>Universal relevance.</h3><p>Now our player shifts their view up to the horizon and is met with a surprise. The distant sky brightens as a tiny, very distant island erupts into a volcano, and starts throwing rocks and pumice into the air. As smoke and ash fill the sky, it gets dark and cold, fast.</p><p>Objects like this are relevant to everyone in the simulation — in a traditional game, the developer would have to find some way of working around or faking this. Here, the client’s interest would be defined by a very large radius, very low fidelity query. This could also be used for objects like mountains (to block lines of sight and fire), large visible events (like thunderstorms or nuclear strikes), or simply for key data, like the location of a control point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*7yfDaILejzIdoby3" /></figure><h3>Non-spatial data queries</h3><p>The player, terrified as rocks start to rain down from the sky, heads back into the lighthouse to warn their friend — but they’ve left their room and they’re not responding to in-game messages. Have they logged off? The player goes into their guild menu and looks at their friend’s data — they’re online and still in the same area as them.</p><p>Here a guild is treated as a special QBI data query that’s not linked to any location. The game logic here has medium fidelity updates over a set of entities that could be anywhere in the game world, defined by the game logic and design for a particular set of their components — rank, level, location, and whether they’re online, say. It might also list metadata about the world, like the guild’s wealth, player hierarchies, and leaderboards.</p><p>The player pulls up their mini-map to find them. To save on bandwidth, the mini-map only takes updates from a small set of components on each player and NPC entity — faction and position, say — in a medium radius around the player, but updates both regularly.</p><p>This tells the player that their friend is motionless at the bottom of the tower. They add them to a team, to see their health. Like the guild, a team is defined by game logic to have a limited selection of rapidly-changing components on a small set of entities, but they’re updated more quickly.</p><p>The player quickly sees that their friend is injured and unconscious, which means their in-game communications have been disabled by design. And their health is dropping quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*QQIK-k6y5kUdI1aC" /></figure><h3>Stealth and anti-cheating</h3><p>The player rushes downstairs to heal their friend. When they get there, they see the problem. An enemy player fleeing the volcano has entered the area, attacked their friend and knocked them out, and is still standing over them. The player goes into a stealth mode to get close to their friend.</p><p>Now, for the enemy player, the original player has been excluded from interest — they don’t feature in their client-side high-fidelity local game logic whilst they’re in stealth. This is to prevent the other player cheating by hacking his client — the client doesn’t have the information and can’t request it, so hacking it would be of no use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*8ZG6syN25lqfDpcn" /></figure><h3>Moving between areas</h3><p>Whilst in stealth, the player quietly casts a town portal spell, to get their injured friend back to a safe place. Once the portal is summoned, they peer into it and see that the entities there are all passive and friendly.</p><p>Here, we have something like the telescope example before, but where the player has interest over a small area <em>anywhere </em>in the world. The summoning time allows the player client to preload the entities, components and local assets for the new area. When they’re looking through the portal, the player receives medium fidelity updates about entities in the area, enabling them to interact in a minimal fashion. Developers could make vision through this portal two-way or one-way, or restrict which components are relevant, to further reduce load.</p><p>The player pulls their wounded friend through the portal, before shutting it. Now they can heal them in peace.</p><h3>QBI and the future</h3><p>To reiterate, this is where we’re heading with our QBI technology — some of these designs are possible today, others will be possible in the future.</p><p>If you want to start experimenting today, you can sign up for SpatialOS now. We’ll be releasing the alpha for our QBI system soon.</p><p><a href="https://improbable.io/get-spatialos">Sign up now.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80ed0fe7693" width="1" height="1" alt=""><hr><p><a href="https://medium.com/improbable-engineering/thinking-spatially-using-dynamic-interest-management-to-create-revolutionary-game-designs-80ed0fe7693">Thinking spatially: using dynamic interest management to create revolutionary game designs.</a> was originally published in <a href="https://medium.com/improbable-engineering">Improbable Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ask the Unity expert: choosing between the ECS and MonoBehaviours workflows.]]></title>
            <link>https://medium.com/improbable-engineering/ask-the-unity-expert-choosing-between-the-ecs-and-monobehaviours-workflows-36d70f89b407?source=rss----86a5bdd78a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/36d70f89b407</guid>
            <category><![CDATA[spatialos]]></category>
            <category><![CDATA[ec]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[unity]]></category>
            <dc:creator><![CDATA[Oliver Balaam]]></dc:creator>
            <pubDate>Fri, 01 Feb 2019 14:34:22 GMT</pubDate>
            <atom:updated>2019-02-01T14:34:22.896Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In this, the second in a series of posts on the topic, we’ll compare the ECS and MonoBehaviours workflows in the context of the </em><a href="https://improbable.io/games/spatialos-gdk-unity"><em>SpatialOS Game Development Kit (GDK) for Unity</em></a><em> and explore what they can do for your game.</em></p><p>As we explained in <a href="https://medium.com/improbable-engineering/ask-the-unity-expert-what-is-the-ecs-37616ae375ef">our first blog</a> about Unity’s Entity Component System, the GDK offers two workflow options:</p><ol><li>A MonoBehaviour-centric workflow that works with Unity’s fully developed MonoBehaviour tooling, workflow and APIs.</li><li>An ECS workflow that takes full advantage of the new ECS development paradigm and associated performance improvements.</li></ol><p>The <a href="https://github.com/spatialos/gdk-for-unity">SpatialOS Game Development Kit (GDK) for Unity</a> is built on this ECS. But, before we get into the detail of that, it’s important to remember that these workflows are not mutually exclusive. Most Unity game developers working with SpatialOS get started using MonoBehaviour-centric workflow, and then optimise their game with the ECS workflow. Whichever approach you choose, your game will still take advantage of the GDK <a href="https://docs.improbable.io/unity/alpha/content/modules/core-and-feature-module-overview">core module</a> that we’ve written using the ECS.</p><h3>The benefits of ECS</h3><p>In the <a href="https://medium.com/improbable-engineering/ask-the-unity-expert-what-is-the-ecs-37616ae375ef">previous post</a>, we outlined the main performance benefits of ECS. Let’s look in detail at how each of these performance benefits is achieved.</p><h3>“Code generated by ECS performs significantly fewer jumps between <a href="https://en.wikipedia.org/wiki/Memory_address">memory addresses</a> than code generated by MonoBehaviours.”</h3><p>You can avoid jumping between memory addresses by storing the bytes you want to operate on contiguously in the same chunk of memory. As a case study in how Unity’s ECS induces a memory layout that achieves this, let’s imagine a health <a href="https://docs.improbable.io/unity/latest/content/glossary#unity-ecs-system">system</a> that subtracts the value of a damage <a href="https://docs.improbable.io/unity/latest/content/glossary#unity-ecs-component">component</a> from a health component every <a href="https://docs.improbable.io/unity/latest/content/glossary#update-loop">update loop</a>:</p><p>Unity’s ECS categorises every unique combination of component types that appear in an <a href="https://docs.improbable.io/unity/latest/content/glossary#unity-ecs-entity">entity</a> into <a href="https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/Documentation/content/two_stick_shooter.md#archetypes">archetypes</a>. The ECS dynamically defines archetypes at runtime so it can categorise new combinations of components as they appear. One unique combination that will be defined as an archetype is health and damage. Another is, for example, health, damage and mana.</p><p>Once categorised as an archetype, all health and damage components that exist on entities with no other components will be stored in the same chunk. Similarly, all isolated instances of health, damage and mana will be stored in one chunk. The only exception to this is if there are more entities than a chunk can hold, in which case they will overflow into the next chunk.</p><p>When the ECS iterates over components, the memory access of components within a chunk is always completely linear. This results in all of the components that our health system needs to operate on being stored in a relatively small number of chunks, and being stored contiguously within those chunks. This necessitates fewer memory jumps.</p><h3>“Additionally, the memory layout induced by the ECS allows for further code optimisations that leverage <a href="https://en.wikipedia.org/wiki/Cache_prefetching">cache prefetching</a>”</h3><p>Chunks generated by Unity’s ECS contain tightly packed and contiguous data. This layout, as opposed to the sparsely allocated heap memory generated by the MonoBehaviour-centric workflow, makes it easier for the CPU’s hardware prefetcher to predict and fetch the right objects in anticipation of needing them.</p><p>Unity’s ECS is able to induce this memory layout because components are represented in memory as <a href="https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types">blittable types</a>. Blittable types are data types that have an identical presentation (meaning they take up the same number of bytes) in memory for both managed and unmanaged code. Using these, the ECS can write blittable types into a chunk until that chunk is full, then move immediately onto the next, tightly packing each one.</p><h3>“By decoupling data (entities and components) and logic (systems), the ECS also produces more modular, easy-to-read code.”</h3><p>The structure of Unity’s ECS encourages a cleaner codebase. Its modular design leads you to write modular code that’s easy-to-read, reuse and refactor. As well as being easy to maintain, this conceptually mirrors the core concepts of SpatialOS (<a href="https://docs.improbable.io/unity/latest/content/glossary#spatialos-entity">SpatialOS entities</a>, <a href="https://docs.improbable.io/unity/latest/content/glossary#spatialos-component">SpatialOS components</a>, and the <a href="https://docs.improbable.io/unity/latest/content/glossary#worker">workers</a> that operate on them), making it a perfect fit for our GDK.</p><p>The diagram below portrays an ECS <a href="https://docs.improbable.io/unity/latest/content/glossary#unity-ecs-world">world</a>. A world is a set of entities and systems; an entity is a set of components, and systems act in bulk on entities and their components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*BKCum94wACcSbAS5" /></figure><p>A world constructed using Unity’s ECS.</p><p>The snippet below is a very basic example of an ECS component. You can see more complex examples <a href="https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/Documentation/content/getting_started.md#pure-ecs-full-on-performance---icomponentdata--jobs">here</a>.</p><pre>public struct MyComponent : IComponentData<br>{<br>    public int myValue;<br>}</pre><h3>The current drawbacks of ECS</h3><p>Unity’s ECS replaces GameObjects with entities and MonoBehaviours with a combination of components (to store data) and systems (to operate on that data). It also does away with the concept of Scenes in favour of worlds, which are much more lightweight, consisting of a set of entities, and a set of systems that operate on those entities.</p><p>While these changes unlock the benefits listed above, Unity is currently designed with GameObject and MonoBehaviour-centric workflow in mind. This means numerous features that used to work out of the box (physics, audio and rendering systems) require more engineering to work if you’re only using ECS. This will be the case until Unity adapts or replaces these systems for use with ECS, which they are committed to doing.</p><p>This is why we’ve built the GDK to support both workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nMC6rqXJbSKeri22YK2CUg.png" /></figure><p>Our 200-player FPS Starter Project was written exclusively using the MonoBehaviour-centric workflow.</p><h3>The MonoBehaviour-centric workflow</h3><p>The main benefit of the MonoBehaviour-centric workflow is that, as a Unity developer, you already know how to use it. You can use all of the tools, concepts and built-in systems (e.g: physics, audio and rendering) that you’re used to.</p><p>The main drawback of the MonoBehaviour-centric workflow is that the code it produces is outperformed by ECS code. That said, all games build on the GDK utilize the GDK core module, which we’ve written using the ECS. This means that you’ll enjoy some ECS induced performance gains even if you don’t write any ECS code yourself.</p><p>The GDK also comes with a number of feature modules. Feature modules are optional features that you can choose to include or exclude from your game (player lifecycle, for example). They are intended both to give you a head-start in the development of your game, and act as reference material for best practices to use when writing your own features. Feature modules are written using whichever workflow is best suited for that particular feature, and like all of the GDK, the code is publicly available and fully customisable to meet the exact needs of your game.</p><p>You can make previously impossible games with the MonoBehaviours on the GDK, as evidenced by our 200-player FPS Starter Project, which was written exclusively using the MonoBehaviour-centric workflow.</p><h3>Resources</h3><p>Here are some resources to get you started with Unity’s ECS and Improbable’s SpatialOS GDK for Unity.</p><ul><li><a href="https://software.intel.com/en-us/articles/get-started-with-the-unity-entity-component-system-ecs-c-sharp-job-system-and-burst-compiler#inpage-nav-1">Get Started with Unity’s ECS: Gaining Speed with Cache Prefetching</a></li><li><a href="https://github.com/Unity-Technologies/EntityComponentSystemSamples">Unity’s ECS samples repository</a></li><li><a href="https://docs.improbable.io/unity/latest/get-started">Get Started with the SpatialOS GDK for Unity</a></li><li><a href="https://docs.improbable.io/unity/latest/content/intro-workflows-spatialos-entities#gameobjects-and-spatialos-entities">GDK Workflows: MonoBehaviour or ECS workflow</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36d70f89b407" width="1" height="1" alt=""><hr><p><a href="https://medium.com/improbable-engineering/ask-the-unity-expert-choosing-between-the-ecs-and-monobehaviours-workflows-36d70f89b407">Ask the Unity expert: choosing between the ECS and MonoBehaviours workflows.</a> was originally published in <a href="https://medium.com/improbable-engineering">Improbable Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ask the Unity expert: what is the ECS?]]></title>
            <link>https://medium.com/improbable-engineering/ask-the-unity-expert-what-is-the-ecs-37616ae375ef?source=rss----86a5bdd78a4b---4</link>
            <guid isPermaLink="false">https://medium.com/p/37616ae375ef</guid>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[spatialos]]></category>
            <category><![CDATA[ec]]></category>
            <category><![CDATA[unity]]></category>
            <dc:creator><![CDATA[Oliver Balaam]]></dc:creator>
            <pubDate>Wed, 07 Nov 2018 14:27:13 GMT</pubDate>
            <atom:updated>2018-11-07T14:23:31.288Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In this, the first in a series of posts on the topic, we’ll explain what Unity’s ECS is and what it can do for your game.</em></p><p>The <a href="https://unity3d.com/unity/features/job-system-ECS">headline</a> benefit of Unity’s ECS is performance-by-default. To achieve this, ECS moves away from traditional <a href="https://en.wikipedia.org/wiki/Object-oriented_programming">object-oriented programming</a> (that is, the GameObject and MonoBehaviour centred workflow that most Unity developers are familiar with), and towards <a href="https://en.wikipedia.org/wiki/Data-oriented_design">data-oriented design</a>. To demonstrate their differences, let’s compare how you build an object representing the player character with each approach:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*ghL3zh9enQ9_Rn2GkXa8_w.png" /><figcaption>A traditional object-oriented workflow.</figcaption></figure><p>Using object-oriented programming, you’d create a <em>GameObject</em> to represent the player character, then attach <em>MonoBehaviours </em>to give the <em>GameObject </em>functionality such as a player controller, health and physics attributes. These <em>MonoBehaviours </em>contain both the data (such as hit points) and the code that modifies that data (decrementing hit points when the player takes damage for instance).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*Av7mvsbSdeJGe7jWgTe4qQ.png" /></figure><p>Using data-oriented design, you’d create an <em>entity</em> to represent the player character, then attach <em>components</em> to store data. <a href="https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/Documentation/content/ecs_in_detail.md#icomponentdata"><em>ECS components</em></a> should not be confused with <a href="https://docs.unity3d.com/Manual/Components.html"><em>GameObject</em> components</a>, such as <em>MonoBehaviours</em>. Unlike <em>GameObject</em> components, <em>ECS components </em>don’t contain any logic, they <strong>only </strong>store data. The code we use to perform operations on <em>entities </em>and their <em>components</em> exist in the form of <em>systems</em>. S<em>ystems</em> are scripts. They act, in bulk, on all of the <em>entities </em>and <em>components </em>in the world.</p><p>To continue our previous example of decrementing hit points, a system would group all entities that have health and damage components and decrement the affected components accordingly.</p><h3>What are the benefits of the ECS?</h3><p>The memory layout of data-oriented design ensures that the code generated by ECS performs significantly fewer jumps between <a href="https://en.wikipedia.org/wiki/Memory_address">memory addresses</a> than traditional object-oriented programming.</p><p>Additionally, the memory layout induced by ECS allows for further code optimisations that leverage <a href="https://en.wikipedia.org/wiki/Cache_prefetching">cache prefetching</a>, the process your CPU uses to ensure it has the next bit of data already loaded into the cache by the time it needs it. The Unity ECS paradigm does this by using equally sized chunks of components that can be iterated over linearly. Rather than dealing with randomly stored objects of various sizes, the CPU only has to deal with these uniformly sized chunks stored linearly in the same area of memory. This makes the CPU’s job easier, a bit like playing Tetris with 1×1 blocks.</p><p>By decoupling data (entities and components) and logic (systems), the ECS also produces more modular, easy-to-read code. This particularly interests me as a developer working on Improbable’s <a href="https://github.com/spatialos/UnityGDK">SpatialOS Game Development Kit (GDK) for Unity</a>, which is built on Unity’s ECS. The ECS conceptually mirrors the core concepts of SpatialOS (<a href="https://docs.improbable.io/reference/latest/shared/concepts/entities">entities</a>, <a href="https://docs.improbable.io/reference/latest/shared/concepts/entities#components">components</a>, and the <a href="https://docs.improbable.io/reference/latest/shared/concepts/workers">workers</a> that operate on them), making it a perfect fit for the SpatialOS GDK.</p><h3>Why isn’t everyone using the ECS?</h3><p>With all of these benefits, you might be wondering: why isn’t everyone using ECS? Firstly, ECS isn’t for everyone. At Improbable, we’re excited by it because it suits the massive, richly populated and persistent games that SpatialOS enables, but some games (turn-based strategy games for instance) simply don’t require this level of performance.</p><p>Secondly, ECS is still at an experimental stage of development. Most of Unity’s existing tooling and systems are still only designed to be used with <em>GameObjects </em>and <em>MonoBehaviours</em>.</p><h3>ECS and MonoBehaviour workflows for SpatialOS</h3><p>To alleviate these pain points, the SpatialOS GDK for Unity offers two workflow options:</p><ol><li>A MonoBehaviour-centric workflow that works with Unity’s fully developed MonoBehaviour tooling, workflow and APIs.</li><li>An ECS workflow that takes advantage of the ECS development paradigm and associated performance improvements.</li></ol><p>Crucially, these workflows are not mutually exclusive. Given the current lack of tooling around ECS, we anticipate that you’ll write most or all of your game using <em>MonoBehaviours</em>. Whichever workflow you choose, your game will still take advantage of the performant GDK core module, which we’ve written using the ECS. Our goal is to bring you the benefits of ECS as early as possible, by means of our own API and abstraction layer. This approach will shelter you from most of the breaking changes that Unity makes to their ECS, so you can focus on writing your game however you’d like to.</p><p>In the next post, we’ll explore both workflows in detail, and examine code examples of each. Until then, here are some more resources on Unity’s ECS and Improbable’s SpatialOS GDK for Unity.</p><h4>ECS resource list</h4><ul><li><a href="https://github.com/Unity-Technologies/EntityComponentSystemSamples">Unity’s ECS samples repository</a></li><li><a href="http://bit.ly/unity-ecs-tutorials">Video playlist: Intro To The Entity Component System</a></li><li><a href="https://github.com/keijiro/Voxelman">Voxelman</a>, an ECS tech demo by Keijiro Takahashi</li><li><a href="https://github.com/spatialos/gdk-for-unity">SpatialOS GDK for Unity Github</a></li></ul><p>This article was originally published on 24 September 2018 on <a href="https://improbable.io/games/blog/unity-ecs-1">improbable.io</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37616ae375ef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/improbable-engineering/ask-the-unity-expert-what-is-the-ecs-37616ae375ef">Ask the Unity expert: what is the ECS?</a> was originally published in <a href="https://medium.com/improbable-engineering">Improbable Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>