Search Unity

Is NetworkCompressionModel redundant?

Discussion in 'Unity Transport' started by PolarTron, Dec 10, 2021.

  1. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    I seem to be creating and caching this structure in every system I want to use the DataStreamReader/DataStreamWriter for writing packed data. It seems to be initializing internal static data and the Allocator type is used to avoid a parameterless constructor. It just feels redundant to have this as a required parameter.

    I understand it would be nice to pass in my own compression model but I see no way to extend or create my own.
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Thanks for raising this!

    I agree with you it's a bit inconvenient to have to pass the compression model as a parameter on every call. At the time it was written that way because Burst didn't support storing a default value in a static, but that's possible now. I've added a task to our backlog to extend the API with calls that don't require passing in the compression model.
     
    PolarTron likes this.