Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Good Fast Transforms v2

Discussion in 'DOTS Dev Blitz Day 2023 - Q&A' started by JesOb, Aug 23, 2023.

  1. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,081
    What plans unity have for Transform system future?

    Currently it is still behind QvvS Transform system of @DreamingImLatios. Still slower, have more bugs, bad support for hierarchies, no support for non uniform scaling (post transform is not a solution), they are not perfomance by default they drain memory by default design currently...

    Another is that it uses LocalTransform while many systems want to have WorldTransform like in QvvS Transforms. What your thoughts about this?

    It will be very welcome to adopt QvvS Transforms for ECS 2.0, but UT planning to do in future?
     
  2. jivalenzuela

    jivalenzuela

    Unity Technologies

    Joined:
    Dec 4, 2019
    Posts:
    67
    To answer your question directly, we're currently doing some prototyping and design work to decide on the next revisions to the Transform system. I can't share any details - we haven't decided internally yet - but it will almost certainly have to occur in a breaking release (i.e., not in the Entities 1.x timeframe).

    The current Transform system reflects the use-cases we thought would be most likely in games using it after Entities 1.0. For example, non-uniform scale and deep hierarchies are common sources of performance and physics interoperability problems. I'd appreciating getting more information about your situation to better understand how it's getting used (or what prevents you from using it).

    If you have more detail about what having bad support for hierarchies entails I'd love to hear it! And obviously please feel free to file a bug if you spot them.
     
    optimise and JesOb like this.
  3. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,081
    just read @DreamingImLatios posts about Unity ECS. There you will find big amount of issues of current Transform system.

    Thanks for answer. Glad you try to make transform better in some ECS v2 in future :)
     
  4. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    That is not a helpful statement. I have lots of scattered posts and a lot of them pertain to issues that have since been resolved. So for current issues I've solved in my implementation (which is completely independent of Unity Transforms and required a lot of hackery to replace on my part):
    • Changing parents is non-deterministic and will result in different entity orders in different chunks run to run.
    • Change filters on LocalToWorld are non-deterministic when updating the hierarchy due to a really stupid race condition introduced by disabling safety. I discuss it thoroughly here: https://github.com/Dreaming381/Lati...m Hierarchy 1.md#a-race-condition-in-the-wild
    • Lots of components are larger than they need to be and more are needed than necessary, using precious chunk space. A dynamic root entity with Unity Transforms requires 96 bytes for position, rotation, and uniform scale (LocalTransform + LocalToWorld). Whereas my solution drops that down to 48 bytes for full movement and rendering and also supports non-uniform scale. There's plenty more improvements when actual hierarchies are involved.
    • Hierarchy updates are slow at scale, and the page I linked describes how to make them way faster.
    On top of that, here's the other features not related to component size or performance I have that Unity Transforms lacks:
    • Non-uniform scale out-of-the-box support with non-propagation to avoid shearing (which rarely people want and is what causes most non-uniform scale performance concerns)
    • World-space transforms for read access at all times via a ParentTransform cache (You were doing something similar at some point)
    • Motion history components for standardized access to the previous frame's world-space transform used for all sorts of things
    • Per-component world-space locking in hierarchy updates (I just added this recently and it lets a user specify for example that a child should preserve its world-space x-axis position and full rotation when being updated in the hierarchy)
    There might be more that I am forgetting, but hopefully this is a useful summary.
     
  5. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    I hope next revisions to the Transform system will support open world by default that not just for desktop platform but also console and all the way down to mobile platform.
     
    jivalenzuela, WAYNGames and JesOb like this.