Search Unity

float3 in dotnet core and SIMD

Discussion in 'Entity Component System' started by labandunga, May 26, 2019.

  1. labandunga

    labandunga

    Joined:
    Aug 1, 2012
    Posts:
    29
    Hi,

    I have a client and a server architecture that uses a shared project. This shared project, let's call it the MyGame.GameLogic, uses float3. This gets put in as a dll into the plugins folder in Unity which I use in my systems. Ofcourse the same GameLogic project is being used by my server which is currently running on dotnet core 3.0 preview.

    My question is, would float3 be translated into SIMD in dotnet core? Or should I be using System.Numerics in my shared project to guarantee SIMD usage on my server?
     
  2. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    The SIMD usage is possible because of Burst finding you iterating array of `float3` in a for loop for over than a certain rounds. The `float3` itself used without Burst is just a struct with 3 floats.
     
    labandunga likes this.
  3. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Is there a reason you are not using Unity for the server?

    The current standalone player can be a bit heavy for servers due to including all of the existing UnityEngine.dll code, which is why some people used to make their own dedicated servers in .NET without using a whole unity standalone player/

    We are however about to release a preview of DOTS runtime formely known as UTiny, which is essentially DOTS without unity engine and highly modular code. There are many applications of this. From tiny facebook messenger games to runtime DOTS only server code that has to be minimal for performance & memory reasons.

    This way you can create a DOTS only server. And use Hybrid DOTS for the runtime so you can continue to use all of Unity especially for rendering & UI.


    Some more info:
    https://unity.com/solutions/instant-games

    But again, in a few week's we'll release the preview of the C# based DOTS only runtime. I'd suggest you build on top of that for servers, since it gives you a more integrated workflow.
     
    psuong, kstothert, recursive and 4 others like this.
  4. BrendonSmuts

    BrendonSmuts

    Joined:
    Jun 12, 2017
    Posts:
    86
    Really exciting, been looking forward to playing with the pure DOTS runtime. Can't wait!
     
  5. labandunga

    labandunga

    Joined:
    Aug 1, 2012
    Posts:
    29
    That's what I was thinking, thank you.


    Because of the reason you've mentioned, we didn't want to use Unity as a headless server for scalability reasons. We have to keep our memory & cpu usage to a minimum, otherwise we risk the failure of the project. I wasn't aware that a lightweight framework was in the works. It's an exciting prospect to be sure, I will keep an eye out on the announcements. We'll have to see where we stand when we have more information on it.
     
  6. ReignOfDave

    ReignOfDave

    Joined:
    Oct 22, 2015
    Posts:
    51
    @Joachim_Ante Any news on the C# runtime?
     
    Ivan-Pestrikov likes this.
  7. siggigg

    siggigg

    Joined:
    Apr 11, 2018
    Posts:
    247