Understanding Worlds in relation to ComponentSystems

I think I got most of the basics down of ECS, however I don’t really understand the use of Worlds the way they are implemented now. It seems they only have a relationship with Entities, do they also have a relationship with Systems?

Somewhere in the documentation is says that Worlds can be used the separate simulation from presentation. So if I would want to do that, I would want my Entities to be shared between Worlds, but have Systems that only are created on one of my worlds and have them update at different rates.

Are these things feasible in the current implementation and how would I do them?

  1. Add Systems only to specific Worlds
  2. Have different update rates for different Worlds
  3. Share Entities between Worlds
1 Like

Not fully on topic, but iirc the Unity guys wanted to elaborate more on the usage of Worlds when they wanted to show multiplayer examples. The main reason for different worlds would be to have the possibility for a world for each player. I guess so that you still can share entities between worlds or even let them know of each other, but time will tell.

Since I was working in this (two weeks ago), the documentation has been updates with:
“Note: We are currently working on multiplayer demos, that will show how to work in a setup with separate simulation & presentation Worlds. This is a work in progress, so right now have no clear guidelines and are likely missing features in ECS to enable it.”

And two links to files, that pointed me to the code of the automatic world creation code, these files (especially DefaultWorldInitialization.cs) atleast provided the answer to question 1. (yes)

1 Like

Can you give the correct links to the file ? When I click on the links in the documentation, it shows a “page not found” error…
THanks :slight_smile:

I just search for the files in my Visual Studio Solution. They are in the Unity.Entities.Hybrid project; DefaultWorldInitialization.cs and AutomaticWorldBootstrap.cs

I have no such project as “Unity.Entities.Hybrid”. I search for a file named “DefaultWorldInitialization” in the samples and couldn’t find one :S