New Unity ECS Coding!?!

Hi All,

I just heard that Unity 2018 has a whole new coding style called the Entity Component System and it’s a radically different system than the GameObject->Component system that I/we have used up to now. Now, I am no master of the current system and have trouble with the current one, sometimes lots of trouble, but, this new system has warped my mind after watching a very small introductory video.

So, I would like to know is @ben or @Rob or anyone on the GameDev team going to be doing a course - either a introductory and longer course on this new system and/or what they are calling the Hybrid system using elements of ECS and the older component model?.

To quote Garth from the movie, “Wayne and Garth”:
weFearChange

1 Like

Hey Vaughan,

Firstly…

With that out of the way…

This is a change which isn’t going to happen over night. The hybrid system approach is being rolled out so that people can start using the ECS approach early and, importantly, provide feedback to Unity.

If you consider other changes which have been made to Unity in the past, it takes quite a while before something which is deprecated becomes obsolete, as such, I would fully expect the existing model to be supported for some time. Additionally, if you were to ever look at ECS and decide it wasn’t for you, you could still use an older version of Unity for sometime to come before you were forced to make that next step.

Adapting to the new model might not seem straight forward initially, but Unity tend to focus on keeping their product easy to use in order for people to get the most out of it.

With regards to GameDev.tv’s / @Ben’s plans are I cannot really say. I know that at the moment they are going back through the original Unity course and making it Unity 2018 friendly but I don’t believe this is taking the ECS model in to account at all at this stage, simply updating their product to work with the newer versions of Unity.

We could make some assumptions though, if this is being done to modernise the course content, it stands to reason that at some point it will need modernising again, as, even if a separate introductory course was created for Unity, at some point the original course, the 3D course and the RPG are all going to be out of date.

Clearly this wouldn’t be for a significant amount of time, but I think it stands to reason that the team would want to provide their students with updated content/courses so I’m fairly certain it will be covered in due course.

It would probably also be fair to assume that, due to the amount of time it takes to produce the courses, perhaps creating a course around the hybrid system might not be a worthy investment of time, as I suspect Unity would be updating this at a rate which is faster than that which GameDev.tv could update the course content for. I would imagine that the dust would need to settle so to speak before it made sense to invest the time in producing a course. At the same time, if you want to be cutting edge/leading the way, sometimes you have to take that hit and be ready to make more rapid updates.

I fully appreciate where you are coming from with regards to change but lets face it, you can’t stop it, everything is changing around us every day, so all we can do is learn to accept it and keep moving forwards - which I have every confidence you will be able to do with these changes, just as you have done so with the previous API changes for example from the original course material to the more recent versions of Unity.

The link below links to lots of useful information, but as a good overview, try the first four links;

  • ECS principles
  • Is ECS for you?
  • ECS concepts
  • How ECS works

Hope this helps :slight_smile:


See also;

1 Like

Further to my earlier reply, I have extracted one of the ECS samples from GitHub and put it into a .unitypackage so that you can import it and take a look, without too much clutter, but you do need to take a few steps which I’ve tried to simplify below.

Download the RotatingCubes.zip file, extract the RotatingCubes.unitypackage and then follow the steps below.

RotatingCubes.zip (20.1 KB)


  • create a new Unity project using 2018.1.0+
  • File/Exit to close Unity
  • browse to the project’s /Packages directory and open the manifest.json file with a text editor
  • replace the existing text with the following;
    {
        "dependencies": {
            "com.unity.entities": "0.0.12-preview.5"
        }, 
        "registry": "https://packages.unity.com", 
       "testables": [
            "com.unity.collections", 
            "com.unity.entities", 
            "com.unity.jobs"
        ]
    }
    
  • save the file
  • re-open the project within Unity
  • set the Scripting Runtime Version to .Net 4.x Equivalent (Build Settings / Player Settings / Other Settings)
    image
    changing this setting will require you to restart Unity
  • after Unity restarts and your project opens, import the RotatingCubes.unitypackage (Assets / Import Package / Custom Package)
  • open the RotationExample scene from within Assets/Scenes
  • click the Play button

You should see a circle of cubes with a sphere moving in a circular motion through each cubes, causing them to rotate for a short while.

  • click the Play button again to stop the game

Now take a look at the prefab, the two entities (gameobjects) in the Hierarchy and their associated components/scripts.

Did you see the amount of cs files needed to just rotate the cubes/sphere - 13 files. This scares me, this scares me a lot.

I’ll do that in the next couple of days - I need a good lie down after seeing this :rofl:.

Just to be clear, what i was thinking was not a complete overhaul of the Unity courses to be compatible with ECS, they are pretty much fine for the foreseeable future, but, at some point there is going to be a need to have a course in ECS just to remain current and I would rather it come from GameDev/Udemy rather than some other format, books or heaven forbid trying to learn through websites like Brackeys - horrible forums to ask questions or on YouTube and the Unity learning system which is pretty hopeless as well. Half the tuts they have don’t work on Unity 5.

Thanks for the links, I will check them out.

Regards,
Vaughan.

Did you see the amount of cs files needed to just rotate the cubes/sphere - 13 files. This scares me, this scares me a lot.

If you look at the full samples project, you will see that a lot of these are re-used, the entities anyway, the namespace samples.common is the clue here. :slight_smile:

Nothing to prevent that from happening now to be honest, the re-use, but because behaviour and data is typically mixed together this tends to happen less.

If the team does put a separate course together it may not have a lot of longevity. Much in the way that there were rumblings with regards to the issues caused by API changes between the old course and newer versions of Unity, whilst an intro to ECS might get a few people up and running, at that point I would imagine ECS to be a fully released part of Unity, if that is the case, then the current way of doing things is now old, and having courses which teach people how to do things the old way is not likely to attract a lot of students, especially if their only progress path is to then buy another course.

“Oh, so what, now I have to buy another course because this is the current way of doing it :angry:

Up to this point, with only API changes, patches could be applied, or documents created to give explanations of resolving the changes.

If there was a small course I think it would have to focus on the hybrid approach, personally, I don’t see the value in that, that would be worse than teaching someone the old way in my opinion, as then they would have to learn another way again once the hybrid was no longer available. Maybe not a big issue for the games covered in the course, but anyone wanting to make something considerably larger would not be very amused I’m sure.

The hybrid approach does offer a bit of a half-way-house though, which means people can start to get the hang of changing things/working in a different way, and for some, perhaps that is an easier first step.

ecs examples

both hybrid and pure ecs

unity ecs physics | movement and adding force to rigidbody

I did not know about ECS until today. And now it turns out that I need to buy a couple more courses when there will be a discount. I want to believe that not everything will become obsolete.

Well, the next Unity is supposed to have a fully fleshed out visual scripting environment a little like Unreal, so they say, so, the changes they keep-a-coming :scream:.

I like what Unity is changs so fast. And visual scripting are great help for 3D designers. I bought Unity 3D and RPG courses just a few days ago, so I am a little disappointed that they have already out of date. I planned to study them after 3D modeling courses. I have a lot of material. So i need 500 hours to get a full understanding of modeling. And I was planning to start learning Unity С# at May 2019.

ECS Overview 1

ECS Overview 2

ECS Overview 3

ECS Overview 4

ECS Overview 5

No online course will ever be not out of date if you focus purely on the new features of a product that the course may not cover - because they were not available when the course was written. No one is going to be able to create up-to-date content as fast as the people who are creating the software, not even if it were the same people who were creating the software, because in the background they are already working on the next version, and the next version and so on.

That said, a lot of what you learn will not be out of date, there will be a degree of core learning that will be applicable to many versions of Unity for some time to come. If you consider the basics of how to open a project, how to save a project, how to create a GameObject, how to add a component - those are pieces of learning which have not changed since the the original course was created in 2015 using Unity 4.6 and those approaches still stand true today.

I would suggest that part of the value of any course would be to give you a good grounding of the product, and the confidence to then research for yourself more indepth concepts/approaches and features.

As both the Unity 2D and 3D courses are aimed at people who may never have written a single line of code before, and most likely never made a game before, diving straight into ECS, which I believe at the moment remains in beta/experimental is going to create a lot of problems for students. The very fact that a new feature is in beta/experimental means by its very definition that it will invariably change.

What I would suggest to you is that there is a lot that you can start to learn right here, right now without having to be at the forefront of technology in order to benefit from. If I was interviewing someone who suggested they knew ECS inside out, but then failed to perform some rather basic activities I think I would be of the mind to not hire them, as opposed to someone who demonstrated a strength of knowledge in a broad range of skills, with all of the basics covered and perhaps just an awareness of a new feature. If they were able to further discuss why/how that new feature may be important to my business then that would be a bonus.

It should also be remembered, in my opinion, that features are effectively tools, and choosing the right tool for the right job is important. ECS appears to be great for simulations and situations where there are many, many things - but for some non-simulation based scenarios I doubt it will be necessary or hugely beneficial, I also doubt that Unity will, on day one of it’s official release say, “this is the only way you can create a game”. Whilst that may be a position to move to over time, I think there would be a huge setback to that approach.

Thank you for such a detailed response.

1 Like

You’re very welcome :slight_smile:

Privacy & Terms