#archived-dots

1 messages ยท Page 94 of 1

slow epoch
#

I don't know if it's still there but if it is maybe the source code could give some tips about modifying GOs on jobs but probably it's just internal stuff

flat talon
#

IJobParallelForTransform

slow epoch
#

How do you manage to modify transforms in jobs and that anyone else is already modifying them?

flat talon
#

I never dug into what the class does, but it works. Signature is:
public void Execute(int i, TransformAccess transform)

Then you can just write
transform.position = new Vector3(

#

I saw this in an ancient sample, before Burst/ECS was much of a thing ๐Ÿ™‚

slow epoch
#

Maybe is some kind of CommandBuffer-like thing

flat talon
#

Anyways, I think that way to access the transform will be deprecated very soon ๐Ÿ™‚

slow epoch
#

Yeah i even though it wasn't supported anymore

winter veldt
#

well i'm fine with doing it outside of a job.. i can just.. access the GO right from the OnUpdate?

flat talon
#

ugh how do I paste a codeblock in Disco again?

#
    {
        Camera mainCamera = Camera.main;
        if (mainCamera == null)
            return;

        Vector3 cameraVector = mainCamera.transform.position;
        float3 cameraPos = new float3(cameraVector.x, cameraVector.y, cameraVector.z);
        
        Entities.With(query).ForEach(

etc..  ```
#

that should work just fine @winter veldt

#

This is from a ComponentSystem

winter veldt
#

ok cool! thanks

winter veldt
#

works great

hollow jolt
safe lintel
#

@winter veldt you can also just parent the camera to another entity(as well as using CopyTransformToGameObject) and access that parent entity through a job if you ever wanted to manipulate it through jobs without messing around with its transform directly

mystic mountain
#

Is it possible to check if entity exist in job?

#

Like, I have a reference to an entity in a component, and might want to add a component to it, I'd assume it's not safe to add component to entity that has been destroyed?

coarse turtle
#

I think @rare umbra might be having the same issue @mystic mountain

#

Or a similar one

mystic mountain
#

Realized I can solve it by checking a component I never remove from it..

vagrant surge
#

@mystic mountain pretty sure there is a entitymanager is entity handle valid type call somewhere

#

not sure from within jobs tho

flat talon
#

@mystic mountain yes it is possible by using Exists on ComponentDataFromEntity giving the id, but I guess you just figured that out ๐Ÿ™‚

vagrant surge
#

btw, just asking. Its not possible to add/remove components while iterating, no?

#

not even on non-jobbed systems

coarse turtle
#

yea afaik

onyx mist
#

If I'm understanding correctly you can do this by continously getting the "getcomponentdatafromentity()"-type functions

#

Atleast that's what I did for my thingie

#

So like you get the componentdata, add the component or any other structural change, things get invalidated, get the component data again after

#

Im doing this on the main thread though, not sure how itd work in a job

vagrant surge
#

oh, not talking about that exactly

#

i comment about adding/removing entities while iterating

#

you are iterating a for-each or system of some entities, and modifying the entities you iterate

#

without command buffer and without barriers

#

for example you iterate all entities with a Health component, and if health < 0, then you set a Dead component

misty void
#

can someone explain to me what is DOTS animation? it is mentioned multiple time but i never see any article or documentation about it ๐Ÿค”

tawdry tree
#

A package for doing animation within DOTS (ECS and such). That's all I know. AFAIK it isn't out yet, or if it is, it's very recent (preview).

misty void
#

ah i see, kinda weird that they mention something that isn't available yet.

#

which make me even more confused

hollow sorrel
#

@vagrant surge latest (or one of latest idk it has been a while) update added being able to add/remove during iteration/ForEach in non-job systems

#

jobbed still needs ecb tho

vagrant surge
#

ill try to check implementation

#

that thing is actually crazy tricky to implement

remote coyote
#

There is a super early version of DOTS animation on staging

vagrant surge
#

the issue is fairly simple-ish. Take that you are matching component A, and adding B. And there are 10 archetypes that have A

#

one of them has A+B

vagrant surge
#

you start iterating an archetype that is maybe A only, and add B

hollow sorrel
#

[0.1.0-preview] - 2019-07-30
Allow structural changes to entities (add/remove components, add/destroy entities, etc.) while inside of ForEach lambda functions. This negates the need for using PostUpdateCommands inside of ForEach.

#

was the version it was added in

remote coyote
#

Latest update was late June though

vagrant surge
#

now an entity is moved into chunk of AB, and you risk double-exxecuting the entity

hollow sorrel
#

yea i don't really understand it but i remember people talking about it being a big deal

vagrant surge
#

it is

#

its actually quite tricky to implement, algorithm wise

#

to do it safely

safe lintel
hollow sorrel
#

what is the benefit? is it more efficient to do during iteration?

vagrant surge
#

a lot more so

#

its also a lot more flexible

#

the reason its faster is because you dont need all of the command buffer execution. You do the copy while iterating, when stuff is still hot in the memory

hollow sorrel
#

ahh i see

misty void
#

welp, i guess i better wait then

remote coyote
#

Ah nice find!

safe lintel
#

if you manage to get it working ping me ๐Ÿ™‚

dull copper
#

you'll get ping in few weeks once Unity releases the updated package ๐Ÿค”

safe lintel
#

weeks ๐Ÿ˜ฉ

#

wonder what exactly is holding it up

dull copper
#

things breaking would be my educated guess

magic frigate
#

I'll gladly wait for them to make everything work nicely together instead of trying to learn from something unfinished that requires weird workarounds

safe lintel
#

well.. it still sort of requires some weird workarounds right now

dull copper
#

and probably still does after next version

#

would need to come back in few years if one wants more finalized setup ๐Ÿ˜„

#

even if they do get the base entities package out of preview next year, it's likely to evolve a lot during upcoming years still

remote coyote
#

We have a commit!

#

Not very exciting though, sadly

naive parrot
untold night
#

At least we now know how to contribute properly.

Thanks goodness, there could have been all kinds of wacky pull requests!

civic bay
#

How can I add a component to entities that have a specific component. But to set this in a normal GameObject?

silver dragon
#

You can use EntityManager and EntityQuery in a MonoBehaviour.

civic bay
#

How can I create a query in a MB?

silver dragon
#

EntityManager.CreateEntityQuery

#

and get EntityManager from a World

civic bay
#

Ah just found that then lol

#

Thanks

silver dragon
#

np ๐Ÿ™‚

civic bay
#

I was trying to get entity query

#

But I guess thats the old way from these Unity Docs

#

Or unless that's in a ComponentSystem

dull copper
#

(not mine, from earlier discussion about that)

prime cipher
#

Oh, that sweet sour taste of anticipation

remote coyote
#

Hahaha

mystic mountain
#

And another day goes by.. ๐Ÿ˜ข

remote coyote
#

will probably be last Friday in November, or first Friday in December, or last Friday in December, or first Friday in January, or...

low tangle
#

just sucks because the more I build the more I have to change to accommodate changes we dont know. but then again, we signed up for this with prerelease software

mystic mountain
#

Currently I'm in a position I don't know if I've done something wrong order, logic seems fine, but DOTS NetCode crashes on me - spend possibly 3 day debugging and possibly finding nothing, or wait for next release and maybe save that time x)

remote coyote
#

yeah, I wouldn't sit on the fence waiting for Netcode

#

I'm just doing other things that don't rely on it

prime cipher
#

That's what I thought too and took a look into the new UI Builder. Builder looks awesome. bad thing, the corresponding Panel Renderer just renders nothing during gameplay. Another spot to wait for probably ๐Ÿ˜ฆ

hollow jolt
#

is there a way to inspect this static method ? Unity.Physics.JointData.CreateRagdoll

#

i want to create my onw joint but can't see the source code

fair flame
civic bay
#

What's the correct way to iterate through entities with X and Y component but not Component Z?

#

Like if I have run component, turn component, death component

and have a system that move's the target, for entities that have run and turn components

#

But when death is added, to stop move system from running

#

atm im just removing run and turn components when I add death

#

but dunno if that's the right way?

slow epoch
#

I think is better to have a Alive component

#

But there is an attribute to ignore entities with X component

#

Don't remember the name tho

dull copper
#

at this point, I wouldn't wonder if 2019.3 release and dots packages landed at the same time

civic bay
#

Oh cool, I'll try find it

#

Thanks

remote coyote
#

I think that's the expected thing Olento. That we will get the 2019.3 release and the new 0.2 version of the DOTS packages (along with Netcode and DOTS Animation) at the same time.

slow epoch
#

Any date for 2019.3?

#

I'd say over Jan-Feb

dull copper
#

within 4 weeks now is very likely

#

they never go past xmas for the last release

slow epoch
#

I was thinking about .4 for some reason

dull copper
#

that's probably going to be out in the spring

#

along with 2020.1

mint iron
#

atm im just removing run and turn components when I add death
@civic bay you can either add [ExcludeComponent(typeof(MyComponent))] to the job struct or set a None value on the query description passed into the job schedule. _myQuery = GetEntityQuery(new EntityQueryDesc { Any = new [] { ComponentType.ReadOnly<Whatever>(), ComponentType.ReadOnly<SomeStuff>(), }, None = new [] { ComponentType.ReadOnly<MyComponent>(), } });

civic bay
#

I have a NativeArray of entities of a query type, how can I add a component to just any half of the entities in this array?

#

I tried Slice() but don't understand fully how that works

#

I have the add component stuff all set up, but it adds it to every entity matching the query, just want it to add to 50/100 of the entities

onyx mist
#

Does it have to be perfectly even? You might be able to do if(rand.NextInt(0, 101) < 50) {add component }or similar

civic bay
#

No not perfectly even, just average

#

Is there no way to split a NativeArray to another NativeArray with a set size?

silver dragon
#

Create a new NativeArray with a smaller size, iterate over it and copy values?

trail burrow
#

@civic bay

        // 100 of something
        var a = new NativeArray<int>(100, Allocator.Persistent);
        
        // first 50 of em
        var b = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<int>(a.GetUnsafePtr(), 50, Allocator.Persistent);
#
        // middle 50 of em
        var b = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<int>(((int*)a.GetUnsafePtr()) + 25, 50, Allocator.Persistent);
civic bay
#

Is NativeArrayUnsafeUtility... safe to use for this?

#

haha

trail burrow
#

if you know what it's doing, and how the memory is shared between the array instances, yes

#

if you have no idea how it works, or what happens when you pass a pointer from one arrays memory to another... no probably not

civic bay
#

Yeah I do, that's okay then

#

Need to mark as unsafe{ } right?

trail burrow
#

yes

civic bay
#

Awesome, got it thanks @trail burrow

trail burrow
#

np

civic bay
#
  unsafe
{
    NativeArray<Entity> tenPercentOfEntities = new NativeArray<Entity>();
    tenPercentOfEntities = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<Entity>(landedEntities.GetUnsafePtr(), (landedEntities.Length * 10) / 100, Allocator.Persistent);

    m_entityManager.AddComponent(tenPercentOfEntities, typeof(TestTag))

    tenPercentOfEntities.Dispose();
}
#

@trail burrow Hey I get an error with this, wondering if you could see what I'm doing wrong?

trail burrow
#

well what was the error lol

civic bay
#

Sorry was playing it again to get it

trail burrow
#

also you should not tenPercentOfEntities.Dispose()

civic bay
#

InvalidOperationException: The NativeContainer GatherEntityInChunkForEntities.Entities has not been assigned or constructed. All containers must be valid when scheduling a job.

#

How come?

#

Because it's persistent?

trail burrow
#

because the copy array doesn't own the memory

civic bay
#

Ohh

#

Still get the same error though

#

As well as A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

trail burrow
#

i dont have time to debug this sorry ยฏ_(ใƒ„)_/ยฏ

civic bay
#

No worries

#

Thanks for your help anyways

mint iron
#

@civic bay new NativeArray<Entity>() should have Allocator.Persistent arg; convertexisting copies the safety/sentinel, and your collection has neither so job detects it and gives u that exception All containers must be valid.

civic bay
#

But NewNativeArray<> takes in 2 args

#

Entity[]
NativeArray<Entity>
length

Followed by Allocator

#

I suppose I could put the size in based on the % I want

#

for both of them

#

I'll try that

#
EntityQuery landedGlitterQuery = m_entityManager.CreateEntityQuery(ComponentType.ReadOnly<LandedGlitterData>());
NativeArray<Entity> landedEntities = landedGlitterQuery.ToEntityArray(Allocator.Persistent);

unsafe
{
    int percentToFall = (landedEntities.Length * 10) / 100;

    NativeArray<Entity> tenPercentOfEntities = new NativeArray<Entity>(percentToFall, Allocator.Persistent);
    tenPercentOfEntities = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<Entity>(landedEntities.GetUnsafePtr(), percentToFall, Allocator.Persistent);

    m_entityManager.AddComponent(tenPercentOfEntities, typeof(ReadyToShakeTag));
}

landedEntities.Dispose();
#

This is my code now and still same 2 errors as above

#

InvalidOperationException: The NativeContainer GatherEntityInChunkForEntities.Entities has not been assigned or constructed. All containers must be valid when scheduling a job.

#

A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

flat talon
#

@trail burrow Have you compared that method with using NativeArray.Copy ? That in the end does a MemCpy after a bunch of bounds checks

#

I always thought ConvertExistingDataToNativeArray() was mostly useful when reading from managed arrays?

civic bay
#

But you can't copy to a smaller NativeArray<> than the current, can you?

flat talon
#

you can specify index start in both source and dest, and how much of the source to read

#

so you would allocate a target native array with the smaller size you want, then copy into it from the bigger array

civic bay
#

How do you specify the index start?

flat talon
#

there are lots of overloads, one has 5 params: sourceArray, sourceStartIndex, targetArray, targetIndex, length)

#

It looks like ConvertExistingDataToNativeArray doesnt do a copy but simply uses the memory already present, ie copies the pointer

civic bay
#

Wait, lots of overloads in what method?

#

CopyTo? or on the constructor for the NativeArray

flat talon
#

Copy yes

#

Alternatively you could also use a NativeSlice, which seems to do a similar thing as using ConvertExistingDataToNativeArray

civic bay
#

I tried to use that, but didn't seem to work how I wanted it to

flat talon
#

Sorry if Im confusing your case JHulse, I'm just interested in what is the best way and in what case each is useful

#

If you really want to copy the data into a new memory block, then I'd recommend using NativeArray<T>.Copy

civic bay
#

No no any help is greatly appreciated

#

I'm giving Copy a go now

flat talon
#

If you just want a "view" into the existing memory, then slice or ConvertExistingDataToNativeArray() seems more useful.

Anyone please feel free to correct me here ๐Ÿ™‚

civic bay
#

I wanted to get 10% of the entities with a certain tag, so I can add another tag to just that select 10%

#

So wouldn't copying the pointer be better?

#

Seems NativeArray.Copy works though

#

I'll roll with this and keep trying the ptr method, see if I can get that working

flat talon
#

the Copy copies the memory, so if you modify that those changes wont be reflected in the bigger array

#

I use it when combining things and splitting data apart

hollow sorrel
#

thinking about seperating rendering from simulation, dots physics atm modifies Translation directly but would be nice to be able to run simulation at a certain framerate (e.g. 30 or 60) while rendering goes at whatever the refresh rate of your monitor is, interpolating between physics positions. i assume this is pretty common

can't decide wether to use either

  1. seperate Entity for rendering, holding its own Translation + mesh + a reference to the physics entity that has the 'real' position
  2. keep everything on the same Entity, but make a new component like InterpolatedTranslation and use that for rendering (would be writing own rendersystem anyway)
#

what would you guys do

flat talon
#

afaik to run things at different rates they need to be in different worlds no? Or you mean not tick the component systems every frame?

#

I know Unity is working on adding more support for that (running different worlds at different rates)

hollow sorrel
#

my plan was to just leverage ComponentSystemGroups, default world is already split up into a SimulationSystemGroup and a PresentationSystemGroup
not sure if they support different rates atm, but should still be possible to turn off autoupdate and call update manually from somewhere else at different rates

#

not sure if that's better than seperate worlds, but presentation systems would be constantly getting data from simulation components to represent so i feel like same world makes sense

flat talon
#

Yeah that was my worry as well, you'd constantly be copying data between the two. But this is one of the cases they have stated for having multiple worlds at different tick rates, game logic vs rendering.

I haven't done anything like this yet though, but people on the forums have been discussing it.. have you tried searching there?

mystic mountain
#

@hollow sorrel the multiplayer NetCode already does simulation at fixed rate, and rendering at framerate

hollow sorrel
#

how do they do it? seperate worlds?

#

also while i'm definitely interested in that too and i'm glad you brought it up, the tl;dr of my question i guess is more:

is it better to split components into multiple entities (such as 'render entities'), or is it better to have monolith entities that hold everything

leaning towards the 2nd because i feel dependencies are kinda anti-ecs if they can be avoided, but i think that also means there'd be a lot of chunks by how dots handles archetypes

vagrant surge
#

@hollow sorrel split is generally better if you are editing them commonly

#

the cost of add/remove components depends on how big your entity is

#

and if you add/remove lots of different things, there is kind of an explosion on archetypes

#

so in this case, it depends if your entity is going to change commonly or not

hollow sorrel
#

ahh i see

vagrant surge
#

for my experiments on c++land with my own ecs that copies unity, i have a clear separation beetween the render entities and the game entities

#

so on the game i have game object with physics/logic/states, but it just points into a "dynamic mesh" entity that is basically transform + bounds + mesh

#

does unity already do that? ๐Ÿค”

#

on the ecs renderer

hollow sorrel
#

not sure but i don't think they use a different entity

#

only a sharedcomponent to hold the material/mesh iirc

vagrant surge
#

thats fragmentation nation

#

i thought of doing that in my engine, but it was a terrible idea

#

loading any sort of game map would end with 999999 archetypes

#

and crazy fragmentation

hollow sorrel
#

ahhh

#

what happens memory wise tho when you reference them? i assume for each entity that is iterated you do another lookup to the referenced entity's component using the entitymanager

#

or is there like a smarter way to get all references

mystic mountain
#

current DOTS multiplayer has everything in one world, they use two additional components for interpolated rendering.

vagrant surge
#

in my case i was using change detection through version ids and the like

#

so i had a system that checked if transform changed, and updated render objects

#

for static objects you obviously dont need that

#

but for dynamic game objects...

#

i havent checked the code of the hybrid renderer, probably should

hollow sorrel
#

yea makes sense

#

i think for hybrid renderer they also filter changed objects

#

saw something like that at least

#

btw i feel it makes sense to put the reference on the rendering entity to the simulation entity since that's where the data comes from, but what if you delete the simulation entity and want to delete the rendering entity

#

would the rendering system just constantly check if the referenced entity is still alive

vagrant surge
#

no,there are tricks for that

#

unity has system state components that are precisely designed for this

hollow sorrel
#

ah yea i forgot about those

#

but then they'd both have a reference right

#

simulation entity a state component to the rendering entity, rendering entity a normal component to the simulation entity

#

just making sure

vagrant surge
#

no, no need

#

the system state component holds a reference to the "render proxy" entity

#

when the game object gets deleted, the system state component gets "orphaned"

#

you can iterate orphaned SSCs

#

so you iterate those orphaned sscs, and then delete the render proxies they are pointing to

#

i havent added system state components to my own ecs, but i absolutely want them for things like this

hollow sorrel
#

yea but the render proxy still holds a reference to the entity with the state component right

vagrant surge
#

yeah. But when the entity gets deleted, the state component gets orphaned, so then you delete the proxy

hollow sorrel
#

makes sense

#

thank you, this helps a lot

#

and @mystic mountain ty for letting me know about the netcode, i'll check out how they do the different rates

winter veldt
#

hey all. i have a question about getting components and component data from entities. is there a way to get the components from a given entity? like for instance, if i save an entity in a component, can i then get the entities position data from it somehow?

night cargo
#

Use EntityManager.GetComponentData to get the data from your first entity, then again get the position data from the entity referenced in your component.

winter veldt
#

thanks!

#

i see ComponentDataFromEntity<T> can also be used inside jobs.

knotty radish
#

new 0.2 version of the DOTS packages is out /o/

hollow sorrel
#

don't play with my heart

knotty radish
#

But no netcode yet (since it's in his own package)

safe lintel
#

Wait, for real?

untold night
#

Wat

knotty radish
#

Well netcode always was in the multiplayer git repo

#

But let me double check

#

Not seeing anything related to that

#

So will need to wait the specific netcode update

#

Still, there is a lot to process in that update so enjoy

safe lintel
#

and here i was beginning to gain acceptance of a long wait!

hollow sorrel
#

this looks new

craggy orbit
#

it really is out ๐ŸŽ‰

hollow sorrel
#

seems new entity gets automatically created in default world now that keeps track of time

safe lintel
#

might be related Time` is now available per-World, and is a property in a `ComponentSystem

hollow sorrel
#

oOoOo

#

wait where are you getting that from

#

is changelog out too

safe lintel
#

its in the package

#

yeah that link ๐Ÿ™‚

hollow sorrel
#

oh 3 mins ago i got "changelog not available offline"

#

oh prob cuz i still had compile errors nvm

onyx mist
#

Oh my god

knotty radish
#

The build manager is sexy

stiff skiff
#

Well.. time to do some major digging haha

mystic mountain
#

I figured if I started doing some large refactoring with manual labour dependent on current DOTS stuff, which I know I have to redo when they release new package, then they would release the new packages in a day or two, but I didn't expect the same day ๐Ÿ˜Ž

onyx mist
#

Yikes, good luck!

stiff skiff
#

It now requires the scriptable build pipeline, thats new

safe lintel
stuck saffron
#

Thanks bro

hollow sorrel
#

looks like samples have been updated too

safe lintel
#

@digital scarab oh hey since you're here, was wondering if you knew of any long term plans for the physics system to use more of the transform system components?

#

alrighty thanks, will ask on the forums

stiff skiff
#

Are there separate system groups for Update and FixedUpdate?

flat talon
#

aww yiss, finally โค๏ธ

safe lintel
#

oh wait maybe i misread the code there

#

yeah forget that

twin raven
#

really? I was planning to do something else but guess not ๐Ÿคท๐Ÿผโ€โ™€๏ธ

stiff skiff
#

Why this new sudden restriction? InvalidOperationException: Cannot add more than 8 SharedComponent to a single Archetype

flat talon
#

in what cases would you possibly want that many shared components? Ive used like a max of 1 or 2 ๐Ÿ˜›

hollow sorrel
#

not sure how i feel about that [ConverterVersion(string username, int version)]
if i understand correctly we're supposed to increment that every time we change a component or authoring so that subscenes rebuild?

prisma anchor
#

Is there a way to not schedule a job if your data isn't ready?

stiff skiff
#

@flat talon its more that its odd to suddenly have this limit. If I want to have lots of chunks.. why not

worldly pulsar
#

@prisma anchor don't call Schedule()? ๐Ÿ˜›

flat talon
#

they had to put a limit, Mike went into it somewhere. Cant remember if it was for perf or API reasons

mystic mountain
#

Interesting stuff, I wonder if

* Duplicate component adds are always ignored
* No exception is thrown when re-adding a tag component with `EntityQuery`.

will allow duplicate Tag/Component adds without exception throwing all over the place? That would be neat! : )

prisma anchor
#

@worldly pulsar it complains that i didn't return a job and just returned input deps

night cargo
#

HYPE

flat talon
#

hardcodednumber: Combine your new job with the input deps and return that

prisma anchor
#

an empty job?

flat talon
#

ie just pass the deps into your schedule method and return the job handle for the new job

hollow sorrel
#

i imagine * Duplicate component adds are always ignored means it won't be added

prisma anchor
#

I see. thanks.

flat talon
#

ah sry, didnt see you didnt want to schedule a job.

prisma anchor
#

correct.

hollow sorrel
#

you can just return the same jobhandle that's passed in as param i think

flat talon
#

btw can you explain how your "data isnt ready" ? is it being prepared by another job? if so, add that job as a dependency?

worldly pulsar
#

it complains that i didn't return a job and just returned input deps
Wait what? What's the exact error? I'm 90% sure I did return inputDeps before and it didn't complain.

prisma anchor
#

I'm trying to recreate it, gimme a second

dull copper
#

oh wow

#

they did release them

#

better grab local copies to cache before they wipe them for whatever reason ๐Ÿค”

flat talon
#

cant see the new animations or network packages though, Im sure they will follow shortly

dull copper
#

yeah they are not on the bintray yet

#

only entities, jobs, hybrid and collections

#

missing physics update as well

flat talon
#

good enough for me for now ๐Ÿ™‚ there goes the weekend ๐Ÿ˜„

prisma anchor
#

On an unrelated note, I'm getting this error ArgumentException: A component with type:GameBoardData has not been added to the entity. However, in the entity manager the entity does have the type GameBoardData

flat talon
#

hmm physics is weird, they did promise last time to keep that in sync

dull copper
#

it's not given that physics does require a bump

#

you'd expect it tho due to bigger api changes

flat talon
#

beta 12 out as well, crashes my project as soon as I try to open it ๐Ÿ˜ฆ better stick with 11

hollow sorrel
#

physics still seems to work on my test project

#

dunno about bigger projects

dull copper
#

I haven't had issues with b12

#

did you wipe library?

#

I mean I get random crashing very often when upgrading the engine version for old projects

#

@digital scarab any word on the anim and netcode packages?

#

ah

#

is there going to be physics update for this?

#

or is the current version fine?

#

with Entities 0.2?

#

ok, thanks for the info ๐Ÿ™‚

flat talon
#

ah good point, I'll try wiping library

prisma anchor
#

Thanks @flat talon @worldly pulsar I was doing it wrong lol. Its working now

flat talon
#

oh hey ๐Ÿ˜‰

dull copper
#
## [Entities 0.2.0] - 2019-11-22

**This version requires Unity 2019.3 0b11+**

### New Features

* Automatically generate authoring components for IComponentData with IL post-processing. Any component data marked with a GenerateAuthoringComponent attribute will generate the corresponding authoring MonoBehaviour with a Convert method.
* BuildSettings assets are now used to define a single build recipe asset on disk. This gives full control over the build pipeline in a modular way from C# code. 
  * BuildSettings let you attach builtin or your own custom IBuildSettingsComponents for full configurability
  * BuildPipelines let you define the exact IBuildStep that should be run and in which order
  * IBuildStep is either builtin or your own custom build step
  * BuildSettings files can be inherited so you can easily make base build settings with most configuration complete and then do minor adjustments per build setting
  * Right now most player configuration is still in the existing PlayerSettings, our plan is to over time expose all Player Settings via BuildSettings as well to ease configuration of complex projects with many build recipes & artifacts
* SubScenes are now automatically converted to entity binary files & cached by the asset pipeline. The entity cache files previously present in the project folder should be removed. Conversion systems can use the ConverterVersion attribute to convert to trigger a reconversion if the conversion system has changed behaviour. The conversion happens asynchronously in another process. Thus on first open the subscenes might not show up immediately.```
#
* Live link builds can be built with the new BuildSettings pipeline.
  Open sub scene
  * Closed Entity scenes are built by the asset pipeline and loaded via livelink on demand
  * Opened Entity scenes are send via live entity patcher with patches on a per component / entity basis based on what has changed
  * Assets referenced by entity scenes are transferred via livelink when saving the asset
  * Scenes loaded as game objects are currently not live linked (This is in progress)
 by assigning the LiveLink build pipeline

* `Entities.ForEach` syntax for supplying jobified code in a `JobComponentSystem`'s `OnUpdate` method directly by using a lambda (instead of supplying an additional `IJobForEach`).
#
* `EntityQueryMask` has been added, which allows for quick confirmation of if an Entity would be returned by an `EntityQuery` without filters via `EntityQueryMask.Matches(Entity entity)`.  An EntityQueryMask can be obtained by calling `EntityManager.GetEntityQueryMask(EntityQuery query).`
* Unity Entities now supports the _Fast Enter playmode_ which can be enabled in the project settings. It is recommended to be turned on for all dots projects.
* The UnityEngine component `StopConvertToEntity` can be used to interrupt `ConvertToEntity` recursion, and should be preferred over a `ConvertToEntity` set to "convert and inject" for that purpose.
* _EntityDebugger_ now shows IDs in a separate column, so you can still see them when entities have custom names
* Entity references in the Entity Inspector have a "Show" button which will select the referenced Entity in the Debugger.
* An `ArchetypeChunkIterator` can be created by calling `GetArchetypeChunkIterator` on an `EntityQuery`. You may run an `IJobChunk` while bypassing the Jobs API by passing an `ArchetypeChunkIterator` into `IJobChunk.RunWithoutJobs()`.
* The `[AlwaysSynchronizeSystem]` attribute has been added, which can be applied to a `JobComponentSystem` to force it to synchronize on all of its dependencies before every update.
* `BoneIndexOffset` has been added, which allows the Animation system to communicate a bone index offset to the Hybrid Renderer.
* Initial support for using Hybrid Components during conversion, see the HybridComponent sample in the StressTests folder.
* New `GameObjectConversionSystem.ForkSettings()` that provides a very specialized method for creating a fork of the current conversion settings with a different "EntityGuid namespace", which can be used for nested conversions. This is useful for example in net code where multiple root-level variants of the same authoring object need to be created in the destination world.```
#
* `EntityManager` `LockChunkOrder` and `UnlockChunkOrder` are deprecated.
* Entity Scenes can be loaded synchronously (during the next streaming system update) by using `SceneLoadFlags.BlockOnStreamIn` in `SceneSystem.LoadParameters`.
* `EntityCommandBuffer` can now be played back on an `ExclusiveEntityTransaction` as well as an `EntityManager`. This allows ECB playback to   be invoked from a job (though exclusive access to the EntityManager data is still required for the duration of playback).
flat talon
#

congrats on the release @digital scarab You guys must be so relieved to finally get this out the door ๐Ÿ™‚

dull copper
#

I won't spam the rest of the changelog here, those were the new feats, rest has upgrade guide changes and fixes :p

worldly pulsar
#

Somewhat unrelated, but did anyone manage to get the "Generate all .csproj files" option to work reliably? It sometimes works for me, but even when it does, Unity then decides to regenerate the .sln again without all the package projects whenever I touch anything in the editor

flat talon
#

Anyone else seeing a bunch of these on project load? its just warning, so should be fine :)

"Assembly for Assembly Definition File 'Packages/com.unity.entities/Unity.Scenes.Hybrid.Tests/Unity.Scenes.Hybrid.Tests.asmdef' will not be compiled, because it has no scripts associated with it.
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)"

winter veldt
#

does it change all the things again?

flat talon
#

thanks @dull copper wiping the library got me into b12 ๐Ÿ™‚

winter veldt
#

@worldly pulsar i've had that issue too, and dropped it.

worldly pulsar
#

Dropping it is not really an option if I often need to read the Entities code :/

hollow sorrel
#

generate csproj? as in like for packages?

dull copper
#

@worldly pulsar I've had mixed experience with it

#

I think wiping all generated stuff sometimes work

#

but not always

#

only way to reliably get the missing packages to solution is to place the packages as local packages on your packages folder

#

but obviously it's more pain to update them there

night cargo
#

If somebody else runs into weird Burst issues, just restart Unity.

dull copper
#

@hollow sorrel if the csproj are not on the game solution, you can't browse through those packages source code, or jump to it from your project

#

it's super handy

#

especially when figuring out how things work

hollow sorrel
#

where does one find this

dull copper
#

it's in editor preferences I think

flat talon
#

Alex - there's normally an error when you update the package, that the one you ran into?

worldly pulsar
#

some combination of restarting Unity, deleting all .csproj/.sln, opening a .cs file in Packages in editor and clicking Assets/Open C# Project works. You can see how this is annoying ๐Ÿ˜›

dull copper
#

same place where you select your code editor

#

there's a checkbox for it

worldly pulsar
dull copper
#

yup

hollow sorrel
#

ooooo

untold night
#

Rider actually has a separate packages folder

#

it's quite nice

dull copper
#

technically you could make two batch scripts that moved packages back and forth from your library/packagecache to packages folder and back

hollow sorrel
#

thanks, i've gotten used to F12 and clicking files manually in project window, but references don't show up because it doesn't know the entire csproj

dull copper
#

yeah, you don't get further than metadata if you don't have the full packages there

worldly pulsar
#

@untold night I know, I just really don't like the IntelliJ IDE (mostly because their vim plugin is terrible)

safe lintel
#

so.. anyone know how to do that live conversion thing?

dull copper
#

@safe lintel ```* Live link builds can be built with the new BuildSettings pipeline.
Open sub scene

  • Closed Entity scenes are built by the asset pipeline and loaded via livelink on demand
  • Opened Entity scenes are send via live entity patcher with patches on a per component / entity basis based on what has changed
  • Assets referenced by entity scenes are transferred via livelink when saving the asset
  • Scenes loaded as game objects are currently not live linked (This is in progress)
    by assigning the LiveLink build pipeline```
#

these things need to be in subscenes for now

flat talon
#

anyone here running beta 12 with HDRP 7.1.5? I have a weird thing where I create a Cube (GameObject->3d object -> cube) it emits light like crazy

safe lintel
#

i thought subscenes would show the live conversion in editor though(without needing to build?)

dull copper
#

@safe lintel have you tried the Advanced/SubsceneWithBuildSettings sample on the DOTS sample repo?

#

it has some livelink confs by the looks of it

safe lintel
#

@flat talon since b5 ive had strange artifacts with the default material if its converted to an entity

#

thanks ill check that out

stiff skiff
#

How do you make this BuildSettings asset ?

#

nvm.. found it, it was weirdly greyed out, but suddenly let me make one

safe lintel
#

where did you find it?

night cargo
#

With the [GenerateAuthoringComponent], how can we run a GameObjectConversionSystem? Since the generated component doesn't seem to appear in the code editor, there is just no way to GetPrimaryEntity

flat talon
#

why would you want to use both? Either you want the conversion to be automatic or manual?

#

You can still implement IConvertGameObjectToEntity as before

#

If you mean you want a converted prefab entity reference, I dont know of a way to let GenerateAuthoringComponent handle that since the component field is just Entity

stiff skiff
#

Mmm, build out players with burst compilation disabled, throws an exception when the world is created

#

Could anyone help me verify this isn't just me?

flat talon
#

The disabled checkbox unchecked in the Burst AOT settings? and you updated to 1.2 preview 9?

stiff skiff
#

I'm on 2019.3.0b12, with the new entities package and whatever that relies on

#

Burst AOT has compilation disabled for all platforms

#

Things work fine in the editor, burst on and off

#
'Message': 'Burst failed to compile the function pointer `Void AddComponentEntitiesBatchExecute(Unity.Entities.EntityComponentStore*, Unity.Collections.LowLevel.Unsafe.UnsafeList*, Int32)`'
'Stacktrace': '  at Unity.Burst.BurstCompiler.Compile[T] (T delegateObj, System.Boolean isFunctionPointer) [0x000f3] in <3e635592c8244e9c835505c46070ed2f>:0 
  at Unity.Burst.BurstCompiler.CompileFunctionPointer[T] (T delegateMethod) [0x00000] in <3e635592c8244e9c835505c46070ed2f>:0 
  at Unity.Entities.StructuralChange.Initialize () [0x00000] in <71559f61f83b471ca031f77599b51d27>:0 
  at Unity.Entities.EntityManager..ctor (Unity.Entities.World world) [0x0000b] in <71559f61f83b471ca031f77599b51d27>:0 
#

Its not really telling me why it failed

flat talon
#

did you check what version of Burst is installed? when I upgraded an existing project it didnt update Burst, but did for a new fresh project

safe lintel
#

@dull copper hmm that example doesnt show you the preview conversion results unless im not enabling a certain setting?

vagrant surge
#
  • Added support for managed IComponentData types such as class MyComponent : IComponentData {} which allows managed types such as GameObjects or List<>s to be stored in components. Users should use managed components sparingly in production code when possible as these components cannot be used by the Job System or archetype chunk storage and thus will be significantly slower to work with. Refer to the documentation for component data for more details on managed component use, implications and prevention.
#

this is absolutely huge

#

really, really, really huge

stiff skiff
#

@flat talon The only version in the PackageCache is com.unity.burst@1.2.0-preview.9

flat talon
#

yeah thats the latest

#

Just to check, have you done a standalone player build on this machine before updating to 0.2? Just wondering about the VS SDK prereqs

safe lintel
#

@vagrant surge im a little confused how that differs from just using AddComponentObject?

stiff skiff
#

I've certainly build standalone before, but I made sure the checkout of my project was clean

vagrant surge
#

@safe lintel letting you store normal C# classes lets you do anything

#

you can point to OOP classes for stuff

#

its more than just the component object stuff

safe lintel
#

but couldnt you do that before?

vagrant surge
#

no

#

component datas had to be struct

#

so no managed data types

#

now they can be class, and be managed

#

they will be much slower

#

and no burst support

#

but you will be able to interface with external things to the ECS much, much easier

safe lintel
vagrant surge
#

because you dont point to a game object

#

you can point to any normal C# stuff

hollow sorrel
#

is it just me or did Convert and Inject stop working (seems to also destroy now)

safe lintel
#

i think you use ConvertToEntity(stop) now, seemed to not destroy the gameobjects for me

safe lintel
#

actually you know what forget what I said, not really sure what the hell is going on here

night cargo
#

@flat talon thanks, I just did not know it handled the whole conversion (thought it just created the authoring component for attaching to the object and nothing else).

hollow sorrel
coarse turtle
#

Yay I just saw the update ๐ŸŽ‰ time to play with it ๐Ÿ™‚

rare umbra
#

I just updated and I'm getting a compile error in the package:
ICompiledAssembly' does not contain a definition for 'Defines' and no accessible extension method 'Defines' accepting a first argument of type 'ICompiledAssembly' could be found (are you missing a using directive or an assembly reference?)

safe lintel
#

i found that not all of my packages updated automatically, so like had to manually update some things

rare umbra
#

hrmm it says everything is up to date here

safe lintel
#

i had a lot of trouble updating though, did have some prior package combination that wasnt compatible so i had to make a new project, add entities and the main packages manually, and then copy paste it back over to my main project.

#

and my project still is broken with the new inject behaviour ๐Ÿ™‚

worldly pulsar
#

"Convert and Inject" destroying the gameobject has to be a bug

rare umbra
#

Whoops

night cargo
#

What I do anyway and think is a good practice is to use a separate object for the convert to entity and always destroy. If you need transform access add it in the conversion.

safe lintel
#

too much stuff to change if this is just a bug/oversight on their part personally but i see what you're saying

night cargo
#

It would be nice if conversion happened before any system "on create" method ๐Ÿ˜ข I find it nice to use oncreate for initialization and just found out that my converted entities were not created at that point.

deft niche
#

"Convert and Inject" destroying the gameobject... damn!! Breaks everything on my current project... ๐Ÿ˜ฆ

safe lintel
#

youre not alone ๐Ÿ˜„

magic frigate
#

Where exactly are these Fast Enter playmode options? Do they mean disabling these guys?

magic frigate
#

Thanks, I wrongly assumed they added new options with the new .02 entities update but it just means they support it now. Man, this is fast.

candid willow
#

oh what is this? version 0.2.0 is released

#

why yes, I do want to try the update at 2am

mint iron
#

@night cargo i've found that annoying also, especially if you have a filter on the system because then OnStartRunning will be fired repeatedly. But i guess the conversion has to be considered async since it can happen at any time (e.g. addressables intantiating objects with conversions)

onyx mist
#

"Cannot find the field TypeInfos required for supporting TypeManager intrinsics in burst"

prime cipher
#

Canโ€™t wait to get my hands dirty with 0.2, now conversion of any type is supported? Like Cameras, Skinned Mesh Renderer, etc?

onyx mist
#

has anyone gotten this error?

#

i deleted and rebuilt my library folder but it didnt seem to help

#

"InvalidOperationException: Burst failed to compile the given delegate: Void InstantiateEntitiesExecute(Unity.Entities.EntityComponentStore*, Unity.Entities.Entity*, Unity.Entities.Entity*, Int32)
attribute: Unity.Burst.BurstCompileAttribute"

#

i get this too

mint iron
#

checked all your package versions and editor version are latest? to rule out caches you could try making a fresh new project and see if the issue still appears.

onyx mist
#

yup i checked, editor version is 2019.3.0b12, packages are all updated

trail burrow
#

tons of issues with the new 0.2 update

#

๐Ÿ˜ฆ

#

of course

fair flame
#

@onyx mist make sure burst is on the latest preview package, not the latest verified

onyx mist
#

1.2.0 right?

fair flame
#

it should be preview.9- 1.2.0, yeah

onyx mist
#

yup im good there

fair flame
#

try rebuilding your Library, I was getting that error before but I'm not sure exactly what fixed it

onyx mist
#

I'll try doing that again

onyx mist
#

ok i think that did it!

trail burrow
#

can't get it to work, even in a fresh project, idk wtf is wrong

#

ยฏ_(ใƒ„)_/ยฏ

hollow sorrel
#

whats your error

#

might have to manually add packages to the json, mainly properties 10

trail burrow
#

@hollow sorrel i just gave up and realized that i'll wait for ecs/dots to be some resemblance of stable before i poke it again

#

i just cba to fiddle with it to make it work anymore lol

hollow sorrel
#

๐Ÿ‘Œ

#

though imo entities 0.2 seems pretty stable so far apart from the gameobject inject issue (which has a workaround but i hope they fix it before 0.3)

#

didnt seem to have breaking changes for existing code either

trail burrow
#

@digital scarab eh... nice backhanded comment lol.

#

Getting some type of compilation error when i import it, and a friend had some issue with burst throwing an error on some internal job in the entities package i think.

#

And I can't be bothered to figure stuff like that out by hand, when I install a package for the engine I'd like it to just work without having to go through manually figuring out if there's missing references, etc. and patching .json config files by hand

hollow sorrel
#

yea i think thats fair

trail burrow
#

Well. I tried to install entities 0.2-preview, something doesn't compile inside of it. I don't know what it is, and I can't be bothered to figure it out.

#

@digital scarab will have to be later, gotta deal with the kids now (Saturday morning and all)

worldly pulsar
#

@digital scarab any chance the GameObject Inject/Destroy issue will be hotfixed within like a week or two?

dull copper
#

@digital scarab I do feel that Unity should be more agressive on clearing the library cached things on package upgrades as that's like source of half of the issues people have with the updates (not just with dots but in general)

#

making people wait more when they upgrade things is lesser bad than stuff straight up throwing random looking errors at people

#

right now it feels like library conflicts are not dealt at all

#

I'm quite used to clearing the whole library folder as first step when things do something unexpected right after any update in Unity because that stuff simply does not work like you'd expect

#

I do stress that we, as users, shouldn't need to clear Unitys cached data manually

#

as long as package manager has been around, this has been like number one issue with new people or people in general who started disliking the package workflow in current Unity

trail burrow
#

@dull copper clearing the whole library folder is like a no-go when you have a project which takes 12+ hours to import lol

dull copper
#

people new to this stuff will not know this either

trail burrow
#

that's not a solution

dull copper
#

yeah, this is why Unity should do it for us selectively

#

clear things that got removed from manifest and only then get things in that are added

#

I think they kinda try to just replace some things but don't cache things they already found which would cause some random glitches after the upgrade

#

@trail burrow clearing only code and package related files wouldn't take long tho

#

and these are all separated there

#

I wonder if the new asset database system handles these things more gracefully

#

it's enabled by default for new projects on 2019.3 now I think

velvet sorrel
#

Re-import of project takes 3 days here ๐Ÿ™‚

dull copper
#

but somehow I feel that the issue is mainly in the script assemblies

#

with SRPs there can be some issues with cached shaders too I guess

solar ridge
#

Be free rage and anger! An update has summoned thee and it is inevitable! Mean while... I am getting McDonald's whilst I await forum answers soarynSip

trail burrow
#

@solar ridge I'm not angry... lol

solar ridge
#

Im not saying you are! ๐Ÿ˜„

#

But I can guarantee you there are people who are

trail burrow
#

I'm just tired of installing updates, getting errors and having to dig through the forums to figure out how to make it work.

solar ridge
#

Whilst that I understand 100%

trail burrow
#

It's getting a bit long in the tooth, while yes it's in 'preview' for now

solar ridge
#

It is a mixture of a lot of things

autumn sleet
trail burrow
#

It's supposed to be stable at 2020.1 right?

solar ridge
#

1: Beta of the editor, 2: preview of the package (of a preview almost) 3: they likely were still feeling rushed as it went Waaaaay past their intended drop date

velvet sorrel
#

Nobody wants to preview anything, if you can't even make it run a little bit, nobody wants to give feedback to unity if feedback is always ignored.

trail burrow
#

Having it drop on a friday evening (copenhagen time at least), it feels like someone pressed the release button by mistake lol

tawdry tree
#
  • as Topher said, the package manager itself might be a source of issues
trail burrow
#

You never release on friday evening lol ๐Ÿ˜„

solar ridge
#

I was surprised to see it today infact

tawdry tree
#

Releasing on friday evening is either crazy, or you have a 7 day work week

solar ridge
#

(I went to sleep early so didnt see it until this morning) but yes. It is indeed odd

#

Also @dull copper I didnt see your ping before now. Feel free to DM. May not be able to help though ๐Ÿ™‚ as I need foooooood

autumn sleet
#

@digital scarab what may we use instead of removed PlayerLoopManager.RegisterDomainUnload?

#

I meant, it is removed in 0.2

#

Sorry I mixed up these two, PlayerLoopManager has been removed so we cannot use it anymore.

#

Any alternatives to receive a callback in proper order of shutdown?

#

Thank you. It was very handy to subscribe on it and call something before or after shutdown (example: free resources or dispatch IO events)

#

Okay, thank you, yes I followed that it uses GO internally. I will try to replicate the behavior.

onyx mist
#

am i using something wrong?

#

ive done a few checks and mother is definitely null

mystic mountain
#

You're not showing all your code...

onyx mist
#

i figured that was all that was necessary

#

what more do you think you need to help?

mystic mountain
#

So how do you know you get nothing?

onyx mist
#

commandBuffer.AddComponent(i, mother, new dfdf { });

#

i did tests such as this

#

checked the mother entity and they had no such component

#

DynamicBuffer <Relationship> motherRel = relBuffer[mother];

#

doing this (which is the main reason i need the mother) gives me a null reference exception

mystic mountain
#

Well, for starters have you checked your Job is running?

onyx mist
#

yup

#

100% running

mystic mountain
#

And if you printout the entity from the job?

#

Your CB is properly created and handle added?

onyx mist
#

oh nevermind my silly brain forgot the commandbuffer doesnt immediately do things

#

so yeah the mother is definitely not null

#

DynamicBuffer <Relationship> motherRel = relBuffer[mother];

#

the issue is this line then

#

oh i didnt set the buffer from entity...

#

i was refactoring my code and forgot to put it back in

#

silly me

#

thanks for your time jaws i appreciate it

hollow sorrel
#

useful for systems with few entities

flat talon
#

What renderer is everyone using with ECS and Hybrid? I thought HDRP was the recommended one, but Im having massive issues with it now and everything is very slow (starting/stopping play takes ages)

solar ridge
#

Make sure to turn on the fast playmode

#

under Editor in the project settings

#

alllll the way at the bottom

flat talon
#

yeah I did, didnt matter

#

new project in beta 11/12, upgrade packages to 0.2, add HDRP 7.1.5, new scene.. add cube = glow of doom. And even with an empty system the start play is like 5-6 seconds.

Playing around with the old default renderer now, muuuch faster there

solar ridge
#

Intersting

#

I have the HDRP loaded up and getting nothing like that, but I don't doubt it is happening ๐Ÿ˜ฆ

flat talon
#

new project or existing one you upgraded? Can you try for me "new scene" and add an empty cube? (via the menus)

solar ridge
#

Completely new

#

Restarting my editor real quick

flat talon
#

thanks

#

and you using the latest 7.1.5 HDRP?

solar ridge
#

Im using whatever the beta ships with

#

the last time I tried loading HDRP from packagemanager (a month or 2 ago) everything died

#

7.1.1

#

updating

#

as nothing in the new scene is causing anything awry

flat talon
#

oh you using 7.1.1? interesting point! previous I had to update to 7.1.3 (which was broken) and then 7.1.5

#

maybe 7.1.1 works with 0.2 entities

solar ridge
#

Nope

#

Still loads fast

#

Now. FPS is interesting when moving the camera

#

No idea what is going on there

#

Scene

trail burrow
#

@solar ridge At least the bloom is gorgeous ๐Ÿ˜„

solar ridge
#

It looks MUCH better than it used to

trail burrow
#

yeah

solar ridge
#

their default processing was Baaaad before

trail burrow
#

bad doesn't even begin to describe it lol

dull copper
#

start and stop is the burst compilation

solar ridge
#

where exposure was 10x more sensitive

dull copper
#

oh this wasn't scrolled down

trail burrow
#

๐Ÿ˜„

#

hate when that happens

dull copper
#

only like one hundred and second time

#

it's such a poor UX

#

it should warn you are not scrolled down if you start typing in the past view :p

#

I tried to get them to fix this few years ago but they didn't care as they think it's fine this way

solar ridge
#

... why is the editor loop ~60ms per frame???

flat talon
#

haha you getting the same glowie cubes as I then

#

I'll stick with 7.1.1 since that seems to work with beta 12 now

solar ridge
#

Well both are showing this error

#

The start / stop time is the same

flat talon
#

hm

solar ridge
#

However, the profiler indicates ~200Fps

#

the camera shows otherwise

flat talon
solar ridge
#

Yes. That is normal

flat talon
#

only appears when I select the cube though. Never seen that before

solar ridge
#

That is where it is in the light probe group

#

Which probes to pull light samples from

flat talon
#

new scene -> add cube = bloom of doom

solar ridge
#

I made the bloom my self

#

I thought you wanted a cube with bloom

flat talon
#

no

solar ridge
flat talon
#

anyways, not really related to DOTS.. hdrp just seems broken for me somehow ๐Ÿ™‚

solar ridge
#

OH! yes. because you dont have any of the volumes limiting

#

Hence the default scene

flat talon
#

./facepalm.. Guess I have a lot to learn about the new SRPs ๐Ÿ™‚ I was worried this was the hybrid renderer breaking somehow

solar ridge
#

Nope

flat talon
#

cheers!

solar ridge
#

So on the default scene

#

turn off the post Process volume for a trip ๐Ÿ˜‰

#

It is specifically the exposure helping here

#

this gives you the light in / out of a cave effect

flat talon
#

yeah Im used to auto exposure in UE4

solar ridge
#

That is a setting ๐Ÿ™‚

flat talon
#

has anyone gotten the per-instance material params working? I know they're not in the release notes, but for example:

[MaterialProperty("_Color", MaterialPropertyFormat.Float4)]
public struct MaterialColor : IComponentData
{
    public float4 Value;
}```
hollow sorrel
#

are those new?

flat talon
#

yes

hollow sorrel
#

does it use materialpropertyblocks?

#

pretty neat if it already works

flat talon
#

thats what I thought. Somewhere on the forums a long time ago it was mentioned the next release should support this

hollow sorrel
#

wonder why they wouldn't put that in the notes since it's a pretty big thing

flat talon
#

Ive tried both normal and hdrp and cant get them to work so far.. I just get a gray color when setting any value

#

maybe its not finished

hollow sorrel
#

ah

flat talon
#

I'll make a forums post, see if they respond ๐Ÿ™‚

#

ah wait, found yet another checkbox

#

ooh got it working โค๏ธ

dull copper
#

that new entity inspector thing didn't land yet?

#

looking at the updated ecs samples, what is joe converter? ๐Ÿ˜„

#
[RequiresEntityConversion]
[AddComponentMenu("DOTS Samples/IJobChunk/Rotation Speed")]
[ConverterVersion("joe", 1)]
public class RotationSpeedAuthoring_IJobChunk : MonoBehaviour, IConvertGameObjectToEntity```
trail burrow
#

lol

flat talon
#

@dull copper the ConvertVersion attribute is because of the V2 asset database subscene saving. I believe once it detects a new version it will refresh the saved subscenes. Im not sure what the name param is for

vagrant surge
#

@flat talon very big news

#

veeeery big

flat talon
#

๐Ÿ˜„

vagrant surge
#

that will allow some very serious shanenigans

flat talon
#

aye! its marked as experimental, so not sure yet how efficient this is

#

I've only done a few meshes so far

hollow sorrel
#

in previous versions you had to manually convert a subscene and the entities/components made through the authoring monobehaviours then get serialized

but if you then change your authoring component like if you wanted to add an extra component in your converter, it wouldn't automatically rebuild your subscene, so it'd still have the old serialized components until you manually hit rebuild

i'm guessing the converterversion is a way to tell unity "oi m8 this subscene changed so it needs to be rebuilt" if the version changed, and the username is prob a way to prevent conflicts. if 2 ppl both make a commit where version is changed to 3, git will think it's fine but they'll both only have their own subscene changes

#

but still i feel like there has to be a better solution

#

instead of manually changing the version attribute (and with a name on top of that)

flat talon
#

ah yeah, that makes sense from the conflict pov

hollow sorrel
#

that said the only other way i can think of is by checking if an authoring type has been modified after recompile, which would involve a lot of magic and more assembly checking

#

recompile time is already long enough

safe lintel
#

@solar ridge the editor Ms thing might be the xr (inputs?) package, either removing or updating it should fix the editor gc issue(I only tried removing it which did fix it for me)

solar ridge
#

I have found it is something related to the fast playmode

#

if I build or turn off the playmode settings then it fixes it

#

WHich is weeeeiiird

flat talon
#

did you try keeping the fast mode on but enabling for example the domain reloading? in that case, it could be something like a static field

solar ridge
#

Not having much luck spawning an entity that changes its color @flat talon

#

Interestingly the material I created the values won't change from full white in the editor nor will they change via the component :\

#

Can't seemingly change input color at all

#

Well. Scratch part of that. It works now, but still odd I can't change the instancedMaterial at all as a default

flat talon
#

Yeah I noticed that too, something broken with the thumbnail preview perhaps?

solar ridge
#

Also performance dies after a bit

#

14k material colored entities was roughly my cap before it was not ideal for a player

safe lintel
#

anyone having issues with physics in the new update?

solar ridge
#

Didnt think Physics had updated to use the latest yet

safe lintel
#

i mean just using the old package with the new entities release

solar ridge
#

yeah that wont work really... ๐Ÿ˜›

#

A LOT of systems changed

#

I think you will need to wait for the FPS sample to really get it. (I THINK)

safe lintel
#

bleh kind of forgot stuff might need to be changed there too

hollow sorrel
#

what kind of issues?

safe lintel
#

from what i can tell, everything works except for manually overriding velocity

hollow sorrel
#

i don't think 0.2 really introduces any stuff that 'need changing' other than if you were abusing World.Active and were using bootstrap interface

#

so physics should be fine

dull copper
#

I'm currently upgrading DOTS samples repos physics samples to latest hybrid, burst and entities

hollow sorrel
#

i'm also manually overriding velocity

safe lintel
#

is it working for you?

hollow sorrel
#

well i'm also using only kinematic physicsbodies but yea that is working

#

dunno about dynamic

#

is it just not changing velocity for you?

safe lintel
#

no, really strange

#

tried it on both kinematic and dynamic and no effect

dull copper
#

I'm getting burst errors

hollow sorrel
#

maybe your system order changed compared to before update
is your system using [UpdateBefore(typeof(BuildPhysicsWorld))]?

#

i always mix up when it's supposed to update tbh there's so many different physics systems to keep track of

#

but before buildphysicsworld works for me

safe lintel
#

ah that does appear to fix it

hollow sorrel
#

even samples don't seem to be unanimous in this

#

i've seen a system that does before buildphysicsworld, before physicsstep, and the kinematic charactercontroller does [UpdateAfter(typeof(ExportPhysicsWorld)), UpdateBefore(typeof(EndFramePhysicsSystem))]

#

kinda confusing

safe lintel
#

thanks @hollow sorrel

dull copper
#

ok, upgraded lwrp to latest (I totally forgot to do this) and regenerated library

#

the few use case demos I tried from physics samples work as is with the latest entities and hybrid

safe lintel
#

odd, i was using UpdateAfter* BuildPhysicsWorld for another system prior to the update and velocity was being changed
*typo

hollow sorrel
#

yea not sure what the cause is

safe lintel
#

ooo burst appears to be working with commandbuffers

safe lintel
#

i also really appreciate being able to select entities and traverse a hierarchy or go to other referenced entities in the debugger, that is huge

solar ridge
#

Yeeep the command buffer change is nice

stiff skiff
#

Has anyone been able to run a build out player with burst AOT disabled?

safe lintel
#

lots of stuff that didnt make the changelog, i already have the urge to switch every use of inject to the new companion gameobject system even though its marked as experimental and not recommended apparently

stiff skiff
#

I'm trying to figure out if its just me

safe lintel
#

just tested briefly, project built but got console errors, tbh dont recall disabling burst compilation in a build previously so not sure if thats new or what happened before for my own project

hollow sorrel
#

what's the new companion gameobject system?

safe lintel
#

it keeps the gameobject around and the component you specify, i quickly used it for my camera setup so I can use ConvertAndDestroy while also having the camera persist with its associated gameobject(i think?)

hollow sorrel
#

ah i see

#

i wonder what the benefit of hiding it in the hierarchy is

safe lintel
#

it does say: Hybrid Components are an experimental feature, their use isn't recommended yet. but that kinda feels applicable to the entire spectrum

hollow sorrel
#

seems to be kinda the same as adding a copytransform or whatever it was called + a seperate statecomponent for destroying it when the entity gets destroyed tho

onyx mist
#

should i worry about making native(x)s too big?

safe lintel
#

simplifies the workflow for me at least, dont have to create some mumbo jumbo system to attach the camera via another gameobject that has to hook together to a pure ecs entity, it just gets kept on conversion and lives and dies with that same pure ecs entity

deft niche
#

Thats actually cool

coarse turtle
#

hmm looks like a good idea with sprite renderer ๐Ÿค”

hollow sorrel
#

i mean for that wouldn't you just have to add a convert&inject mono + copytransform component + a link statecomponent with a system that's like 5 actual lines to destroy the gameobject when the entity gets destroyed

#

so workflow is like add 2 monobehaviours once you get it setup

#

and you're still able to see it in hierarchy/modify it in editor in that case unlike the hybridcomponent thing

solar ridge
#

Not even doing colors ๐Ÿ˜ฆ

#

73k entities

hollow sorrel
#

12ms for 73k sounds a lot better than doing it the old way at least ๐Ÿ˜„

solar ridge
#

Right... but with old ECS I had 200k at ~120fps

safe lintel
#

Well for me, also another system to find the camera thats unparented, some components to add as a tag to ensure it doesnt get double attached, possibly a linked entity group to ensure its deleted along with the other entities if they ever get destroyed, also the prefab camera gameobject has to be split from the other player prefabs and then with the current ConvertAndInject bug of destroying root gameobjects...
just switching over to a system that does: AddHybridComponent(camera); is way simpler

hollow sorrel
#

you could add the monobehaviours to the entity already so you could still run your ForEach(Camera camera) query like normal

trail burrow
#

@hollow sorrel @solar ridge loosing performance as you add features is pretty expected

solar ridge
#

I expected it... but 200k to 17k seems fairly drastic

amber flicker
#

@solar ridge this in a build?

solar ridge
#

This is not in build no. Neither was the 200k

trail burrow
#

@solar ridge 17k or 72k?

#

you said 72k above

solar ridge
#

17k is the last 60fps marker

amber flicker
#

worth checking against a build to see if it's safety check related (speaking of which, you disabled safety checks right?)

solar ridge
#

72k is slowly leaving 30fps

hollow sorrel
#

materialpropertyblocks aren't free but there's prob still room for optimization there
it wasn't even part of release notes so i wouldn't worry about it so soon

solar ridge
#

This is without using that

#

Let me double check something

hollow sorrel
#

oh i thought you were changing colors

solar ridge
#

I tried that

#

That was 8k 60fps or so with 4 color variants

#

No material component results in the above

hollow sorrel
#

so the same code as before but now it runs worse?

gusty comet
#

So, uh
I'm wondering wheather I should switch to dots
What are the pros and cons of using it?
Is it hard to switch from the "old" system to dots?

solar ridge
#

The code itself on our side is no different. the new C# Renderer (RenderMeshSystemV2) is taking far longer than it was

amber flicker
#

@gusty comet at this point it's less 'switch' and more like 'augment' - dots can help cpu stuff run faster if you need it to but isn't yet a replacement way for doing everything

safe lintel
#

if you meant something like 'dstManager.AddComponentObject(entity, GetComponent<Camera>());' it wont survive the Convert&Destroy option

hollow sorrel
#

ahh yea that's worth making a bugreport for if it's a regression like that

gusty comet
#

@amber flicker
So I could use it for some things but do other things in the old system?

solar ridge
#

You can mix and match pretty well

#

but you have to be aware of what you are trying to mix

#

Not everything has to be an entity and vice versa

rare skiff
#

Is the hybrid renderer not compatible with latest dots packages?

gusty comet
#

Well, let's say I would like to spawn multiple object at the same time from time to time
Are dots better in that?

rare skiff
#

I get a bunch of errors after importing on 2019.3b

solar ridge
#

The hybrid renderer is actually made with the latest dots

#

Gotta reimport/restart the editor

hollow sorrel
#

@safe lintel no i meant convert&inject + the addcomponentobject
i'm just ignoring the convert&inject issue since that's clearly a bug but if we include that then i'd agree the workflow is pretty ass

solar ridge
#

usually fixes the issue

rare skiff
#

Ok let me try that

#

What are the various dots platform packages

#

Thats new to me

#

is DOTS Platforms just, all of them?

solar ridge
#

You needn't worry about those for now

#

That I believe will be the way they support builds of other systems later

rare skiff
#

ok

safe lintel
#

well i like not having to create extra code to handle the gameobject's life as well as linking to the entity its supposed to be attached to, and it simplifies the prefab usage in my case

#

i guess its minor in the end, but those extra steps it takes out was just really refreshing to have simplified given how much of it is usually adding extra stuff to replicate simple things from before

rare skiff
#

I know 2019.3 is beta, but how stable has it been for you guys

amber flicker
#

@gusty comet yes, it can be good at spawning - entities + IComponentData's have much lower overhead than gameobjects + monobehaviours... however, almost no traditional monobehaviour components are fully supported yet

hollow sorrel
#

that's fair
i do think it should be included
i'm just wondering what the difference is if you already did write a lifetime system for when it wasn't built in

#

btw any way to like force the csproj generation? i turned it on but it never did anything

#

this was asked a while ago too i think but i forget if it was answered

solar ridge
#

What I find the most interesting thus far: If the cubes are off the screen, they don't get rendered so the render loop skips them, but the presentation group still takes ~20 ms

#

If I purely just create an entity (no components tagged) then I can go WELL past 4million

flat talon
#

@safe lintel just be careful to not use too much of the hybrid component workflow, apparently it's very slow.

prisma anchor
#

Is it possible to add constraints to position/rotation?

placid thicket
#

after updating to the latest preview packages, is anyone else getting this error? it persists even after rebuilding my Library

safe lintel
#

@flat talon thanks, theres always a catch ๐Ÿ˜„

placid thicket
#
 Object reference not set to an instance of an object 
  at Unity.Entities.CodeGen.TypeDefinitionExtensions.IsComponentSystem (Mono.Cecil.TypeDefinition arg) [0x00000] in D:\Projects\GAME\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities.CodeGen\CecilExtensionMethods.cs:142 
tawdry tree
#

Have you made sure to restart the editor? And what packages do you have?

placid thicket
#

yup, restarted the editor (both before and after removing Library) - there's a number of packages installed... primarily supporting DOTS (Burst, Hybrid Render, Entities, etc)

tawdry tree
#

I've seen that the various rendering packages (primarily SRP, I believe) can cause weirdness, but... That error seems very ECS specific. This was a project upgrade right? Could be some existing code that's incompatible with the new package, does a fresh project with those same packages work for you?

placid thicket
#

correct, this is a project upgrade - lemme give it a go in a fresh project

tawdry tree
#

If a fresh project works, I'd go around each of your ECS-related files and fix any and all compiler errors (and possibly warnings), but also one by one comment them out, until it worked or I nothing left. Then work back from there towards everything working

safe lintel
#

i had to make a new project, import the main packages and then copy paste the manifest back to my main project to get it to work, though I didnt specifically encounter your error

placid thicket
#

Thanks for the insight guys, I had commented out my ECS code to get a starting point and still encountered the issue... so I'll keep poking around

#

may just downgrade and wait a week

safe lintel
#

well i think my dreams of hassle free companion objects just came crashing down, trying to use it in a prefab situation falls apart due to hdrp's [RequireComponent] on the camera.

autumn sleet
#

Anybody got EntityCommandBuffer working with new entities update? Specifically in IJobChunk, ECB does not play back my commands.

#

I think I solved my problem, it is related to custom world bootstrap and default BufferSystem that was not initialized.

civic bay
#

Is it possible to set the Collision Filter at runtime?

rare skiff
#

One concept I can't figure out is how systems are added to runtime. What constructs a new system?

dry dune
#

There is an automatic default world bootstrap, it iterates on all systems in the project and adds them to the world, however you can disable it and initialize your world manually

rare skiff
#

Ok so by default it finds all systems in the project and adds all of them, interesting

#

How would I specify my own custom bootstrap

dry dune
#

you can prevent automatic system adding
on project level by defining UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP constant in player setting
on per system level by adding [DisableAutoCreation] attribute

#

check what is inside DefaultWorldInitialization.cs

rare skiff
#

I'm taking a look at that now

#

What is calling DefaultWorldInitialization

dry dune
rare skiff
#

ty

#

Is this currently the best resource for learning Unity ECS?

#

I'm coming from heavy Entitas usage.

dry dune
#
  • see pinned posts here
rare skiff
#

So, in this sample there are several systems which handle rotating cubes

#

How can that work if all systems are doing the same thing in a different way at the same time

#

Because the default bootstrapper loads all systems in the project in

#

I guess in each example, the components on the cube are different?

#

It's just weird to me that all systems in the project are loaded in

#

Even if they aren't being used for the current example scene being used.

dry dune
#

What is calling DefaultWorldInitialization
[RuntimeInitializeOnLoadMethod( RuntimeInitializeLoadType.BeforeSceneLoad )] attribute on static method

#

if system has nothing to iterate on world not going to run it

rare skiff
#

Surely it's still existing in memory though right?

#

I can see a bunch of unused systems just sitting

#

Looks like AutomaticWorldBootstrap.cs called the DefaultWorldInitialization

dry dune
#

it is ok to have a ton of not-running systems

rare skiff
#

This concept of scripts being loaded in that aren't in the scene is weird

dry dune
#

nothing prevents you from initializing your world manually, automatic bootstrapper can't understand what in you project is related to which scene

autumn sleet
#

What would be the correct way to initialize two separate words Client, Server with individual transform systems and renders? Entities 2.0 broke the workflow I had before.

rare skiff
#

Is every single system in Unity ECS called every frame?

tawdry tree
#

Every system that is properly added to a system group in a world, that is run, yes

#

Which means that by default, yes, every system that is not disabled automatically (not entities to work on) or by you will run every frame

magic frigate
#

Assuming it isn't culled due to not finding anything that fits its query to run on?

tawdry tree
#

You can override the behavior, though, either at system level or build the entire world-system group-system graph yourself

rare skiff
#

Ok interesting

#

Trying to understand this syntax in the lambda expression

#

Entities.WithName("RotationSpeedSystem_ForEach")

#

Why in WithName is it the name of the system as a string?

tawdry tree
#

Uhh, where is this from?

rare skiff
#

The Unity system example

magic frigate
#

Probably the new example foreach

rare skiff
#

Yes'

tawdry tree
#

Because that's a magic string, which seems... brittle

rare skiff
#

I don't understand why a string is used here

tawdry tree
#

Probably magic

rare skiff
#

And why is the string the name of the system

#

But it says Entities.WithName

#

Why would an entity have a name of the system

tawdry tree
#

I assume that's either a more advanced example (where they need magic to do magic), or not something we're supposed to take as an example

#

Check the source for the documentation for the string argument

rare skiff
#

It's an example project and it is the most simple example

#

Here's the class

tawdry tree
#

Again, check the documentation for that argument/method overload, either in source or some documentation, if it is updated

#

But that seems to me like maybe it registers an index or something for potential future use?

rare skiff
#

It seems like might still be too early to start using Dots

tawdry tree
#

Some parts, specifically simple jobs and burst, you should be able to use no problem

magic frigate
#

That isn't just an Entity, I think it's a lambda that does some magic to turn what's inside of that into jobified code.

rare skiff
#

Where can I find more examples of ECS systems? I found some online but they are outdated now.

magic frigate
#

It's weird but it's essentially a new speedy shorthand to skip a lot of boilerplate that's involved in making regular jobs.

tawdry tree
#

ECS, however, is still very much in preview. You can do simple stuff, but for more complex stuff you got boilerplate and/or a lot of work ahead of you. The built-in stuff isn't quite there yet for (most) mechanically complex games.

rare skiff
#

Yeah thats cool. Just doing some learning for now.

#

But don't want to learn how this works then the whole syntax changes next year.

tawdry tree
#

If so, it might be a generator, and the WithName might be the name of the generated job

rare skiff
#

That would make sense

magic frigate
tawdry tree
#

The key part to focus on now isn't the syntax, it's the pattern

rare skiff
#

I'm coming from Entitas, are you familiar with that?

magic frigate
#

Some of the examples I linked may be a bit older but the overall structure will probably remain the same

tawdry tree
#

How do you make good components? What should be one? What about entities? How do you handle that in systems?

#

That example there is basically the same as what you'd previously do , but move the .ForEach() contents to the Execute of a job

#

And you can still do that

#

Which might actually be better for clarity, in some (many?) cases

#

I'm sad that example doesn't use nameof() though - it's literally in that same class, and nameof() is compile-time constant. Unless this is some mumbo-jumbo happening before that? They should be able to recognize nameof(x) either way...

magic frigate
#

I guess you could go argue your point with Joachim in the .02 thread

rare skiff
#

These sample projects are a bit of a mess

#

Giant folder with a bunch of scripts

#

Some of them are really long and probably need to be broken up into more classes. Did they do this because of some current limitation with the API?

#

This one has several classes and structs in a single .cs file..

dry dune
#

Yeah thats cool. Just doing some learning for now.
But don't want to learn how this works then the whole syntax changes next year.
i've started learning from the first day, yes syntax changed few times for some things, but you can learn core concepts

rare skiff
#

Ok, that is good to know.

tawdry tree
#

Yeah, let me reiterate: **The important part to learn isn't the syntax, it's the patterns and the way of thinking. **
That's the hard part, and if you got that down, and some basic google-fu, the syntax doesn't really matter.

dry dune
#

I'm coming from Entitas
Entitas is not that low-level, it is not about cutting edge performance only about structuring data

#

Assuming that they promised to release first stable version in January right now is a very good moment to start learning DOTS, to be prepared right at launch day ๐Ÿ™‚

rare skiff
#

Ok nice. So the final product is pretty close to what we have now then.

#

I'm prepping for that new netcode 3rd person demo

#

Has there been any news on it

dry dune
#

yes API should not change very much anymore

#

forum is the best place to monitor any announcements

#

0.2 hit yesterday and this is a BIG thing, i hope we'll get everything that was promised "with next release" very soon

rare skiff
#

Nice I will check out the changelog

rare umbra
#

Iโ€™ve asked this question in networking but didnโ€™t get much traction so asking it again here.

Iโ€™m building a game where inventory items are awarded and managed on the server and then syncโ€™d with the client. Inventory shouldnโ€™t be updating too frequently. At heaviest times every 5 seconds and on average once every 3-5 mins.

Iโ€™m looking to represent inventory items as entities with Item Components (bunch of types) and serialized them on the server. Itโ€™s important to keep the inventory in sync but itโ€™s only ever one way (read only from client). I donโ€™t need a dedicated server, Iโ€™m thinking about using a web server. What stack would you recommend and is there anything that will make syncing with the server and local data via DOTS simpler?

safe lintel
#

0.2 brought changes but the syntax is mostly the same for the core bits of it

rare skiff
#

@rare umbra What we are doing is using a web api server built on NodeJS that acts as the middleman between the client and database

#

For the database we are using documents

#

And on the Unity side we are using an Asset called BestHTTP to build a web request and send/receive data in JSON format

#

Looks like this:

#

BestHTTP Web Request => NodeJS api server => MongoDB storage

#

On the Unity side We have web request entities/systems that take care of those web requests.

#

Not sure if its the best, but its working well for our use-case.

civic bay
#

Is it possible to set 100 of the same entity but set the material colour of 0-49 to red and 50-99 to blue?

#

I can get the shared render mesh data of the entity and set the shared component data to the new colour, but this affects all entities of this type

#

And I can't set component data with Render Mesh, has to be shared component data? or am I doing it wrong lol

dry dune
#

to do that you need Entities 0.2 and HDRP

rare umbra
#

@rare skiff Sounds like what Iโ€™ve been thinking. What do you do when you pull down new json data? Do you do clear all entities / components and create from scratch? Or do you do a version check and only rebuild everything if the data version on the server is newer? OR do you somehow do a diff and only create the data locally for the new data on the server? (Last one is what I think I should be doing but have no idea how to achieve this)

civic bay
#

Ah damn, I'm on 0.1.1

#

Thanks though @dry dune

rare skiff
#

Right now we are just destroying and rebuilding the entity using the new data but in the future we will be able to just update existing because every object has a unique UUID.

#

Also we have an entity serialization/deserialization system that takes care of everything automatically

#

We have a component for each field in the JSON document

stable vigil
rare skiff
#

So we deserialize the JSON directly into an entity with each field in the JSON as a component

stable vigil
#

i think its simple but idek

rare skiff
#

And vice versa

#

@rare umbra

rare umbra
#

@rare skiff yep this is really similar to what I thought I needed to do. Glad Iโ€™m not crazy. Sounds like a fair bit of work for me given that Iโ€™ll be starting from scratch. Might start with a basic dev and node server and API call and then just iterate from there. GUIDs would definitely help me know if I need to create the entity or not but it doesnโ€™t really help me know if the entity is up to date

rare skiff
#

Your API server would have to inform the client which entities (by UUID) need to be updated and provide the new data as well

#

The API server would always know what is changing

#

@rare umbra

rare umbra
#

Yeah I need to look into RPC I think. I only have experience with request based server architecture

rare skiff
#

If you are doing a web based API server RPC won't work

#

This would be a REST API that you would access through a url endpoint with a json payload

#

RPC would be like a socket based game server

rare umbra
#

Right so I guess on the server you need to store some flag as to whether the data has been sent to the client or not?

#

As itโ€™s only sent when requested

#

Or time stamp

rare skiff
#

Ok I think I see what you are getting at

rare umbra
#

Of course, time stamp is the way to go

rare skiff
#

If data changes we don't distribute that to clients

#

Not in real time

#

It sounds like you need more of a streaming solution

#

If you want to keep clients updated

rare umbra
#

Nah doesnโ€™t have to be - it doesnโ€™t have to happen often. Iโ€™m planning to use this for an inventory system. Inventory can be a thousand items, wouldnโ€™t want to destroy / recreate entities every time a http request is returned

#

Think Iโ€™ll just track what time items are added or updated and send down only stuff that changed since the last request

rare skiff
#

makes sense to me

rare umbra
#

And do requests every 20 seconds or something

#

When logging in just pull down everything, ignoring the time stamp

#

Actually I might send everything down every time and put the burden on the client to filter out unchanged stuff for optimization. This will make my server much simpler

worldly pulsar
#

Apparently the new [GenerateAuthoringComponent] has a "one component per file" restriction ๐Ÿ˜ฆ

safe lintel
#

also kind of weird how the built in stuff doesnt have them ๐Ÿคทโ€โ™€๏ธ

worldly pulsar
#

I guess most built in components are supposed to be converted from the old-style built in components (Transform -> Translation+Rotation, Rigidbody+Collider -> all the physics stuff)

safe lintel
#

i suppose so, only noticed when I checked out the CopyTransformToGameObject etc stuff

rare skiff
#

Is Generate Entity Cache no longer a thing?

#

I believe that was a button on Sub Scene

worldly pulsar
#

I think the idea is with the new [ConverterVersion] attribute you never need to regenerate the cache by hand?

coarse turtle
#

I don't suppose there's a way to set a ChunkComponentData on conversion is there?

worldly pulsar
#

Are they discarded if you set them in GameObjectConversionSystem? Never tried tbh

coarse turtle
#

Hmm well the entities I'm converting wouldn't be discarded, but I guess I can try to do it in a conversion system - it would probably make sense to do so lol

jade siren
#

Hi everyone. Does anyone can guide me about what's the best way to update a game object using ECS ?
I'm trying to let some cinemachine cameras to track a gameobject (or entity, that would be awesome). And i really don't know how to achieve that. So any guide or keywords will be useful

#

The examples that i found used ComponentArray or Inject, so they are obsolete already

#

Well. I did the opposite. The monobehaviour reads from an entity query and updates itself

hollow jolt
#
// Serializable attribute is for editor support.
/// ReSharper disable once InconsistentNaming
[Serializable]
public struct RotationSpeed_ForEach : IComponentData
{
    public float RadiansPerSecond;
}

What is the ReSharper ?

worldly pulsar
#

It's a Visual Studio plugin

hollow jolt
#

i guess i shouldn't worry about it since I'm using VSCode

#

would that effect OmniSharp tho ?

worldly pulsar
#

no, these comments are specifically for resharper

hollow jolt
#

ok got it, cheers

worldly pulsar
#

it's like #pragma warning disable 123, but only for resharper

hollow jolt
#

oh i see, i guess it will auto scan the comments

#

// ReSharper ...

#

@worldly pulsar would you happened to know about ecs-physics-joints ?

worldly pulsar
#

nope, I've never used anything other than raycasts in dots physics

hollow jolt
#

ok, thanks

mint iron
#

pretty interesting post about the new generated jobs https://forum.unity.com/threads/performance-overhead-of-dots-systems.751823/#post-5205242

For low entity counts + many systems. This is now the most efficient way of writing that code. It uses burst for the execution, but does not schedule a job. Instead it uses the Burst delegate compiler to run the job directly on the main thread without going through the job system which at the moment has too much overhead when the code being executed is as simple as above and just process 1-2 entities.

dull copper
#

indeed

#

this is going to confuse a lot of people tho

#

but yeah, it's temporary

#

but if you think about current state of DOTS, most things are temporary

mint iron
#

what's temporary about it (with regard to what i posted) ?

dull copper
#

Lets call this a workaround for now. The end goal is to make it unnecessary to type out [AlwaysSynchronizeSystem].

mint iron
#

ahhh ok

dull copper
#

you'd need some way to imply you want it to run on main thread tho

#

so I dunno how that's a real issue

#

I wonder if it would be feasible to run some tasks synchronized on same worker thread instead of letting the job system manage that, like to still have things out of main thread

#

also, if the job system doesn't really give gains on low entity counts.. I dunno... most games will have low entity counts and many systems

mint iron
#

ahh i get it, they have to have this manual sync attribute becauise they're not using the job dependency system to complete dependencies.

dull copper
#

so the most efficient way to use DOTS would then be to just run everything on the main thread still?

#

if talking about your gameplay code now that is

#

brute force systems like physics etc can definitely make use of the jobs

worldly pulsar
#

gameplay code is usually not the bottleneck tho

hollow sorrel
#

good point

dull copper
#

that's true

#

this is why unreal can do blueprints :p

worldly pulsar
#

the big wins are for rendering/physics/AI to be jobified

mint iron
#

the fastest way is probably going to call the compiled burst function directly, which thread its on probably doesnt matter, just depends if you want it to block or go concurrently.

hollow sorrel
#

gameplay code is prob gonna be most of your game's codebase tho, right now the 'default' is using jobs but maybe it should be the other way around

dull copper
#

my main interest on dots is being able to run custom physics code along with dots physics/havok, but I don't really have that many entities I'd need that custom math for, but I do have crazy amount of iterations between physics steps for my own stuff

#

this isn't really traditional gameplay code, rather extension of physics engine

hollow sorrel
#

which thread its on does matter tho because scheduling has overhead

worldly pulsar
#

I'm writing most code in ComponentSystems, because jobs were like 10x more code for 0 performance gain. But then I have like 200 entities total

dull copper
#

but if you don't run your code through burst, you can't get determinism

hollow sorrel
#

@worldly pulsar they changed that in 0.2, now you can use same foreach syntax without adding a new job struct

worldly pulsar
#

I know