Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Extreme DOTS Multiplayer test

Discussion in 'NetCode for ECS' started by _met44, Apr 11, 2020.

  1. _met44


    Jun 1, 2013
    Hello !

    I'm trying to understand and evalute the capabilities of the new DOTS Multiplayer and got stuck at some point that I'm going to explain bellow.

    I began with the asteroids sample project and it was really hard to understand what was going on after scaling the amount of asteroids (10k) and felt like not intended for this.

    I then setup a project that moves a bunch of simple cubes with a configurable amount (no physics involved) and with a recognizable pattern using the math.sin function by passing time offset by X + Z position.

    It looks like that (please imagine it being smoothly animated) when run without multiplayer :

    From this base I setup multiplayer by looking at the asteroids sample project and after enough struggling I got it working.

    Each cube syncs its Translation component. The client doesn't control anything yet, only shows the cubes received by the server. Note that I tried all the settings, one by one, just to make sure.


    Issues I haven't been able to figure out are:
    - why movement is really jaggy in multiplayer
    - why it doesn't update everything all the time (seamingly)
    even though neither the network or CPU seems anywhere near reaching my hardware capabilities.

    Here is how it looks with 200x200 cubes, really really jaggy and looks like it updates a few lines at a time: (takes roughly 2s to update a given cube again)

    And here is the net debug tool when passing 40k entities through the new multiplayer:
    40k netdbg.png
    I find it weird that the client skips receiving some frames that the server sends but maybe i'm just not understanding this tool correctly. From what I noticed, the smaller the amount of cube the less frames without receiving packages the client has.

    I also tried lowering significantly the amount of cube.
    Here is how it looks for the client with only 20 by 20 cubes, it is sort of ok compared to 40k cubes but still breaks up the curve frequently and interpolation feels jaggy:

    I also tried with a single cube which also had jaggy interpolation but is harder to showcase with a screenshot :p

    I also tried playing with the GhostDistanceImportance values, it did change slightly how it was broken visually but never solved the issue.

    Anyone got experience/insights about what could be going on ?

    I can put the sources on github but I doubt it'll tell much, my code is just translation.value = blabla in a job and then the multiplayer does its magic to send it to the client...