#archived-dots

1 messages ยท Page 24 of 1

devout prairie
#

is there stuff in the new graphics package that helps out people doing 2d stuff?

#

i'm itching to install 2022.2 and try things out but i'll wait for the samples i think

#

interested in improvements to physics

zenith stirrup
#

does anyone know if Bootstrap mechanics have changed?
I create an additional world and add systems to it:

this worked before, but now seems to not do anything.
my created ServerWorld is entirely empty

haughty rampart
#

heya guys, I've annotated an editor script method with [BurstCompile], but i cannot see it in the burst inspector. something i'm missing?

honest plinth
rustic rain
#

so

#

LocalToWorld is not gone

#

it's Translation, Rotation and Scales are gone?

honest plinth
#

Yeah, as far as I can tell. Sorry I have not been tracking that

rustic rain
#

eh, I'll just wait for migration guide on transforms in manual

haughty rampart
zenith stirrup
raw mica
#

The naming is inconsistent we don't have a NativeMultiParallelHashMap but just NativeMultiHashMap as we don't have a different single threaded optimized version. We'll fix this in a new release

misty wedge
haughty rampart
#

hey, chiming in quickly since unity is present: i remember reading something about first assigning a job to a variable and then calling var.Schedule() instead of immediately calling new Job().Schedule() but i can't find it anymore. this still true?

rustic rain
#

oh man, Play Mode starts so much faster

#

almost instantly

haughty rampart
#

by doing what?

rustic rain
#

simply as it is

#

compared to 2021

haughty rampart
#

ah

haughty rampart
#

ah ok, well it's entity specific and actually a known issue. so i guess it will be fixed at some point

misty wedge
#

What's the best way to check if a World is a server or client world now that the default groups are gone?

#

Nevermind, there's a native extension for it now

karmic basin
haughty rampart
#

hey guys, another thing. i'm not perfect in asm, so a question: vmovups are apparently vectorized movs of floats, but are there vectorized movs for integers?

rustic rain
#

pog, scene entity selection is a thing now

haughty rampart
#

hm, must be missing something then. i have a NativeArray<Color32> but burst uses vectorized float movs

viral sonnet
#

how are we supposed to remove certain comps now in baking? i can get it to work somewhat with an additional baking system that removes comps with an ecb but when a baker uses CreateAdditionalEntity, it won't work. and now i have runtime entities (which should be small) with translation/rotation/scale/LTW/LinkedEntityGroup/Parent ... what the hell ...

rustic rain
#

I assume they will be able to iterate over entities

#

instead of game objects

viral sonnet
#

probably other bakers run later. i dunno about the sequence

#

now i'd have to remove them in runtime which defeats the purpose of a new baking system

haughty rampart
#

Is there something new in enties or what? Haven't seen anything myself, but apparently we're talking new things?

rustic rain
#

a lot changed

haughty rampart
#

Where can I get the new stuff? Don't have a package update

haughty rampart
#

Thx

viral sonnet
#

and unity 2022.2

haughty rampart
#

Ahhh

#

Makes sense.

#

2023 compatible too?

safe lintel
#

probably not

haughty rampart
#

:c

rustic rain
#

interesting

viral sonnet
#

i'm honestly mostly dissapointed by the update. 128 entities cap in chunks, physics systems doesn't respect some settings and runs CreateRigidBodies eveyr frame, baking system is a lot of rewriting with 0 gains, regressions with features like removing. overall a bad experience and at the end of the day it has worse performance than 0.51

rustic rain
#

๐Ÿฅฒ

safe lintel
#

I consider the baking system a huge qol improvement even if the outset is it looks like you dont get anything "new"

viral sonnet
#

it's the same as IConvert. i don't get it

haughty rampart
#

Have to check for myself I guess

safe lintel
#

whats not to get? it is far less boilerplate to write

viral sonnet
#

i hope i change my mind on the other stuff. this 128 entities cap is quite the problem though.

haughty rampart
#

Why?

#

Didn't we have 32 cap or ssmth before?

viral sonnet
#

when you have small entities a chunk only has room for 128. which means not as much iterations on a chunk and wasted memory

#

nope, totally uncapped up to 1000+ in a chunk

rustic rain
#

anyone explained it?

#

and whether we can expect uncapped solution?

haughty rampart
#

Oh wait it was a byte cap before, wasn't it?

viral sonnet
#

the reason is the enabled/disabled comps feature. but the cap is there even if you don't use it.

whole gyro
#

enabled components is implemented as a bitmask

viral sonnet
#

yes, it was explained in a forum post. that's also why you have v128 in your IJobChunk now

rustic rain
#

ah

#

pff

#

it can be done dynamically

#

just more variables to count

#

so if you have 500 entities

#

you'll use 8 bytes

#

instead of 4

#

for enabled/disabled

#

or whatever was used

viral sonnet
#

that's the crazy thing. tertle already tested it. it's not even much faster. and we could all implement this with a bool comp and even a change filter

rustic rain
#

well, tbh

#

I don't really value this for speed

#

but for utility

#

of saving data on entity

viral sonnet
#

but the 128cap already gave him half the performance compared to uncapped

rustic rain
#

instead of storing it somewhere

whole gyro
#

The thing we couldn't implement ourselves was a way to have a query not return an entity if a bool inside a component was false.

viral sonnet
#

correct, but iteration time on a tightly packed bool array is so fast. who cares

rustic rain
#

oh man, I love this

#

actual ECS, lezzgo

whole gyro
whole gyro
#

I have over 100 errors from this change and its trivial to do so. I know they want us to use new singleton pattern, but this seems like something we could have gradually done (maybe log a warning instead)

haughty rampart
#

i hope they improved the source generator codes

rustic rain
#

new API

misty wedge
#

What's the correct pattern going into the future then for system data? Similar to the Singleton component that something like EndSimulationCommandBufferSystem implements, and calling SystemAPI.GetSingleton<T>()?

haughty rampart
rustic rain
#

yeah

whole gyro
rustic rain
#

SystemAPI

haughty rampart
rustic rain
#

wait

#

no

misty wedge
rustic rain
#

that's not what I meant

haughty rampart
#

wow :c

rustic rain
#

I meant ECS API that uses codegen

viral sonnet
#

system handles are mostly a fix for ISystem. for SystemBase it's a regression

rustic rain
#

no actual codegen from Unity, sorry xD

haughty rampart
whole gyro
misty wedge
devout prairie
rustic rain
#

๐Ÿ˜ฎ

misty wedge
whole gyro
misty wedge
#

Only as long as the system that has the singleton actually requests e.g. a write handle to it though right?

#

(Forcing other requesting jobs to wait)

whole gyro
#

If you intend to write outside the system, then yeah

misty wedge
#

Ok, just wanted to make sure the singleton API isn't doing any special magic

whole gyro
#

No I don't think its doing anything new other than creating these per-system entities for you

rustic rain
#

World.UpdateAllocator.ToAllocator

#

What the

#

is that allocator that gets disposed on end of frame?

misty wedge
#

Why does unity hurt me so by making everything internal pensive

haughty rampart
#

i sometimes wish there was a compiler parameter to allow you to access internal and private things. that is usually not something you want to do, but sometimes this would just be insanely useful

#

for advanced use cases

whole gyro
safe lintel
#

are we supposed to store TypeHandles inside of the singleton system entities?

#

how do you actually access that system singleton anyway?

misty wedge
whole gyro
rustic rain
#

because you can publicize it easily

#

compared to private

misty wedge
#

Ideally I wouldn't even need to, and there would be a property to read the values in the struct...

rustic rain
#

well, if you want to tweak with complex stuff, publicize it kek

misty wedge
#

That kind of defeats the purpose of encapsulation

#

But I get where you are coming from, since otherwise it just isn't possible

#

I just find it annoying

misty wedge
#

Yeah I know about that, but I'd rather not

safe lintel
#

asmref is so much more elegant than copying the entire package to modify it though?

whole gyro
misty wedge
haughty rampart
safe lintel
#

@whole gyro thanks!

haughty rampart
#

damnit

#

but the asmref is nice, since you can just use 1 line of code to make it accessible for anything you want

viral sonnet
misty wedge
rustic rain
#
/// Old way
var query2 = GetEntityQuery(
    new EntityQueryDesc
    {
        All = new[]
        {
            ComponentType.ReadWrite<LocalToWorld>(),
            ComponentType.ReadOnly<Translation>(),
            ComponentType.ReadOnly<Rotation>(),
        },
        None = new[]
        {
            ComponentType.ReadOnly<Parent>(),
            ComponentType.ReadOnly<Child>(),
        }
    });


/// New way
var query2 = new EntityQueryBuilder(Allocator.Temp)
    .WithAllRW<LocalToWorld>()
    .WithAll<Translation, Rotation>()
    .WithNone<Parent, Child>()
    .Build(this);

#

oh man, this looks cool

viral sonnet
#

internal means public for the namespace assembly. they just don't want to expose it to us. (which makes sense for noobs)

rustic rain
#

finally some good compact API

haughty rampart
rustic rain
#

compared to those nested monstrosities

viral sonnet
#

ah right

misty wedge
#

I mean yes, but it's similar to reflection. Yes you can do it, but I think you should take a second to think if you should

rustic rain
#

anyone looked into it?

rustic rain
#

I guess it grabs singleton now?

#

instead of grabbing time directly

#

from world

misty wedge
rustic rain
#

I am still reading through manual, haven't really touched editor yet xD

gloomy halo
rustic rain
#

oh man, I feel like migration will be tough

misty wedge
#

Wasn't there some trick you had to do with asmrefs so that your normal asmdef works again? I haven't used them in some time

haughty rampart
haughty rampart
viral sonnet
viral sonnet
#

oh nice thanks, gonna look through it

haughty rampart
#

asmref is the only thing i have no idea how to do with the .net sdk csproj. anyone has an idea?

balmy thistle
#

The API changes are a matter of taste, but functionally it's an improvement in almost every way

viral sonnet
#

once i figure out the regressions, fine. until then, i don't profit from any of this

safe lintel
whole gyro
safe lintel
#

ahh that makes more sense now

whole gyro
#

Not sure how I feel about the name. It definitely makes it more clear that it won't be removed during normal destroy, but I feels weird when it is often used to initialize an entity

viral sonnet
#

partial solution found: baker.CreateAdditionalEntity(TransformUsageFlags.None - this won't add any transform stuff then

whole gyro
#

Wait so is there no way to remove transform components from the main entity?

viral sonnet
#

leads to ArgumentException: A component with type:Unity.Transforms.Translation has not been added to the entity. Entities Journaling may be able to help determine more information. Please enable Entities Journaling for a more helpful error message. Unity.Entities.EntityComponentStore.AssertEntityHasComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities/EntityComponentStoreDebug.cs:301) Unity.Entities.EntityComponentStore.AssertEntityHasComponent (Unity.Entities.Entity entity, Unity.Entities.TypeIndex componentType) (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities/EntityComponentStoreDebug.cs:323) Unity.Entities.EntityDataAccess.SetComponentData[T] (Unity.Entities.Entity entity, T componentData, Unity.Entities.SystemHandle& originSystem) (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities/EntityDataAccess.cs:1280) Unity.Entities.EntityManager.SetComponentData[T] (Unity.Entities.Entity entity, T componentData) (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities/EntityManager.cs:417) Unity.Physics.Authoring.PostProcessPhysicsTransformBakingSystem.PostProcessTransformComponents (Unity.Entities.Entity entity, Unity.Physics.Authoring.PhysicsPostProcessData physicsPostProcessData) (at Library/PackageCache/com.unity.physics@1.0.0-exp.8/Unity.Physics.Hybrid/EntitiesBaking/BakingSystems/PostProcessPhysicsTransformBakingSystem.cs:28) oh man ... ๐Ÿ˜„

#

physics expects transform on childs or smth

whole gyro
#

Yeah, might be from the code that traverses the hierarchy and bakes all colliders into one

#

I was hoping they would make the collider merging thing optional in this release but I didn't see anything about it in the changelog.

viral sonnet
#

how is this untested? ๐Ÿ˜„

#

good thing i have my 0.51 still open. hard to figure out where the differences are otherwise. my best guess is that the additional entity wasnt a child

whole gyro
#

How do hide this thing?

#

figured it out. Had to drag it to the side and then it let me right click and hide it

wraith hinge
#

so the reason we make so many things internal is that for anything we make public, we are going to get absolutely murdered by everybody who uses it if we ever change it. cf. https://xkcd.com/1172/

#

and because of all the pain we've caused historically by messing with public stuff, we now have draconian internal processes for preventing us from breaking anything that was ever public (edit: in a non-preview/experimental/prerelease version)

#

put another way, the group here in this channel is much more tolerant of breaking changes than the median user ๐Ÿ™‚

haughty rampart
#

well, that's exactly what internal is supposed to be used for. so no issues there :)
would just be nice if there was an / multiple 'unsupported' wrapper out there for advanced users

wraith hinge
#

we unfortunately haven't had much success to date signaling that unsupported is really unsupported. most people seem to just use it like it's production ready and then get just as mad when it breaks as they would have otherwise. this is also why we've gotten so much cagier with our messaging and promotion

errant hawk
wraith hinge
#

i can't tell you how much unity devs wish you were in the majority on that point

haughty rampart
wraith hinge
#

i would say that for all of the above reasons, most people at unity who worry about this stuff consider asmrefs a mistake. so i wouldn't be surprised if there isn't one, but i also don't work on that stuff myself, so i don't really know.

haughty rampart
safe lintel
#

i feel that the switch to a yearly release version schedule(2021, 2022) sorta hampers the ability to go hog with huge changes

errant hawk
wraith hinge
#

regrettably, many people upgrade projects from unity versions from approx 500 B.C. and expect it to just work out of the box

haughty rampart
wraith hinge
#

not sure what you mean by extract the same types

haughty rampart
#

essentially copy paste to own assembly XD

wraith hinge
#

what's an example of such a thing?

raw mica
#

You won't be able to do that since usually the bindings are internal (since these are private impl details that can change)

errant hawk
raw mica
#

If you want to roll the dice and bind to them anyway, you'll need to use reflection or sneak around and use the internalapibridge approach Unity employs

haughty rampart
#

e.g. TextureImporter.MaxTextureSizeAllowedForReadable just vanishes completely

haughty rampart
#

and vanishes when you try to replicate it

safe lintel
#

is there an advantage to using a ChunkEntityEnumerator over a for loop of entities from the chunk's nativearray?

vagrant lotus
#

no non-uniform scale for experimental 1.0 ๐Ÿฅฒ

#

does the post-transform-matrix component affect dots physics' collider?

errant hawk
gusty comet
#

Does the 1.0 experimental package have proper 2d support now?

karmic basin
robust scaffold
coarse turtle
robust scaffold
#

Unity released 1.0 hella fast

gusty comet
#

Ok so back to hiatus for another year then.

robust scaffold
haughty rampart
misty wedge
#

Seems kind of strange that AddSharedComponentData is being auto-upgraded to AddSharedComponentManaged

#

Since it could be either or

gusty comet
#

Nah I just use another solution. If I have to jank up solutions that may have unforseen side effects I rather use monogame and one of the myriad of ECS libraries out there.

haughty rampart
#

bleagh

wraith hinge
errant hawk
#

no need to explicitly declare it

whole gyro
karmic basin
#

Yeah I read it quick but I think GravitonPunch is right

#

By the way, like thelebaron said, very nice game indeed @whole gyro , wishlisted it !

misty wedge
#

Really liking all the other API name changes so far

errant hawk
#

How do I query managed IComponentData types? It throws an exception stating it needs to be unmanaged.

raw mica
#

since essentially i m trying to extend

misty wedge
#

Is there a difference between calling GetSingleton<PhysicsWorldSingleton> and RequireForUpdate<PhysicsWorldSingleton> when it comes to dependency management for systems that require reading the physics world?

errant hawk
misty wedge
errant hawk
misty wedge
#

I don't think you can request managed components using it

#

Since it is specifically for ISystem based systems

errant hawk
#

oh it's an exclusive?

#

didn't know that

rustic rain
#

if foreach doesn't work

misty wedge
#

I'm guessing so? I don't think Entities.ForEach was deprecated in SystemBase based systems

rustic rain
#

why not just iterate chunks

#

with managedtypehandle

#

allthough you most probably want to create a list somewhere

#

dictionary actually

errant hawk
#

I'm just making an entity follow system so I can track an entity with a camera

rustic rain
#

managed component access is extremely slow

errant hawk
rustic rain
#

you can create look up dictionary

#

for your managed components

errant hawk
#

I suppose

misty wedge
#

Isn't managed component access doing the same thing?

rustic rain
#

there was list of object type

#

in which managed components were stored

#

untyped

#

and it was all accessed by index

#

on entity

errant hawk
misty wedge
rustic rain
misty wedge
#

And? You are using an index

rustic rain
#

since it stores all managed components

wraith hinge
misty wedge
errant hawk
misty wedge
#

(instead of Entities.ForEach)

misty wedge
#

Thanks, good to know

errant hawk
misty wedge
#

You can't schedule queries though, can you? I thought I was reading that you can't

wraith hinge
#

i believe the idea is to use ijobentity if you want to go parallel

rustic rain
#

in first case you must access index array by entity and then access managed component by index

misty wedge
#

Alright, just making sure. So IJobEntity for scheduling and Query for immediate access

rustic rain
#

in other case you access dictionary by entity

hot basin
#

How's 1.0 update? any major bugs?

misty wedge
#

I wouldn't call a second indexing "extremely slow", especially if it makes the code more readable ๐Ÿคท

wraith hinge
#

if it doesn't it's a bug

errant hawk
#

using the RefRW type

haughty rampart
vagrant lotus
proud jackal
vagrant lotus
#

another thing, what is the intended use case for netcode for entities?

currently im directly using unity transport

errant hawk
#

@rotund token how did you fix the Loading Entity Scene failed because the entity header file couldn't be resolved. error?

wraith hinge
haughty rampart
#

Ah ok. Good to see that source generators are still used in some places

errant hawk
haughty rampart
#

Any timeline on when we can expect them to use IIncrementalGenerator instead of ISourceGenerator ?

proud jackal
haughty rampart
#

Awesome

wraith hinge
# vagrant lotus another thing, what is the intended use case for netcode for entities? currentl...

it implements all kinds of things, including prediction, replication of specified components over the network, client/server connection stuff, and much more; see https://docs.unity3d.com/Packages/com.unity.netcode@1.0/manual/index.html (although don't mind some stuff being a little out of date, e.g. GAC still being used).

i personally had a great time doing a game jam with it last month; it seemed more doable to prototype a multiplayer game than i had previously imagined

errant hawk
wraith hinge
#

haven't used mirror. but mostly, i found that all the complexity i discovered was pretty inherent in the problem being solved and the model of networking it implements.

#

e.g. you have to decide whether a given object is synchronized between client and server, and whether it's just simulated on the server or also predicted ahead on the client, or just simulated on the client and the server never hears about it

#

as i understand it, this is not a thing with the lockstep / rts networking model, which com.unity.netcode doesn't implement

haughty rampart
#

some love to the unity staff for showing so much presence today โค๏ธ

vagrant lotus
misty wedge
#

Networking hard

#

is my guess

haughty rampart
#

oh, is the 'Roslyn Compiler for Unity' package still needed?

haughty rampart
#

nice

proud jackal
# haughty rampart nice

You can even change our generators if you want to add stuff, like e.g. adding your own OnChunk to IJobEntity, it's pretty fun, but it does entail the same problems that happen if you change Entities package code AKA new release causes nightmares with anything but minimal changes :3

haughty rampart
#

that's to be expected

haughty rampart
vagrant lotus
#

porting old code to 1.0,
at the getting it to working again stage,
how do i get SystemState outside of SystemBase?

proud jackal
#

how do i get SystemState outside of SystemBase?
To what do you refer? there's a mySystemBase.CheckedStateRef property you can call is that it? :3

Or do you mean, how do you get hold of a SystemState if you're not inside a SystemBase? To which the answer is World.GetExistingManagedSystem<MySystem>().CheckedStateRef o.O

whole gyro
vagrant lotus
#

im using a monobehavior to access the commandbuffer in 0.51

proud jackal
#

Slightly cursed tho, if it's just to get hold of the UnmanagedWorld then please do World.Unmanaged

vagrant lotus
#

ah

errant hawk
#

still struggling on how to get a GameObject to follow an entity...

fallow socket
misty wedge
#

Is SystemBase.GetSingleton or SystemAPI.GetSingleton preferred? (in a SystemBase based system)

vagrant lotus
#

RenderMesh constructor now requires a Renderer, where can i find a default one?

haughty rampart
#

what's the new substitution of NativeParellelMultiHashMap ?

misty wedge
#

Same goes for all the other SystemBase APIs that are now available under SystemAPI

whole gyro
#

Or if you don't need parallel, just NativeMultiHashMap

haughty rampart
#

thx

proud jackal
fallow socket
misty wedge
#

So basically use SystemAPI for everything?

proud jackal
proud jackal
whole gyro
#

So should we expect more deprecated and removed parts of the API prior to 1.0 coming out of experimental? Like removing IConvertGameObjectToEntity?

#

I would vote for more things being removed to clear up confusion

haughty rampart
#

+1

#

SystemApi.Time or World.Time for time.deltatime replacement?

misty wedge
#

I'm guessing SystemAPI.Time

proud jackal
#

Yup :3

#

The idea is for there to always be a non-codegen alternative, and SystemAPI to be the we will try to make it work in more places approach :3

haughty rampart
#

why's it not called deltatime tho?

proud jackal
#

It's SystemAPI.Time.deltaTime so still there ๐Ÿ˜› (just also has a elapsedTime)

whole gyro
haughty rampart
#

oh XD duh

#

why have a non-codegen alternative though? i've never seen any problems with codegen

errant hawk
#

damn, the editor is crashing almost every chance it gets

#

constantly having to clear entity cache just to hit play mode

proud jackal
haughty rampart
#

but that's where IIncrementalGenerator comes into play XD

proud jackal
#

Indeed :3

haughty rampart
#

so.....

proud jackal
haughty rampart
#

damn. i'd love to work on dots as a unity employee

#

well, anything really that doesn't touch c++

proud jackal
#

Unity is made in CPP so not like we don't touch it either ๐Ÿ˜›

haughty rampart
#

damn. thought there were some unity teams that don't

proud jackal
#

Depends on the team, DOTS Access rarely does, until we have something specific that needs changing :3

haughty rampart
#

it's not that i don't know cpp. just...cpp feels old and chewy.

vagrant lotus
#

I noticed that RenderMeshUtility no longer support passing EntityCommandBuffer.
Is there a new utility that add the relevant component with ECB?

haughty rampart
#

do the commandbuffersystems still need .AddJobHandleForProducer() ?

wraith hinge
whole gyro
#

Is there a way to set the entity's name through a baker?

haughty rampart
#

i know that's been asked before, but how do i get state.WorldUnmanaged in : SystemBase?

whole gyro
#

World.Unmanaged

haughty rampart
#

thx

#

is havok physics already compatible with 1.0

#

?

whole gyro
haughty rampart
#

ok. out of the package manager it flies XD

errant hawk
#

subscenes are still bugged... clearing the cache doesn't do anything as old components are still showing up even after removal

whole gyro
haughty rampart
#

well, it didn't have a 1.0 update yet, so had to remove it

#

for now

errant hawk
#

lmao my editor crashes on an empty scene now

balmy thistle
errant hawk
#

nope

balmy thistle
# errant hawk nope

You running on an M1 mac or GNU/Lunix or something in particular? What editor version?

errant hawk
#

windows, 2022.2.0b8

haughty rampart
#

eyyyyyy first crash

whole gyro
#

88 IConvertGameObjectToEntitys on the wall
88 IConvertGameObjectToEntitys
Take one down, convert it to Baker<>
87 IConvertGameObjectToEntitys on the wall
...

raw mica
# errant hawk nope

There should hopefully be a crash log in C:\Users\<username>\AppData\Local\Temp\<app_company_name>\<appname>\Crashes\Crash_<date> (can search for editor.log / player.log or a crash.dmp)

haughty rampart
#

is ISystemBase the new standard now btw?

proud jackal
#

ISystem, and yes indeed, at least if you want Buuuuurst ๐Ÿ™‚

haughty rampart
#

right. niiiice

#

i ALWAYS want burst

#

speaking of burst, can we call any external native method soon?

pastel field
#

Updating from Unity 2021 to Unity 2022 ๐Ÿคฏ
Entities 1.0.0-exp.8 **Changelog ** ๐Ÿ˜ฑ
Unity Physics 1.0.0-exp.8 **Changelog ** ๐Ÿชฆ

half jay
#

may i create or remove components inside ISystem ?

haughty rampart
#

uh, there doesn't seem to be much docs on ISystem yet.
so question is: is it supposed to be class or struct?

errant hawk
proud jackal
haughty rampart
#

good

raw mica
#

speaking of burst can we call any

haughty rampart
#

what's the difference between state.world.unmanaged and state.worldunmanaged

proud jackal
haughty rampart
#

seems very redundant then

#

๐Ÿงน

fallow socket
haughty rampart
#

why?

#

i'm talking about state.World.Unmanaged

proud jackal
#

Cause of the managed reference (World is managed)

#

state.World = unburstable because World is managed
state.World.Unmanged is as a result unburstable.
state.WorldUnamanaged is not, cause it doesn't go through a managed reference first

haughty rampart
#

ahhh. why have state.World.Unmanaged then?

raw mica
#

Wow ok the crashing was caused by an

haughty rampart
#

so runtime conversion is deprecated in 1.0 ?
how do you do dynamic entity building then?

pastel field
#

Is there a version of Unity 2022.2 that is compatible with the Entities 0.51.1 ecosystem?
I tried with Unity 2022.2.0b7 (a beta before the switch to entities 1.0.0) but it doesn't pass.

rotund token
#

you can still create entities via entitymanager

hot basin
haughty rampart
#

is anything from SystemAPI burstable?

rotund token
#

most of it isn't it?

#

most of it works inside ISystem burstable update

haughty rampart
#

awesome

pastel field
#

Making a 2021 LTS project upgrade to 2022.2 seems very compromised if I have to solve DOTS 0.51.1 => 1.0.0 first

haughty rampart
misty wedge
#

Is inheriting from a custom base class for SystemBase not allowed anymore? The code generators aren't finding my base class

proud jackal
#

All of SystemAPI is burstable :3

vagrant lotus
haughty rampart
#

backups? what's that? muahahahaha

hot basin
#

zip wtf

#

switch to git already

vagrant lotus
#

im brain dead

pliant pike
#

How would I iterate through a nativearray in a threaded job if some of this stuff is being depreciated?

rotund token
#

what is being deprecated related to that?

haughty rampart
#

de-pre-ca-ted people not de-pre-ci-a-ted

pliant pike
#

Ijobparralellfor, and entities.foreach

rotund token
#

Oh, you should be using IJobFor for a while anyway

misty wedge
#

It's a class inheriting SystemBase

rotund token
#

only time i've seen something related to this it was missing an dependency on the asmdef

misty wedge
rotund token
#

yeah are you missing something like, entities

devout prairie
#

non 1.0 question:
is it possible to set a buffer or buffer element via ecb?

misty wedge
#

entities is also there

devout prairie
#

or is only add to buffer possible

rotund token
#

there's a SetBuffer isn't there

devout prairie
#

There is, but it doesn't accept anything

haughty rampart
#

what's the reason for removing [generateauthoringdata] anyway?

devout prairie
#

at least on a parallel ecb it doesn't

rotund token
#

it returns a fresh buffer - that you then populate as your set

devout prairie
#

which i can then update

#

ahhhhhhh

#

ahhhhhhhhhhhhhhh

#

interesting, thanks

vagrant lotus
#

one thing that im really happy with 1.0 is that the 2022 editor is much faster than 2020

hot basin
#

nice, UT updated samples

#

this new Baking system seems useful

haughty rampart
#

very interesting. to me it seems like it would be a prime example for a source generator

#

uuhhh.....................
:/

#

that's a false 'truth' it's the same compilation time as writing it yourself

#

yes, but IIncrementalGenerator reduces that massively, and it runs while you code, not while you compile

balmy thistle
#

Not all the source generators are incremental

haughty rampart
#

yes but you're in the process of making them be

balmy thistle
#

And you can't get faster than not running

haughty rampart
#

so don't tell me it's 'too slow'

vagrant lotus
#

?? 2022.2.0b8 editor problem and not DOTS?

haughty rampart
#

i have written multiple source generators, some using syntax, some semantic and some both. when using ISourceGenerator you could feel it slowing down the ide in a large project. once i migrated all to IIncrementalGenerator, i could never feel any difference to vanilla even on large projects

#

of course if you keep writing Files to the temp folder and getting all kind's of (frankly) unnecessary string annotations from (idk where) you will be slow

rotund token
#

So... did you have to make EntityCommandBufferSystem.PendingBuffers internal? ^_^'

#

i'm not really seeing how i create my own command buffer system

#

(without just hacking myself internal access as always which I am happy to do but seems like i'm overlooking something)

misty wedge
#

Also kind of confused that NetworkStreamDriver.Connected is internal, that'd be nice to know

haughty rampart
#

yeah. just please stop writing the code as files to the temp folder. that will always be slow

rotund token
#

oh wait the underlying m_PendingBuffers is protected

#

yeah that's weird

haughty rampart
#

well, if anything IO is in comparison always very slow. but also, it's just not needed. as a temporary debug measure i can understand it, but source generators are built so that if you want to inspect the generated code you can go into visual studio, look into the analyzers of the solution, find the source generator (yes it's under analyzers), open it, and you can view any and all generated code 'files' (not actual files) on demand there.

proud jackal
#

It indeed does in Rider :3

haughty rampart
#

i'm not 100% confident, since i primarily use VS, but it should be supported or at least supported very soon

#

it also keeps you from editing the file. which is not a given with the file output to the temp folder

#

with a big banner 'this file is autogenerated'

proud jackal
#

Here's how to find it

devout prairie
#

I'd love to switch to Rider just to get away from VS occasionally deciding to be slow as hell

haughty rampart
#

didn't have that problem with 2022 at all. any major extension you have loaded?

devout prairie
haughty rampart
#

i mean

devout prairie
#

not sure if it's called intellisense, when it loads up code completion suggestions

#

Ah right no i'm VS 2019 ๐Ÿ˜›

haughty rampart
#

then damnit. switch to 2022 much better

devout prairie
#

it keeps telling me unsupported please upgrade, tired of installing versions of vs every ten minutes ๐Ÿ˜›

rotund token
#

rider certainly popular these days those, 80% of our devs have switched over the past 2 years. VS22 might slow the transition though.

devout prairie
#

but yeah, i should

misty wedge
#

Am I missing something with the Query API not being found by my IDE?

devout prairie
#

for various purposes tbh.. i actually do have VS 2022 installed but it's setup for C++ as i was building some repos

safe lintel
#

latest vs community seems much nicer than I remember vs in the past at the very least, but gotta say rider is pretty damn smooth

misty wedge
#

๐Ÿ˜ฆ

haughty rampart
#

sure. i'll stick to vs though

proud jackal
# misty wedge

It's part of SystemAPI, so do SystemAPI.Query<NetworkIdComponent>()

devout prairie
haughty rampart
#

why are there () around q

misty wedge
misty wedge
#

Can you exclude things from the query?

proud jackal
#

WithNone

devout prairie
# haughty rampart ๐Ÿค”

these options, in Unity prefs.. you can enable generation of built in packages etc, say if you want to browse the ecs codebase for example in VS, rather than just getting stubs..

rustic rain
#

game modding I mean

haughty rampart
devout prairie
misty wedge
proud jackal
haughty rampart
#

unfortunately not yet compiled with .net 6 / 7, but that's getting done eventually too

misty wedge
#

Interesting!

rotund token
#

personally I can't see myself using Query at all outside of baking systems

haughty rampart
#

AHHHHHHH omg. just started migrating to ISystem and writing foreach() is pain. you can feel the v1 source generators kicking in XD

vagrant lotus
rotund token
#

hmm I assume there's no way to specify a handle for ECBS anymore?
I might have to rework a few systems and split them into 2. I specifically avoided adding a few expensive jobs to this on rare occasions

devout prairie
#

possibly relevant question -
If you use a ecb.CreateEntity and assign the returned 'dummy' entity to a component entity field - that will be tracked and the entity field will be updated with the correct entity once the ecb has run..
However doing the same with a dynamic buffer - the entity field inside the buffer element is never updated..
Is this something that's likely to be 'fixed'? It would be quite useful.

rotund token
#

it's a good day

#

so long old friend

rustic rain
#

wait what

misty wedge
#

Is there a significant performance difference?

rustic rain
#

what happened?

rotund token
#

i converted all my system bases to ISystem

rustic rain
#

system base is obsolete?

misty wedge
#

He migrated everything to ISystem

#

no

rustic rain
#

huh

#

my dream

#

at least back in 0.51 kek

#

will probably be reality now

haughty rampart
viral sonnet
#

maybe not significant but good enough. it's all burst is what's great

rustic rain
#

what managed class is baseline now?

rotund token
#

apart from inherited systems for certain patterns, I can't see myself using SystemBase anymore

misty wedge
rustic rain
#

hmhm

#

ok I got it

#

with new way to get ECB

#

there's little to no need in managed systems

proud jackal
#

SystemBase is not being depricated cause there are valid uses still do to how much of Unity is managed today. Mesh is an example of that. But ISystem is to be the go to for ALL new systems, unless they specifically have to do something managed that is to be stored in the field of a system

devout prairie
#

so if system level data is stored on entities now how does that work with for example a nativearray stored on the system, how would you retrieve it

rotund token
#

i haven't bothered moving all my system level data yet to the entity, you can still store them in the system - this is going to be a task

devout prairie
#

and how do you get a reference to another system, using GetExistingSystem as before

#

i got the impression it was done internally

rustic rain
#

system reference stored on them

devout prairie
#

hmm

proud jackal
#

so if system level data is stored on

rustic rain
#

Just imagine that anything you want can be stored on entities

#

And can be queried through entity manager in almost any part of code

rotund token
#

on a side note: did anyone notice they removed Recompile After Finished Playing in 2022?

#

Recompile and Continue Playing is a nice dream, but it just breaks everything atm for me ^_^'

misty wedge
#

This is the first time interacting with ISystem for me, how do I work around calling something like SceneSystem.LoadSceneAsync now that SceneSystem inherits ISystem and not SystemBase?

viral sonnet
#

so the only regression i have now in my project is a lot of CreateRigidBodies jobs. I've dug into the query and the job runs on Translation/Rotation/PhysicsVelocity - my entities don't have a PhysicsVelocity so i'm not sure why i have so many jobs - scratch that - it also runs on static colliders.

haughty rampart
#

when i run my project it complains that there is no EndSimulationCommandBufferSystem singleton. how can that be?

rotund token
#

have you implemented your own CommandBufferSystem ?

haughty rampart
#

no

misty wedge
#

What happens if I do GetExistingSystem and then call World.Unmanaged.GetSystemStateRef but the system doesn't exist? I can't see a way to check

wraith hinge
rotund token
#

yep i noticed, thanks!

fallow socket
haughty rampart
#

what's the state of the dots compatible input system?

wraith hinge
#

normal unity input for the time being. Iโ€™ve never seen it be a bottleneck tbh

haughty rampart
#

yeah it's not a bottleneck question. rather a convenience one for ISystem etc

#

is ISystem always bursted btw or can you disable it?

viral sonnet
#

it needs a [BurstCompile] tag

rotund token
#

both on struct + methods you want to compile

rustic rain
#

Wait a second

#

So now loading subscenes can be done only through entities?

fallow socket
rotund token
#

it actually appears as bursted in the profiler now as well!

#

so fast

haughty rampart
fallow socket
haughty rampart
#

sure. thx

haughty rampart
rotund token
#

yes

#

often oncreate won't be burstable still (not really a huge deal) [actually not 100% certain it can be bursted i haven't tested since update]

safe lintel
#

it can if you use the new query builder thingamajig

devout prairie
#

i noticed they had the tag in the short examples which i thought was unusual but i guess it gives the option of using it or not

rotund token
#

oh that's what i needed to do

#

update my ISystem template to use query builder instead

haughty rampart
#

in ISystem is there something like OnStartRunning() ?

rotund token
#

ISystemStartStop

#

add that as well

haughty rampart
#

ah

rustic rain
rotund token
#

nope

#

public now!

safe lintel
#

is there a reason in a game to have multiple audio listeners?

rustic rain
#

Cool

haughty rampart
#

Unsupported parameter `Unity.Mathematics.quaternion` `q` in function `MoveSystem.ToEulerAngles(Unity.Mathematics.quaternion q)`: structs cannot be passed to or returned from external functions in burst. To fix this issue, use a reference or pointer.
since when????

wraith hinge
#

Thatโ€™s just for burst entry point functions

haughty rampart
#

uh, sorry, what?

#

i am 100% sure i was able to define a static method, burst compile it and pass a value type to it

misty wedge
#

I'm guessing EndSimulationEntityCommandBufferSystem.AddJobHandleForProducer is handled by the dependency to the singleton now?

haughty rampart
#

yes

rotund token
#

obviously update formatting for your own styling

#

(and if you don't have a template, highly recommend you making some. saves so much time)

haughty rampart
viral sonnet
#

i should do that. looks useful

rotund token
haughty rampart
#

yes

rotund token
#

you can't pass structs to burst function pointers

haughty rampart
#

need i ref / in it?

rotund token
#

only primitives / pointers

#

ref might be fine, i havent written a function pointer in ages

viral sonnet
#

does anyone else have CreateRigidBodies jobs on static colliders all the time? with entities 0.51 those were only calculated once and then the job was just a blip on the timeline. i've even checked the change job and comps. no changes going on.

haughty rampart
#

it's not a function pointer. it's just a simple static method

rotund token
#

if you put a [burstcompile] on it

#

it's now a function pointer

whole gyro
#

Thanks for sharing btw

haughty rampart
rotund token
#

if you call it from burst code yes

haughty rampart
#

so.......i don't need to annotate everything with [Burstcompile]

rotund token
#

only OnUpdate

haughty rampart
#

why do i need to annotate OnUpdate then?

rotund token
#

to make it into a function pointer

haughty rampart
#

since [BurstCompile] is already on the system struct?

rotund token
#

that doesn't compile anything

#

that's just a hint for burst to find things to compile

#

burst searches structs/classes for [BurstCompile] attribute
then searches within that struct/classes methods for [BurstCompile] attribute to actually compile

#

(unless the attribute on a job, then it just knows what to do)

haughty rampart
#

i was better at dots once......have to get good again XD

#

ok, so with a job struct inheriting from IJobEntity....do i need to also annotate Execute() since it's not a fixed definition?

#

or is that redundant

viral sonnet
#

you don't have to

#

i think burst handles every IJob as trigger to compile every method there. the same can't be said for ISystem where methods are sometimes not possible to burst compile.

#

that's why we need individual [BurstCompile] tags in ISystem but not for every job

haughty rampart
#

right. i start to remember now

rustic rain
viral sonnet
#

every method in a job gets burst compiled. 100%

rustic rain
#

๐Ÿค”

haughty rampart
#

yeah i agree. it's kinda inconsistent and a bit confusing. need clarification here please

rotund token
#

no way to do use EntityQueryBuilder with chunk components? ๐Ÿ˜ฆ
I guess you live another day GetEntityQuery

viral sonnet
#

maybe if a method in a job struct isn't called from execute is the only reason burst compilation is skipped

haughty rampart
#

damn. seems like all unity staff left. no way to know

#

hoooooray crash

#

XD

viral sonnet
#

so uhm, about my physics problem. no one uses static colliders? ๐Ÿ˜„

safe lintel
#

what was the problem?

rotund token
#

i haven't got to the point of having a gameplay library updated yet

haughty rampart
#

haven't yet reached my physics part ๐Ÿ˜„

rotund token
#

3/14

viral sonnet
#

the colliders get recalculated every frame

rotund token
#

i got caught up updating this libraries api

viral sonnet
#

CreateRigidBodies job is running heavily. no idea because there are no rigid bodies on these colliders

proud jackal
haughty rampart
#

no stress

whole gyro
#

And thanks for staying up late for us ๐Ÿ˜ƒ

proud jackal
#

no way to do use EntityQueryBuilder with

proud jackal
wraith hinge
#

ok here's the deal with burstcompile people

#

burst can only ever burst static methods, period, end of story.

#

what's the deal with isystem's onupdate, and ijob*'s execute, you ask? different magic for each.

#

in the case of jobs, each job interface is annotated with an attribute like [JobProducerType(typeof(SomeOtherSpecialSecretType))]

#

burst knows to look for this attribute, go find that other type, make sure it's generic, specialize it with the type of your specific job struct, and then compile the static Execute method on that other type. the static Execute method on that other type will call your personal Execute with some arguments and in some context, and your personal Execute will be bursted as part of that larger static function.

viral sonnet
#

physics giving me more trouble. the spike is when the player character moves. no such spike in 0.51

wraith hinge
#

in the case of isystem, we run an ILPP that specially generates static functions that take a void* for the this argument plus the ref systemstate, and we cast the void* back to the particular system type and then call the non-static onupdate on that. burst then bursts our static wrappers, and we make sure to call the static wrappers when we update systems.

#

so, corollaries of this:

  • non-execute methods of job structs that have burstcompile on the job struct are not bursted [edit: unless they're static and you put burstcompile on them specifically]
  • the isystem magic only happens for the special callbacks we've implemented this wrapper stuff for
  • the job execute stuff can make it seem like burst entry points can take other arguments, because your personal execute is not actually the burst entry point
#

i feel like i should paste this somewhere less ephemeral, but i dunno where

viral sonnet
#

some friendly mod should pin this ๐Ÿ™‚

rotund token
#

i feel silly, but ah, where is the live conversion option now (i don't see anything in preferences)

viral sonnet
#

you mean the dot?

rotund token
#

that doesn't seem to change this preview

wraith hinge
rotund token
#

i only have a live baking logging option

#

which i have toggled on/off

wraith hinge
#

err, sounds like a bug to me.

#

i imagine it was a slightly flubbed backport from master

rotund token
#

i assume i can probably hack this on via LiveConversionSettings

wraith hinge
#

yeah just set LiveConversionEditorSettings.LiveConversionEnabled = true

rotund token
#

marked as an internal setting

#

the BakingPreferences

haughty rampart
wraith hinge
#

i mean there's more codegen magic there, but basically, the execute is still ultimately called from a static secret extra method which is the actual burst entry point

haughty rampart
#

ah

rotund token
#

haha this has led me down a much more fun path
UnityEditor.EditorPrefs.SetBool("DeveloperMode", true); ๐Ÿ˜ˆ

haughty rampart
#

what's that do?

rotund token
rotund token
#

but makes Unsupported.IsDeveloperMode() return true

#

enabling a bunch of internal things

proud jackal
#

I think it's the same as just typing internal inside the help>about window ๐Ÿ‘€

rotund token
#

anyway turning on live baking has fixed the issue

#

now that i can see the option

wraith hinge
#

i haven't actually noticed too many things that are gated on that these days. i think it enables these funny circles that tell you when a window is repainting?

rotund token
#

and i can actually see my authoring data at runtime now

#

i was very confused why that wasn't working

#

aww time for work, back to 0.51

haughty rampart
#

how do i enable the new transform system?

rotund token
#

it's enabled by default

#

but if you install physics/netcode it gets disabled

#

as they aren't updated yet to support it

haughty rampart
#

ah damn

#

welp, out with netcode then

#

and physics apparently

coarse turtle
#

what's the new way of writing tests with ECSTestsFixtures now? I used to use Entities.ForEach(() => { }) for quick tests. is there something as convenient or would it be using an EntityQuery and iterating that query to test components? ๐Ÿค”

robust scaffold
#

Ugh, i wanna play with 1.0 so badly. Damn work, taking up all my time.

coarse turtle
#

oh that's very neat lol

#

thanks ๐Ÿ™‚

misty wedge
#

Anyone know what's going on here? [Worker0] 'Schnozzle.Serialization.SerializeEntity' is missing the class attribute 'ExtensionOfNativeClass'!

minor sapphire
wraith hinge
#

no. unless you jump through massive hoops, everything you call from bursted code is bursted

minor sapphire
#

right so what you're saying is "don't call the other methods from a non-burst context and expect them to be bursted?"

viral sonnet
#

so I haven't figured out the physics change. if I just remove the colliders I'm back to how my timeline looks in 0.51 - at least that's something. 2022 and 1.0 is around 5-10% faster in my stress test

#

what i find worrisome though for physics. every static collider gets rebuilt when 1 dynamic collider changes position. i don't know how that should work with any kind of game world.

#

i was hearing whispers that this will be fixed but apparently not in 1.0exp

#

getting 12ms BuildPhysicsWorld when the player moves ๐Ÿ˜„

safe lintel
#

is anyone's unity stalling on reloading domain from code changes? a restart always cures it but getting annoying

viral sonnet
#

no issues here

timber ivy
safe lintel
#

havent tried that yet

timber ivy
#

Usually works for me

#

i just prune all the generated files from the project directory

safe lintel
#

giving it a go now

viral sonnet
#
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <d8312cdadbc04553bb2b6d38bb19d383>:0)
Unity.Collections.NativeParallelHashMap`2[TKey,TValue].CheckRead () (at Library/PackageCache/com.unity.collections@2.1.0-exp.4/Unity.Collections/NativeParallelHashMap.cs:747)
Unity.Collections.NativeParallelHashMap`2[TKey,TValue].GetValueArray (Unity.Collections.AllocatorManager+AllocatorHandle allocator) (at Library/PackageCache/com.unity.collections@2.1.0-exp.4/Unity.Collections/NativeParallelHashMap.cs:330)
Unity.Entities.BlobAssetStore.ResetCache (System.Boolean disposeAllBlobAssetReference) (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities.Hybrid/GameObjectConversion/BlobAssetStore.cs:69)
Unity.Entities.BlobAssetStore.Dispose () (at Library/PackageCache/com.unity.entities@1.0.0-exp.8/Unity.Entities.Hybrid/GameObjectConversion/BlobAssetStore.cs:455)``` that's an odd one
#

Dispose leads to GetValueArray?

#

oh leak detection is no more?

rotund token
#

in preferences

viral sonnet
#

oh in jobs. i see ๐Ÿ˜„

#

lol it was enabled all the time. seems it doesn't have as much overhead anymore

safe lintel
#

ugh still stalling on domain reload

rotund token
#

see what's looping

viral sonnet
#

the above error is thrown on an empty blobAssetStore btw. somehow i have one left in a system that i just create and dispose

safe lintel
#

how do I force a breakpoint for script recompile?

rotund token
#

just when it's stalled

errant hawk
#

Still looking for an easy way to track a entity with a GameObject

#

so far I've tried to add a component that has a reference to a prefab, that didn't work as I kept getting null refs

viral sonnet
#

add the Transform to the entity?

errant hawk
viral sonnet
#

if i remember correctly the fps demo used WeakAssetReference to get around the problem. might be overkill though. is this for a 3rd person camera or smth?

errant hawk
#

Literally just want a GameObject to follow an entity. Lights, camera, etc that dont currently work with entities

viral sonnet
#

can you query the entity? i have a case where I query a comp in a coroutine until it's found. then setup some stuff

errant hawk
#

I can query an entity, but it doesn't have a valid prefab because for whatever reason the baker fails to assign the field

viral sonnet
#

i mean query the entity from the GO. that way you don't need any reference at all. just spawn the prefab and have some kind of unique tag on it to query it easily

errant hawk
#

For now I guess that's what I'll do

#

The API I think changed a bit, do you got a good idea on what needs to be done?

rotund token
#

can just attach any gameobject to an entity

#

and optionally bind monobehaviours/components to the entity

#

(not updated to 1.0)

#
    {
        [SerializeField]
        private GameObject prefab;

        [SerializeField]
        private CopyModes copyMode = CopyModes.CopyTransformToGameObject;

        public GameObject Prefab => this.prefab;

        public CopyModes CopyMode => this.copyMode;
    }```
#

can control what direction the transform is copied

#

the gameobject life cycle is managed for you

#

created/destroyed

#

the tldr: it stores the prefab reference on a class ComponentData

#

and instantiates it at runtime

#

then adds any componet you want, animator, light, etc to the entity for you to query

viral sonnet
#

that's the proper solution ๐Ÿ™‚

rotund token
#

note: the entity is marked UnityEngine.HideFlags.HideInHierarchy

#

so you won't even see it

#

it'll just appear to be a pure solution

#

but if you want to see it just change the bindings in HybridDecoratorSystemGroup

#

but you dont need to touch the gameobject ideally

#

it'll create/destroy on entity lifecycle and by default bind Transform, Animator, SkinnedMeshRenderer to the entity

errant hawk
#

All this just so I can get a camera to follow an entity...

rotund token
#

but you can add anymore you want by implementing ComponentDecoratorSystemBase

#

i mean it's 1 component

#

then the whole thing is automated?

#

(though if you want a good camera, i have a near full cinemachine wrapper for entities)

errant hawk
#

doesn't matter, it shouldn't even be a requirement to set it up this way in the first place

viral sonnet
#

until hybrid is more of a thing that's how it is

errant hawk
#

It's no longer called hybrid, but Entity Graphics

#

I'm really hoping they add support for at least the camera, but they said it is unlikely to change

viral sonnet
#

hybrid as in GO <-> entities link mr smarty pants

wraith hinge
#

for cameras and stuff where there's only one, i just set static variables with the position and rotation from the code that knows which entity is which, and then read said variables from a monobehaviour on the gameobject i want to move

#

hardly a rolls-royce solution, but it works

errant hawk
viral sonnet
#

we have heard very little on hybrid or GO companion objects. as long as animations are not out we have to rely on GO Animators and it's pretty frustrating that we all have to implement the same thing. tertle has put a nice package together but there's still so much more. Audio or Particle systems for example where there's no dots equivalent.

wraith hinge
#

i mean for animators yeah we're dealing with it, but it's a big task. for audio, it's kinda like input where it's unlikely to be a bottleneck. for particles, probably same, but with vfxgraph? how many particle systems do you intend to have? and also, you can kind of make your own particle systems in dots, because dots scales almost as well as the c++ in shuriken

viral sonnet
#

it's not really about bottlenecks. it basically boils down to having all the missing features on a GO that follow an entity and writing the interface from the entity to the GO. apart from the interface we have to deal with spawning the presentation GO and handle the updating of Transforms. everyone today has to implement this because there's no way around it and will stay so for much longer.

wraith hinge
#

it's true. but i'd say most of the things we have dealt with so far have been hair-on-fire things where people really couldn't write their own stuff to get around it

viral sonnet
#

and you have been doing a great job! ๐Ÿ™‚ i hope there's not so much fire anymore. you have ticked off most of the big things in this release i think. some focus on this problem would be great when things have settled down and especially for 1.0 which will bring in a lot more devs and newcomers.

#

it's also in the spirit of converting existing games to dots. with a good foundation of entities <-> GOs it's not as daunting.

wraith hinge
#

yeah, agreed, especially since this flavor of QOL is probably not a huge amount of work? whereas the next steps for more speed are very involved, like research into changing the dependency scheme of systems so jobs can overlap more

viral sonnet
#

i can't even imagine how complicated improving the dependency scheme is ๐Ÿ˜„ the job system is already doing such a good job. kind of surprised you want to do even more on that front.

wraith hinge
#

if you look at the cpu utilization in a cpu-heavy dots game, you'll see that we go wide a lot better than normal monobehaviour unity, but there are still significant bubbles where we call .Complete() and then do some main thread work

#

whereas if you look at the same profile for e.g. Spiderman, you will not see such gaps

#

so we wanna fix that ๐Ÿ™‚

viral sonnet
#

great times ahead. you are obviously not slowing down even with 1.0 on the horizon

viral sonnet
#

when an ISystem can be used for conversion. A SystemBase will work too, right? Has anyone tested?

rotund token
#

yes

safe lintel
#

think you gotta add the system flags to baking

rotund token
#

^

viral sonnet
#

[WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)] just this one, right?

safe lintel
#

yeah

viral sonnet
#

that's convenient. so GOCS is completely obsolete?

safe lintel
#

they still use it in some physics bake/conversion so not really sure

viral sonnet
#

i basically have to use a systembase because it's a generic baking system. now it's a GOCS

#

i'm so confused. that happens in my game project. can an asmdef lead to that?

safe lintel
#

guessing missing asmref?

viral sonnet
#

i use the same in my other project so it's double weird ๐Ÿ˜„

safe lintel
#

hm on first glance companions dont create gc like before

viral sonnet
#

lol I'm so lost to what's going on ๐Ÿ˜„

#

i never had a namespace problem for Dictionary or List

rotund token
#

but i looked deeper and physics has full baker support

#

from my testing GOCS don't even run

#

so ah i think it's just like IConvertblah left in non-functionally

safe lintel
#

ah well sort of feel better because I was converting my GOCS(because they werent working & i didnt know about the flag) to bakers until I saw that physics still had them, and now I def should continue converting

rotund token
#

yeah full baking

safe lintel
#

i wonder if they fixed the joint conversion behaviour bug? no mention of it in the changelog ๐Ÿ˜Ÿ

#

Generic message code 233 has not been handled very helpful

#

alright libraries updated, lets see how opening the actual project goes

rotund token
#

oh yeah i got spammed with that last night

#

no idea what it was

safe lintel
#

is RegisterPrefabForBaking the new DeclareReferencedPrefab?

rotund token
#

you dont need to do anything

#

except GetEntity(prefab)

#

handles for you now i think

safe lintel
#

kinda what confuses me, what situation would you need RegisterPrefabForBaking then?

rotund token
#
        {
            if (gameObject == null)
                return Entity.Null;

            var gameObjectId = gameObject.GetInstanceID();

            // If it already exists, just give back the reference
            if (!_GameObjectToEntity.TryGetValue(gameObjectId, out var entity))
            {
                if (gameObject.IsPrefab())
                {
                    // Okay, it doesn't exist so we need to create it
                    entity = CreateEntityForPrefab(gameObject);
                }
            }

            return entity;
        }```

```        void RegisterPrefabForBaking(GameObject prefab)
        {
            if (!_BakedEntities._GameObjectToEntity.ContainsKey(prefab.GetInstanceID()))
                _BakedEntities.CreateEntityForPrefab(prefab);
        }```
#

both just call CreateEntityForPrefab

safe lintel
#

thats odd

#

but GetEntity is much simpler ๐Ÿ™‚

viral sonnet
#

damn, i've found out what's going on. codegen is breaking my custom partial class SpellLoader

#

was working fine in 0.51

#

tricked it with putting all the using declarations into the partial file

#

how do we get the BlobAssetStore in a baking system?

rotund token
#

var bakingSystem = World.GetExistingSystemManaged<BakingSystem>();

#

.BlobAssetStore

#
    /// Provides methods to control the baking process, and provides access to the <see cref="BlobAssetStore"/> used
    /// during baking.
    /// </summary>
    [DisableAutoCreation]
    public partial class BakingSystem : SystemBase```
viral sonnet
#

ah nice thanks a lot!

#

have you tried SystemAPI.Query with a MB? doesn't seem to work

rotund token
#

SystemAPI is codegen

#

it only works in systems

viral sonnet
#

how are we supposed to iterate over MBs now for baking?

rotund token
#

oh you mean iterating MB

#

not querying from MB

rotund token
viral sonnet
#

says error DC0053: Entities.ForEach cannot be used in system ScriptableObjectConversionSystem as Entities.ForEach in generic system types are not supported.

rotund token
#

well yeah you cant use code gen with generics

#

you'll just have to manually chunk iterate or ToEntityArray from a generic

viral sonnet
#

i hate these kind of regressions. that was working great in GOCS

rotund token
#

well GOCS was using ComponentSystem

#

EFE in that was very different

viral sonnet
#

isn't systembase just an enhanced version of componentsystem?

#

true

#

hm, the query can't find anything. does this look correct to you? var query = GetEntityQuery(ComponentType.ReadOnly<ScriptableObjectConverter>()); as it's just a MB I think I can't use it.

rotund token
#

oh in your baking system?

#

it's too late by this point

#

the gameobjects no longer exist

#

(as far as i can tell from my half day of playing with this)

viral sonnet
#

oh well that makes sense. okay at least i know what to do now. but now i need sleep. thanks for your help

rotund token
#

there's 2 phases
Baking phase using Bakers, (slow managed phase) that converts authoring data into entity data (and you can create temporary entity data for baking)
Processing phase, (fast burst) systems that process this entity data

rustic rain
rotund token
#

you can store temp data on components and have the component removed before runtime using
[TemporaryBakingType]

rotund token
#

(not this case but it's still required for now)

#

if you have data you want to store in a blob, basically write it to a temp component then process it into a blob in the system

#

it would be nice to avoid this for blobs and have access to them in baking but not possible atm at least from my quick testing

#

(again hasn't been long of experimentation)

dense storm
#

Anyone have an example how you define system group?

#

I just have to make a class that derive from ComponentSystemGroup?

rotund token
#

yep

dense storm
#
    public class PreMovementGroup : ComponentSystemGroup { }

    [UpdateAfter(typeof(PreMovementGroup))]
    public class SetDirectionGroup : ComponentSystemGroup { }

    [UpdateAfter(typeof(SetDirectionGroup))]
    public class MovementGroup : ComponentSystemGroup { }
#

This is fine?

rotund token
#

should be fine

dense storm
tropic venture
#

YESSSSSSS!!!!!!!!!!!!!

#

i gotta try it out

dense storm
#
        public partial struct TeleportJob : IJobEntity
        {
            void Execute(ref LocalToWorldTransform transform, ref TeleportData teleportTarget)
            {
                //if (teleportTarget.enabled)
                //{
                  transform.Value.Position = teleportTarget.Position;
                  transform.Value.Rotation = teleportTarget.Rotation;
                //}
                //teleportTarget.enabled = false;
            }
        }

How do I do this with the new IEnableable now?

rotund token
#

(Dani got you ^_^) [I love trolling people while they type]

proud jackal
dense storm
#

So I no longer have to check enabled in the execute and it will exclude from query automagically?
And I assume I have to set enabled = false outside the job?

proud jackal
#

Specifically all the code to check enabledness is source generated by us when you do IJobEntity, so the biggest difference between doing IJobEntity and IJobChunk is that you would normally have to write that check yourself by checking the V128 bitflag ๐Ÿ˜›

#

Btw you can also set enabled = false/true inside a job by using ComponentLookups :3

rustic rain
#

Any plans on making uncapped chunks though?

proud jackal
# dense storm How do I do this?
partial struct SomeJob : IJobEntity {
    public  ComponentLookup<TeleportTarget> someLoonup;
    Execute (Entity e) => somelookup.SetEnabledness(e, false);
}

then

var myLookup = SystemAPI.GetComponentLookup<TeleportTarget>();
new SomeJob{someLookup= myLookup}.ScheduleParallel();
dense storm
#
job.TargetComponentData = this.GetComponentLookup<TeleportData>(false);

//In Job

public ComponentLookup<TeleportData> TargetComponentData;
proud jackal
dense storm
#

I see, ok!

haughty rampart
#

using ISystem
this happens: The system --- writes Unity.Transforms.LocalToWorldTransform via --- but that type was not assigned to the Dependency property. To ensure correct behavior of other systems, the job or a dependency must be assigned to the Dependency property before returning from the OnUpdate method.

#

apparently ISystem requires manually adding it to some dependency?

rustic rain
#

If you use jobs

#

you must return correct JobHandle with all dependencies

haughty rampart
#

i do it the same as here:

public struct SampleComponent : IComponentData { public float Value; }
public partial struct ASampleJob : IJobEntity
{
    // Adds one to every SampleComponent value
    void Execute(ref SampleComponent sample)
    {
        sample.Value += 1f;
    }
}

public partial class ASample : SystemBase
{
    protected override void OnUpdate()
    {
        // Schedules the job
        new ASampleJob().ScheduleParallel();
    }
}
#

from the docs

#

so not sure what the error is

proud jackal
#

i do it the same as here

haughty rampart
#

what roslyn version does current unity 2022.2 use?

narrow scaffold
#

Hello guys,
I have another dots question:

I have a struct that describes the execution of a player ability,
it contains info like animation names, timings, damage, references to effect prefabs etc.

I would like to be able to dynamically store these abilities on my player entitiy, and be able to switch them out at runtime.

What do you think is the best way to do this in dots?

rotund token
#

That's a bit of a broad question and I could probably write a thesis on it!
I've researched half a dozen ability systems and they all worked very different to achieve different things.

#

If you're question simplifies down to just, I have data about abilities, how do i store it there are a few different approaches all with different positive negatives, a few but definitely not limited to

  1. don't store it on the entity, keep the actual data in a system (or system singleton) that uses it and just index to it
  2. store it in blob memory on a component
  3. store it on a separate entity with a reference
  4. write a custom container suitable for your needs
#

all of these have a theme of not really needing to store the actual data on the actors entity, but just some type of indexer into your data

#

this could just be a buffer of keys, where each key is a skill you have unlocked

rustic rain
#

oh god, upgrading project's conversion is so painful

#

btw

#

native containers now are fixed sized structs, right?

#

for component data

rotund token
#

i mean, they aren't fixedlist or something like that
most just end up being like a ptr + allocator label once safety is removed

narrow scaffold
#

Thats already a great help @rotund token , thanks a lot. I assumed that it would be a bad idea to store the ability data directly on the entity so that confirms my intuition. I will try around with your suggestions!

rustic rain
#

so

#

since they are unmanaged now

#

it's still fixed size

#

just a little bigger

rotund token
#

yeah still a certain size just has a few safety elements as well

#

i mean, all structs are fixed size ^_^'

rustic rain
#

hmmm

#

[UpdateInGroup(typeof(GameObjectAfterConversionGroup), OrderLast = true)]

#

what would be an equiavlent for BakingSystem?

haughty rampart
#

anyone know what roslyn version current unity 2022.2 uses?

rotund token
#

pre -> transform -> bake -> post

karmic basin
rustic rain
#

hmm

#

any idea

#

whether DisableRendering affects nested entities?

#

so for example

#

there's parent

#

with DisableRendering

#

will children get drawn?

rotund token
#

I believe they still will

#

I wrote a simple helper at one point to disable all in a hierarchy

#

(this info from 0.51 but I doubt it's changed as it'd inefficient to check hierarchy for component each frame)

dense storm
#
[BurstCompile]
    public partial struct TeleportSystem : ISystem
    {
        public void OnCreate(ref SystemState state) { }
        public void OnDestroy(ref SystemState state) { }

        [BurstCompile]
        public void OnUpdate(ref SystemState state)
        {
            var teleportLookup = SystemAPI.GetComponentLookup<TeleportData>(false);
            new TeleportJob
            {
                TeleportLookup = teleportLookup
            }.Schedule();
        }

        [BurstCompile]
        public partial struct TeleportJob : IJobEntity
        {
            public ComponentLookup<TeleportData> TeleportLookup;

            void Execute(Entity e, ref LocalToWorldTransform transform)
            {
                var teleport = TeleportLookup[e];
                transform.Value.Position = teleport.Position;
                transform.Value.Rotation = teleport.Rotation;

                TeleportLookup.SetComponentEnabled(e, false);
            }
        }
    }

This kept executing even when TeleportData is off.

#
void Execute(Entity e, ref LocalToWorldTransform transform, in TeleportData teleport)
            {
                transform.Value.Position = teleport.Position;
                transform.Value.Rotation = teleport.Rotation;

                TeleportLookup.SetComponentEnabled(e, false);
            }

This gives off InvalidOperationException: The writeable ComponentLookup<ProjectBrave.TeleportData> TeleportJob.JobData.TeleportLookup is the same ComponentTypeHandle<ProjectBrave.TeleportData> as TeleportJob.JobData.__ProjectBrave_TeleportDataTypeHandle, two containers may not be the same (aliasing). exception

#

Not sure how to make it behave like it does when I used flag before using IEnableable interface.

#
public partial struct TeleportJob : IJobEntity
        {
            void Execute(ref LocalToWorldTransform transform, ref TeleportData teleportTarget)
            {
                //if (teleportTarget.enabled)
                //{
                  transform.Value.Position = teleportTarget.Position;
                  transform.Value.Rotation = teleportTarget.Rotation;
                //}
                //teleportTarget.enabled = false;
            }
        }

Previous code

#

Need help using IEnableable as a flag correctly :(

rotund token
#

you can't pass in a typehandle and a lookup of the same component

#

without turning off safety assuming what you're doing is safe

#

what you're doing is actually safe so you could turn off safety on the ComponentLookup if you wanted

#

alternatively if you aren't comfortable doing that instead of passing in get TeleportData from your TeleportLookup

#

and just add a [WithAll(typeof(TeleportData))]

#

to your job

dense storm
#

I see, I will do that. Glad to know its safe!
But currently IEnableable is pretty weird, there are too many workarounds you have to do compared to just using flags.

rotund token
#

this isn't really related to IEnableable

#

(your error)

#

it's a pretty common case

#

for example you want to offset 1 entities translation to another entities translation

rustic rain
#

hmmm

#

can't find

#

how to get BlobAssetStore for baker

rotund token
#

I posted this for enzi above

rotund token
#

And a bit more below

gloomy halo
ebon stratus
# rustic rain how to get BlobAssetStore for baker

There is a difference between a Baker and a BakingSystem. In a Baker, you should use AddBlobAsset because then the BlobAssets are tracked and correctly reverted and rerun whith Incremental Baking. For the BakingSystem, while technically you can get a BlobAssetStore as described, you should note that that does not mean that it is properly tracked and reverted like in a Baker.

rustic rain
#

any example of how to use AddBlobAsset then?

rotund token
#

I'm curious about this actually because physics currently does all their blob asset work in the baking systems

#

What's the benefit either way

#

Is this for sharing memory? Eg. Does addblobasset only create unique blobs?

ebon stratus
#

I'll split my answer in two, first for the Baker:

#
ref var blobRoot = ref blobBuilder.ConstructRoot<int>(); 
blobRoot = 2; 
var blobAssetReference = blobBuilder.CreateBlobAssetReference<int>(Allocator.Persistent);
AddBlobAsset<int>(ref blobAssetReference, out _);```
#

This is a very simple example, after creating the BlobAssetReference, you call AddBlobAsset to 'register' the BlobAsset to the Baker. After that you can store the BlobAssetReference in a component like before and it will be available to you

rustic rain
#

hmm
And if add DependsOn()
then blob will be removed and replaced with new one?

rotund token
#

(Sorry I skipped ahead and read the source code. It totally is TryAdd ref stored to the asset store. somehow missed this ok)

ebon stratus
#

Then for the BakingSystems. Unfortunately, this is a lot more complicated. I haven't looked at the Physics code yet, but I do know that there is some code that we haven't been able to change yet, afaik Physics falls in that category.

rotund token
#

I'm assuming the case for using BakingSystems would purely be very specific performance or use cases then?

#

But yeah this makes a lot more sense, for most use cases Baker seems much more preferable

ebon stratus
#

Yes, I am currently working on some samples for BlobAssets to show the different use cases. A user pointed out on the forum that creating a lot of BlobAssets that are intensive to create could be more performant in BakingSystem. But for most use cases the Baker is sufficient and easier

ebon stratus
frosty siren
#

Use of [ExecuteAlways] on systems is now deprecated. Use [WorldSystemFilter(WorldSystemFilterFlags.Editor)] instead to ensure your system is added and runs in the Editor's default world. If you'd like to ensure your system always updates, use the [AlwaysUpdateSystemAttribute] instead

Does it mean that now systems can run in edit mode?

rotund token
#

I guess 1 final question, it returns the hash of the blob asset in an out - what would be a use case I would need this? (I can think of uses in a BakingSystem but not so much a Baker)

ebon stratus
rotund token
#

Oh I guess 1 more, if I use Baker.TryGetBlobAssetReference I assume it will still track fine / reverts etc?

ebon stratus
#

Usually this is not something you need. But you can use the hash in TryGetBlobAssetReference() to check if a BlobAsset already exists. AddBlobAsset() also checks that the BlobAsset doesn't exist, but it does require you to create the BlobAsset first.

#

Yes, all methods provided by the Baker will track correctly and revert as needed. That is why we removed the access to the BlobAssetStore directly, to make sure that you have no unexpected behaviour because something is not tracked

rotund token
#

ok thanks for your help! that will provide a way to avoid some costly blob setup

#

need to sleep but mind is racing now

proud jackal
#

`Use of ExecuteAlways on systems is now