#archived-dots

1 messages ยท Page 59 of 1

rotund token
#

hmm

#

1389

#

ok might need to do something similar to fixedstrings

robust scaffold
#

@misty wedge I think you were the one who asked about explicit field offset for autoproperties. A bunch of digging later and I figured out how to specify the offset of the field that the property would wrap around: [field: FieldOffset(1)]. Just that "field:" in the attribute will correctly target the actual value to set it's offset.

misty wedge
#

Yep, I got the same answer from the C# discord ๐Ÿ‘ The offset will target the backing field

#

iirc it's not supported on all platforms though? I might be misremembering though (I checked my conversation there and I think I'm thinking of something else)

robust scaffold
robust scaffold
#

Yep.

#

The forced buffer inside the chunk is unfortunate but player entities are so fragmented anyways it doesnt matter.

misty wedge
#

I still think it's a bit odd you can't specify serialization settings as with other ghost components (with [GhostField])

robust scaffold
viral sonnet
#

having fun with blobs. my requirement is to reference a blob in a blob array. doesn't seem possible though -.-

#

maybe i should reference the hash

robust scaffold
viral sonnet
#

bit clunky, i have conditions where the evaluation can go to another condition. a chain basically

misty wedge
#

Anyone know why the source generator doesn't like this? Getting

C:\dots2\Packages\com.unity.netcode\Runtime\SourceGenerators\Source~\NetCodeSourceGenerator\Generators\NetCodeSourceGenerator.cs(95,1): error NetCode: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')   at Unity.NetCode.Generators.NetCodeSourceGenerator.Generate(GeneratorExecutionContext executionContext, IDiagnosticReporter diagnostic)
#

When adding a [GhostComponent(PrefabType = GhostPrefabType.Client)] on a class based IComponentData ๐Ÿคทโ€โ™€๏ธ

rotund token
#

no one can see something obviously wrong here that just breaks netcode right?

#

before i go make a forum post asking wtf is going on

#

and why my ghost size is not matching expected

#
        public struct Snapshot
        {
            public FixedBytes512 Buffer;
        }```
#

Failed to decode ghost 707 of type NetworkPacket(5), got 4242 bits, expected 4247 bits

robust scaffold
#

took me a few hours to figure that out as that error does not help whatsoever in debugging what netcode wanted

misty wedge
#

I thought that was it and that I had them all, but I was missing Unity.Networking.Transport

#

I swear that error message was better in the past

robust scaffold
#

there's a different version when you add a [ghost field] that does tell you that the asmref is missing references but without ghost field, it's extremely vague.

misty wedge
#

Do IJobParallelForTransform jobs need to run in TransformSystem?

#

Something is overwriting the value but I don't think it's me

rotund token
#

i don't believe so

misty wedge
#

Weird

#

I debugged the job and the value being set there is different than what is on the gameobject transform

rotund token
#

is it a root gameobject? or child?

misty wedge
#

Root

rotund token
#

i assume something does move the gameobject at some point?

misty wedge
#

I'm probably messing up the setting logic somehow, I'll check a few things more before wasting your time

misty wedge
rotund token
#

probably doesn't matter, i don't think go hbave the whole delayed child updating

misty wedge
#

Okay, I fixed it

#

I don't even want to say what the issue was pensive

late mural
#

is there anyway i can make a certain isystem's OnStartRunning() happen before a certain SystemBase's OnStartRunning()?

rotund token
#

only if they are starting on same frame

#

an updatebefore/updateafter would cause 1 to run before other

#

but if the trigger to make a system start running happens on different frames no

late mural
#

ooh that gives me a good idea, i could make the systembases OnStartRunning() require a component that will only exist after the isystem has done what it needs to

misty wedge
#

You need to require the component in OnCreate though, not in OnStartRunning

late mural
#

ok thanks!

misty wedge
#

(But I guess that's what you already meant)

late mural
#

(ye...)

misty wedge
#

Is Dispose called automatically on components that implement it?

#

Wow, that seems to be the case. TIL

#

Makes having native containers in components so much easier pensive

rotund token
#

only works on managed components as far as i'm aware right?

misty wedge
#

Ah really?

#

I've never seen it documented anywhere

rotund token
#
        {
            if (obj is IDisposable disposable)
                disposable.Dispose();
        }```
#

it's called in ManagedComponentStore

misty wedge
#

It's also in the docs, guess I must have never read them for managed components

#

For managed components that reference external resources, it's best practice to implement ICloneable and IDisposable, for example, for a managed component that stores a reference to a ParticleSystem.

viral sonnet
#

i'd like to see a feature that blobs can reference other blobs. it works very fine for entity references to blobassetreference

#

which seems a lot more complicated to me

stiff mesa
#

Hey everyone. Please remind me, is it thread-safe to change component's fields directly?

robust scaffold
stiff mesa
#

So, while it's jobs, it's ok?

robust scaffold
#

But otherwise, yea. It's fine.

stiff mesa
#

Ok, thank you!

robust scaffold
#

@light badger I would like to offer another suggestion, in ProcessCharacterHitDynamics, the condition to execute "processor.OverrideDynamicHitMasses" should be a || check between the two bodies for inverse mass != 0. So long as one mass is not indicated as kinematic through the inverse mass, the override should be called.

#

@light badger With this change, a kinematic being slowed by pushing a dynamic mass is as simple as this 1 line. Your controller is very flexible and amazing.

robust scaffold
#

A bit of trimming and some manual constants to patch up holes in the solver and I have done it, a 2D top down Rival Character Controller.

#

Surprisingly very painless. Rival is very well designed.

#

Being able to slap debugs everywhere throughout actual rival code helps a lot when figuring out what constant I assumed accidentally zeroed out everything.

#

Huh, rival characters of spheres with radius of 0.5 can not fit in tubes with diameters of 1.

#

Easy fix, make characters slightly smaller than what they are, 0.495 works.

robust scaffold
#

Why is my game running so slowly? (checks profiler, sees wall of blue) Oh, I turned off burst...

late mural
#

getting this error, and im very confused, as line 67 is a closing curly bracket....

solar spire
#

surely there are only so many things in that function that could be using a min and a max

late mural
#

ok yup managed to fix it, still kinda odd that it was giving me the wrong line, perhaps to do with the source gen stuff, or perhaps inconsistent line endings?

stiff mesa
#

Is it ok to create entities in OnCreate? I need my system to initialize a singleton once and not update anymore.

misty wedge
#

I only did basic CCD, and sliding stuff, and I probably still want to add characters pushing dynamic bodies, so at that point I may as well switch to Rival

misty wedge
#

If I destroy an entity, does it not automatically destroy its child entities?

#

I've barely used the transform system

#

It seems to only remove the Parent and PreviousParent components on the child

#

I'm guessing it's because the child is missing from the parent's LinkedEntityGroup. Do I need to add this manually?

#

(in addition to adding the Parent component on the child)

#

That seemed to have worked so I guess that was the issue

misty wedge
#

Coming from game objects, that's the intuitive assumption, that's why I was confused

calm edge
#

is there a way to query for entities in a job, or a way to run a query and pass in the components?

rustic rain
calm edge
#

I mean other than the ones being iterated over for the job

rustic rain
#

you use lookups for that

calm edge
#

I have a job processing AICharacters, and I want to get all the AITargets

#

I found EntityQuery.ToComponentArray, is that what would normally be used?

rustic rain
#

no

misty wedge
#

It depends on whether or not the AITargets have any kind of connection to the AICharacters or not

rustic rain
#

you use Lookup

calm edge
#

no connection

misty wedge
#

if you just want them all you can get the component array, otherwise use a lookup

rustic rain
#

ComponentLookup

#

or BufferLookup

misty wedge
#

(which you would schedule before the job requiring the data, then pass the dependency to the next job)

calm edge
#

I don't know the entities the AITargets are on so CompoentLookup isn't much use afaict

rustic rain
misty wedge
#

Why? Maybe there's a good reason he needs all of them

#

nothing wrong with that, depends on what exactly he is trying to do

rustic rain
misty wedge
#

It depends?

#

Impossible to say without knowing what he's trying to do

rustic rain
calm edge
#

yeah

rustic rain
#

I see

misty wedge
#

Ideally you'd use some kind of spatial hashing system to more quickly find entities that are "close by"

rustic rain
#

I did it this way, but no idea whether there's most efficient one:
I made a job that queries for all potential targets and just add them to one big HashMap, while also putting all required data here (position, smth else and etc)

#

and then I pass that hashmap to jobs that want all targets

#

and in my case, I have "rooms" which separates targets

#

as shared comp

#

so this way I then split hashmap based on room id

misty wedge
#

If you are extra lazy you can also just e.g. overlap sphere using the physics system and find the correct things by layermask

rustic rain
#

so target finding has less misses

misty wedge
#

Anyone ever get this when making a build? UnityEditor.dll assembly is referenced by user code, but this is not allowed.

#

It doesn't tell me where though for some reason

#

Building addressables works fine

calm edge
#

Is it trying to say you have a reference to UnityEditor when building a standalone player?

#

in which case you can just search all your asmdef files for unityeditor?

misty wedge
#

UnityEditor is part of the engine, you don't need to reference it in an asmdef

#

And since the namespace is automatically missing on build, it should throw a compilation error telling you that namespace doesn't exist

#

For some reason it's not doing that

calm edge
#

yes, but you may be able to directly add an assembly reference

misty wedge
#

Why? If I add an assembly that references UnityEditor at build time, that reference wouldn't compile either, since it is referencing something that doesn't exist

#

Unless you mean a precompiled assembly from unity itself

calm edge
#

editor assemblies would have to reference it when being built so I thought maybe you could trick it by adding it as an override reference, but it looks like unity just removes the reference

#

so I have this:

        var targets = _targetQuery.ToEntityArray(Allocator.TempJob);
        var job = new AIControllerJob
        {
            PhysicsWorld = SystemAPI.GetSingleton<PhysicsWorldSingleton>().PhysicsWorld,
            WorldTransformLookup = SystemAPI.GetComponentLookup<WorldTransform>(true),
            Targets = targets
        };
        job.ScheduleParallel();

but I can't figure out how to set up the job to dispose the array after

misty wedge
#

targets.Dispose(JobHandle)

#

using the JobHandle returned by job.ScheduleParallel()

rustic rain
calm edge
#

sorry, this is an ISystem, I don't seem to have JobHandle

#

and ScheduleParallel returns void

rustic rain
#

you have

#

just pass state.Dependency

#

as paramter

#

you are using codegen overload

#

which assigns dependency in code gened version

calm edge
#

targets.Dispose(state.Dependency); ?

rustic rain
#

no

misty wedge
#

The scheduleparallel(state.Dependency)

rustic rain
#

or yes, but only after scheduling main job

misty wedge
#

The ScheduleXXX functions return the new dependency if you pass in an explicit dependency

calm edge
#
        var jobHandle = job.ScheduleParallel(state.Dependency);
        targets.Dispose(jobHandle);
rustic rain
#

yeah, but then assign state.Dependency to jobHandle returned by Dispose method

#

or assign main job handle to state dependency

misty wedge
#

It's probably not important in this case is it?

rustic rain
#

not much difference actually

misty wedge
#

Since disposing the collection isn't a requirement for code after that to run

rustic rain
#

this way

misty wedge
#

Ah yeah, the jobHandle

calm edge
#

it's so annoying that I read a bunch of stuff on how to do something with dots then realise it's all out of date

misty wedge
#

Yep

#

Welcome to the club

rustic rain
#

it changed so many times ,kek

#

I only witnessed 3

misty wedge
#

If you are working in an ISystem I recommend just schedule everything with state.Dependency = job.ScheduleXXX(state.Dependency)

#

Unless you actually want multiple jobs to run in parallel

calm edge
#

I like being explicit like that anyway

misty wedge
#

Yeah I'm also not a huge fan of the "automatic" dependency handling

rustic rain
#

in small systems it reduces boilerplate

#

after we get default interface C# feature

#

our ISystem will look very short

misty wedge
#

It doesn't even remove a single line

#

Just makes the line shorter

rustic rain
#

it still removes boilerplate

#

bruh

#

no need to care about assignment

misty wedge
#

I know, I'm just saying not by a huge amount ๐Ÿ˜…

rustic rain
#

and etc

misty wedge
#

compared to e.g. the SystemAPI codegen for ComponentTypeHandle

calm edge
#

the problem is it's hidden using magic, you can't go to code for ScheduleParallel to see what it's doing

misty wedge
#

^

#

That's the reason I don't really like it

misty wedge
#

You can check the code-gened system

rustic rain
#

just lookup what another partial declaration of your type looks like

#

this will give you actual code that will run

calm edge
#

I get public global::Unity.Jobs.JobHandle ScheduleParallel(global::Unity.Jobs.JobHandle dependsOn) => __ThrowCodeGenException();

rustic rain
#

don't inspect method

misty wedge
#

If you search for the ISystem struct name you should get something like this

#

The bottom one is the code generated one

calm edge
#

yeah that is from the codegen

rustic rain
#

no it's not

#

I mean

#

you inspecting method that is meant to be replaced by codegen

misty wedge
#

This is the method used in the code generated struct

#

It's the actual method being called at runtime

#

Not the "mock" method used for code generation

calm edge
rustic rain
misty wedge
#

You need to inspect the method in the code generated file

calm edge
rustic rain
#

yeah

#

like this

calm edge
#

yeah, and there's just an Execute function and __ThrowCodeGenException() for everything else

rustic rain
#

then you are still looking at smth wrong

#

besides

#

Execute function

#

is from job

#

and is probably your Execute method

calm edge
#

well I call job.ScheduleParallel(state.Dependency); so the function I'm taken to is on the job

rustic rain
#

you should have a system type declaration which is codegened

#

which contains

#

OnUpdate method

void girder
#

Is wanting to spawn multiple entities from one gameobject a valid use case for using Baking systems?

calm edge
#

I implement OnUpdate, remember this is an ISystem

#

it doesn't really matter, it'll probably change again later anyway :p

rustic rain
#

hold up

#

try to remove codegen part

#

temporarily

#

I feel like

#

because you don't use any codegen features

#

it's not generated

#

or easier

#

just add any SystemAPI call

#

like time

#

and just assign it to unused var

#

this will generate OnUpdate for you

#

and you will be able to inspect how it looks

calm edge
#

I'm already using SystemAPI in my OnUpdate

rustic rain
#

then you 100% should have codegened OnUpdate

calm edge
#

well it's just not showing up in visual studio then

rustic rain
#

you can access it from your own code

#

and then open it's declaration

calm edge
#

Doesn't show in intellisense either

solemn hollow
#

anyone else has domain reload problems? i need to restart the editor quite often because of it.

#

this is where its stuck

rustic rain
#

it will only trigger on recompile

solemn hollow
#

yes i have it disabled in enterplaymodeoptions. im talking about recompiling

rustic rain
#

no idea then

#

Anyone used MaterialPropertyOverride?

#

I made this override through asset

#

and while it works while subscene open

#

it doesn't closed mode

#

in play mode it looks like this

#

or more like, override is ignored completely

#

@rotund token sir? Any thoughts on this?

misty wedge
#

no idea why

rustic rain
misty wedge
#

I don't see what that has to do with the burst version?

rustic rain
#

I don't think burst is related at all tbh

misty wedge
#

But if I downgrade it works

#

...

#

It's the only change

rustic rain
#

maybe some kind of burst type has been moved to editor

misty wedge
#

Then that compiling assembly would fail compilation, since the editor types are stripped

#

For some reason it's not giving me an error message of what is referencing the dll

#

Really weird, no idea how I can debug this

#

0 messages saying what is going on

solemn hollow
#

@rotund token had some weird things going on with burst. somehow functionpointers got scrambled. Burst was calling wrong functions. i dont remember the details. maybe somehow an editor function is called like that?

misty wedge
#

Burst 1.8.0 also doesn't work, so it has to be a change between 1.7.4 and 1.8.0

rustic rain
misty wedge
#

Ill try deleting the library folder on 1.8.2 and see if that helps

misty wedge
#

Nope, still doesn't work

#

really weird, it fails pretty far into the build, on Running Backend

#

This is after my scripts have already compiled afaik

#

Not sure if I should make a forum post about this, I can't find anything online

rotund token
rotund token
#

But my best guess is the Shader is not setup for it properly

rustic rain
#

yeah, and it only works with opened subscene

#

idk about, shader considering BRG sees it as compatible and even draws stuff

robust scaffold
misty wedge
#

I looked at rival a little bit and used some of the concepts there to hack together my own janky controller, but a lot of it went over my head

robust scaffold
misty wedge
#

Was rival updated in 1.0 to use aspects?

robust scaffold
#

It's basically a trimmed down first person controller.

#

Yep

misty wedge
#

Ah cool, didn't know

robust scaffold
#

The whole thing is now just a single aspect. It's really neat.

misty wedge
#

Maybe I'll take a look at it again

robust scaffold
#

And thanks to aspects, the physics character update is just this```csharp
[BurstCompile]
[WithAll(typeof(Simulate))]
private partial struct CharacterPhysicsUpdateJob : IJobEntity
{
public CharContext Context;

        public KinematicCharacterUpdateContext BaseContext;

        private void Execute(ref CharAspect characterAspect)
        {
            BaseContext.EnsureCreationOfTmpCollections();
            characterAspect.PhysicsUpdate(ref Context, ref BaseContext);
        }
    }```
#

The only half complete implementation I still have on the character controller is moving platforms. I'll need to do some custom physics querying to figure out how to do it and ehhh, i dont have any moving platforms to test anyways

misty wedge
#

@rotund token have you had any issues building mono and il2cpp on burst 1.8.2?

tribal pollen
#

I've changed the prefab i'm spawning to something that actually looks better but now I'm getting
A BatchDrawCommand is using a pass from the shader "Unlit/Transparent" that is not SRP Batcher compatible. Reason: "Material property is found in another cbuffer than "UnityPerMaterial"" (_MainTex_ST) This is not supported when rendering with a BatchRendererGroup (or Entities Graphics). MaterialID (0x5) MeshID (0x3) BatchID (0x1) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
It renders fine as a normal GameObject

misty wedge
#

I'm guessing the shader is not SRP batcher compatible. If you select it in the editor it tells you

#

@robust scaffold you ever have a weird issue in netcode in builds where an RPC is just not send? I swear I had it previously but I forgot what the issue was

robust scaffold
tribal pollen
#

The shader is URP/Toon, my project is URP too, not sure why SRP is a problem

robust scaffold
robust scaffold
# misty wedge

If that's on the client, you dont need to specify target connection. Furthermore, no clue.

misty wedge
#

No, that's sent on the server

rustic rain
#

it requires dots instancing code as well

#

I have dived into learning how to do it

misty wedge
#

The player joins, sends an RPC, the server receives it and checks if the player has a player entity in the world, and if not, sends an RPC to request character creation

rustic rain
#

and then

#

non-working material override system smacked me

#

against a wall

robust scaffold
rustic rain
#

it was very easy to implement

robust scaffold
rustic rain
#

I'm fine considering perfomance gains and fully burstable overrides

rustic rain
#

but holy shit, they just don't work

tribal pollen
#

Kinda regretting going with ECS right now lol

rustic rain
#

lul

robust scaffold
tribal pollen
#

Yeah... >_>

rustic rain
#

there is this guy

#

who made ecs system for C#

#

which is very similiar to unity one

#

it's called Arch

tribal pollen
#

well first animations and now just rendering prefabs.... I wanted to make it look nicer to feel like things were coming together, but I guess I just have to wait on it.

rustic rain
#

I want to try it

#

for some small project

#

maybe until we get proper instruments that's the way

#

but I hope I can fix material overrides

#

and start working on sprite renderer

misty wedge
#

1.7.4 works fine

#

1.8.0 is also broken with the same error

#

Guess I'll make a forum post and hope someone responds ๐Ÿคทโ€โ™€๏ธ

devout prairie
#

Well, sadly, i've tried everything i can think of to make physics Motors emulate what config joint Drive does, and have to conclude it's not workable

rustic rain
#

yep, dots has brought only disappointment lately

rotund token
#

Aren't we a set of positive people today!

misty wedge
misty wedge
#

Why the scene isn't loading in the build? I have no idea

rotund token
#

Do you have something to wait for the scene load?

#

How are you opening it?

misty wedge
#

Yeah, I have a component in the scene, and the system requires it

misty wedge
rotund token
#

Yes

misty wedge
#

Or what do you mean by open

#

Sec

#

Haven't touched this in ages, it used to work though

#

It definitely works in the editor though, not sure what the issue in the build is. Like I said, this also used to work in a build at some point

rotund token
#

Seems fine

misty wedge
#

Maybe I should read

#

What does that even mean though? This is a gameobject I'm referencing in a baker

rotund token
#

referencing a prefab but not baked?

misty wedge
#

It's baked to an entity with GetEntity

#

I'm not using it for anything atm, I'm gonna try and remove it

rotund token
#

that error seems to imply the subscene thinks there is a gameobject reference not a converted entity

misty wedge
#

This is in the baker

#

I'm not adding any other components

robust scaffold
# misty wedge

Just tried build testing my project: Works with burst 1.8.2 using mono.

misty wedge
#

The error message is so strange

robust scaffold
#

I'm not using any pooling so I dont know

misty wedge
#

No, that has nothing to do with the build error

#

That's in a working build

#

With burst 1.8.2, I can't build anymore, it fails at the end

#

The only error message is: UnityEditor.dll assembly is referenced by user code, but this is not allowed.

#

It works fine in 1.7.4

#

Fails for mono and il2cpp

#

I'm not sure what else I can try

robust scaffold
#

I thought it said unity engine and then you might have a problem. Unity editor assembly is not allowed in build.

misty wedge
#

But how can that be the issue when the user code is the same

#

The only change is switching burst version

robust scaffold
#

you have to use compiler conditionals. I dont know why it was allowed in burst in the first place.

#

#if UNITY_EDITOR and whatnot. Including around the using UnityEditor;

misty wedge
#

Burst allowed editor code before?

robust scaffold
#

Shouldn't have. They might have included a test for it in the most recent burst versions. Either way, it shouldnt be allowed.

misty wedge
#

I don't understand how my code is even compiling then

#

The UnityEditor assemblies are stripped, so the code should fail to compile at all

robust scaffold
#

It could be compiling and then silently failing inside build. If your code doesnt touch editor, then it would be fine to silently fail but you should always have the conditional around any reference touching the editor in the first place.

#

It's an easy enough fix, just slap the if check around all editor functions

misty wedge
#

Gotta find them first ๐Ÿ˜…

#

It's weird that it isn't telling me where the issue is

#

But I guess it has to be inside burst somewhere or something?

robust scaffold
#

inside a bursted system probably.

misty wedge
#

Can I disable burst completely? Maybe then I'll get an error message

rotund token
#

@misty wedge where do your bakers exist

misty wedge
#

In which assembly?

rotund token
#

yes

misty wedge
#

The runtime one, I haven't moved them yet

#

(or I should say, they are in a runtime assembly)

viral sonnet
#

this is so weird. testing rival, open subscene -> InvalidOperationException: GetSingleton<FixedTickSystem+Singleton>() requires that exactly one FixedTickSystem+Singleton exist that match this query, but there are 0. closed subscene. everything's fine

viral sonnet
#

also wondering why even new assets use the old input system ^^

signal phoenix
#

In rival's case, it's just because it makes one less package to depend on. New input system is used in the samples though

viral sonnet
#

ok makes sense. it's so weird that the new input system can be activated but then it needs a package.

rotund token
#

would be nice in like unity 2024 or something the old system is just replaced

#

weird as a new user to just get this old system and think that's what you should be using

#

new system could just be included as a default package

viral sonnet
#

agreed, more than enough time has passed to force the new input system by now. old input system is really OLD ๐Ÿ˜„

#

and a pain for anything more than a quick prototype

rotund token
#

you can use the new system in a similar hacky way for testing anyway, like

#

Keyboard.current.spaceKey.wasPressedThisFrame

#

etc

#

without having to setup bindings/actions etc

viral sonnet
#

that's what i have been using mostly. now i'm setting up action maps

#

but yeah, that's very close to the old input system

safe lintel
#

i dont understand why there are some super legacy things being held on to like reserved rigidbody and animator etc fields in monobehaviour as backwards compat stuff, but if you actually updated a project back from unity 4 or 5 or whatever they are from, theres bascally zero chance it would actually update without errors. makes sense to drop the old input system as well at this point but there are other worse offenders

rotund token
#

because people don't upgrade that many versions at once

#

they upgrade 1 at a time

#

and fix as they go

#

there are plenty of unity games built in unity 5 that still get regular updates that would have slowly upgraded their version as they come to end of life

#

(hearthstone)

lethal cairn
#

yeah, we've upgraded 1 version at a time, tried to fix all the errors in that version, did some tests, then proceeded to the next one.

#

trying to leap over multiple versions only made it a big mess that ultimately we'd had to reset to the original state.

#

alas, at least I have some experience using many Unity versions so I know what should change in that specific version.

#

along the way I also did many refactoring changes so I can say that it wouldn't be a simple task.

#

makes sense to drop the old input system as well at this point but there are other worse offenders

#

disagree. we still use the old input for various reasons.

safe lintel
#

that would explain keeping those reserved fields around for a few editor versions, but keeping it now kinda runs contrary to the 1 editor version at a time though doesnt it?

lethal cairn
#

At every upgrade you would see many warnings about deprecated APIs. Just fix them too and it would be fine.

#

I fixed most warnings and all errors, in the end everything goes smoothly.

#

Compared to the previous attempts (jump over multiple versions), this time I feel very confident about the result.

safe lintel
#

no but this annoys me ๐Ÿ™ƒ

rotund token
#

unity belives in _ or m_ ๐Ÿ˜ฆ

#

i had same issue until i stopped having to use MB

safe lintel
#

checked the manual, its back from unity 5 days, its like a 7 year old upgrade warning at this point

lethal cairn
#

Try to live with that. It annoys me at first too but it just a small thing for me. I can just rename my fields.

#

Btw, I've built a good convention for my company and a companion .editorconfig to enforce the convention.

safe lintel
#

i dont even use monobehaviours much now except for authoring components but keeping it around is just endemic to other areas unity keeps a lot of baggage around for that really fractures the sort of onboarding experience you have with the product

lethal cairn
#

Well, I just forget about all of them. I suggest you the same too. Just focus on things that are really important. I don't have much time to spare for little details.

safe lintel
#

you can ignore whatever you want, ill continue to whinge about things I dislike, squeaky wheel gets the grease and all that, or not but I feel better venting

stiff mesa
#

Hey everyone. Experiencing something weird here. I'm calling the SystemAPI method and it throws an exception:

No suitable code replacement generated, this is either due to generators failing, or lack of support in your current context

I went inside the method and it looks like this:

#

How is it supposed to work?

rotund token
#

systemapi is code gen

#

and you can only use them in systems

safe lintel
#

i get the same error message when ujsing SystemAPI.HasComponent in systembase

#

so i guess some missing cases

rotund token
#

odd

#

using it inside a query/job or something?

#

we'd need to see your context @stiff mesa of where you're using it

safe lintel
#

reported just waiting to hear back
used inside of EFE instead of HasComponent but switched back(obviously)

stiff mesa
rotund token
#

though it usually gives an error that it requires systemstate

#

so it's odd it's not saying that

stiff mesa
#

Hm... How do you usually avoid boilerplate code? So far my main problem with DOTS is I have to write A LOT of code multiple times.

rotund token
#

the vast majority of code i need to re-use is from jobs

#

not from systems

#

so i just write little helper structs

#

and even when it's a system, i again just write helper structs

#

and just do it without systemapi

#
    [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)]
    [UpdateInGroup(typeof(LateSimulationSystemGroup))]
    public partial struct CameraStateSystem : ISystem, ISystemStartStop
    {
        private StateModel impl;

        [BurstCompile]
        public void OnStartRunning(ref SystemState state)
        {
            this.impl = new StateModel(ref state, ComponentType.ReadWrite<CameraState>(), ComponentType.ReadWrite<CameraStatePrevious>());
        }

        public void OnStopRunning(ref SystemState state)
        {
            this.impl.Dispose();
        }

        [BurstCompile]
        public void OnUpdate(ref SystemState state)
        {
            var bufferSystem = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>();
            this.impl.Update(ref state, bufferSystem.CreateCommandBuffer(state.WorldUnmanaged).AsParallelWriter());
        }```
#

for example

stiff mesa
#

That looks somewhat similar to what I'm trying to do. I probably just doing it wrong.

viral sonnet
#

thank god for ICollector. now one can write proper collectors and i don't have to postprocess raycast hits with checks like (hit.point != Vector3.zero || hit.normal != -targetDir) && (hit.point != Vector3.zero && hit.normal != Vector3.zero)

#

lol, the wrench in the machine. uhm, how should i handle this? ๐Ÿ˜„

solar spire
#

Use .Equals to compare two float3's. Or math.all on the bool3, but I doubt that's the best way. math.any(hit.Position) is also a fine way of asking if it's not 0

safe lintel
#

InvalidOperationException: Entity Entity(72:1) doesn't belong to the current authoring component. is it just expected to have to workaround not being able to add components to other 'GameobjectsWhichWillBeBakedIntoEntities' on your baker and require using a BakingSystem to get around it?

rotund token
safe lintel
#

like a hierachical gameobject, cant add ICD to a child with the root baker, only via a baking system?

viral sonnet
#

thanks! math.all seems reasonable.

rotund token
#

how do you incrementally bake a single entity if its touching other entities

safe lintel
#

its hard to break out of the mentality from the old conversion systems/interface ๐Ÿ˜ฆ

rotund token
#

this has bit me as well but it does make sense and is conceptually quite nice

viral sonnet
#

best case would be that i don't have to check for 0 positions because they are filtered before hand

solar spire
#

how are you getting bogus hits?

rotund token
#

we catch them because our dev scene starts at 0,0,0 but they rarely rarely popup in the build since you aren't usually at 0,0,0

#

im wondering if i just make 0,0,0 not valid in a future project

#

make world from 1,1,1 ->

viral sonnet
#

rival uses math.dot(hit.SurfaceNormal, _cameraDirection) < 0f to check for valid hits. cinemachine also uses the same check as i posted above

#

the hits are mostly edge cases when using sphere casts and the hit is inside. always result in 0/0/0 position

#

took me a long time to get rid of all the quirks in my asset.

#

nowadays they are mostly documented

safe lintel
#

also can I use idiomatic foreach with structural changes? i dont see that With option

viral sonnet
#

it's not supported yet

#

i still use Entities.ForEach because of it

rotund token
#

i think only things that don't affect the current queries chunks

#

just use a local ecb

safe lintel
#

but its planned for later? can use ecbs for now

rotund token
#

dont need to use ecbs

#

just create your own ecb and pass it in and play it back after

#

imo better than structural changes anyway

safe lintel
#

i mean entitycommandbuffers not buffersystems

rotund token
#

dont have to worry about buffers being invalidated etc

safe lintel
#

its like 3 extra lines of code sandwiching the foreach, so ugly! ๐Ÿ˜€

rotund token
#

burst compilable though!

#

unlike efe withstructuralchanges

safe lintel
#

so is entitymanager in isystem though!

rotund token
#

yeah but it's also faster than with structural changes

#

you dont have to duplicate all your data

viral sonnet
#

man, this looks worse than a dot product ```private static bool IsValidRayCastHit(ColliderCastHit hit, float3 targetDir)
{
var check1 = math.all(hit.Position != float3.zero) || math.all(hit.SurfaceNormal != -targetDir);
var check2 = math.all(hit.Position != float3.zero) && math.all(hit.SurfaceNormal != float3.zero);

        return check1 && check2;
    }```
rotund token
#

why not just use equals?

viral sonnet
#

yeah, i should

solar spire
#

Equals or any on something you want to check isn't 0 were the suggestions I was recommending

safe lintel
#

anyway switching gears: for an animated character in dots and their rigidbodies/colliders, do you guys think they should reside on the actual converted bone hierarchy, or should an extra ragdoll setup be created in tandem?
im trying to figure out whats best for my setup as well as what unity intends as the best practice moving forward. I envision alot of extra busy workarounds to do the dual ragdoll + hierarchy setup since baking and accessing so many sub entities is a bit painful.

viral sonnet
#

i can't comment much on it. whatever reduces the most amount of random access and lookups is preferable

rotund token
#

& | work with bool3

viral sonnet
#

ah nice, thanks tertle

rotund token
#

(check my logic =D)

#

but i think doing them separate and the final all check at end should be equiv

viral sonnet
#

i'm far away to test anything. only have ported like 20% ๐Ÿ˜„

rotund token
#

what are you changing?!

nova river
#

Anyone have a recommendation on how to pause the FixedStepSimulationSystemGroup? When I set FixedStepSimulationSystemGroup.Enabled to false, it pauses just fine. But when I set the Enabled property back to true, it looks like the FixedStep group updates continuously until it has caught back up with elapsed time, which makes sense in a weird way. Code here: https://gdl.space/iwinovorok.cs

viral sonnet
rotund token
#

exciting

rotund token
#

you'd have to pause the whole game not just that group

viral sonnet
#

i think you have to manually patch the time to prevent this

#

seems like a very common use case maybe someone else can tell you how it's done

nova river
nova river
viral sonnet
#

there are 2 time entities. MostRecentFixedTime and WorldTime. it's worth a try to set the elapsed time from WorldTime to MostRecentFixedTime once you unpause

rotund token
#

because your UI etc should be in presentation

viral sonnet
#

true that, it's probably for the best to setup proper groups

rotund token
#

at least this is how I think you should handle this - i very specifically set up my groups in my project from the start thinking about pausing (caused us issues in current game)

#

it's very ideal to just be able to disable your simulation to pause

#

even just for testing

#

pause game, fly around with 3rd person camera or toggle debug settings on UI etc

nova river
nova river
#

Looks like the SimulationSystemGroup doesn't have a Timestep property to speed up or slow down I'll poke around the documentation more tomorrow.

rotund token
#

it's controlled by world time

delicate swan
#

did anyone else miss the RegisterBinding attribute? super useful for feedback from authoring

#

Sets a monobehavior field to a value in a runtime component for feedback without having to switch to runtime data inspector

rotund token
#

well this is fun

#

unity logged me out of my account on hub

#

now won't let me log back in

#

so i can't open unity

delicate swan
#

That sucks

rotund token
#

reason "Query parameter is invalid. Failed to get current clientId unity_hub"

#

what does hta teven mean

solar spire
#

https://status.unity.com

[Resolved] Service is back up.
[Issue] According to our monitoring system this service has become unresponsive, weโ€™re investigating.
[Resolved] Service is back up.
[Issue] According to our monitoring system this service has become unresponsive, weโ€™re investigating.
[Resolved] Service is back up.

rotund token
#

was great timing 45min before cutoff for candidate build for launch is due ๐Ÿ˜

balmy thistle
#

wha

rotund token
#

wha indeed ๐Ÿ˜ฆ

#

stress

#

ok less work thinking, more personal project thinking

#

anyone got a good solution to changing ghost owners?

#

as far as i'm aware this is not supported by netcode atm (though maybe this is outdated, i can't find a source in last year) and it's kind of a big sticking point for me atm

#

to the point if i can't solve it, i'll just have to settle on not having owner prediction and make everything interpolated...

#

no prediction, while not a deal breaking in click to move style game, will still be a much less nice user experience

mystic mountain
#

Is there a way to see all the baking systems?

mystic mountain
#

Anyone know if there are some issues with referenced entity prefabs not getting run through baking systems?

rotund token
#

not sure of an alternative atm

mystic mountain
devout prairie
#

How do i go about getting access to the shared RenderMeshArray, i've naively tried this:

rustic rain
#

this array is only required to free resources once entities are unloaded

#

or for loading resources properly

#

during subscene load

#

what do you want anyway?

devout prairie
#

Hmm, I'm collecting nav mesh sources at runtime and require the mesh of each entity that is tagged for collection in order to add it to the nav mesh build sources list

#

Converting this from 0.51 to 1.0

#

So I dont have access to RenderMesh component any more

#

So previously, i had this:

#

so you can see the NavMeshBuildSource requires a reference to the mesh to be passed in

#

the navmesh api later uses that buildSources list to update/build the navmesh

#

So i'm just trying to figure out, how to do the same thing, assuming using MaterialMeshInfo, now that RenderMesh is gone

rustic rain
#

in graphics system

#

and then

#

collect all meshes through mesh index

#

on your entities

devout prairie
#

Surely not

rustic rain
#

ah, there is GetMesh even

#

I just obtained BRG reference

#

in OnCreate

#

and then used it's public methods

devout prairie
rustic rain
#

of BatchRendererGroup instance

#

and then it's pretty straightforward

devout prairie
#

ahh so it was using reflection, ok

#

i thought maybe you meant without

rustic rain
#

well, my way is more efficient

#

because I only use it in OnCreate

#

otherwise you'll need to modify package

devout prairie
#

yeahhhh.. i'm assuming they're going to make this easier ๐Ÿ˜

devout prairie
#

ah damnit

#

i just realised, type is wrong

rustic rain
#

๐Ÿ˜…

#

yeah

pliant pike
#

so what is the best Unity version to use with DOTS 1.0?

devout prairie
#

you'd think with a history of modding i wouldn't make such mistakes

devout prairie
pliant pike
#

hmm is it viable to just go straight to the 2023.1.0a24 alpha?

rotund tusk
#

Hello! So I'm following some sort of a tutorial and in there they did

BuildPhysicsWorld buildPhysicsWorld = World.DefaultGameObjectInjectionWorld.GetExistingSystem<BuildPhysicsWorld>();

But I'm getting the error:

Cannot implicitly convert type 'Unity.Entities.SystemHandle' to 'Unity.Physics.Systems.BuildPhysicsWorld'

Anyone know why?

pliant pike
rotund tusk
#

Yup but then If I try to do

((BuildPhysicsWorld)buildPhysicsWorld).

I get the same error

#

:/

pliant pike
#

that's because you can't convert between the types

#

I don't what tutorial your using but maybe its out of date or something

misty wedge
#

someone call joseph

rotund tusk
#

I just wanna do an overlapshpere to find Entities and apply force to them, don't know where to start cannot find much information for it

misty wedge
#

ideally pass the CollisionWorld to a job and do the overlap tests there

#

Anyone have an idea what is going on here?

I have a baked component where I am baking a reference to a VisualTreeAsset for use in a UI system.
In editor the baked components looks like this:

#

As you can see the CharacterCreationTemplate has the asset correctly baked, and everything works in the editor

#

However, in a build, that reference is null

#

This used to work, as this code is relatively (a few months) old, so I'm not sure why it broke now

#

The other values on the baked component are properly set. However the 2 VisualTreeAssets are null

#

I have another system that also reads a VisualTreeAsset from a baked component, that asset is also null.

robust scaffold
rustic rain
#

but you can try and let us know how it went ๐Ÿ˜…

pliant pike
#

Maybe not ๐Ÿคจ

viral sonnet
#

pretty sure 2023 is not compatible. otherwise there woukd have been a mention

robust scaffold
misty wedge
#

Something is really broken with scene loading / baking for me

#

Replacing the direct VisualTreeAsset with a WeakObjectReference<VisualTreeAsset> now throws this error

#

InvalidOperationException: Operation is not valid due to the current state of the object.

#

Error when processing 'AsyncLoadSceneJob(StreamingAssets/EntityScenes/6086a43b86fc4d648a3ce1d94c0b822a.0.entities)': Operation is not valid due to the current state of the object.

#

I'm just gonna start loading it via addressables, but it's pretty annoying

rotund token
#

What have you done ๐Ÿ˜ฌ

#

Can you show the baking code for this quickly

#

Does it use dependson? (don't actually know if this matters)

misty wedge
#

I tried changing it to WeakObjectReference, which also didn't work, then I changed it to AssetReference (AssetReferenceT can't be baked since it is missing a default constructor) then gave me the "type missing in typecache error".

#

I've now resorted to just loading the VisualTreeAsset using addressables with a string directly, that works

rotund token
#

DependsOn adds a dependency to an asset in a baker

rustic rain
#

hold up

#

if I use any sort of Object I should use DependsOn?

rotund token
#

Yes

rustic rain
#

๐Ÿ˜…

#

that's probably why my VisualAssets didn't work in build

#

only 1 did for some reason

#

everything else was null

rotund token
#

The baker should detect changes and rebake if it changes

misty wedge
#

I mean the DependsOn thing

rotund token
#

Been there since the start

misty wedge
#

Weird. Then I have no idea why this used to work

rotund token
misty wedge
#

I made a build after upgrading everything to bakers iirc

#

What is it used for then?

#

If not for builds

rotund token
#

It's used to tell baking that it has a dependency on this

#

To rebake if the asset changes

misty wedge
#

Ah, I see

rotund token
#

It's worth a test for a build though

misty wedge
#

Yep, already on it

rotund token
#

To me it seems like unity is just striping the asset from the build because it doesn't think it's used

misty wedge
#

Yep

#

Interestingly enough the Sprite reference is there, but for some reason I have marked that as addressable, so that's why I'm assuming it works

rotund tusk
#
if(InputManager.main.Input.Player.Mouse.IsPressed())
        {
            GameObject player = GameObject.Find("Player");

            float3 overlapPosition = (float3) player.transform.position + (float3) player.transform.forward;

            var hits = new NativeList<DistanceHit>(100, Allocator.Temp);

            if(GetSingleton<PhysicsWorldSingleton>().PhysicsWorld.CollisionWorld.OverlapSphere(overlapPosition, 1f, ref hits,
                new CollisionFilter{
                    BelongsTo = ~0u,
                    CollidesWith = ~0u,
                    GroupIndex = 0,
                }))
                {
                    foreach(DistanceHit hit in hits)
                    {
                        if(HasComponent<PhysicsVelocity>(hit.Entity))
                        {
                            var forceVector = (float3) player.transform.forward * forceAmount * SystemAPI.Time.DeltaTime;

                            PhysicsVelocity physicsVelocity = GetComponent<PhysicsVelocity>(hit.Entity);
                            PhysicsMass physicsMass = GetComponent<PhysicsMass>(hit.Entity);

                            physicsVelocity.ApplyAngularImpulse(physicsMass, forceVector);
                            Debug.Log("hit");
                        }
                    }
                }
        }

So for some reason I'm getting spammed with the message "hit" whenever I'm close to an Entity but it doesn't move at all? The force doesn't get applied?

rotund token
#

You haven't written it back to the component

#

You are only applying it to the local copy

#

Remember components are structs

rotund tusk
#

Hmm how would I do that? I'm watching some tutorials and I'm really confused about it xD First time dealing with DOTS

rotund token
#

SetComponent(hit.entity, physicsvelocity)

#

You've basically done this
int x = class.value
x += 3
???

#

class.value = x

#

Would be required

rotund tusk
#

Ohhh I get it

#

Thank you so much!

misty wedge
#

@rotund token nope, still null ๐Ÿคทโ€โ™€๏ธ

rotund token
#

Rip

#

No idea, you and issue both have problems with this

#

I just have a single array of all my VisualTreeAssets and never had a problem

#

Maybe it's having a second field is issue ๐Ÿคทโ€โ™‚๏ธ

rustic rain
#

๐Ÿค”

#

but I have only single field

#

I have multiple instances instead

devout prairie
rotund token
#

does build config still exist?

#

was at least deprecated in 1.0

#

so yeah file menu

devout prairie
#

ah, i thought was the preferred way especially with dots

#

i think i had some issue previously that forced me to use build config with a dots project

#

that was back in pre 1.0 days though

rotund token
#

it was required in 0.51 for subscenes

#

but they didn't have resources to support it anymore so in 1.0 it should all be done via old build pipeline

devout prairie
#

ah ok, good to know

#

another transient unity thing

#

maybe worth a spin with build config in Schnozzle's case if still available, in the off chance it avoids whatever thing is causing it to not include that asset

rotund token
#

i'm pretty sure you can't even use them anymore

devout prairie
#

ahh

misty wedge
#

It also won't let me load a gameobject. I get this error when attempting to load the scene:
Error when processing 'AsyncLoadSceneJob(/StreamingAssets/EntityScenes/6086a43b86fc4d648a3ce1d94c0b822a.0.entities)': The given key 'PoolStaticSpriteWithRemap (UnityEngine.GameObject)' was not present in the dictionary.

#

I can't even bake a buffer of only entity references to game objects for some reason anymore, this is really strange...

rotund token
#

Time for a clean and pray

#

You don't have any warnings during building do you?

misty wedge
#

Nope

#

I don't even understand why it's looking for the game object in the error message

#

It's baking the entity using GetEntity

#

This is incredibly annoying, since I can't even convert the game object anymore. With runtime conversion gone it basically blocks me from using this prefab at all

#

I can't even load this using addressables

#

I get this error before even attempting to load the scene

#
KeyNotFoundException: The given key 'PoolStaticSpriteWithRemap (UnityEngine.GameObject)' was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <8f06425e63004caf99a79845675f751e>:0 
  at Unity.Scenes.SerializeUtilityHybrid.DeserializeObjectReferences (Unity.Scenes.ReferencedUnityObjects objRefs, UnityEngine.Object[]& objectReferences) [0x000b2] in <186d582aad224082a9094c15d05052cf>:0 
  at Unity.Scenes.AsyncLoadSceneOperation.ScheduleSceneRead () [0x00026] in <186d582aad224082a9094c15d05052cf>:0 
  at Unity.Scenes.AsyncLoadSceneOperation.UpdateAsync () [0x00187] in <186d582aad224082a9094c15d05052cf>:0 
rotund token
#

This is in build right

misty wedge
#

I think I'm just going to give up on building for now, as annoying as that is

rotund token
#

Not editor

misty wedge
#

Yes

#

In the entity hierarchy in the inspector everything looks correct

#

(for the subscene)

rotund token
#

Did you say you've cleared your library artifacts

misty wedge
#

It's as if it isn't including any UnityEngine.Object references used by my baked entities

#

I haven't yet, I'm gonna do that next

rotund token
#

the thing is it shouldn't be including the gameobject reference

#

if you say it's only used for conversion

#

Unity.Scenes.SerializeUtilityHybrid.DeserializeObjectReferences
it's going through hybrid deserialization which implies it's trying to access the actual gameobject reference

misty wedge
#

So it should be including it

rotund token
#

wait so you are referencing the gameobject

misty wedge
#

yes

rotund token
#

that kind of changes the story!

#

is this gameobject a prefab refernce

#

or a reference to another gameobject in the scene

misty wedge
#

It's a prefab

rotund token
#

is this prefab also converted to an entity?

misty wedge
#

Yes

#

Is that the issue?

rotund token
#

maybe!

#

can you test

#

duplicating the gameobjects

#

reference the one that isn't being converted

misty wedge
#

Sure

#

Ill try and build first after the reimport

rotund token
#

(why are you even referencing the gameobject that was converted to an entity?)

misty wedge
#

I spawn the entity which spawns itself as a game object

#

I was just too lazy to make a second prefab

mystic mountain
rotund token
#

i don't see anything obviously wrong

rotund token
mystic mountain
#

Putting the entity manually in the subscene makes that entity be run through the baker. Just that the spawned entity through the prefab entity does not.

rotund token
#

ohb

#

yeah ok

#

is this a prefab?

#

yeah queries by default don't include prefabs

#

entityqueryoptions has options for prefab, disabled, systems etc

#
foreach (var dummyData in SystemAPI.Query<RefRW<DummyData>>().WithOptions(EntityQueryOptions.IncludePrefab))```
#

you need that

mystic mountain
#

๐Ÿ™ƒ

#

Thank you.

misty wedge
#

I'm going to go insane

#

I wish I could just tell the baking system to include the gameobject manually if it can't pick up on this automatically

mystic mountain
#

Now what are EntityQueryOptions.IncludeDisabledEntities?

rustic rain
#

I have similar bug

#

could be internal unity problem

rotund token
misty wedge
rustic rain
#

Didn't try yet, I'll try it tomorrow ig

misty wedge
#

Let me know if you manage to reproduce it

#

I don't understand why it works for other game objects

rotund token
#

really got no idea

#

i have a bunch of class ICD that seem to work

mystic mountain
rotund token
#

you can use Disabled on anything

#

Prefab and Disabled are just 2 built in components of entities

#

That will not appear in queries by default (as you would not want that)

devout prairie
misty wedge
#

Because the baked entity has a component on it that references said game object

devout prairie
#

yeah i get that

#

i wonder if for example you had the gameobject referenced inside a scriptable or something like that, and create a reference to that GameObject field in the scriptable for your component but use a separate GetEntity for the prefab conversion

misty wedge
#

The game object is also marked as an addressable, so it's definitely included in the build

#

The issue is the lookup for it is missing in the scene data

#

I even tried also adding a component to the main scene that references it to force unity to include it in the build, also doesn't work

#

Can you have class components in an aspect?

rotund token
#

things marked as addressable are not included in the build

#

they're included as addressable

misty wedge
#

Like I mentioned I also tried adding a reference to it to the scene

#

Also didn't work

rotund token
#

yeah but is it still in addressables?

misty wedge
#

Both

#

It's not an addressable reference, it was a direct reference to the game object prefab

rotund token
#

yes but is it being stored in addressables

misty wedge
#

Sure, I assume it would be stored in both

rotund token
#

i don't believe so

misty wedge
#

Really? Does unity load the object on scene load from addressables then?

rotund token
#

josephs

misty wedge
#

Haha, had the same error

#

I haven't found them yet though

rotund token
#

hmm just made a build

#

might have same issues

#

if so i believe this would be tied to 2022.2.X

#

because this worked in beta

misty wedge
#

Yes, the code that is breaking for me has worked for ages

#

(at least the VisualTreeAsset stuff, the other thing breaking I wrote a few days ago)

rotund token
#

this error is from inputactions

misty wedge
#

I didn't get a stacktrace iirc

rotund token
#
            this.inputEntity = SystemAPI.GetSingletonEntity<InputBuild>();

            input.Select1.action.started += this.OnSelect1Started;```
#

null on that bottom line

#

i'm getting stack traces

misty wedge
#

Oh, I thought you meant the josephs line

#

So a baked input action asset is null for you?

rotund token
#

yes

misty wedge
#

Seems similar to the VisualTreeAsset being null.

rotund token
#

but i have some other issues first

misty wedge
#

I have no idea why my Sprite object is being included in the build though, since that's also a UnityEngine.Object

rotund token
#

ArgumentException: Type BovineLabs.NavMesh.Debug.NavMeshDrawSystem couldn't be found in the SystemRegistry. (This is likely a bug in an ILPostprocessor.)

#

a bunch of my systems just don't seem to exist

misty wedge
#

epic

rotund token
#

they're all debug systems

#

which is interesting

misty wedge
#

I feel like I also had some issues with the incremental build pipeline sometimes not building correctly

#

switching build folder then seemed to do a proper rebuild and work

rotund token
#

good point

#

this was a mono though

#

but it was on an existing folder

#

that was like 4 weeks old

misty wedge
#

I was also on mono when I had issues

#

It would build super fast but seem to not include some changes I made

#

like 5 seconds build

#

Also something strange I ran into recently: does IsEmptyIgnoreFilter not work with managed components?

#

It was saying false, but the entity array from ToEntityArray had length 0

rotund token
#

hmm should work fine

misty wedge
#

Weird

rotund token
#

toentityarray doesn't ignore filters i don't think

#

so IsEmpty should match ToEntityArray

#

sure you didn't have a filter on your query?

misty wedge
#

No filter

#

That only includes shared and changed filters right?

rotund token
#

enabled components

misty wedge
#

None of those either

rotund token
#

no idea then

misty wedge
#

Eugh I list my code style settings when I was trying to debug something pensive

#

I wish rider had a "use all of the files in this folder" option to auto detect code style, instead of just the whole solution

#

I wonder if it makes sense to pool managed instances to reduce GC strain

rotund token
#

so breaks in development builds

#

yeah.............

#

this is totally the issue

#

if I wrap the assembly in
#if UNITY_EDITOR || DEVELOPMENT_BUILD

#

it breaks in debug builds

#

because it's building with release config

#

i can provide this easily enough by

#if UNITY_EDITOR || DEVELOPMENT_BUILD
    public partial class DebugSystemGroup : ComponentSystemGroup
    {
    }
#endif```
```cs
    [UpdateInGroup(typeof(DebugSystemGroup))]
    [BurstCompile]
    public partial struct NavMeshDrawSystem : ISystem```
#

and making a development build this fails to build even though the DEVELOPMENT_BUILD should be set

#

and if I do this

#if UNITY_EDITOR || DEVELOPMENT_BUILD
    [UpdateInGroup(typeof(DebugSystemGroup))]
    [BurstCompile]
    public partial struct NavMeshDrawSystem : ISystem```
#

and make a development build
ArgumentException: Type BovineLabs.NavMesh.Debug.NavMeshDrawSystem couldn't be found in the SystemRegistry. (This is likely a bug in an ILPostprocessor.)

#

because it's built as release

misty wedge
covert lagoon
#

Weird bugs.

pliant pike
#

wow its kind of crazy how quick and easy it is to set things up and get going in DOTS 1.0

devout prairie
pliant pike
#

yeah I'll have to get more familiar with the baking process but it seems pretty good albeit a bit more complicated at face value

devout prairie
pliant pike
#

yeah it might be just because I was used to the old way

devout prairie
#

yeah i mean previously i was using only runtime conversion ( because i got tired of bugs and other issues with subscene conversion etc ) but honestly switching everything over to subscenes and bakers was pretty straightforward

#

it was the thing i thought was going to take the longest and be the most painful

pliant pike
#

woot!! and I can select entities and view there properties in the scene view

devout prairie
#

yeah, it's a nice step up in a lot of ways

#

i even ported a couple of SystemBase over to ISystem with jobs and found that to be quite painless

#

Still a lot to catch up on though with all the new RW stuff etc etc but i think it's straightforward

pliant pike
#

yeah I'm starting a new project and gonna mess around with some physics

stiff mesa
#

Tertle, I will not mention you but if you see this, is your Event System up to date? Can I use it with Entities 1.0? Cuz' I see there is no documentation anymore.

rotund token
#

umm

#

it was updated to 1.0

#

i /think/ it should still work

stiff mesa
#

Thank you!

rotund token
#

i transitioned my libraries off using it in 1.0

#

as i think a singleton approach is better

#

and now that i've experimented with this i intend to write a helper to setup similar behaviour at some point

stiff mesa
#

Would be interesting to see some code examples

rotund token
#

just how command buffers work
SystemAPI.GetSingleton<X.Singleton>().Create<Y>()

viral sonnet
#

best way to draw physics raycasts in burst/jobs? aline?

tribal pollen
#

what's a good way to be able to click on a visible entity when the game is playing?

rotund token
viral sonnet
#

ah ok, never used that. also found PhysicsDebugDisplaySystem.Arrow

rotund token
#

not efficient

#

but if you just want a quick hack

viral sonnet
#

yeah, nothing major

coarse turtle
#

is there any way to determine if a scene asset in AssetDatabase is a subscene? Trying to collect all subscenes that exist through some editor extensions

viral sonnet
#

lol, for whatever reason PhysicsDebugDisplaySystem.Arrow is totally wrong

viral sonnet
coarse turtle
#

yea makes sense, I guess I could label them in AssetDatabase and query for that label instead

viral sonnet
#

or a real simple method, use string search and name them xxxSubScene

coarse turtle
#

true

rotund token
#

XxXSubSceneXxX

#

what type of tool is this?

#

you could literally just make it open every scene 1 at a time and get all subscenes within each

tribal pollen
#

Added com.unity.physics, and now my project doesn't know LocalToWorldTransforms anymore. :\

rotund token
#

what version are you on?

tribal pollen
#

2022.2.0b16

rotund token
#

entities/physics

#

both pre release?

tribal pollen
#

both experimental.

#

1sec i removed the physics after. i'll add it back

rotund token
#

you should defnitely update to the pre version

tribal pollen
#

They're the latest for my 2022.2.0b16, I guess i could try going to 2023.1.0a24

rotund token
#

they are not the latest, they just don't appear in the package manager

#

we've progressed passed experimental builds into preview builds

#

add
com.unity.entities 1.0.0.pre-15
com.unity.physics 1.0.0.pre-15
com.unity.entities.graphics 1.0.0-pre.15

#

the preview physics now supports new transform system

tribal pollen
#

Ah, i figured since I enabled the 'show pre in package manager' toggle that they would... lol

#

thanks, i'll give that a try

tribal pollen
#

I have the pre15 versions, but now I'm getting the same error even without the physics package...

rotund token
#

1.0 brings a new transform system

#

there are 4 components
LocalTransform
WorldTransform
ParentTransform
LocalToWorld

#

but generally you hide this behind the TransformAspect

tribal pollen
#

ok i'll have to figure it out. I has moved some of my stuff to using the TransformAspect except for places where I was doing a ComponentLookup, or creating a new entity with a starting location of localtoworldtransform, but most of the things that I moved to TransformAspect were just using.Position, which will be removed soon too.

rotund token
#

you can pass in TransformAspect.Lookup

late mural
#

wondering is there a special way to change between scenes, or will it just work if i do it the normal way?

robust scaffold
robust scaffold
#

Although I would recommend transitioning to entity subscenes. I've moved everything into a single Scene with multiple procedurally loaded subscenes containing the entities that need to be loaded at that time. No Scene switching outside of major level loads.

late mural
#

ok ill look into it ,thanks!

misty wedge
#

If I call ToComponentDataListAsync, can I depend on the fact that the order in which the array is returned is the same as if I were to get the entity array for the same query?

#

Also, how does the transform system know when to update the parent? I'm guessing it queries on WithAll<Parent>().WithNone<ParentTransform>()?

rustic rain
rustic rain
#

in fact

#

just take a look at source

#

new transform is way more easier to understand

#

than v1

misty wedge
#

Oh cool

misty wedge
#

Is there a way to get the euler angle from a quaternion?

rustic rain
#

but it is possible

misty wedge
#

Convert to Quaternion and then get euler angles?

rustic rain
#

that's one way

#

but why need to get euler?

misty wedge
#

I need the angle in a shader

#

It seems I don't even use the rotation in the shader even though I'm writing it to the compute buffer, so my question is moot ๐Ÿ˜…

coarse turtle
# rotund token what type of tool is this?

just for level selection w/ subscenes with a menu in ui toolkit - was doing some looking around to see if there was a direct way i can grab subscenes directly w/ asset database - was thinking of writing out the guids as an asset post processor to a file that the UI would read to display the levels

warm panther
#

Q: How do I store a large array on an entity (e.g. is using a BlobArray the only way?), if that array had several hundred or thousands, possibly 10^6 entries?
It's important that indexing the array for reading later is fast and parallelizable. (it's a navigation search structure)

I'd rather just have a NativeArray somewhere, e.g. in the PathfindingSystem, but I struggle with loading such resources into Systems, and technically it is a violation of how Systems are supposed to work (holding significant state; even if it is only static state).

pliant pike
rustic rain
#

this is easy to obtain inside/outside of systems

#

and as easy to modify

#

but beware, it does not support entities dependency detection, so all thread safety is up to you

#

unless you use jobs

#

in which case it'll throw errors if you risk race condition

misty wedge
#

I wish you could implement a factory method for managed component creation

#

Kind of annoying it always creates new instances

#

I guess I could pool the entities themselves

#

Although I don't think there is a way to inject the release of the pool object for automated destruction systems like LinkedEntityGroup

rustic rain
#

I just create managed singleton

#

in which I store list

#

and then have some other management

#

๐Ÿ˜…

#

way easier to work this way, also faster

misty wedge
#

Isn't entities also just looking up the managed component in an array stored in the world?

rustic rain
#

they do

#

but it includes extra steps

#

like getting to managed store

#

and also

#

it uses List<object> which requires cast

misty wedge
#

I doubt that's going to make much of a difference unless you have a massive amount of managed components, which you shouldn't in the first place

rustic rain
warm panther
# pliant pike there's dynamicbuffers or you can do nativearrays now , although if the array is...

You mean I can just add a IComponentData with a NativeArray to an Entity during baking, and that magically serializes/deserializes? That would be the best scenario. I thought I needed blobassets for that. DynamicBuffers are for a different purpose, this is static data.

What other data structure do you suggest other than arrays for large data? I mean, it's a graph packed into an array, it's more about getting the data to persist and into a system, ideally parallel jobs, after baking.

devout prairie
#

I've tried with both brg.GetRegisteredMesh and entitiesGraphicsSystem.GetMesh via reflection and both throw this error

rustic rain
devout prairie
#

It's been working fine with assets baked as part of the subscene, but when i later run this after runtime spawning i get these errors

rustic rain
#

runtime spawning?

devout prairie
rustic rain
#

are you sure you register your assets properly then?

devout prairie
#

well the assets are prefabs, which are baked as part of the subscene

#

and they spawn and render with no issue at all

#

it's just getting the mesh that seems to be a problem

#

assuming the instances are registered by the graphics system automatically when they are spawned

rustic rain
#

they are registered on subscene import

#

when you import your assets

#

into world

devout prairie
#

the index on the MaterialMeshInfo components do match up from what i can see

rustic rain
#

you need to use BRG methods to register

#

and then use those indices

#

in component

devout prairie
#

i'm just spawning entity prefabs

rustic rain
#

you don't use subscene, right?

devout prairie
#

i do, this is 1.0

rustic rain
#

oh