Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Welcome!

Discussion in 'Entity Component System and C# Job system' started by MartinGram, Mar 20, 2018.

  1. MartinGram

    MartinGram

    Unity Technologies

    Joined:
    Feb 24, 2017
    Posts:
    35
    Welcome!

    Welcome to the Entity Component System and C# Job System sub forum.

    Here you can find the resources required to start building with these new systems today.

    What is available today
    We have been working on a new high performance multithreaded system, that will make it possible for games to fully utilise the multicore processors available today without heavy programming headache. This is possible thanks to the new Entity Component System which provides a way to write performant code by default. Paired with the C# Job System and a new math-aware backend compiler technology named Burst. Unity can produce highly optimised code for the particular capabilities of the platform you’re compiling for.

    These new systems work with Unity 2018.1 and newer versions.

    Entity Component System
    Offers a better approach to game design that allows you to concentrate on the actual problems you are solving: the data and behavior that make up your game. It leverages the C# Job System and Burst Compiler enabling you to take full advantage of today's multicore processors. By moving from object-oriented to data-oriented design it will be easier for you to reuse the code and easier for others to understand and work on it

    The Entity Component System ships as an experimental package in 2018.1, and we’ll continue to develop and release new versions of the package in the 2018.x cycle. It is important to stress that the Entity Component System is not production ready

    C# Job System
    The new C# Job System takes advantage of multiple cores in a safe and easy way. Easy, as it’s designed to open this approach up to user scripts and allows users to write safe, fast, jobified code while providing protection from some of the pitfalls of multi-threading such as race conditions.

    The C# Job System ships in 2018.1.

    Burst
    Burst is a new LLVM based math-aware backend Compiler Technology makes things easier for you. It takes the C# jobs and produces highly-optimized code taking advantage of the particular capabilities of the platform you’re compiling for.

    Burst ships as an experimental package in 2018.1, and we’ll continue to develop and release new versions of the package in the 2018.x cycle. For the current package release, Burst only works in the Unity editor. It is important to stress that Burst is not production ready

    Watch Joachim Ante present these new systems at Unite Austin
     
    Last edited: May 8, 2018
    dsx75, AntonioModer, MUGIK and 13 others like this.
  2. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    630
    @MartinGram
    • Thank you for compiling all this into a new Sub Forum and providing all the initial info.
    • It would be great if you could provide a simple instruction on how to start on an empty project.

    My steps - they look wrong but worked somehow in the end:
    1. Downloaded beta linked above -> result: no ECS
    2. Enabled .NET 4.x runtime -> result: no ECS (not sure if this is a required step)
    3. copied the manifest.json from your examples into my project -> result: some signs of ECS (but Unity.Entities, Unity.Mathematics and a few others missing)
    4. Restart Unity a few times, clicking randomly around (kind of banging on the fridge and it suddenly works again) -> it seems to be working (i think i see all the libraries under Unity.)
    Let's start playing with it...exciting.

    Is there an API documentation yet? some things like Unity.Burst / Unity.Jobs seem to be already in the Scripting API documentation --- is there something for Unity.Entities yet?
     
  3. Enrico-Monese

    Enrico-Monese

    Joined:
    Dec 18, 2015
    Posts:
    53
    Will this be compatible only with the preview build or can we use the regular beta versions?
     
  4. MartinGram

    MartinGram

    Unity Technologies

    Joined:
    Feb 24, 2017
    Posts:
    35
    @sngdan Thanks for the feedback. I will provide better "Getting started" instructions once GDC winds down a little bit. :)

    @Enrico-Monese In time you will not need to use the preview build. Some changes sadly didn't make it into 2018.1b12, but we hope that they will land soon.
     
  5. Enrico-Monese

    Enrico-Monese

    Joined:
    Dec 18, 2015
    Posts:
    53
  6. Font8

    Font8

    Joined:
    Jan 1, 2013
    Posts:
    34
    Wow! I won't be able to look into this until tonight but I'm super curious what that Entity-Component system is about, any way to encourage my fellow coders to adopt more data-oriented methods is niiice
     
  7. SubPixelPerfect

    SubPixelPerfect

    Joined:
    Oct 14, 2015
    Posts:
    159
    Yes it is

    Thank you, for sharing this, can't wait anymore to try ECS )
     
  8. SubPixelPerfect

    SubPixelPerfect

    Joined:
    Oct 14, 2015
    Posts:
    159
    Hooray!
    got cube moving with ecs, this is awesome )
     
  9. sk_unity246

    sk_unity246

    Joined:
    Feb 12, 2018
    Posts:
    14
    Another step is that you have to enable jobs, by adding ENABLE_MANAGED_JOBS to the scripting define symbols in the player settings, or else this doesn't compile.

    there is also a warning from one of the tests :

    C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.entities@0.0.11/Unity.Entities.Properties/TypeInformation.cs(150,13): warning CS0162: Unreachable code detected.

    Just saying :)
     
    d1-favero likes this.
  10. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    588
    Is there estimate when we'll get Burst that runs on standalone builds so we can properly benchmark it? Like, is that still planned for 2018.x?
     
  11. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,199
    Burst with AOT is planned for 18.2
     
    Zoey_O and rizu like this.
  12. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    231
  13. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    231
  14. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
    Open Package Manager, try update or install ECS (for empty project), also Reimport All for Asset folder, oh and set .NET 4.x for Scripting Runtime Version
     
    Last edited: Mar 28, 2018
  15. Deadcow_

    Deadcow_

    Joined:
    Mar 13, 2014
    Posts:
    44
    I have this problem too, simply no signs of ECS in b12 :(
     

    Attached Files:

  16. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    231
    Yes the same issue, there is no ECS in PackageManager
     
  17. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    630
    Did you follow post#2 in this thread?

    -you need the right b12 (the one linked in post#1)
    -you need the manifest for the packages in your project
    -you need to set player to 4.6
     
  18. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    231
    Thanks custom build from this thread works :)
     
  19. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
    Because you must have packages in manifest.
    upload_2018-3-28_14-45-14.png
     
  20. Kharindev

    Kharindev

    Joined:
    Mar 27, 2018
    Posts:
    3
    What about this? macOS High Sierra
     

    Attached Files:

    MarkusGod likes this.
  21. CDMcGwire

    CDMcGwire

    Joined:
    Aug 30, 2014
    Posts:
    133
    Huh, I spent a good portion of last year inestigating this kind of functionality, and here it comes, waltzing into Unity. :D

    I will have to look into this when I get home.
     
  22. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
     
  23. Kharindev

    Kharindev

    Joined:
    Mar 27, 2018
    Posts:
    3
    I have already changed
     

    Attached Files:

  24. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
    Reimport All on Assets folder and reload Unity after that
     
  25. Kharindev

    Kharindev

    Joined:
    Mar 27, 2018
    Posts:
    3
    Cool! It's working! Thank you!
     
  26. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    231
    No this will not help, I have tried with no luck. Only custom build hepls :)
     
  27. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
    Because you must set manifest, set .NET 4 and reimport all for assets after all reload project and profit.
     
  28. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,009
    No LWRP in this version?

    How can i get ECS with the SRP LW stuff?
     
  29. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    400
    Take a look into the package manager
    Windows -> Package Manager

    There you should be able to download the SRP packages.
     
  30. zulfajuniadi

    zulfajuniadi

    Joined:
    Nov 18, 2017
    Posts:
    117
  31. zulfajuniadi

    zulfajuniadi

    Joined:
    Nov 18, 2017
    Posts:
    117
    Will the new released 2018.1.b13 version work?
     
  32. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
    No. Now for the rest of the day at 12 preview :) Joke
     
  33. Trindenberg

    Trindenberg

    Joined:
    Dec 3, 2017
    Posts:
    11
    Maybe they should note on the version that doesn't have ECS "Does not include the ECS package". I've downloaded b12 and b13 to test out the new code to no avail, and now I'm downloaded b12 that's apparently not the same b12!? Maybe could just be noted for everyone before they download.
     
    GameDevCouple_I likes this.
  34. Trindenberg

    Trindenberg

    Joined:
    Dec 3, 2017
    Posts:
    11
    Well I downloaded from the other b12 link, and still no ECS I give up...
     
    GameDevCouple_I likes this.
  35. IsaiahKelly

    IsaiahKelly

    Joined:
    Nov 11, 2012
    Posts:
    246
    Installing Unity ECS in a New Empty Project


    1. Download the Unity beta version from here. Important Note: Only this special beta version from the link provided will work with the new entity component system preview. Other beta versions downloaded from the default beta page will not work at this time.

    2. Create a new project with the Unity version above, open it and go to Project Settings > Player and change the Scripting Runtime Version to .Net 4.x

    scripting_runtime_NET4.png

    3. Close Unity, then locate and open the package manifest file located in the root of the project under [project folder] > Packages > manifest.json. Then add the following to the manifest file using a text editor:

    Code (JSON):
    1. {
    2.   "dependencies": {
    3.     "com.unity.entities": "0.0.11",
    4.     "com.unity.package-manager-ui": "1.9.5"
    5.   },
    6.   "testables": [
    7.     "com.unity.collections",
    8.     "com.unity.entities",
    9.     "com.unity.jobs"
    10.   ],
    11.   "registry": "https://staging-packages.unity.com"
    12. }
    13.  
    4. Delete the contents of the Library folder in the root of your project located under [project folder] > Library.

    5. Reopen the project in Unity and then open the Package Manager located under Window > Package Manager and insure that the Entities package is displayed.

    packages_manager_entites.png


    6. All done. You should now have full access to all Unity ECS functions.

    @Trindenberg
     
    Last edited: Apr 2, 2018
    mgmhunt, Aldo-V, zhuchun and 8 others like this.
  36. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
     
  37. Trindenberg

    Trindenberg

    Joined:
    Dec 3, 2017
    Posts:
    11
    Thank you. It was the manifest.json which needed amending. I did see in a picture above but couldn't be bothered to type it all out, thanks for sharing cut and paste Isaiah Kelly!
     
  38. hazarartuner

    hazarartuner

    Joined:
    Oct 22, 2016
    Posts:
    1
    Thanks @IsaiahKelly, I waste my all sunday trying to enable ECS, I downloaded 3 different beta versions from Unity beta program page and tried to install and test over and over again but nothing worked and I was getting so many errors by default. Finally I read your instructions and it worked. The problem is the beta release version. As you say, only the linked beta release works, rest of them does not.

    TLDR; Install just this beta release: https://beta.unity3d.com/download/ed1bf90b40e6/public_download.html The other releases does not working even if they are higher than that
     
    tbriley likes this.
  39. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    400
    When do you plan to add the ecs to the official beta cycle?
     
    fiyorin and tbriley like this.
  40. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    112
    I am getting the following error in our project (we have warnings as errors set via mcs.rsp):

    C:/ProgramData/Unity/cache/packages/staging-packages.unity.com/com.unity.entities@0.0.11/Unity.Entities.Properties/TypeInformation.cs(150,13): error CS0162: Warning as Error: Unreachable code detected

    It looks like TypePropertyIterator.Get(Specifier d) has a yield break in the first line of the method implementation.
     
  41. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,199
    All necessary changes were merged into the release branch thursday last week, so next build should have it.
     
  42. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    I faced problem with Visual Studio 2017
    I using unity 2018.1 beta12 version defined above and trying to look at the sample code from GitHub ECS samples.
    When I open cs file by doubleclick from Unity, I come to VS and VS starts process of unloading and then reloading project files.
    Thats how it looks:
    upload_2018-4-3_16-57-9.png
    This process takes a lot of time. In this situation I just close and open VS cuz even this is faster than wait for end of this unload/reload process.
    Did I miss something?
    Thanks!
     
    Krajca likes this.
  43. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    400
    I had this problems at the beginning of the ecs beta release too. But it disappeared, not sure what I did exactly :D

    Try the following:
    Reinstall the unity addin for vs.

    Maybe this will help.
     
  44. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    656
    Sounds like a balm per capita :)
     
  45. EvilWolf

    EvilWolf

    Joined:
    Jan 19, 2014
    Posts:
    5
    I tried all of the above multiple times with new projects and I can't get it to work. The Package Manager also doesn't show up for me.

    I also get this message in the console as soon as I open the project: "
    Assembly has reference to non-existent assembly 'Unity.Transforms' (Packages/com.unity.entities/Unity.Entities.Properties/Unity.Entities.Properties.asmdef)"

    I'd appreciate some help, I really want to try out ECS...
     
  46. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    400
    You have to switch to .Net 4 in player settings

    EDIT:
    Download the beta from here:
    https://beta.unity3d.com/download/ed1bf90b40e6/public_download.html

    And your manifest (Project Folder/Packages/manifest.json) should look like this
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.entities": "0.0.11",
    4.   },
    5.   "testables": [
    6.     "com.unity.collections",
    7.     "com.unity.entities",
    8.     "com.unity.jobs"
    9.   ],
    10.   "registry": "https://staging-packages.unity.com"
    11. }
    12.  
     
  47. EvilWolf

    EvilWolf

    Joined:
    Jan 19, 2014
    Posts:
    5
    The Scripting Runtime is set correctly, I have the correct build and the manifest looks correct as well.
    I think I got it working earlier once but then I shut down Unity and it broke again... Oh well, I guess I'll wait until more people tested this.

    EDIT: So, I sorted it out. I hope this helps someone else:
    It seems like my packages got corrupted somehow and then stuck around in the Unity cache which is independent of specific projects. After I deleted them and reloaded the project, everything works fine.
    You can find the package cache here: C:\ProgramData\Unity\cache\packages
    Deleting the "staging-packages.unity.com" forced Unity to download the packages again, fixing the problem.
     
    Last edited: Apr 4, 2018
    Spy-Shifty likes this.
  48. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    965
    Is the new job system something we have to do differently to have other cores process it.
    Why not get the navmesh agent to run on a separate core? Or the editor be on it's own core?
     
    Last edited: Apr 9, 2018
  49. TBbadmofo

    TBbadmofo

    Joined:
    Apr 1, 2014
    Posts:
    14
    Version b12 both, regular and this one, does not update my project correctly. Says it can't find unity engine. B13 works and the one before b12 works. This is kind of a lot of aawonky setup to get this to work. I hope it's just included in the next beta release.
     
  50. FROS7

    FROS7

    Joined:
    Apr 8, 2015
    Posts:
    23
    I want beta 14 SOO bad I cant see straight. I understand waiting is important but Im starting to get ansy.