Search Unity

Question Does the physics system leverage Burst and/or Jobs by default?

Discussion in 'Physics for ECS' started by BenjaminApprill, Dec 13, 2022.

  1. BenjaminApprill

    BenjaminApprill

    Joined:
    Aug 1, 2022
    Posts:
    132
    Hey what's up.

    I've got an ECS 1.0 project set up to spawn a mass of spheres, but it is maxxing out at around 10k-15k entities...

    I was under the impression I could push this much further with ECS. Is there anything else that can be done to push the Physics system? I am just using base conversion and the base Physics system. I know there was mention of referencing the same Collider component from a Blob asset to share between the sphere entities.

    Otherwise, my only other idea would be manual Transform updates using Burst and Jobs. The main issue seems to be when more and more spheres get close together. After the spheres have fallen and spread out a bit, the framerates usually get a solid bump... So, it doesn't seem to be about how many entities there are, but it instead seems to be how many updates the physics system has to do.
     
    Last edited: Dec 13, 2022
  2. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    867
    Maybe try spreading them out more? Or spawn them over time so they spread-out?
     
  3. vectorized-runner

    vectorized-runner

    Joined:
    Jan 22, 2018
    Posts:
    398
    If you need that many probably write a physics system by yourself using Jobs + Ecs, like fluid simulation.
     
  4. BenjaminApprill

    BenjaminApprill

    Joined:
    Aug 1, 2022
    Posts:
    132
    I am just generating a cube of these spheres, and dropping them for simulation. Some of the interesting DOTS showcases have hundreds of thousands of entities spawned as an example... It seems like these examples are not part of the Physics system however, and instead are being manually updated.

    I would hate to write a Physics system when Unity released a Physics package specially designed to do ECS Physics... But ok.
     
  5. theman224

    theman224

    Joined:
    Mar 23, 2017
    Posts:
    5
    Same issue here. I would want 100k entities with physics stacked onto each other, Thanks!