#archived-dots

1 messages ยท Page 23 of 1

viral sonnet
#

otherwise the change will be too drastic imo

rotund token
#

hmm maybe i miss-read it

#

if there's a new attribute to add old behaviour then it wouldn't be that bad

viral sonnet
#

somehow nothing in uitoolkit works out of the box ๐Ÿ˜„ i have display none/flex css and set it with ```private const string visibleTag = "visible";
private const string hiddenTag = "hidden";

public static void ToggleVisualElement(this VisualElement visualElement)
{
    if (visualElement == null)
        return;
    
    Debug.Log($"VE: {visualElement.name} has display {visualElement.style.display.value}");

    if (visualElement.style.display.value == DisplayStyle.Flex)
    {
        visualElement.RemoveFromClassList(visibleTag);
        visualElement.AddToClassList(hiddenTag);
    }
    else
    {
        visualElement.RemoveFromClassList(hiddenTag);
        visualElement.AddToClassList(visibleTag);
    }
}``` the class add/remove works fine, that i already tested but the toggle doesn't. even when the VE has a hidden class the display will still show flex. in the debugger it shows display none.
#

do i have to dirty the VE or something?

#

oh! i'm not supposed to use .value

#

that's not it either. it just switched my condition to the always visible branch. "VE: shopOverlay has display Null"

#

they really differentiate between class style and inline style... i don't even ... WHAT

#

visualElement.resolvedStyle.display is the solution ๐Ÿ™‚ the pitfalls are real.

rotund token
#

they are very different things ๐Ÿ˜…

viral sonnet
#

of course they are ๐Ÿ˜„ but you need to read code to figure it out /// <summary> /// <para> /// Reference to the style object of this element. /// </para> /// </summary> public IStyle style { get { if (this.inlineStyleAccess == null) this.inlineStyleAccess = new InlineStyleAccess(this); return (IStyle) this.inlineStyleAccess; } }

#

i assumed style is the computed style. that's what every browser uses

#

whatever, one of those, once you know, you know kind of mistakes

#

now i figured that out my extension also works: ```public static List<T> GetActiveElements<T>(this VisualElement ve)
where T : VisualElement
{
List<T> tmp = new List<T>();
ve.Query<T>().ForEach((T element) =>
{
if (element.resolvedStyle.display == DisplayStyle.Flex)
tmp.Add(element);
});

    return tmp;
}``` kind of useful to have. so i don't need to micro manage every element and can just query in appropriate situations
rotund token
#

what does active mean?

digital zephyr
#

displaystyle == flex is the same thing as saying it displays normally (as opposed to hidden); seems a bit odd to me until i read the docs:

wraith hinge
#

there is now a RequireAnyForUpdate call that can OR between queries for this purpose

dull scroll
#

my IDE tells me quaternion.Euler cannot be applied with * operator

quaternion.Euler(0f, j * (360f / slices), 0f) * new float3(0, 0, 1)

#

is there a work around for this?

karmic basin
dull scroll
rustic rain
wraith hinge
#

yep

rustic rain
#

nice

errant hawk
#

Are queried entities in order?

#

for example, if I make a job that gets all entities with component A, will the entities index be in order 1, 2, 3, 5, 11, 13, etc?

#

The reason I ask is because I want to adapt my small networking API to ECS and I need a way of mapping entities to connected clients

rustic rain
#

internally it gets chunks

#

and goes through them

#

entities can be in any order

errant hawk
safe lintel
#

GameConversionSystems and the interface IConvertGameObjectToEntity are being removed in 1.0. This is a breaking change. I think we all knew this was going to be a breaking change but just thinking about all the work to refactor everything is ๐Ÿ˜‚ ๐Ÿ˜ญ

rotund token
#

Convert to entity finally gone as well

balmy thistle
#

URL

rustic rain
#

so

#

only conversion systems from now on?

safe lintel
#

might be easiest

pliant pike
#

gameconversionsystems and iconvert are being removed leahWTF

rustic rain
#

wait waht

#

how do you convert now

#

what is pipeline

viral sonnet
#

huh? it's in the post. baker and bakersystems

#

it's just new api. mostly very similar

rustic rain
#

so

#

I can see that they get rid of runtime conversion

viral sonnet
#

ah you mean specifically runtime conversion? yeah no idea either. seems we have to build entities ourselves. question is how it will work with HR and physics

rustic rain
#

As in

#

Bake literally all possible prefab scenarios beforehand

#

And then just modify them

vale chasm
#

Hello everyone, I've been experimenting with DOTS (with ECS 0.51) since a couple of days and I'm trying to get an android build on Google Play. To do so I need to I need to add the "Android Export Settings"component to my build configuration but it's not available in the component list.

#

Anyone have any idea why it's not available? (I'm targeting android & have com.unity.platforms package)

rotund token
#

hmm i think most of those build configuration settings were removed in 0.51

#

with the removal of the specific platform packages for android/ios/windows etc

vale chasm
#

Humm ok It may have been a part of com.unity.platforms package.android witch is now depreciated with 0.51. Any other known way to build an App bundle with the DOTS build pipeline?

rotund token
#

does just setting this up via the regular project settings window not work?

vale chasm
#

NopI also need to build using L2CPP arm7 & 64 And it dont seems to work using the regular way.

rotund token
#

you still have to build with build configs

#

but i thought most of the project settings stuff should still apply

#

(i haven't developed on mobile recently though and I know optimize on the forums had some issues with this in 0.51 for a little while)

vale chasm
#

It's seems to work Thanks! I tough it was a completely different pipeline and project settings didn't apply.

rotund token
#

oh did burst 1.8 come out of preview?

#

seems i missed this

errant hawk
rotund token
#

what was your wish

errant hawk
rotund token
#

oh well that wasn't a surprise

#

subscenes have been pushed for a while

errant hawk
#

yes but you lose the ability to link GOs for tracking without having to jump through a few hoops first

rotund token
#

not sure i follow

errant hawk
#

if you want a camera to follow an entity, you can only do so (easily) from a ConvertToEntity GameObject, not in a subscene because the subscene is already processed

#

personally I hope they add a camera component so I dont have to rely on GOs for just that purpose

rotund token
#

but what i don't understand is, if you liked ConvertToEntity for this use

#

why are you happy they removed it?

errant hawk
#

it suggest they're making improvements towards not using GOs

#

Im all for a pure entity workflow

viral sonnet
#

i love patch notes like this Fixed a bug in Burst player builds where sufficiently complicated Bursted code could cause a deadlock deep within LLVM. it sounds so mysterious

rotund token
#

historically it's actually a bit annoying because some of them have been my reports and it's hard to know if it's the fix

#

(pretty sure this one has no relation to anything i reported though)

errant hawk
#

I think 1.8 fixes an issue I reported a long time ago... maybe that was 1.7

viral sonnet
#

what were the issues?

rotund token
#

didn't really miss anything

errant hawk
rotund token
#

oh i know the error you're talking about

#

yeah that should be fixed

#

not sure what version it was fixed in though

errant hawk
#

I was the first to report on it I think

#

not sure

#

It caused me so many headaches when I was working with proc gen

#

eventually, after testing the bug, I concluded it wasnt my code

viral sonnet
sinful cipher
#

It has been a while since I worked with Unity DOTS. What should I be aware of prior to choosing between these two Unity versions? Like any problems in Unity 2021 that Unity 2020 doesnt have?

errant hawk
rotund token
#

(try build with il2cpp if you have compound colliders)

errant hawk
#

I don't, specifically for issues ill2cpp gives me regardless

sinful cipher
rotund token
#

haven't compounds been supported for ages

sinful cipher
#

Nvm maybe I should first reorient myself in all this before talking nonsense

sinful cipher
errant hawk
#

yeah, compounds have existed since the start

rotund token
#

hmm i can see support in the original released package

#

Commits on Apr 3, 2019
com.unity.physics@0.0.1-preview.1
seems to support it

errant hawk
#

otherwise, their test projects would not work at all

sinful cipher
#

Weird. Then it must have been something else, I just cant remember what it was. Something I really needed lol but couldnt be done (yet)

#

Ooooh

#

I remember

#

Moving the child colliders of a compound collider!

#

Like, you can totally do that with GameObjects and Rigidbodies

#

But with DOTS...hmmm...

rotund token
#

oh yeah all colliders are baked in unity physics

#

you'd need to regenerate the collider

errant hawk
#

for now at least

sinful cipher
#

What would performance be for regenerating each physics step you reckon?

rotund token
#

(well no, you could edit the blob probably but it'd require unsafe code)

sinful cipher
#

Maybe not too bad?

errant hawk
#

not very expensive

#

They're all primitive shapes

sinful cipher
#

Hmm

#

What is Mesh Collider support like in DOTS at the moment?

rotund token
#

fine

sinful cipher
#

I dont think I tried that yet

errant hawk
#

converts to a DOTS mesh collider

sinful cipher
#

And I read there is... DOTS audio in beta? That correct?

errant hawk
#

it was planned, but for now it is on hold

sinful cipher
#

๐Ÿ˜ฎ

#

Alright. Thanks guys

rotund token
#

yeah development on audio stopped a while ago

errant hawk
sinful cipher
errant hawk
#

once 1.0 is released, a LOT of doors will be opened

sinful cipher
#

I presume this is referring to navmeshes and AI and such?

errant hawk
#

yeah see they even have working prototypes

sinful cipher
#

Hmm

#

So this whole DOTS thing seems to be alive and well for now

errant hawk
#

very much so

#

it's where other game engines are heading as well

sinful cipher
#

Nice... I really want this to work out. This is exactly what was missing for me

errant hawk
#

I wont be surprised if OOP/mono is phased out in the coming years (5-10 maybe)

errant hawk
sinful cipher
#

Hmm

errant hawk
#

right now it is an "addon engine"

sinful cipher
errant hawk
#

yes, but as it stands it's not nearly as polished as DOTS

#

IIRC unreal also struggles with multi-threading

sinful cipher
#

Seems DOTS is already quite widespread among AAA in-house engines, but not so much for public/licensed engines

errant hawk
#

DOTS is what unity is calling their ECS implementation

sinful cipher
#

Yeah you're right

#

Meant to say ECS

errant hawk
#

ECS has existed for a long time, its just now being valued since multi-core CPUs are widespread

#

8+ core CPUs will absolutely destroy with ECS

#

hell, my 4 core does incredibly well

sinful cipher
errant hawk
#

ECS is just a design pattern

sinful cipher
#

Yeah but like to me it was never immediately obvious why you'd go through the trouble of implementing it for a game

#

(until I opened up the Unity Profiler to see what was taking so long lol)

#

It was quite a shock to me honestly when I learned about how the way you code affects how well CPU cache is utilized and such and how much of a difference it makes

#

I had already been programming for quite a few years and no one told me lol

errant hawk
#

Here is an old test of my vehicles. 2k total vehicles, 100hz physics rate, with level 4 contact solving. You cant do that with mono lol

#

going to make a new test with all the optimizations I did

sinful cipher
#

Oh so the cars are also like proper cars with simulated tires and such?

errant hawk
#

proper lat/long friction, anti-roll, tire inertia, and eventually engine simulation

sinful cipher
#

Nice. Mono WheelColliders are useless. Wont even work upside down (so no driving around on a spherical world)

errant hawk
#

they dont work regardless lol

sinful cipher
#

lol

errant hawk
#

why they still exist, is honestly annoying

sinful cipher
#

I dont have a nice recording but here's what I've been trying. Some kind of spherical world surface geometry streaming thing (although its not baked terrain, but generated from noise).
Reasonably performant, but not nearly good enough yet. Really made me respect what is being done by the proper studios that ship games with huge streaming worlds

balmy thistle
#

DOTS isnโ€™t just ECS.

sinful cipher
#

Also a reasonably accurate aero sim. (No particle/vector grid yet though...that would be cool to do)

errant hawk
#

wanted to start off with a simple heli as they are significantly easier to design compared to a plane lol

sinful cipher
#

Just stuck a bunch of narrow plane wings on a rotating body and that did pretty well. Although I did have to "exaggerate" the amount of blades otherwise the thing would be very jittery

sinful cipher
errant hawk
#

well, the proper air simulation aspect seems pretty daunting

#

I imagine it could be easily faked getting the normal direction by the plane of the air foils

#

max resistance for when their perpendicular with eachother

sinful cipher
errant hawk
#

actually yeah, seeing the normals on the blades suggests it's what I should actually do

sinful cipher
sinful cipher
#

And then angle the individual blades like one would on a real heli to steer it and go up and down

errant hawk
#

you could use a logrithmic spline that transitions the blade from one angle to another

sinful cipher
#

Worked super well. As long as you did a decent job with the wing segment physics

#

But if I have to be honest: I kind of regret taking this approach, at least for simulating modern fighter jets.

devout prairie
errant hawk
sinful cipher
#

Modern fighter jets really make use of surfaces at the front changing the airflow before it reaches surfaces at the rear. You can't really do that with this 'surface normal' approach. Or at least its not very intuitive, and definitely hard to do in ECS.

#

A particle/vector grid makes much more sense in that regard.

devout prairie
sinful cipher
#

But that shit hard lol

errant hawk
devout prairie
errant hawk
#

air is going to flow in a pre-defined direction, so with a few params you could deterministically simulate airflow

errant hawk
#

no optimizations yet

sinful cipher
# errant hawk you could always fake air flow

Yeah but endlessly tweaking like 20 wing parameters to get the behaviour it should have really starts to suck after a while. Like look at this Curve. It was done by hand. And I need one for the tip of the wing, the middle, the sharp leading edge, the vertical tail, the horizontal tail...

#

And thats just for 1 plane

#

I really want to just simulate it all and be done with it

#

And after all that trouble I dont even get airflow interaction between 2 wing surfaces

errant hawk
#

do you know of any external software that does simulations? I think you could export the curve data into a file and port that over to unity mono/ecs

sinful cipher
errant hawk
#

you could then "animate" between the different air current directions

sinful cipher
errant hawk
#

are you apart of the vehicle physics server?

#

there's some good stuff in there

sinful cipher
#

If you intend to make simple planes (classic '+' shape I guess ill call it) then your idea should be sufficient for good simulation

errant hawk
#

Yeah I dont need to recreate MS flight simulator lol

#

does everything you're talking about

sinful cipher
#

But for some plane the airflow interaction becomes more complex. Here a vortex is created from the airflow before it washes over the main wing

sinful cipher
sinful cipher
#

Surface normal trick like you suggested should indeed do

errant hawk
#

yeah but I will make it a little better than just a normal direction

sinful cipher
errant hawk
#

damit

#

XE5e87xq

#

there thats the end of the link lol

sinful cipher
sinful cipher
#

Ah yes got it

errant hawk
#

I'll just dm you the link kek

sinful cipher
#

no its alright i got it lol

errant hawk
#

ah ok lol

viral sonnet
errant hawk
viral sonnet
#

oh cool, so not even just for unity?

errant hawk
devout prairie
dense storm
#

What's the difference between the 2?

#

Which one do I have to move to move my object?

devout prairie
dense storm
#

In what case do you want to move the LocalToWorld float4 value?

rustic rain
#

in which

#

translation + rotation + any type of scale

#

create local to world

#

automatically

dense storm
#

I see, thanks!

devout prairie
#

LTW is generally more useful to read and get final pos/rot from

#

Whereas if you want to actually set pos / rot it's best to use Translation and Rotation, as the transform system then reads those and factors in scale to create the entities final matrix etc

dense storm
#

Is it safe to read data from that Transform component's Transform.Value.transform.position? And does it actually read the gameObject's current transform?

#

And one of my script which does not implement IConvertToEntity ends up being in the entity's component

#

Called Tester, how do I prevent that?

rustic rain
#

it's the slowest way to read position

dense storm
devout prairie
#

Accessing Transform is technically random access as your getting the game object out of other memory so it's best to avoid

rustic rain
dense storm
#

Yes, ConvertGOToEntity > Inject

rustic rain
#

oh well

#

don't use that

#

it will be removed in next version

devout prairie
#

It'll exist so that the transform game object system can take the final entity translation data and apply it to the gameobject

#

Sorry slow, pc crashed while I was typing lol

dense storm
#

So I create my own script that converts everything that implements IConvertToEntity?

#

Hmm I'll give it a go

devout prairie
#

Dots seems to consume my gpu and doing anything else you intensive on the pc whilst using unity tends to cause problems

rustic rain
#

there's conversion pipeline

#

use it

#

in other words

#

put your gameobject to convert into subscene

#

it will be converted as soon as you close it

devout prairie
#

Dont forget to cross your fingers and click your heels together three times

#

I've found that helps to get it working as expected

dense storm
#

Ok thanks, that's a lot to read and understand, will take my time on it

karmic basin
dense storm
# karmic basin Yeah read the official manuals at least twice, will prevently answer a lot of qu...

Reading that, its not really clear when and what calls Convert() method on MonoBehaviours that implement IConvertGameObjectToEntity. Does it gets called automatically by ConversionSystem, and when GO with authoring is placed in a subscene?

And I still need my GO for hybrid workflow. Does the destroys the game object?

If I write a ConversionSystem, does it destroy my GO?

// Authoring component
class FooAuthoring : MonoBehaviour
{
    public float Value;
}

// Runtime component
struct Foo : IComponentData
{
    public float SquaredValue;
}

// Conversion system, running in the conversion world
class FooConversion : GameObjectConversionSystem
{
    protected override void OnUpdate()
    {
        // Iterate over all authoring components of type FooAuthoring
        Entities.ForEach((FooAuthoring input) =>
        {
            // Get the destination world entity associated with the authoring GameObject
            var entity = GetPrimaryEntity(input);

            // Do the conversion and add the ECS component
            DstEntityManager.AddComponentData(entity, new Foo
            {
                SquaredValue = input.Value * input.Value
            });
        });
    }
}
#

How do I create a one shot system that only runs once? Like a door open system? Removing Entity's component data after the system finished is a structural change and shouldn't be done right? So how do I do it correctly?

muted star
dense storm
muted star
#

what's the problem with that?

dense storm
#

Okay, I'll do tags thanks

devout prairie
#

I think the way to think about structural changes, adding/removing tags is:

#

If you're doing it on 10k entities regularly, maybe don't do that, find another way

#

For just occasional stuff like UI etc, it's probably fine

muted star
#

I'm currently syncing rotation and positions of different entities like this:

var translation = cloneLocalToWorld.Position + (mirroredLocalToWorld.Position - cloneLocalToWorld.Position);
EntityManager.SetComponentData(clone, new Translation {Value = translation});

var rotation = cloneLocalToWorld.Rotation.value + (mirroredLocalToWorld.Rotation.value - cloneLocalToWorld.Rotation.value);
EntityManager.SetComponentData(clone, new Rotation {Value = rotation});

EntityManager.SetComponentData(clone, new LocalToWorld { Value = mirroredLocalToWorld }) didn't work for some reason.

Surely there must be a a more straightforward way to do this?

rustic rain
#

just queries over all game objects and calls this method basically

#

but only during conversion (subscene or convert component)

devout prairie
muted star
#

Setting the LocalToWorld directly doesn't work for some reason, so I'm setting the Translation and Rotation instead

devout prairie
#

it is generally more advisable to write to Translation/Rotation unless you know exactly when and where you're setting LTW

#

Basically, the transform system takes the Translation and Rotation components ( and scale also ) and writes them to the LocalToWorld

#

LTW is probably in general more useful to read from than actually write to

muted star
rustic rain
#

off entities you sync with

#

if they are simply meant to follow you main entiites

devout prairie
#

That's a good idea actually

muted star
devout prairie
#

I take it just queries for all three ( and scale ) and so will skip updating LTW on any that don't meet that criteria

rustic rain
#

transform runs only if entity has one of those components

#

with change filter

devout prairie
#

Right

#

And the renderer will read the LTW right, so objects will still render ok with just that component i'd guess

rustic rain
#

yeah

devout prairie
#

ie they'll render in updated positions still

#

( obviously if you do do that - be wary of scale values not equal to 1/1/1 as you'd have to factor that in when setting the LTW otherwise it will result in skewing and all kinds of hell i believe )

half jay
#

is it possible to get chunk by value in SharedComponent? For example i want get chunk with entities which has Components with value = 1

rustic rain
#

you apply shared filter to query

#

and then you can get all chunks from it

half jay
#

but i need exactly by value.

rustic rain
half jay
#

ty

safe lintel
rotund token
#

i can finally talk about this
https://github.com/needle-mirror/com.unity.entities/blob/85dc36a489eb40741392d89c574c7a6013355379/Unity.Entities/EntityCommandBuffer.cs#L5441

            /// Entities in the <see cref="LinkedEntityGroup"/> that don't match the mask will be skipped safely.</summary>
            /// <remarks>Behavior at Playback: Will throw an error if the entity is destroyed before playback,
            /// if the entity is still deferred, if the entity has the <see cref="Prefab"/> tag, or if any of the matching linked entities do not already have the component.</remarks>
            /// <param name="sortKey">A unique index for each set of commands added to this EntityCommandBuffer
            /// across all parallel jobs writing commands to this buffer. The `entityInQueryIndex` argument provided by
            /// <see cref="SystemBase.Entities"/> is an appropriate value to use for this parameter. In an <see cref="IJobChunk"/>
            /// pass the 'unfilteredChunkIndex' value from <see cref="IJobChunk.Execute"/>.</param>
            /// <param name="e">The entity whose LinkedEntityGroup will be referenced.</param>
            /// <param name="mask">The EntityQueryMask that is used to determine which linked entities to set the component for.
            /// Note that EntityQueryMask ignores all query filtering (including chunk filtering and enableable components),
            /// and may thus match more entities than expected.</param>
            public void SetComponentForLinkedEntityGroup<T>(int sortKey, Entity e, EntityQueryMask mask, T component) where T : unmanaged, IComponentData```
#

i think this is a really cool/useful feature for initialization

rotund token
#

Convert IJobEntityBatch and IJobEntityBatchWithIndex to IJobChunk
we've done full circle

half jay
#

and what about Render system? Does its still no have gles3 support?

rotund token
#

haha there's as many errors as i expected and this upgrade is going to take a while

#

be a while before i get to looking at rendering ๐Ÿ˜„

half jay
#

im only installing Unity 2022b right now ๐Ÿ˜„

safe lintel
#

just reading the transform and physics changes, yeah converting conversion to bakers is the least of my worries

karmic basin
#

Not gonna lie, did not expect an update so soon

#

Might be time to jump back into dots ๐Ÿ˜‹

whole gyro
#

Woohoo!

viral sonnet
#

We are still working on making the physics and netcode systems compatible with the improved transform system.
what does this even mean? is it working?

whole gyro
#

Interesting, I thought the transform system improvements were coming later. But it seems like its already here?

wraith hinge
#

i mean, it's there, but because it doesn't work with physics or netcode, it's not super useful yet

honest plinth
karmic basin
#

That's what the "critical fixes to come in next patches" are about ?

#

Known bugs ?

viral sonnet
#

Each system has an entity associated with it, used to store per-system data. This approach should be preferred over adding public fields to ECS systems.
that's nice

rotund token
#

oh that's really useful for serialization

#

if i can figure out how to write back to it easily on load

whole gyro
rotund token
#

well my saving saves entities

#

i could save state from a system if i required

#

previously i just made my own entities and stored the data on it anyway

safe lintel
#

@wraith hinge so physics is planned to be integrated with the new transform system?

rotund token
wraith hinge
#

yep and yep, for the time being

#

the general hope and intent is that v2 should replace v1 over time, but some work to do before that can happen

rotund token
#

i am so confused what is happening with native hash maps

#

has NativeParallelMultiHashMap been removed again and changed back to NativeMultiHashMap

#

but there is still a NativeParallelHashMap

raw mica
rotund token
#

trying to figure out what to do with my libraries

#

because i have a few extension methods complaining about v2 changes

hot basin
#

how's that 1.0 rolling out?

karmic basin
#

"New features like motors and breakable joints "
Happy to read that ๐Ÿ™‚

raw mica
#

has NativeParallelMultiHashMap been

whole gyro
#

Is the TransformAspect only a thing for transforms v2?

hot basin
#

oh they even addressed acquisition of the Rivial asset

whole gyro
#
      if (healthData.Left > 0)
        SystemAPI.SetComponent(friendlyOgreEntity, healthData);
      else
        state.EntityManager.SetComponentEnabled<AliveTag>(friendlyOgreEntity, false);

I noticed this in the ISystem example. Seems like there should be a SystemAPI.SetComponentEnabled<>. Can we assume this will be added in a future version?

devout prairie
devout prairie
karmic basin
#

๐Ÿ™‚ I was asking a few days ago to see if I start my New project with dots... Welp I got my answer now ๐Ÿ˜„

rotund token
whole gyro
rotund token
#

like
SetComponent (New CreationTime {Time = time})

#

and not care if anything needs the data or not

#

maybe a designer thinks at some point, having creation time on this entity would be useful, they can just add it in the editor

#

and it'll be set next time

viral sonnet
#

tertle, is your SharedStatic working? it get compile errors in my libs

rotund token
#

SharedStatic is a burst feature

#

oh you mean can i compile with it?

#

i haven't fixed compile errors yet in just my core library

viral sonnet
#

even for BurstCompile tag

rotund token
#

well i have no issue with burst compile tag

viral sonnet
#

lol i dunno maybe i have too many errors ๐Ÿ˜„

rotund token
#

seems fine

viral sonnet
#

weird stuff

#

oh maybe my asmref is broken

rotund token
#

ok runtime no compile errors

#

onto authoring/editor

#

gah Inspector is gone lies just made internal

devout prairie
#

i thought enableable components wasn't coming till later, that's nice

#

there's a ton of nice stuff in this, top marks to everybody involved

whole gyro
viral sonnet
#

i don't know yet

whole gyro
#

This is neat

Added OptionalAttribute, used for declaring optional components inside an aspect declaration.

devout prairie
#

Yeah this is a really big step forward for DOTS. Exciting times. It's laying the groundwork for the next generation of Unity games which are going to be, something else entirely.

viral sonnet
#

CDFE renamed to ComponentLookup - much better name

half jay
#

@rotund token will you update your EventSystem package? our team heavily using it

rotund token
#

i will definitely update 2.0 branch (today probably)
I will see how broken 1.x is

#

ideally yes i will do it for others sake

half jay
#

we are already on 2.0 now. tyvm

rotund token
#

ok 2 hours later, core library compiling

whole gyro
#

This seems useful for serialization

Added TypeManager.HasDescendants(), TypeManager.IsDescendantOf(), and TypeManager.GetDescendantCount() for checking the inheritance relationship between types.

rotund token
#

nice surprise at a 4am wakeup today

whole gyro
# viral sonnet

Cool thanks! It looks like there is a SystemHandle property you can call on systems (or SystemState if in ISystem)

viral sonnet
#

look like i don't need my lib anymore ๐Ÿ˜„

#

hm, not quite. can't get the ptr. it's private

rotund token
#

best news is ComponentSystemGroup is now a SystemBase

viral sonnet
#

still a step up to having no ref values at all

#

@wraith hinge please add the ability to get the pointer to RefRO/RW struct ๐Ÿ™‚

wraith hinge
#

i feel like you can if you're determined

viral sonnet
#

with UnsafeUtility.AddressOf?

wraith hinge
#

exactly

#

on the result of ValueRW

viral sonnet
#

that's exactly what i don't want to do ๐Ÿ˜„

wraith hinge
#

errr... you want a pointer but you don't want to say addressof?

viral sonnet
#

i have no idea what burst does with it but a chain of UnsafeUtility.AsRef<T>(_Data) and UnsafeUtility.AddressOf() is not that great when byte* is directly in the struct and I could just call GetPtr and it returns byte* _Data

wraith hinge
#

burst is very happy about it; it's a no-op, i believe. (for burst, a ref is just a pointer anyway.)

#

in mono it might add an extra function call, because mono is bad at inlining. but burst is great at inlining, so nevermind

#

put another way, if you find out that asref and/or addressof is slower in bursted code than just talking about a raw pointer, i hypothesize the burst team would treat that as a bug and fix it; not least because we use it everywhere ourselves and rely on it being fast

viral sonnet
#

ah that's cool then if it translates to no op. currently rewriting my lib that exposed pointers in CDFE. looks like everything is covered - even public bool TryGetComponentPtrRW(Entity entity, out T* ptr) can be made with the RefRO/RW

wraith hinge
#

i'm also curious what the use case is for the ptr over the refrw

rotund token
#

Physics got a big update, I like

#

Finally setup how I feel it should be, no longer needing system access or setting up dependencies

#

(also supports scale)

whole gyro
#

Limitations
Code in the foreach body always runs on the main thread (until foreach is supported inside IJobEntity).
You must use the RefRO and RefRW generic types to iterate through components. RefRO indicates read-only access and RefRW indicates read-write.
You can iterate up to 8 aspects or components in the same foreach statement.
You can't query dynamic buffers in a foreach statement.
You can't save a query in a variable, field, or property and then reuse it multiple times.
You can only perform a foreach iteration over a Query<T>() inside a method that has a ref SystemState parameter.

Reading through the upgrade guide on the new idiomatic foreach. Surprised to see that dynamic buffers aren't supported. Is that planned?
Also, there is mention of foreach maybe being supported in IJobEntity at some point. I'm curious if that is true and what that would even mean since the IJobEntity interface is already per-entity.

half jay
#

does physics got improvement in performance ? i got problem when in run time creating a lot of colliders BuildPhys system took a long time to execute

rustic rain
#

wait what 1.0 is here?

viral sonnet
rotund token
wraith hinge
rustic rain
#

I'v been reading into this convo and wondering why suddenly Unity devs around ๐Ÿ˜…

rotund token
safe lintel
#

i asked in the 1.0 thread but might as well ask here, is a 1.0 preview package for havok planned?

wraith hinge
#

i would have thought so, but i can never predict licensing/legal stuff accurately myself

devout prairie
#

anybody care to do a tldr on physics update?

rotund token
#

The changelog has an upgrade guide

#

Front facing its really just about system ordering and world access

whole gyro
# devout prairie anybody care to do a tldr on physics update?

Reading the changelog now. But main things I've seen so far:

  • They totally reworked how all the systems are organized.
  • You no longer need to fetch the PhysicsWorld or Simulation from systems. Instead you go through new singleton components.
  • Dependencies are now automatic (no more RegisterPhysicsSystemsReadOnly, etc.).
  • Uniform scale now works.
devout prairie
#

ah yeah reading this now, thanks

#

so getting PhysicsWorld using GetSingleton i guess is in line with all system variables now being stored on entity

rotund token
#

Netcode didn't get the memo ๐Ÿ˜…

viral sonnet
#

any idea why my package throws this error? LocalPackages\com.unity.entities.exposed@0.1\DynamicHashMap\DynamicHashMapData.cs(314,10): error CS0246: The type or namespace name 'NotBurstCompatibleAttribute' could not be found (are you missing a using directive or an assembly reference?)

rotund token
#

RegisterPredictedPhysicsRuntimeSystemReadWrite and RegisterPredictedPhysicsRuntimeSystemReadOnly extension methods, for tracking dependencies when using predicted networked physics systems.

rotund token
whole gyro
wraith hinge
#

similarly burstcompatible renamed to [GenerateTestsForBurstCompatibility]

#

the exclude is not scriptupdatable because you have to provide a reason now

viral sonnet
#

thanks!

rotund token
#

Are you using a copy of my dynamic hash map enzi?

wraith hinge
#

(unless you are very determined, i very much doubt you were actually getting anything out of those attributes; they only do anything if you proceed to run the codegeneration that knows about them AND then make a player build afterwards)

rotund token
#

It's already fixed in my 0.9 branch

whole gyro
#

Perhaps a dumb question but I didn't see it in the upgrade guide. Are we supposed to upgrade to unity and the ECS packages at the same time? And should I use the latest unity 2022.2 beta?

wraith hinge
#

yep and yep

viral sonnet
whole gyro
errant hawk
#

I wonder how long it will take to convert my project to 1.0

viral sonnet
#

seems to go a bit deeper as I'm getting Burst and mathematics errors. burst namespace can be found though. mathematics doesn't

devout prairie
#

Really nice to see physics has had some love

#

Cleaned up and a couple of nice features added

#

I can sortof understand why Animation has been deferred, given the level of changes all round

#

I'd guess work on that might continue after the move out of experimental

whole gyro
#

Besides removing/replacing [GenerateAuthoringComponent], is there anything else that should be done before updating?

rustic rain
#

hmmm

#

is there an aspect type handle?

errant hawk
#

@wraith hinge are there any sample projects we can test 1.0 with?

raw mica
rustic rain
#

PhysicsWorldSingleton worldSingleton = SystemAPI.GetSingletonRW<PhysicsWorldSingleton>();
Very interesting, I'v been using same approach in 0.50 ๐Ÿ˜…

#

not quite sure about the idea behind SystemAPI
Is that codegen?

safe lintel
#

we dont need to register rw or ro for physics systems now?

#

i am totally failing where to find the physics upgrade docs ๐Ÿ˜„

#

ah wait it was just the changelog for now I guess

raw mica
rustic rain
safe lintel
rustic rain
#

I am so glad everything is getting actual ECS structure

#

which is also fully unmanaged

balmy thistle
#

Including unmanaged shared components

rustic rain
#

ok, baking sounds interesting

devout prairie
#

it mentions in the physics changelog one of the sample scenes:

#

are updated samples available?

rustic rain
#

sounds like open subscene won't be as buggy

rustic rain
devout prairie
rustic rain
#

Transforms look weird

#

reeeeaaaally weird

#

no more Translation, Rotation...

devout prairie
#

ah really?

rustic rain
#

looks like

#

NonUniformScale is gone too

#

I'm a bit lost

whole gyro
rustic rain
#

huh

#

I am guessing

#

Transforms are now... all in one components

raw mica
errant hawk
rustic rain
#

yeah, the whole idea was a huge mess

viral sonnet
#

RegisterPhysicsRuntimeSystemReadOnly can just be removed now?

rustic rain
#

when amount of scale opportunities

#

has rose to 3

whole gyro
errant hawk
#

how do I get the physics world so I can cast rays and such?

whole gyro
# errant hawk how do I get the physics world so I can cast rays and such?

Retrieval of PhysicsWorld is achieved differently. Previously, it was necessary to get it directly from BuildPhysicsWorld system. Now, PhysicsWorld is retrieved by calling (SystemAPI|SystemBase|EntityQuery).GetSingleton().PhysicsWorld in case read-only access is required, and by calling (SystemAPI|SystemBase|EntityQuery).GetSingletonRW().PhysicsWorld in case of a read-write access. It is still possible to get the world from BuildPhysicsWorld, but is not recommended, as it can cause race conditions. This is only affecting the PhysicsWorld managed by the engine. Users still can create and manage their own PhysicsWorld. Check out documentation for more information.

errant hawk
#

ah ok must have missed that part

#

oh under the physics package... go figure

whole gyro
#

haha yeah, but it took me a while to figure out that the physics upgrade guide was inside the changelog

safe lintel
#

upgrading is pretty wild, just drifting around in a sea of red

devout prairie
#

sad that Entities.ForEach is going in the bin

#

my dear friend

#

idiomatic foreach looks good though

#

ok i think i get what Aspects is doing

#

that's pretty nice, i like it

#

should remove a ton of boilerplate crap

rustic rain
#

doesn't seem like ECB is usable in 1.0 yet

#

I mean

#

with ISystem

rotund token
#

How are you trying

rustic rain
#

I don't, I simply look at manual

#

And it still says to use system reference

#

To create ecb

#

Hmmm

rotund token
#

Pretty sure it says to use system api

rustic rain
#

Is there anything else besides registration in type manager required to register generic component

viral sonnet
#
        var ecbSingleton = SystemAPI.GetSingleton<BeginSimulationEntityCommandBufferSystem.Singleton>();
        var ecb = ecbSingleton.CreateCommandBuffer(state.WorldUnmanaged);```
rotund token
#

Yeah that ^

rustic rain
#

Where type of generics doesn't affect struct?

rotund token
#

This upgrade is going surprisingly smoothly for me

rustic rain
#

I wonder if Unity can add hook to register generics with reflection

rotund token
#

My heavy use of decoupled libraries and standalone projects probably helps as I can just upgrade 1 at a time

rustic rain
#

Did they implement codegen?

rotund token
#

But just off the api stuff isn't too breaking

rustic rain
#

To generate struct for each ECB?

rotund token
rustic rain
#

I meant ECB specifically

rotund token
#

Not sure about that?

raw mica
#

Is there anything else besides

errant hawk
#

damn selecting an entity causes everything to fall through the ground :C

viral sonnet
#

GenerateAuthoringComponent has been deleted or am I just having a reference problem?

rotund token
#

Yes

#

Gone

#

It's in the upgrade guide

viral sonnet
#

haha, man I'm glad I only have a couple of them

errant hawk
rotund token
#

Is there any documentation of what system api generates under the hood if I need the functionality but somewhere code gen won't run

#

Or do I just need to inspect the generated code

rustic rain
#

That's what I usually do

#

Although pretty sure you can look through codegenetators

#

But they are probably way more confusing

rotund token
#

What I intend to do but just for speed of updating I'd rather leave source code reading to when it can actually compile

errant hawk
#

Im really liking the baking API

#

much simpler than before

safe lintel
#

I also like it, more streamlined than the original mouthful api

errant hawk
#

yeah

rustic rain
#

Do bakers support update after?

safe lintel
#

still unsure how you use DeclareReferencedPrefab etc with it though

rustic rain
#

Constraints

rustic rain
#

You simply get entity now

errant hawk
#

GetEntity()

rustic rain
#

Seems like registration is inside of it now

rotund token
#

GameObjectConversionSystems still seem to work now? (though they use SystemBase instead so need api udpates)

#

i will deal with those later

viral sonnet
#

tertle, did you already upgrade Inspector? seems gone

rotund token
#

yes

#

i found the new one

#

it's in Unity.Platforms.UI

#

and internal

safe lintel
#

I keep getting errors about how my GameObjectConversionSystem need to use .run or structural changes and then it disappears when i fix another error so want to get rid of them now

viral sonnet
#

thanks

rotund token
#

which had only entiites foreach main thread

#

no schedule option etc

#

you just have to add WithStructuralChanges().Run()

#

to them all

safe lintel
#

still get errors after adding those things but maybe just due to how many other errors I still have yet to fix

sage wave
#

Is dots replacing OOP? Or is it just optional?

I'm making a game in Unreal but I'm trying to make the switch to Unity once it's done

rotund token
#

'Implicit cast from NativeList<T> to NativeArray<T> has been deprecated; Use '.AsArray()' method to do explicit cast instead.'

#

I love that change

#

that caused so many bugs

errant hawk
#

wow converting to the baking system was pretty painless

#

all I had to do was add properties

#

and add authoring. at the start

#

along with rename and remove some methods/params

rotund token
#

ok where did Filter run off to in physics

#

oh GetCollisionFilter SetCollisionFilter

errant hawk
#

Damn working with cameras is still annoying af

rotund token
#

is there no way to nuke subscene data to regenerate it?

errant hawk
rotund token
#

in 0.51 and below

#

there was a window you could clear subscene data to fix errors

#

like

#

Loading Entity Scene failed because the entity header file couldn't be resolved.

#

i have a completely empty subscene but i'm getting errors like

#

[Worker0] Exception thrown during SubScene import: System.TypeInitializationException: The type initializer for 'Unity.Entities.Conversion.CompanionComponentSupportedTypes' threw an exception. ---> System.ArgumentException: Unknown Type:`UnityEngine.Rendering.Volume` All ComponentType must be known at compile time. For generic components, each concrete type must be registered with [RegisterGenericComponentType].

#

oh maybe i need a render pipeline installed

#

let me throw in urp

errant hawk
#

have you restarted the editor? I noticed some errors went away after that

rotund token
#

yeah

errant hawk
#

ok yeah I think a render pipeline is needed

rotund token
#

i was testing my library compiled with hybrid renderer

#

so i just installed it

#

so makes sense it's not working without a pipeline

#

im not rendering anything atm, just testing scripts compile

viral sonnet
#

clear entities cache is gone too

errant hawk
#

only thing left is the upgrade physics

safe lintel
#

so sneaky, got down to 5 errors in my packages fixed one and then like 100 new ones popped up after another updater ran๐Ÿ˜…

whole gyro
#

Has anyone successfully gotten a custom ECB system to work?
The upgrade guide says to implement your own Singleton type. I copied the one from one of the built-in ECB systems but the implementation uses an internal PendingBuffer field.

rotund token
#

i need to remember what empty, mixed, orange buttons mean ๐Ÿ˜„

#

but its cool switching between these views

#

just getting a few random uielements errors on isnpecting though

#
UnityEditor.GameObjectInspector.OnDisable () (at <dbec13b8891f4cb392de8ec34da2cbaf>:0)
UnityEditor.InspectorWindow:OnEnable()```
#

not very descriptive on why...

safe lintel
#

yeah even when that video came out thought a circle changing colors was like a really cryptic way of showing state change

rotund token
#

i am seeing one huge annoying issue though

#

you know those new entities tied to systems? well they're all in the inspector

whole gyro
#

lol

rotund token
#

i have 0 of my own systems in this project

#

this is just built in ones

whole gyro
#

Are those entities empty by default?

raw mica
#

@rotund token That is a bug on our end

errant hawk
#

or like a little drop down similar to the shader modes

rotund token
#

LinkedEntityGroup still exists in chunks ๐Ÿ˜ข

raw mica
#

Systems now have an entity mapped to them which allows systems to carry state inside components rather than the system instance itself. However you should not need to know about that entity unless you've explicitly set data on it

rotund token
#

please can we make it 0 size ๐Ÿ™

#

i literally gain 50% performance in some of my libraries by removing this

devout prairie
#

was thinking even if things are grouped by linked entity group or something

#

just meaning visually in the inspector fwiw

rotund token
#

i am slightly confused, i can't seem to select the gameobject representation at runtime

#

i thought this was part of the workflow

whole gyro
devout prairie
#

i guess kindof like a layers system in any dcc app

#

the ability to group and show/hide based on type or some arbitrary collection criteria

rotund token
#

Journaling window โค๏ธ

devout prairie
#

having 10k bullet entities all show up etc isn't really ideal, would make sense to just group them in the inspector and show collapsed group headers

#

similar to ordinary hierarchy view

rotund token
#

blah, entities hierarchy is still any query

#

ok got to fork that and make it AND

wraith hinge
rotund token
#

aha! thanks

wraith hinge
#

along with a bunch of other formerly dots menu things

rotund token
#

ah and it has my next question already answered, journaling memory

viral sonnet
#

nice thanks

whole gyro
#

hmm, yeah I don't understand how to make a custom ECB system with the public API

#

But it looks like ECBSystem.CreateCommandBuffer is still there so I can just use GetOrCreateSystemManaged and do things the old way

viral sonnet
#

so, compiler errors gone. now i'm left with InvalidOperationException: The previously scheduled job ParallelList`1:ParallelListToArraySingleThreaded writes to the Unity.Collections.NativeList`1[NZSpellCasting.ThreatEvent] ParallelListToArraySingleThreaded.array. You must call JobHandle.Complete() on the job ParallelList`1:ParallelListToArraySingleThreaded, before you can write to the Unity.Collections.NativeList`1[NZSpellCasting.ThreatEvent] safely. which is a weird one because the scheduling is handled and worked before. ๐Ÿค”

wraith hinge
#

the point of the singleton is just so that you can create ecb's to be played back by that system from a bursted isystem. if you don't plan to do that, don't worry about the singleton thing

whole gyro
whole gyro
wraith hinge
#

it's intended in that we have clearly found that bursted isystems are by far the fastest thing in town, and so given that speed is, uh, pretty core to dots, we feel guilty about recommending defaults that aren't the fastest

errant hawk
#

Will cameras ever be ECS supported?

whole gyro
wraith hinge
#

...i would think so? because you obviously can't call that from a bursted isystem, and we have made command buffers from jobs in bursted isystems in e.g. netcode... so it better not need that... i'll ask around.

viral sonnet
#

the new splash screen is great. the chosen image though ... ๐Ÿคจ

wraith hinge
whole gyro
# wraith hinge ...i would _think_ so? because you obviously can't call that from a bursted isys...

I know this isn't the intent of the change, but personally I would love it if all I need to work with ECBs is this one-liner:

EntityCommandBuffer commandBuffer = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>()
            .CreateCommandBuffer(World.Unmanaged);

Instead of the old way:

private EntityCommandBufferSystem _commandBufferSystem;

_commandBufferSystem = World.GetOrCreateSystemManaged<EndSimulationEntityCommandBufferSystem>();

EntityCommandBuffer ecb = _commandBufferSystem.CreateCommandBuffer();

_commandBufferSystem.AddJobHandleForProducer(Dependency);
errant hawk
#

also, only the directional light works (still)

wraith hinge
#

it's a plausible idea i suppose? i'm not aware of any concrete plans though

errant hawk
#

I just find it odd how sound is potentially getting ECS support but the #1 most used component, isnt (camera)

#

same with lighting

whole gyro
#

I really appreciate the unity devs that have been hanging out here and helping us with the upgrade

rotund token
#

finding first time i select an entity after a domain reload i always get an argument exception

Parameter name: _unity_self
UnityEditor.UIElements.InspectorElement.GetOrCreateEditor (UnityEditor.SerializedObject serializedObject) (at <dbec13b8891f4cb392de8ec34da2cbaf>:0)
UnityEditor.UIElements.InspectorElement.Reset (UnityEditor.SerializedObject bindObject) (at <dbec13b8891f4cb392de8ec34da2cbaf>:0)
UnityEditor.UIElements.InspectorElement.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at <dbec13b8891f4cb392de8ec34da2cbaf>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetAndDefaultPhase (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at <f05d71c29e974cdca581869c2af9adb3>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <f05d71c29e974cdca581869c2af9adb3>:0)```
#

then it works fine until next domain reload

errant hawk
rotund token
#

yeah im just going to debug it a little to see if i'm causing it somehow

#

i thought it might be my custom inspectors but i deleted them all and still happens

rotund token
#

fell and stopped as expected

errant hawk
#

no no, only happens when I select an entity in the scene viewport

rotund token
#

in scene view? how are you selecting an entity

#

oh wait you can

errant hawk
#

by clicking on it

rotund token
#

but yeah that works fine for me as well

worn stag
#

it's happening to me too when subscene is opened

#

when closed it's ok

rotund token
misty wedge
errant hawk
#

Its a shitty ball pit to drive my vehicles through lol

whole gyro
#

Does the new entities graphics package still support the MaterialProperty attribute?

viral sonnet
#

huh, so IConvertGameObjectToEntity doesn't convert anything anymore. the mention would have been nice ๐Ÿ™‚

devout prairie
# errant hawk

this may sound idiotic and might completely not be the issue but try reducing the size of the floor plane

rotund token
#

replace it with PropertyInspector

devout prairie
#

i had an issue recently after increasing the size of the ground, things started to wonk out completely until i finally figured it out and reduced the size of it again

rotund token
#

and it'll work again!

#

(unity really needs to add this inspector)

viral sonnet
#

thanks! yeah, the Inspector should belong to Entities

rotund token
#

there's also a
PropertyInspector<TValue, TAttribute>

#

where you can draw for a specific attribute

viral sonnet
#

hm, does that help in our buffer problem?

rotund token
#

nah i dont think so

#

i havent tested it yet

#

but i assume it just allows you to custom draw a specific int etc somehow different

rotund token
viral sonnet
#

was expecting that too. i'll rename it and then write the bakers to not miss any

rotund token
#

hmm is DeclareAssetDependency still needed?

#

from what i understand DeclareReferencedPrefabs is no longer

#

but that's quite different

#

hmm seems like i might, but i can't seem to do it from baker

viral sonnet
#

have you tried DependsOn?

#

baker can't remove comps?

rotund token
#

i searched asset far and wide

viral sonnet
#

np, have you found a way to get rid of LinkedEntityGroup and the likes? i see no way to remove. other thing i'm trying currently is to call a baker from another baker. that was working very easily before with static methods

rotund token
#

can't still use GameObjectConversionSystem?

#

it still seems supported to me by the fact physics still seems to use it

#

(haven't tested)

viral sonnet
#

oh right, i think i read code from you where you were adding a comp to trigger a removal in a GOCS. that could still work with a bakersystem

#

i'll probably have to rethink my approach to support individual authoring comps and full authoring comps that handle a group of them

#

wait, can we bake aspects?

rotund token
#

i know we probably aren't meant to pass IBaker through a chain of objects

#

but doing this instead of all the old conversion stuff has made my code so much cleaner

viral sonnet
#

can you post what you are doing?

rotund token
#
    {
        public override void Bake(SettingsAuthoring authoring)
        {
            if (authoring.Settings == null)
            {
                return;
            }

            foreach (var setting in authoring.Settings)
            {
                if (setting == null)
                {
                    Debug.LogWarning("Setting is null");
                    continue;
                }


                this.DependsOn(setting);
                setting.Bake(this);
            }
        }
    }```
#

oh that's all

#

this is how i setup all my settings entities

viral sonnet
#

i'm fumbling around with this. how does authoring.Settings look that you can call Bake on it?

rotund token
#
    {
        [SerializeField]
        private Settings[] settings;

        public Settings[] Settings => this.settings;
    }```
#

Settings is just

#
    {
        public abstract void Bake(IBaker baker);
    }```
safe lintel
#

System.InvalidOperationException: The BlobAssetReference is null. well thats not good, physics isnt converting on a default cube. not an empty project but i dont think my packages should be breaking the baking system

viral sonnet
#

ok thanks, i need to utilize the IBaker too

late mural
#

wondering are there any major breaking changes going from 0.51 to the experimental 1.0.0 thing?

viral sonnet
#

lots ๐Ÿ˜„

late mural
coarse turtle
#

what's a way to grab an unmanaged system? Seems like getting the systemHandle.Struct is no longer valid with 1.0. (Although I guess in actuality, I guess I should move some inter dependent stuff into a different location)

late mural
#

i was just about to start work on getting nvidia flex (fluid simulation thing) working with dots, is 1.0 stable enough, and/or better than 0.51 currently?

rotund token
#

bit early to say (stability)

#

you'd hope it's better though

viral sonnet
#

we'll have to wait a bit for performance tests as we are in the middle of rewriting

late mural
#

understandable, thanks for the info yall!

rotund token
#

extensions not all tested so good chance some of them are broken but will be tested as I work through my libraries that depend on them

#

unfortunately have to do some actual work

viral sonnet
#

this is my boilerplate now so i can call bake from other bakers ```public class AvatarAnimationState_Authoring : MonoBehaviour
{
public static void BakeMethod(IBaker baker)
{
baker.AddComponent(new AvatarAnimationState());
}

    public class Baker : Baker<AvatarAnimationState_Authoring>
    {
        public override void Bake(AvatarAnimationState_Authoring authoring)
        {
            BakeMethod(this);
        }
    }
}```
viral sonnet
#

there's probably a better solution but i have way too much comps to go through to think about it much ๐Ÿ˜„

misty wedge
#

Any sense in getting the 1.0 upgrade out of the way now or do you think things will change significantly until it becomes stable?

viral sonnet
#

so before i make any dumb mistakes. calling GetEntity inside a baker will return me what was once the Entity entity parameter in IConvert, right?

viral sonnet
misty wedge
#

I use almost no authoring code, so I should be fine on that front

#

Looking over the migration stuff there are quite a few things though

viral sonnet
#

lucky you ๐Ÿ˜„ then you can chill a bit and wait what others say about the version. hard to tell right now. but also nice to leave unity 2021 behind ๐Ÿ™‚

misty wedge
#

Ah, it supports 2022 now?

viral sonnet
#

yes, 2022.2.0b8

#

new job system should be also included

misty wedge
viral sonnet
#

the same thing but faster ๐Ÿ™‚

misty wedge
#

Ah ๐Ÿ˜…

#

Guess I'll upgrade tomorrow

#

Aspects are... interesting?

viral sonnet
#

there's a pretty good chance i'll write bakers in my dreams today

late mural
#

wondering does dots 1.0 work on the 2022.1 version, or only on the beta .2 version?

whole gyro
late mural
whole gyro
late mural
#

got it, thanks a ton!

viral sonnet
#

oh this sucks. i thought we moved beyond this InvalidOperationException: Baking error: Attempt to add duplicate component NZSpellCasting.TargetableTag for Baker Avatar_Authoring_Baker with authoring component Avatar_Authoring. Previous component added by Baker NpcComponent_Authoring_Baker

#

EntityManager didn't care about this. Now I wonder how I can even catch this

rotund token
#

i cant say for certain but i think it could be related to incremental conversion desire

#

ideally you only need to re-bake what changes

#

not certain this is a thing atm (it might be) but from what i've seen of code it's desired and imo would be great for performance

viral sonnet
#

baker has no HasComponent

#

what's even worse is that it is an exception

rotund token
#

I would assume the whole
Authoring <===> Runtime
Concept basically relies on mapping 1:1

viral sonnet
#

oh well, time to fix my authoring ๐Ÿ˜„

rotund token
#

(well 1 to many would be fine as well)
(again just speculation why the restriction might exist)

viral sonnet
#

eh, makes sense anyway. way too much weird bugs could happen with unclean setup. got it working, i have only screwed up one comp in this chain of authoring comps

#

now everything seems to work except for my spawner lol

#

7 hour rewrite. the downside of being just one dev

#

bakers were the most time consuming. wish they had a simple codegen for upgrading ๐Ÿ˜…

rotund token
#

im 1/14 libraries down

#

most libraries only have 1 (many 0) authoring script though

#

so i don't expect that part to be to hard

viral sonnet
#

14? ... sheeet

viral sonnet
#

doc writers have gone above and beyond for this sample ๐Ÿ˜„ [WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)] partial class BakingOnlyEntityAuthoringBakingSystem : SystemBase { protected override void OnUpdate() { // โ€ฆ Your code here โ€ฆ } }

safe lintel
#

you guys moved your GetComponentTypeHandle's to OnCreate? do we just store them as system fields now?

#

got so many warnings about that in only my packages, dont want to think about the main project

viral sonnet
#

yes, since 0.51

#

how can we get entity with a SystemAPI.Query? - found it foreach (var (translation, entity) in SystemAPI.Query<Translation>().WithEntityAccess())

safe lintel
#

ahh that was a thing in 51? I never got warnings about it there ๐Ÿ˜ฆ

viral sonnet
#

there were no warnings but we were able to create once and then call update

#

i have some unwanted systems running now, like LocalToParentSystem ๐Ÿคฎ but other than that, every job runs a bit slower. reason might be the overall timing but the first tests are disappointing. @rotund token pretty interested how fast your stat system will be

rotund token
#

Oh yeah I'm going to benchmark and compare to my 0.51 benchmarks I did earlier this week, I have them saved

#

3rd or 4th on list of libraries to update just because of this curiosity.

#

When I clock off see how many I can get done tonight

safe lintel
#

@viral sonnet it also gave message to update the handle, did you do that in 51 too?

rotund token
viral sonnet
#

haven't found a way sadly

#

WithEntityAccess needs the Query and Query() alone doesn't work

#

looks quite ugly ๐Ÿ˜„

rotund token
#

State entity manager create query?

#

Cached in on create

#

Just a regular ISystem isn't it

zenith stirrup
#

Anyone figured out how to work with SystemHandle, where we used SystemBase before?

"[...] error CS0029: Cannot implicitly convert type 'Unity.Entities.SystemHandle' to 'Unity.Entities.ComponentSystemBase'"

couldn't find any documentation on it

torn hornet
#

GetExistingSystemManaged<T>() will return the ComponentSystemBase instead of SystemHandle.

zenith stirrup
#

@torn hornet "GenerateAuthoringComponent could not be found" - do you happen to know how this works in 1.0 now? the release post didn't mention it either ๐Ÿ™‚

rotund token
#

it doesn't work

#

it's removed ๐Ÿ˜„

#

you must write a baker now

torn hornet
zenith stirrup
#

alight, thanks guys

zenith stirrup
#

quite excited to try 1.0

rotund token
#

tiny bit tedious to update everything but the Baker API is pretty clean so far

zenith stirrup
rustic rain
#

I guess authoring components now meant to be simple monos?

zenith stirrup
#

this does look a lot more simple indeed

dense storm
#

What happened to build configuration?

#

After upgrading to Entities 1.0.Experimental8 it all failed to import

#

No longer needed?

#

Its still in the context menu

honest plinth
pastel field
#

I didn't quite understand,
**Entities 1.0.0-exp.8 **is only available for Unity 2022.2.0b8 and later.
Does this mean that there will be no v1.0.0 for Unity 2021 LTS?

rotund token
#

no

#

This plan was announced quite a while ago

#

1.0 full release will likely come with or after the release of 2022.3 LTS

full epoch
#

is it safe to convert project to 1.0.0 are there some problems?

pastel field
rustic rain
#

so I'm 100% sure it's not safe ๐Ÿ˜…

rotund token
#

well so is everything earlier ๐Ÿ˜„

#

i had a large post of issues when we updated from 0.17 to 0.50

#

i don't have a same list to make so far this time

#

only gotcha i've found is implicit interface implementations
void ISystem.OnUpdate(ref SystemState state)
breaks code gen

#

which I don't think many other people will run into

#

obviously more painful than previous updates, but i'm finding it more stable at least (so far)

rustic rain
#

I find codegen somewhat scary

#

because it makes things dependent on style and syntax

rotund token
#

one thing i wish they really had done

rustic rain
#

would have been great if we could do codegen with similiar to reflection fashion

rotund token
#

was delete IConvertGameObjectToEntity

#

it doesn't work

#

it just hides issues because it doesn't work

rustic rain
dense crypt
#

What does it mean if a function that returns a NativeArray doesn't allow me to specify the Allocator? I see in the source that it's using Allocator.None, in this case it's GetDynamicComponentDataArrayReinterpret

This would be a direct view to the memory, and not an actual copy right?

rotund token
#

yes

#

wait

#

how do turn on/off jobs debugger ๐Ÿค”

rustic rain
#

I think

#

they mentioned moving everything dots related there

rotund token
#

oh

#

theres a jobs tab as well

#

thats what im missing

#

i was literalyl looking at that page

#

but just the entities tab

#

what's another tab pinned to my editor

rustic rain
#

is that correct version?

rotund token
#

going from 234 to 235 barely a % difference

#

yes

half jay
#

any ideas how can i fix this ?

Library\PackageCache\com.unity.entities.graphics@1.0.0-exp.8\Unity.Entities.Graphics\MeshRendererBaking.cs(120,46): error DC0005: Entities.ForEach Lambda expression parameter 'renderMesh' with type RenderMesh is not supported

Also i have a lot of similar erros

dense crypt
#

Um, my DOTS (0.51) windows appear very broken and I can't seem to fix it with an editor restart. Any ideas?

pastel field
#

I would have thought that in the long run we would have been able to do without Shared Components and reduce the gap between MonoBehaviour Components & Entities, but nope.
Even worse, new components are appearing (the documentation has become abysmal).
I'll have to wait for the update of the samples because it's clearly not accessible enough as it is.

rotund token
dense crypt
rotund token
#

what version of unity

dense crypt
#

2021.3.8f1 - it appears to affect all DOTS windows, all other windows are working fine

rotund token
#

odd

#

try a window layout reset all layouts

#

outside of htat no idea

dense crypt
#

Yeah no dice, I'm really confused here

rotund token
#

oh well

#

better update to 1.0

#

๐Ÿ˜„

dense crypt
#

It seems to be releated to some kind of import issue, I think it's the cache server being wonky or something

#

I noticed that a certain uxml pane for the UI wasn't correctly imported, reimporting fixed that particular one but issue remains

dense storm
#

I'm getting a lot of these after updating, what goes wrong?

InvalidOperationException: No suitable code replacement generated, this is either due to generators failing, or lack of support in your current context
ProjectBrave.Runtime.Combat.InputMovementSystem.OnUpdate () (at Assets/_ProjectFolder/Scripts/Runtime/Combat/ECS/InputMovementSystem.cs:18)
#
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.Burst;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;

namespace ProjectBrave.Runtime.Combat
{
    [UpdateBefore(typeof(LocalMoveSystem))]
    [UpdateBefore(typeof(WorldMoveSystem))]
    public partial class InputMovementSystem : SystemBase
    {
        protected override void OnUpdate()
        {
            new InputMovementJob /*Error leads here*/
            {
                DeltaTime = SystemAPI.Time.DeltaTime
            }.ScheduleParallel();
        }

        [BurstCompile]
        public partial struct InputMovementJob : IJobEntity
        {
            public float DeltaTime;

            void Execute(ref LocalToWorldTransform transform, in InputData input, in MovementData movement)
            {
                transform.Value.Position += input.Value * movement.Speed * DeltaTime;
                transform.Value.Rotation = quaternion.LookRotationSafe(moveDirection, new float3(0, 1, 0));
            }
        }
    }
}
rotund token
#

i think there was a note about this

#

try do this

#

var deltaTime = SystemAPI.Time.DeltaTime;

#

DeltaTime = deltaTime;

#

i swear i read something like that breaking atm due to double code gen, but can't find it

#

i could just be making it up, long day

dense storm
#

I'll try lol

rotund token
#

ah yes

#

Known issues
If you schedule an IJobEntity constructed with an initialization expression that invokes a SystemAPI method, such as:
SomeJob{targetLookup = SystemAPI.GetComponentLookup<Target>()}.Schedule()
This causes the following runtime error:
No suitable code replacement generated, this is either due to generators failing, or lack of support in your current context.
To fix this, put in a local variable first. For example, the following works:
var targetLookup = SystemAPI.GetComponentLookup<Target>(); new SomeJob{targetLookup = targetLookup}.Schedule()

dense storm
#

I hope that's temporary? Lol

rotund token
dense storm
#

Cool it worked :)

#
var ecb = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>().CreateCommandBuffer(combatWorld.Unmanaged);

This on MonoBehaviour Awake() also produces the same error.

rotund token
#

can't use SystemAPI outside of systems

dense storm
#

I see

rotund token
#

it's completely codegen

devout prairie
#

was just reading there's a new AI Navigation package in 2022.2

rotund token
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Crashing soon as build starts

#

something about blobarray

#

yet i don't even have any of my own

rotund token
#

well I can build mono

#

I built with faster (Smaller) builds as instructed for il2cpp so not sure what's up

#

@viral sonnet benchmarked it
0.51 - 2.05ms
0.51 128 Limit - 4.75ms
1.0 - 4.34ms
Slower as expected

#

I think the gains are mostly the rewritten job scheduler which is pretty sweet

strange wagon
#

Hi! I'm trying to capture a bullet collision with enemies and create a new Damage enity to collect them in a different system and inflict Damage. I don't understand what to use in EntityInQueryIndex when creating an enity via command buffer. I will need to process the created enities in the same order that I create them in this system.
commandBufferParallel.CreateEntity(???? , damageArchetype);

protected override void OnUpdate()
    {
        var commandBufferParallel = _commandBufferSystem.CreateCommandBuffer().AsParallelWriter();
        var nonTriggerMask = _nonTriggerMask;
        var bulletMask = _triggerBulletMask;
        Entities
            .WithName("ProjectileHitDetectionJob")
            .WithBurst()
            .ForEach((Entity e, int entityInQueryIndex, ref DynamicBuffer<StatefulTriggerEvent> triggerEventBuffer) =>
            {
                for (int i = 0; i < triggerEventBuffer.Length; i++)
                {
                    var triggerEvent = triggerEventBuffer[i];
                    var otherEntity = triggerEvent.GetOtherEntity(e);
                    
                    if (triggerEvent.State == StatefulEventState.Stay || !nonTriggerMask.Matches(otherEntity))
                        continue;
                    
                    if (triggerEvent.State == StatefulEventState.Enter)
                    {
                        if ((bulletMask.Matches(triggerEvent.EntityB) && bulletMask.Matches(triggerEvent.EntityA)) ||
                            (bulletMask.Matches(triggerEvent.EntityA) && bulletMask.Matches(triggerEvent.EntityB)))
                        {
                            //HERE
                            commandBufferParallel.CreateEntity(???? , damageArchetype);
                        }
                    }
                }
            }).ScheduleParallel();
        
        _commandBufferSystem.AddJobHandleForProducer(Dependency);
    }
devout prairie
strange wagon
#

entityInQueryIndex is always equals 1 in this case

devout prairie
#

it basically provides the entity index for parallel jobs where the total number of entities being iterated is split up across different threads

devout prairie
#

ahh i think i see

#

i don't think it's necessary to do a parallel job in that case, although it should still work

#

the entityInQuery index refers to the entity holding the buffer, not the buffer index itself that you're using

strange wagon
#

Yes it works, but I'm generally not sure I have the right approach to implementation

#

The enitites are created with different indices, it seems as if everything is fine. maybe I should process them in another system and check the order.

raw mica
#

The value passed to an ecb.ParallelWriter is a key into the command buffer. The value won't match the entity.Index but instead be 0..n. The docs for that method should also mention you should pass entityInQueryIndex when in an Entities.ForEach
edit: doc link: https://docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Entities.EntityCommandBuffer.ParallelWriter.CreateEntity.html#Unity_Entities_EntityCommandBuffer_ParallelWriter_CreateEntity_System_Int32_Unity_Entities_EntityArchetype_)

devout prairie
#

This line:
var otherEntity = triggerEvent.GetOtherEntity(e);

strange wagon
#

got it! what would you advise to use just Schedule? or will my code work correctly?

devout prairie
#

get other entity is just a helper, the event object holds EntityA and EntityB.. if you pass in A it'll return B and viceversa.. you don't want to pass in e

#

i don't think you even need that line, just use triggerEvent.EntityA and triggerEvent.EntityB

#

But yeah, ScheduleParallel isn't needed here as there's only one stateful event buffer entity, just use Schedule

strange wagon
#

thanks!

misty wedge
#

Time to upgrade to the new version, wish me luck

dense storm
#

Does baking with a baker deletes the authoring gameobject?

#

Haven't tried, my original code before upgrading manually creates entities

#

And can't try rn bc not in office, but just wondering since the docs doesn't specify

#

Wanted to go hybrid

misty wedge
#

Is there a reason why the names for the hashset collections keep changing? It went from NativeMultiHashMap to NativeParallelMultiHashMap and now it's back to NativeMultiHashMap...

rustic rain
misty wedge
#

I see

#

So something like NativeHashSet.ParallelWriter doesn't exist anymore I'm assuming

#

It would need to be NativeParallelHashSet.ParallelWriter

rustic rain
#

hmm

#

any tip how to install graphics package?

#

I can't find them in search

#

and I can't find correct package name

misty wedge
#

Is NativeMultiParallelHashMap missing from collections?

#

It's in the docs but it doesn't seem to be in the package

dapper vine
misty wedge
#

Weird, it seems to be missing

#

The reference in the docs even broke...

rustic rain
#

yeah

misty wedge
#

I'm guessing the docs are just incorrect, and there is no NativeMultiParallelHashMap, since NativeMultiHashMap is also missing from the docs

#

I guess they just messed up the name

rustic rain
#

graphics is totally new it seems

misty wedge
#

The naming is getting more and more confusing

rustic rain
#

hold on

#

there's actual

misty wedge
#

Why the hell did they change the name again if you can still write to it in parallel

rustic rain
#

parallel hash map

#

the one you see

#

is best for single thread

misty wedge
#

Yeah I know

#

But there is no non-parallel MultiHashMap

#

and they changed the name from "Parallel" to no parallel

#

Even though you can request a parallel writer

rustic rain
#

I don't remember naming

misty wedge
#

???

rustic rain
#

but Unity dev told

#

there is

misty wedge
#

I can't find it in collections 2.1.0-exp.4

#

There is only one multi hashmap, NativeMultiHashMap

#

Which is weird because it is parallel capable, and in the previous version it had parallel in the name, but they changed it again for some reason...

honest plinth
# rustic rain

Yes. A lot has changed and hopefully you will get some better perf in situations where Hybrid Renderer V2 would be slow (lots of unique meshes and materials). We can now reference many combinations of mesh/material from the same batch, as long as the "GPU Archetype" is the same

devout prairie
rustic rain
honest plinth
#

Which mean: I think graphics can use the new transforms

rustic rain
#

I thought transforms got rid of LtW component

misty wedge
rustic rain
#

and isntead some new one

honest plinth
#

Ah, perhaps that is the case. I remember discussing this and getting to the conclusion that getting graphics on to the new types would be a trivial change for the transform people. I did not hear anything after that.
Sorry for the confusion

devout prairie
misty wedge
devout prairie
#

There's now:

misty wedge
#

Yeah I get the other collections, but there's still only one multi hashmap

#

I'm fine with it not auto renaming the other ones since they have distinct use-cases

devout prairie
#

NativeHashMap
NativeParallelHashMap
NativeMultiHashMap ( with or without ParallelWriter )

rustic rain
#

new transform is hella confusing, I guess I'll wait until all crucial packages pick it up

viral sonnet