#archived-dots

1 messages ยท Page 179 of 1

mint iron
#

basically all of jobs, all the native containers, all of ecs are /unsafe

sick prism
#

hahaha

mint iron
#

but you could compile whatever this is as a separate package that is itself unsafe, and use an API from it if you need to make it safe for distribution reasons

sick prism
#

thank you for the help

#

unity for colliders uses blob data or smth

#

right?

mint iron
#

lemme check real quick

sick prism
#

i'll admit i actually am not using entities yet ๐Ÿ˜„

#

so i dont really wanna introduce it as a dependency yet

#

ill figure smth out, thank you for the help

mint iron
#

o0o0o another option would be to have a separate array for the muscles, and the HumanPoseWrapper would have a startIndex + length to its section.

sick prism
#

looking at blob assets stuff, it seems like this could actually be what i need

#

but itd require me to add entities as dependency hmmmm

mint iron
#

oh, there's also the FixedList collections you could use

#

like FixedListByte512

sick prism
#

ooh, unity.collections package?

mint iron
#
    public struct HumanPose
    {
        public float3 LocalPosition;
        public quaternion LocalRotation;
        public FixedList512<float3> Muscles;
    }
sick prism
#

that seems sexy enough

#

thanks!

mint iron
#

yeah Unity.Collections

#

np

sick prism
#

hmmm i cant seem to find it... which version of Unity is minimum for that?

#

on 2020.1.2f1

mint iron
#

im on 2020.1.0b14 with collections 0.9.0-preview6

sick prism
#

oh damn i think i know why, is package visible in package manager?

mint iron
#

it should show your version in package manager yeah

sick prism
#

weird

mint iron
#

they do it with code gen com.unity.collections@0.9.0-preview.6\Unity.Collections\FixedList.gen.cs

sick prism
#

i think they may have removed it from the package manager, recently they did that for some packages

mint iron
#

huh, yeah im a few months behind

#

oh, probably because its preview

#

i heard they put an extra opt-in in the settings or something

sick prism
#

im also bit behind, but no way to enable them

#

gotta add the package manually

#

as in type in package name

#

collections seems close enough to stable tho so ill pull that in

frosty siren
#

Is this ok that [GenerateAuthoringComponent] for IBufferElementData with Entity field doesn't show List<GameObject> in the inspector? Am i do something wrong?

fluid kiln
#

Buffer authoring doesn't work with game objects yet afaik

#

You'll have to implement your own IConvertEntityToGameObject

deft stump
#

and I believe you can't use list

fluid kiln
#

I think he has Entity entity as the field

#

And expects to see a list in the inspector

#

The same way it would with an int value for example, would display a list of int to input in the inspector

deft stump
#

I have a weird bug

mint iron
#

squish it

deft stump
#

I'm trying but it's so weird i want to dissect it

#

anyway lemme open up vs and post it on hatebin or something

shy pilot
#

I can't seem to get Camera.Main or GameObject.Find to work from OnCreate updating in in the Client Presentation system group?

#

I get nullreference on any line i try to use it in :(

#

am i missing something ๐Ÿ˜†

zenith wyvern
#

OnCreate happens before GameObjects exist. Try OnStartRunning

#

Or if that's not the behaviour you want you need to use SceneManagement to hook into when a scene is loaded

shy pilot
#

thanks :)

#

so OnCreate is like Awake and OnStartRunning is like Start?

#

yep it works :) you are a legend @zenith wyvern!

frosty siren
#

What systems i need to add to get mono-entity conversion to work? I added ConvertToEntitySystem (under InitializationSystemGroup) but it doesn't work

opaque ledge
#

everytime i see #497866432277643275 flashing, i am checking it if its the DOTS blog post that was mentioned in recent AMA ๐Ÿ˜ฆ

hollow sorrel
#

@frosty siren i think just that system should do the trick
did you set your world as default injection world?

frosty siren
#

How to do it? ๐Ÿ™‚

hollow sorrel
#

World.DefaultGameObjectInjectionWorld = myWorld;

#

(only need to do that once)

frosty siren
#

Thank you๐Ÿ™

#

Still throw this warning even if i set my custom world as default injection world ๐Ÿ˜ฆ

hollow sorrel
#

hmm that's weird

#

i don't think they have to be in order, i'm adding the converttoentity system before setting default injection world

#

i think converttoentity runs the frame after you add it tho and it needs to be set by then

safe lintel
#

@shy pilot a note: OnStartRunning is called any time your system has entities to process(and previously had none), it may be called once, it could be called hundreds of times

frosty siren
#

i don't think they have to be in order, i'm adding the converttoentity system before setting default injection world
@hollow sorrel didn't work

hollow sorrel
#

sounds like wherever you're setting it isn't running then or isn't running in time

#

converttoentity just checks if injection world != null and only throws that warning if it is

#

might need to set it in Awake and force script execution order to be first on wherever you set it

#

since i think conversion might be running in Awake

zenith wyvern
#

Whoa they actually mentioned dots in a blog post

#

What a world

safe lintel
#

the phrase pops up on the blog in many articles, but mostly in passing ๐Ÿ˜

gilded glacier
#

has anyone used assembly definitions in their ecs project ?

fluid kiln
#

Is it considered bad practice to have systems with no behaviour in OnUpdate?

zinc plinth
#

I mean you might very well want to use a state that you can share with more liberty than a singleton entity

#

Just be careful to keep a ref to that system everywhere you use it to not re fetch it everytime

fluid kiln
#

How would I go about managing these refs since they can't be static (multi-worlds)

#

Maybe a dictionary singleton with world-system lookup

swift heron
#

I've found myself in that situation too. My spawn system doesn't use OnUpdate, just has methods to call the entity manager

safe lintel
#

where are you putting your logic?

viral sonnet
#

hm, we can't use NativeHashMap<Entity, NativeHashMap<int, int>> ... how would I work around it?

coarse turtle
#

2 native hash maps?

NativeHashMap<Entity, int> map1;

// This could also be an array you map by index instead too
// So NativeArray<int> and you access by the key from map1
NativeHashMap<int, int> map2;

var intKey = map1[some_entity];
var intValue = map2[intKey];
viral sonnet
#

thanks, i'll try that

#

i get what you mean, your example is 1:1 though, so it's not a solution for my data. i'll try a nativemultihashmap. let's see if i can get rid of my buffer iteration that way...

coarse turtle
#

ah yeah - if it's not a 1:1 mapping then multivalued hashmaps will be a better soln

viral sonnet
#

hm, i can't get this to work. basically i want to build a lookup for enum/int effectTypes on an entity and get values from this effect. important part is that I only have 2 lookups, 1 for the entity, 1 for the effectType. NativeList also can't hold a hashmap so maybe I need to build a proper hash for entity+effectType

fluid kiln
#

I have a weird bug with NetCode 0.4.0 when sending an RPC from the client to the server, the server creates anywhere between 1-3 RPCs seemingly at random

remote frigate
#

I'm attempting to get a build working for my dots project. Do i need to use the Unity.Build setup to build Dots projects?

#

My build immediately crashes upon startup.

safe lintel
#

afaik its only subscenes that have a hard requirement for using the new build/platform packages but id assume it will be the preferred way sooner or later

crystal zephyr
#

Hey guys,
I have a question about delayed created systems. I still have the defaultWorldCreation active but my system has the attribute DisableAutoCreation.
But later in the game I doing that:

var initializationSystemGroup = world.GetExistingSystem<InitializationSystemGroup>();
initializationSystemGroup.AddSystemToUpdateList(world.CreateSystem<MySystem>());
initializationSystemGroup.SortSystems();
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(world);

But in the end the system does not appear and does not get updated.

#

Do I miss something? Is it not possible to delay the system creation?

amber flicker
#

I think that looks right - I use the same thing but with the SimulationSystemGroup and I think that last ScriptBehaviourUpdateOrder call isn't necessary. Are you certain the requirements for the system are being met? I wonder if it's worth also adding an [AlwaysUpdateSystem] for testing.

crystal zephyr
#

I just tried it again and now it appeared. Thanks to confirm that I doing it correct. I will check again it might be that the enityDebugger just not updated correctly

amber flicker
#

Cool - yea occasionally you have to mouse over to force I redraw I find

crystal zephyr
#

It is even worse. Giving the debugger focus is not enough. I had to select another world and back to default world then it showed up. ๐Ÿง

amber flicker
#

ah ok - good to know

hasty condor
#

When using dots, does everything need to be coded in the dot framwork or can I for example have a background element use monobehaviour.

agile dome
#

@hasty condor You can do it hybrid. Unity Tiny would be in pure DOTS.

stone osprey
#

So following problem : My UI is still based on GameObjects and UGUI ( Or whatever its name is )... the data of the ui is mostly stored in entities because i receive them straigth from my server. So e.g. theres a "PopUp"-Entity that has a "Localization" component attached which stores a Dic/Map of strings and shorts... the string represents the useage and the short points to a localization in my database -> "title", 1. The main question here is... whats the proper way of make the UI use an entity for representating its data ? Do we simply attach the entity to the UI and let gameobjects acess the components to receive the data ? Do we write a system that iterates over all ui objects and their entity to manually write the data into the gameobject every frame ? How would you solve this ?

crystal zephyr
#

That's not an easy questions. Fact is you have to sync the data between entities and your game objects somewhere. How often these data changes? Do you have to always sync (slow) or can you do it on specific points?

Maybe you could convert your ui elements as well to entites but with ConvertAndInject to keep the gameobject. I could imagine to having some dataReceiverComponent on these elements and then you need a sync system which whenever new data arrives is setting the data on the gameobject. This system would be a system which deals with managed objects then.

#

I think the main point is to know when to update instead of doing it every frame. As far as I know a system which iterates over managed objects is kind of slow. Maybe somebody else could say something to that, because I am not 100% sure for the latest versions.

#

Kind of an event system which can be triggered from ECS and be listen from Mono.

stone osprey
#

@crystal zephyr Thanks ! Well actually i only need to change the data once : when the entity was created. I connected the go with the entity using ObjectComponents ^^ but the idea with the inserter is great, a mono component on the entity that is used as some interface to inject data.

crystal zephyr
#

Yeah, I thought you may want to avoid the direct connection of your data to a specific ui elements. I imagined you could have more than one ui element interested in the same data.

#

But I have to say I never tried it. I often have ideas but not time to try it out ๐Ÿ˜„

crystal zephyr
#

Hey guys, does somebody know. In the older versions you got a huge peek whenever you loaded a prefab on run-time which had a convert to entity component, because this was causing the whole conversion world to created.
Is this still the case or is that now more elegant solved?

#

Besides use of subscenes. I wonder how to tackle the use case of loading something on demand which should be an entity.

gusty comet
#

ok I am stepping back in to see whats changed but I for the life of me cant find the entities package anymore in 2020.2?

#

I am mightily confused.

#

Nevermind found it

crystal zephyr
#

They removed it from the packages, because unity only want to have easy available which are production ready. YOu have to add the package manualy to your packages.json

gusty comet
#

okay this is odd now

deft stump
gusty comet
#

I will give this a look

#

Yep I am back up and running, much appreciated.

amber flicker
#

@crystal zephyr runtime conversion still slow and generally not recommended. Hope better workflows will come but at the moment putting prefabs in a subscene is best afaik

coarse turtle
#

not the best idea, what if you serialize a world with entities to a file and load it in on runtime and copy the entities over to the main world ๐Ÿค” (I've never tried but it popped up in my head)

amber flicker
#

@coarse turtle isn't that basically what a subscene is/does?

coarse turtle
#

yeah pretty much hahaha

stone osprey
#

Any idea how i may receive the real "Type" out of a "ComponentType" ?

#

Im still struggling with the following : Get all components of a certain entity, print their names and their types

#

Found it : type.GetManagedType()

tiny solar
#

Does anyone have any examples of how they're organizing their Entity structure outside of code?

frosty siren
#

Do you guys use generic components (for example for timers)? And if answer is yes, tell me please how you create all generic systems for all your generic types variations?

hasty condor
#

Does ECS work well with scriptableobjects?

pliant pike
#

they work fine I just convert them to blobassets

safe lintel
#

its compatible in the sense you can access them like regular non dots stuff

hasty condor
#

how do I reference specific entities in runtime?

zenith wyvern
#

With Entity Queries

#

Or just an Entity reference on a system or other Entity

hasty condor
#

Can you use navmeshagents or is there a specific way to do pathfinding in dots?
Also if you can do both which would be better for like thousands of units moving at a time

crystal zephyr
#

You could go hybrid and have a system which access the managed component NavMeshAgent. But be aware these are only exists on a gameobject so you need to ConvertAndInject or doing any other thing to identiy the correct gameobject with the navmeshAgent.

#

Currently there is no native support for navigation in dots. There was somebody how implmeneted its own navAgent with NavMeshQuery. This can be done in pure ecs.

#

Btw: I have a general question how you all writing your systems. There is not the rare case that you need more than one Entities.ForEach query for a certain logic. Just imagine you have to handle the 3 different cases of something is new, got updated or removed.
Do you write for all things a new system or do you right a system with several Entites.Foreach inside?

amber flicker
#

Generally I'm not too worried about writing 3x ForEach if the body of the lambda is small. For anything more than 2-3 or for when the code in the lambda is more significant I will sometimes either 1) turn the body of the code into a static method or 2) use e.g. switch ( HasComponent<OptionalComponent>(entity))... . For when performance is really important I'll use an IJobChunk instead.

crystal zephyr
#

Isn't hasComponent super slow? I guess that's why you mentioned IJobChunk, because you could make a hasComponent one chunk bases.

amber flicker
#

it's not that slow but yes, I try to avoid any random access in the fast path when possible - it's the main place where IJobChunk still has an advantage. I would hope they will eventually add either support for optional components to the lambdas or introduce a Chunk.ForEach API that they've previously mentioned. In the meantime though I'm happy with using HasComponent for the majority of cases that don't have e.g. thousands of entities being iterated over.

#

the nice thing about dod/ecs that's a bit hard to get used to is that it's very easy to later refactor this kind of thing - say you use HasComponent for now.. a few months down the road, you profile and find it's more of a bottleneck than you'd like... easy to change/optimise. In my opinion, while devving (not optimising) I think it's preferable to go with what's quickest to write/iterate on - especially given how much more verbose IJobChunks are. That said I think at least a couple of people here prefer to write IJobChunk's pretty much all the time ๐Ÿ™‚

next lintel
#

hello today i learned subscenes are a thing and took a look into it and wanted to fiddle around with it a bit. i was able to create one and it looks good in scene view but as soon as i go into play mode, all objects become invisible. they are somewhat there since i land on the terrain but they dont show up in the scene?

amber flicker
#

currently there's only support for a very limited set of features - you will need 1) the hybrid renderer package installed, 2) URP or HDRP, 3) using the standard shader, 4) Unity 2020.1 or newer. Note afaik there isn't support currently for things like light baking, more than one directional light etc.

next lintel
#

standard shader means not even shader graph things are allowed? ๐Ÿ˜ฆ

#

or the terrain shader

amber flicker
#

definitely not terrain shader... it may be possible to create some shader graph shaders but I haven't tried sorry - just know that it's very very limited at the moment

next lintel
#

ok that is a pity but i think storing the terrain outside the subscene is not a big deal.
do entities in general allow shadergraphs?
i was watching a talk about dots and it's performance looks like a miracle and since the terrain shader is a mess in hdrp i mostly abandonded it and currently place each grass and flower one by one and i think making them entity things would improve the quality a lot?

amber flicker
#

So.. I apologise if you already know this but I just want to cover the basics. DOTS is fantastic for the CPU. It does not help with the GPU so (mostly) it won't help that much with how good things look or how many blades of grass you can have on screen (these should generally be done on the gpu / via compute shaders or other means). Subscenes do help with load time, though at the moment they come with other costs. Basically, unless you are doing some simulation on the CPU, I wouldn't be sure it will improve your performance and there are currently many shortcomings with the workflow.

next lintel
#

i actually had no idea about that. so entities reduce the spawntime / loading screen time but not increase the performance while displaying them

deft stump
#

do entities in general allow shadergraphs?
you can use shadergraphed materials.
but they're also very limited. I dunno what the limits are unfortunately as I'm no shader-guy

amber flicker
#

@next lintel If you're not too sure what DOTS offers I would strongly recommend avoiding subscenes & DOTS in general for now - I guess it will cause you a lot of problems. Just putting things inside a subscene won't help with performance. Perhaps in a couple of years that will change. When working with entities, instantiation is very fast yes. Subscenes are designed to make all the data in a format that can be directly loaded into RAM - rather than deseralized - which is part of what makes them very fast to instantiate and load.

next lintel
#

hm understandable. i really have no idea about dots but since it seems to offer a lot of multiplayer potential and so on it made me really curious. but i guess it is to early to learn and use it right now especially as an artist and not a programmer ๐Ÿ˜ฆ

amber flicker
#

I don't want to discourage you to learn about it. It's very interesting (especially from a programmers pov) and the future of Unity. But, as I don't think Unity are good at communicating about this, I just want to make it very clear that right now, it's mostly for learning, experimenting and for very keen programmers.

deft stump
#

And for madlads. don't forget the madlads that's really trying to make a full game out of it XD

next lintel
#

yeah and i think since i am not a keen programmer and have only basic knowledge about programming in general it would take way to much afford to get into.
instead i will stick to model a little world and abandon the thought about making it an actual multiplayer game.

amber flicker
#

If you haven't released a game before I would very strongly recommend making the smallest game you can think of (& definitely without multiplayer) - it will likely still take years longer than you expect ๐Ÿคฃ - but you don't need to listen to me - have fun and good luck!

next lintel
#

yeah i realized that during my bachelor. it will take ages to finish such things but that is fine.
i set it as my life goal to create my own world one day. so what a life goal would it be if i would be able to finish it within one or two years?

hollow lynx
#

any news about the new terrain dots engine ? i heard while back they working on terrain dots system or something

hasty condor
#

could anyone take a look at my code? For some reason nothing in the update will work

amber flicker
#

@hasty condor assuming you don't have any compile errors, my guess is you don't have a SpawnerComponent present. You can try adding the [AlwaysUpdateSystem] attribute above your SpawnerSystem and I guess it will run. A note - as you're using the Dependency I would write Depdency = Entities... and ScheduleParallel(Dependency).

safe lintel
#

check either the entity debugger or system list if you have the dots editor package installed to see if theres a query for the system to iterate on

stone osprey
#

Sooo... im using a UnsafeHashmap for storing some values... i wanna iterate over them at some point... currently i use map.GetKeyArray(TempJob) for receiving a key array map and later on i dispose it... the problem here is, why is it so insane slow ? Is there a faster way ?

stone osprey
#

I basically only wanna store a map or list of tuples in an component to iterate over it

hasty condor
#

Where do you download unity physics? I searched in my package amanaager and could not find it.

opaque ledge
#

some packages are hidden in package manager

#

in short : press at plus button in package manager and write "com.unity.physics"

stone osprey
#

are pairs/tuples supported by dots ?

zenith wyvern
#

Sooo... im using a UnsafeHashmap for storing some values... i wanna iterate over them at some point... currently i use map.GetKeyArray(TempJob) for receiving a key array map and later on i dispose it... the problem here is, why is it so insane slow ? Is there a faster way ?
@stone osprey

Why not use GetEnumerator?

stone osprey
#

@zenith wyvern It does not exist...

zenith wyvern
#

I'm looking at the source right now, UnsafeHashMap does have an enumerator

stone osprey
#

strange... i cant acess it

#

Yeah i just looked into it rn... theres an enumerator, atleast some structs for that... but it gets marked red once i try to acess it

#

Hmmm... or wait... probably its encapsulated

#

Hm no... mine does not contain one. The enumerator i saw was for an multiunsafehashmap

zenith wyvern
stone osprey
zenith wyvern
#

What version of Collections?

stone osprey
#

Im using an version from 3 months ago... probably thats the reason... nevertheless its kinda strange that they dont include such an important feature from the beginning

#

0.7.0

#

Any idea if its save to update to a newer version ? Last time i played around with the package manager it took days till all versions fitted perfectly

zenith wyvern
#

Well I would tell you which version I'm using but Unity is now just throwing an exception when I try to open my package manager

#

But yeah I'm sure if you update your Collections it will be there

#

I can't promise anything, I updated all my stuff to the latest versions a few days ago and everything was working. I had one upm related error from a certain package but I forget what it was

#

Oh yeah it was addressables

stone osprey
#

Thanks ๐Ÿ™‚ im gonna try it... praying to god that it works smooth this time... if i only update the collections, it should be fine... atleast i hope so

#

well... no errors after the collection upgrade... lets see if i can run this without problems

#

finally a positive experience with the package manager

#

hmmm... im now on 0.8.0 and i still dont have a enumerator

#

Theres already a version 0.9.0, but my package shows me no update

#

And the official documentation also does not show a .GetEnumerator()..

zenith wyvern
#

Well like I said I would tell you my version but I can't even open my package manager, or anything else. My entire editor UI borked up so I'm rebuilding my library cache

stone osprey
#

hmmm... then the documentation is not up to date either... im gonna restart unity

zenith wyvern
#

Appears it's in version 0.12 at least

stone osprey
#

collections-version 0.12 ?

zenith wyvern
#

Yes

#

If you're not seeing that you probably need to update your unity version

stone osprey
#

Hmmm...

#

Still using 2019.3... that could be the reason

#

But i thought the packages are used for adding such content to multiple versions

amber flicker
#

I think you're in for a rough time doing anything with DOTS if you're not on at least 2020.1

zenith wyvern
#

Unity officially moved to 2020 only a few months ago if I remember right

#

For dots I mean

#

There's a post on the forums about it

stone osprey
#

Thanks ^^ great... so im forced to upgrade my project again xD

zenith wyvern
#

The cost of playing around with alpha stuff

amber flicker
#

it's experimental.. eventually we'll have to upgrade to 2021 I'd expect

amber flicker
#

I'm just going to add that HashMap isn't the fastest structure for enumerating - I'm not sure what improvement you're hoping/expecting and how slow it really currently is.

stone osprey
#

@amber flicker I just wanna store a map<NativeString, short> into a burstable component... thats all ^^ i asked a few weeks ago and someone told me UnsafeHashMap is the way to go, because i couldnt store a Native one in there somehow

amber flicker
#

that's not necessarily wrong.. I'm just curious how fast you expect dealing with strings to be vs what you're experiencing

stone osprey
#

I dont care about the performance that much ^^ i just wanna store the data the servers sends me, thats what im using it for... Stuff like localisation ๐Ÿ™‚

amber flicker
#

ah ok - I was going off what you said earlier about the problem being it's insanely slow

#

also I haven't done any string manipulation at all but I had the impression in general it's better to use FixedString over NativeString where possible?

stone osprey
#

Yeah i just did some testing ^^ filling 400 PopUps with data every frame, thats where i saw that my own iteration over the map ( copy, dispose ) was slow as fuck.... but well, whats even the difference between them ? ๐Ÿ™‚

hasty condor
stiff skiff
#

You're using a method ColorChangeLerp which is defined on your ColorChangeSystem inside a ForEach

#

This will cause it to capture this which is the instance of ColorChangeSystem. Systems are reference types, and those are not allowed to be used in a ForEach without specifying WithoutBurst

#

You can solve this by either adding WithoutBurst or making the method ColorChangeLerp static

hasty condor
#

thanks zero

#

@stiff skiff how do i specficy without burst? do I also lose a lot of speed by doing this?

stiff skiff
#

You change Entities.ForEach.... into Entities.WithoutBurst().Foreach....

#

Speed loss depends on what the ForEach actually does

hasty condor
#

I looks for those with one component then does the colorchangelerp

stiff skiff
#

Though you can't really "loose" speed, seeing as it doesn't work right now

hasty condor
#

true

stiff skiff
#

Still, cant colorchangelerp be a static method?

stone osprey
#

Do lts versions have acess to the newer dots packages ? Like collection 0.12 ?

hasty condor
amber flicker
#

pass DeltaTime in as an argument to the lerp

stiff skiff
#

^

#

Actually looking at that

#

it still wont work as Material is a reference as well

#

I think?

hasty condor
#

so ill need an argument there as well?

stiff skiff
#

No, reference types as a while are not supported by burst

amber flicker
#

also all the lerp stuff is using old Mathematics

hasty condor
#

oh what should I use instead?

amber flicker
#

math.lerp()

#

unfortunately changing colours of materials is a painful example to start with

hasty condor
amber flicker
#

yes, it looks dumb but you'll also have to capture Time.deltaTime with a local variable outside your ForEach - i.e. float dt = Time.deltaTime;

stiff skiff
#

I think it's best if you just use WithoutBurst and make things work. Burst should be something to look into once you get performance problems

safe lintel
#

you should look up the difference between reference types(which are incompatible with burst) and value types, its pretty much the key to determining where you can use burst jobs and where you need to use .Run() on the mainthread @hasty condor

hasty condor
#

ill give it a read

safe lintel
#

and almost everything significant in unity that predates dots is reference types

stone osprey
#

cough does lts versions have acess to all package versions ? FOr example 2019.4 having the collections 0.12 ?

coarse turtle
#

no - some are locked

#

believe the beta should have the latest versions

safe lintel
#

if you just want to get or set it you just read the values right from the velocity component. but there is a PhysicsComponentExtensions class that allows you to set it with mass and other parameters

stone osprey
#

Any idea why my package manager does not find entities ?

stone osprey
#

Any idea why i get those ?

#

Everything up to date

#

What the hell is even that styling utility ? And why is it not here ? :c

#

So i now downgraded in several steps that editor... everytime other issues. How do we resolve such damn issues ?

rancid geode
#

which Editor version are you using @stone osprey ?

stone osprey
#

Unity editor : 2020.1.6f1

#

Dots editor : 0.10.0 now

#

Thats weird... now after the upgrade to 0.10.0 i get an error in the adressables... a missing method in "BuildLog"

mint iron
#

welcome to whose package is it anyway, the game where the dependencies aren't listed and the complaints don't matter.

stone osprey
#

Its awfull... now "BuildLog" is missing one... only one single method. BuildLog is from "Scriptable Render Pipeline", so i updated that one to the latest version andddd....

#

Nope

#

Still the same error, even if the documentation says that the damn method is there

#

Bring me the one developer who thought such a system is a good idea

pliant pike
#

I think I had a similar error I messed around with the Editor versions

stone osprey
#

@pliant pike Entity Editor or unity editor versions ?

pliant pike
#

Unity Editor

stone osprey
#

wait... praise the lord...

#

I got it, the damn "Adressables" need to be atleast version 1.16

crystal zephyr
#

I hate it when you have to deal for hours with the dependencies while you could do nice game things. Didn't they wanted that we use our time to create content? ๐Ÿ˜„

sand prawn
#

Is there a way to await a job and then continue with its results on the main thread?

#

Or do something like a Promise .then?

#

(without blocking the main thread ala .Complete())

safe lintel
#

so just a heads up if anyone is trying out subscenes and the runtime ui toolkit package, my subscenes arent working in builds with the ui package. just filed a bug report ๐Ÿ˜‰

#

annoying having wasted so much time tracking that one down

rancid geode
#

@sand prawn not sure if C# has anything similar built-in already, but I use UniTask for that, wher I can use await UniTask.WaitUntil(() => someJob.IsCompleted);

low tangle
#

has the dots blog post happened yet?

coarse turtle
hasty condor
#

can anyone give me a dumbed down explanation on the difference between ISharedComponent and IComponent?

zenith wyvern
#

Components are used for storing your data. Shared components are used for filtering and forcing your data into certain chunks. The docs give a pretty good explanation

deft stump
#

ISharedComponentData is IComponentData but it's values are indexed in some dictionary somewhere.
so if you have 2 IShared having the same value, it points to a single key that's pointing to 1 value.
great for stuff that doesn't change much and when you're memory conscious.
not great to change it every frame because chunk movement.

hasty condor
#

ty guys, when ever I try to use Material/Renderer or use a list I get an error saying its not primative or blittable(?), what exqctly does that mean?

#

this is as a Icomponent btw

coarse turtle
#

that means that Material/Renderer is a managed type

safe lintel
#

@low tangle nope lol

coarse turtle
#

which allows it to be garbage collected (in general you won't really be able to use reference types). Blittable data means that it can be interoperated between different languages (e.g take an int type, because it is blittable it will have the same structure in C++ - meaning C# can interact with C++ without any kind of structural changes to it)

hasty condor
#

that makes sense but why can't I use lists?

coarse turtle
#

because Lists are also managed types

hasty condor
#

or arrays

deft stump
#

because List is a class

hasty condor
#

ohh ty

deft stump
#

you can use arrays

coarse turtle
deft stump
#

not 2D arrays

#

or XD arrays

zenith wyvern
#

You can't use arrays on IComponentData

#

Only unsafe containers/pointers/etc

deft stump
#

I might be remembering wrong then :D.

hasty condor
#

why are unsafe containers unsafe?

zenith wyvern
#

Because you have to manage their memory yourself

deft stump
#

gc won't dispose that for you

hasty condor
#

is there a way to use hybrid somehow to just make a reference to a monobehaviour array when using a system?

zenith wyvern
#

If you mean storing it on a component - you can use SharedComponents

#

They can store non blittable types

low tangle
#

@safe lintel AAAAA

hasty condor
#

ty a lot guys

coarse turtle
#

otherwise managed IComponentData

#

some of the docs available might have what you're looking for @hasty condor

deft stump
#

hrmmm is there a way to make a system run once?
like how GOConversionWorld's systems run only once?

coarse turtle
#

I think you can override ShouldSystemUpdate - I think there's a virtual function like that

deft stump
#

shouldsystemupdate huh...

coarse turtle
#

ah sorry it's not a virtual function as I thought

zenith wyvern
#

I just set Enabled = false inside OnUpdate

hasty condor
dull copper
#

does anyone know what that is?

deft stump
#

never heard of it

dull copper
#

@hasty condor you need to be more specific

#

is that even related to DOTS in any way?

hasty condor
#

ye

#

its a package

deft stump
#

can you post a link or something where you got word of it?

dull copper
#

there's no such package on registry

hasty condor
dull copper
#

that's no package, it's a namespace

deft stump
#

that's a namespace.

hasty condor
#

oh

dull copper
#

yeah, it's shipped with Unity binaries already

#

if it's in UnityEngine, it's in engine itself

hasty condor
#

I tried again I made a typo

dull copper
#

this is also why you found the doc on regular engine docs and not in package docs

hasty condor
#

it works ty

stiff skiff
#

Anyone here using the DOTS physics package, and uses it's debug rendering stuff?

#

Its showing loads of ordering issues for me (things in the back render over stuff in the front). Does anyone else have this?

hollow sorrel
#

@bright raft try checking hierarchy view instead of timeline to pinpoint which system is being slow

#

ah yea debugstream is infamously slow, i dunno if it's on by default tho

#

try doing t:physicsdebugdisplayauthoring in your scene hierarchy search

#

if not you could try adding that component to a gameobject in scene yourself and disabling all the draw bools

#

need to use gameobject conversion on it too since it's authoring

#

ah actually it might not be that

#

resetdebugstreams awaits EndFramePhysicsSystem to complete and since profiler says jobhandle.complete it's prob that instead

#

EndFramePhysicsSystem being slow for whatever reason, dunno about edge cases that would cause that

#

seems you are getting in a deathloop due to fixedstepsimulation, it's running 7 times
if 1 physics step is late it's gonna run again and if that's late then prob again until i assume there's a max of 7

#

dunno why it would run slow in the first place tho

#

dunno bout that but you prob wanna fix the root of the problem

#

are you doing anything on collision events?

deft stump
#

Does enabling/disabling systems have perf cost?

#

Lets say worst case scenario. Im doing it every frame

amber flicker
#

I'd hope it would be a very small overhead - something you can test?

deft stump
#

I'd hope it would be a very small overhead - something you can test?
@amber flicker I could.
was just asking here before i do it, maybe someone knows

amber flicker
#

@bright raft to ask the obvious question - you have burst enabled and safety systems disabled?

hollow sorrel
#

@deft stump systembase.Enabled is just a boolean that it checks every update wether it should run or not, so should be pretty much free to change every frame

amber flicker
#

There are various systems that check the safety of bust and jobs but can be a bit slow - anything performance related it's worth testing in a build but you can get a pretty good editor-representation by disabling leak detection and burst safety checks. (Obviously turn them back on once you're done checking perf)

deft stump
#

Noice now I can abuse it for even slighter optimizations XD

amber flicker
#

that's disappointing

#

I didn't know terrain was even supported with dots - this is all Unity dots physics right? Did you convert the terrain to a corresponding physics body/collider (whatever they're called)?

#

wait all of this is debug stream? Isn't there an option to turn that off?

hollow sorrel
#

could you turn on the debug draw colliders in the authoring and show your terrain?

#

if you're just copying terrain mesh to collider 1:1 maybe you're ending up with a collider with a million tris or something

#

can be on an empty gameobject but you also need to add a conversion component (or whatever it was called)

#

hmm

#

maybe the debug components only shows up in scene view? not sure if it's both game and scene or not

tawdry lotus
#

is it possible to use entity query builders like systems do but from outside a system? like a monobehaviour start() or update() ?

amber flicker
#

@tawdry lotus yes if I understand what you mean - just use EntityManager.CreateEntityQuery()

tawdry lotus
#

no, I want to do a ForEach

#

is that possible? to iterate like systems do but from outside systems

#

I mean, yes, I can create a query but cant iterate it like systems do, or can I? maybe I didn't find the right API but it was there

#

I want to create a one time logic, for a playable test, want to do something over some units, but don't want to create a one time system, don't want to have 1000 system that are not used for anything in the world... maybe i have to change the approach, create a system with some annotation or something to avoid being automatically added and then in my tests add the system only in that test scene...

deft stump
#

you want to... let's say... write MonoBehaviour class and perform stuff from a query?

#

If yes, you can. through EntityManager

rancid geode
#

or trough IJobChunk, you just can't do the "Entities.ForEach...." specifically

#

you can create a dummy system to store your Entities.ForEach calls exposed through public methods and call those from your MB code, this is the hacky way

amber flicker
#

if it wasn't obvious you can also do (psuedo) var components = query.ToComponentArray() then iterate the components with a for loop - you can also do a struct job like Bruno mentioned which makes it easier to use burst. More generally, I'd try not to do this in Monobehaviours a lot - you may end up fighting DOD.

pulsar jay
#

does anybody already use unitys build configuration files?

amber flicker
#

I do/have successfully built but only on Windows and I doubt I could tell you anything useful about them ๐Ÿ˜…

pulsar jay
#

I am really confused why Unity is so quiet about this feature. It seems to enable custom build targets which some people have been waiting for since 2014

#
Unity Technologies Blog

N/A For the sake of viewer convenience, the content is shown below in the default language of this site. You may click one of the links to switch the site language to another available language.โ€œIn the Labsโ€ is a series of blog posts that put focus on features that have been p...

amber flicker
#

pretty sure they're quiet because it's still ~~experimental ~~preview with a lot in flux

deft stump
#

why is it in japanese?

pulsar jay
#

why is it in japanese?
@deft stump no clue its just the description though

#

pretty sure they're quiet because it's still experimental with a lot in flux
@amber flicker in the package manager it is flagged as preview

#

is there even an experimental tag?

amber flicker
#

I'm being lazy with my terminology - in preview

pulsar jay
#

I think it is especially confusing that there is a scripable build pipeline package which delivers sth completely different and the "real" SRP is hidden in the platforms package ๐Ÿค”

#

anyway... I tried to create a custom build step but I cannot figure out how to do it with the current version

amber flicker
#

the main bit that was confusing for me was you have to add a 'classic build' step or something

pulsar jay
#

it worked in the previous version as I just created a build step and added it to the pipeline asset

#

but back then the pipeline itself was also an asset

#

now it seems like the pipline is created in code

#

and I dont see a way to either select a pipline or inject a custom buildstep into an existing one

amber flicker
#

I don't know if you have to mess with the pipeline/code step - just having a BuildConfiguration asset works for me (though I did have problems building to il2cpp at some point). Mine fwiw:

#

other than also making sure your platform specific com.platforms.xxx package is installed

pulsar jay
#

I have a custom build step where I create the application version from git tags

#

so I have to somehow inject this build step

amber flicker
#

Ah ok - no idea how that works or what issues there are currently with that

pulsar jay
#

the current state looks a bit ecs like as there are components and the build steps act upon them

deft stump
#

I'm still trying to understand how to build for android with those XD

#

like what components must I use

amber flicker
#

it's a mysterrrryyyy ๐Ÿคช

pulsar jay
#

but the components are defined in code:

        {
            typeof(ClassicBuildProfile),
            typeof(SceneList),
            typeof(GeneralSettings),
            typeof(OutputBuildDirectory)
        };```
deft stump
#

goddammit unity XD

pulsar jay
#

I'm still trying to understand how to build for android with those XD
@deft stump Create -> Build -> Android Classic Build config schould work for that?!

amber flicker
#

@pulsar jay have you posted on the forums about it? There are some things that this channel is great for and others (probably like this) where the forums might be better.

deft stump
#

there's such an option!? XD

#

wth unity

#

I blame unity for all my hardships

pulsar jay
#

@pulsar jay have you posted on the forums about it? There are some things that this channel is great for and others (probably like this) where the forums might be better.
@amber flicker yeah I have. But just recently: https://forum.unity.com/threads/scriptable-build-pipeline-and-platforms-package-confusion.975885/

#

but I rarely get answers to these kinds of questions over there ๐Ÿ˜ฌ

amber flicker
#

I was gunna say... looks like a relatively slow forum - I'd be tempted to post on DOTS although I don't know if you're actually working with subscenes or anything?

pulsar jay
#

I am not currently. But I am just settings up a new project which will eventually use prefab conversion

amber flicker
#

From what I've seen, there's very little knowledge out there about this - kind of have to get lucky a Unity dev replies to you most likely. Sorry that's not especially helpful.

pulsar jay
#

yeah thx anyway

#

oh but maybe you have an idea if it would be possible to extend a package assembly with assemble reference files?

#

because I was trying to copy and rename the build piplene but couldnt because it was using internal stuff

amber flicker
pulsar jay
#

having a local version of the package?
@amber flicker yeah I thought I might get around this somehow

amber flicker
#

just good ol' reflection perhaps

pulsar jay
#

mhh that would be the last resort I guess

deft stump
#

peaj I love you

pulsar jay
#

its just so frustrating because it worked before

deft stump
#

there is an option

#

XD

#

for android build

#

uuugh

pulsar jay
#

sure hope it works ๐Ÿ˜…

coarse turtle
#

I'm actually curious about the scriptable build pipeline, if we could execute it via a bash script or something ๐Ÿค” I wonder if anyone here has tried ๐Ÿ‘€

pulsar jay
#

thats what I am about to try

#

I currently have a project running with mutliple different build setups

#

which is quite handy because they all use different starting scenes etc.

#

and I have a custom build step in there two

coarse turtle
#

Yeah I'm starting to have a similar set up - would love to know if that works out

pulsar jay
#

problem is that project uses platforms 0.2.0

deft stump
#

if it works. devops eccentrics will love it

pulsar jay
#

back then a buildpipeline was an asset and I could just add a custom build step

#

but now a buildpipline is a class with hardcoded buildsteps

#

and I dont have a clue where it is even decided which build pipeline will be used

coarse turtle
#

ah right, I forgot the build pipelines had custom steps - I never tinkered with that before ๐Ÿค”

deft stump
#

there's a get version from git? wow

pulsar jay
#

there's a get version from git? wow
@deft stump thats my custom step ๐Ÿ˜‰

deft stump
#

aaah

pulsar jay
#

but it is a great way of updating the version number imho

coarse turtle
#

Setting it manually every time you make a commit would be a royal pain.

#

I agree with this because I'm doing that lol

stone osprey
#

How would we deal with relations between entities ? For example one entity that represents a "PopUp" with its title... and one Tree that defines the "PopUp" to spawn once this entity was clicked. So lets say we want that tree to modify the popups title once it was spawned. How do we do that ?

coarse turtle
#

Maybe when the entity is clicked, fetch the target the entity affects and either tag it to be updated by a system or push some kind of message to an event queue. With the event queue you can then purge all pending events within a system and do whatever action you need done (like modifying the tree title when spawned)

stone osprey
#

@coarse turtle Thanks... there was a typo, i meant the popup ^^ Does the same apply to when the tree should be able to modify the popups title ?

coarse turtle
#

i'd assume so on a general sense

#

like you perform some action on the tree - you notify the pop up that the title has to change -> update the popup title since there's an event in the event queue (or tag the target entity if thats the route you choose to go)

stone osprey
#

@coarse turtle Alright thanks, should work ๐Ÿ™‚ So like Tree{ OnClick, ChangeTitle, ConnectedPopUp } and a system iterating over chance title and connected popup in order to insert/modify the current title.

frosty siren
#

With what magic we have auto-generated WorldBounds component on rendering entity after conversion in default world? Still suffering trying set up own world from scratch.

amber flicker
#

@frosty siren it's recommended to use the conversion workflows rather than try and add all the components yourself - partly due to all the differences with the render pipelines. You can check out the source for e.g. GameObjectConversionUtility if you want to see some of the inner workings.

frosty siren
#

Yes. I use ConvertToEntity ๐Ÿ™‚ The problem is that i trying create my own world. But can't force it to render converted things

tawdry lotus
#

@deft stump @rancid geode thanks, will check, @amber flicker I am iterating like that, asking for query entities and component arrays, and works, but want to reuse the same code style and helper methods that systems have, and want to keep the tests as simple as possible (avoid lots of boilerplate code), thanks all of you

amber flicker
#

@frosty siren I can't say specifically what you need to do although I guess what is happening is ConvertToEntity is converting it to be in the default world. To move the entity to another world I guess you may need to use some copy between worlds api - I suspect it wouldn't be enough to use .Instantiate and modify the scene id on the components for example as there will be ISharedComponentData's involved at the least. As it sounds like you're converting at runtime (generally not ideal) it may be easier to remove the ConvertToEntity component and instead convert the gameobject at runtime for your custom World. Sorry I can't help any more specifically.

frosty siren
#

I have only 1 world and set it to DefaultInjectionWorld, so injection works fine (although i had some problems a day ago), and i see my converted entity with all stuf through inspector in my world. But it's not rendered by RenderMeshSystem, even not in query. As i understand because entity has no WorldRenderBounds, and i can't add system AddWorldAndChunkBounds manually.

amber flicker
#

you have the hybrid rendering package installed right?

zenith wyvern
coarse turtle
#

that's neat

#

I remember trying to do state machines with SharedComponentDatas - it was a neat idea to have different logics per chunk but I think at the time it was too homogenous of a solution for many different state machines

amber flicker
#

finally an example that looks clean, well commented and relevant ๐Ÿฅณ

frosty siren
#

you have the hybrid rendering package installed right?
@amber flicker yes

safe lintel
#

Is that example still there @zenith wyvern Iโ€™m on mobile and getting a 404 when I try to view it

zenith wyvern
#

Yeah, the link I posted is still working fine for me

safe lintel
#

Ah copy paste sorts it. Wow this is very in depth

fringe sinew
#

I wonder, why do we even need to implement custom IEquatable and hash get functions for class components?

#

Why exactly? Those are reference types anyways. Is it for serialization?

#

If so, then why are they needed in the first place? The default hash generation isn't enough?

opaque ledge
#

why do you think you need to implement custom IEquatable ?

#

for native containers ?

fringe sinew
#

NativeContainers work with blittables only, thus it shouldn't be the case

mint iron
#

i think its required for the key in NativeHashMap etc

#

but it is wierd...

fringe sinew
#

and it's inconvenient at that

sick prism
#

is there a version of AnimationCurve i can use inside a Job?

rancid geode
#

but never tried

north bay
#

There is one in the dots animation package

deft stump
#

how do I make my own system group?

frosty siren
#

I remember trying to do state machines with SharedComponentDatas - it was a neat idea to have different logics per chunk but I think at the time it was too homogenous of a solution for many different state machines
@coarse turtle what the difference between change shared component which will change chunk and add/remove tag component which also will change chunk? The second one looks easier for me.

coarse turtle
#

For me it was the entityQuery.SetFilter(<SharedComponentData>)

#

it was pretty convenient for me to use something like that

#

So I had an int represent different states that I could jump to

frosty siren
#

and with that u can use same query with different filters. i see ๐Ÿ™‚

coarse turtle
#

how do I make my own system group?
@deft stump

[UpdateInGroup(...)]
class MySystemGroup : ComponentSystemGroup { }
deft stump
#

noice

deft stump
#

okay argh this doesn't make sense

deft stump
#
    public class ChangeSideIndexSystem : SystemBase
    {
        private EntityQuery entityQuery;
        protected override void OnCreate()
        {
            //FOR Illustration purposes only! I Know i'm ovewriting it.

            //this queryy causes the first image to happen.
            //despite the fact that it is finding that one panel on the side!
            entityQuery = GetEntityQuery(typeof(PanelData), ComponentType.ReadOnly<SidePanelTag>());

            //this queryy causes the second image to happen.
            //but I'm returning the panels in the 3x6 Plus the 1 on the side.
            //I don't need all 20 panels I only need 1.
            entityQuery = GetEntityQuery(typeof(PanelData)/*, ComponentType.ReadOnly<SidePanelTag>()*/);
        }

        protected override void OnUpdate()
        {
            var panelData = entityQuery.ToComponentDataArray<PanelData>(Allocator.TempJob);

            Entities
                .WithDisposeOnCompletion(panelData)
                .WithAll<PlayerSupportTag>()
                .ForEach((ref EntityToPanelData etp, in EntityMovementData movementData) =>
                {
                    etp = Panels.CheckBeforeChange(etp, movementData, panelData, true);
                }).Schedule();
        }
    }
#

if someone could make sense of this problem for me, I'd love to know

#

if you're wondering, yes, it has a sidepaneltag

#

and, yes, the first query is able to find it.

deft stump
#

I realized the problem!
urgh

#

where do you store persistent native containers?

deft stump
#

okay...

#

next problem

#

Index {0} is out of range of '{1}' Length.

#

how?

#

How is 0 out of range of 1 length?

opaque ledge
#

thats because you have burst enabled, limited exception support, try disabling burst from the menu when you are about to see the error

deft stump
#

So burst doesn't like a native array of 1 length?

opaque ledge
#

it has nothing to do with array of 1 length

#

you can think of it like a "placeholder"

deft stump
#

aaaaah Now i see what you meant

stiff skiff
#

Found some regression I didn't expect. Using SystemBase instead of ComponentSystem causes Entities.ForEach to ALWAYS mark a chunk dirty for components passed in as ref

#

The ComponentSystem version would compare your component before the lambda vs after the lambda, and only update the chunk version if they didnt match

#

The SystemBase version does no checks, and just updates the version on if the component type is marked as readwrite

amber flicker
#

my guess (I have no idea) is this was a deliberate design decision but only way to find out for sure would be to post on forums.

#

Between edge cases, cost of comparison, issues with buffers etc, a decision may have been made that a simple rule of using 'ref' causing a dirty chunk may be preferable - I'm just guessing.

stiff skiff
#

I agree that a comparison per component instance is a costly issue

#

but hashing the component's array before iterating over it, per chunk, and again after it. should be doable

amber flicker
#

I think we've repeatedly seen the team choosing simplicity and perf by default over more complex code with increased functionality.. which personally I think is smart while they get the basics solidified. Not that that's without frustrations.

stiff skiff
#

I can probably work around this by using an EntityComponentBuffer to do the writing, and have the query change to readonly

#

This however becomes an issue with the components that have a bitfield as one of their fields

#

or well, any component that has 2 systems that might write to it

amber flicker
#

could you do the hash comparison yourself and set a flag? Not sure it would need an ECB but would need an additional e.g. bool in the components I guess

#

You're smarter than me, I'm sure you already know what options you have ๐Ÿ˜…

stiff skiff
#

Sadly I can't, all this logic is inside the generated code for SystemBase systems

#

Solution for now, is to just avoid the SystemBase where this is an issue

#

Just wanted to drop the bit of info here. Since it is not a documented side effect from going from ComponentSystem to SystemBase when you're "upgrading" your systems to them

rancid geode
#

Found some regression I didn't expect. Using SystemBase instead of ComponentSystem causes Entities.ForEach to ALWAYS mark a chunk dirty for components passed in as ref
@stiff skiff in SystemBase you can use "in" instead of "ref" to tell Unity that you are only going to read from the component

half jay
#

any tips how can i generate GUID in burst job?

coarse turtle
#

hmm are there any examples of ICustomBootstrap available to look at?

mint iron
#

this was a deliberate design decision
Its inline with what they've said from the start, which is if its not set as read-only then its assumed to have changed. i remember everyone being upset that the changedFilter feature was basically useless because it doesnt actually check if things have changed. We had a deluge of people trying to come up with alternatives to check/store/track value changes with copies of the components and things like that but it doesnt seem like it settled on a good solution.

stiff skiff
#

@sage gate I know, but the issue is for conditional writes

surreal grail
#

heyo, quick question, Burst supports interfaces now, right?

mint iron
#

Im not sure if Entities.ForEach supports specifying an interface argument instead of a specific component. But outside of that, if you've put an interface on an IComponentData you can use it like you would normally. e.g. passing multiple components implementing that interface to a static method.

rancid geode
#

I know, but the issue is for conditional writes
@stiff skiff is it an actual issue? if so, you can either split into more queries/jobs (so you only iterate over the ones that actually need to be modified) or you can create your own change-check

stiff skiff
#

I'd say it's an actual issue, because it requires me to rewrite and complicate things way more then I should for simply moving to SystemBase

#

We do have our own change check, but that is per entity currently, instead of per chunk. Due to how Entities.ForEach works

#

This is something that can be "fixed" from Unity's end with ease.

urban remnant
#

Is Burst and Entities still in preview? Sorry I can't check rn

coarse turtle
#

Burst should be out of preview

#

Entities is still in preview

#

Has anyone tried using VTune profiler with entities/burst btw? Trying to see how I can get function symbols to load successfully in VTune ๐Ÿค”

urban remnant
#

@coarse turtle and how about that Fancy visual code editor?

#

(top on ECS)

coarse turtle
#

Visual scripting is still be in preview

urban remnant
#

Mkay.. last time I checked, it wasn't there at all

coarse turtle
#

yeah that's a change in the package visibility by default for preview packages, you can still paste the entry into package manager/manifest.json to grab it

stone osprey
#

I really have the feeling that relationships between entities are a huge pain in an ecs

#

For example... i have a player, a tree and a popup. When the player clicks on the tree the popup should spawn. Both, player and the tree should be able to modify the popup... other title e.g.

#

And i have no clue how to realize this inside an ecs. Thats not a child/parent relationship. Its n:m... any ideas on this one here ?

#

( I also have the feeling that child/parent relations should only be used for hierarchie stuff like transforms, or visuals )

amber flicker
#

My take is I think this is a framing issue. ".. tree should be able to modify the popup.." - sounds a bit peculiar to me. The popup just displays data. That data might, for example, be part of a Singleton<GameStats> with an int TreeCount; and e.g. a tree system updates the data when a tree is chopped down. A tree should I think never know about a popup in most situations I can think of but of course this is very game specific.

stone osprey
#

@amber flicker Thanks ๐Ÿ™‚ Well in my case the tree stores data of which popup should get spawned. But the tree should decide the title of the popup, once it was spawned in ( Select action on cherry tree )... so i can reuse certain popups and fill them with other data. But i dont just wanna limit this to the tree, the player itself should be able to "change" some of the button texts depending on the items in his inventory... so its much more complex, i just tried to break it down

#

Dont wonder about the popup itself... its just for data structure useages ๐Ÿ˜‰

amber flicker
#

In my opinion, feeling pain about relationships between entities is often (not always) a symptom of structural issues. It tells me I need to do another iteration on what the data actually is, where exactly it needs to be transformed and that I might need to conceptually rethink things. I find this the most time consuming part of DOD. The only general advice I can give is to try to map out your data and relationships on pen and paper even. Look at 'cherries' and 'bananas' and go hmm... that's just 'fruit'... wait, 'entity?' do I need any other data? just my 2c

stone osprey
#

@amber flicker So i should rework my structure ? I also thought about this... but i cant merge three entities into fewer :/ My current attempt is to implement a generic N:M relationship... A component that stores entities that are getting observed and one that stores entities we are observing. If one entity in such a relation needs to change the other ones, it will take a few more iterations than regulary... but i think thats fine

deft stump
#

my take on this problem is
tree has an ICD of PrefabEntity of popup.
once I interact with the tree..
ECB.Instantiate the PrefabEntity + ECB.SetComponent stuff in

stone osprey
#

@deft stump Thanks ๐Ÿ™‚ So you mean i should simply fill the required data into the popup once it was being created ? This would work too... but its probably not that dynamic ^^

deft stump
#

well if you have it pre-defined then I'll just store those pre-defined stuff in blobasset.
then fill it in from that.

#

well that's my approach.
I haven't encountered that problem yet so... XD

low tangle
coarse turtle
low tangle
#

np

surreal grail
#

hai hai, how can one get the timings of a specific job from the profiler?

#

(with script)

civic field
#

Heeey. A question. More like. Multiple questions actually.
I have a bachelor theses on ECS. And Im struglling cause whenever I try to use DOTS it forces me to use their hybrid renderer which I have trouble setting up. When it works its limited. And breaks when I build the game.
So I have been thinking. Is there a way to NOT use hybrid renderer and just take adventage of cache coherency, jobs and burst? If yes how?
How do you guys handle animation? The conversion workflow if Ok but the animations package is ... barebones and I have no interest in either having a milion sprite sheets or re-implementing the Animator myself.
Third: what about external assets. Entitas and Svelto ECS for example. (Both have seen production) As far as I can see. They wont provide the same crazy performance. But at least I can use gameobjects etc... normaly. (While I assume they will still be much more performant that just using game objects)

sick prism
#

if i have an array of 96 floats, (384 bytes), would it make sense to pass them into a job as a FixedList512<float4x4>? I need to iterate over those, so makes sense to iterate each float4x4 instead of each float?

#

side question: what's sizeof(float4x4)?

#

is it correct to say its sizeof(float) * 4 * 4 (64 bytes)?

vagrant surge
#

@civic field Entitas is super flexible, but its perf is... alright

#

Svelto is harder to use but can be pretty fast

#

on Cpp-land, you have Flecs (unity style), and Entt (more like entitas). Both of them should be faster than anything else in C#

hollow sorrel
#

@civic field you can still use gameobjects with ecs in a hybrid fashion, you'd need to do extra work to sync them up tho
if you're doing 2d (since you mentioned spritesheets) you might wanna make a simple spriterenderer + animator that works fully ecs without gameobjects, but dunno how much experience you have so gameobjects might be easier

oak pecan
#

combining gameobject and ecs is a bit awkward but it's an option for sure, you can and should use jobs and burst without entities. You won't have the fancy system scheduling dependencies but you'll still have the nativecontainers safety checks andadvantages of burst.

vagrant surge
#

combining gameobjects with ecs works completely fine on Entitas, but its kinda designed around that

civic field
#

Hmm. The main focus of my theses should be Cache coherency. I dont really care about multithreading. Even tho I know myself and will probably spend more time trying to make multithreading work that nesessary ๐Ÿ˜…
Svelto is my main contender for now. Looking into it as Im typing. The developer has a performance comparion on his website which beats Unity ECS. Which gives me a lot of hope. I know I will still suffer the gameobject/hierarch overhead

#

But to be honest the hybrid renderer and subscene/covnversion workflow has been nothing but a headache. And I really want to be able to animate my sprites like a normal person ๐Ÿ˜ So I will probably ditch UECS.

sand prawn
#

Anyone have a really busy (thousands of objects) physics sim working w/ Unity ECS (or other) AND networked well?

#

Similar question for fluid-dynamics or something similar

radiant sentinel
#

hello, i have a question.
i have 1000 players and i want set position of them from received positions (from server). so i have <=1000 position data and user ids. i have no idea what is best way to find players. i have 2 way:

  • IJobChunk over players and find data of player by a for loop. im break for loop if found data. im checking userIds.
  • IJobParallelFor over received data and find player by a loop in job. then setting data by CommandBuffer to Player.
    what is best way?
#

each player has a user ID and each received data has user ID to find target player.

#

i can decrease amount of position data to half of players count.

north bay
#

My take on that would be something like building a hashmap which maps user id to the entity, after that you can just set the received data in the IJobParallelFor you described but without the 'find player' part. Maybe you could also split the workload over multiple frames

radiant sentinel
#

then i should create hashMap and set data by EntityManager at main thread?

#

searching over hashmap is faster than searching over integers array?

north bay
#

You can still set the data which you receive through the command buffer that you pass to your IJobParallelFor job. The HashMap approach would require that one user id only maps to a single entity. That way you can build a more or less static lookup by the user id to the entity he owns/belongs to.

sleek chasm
#

Hey all! has anyone looked at the manual for NetCode 0.3.0 and been able to make 0.4.0 Preview work? I feel like I'm trying to piece it together but it's challenging

agile dome
#

@civic field You can get DOTS only version of Unity through Unity Tiny. Worth noting that DOTS only version of Unity is pretty far from the Unity you know feature wise. ๐Ÿ˜„

tight blade
#

can one have multiple component data on a thing?

#

multiple of the same component, that is

#

one entity, multiple of the same type of component

deft stump
#

nope

tight blade
#

lol, dont know why I thought you might be able to.

deft stump
#

I tried lol not so long ago.
but both EM and ECB just noped out

tight blade
#

lol, well. oh well

#

can the fields of components be other components?

#

hmm

#

seems like you can so far.

shy pilot
#

@tight blade could you not have all the fields be arrays and use that to simulate multiple instances?

shy pilot
#

when i try to build i get this || Copying assembly from 'Temp/Unity.Transforms.Hybrid.dll' to 'Library/PlayerScriptAssemblies/Unity.Transforms.Hybrid.dll' failed ||

#

does anyone recognise it?

visual mist
#

is there a way to get something I can ForEach out of an EntityQuery?

shy pilot
#

@visual mist do you mean something like WithAll?

#

what is the context

visual mist
#

something like WithAll, but using a pre-existing EntityQuery

#

context is I make an EntityQuery because I need its CalculateEntityCount, but I also want to do a ForEach on the exact same entities that the query captures, trying to avoid repetition

shy pilot
#

i'm not aware of any way to do that

#

.ForEach is within entityquerybuilder

#

not entityquery

#

i think you may just need to bite the bullet and run the query again

#

using the normal method

#

but with the level at which ecs's memory allocation is optimised i doubt it will make a real difference

#

(bear in mind i am new to ecs) @visual mist

deft stump
#

whats your use case though @visual mist

#

?

visual mist
#

well, I've gotten rid of the use case because it was a bad idea :\

#

basically I needed a CameraFollowData component to be instantiated as soon as there was a PlayerData around, so I was trying to have a system wait until it sees one, by counting results of the query

#

can you update a component of another entity while staying with Burst?

north bay
#

You can access/modify the data of entities by using ComponentDataFromEntity<T> or GetComponent/SetComponent inside system base

shy pilot
#

can i get someone's opinion on my architecture plan?

visual mist
#

@north bay with EntityManager? with ScheduleParallel?

shy pilot
#

i'm trying to make a game in which players spawn on a ship and can move around freely in flight.
My current idea is to have an entity for every player with their input buffer

#

and then use a connection id in the components for everything that can be controlled by a player (the ship itself, guns, the player's characters in the ship etc)

#

and get the entity with the buffer in the update method of each controllable object

#

Side note: My plan is to make the player characters children of the ship

#

does anyone see any glaring problems with this approach?

deft stump
#

hrmmmmmm...
so my character needs to shoot a fireball, ice, and a tree or something as an attack.
to do this, which approach should I do?
1.) make a dynamic buffer.
assign my prefabs on it.
attach the DB into the entity that needs it.
OR
2.) make these prefabs as child of entity.

tight blade
#

depends why you need an association between the fireball and the entity that shot it, @deft stump

#

seems you could just as easily make them totally independent of the entity that spawned them

safe lintel
#

just store the entity prefabs in some regular icd? Seems the simplest way unless you have tons of prefabs or some sort of special reqs for the prefabs

deft stump
#

tbf that is one thing I could do.
but what if I have 3 characters, and all 3 has different attacks?
(for visualizaition)
entityA: fireball, ice, and tree.
entityB: rock, car, and traffic cone.
entityC: house, polar bear, and phone.

tight blade
#

well, if its always exactly 3, then I get to cheat and say "just have a component which has 3 prefab fields that are referenced when spawning occurs"

#

if its a variable number of them, then yeah something managed could be the way to go, although I personally would probably just have a component that has like 5 fields and then an int field that says how many of the slots are actually used

#

trades a tiny bit of memory for an avoidance of the entity manager

deft stump
#

"just have a component which has 3 prefab fields that are referenced when spawning occurs"
I'll go for this approach.
thanks

tight blade
#

yesss, finally get to rubber duck for you instead of only asking you for help!

#

also I really want to see entityC do its thing

#

shootin houses, polar bears and phones ๐Ÿ˜‚

#

reminds me of Everything in the weird dimension of sad things

tight blade
#

confound it, what is the name of that annotation that lets you alias the authoring components in the "add component" submenu?

#

"AddComponentMenu". found it!

visual mist
#

does DOTS support conversion of Tilemap Renderers? or Polygon Collider 2Ds?

deft stump
#

Nope nope

visual mist
#

Sed sed

visual mist
#

is it possible to somehow manually do this conversion in some reasonable way? or should you pretty much not use these with DOTS?

deft stump
#

@pulsar jay I just remembered.
Have you gotten around building a game through terminal? really curious if it's possible

#

is it possible to somehow manually do this conversion in some reasonable way? or should you pretty much not use these with DOTS?
@visual mist what d you mean reasonable way?

#

what part of conversion is unreasonable to you?

visual mist
#

so, for instance the collider, I could try and build the Physics object matching the polygon collider, if there is some way to introspect a polygon collider to figure out its shape?

#

for the tilemap renderer, I have no idea about their internals so that seems harder ๐Ÿ˜„

#

maybe I can skip the tilemap renderer and hack that tilemap-producing script to dynamically build me the DOTS equivalent ๐Ÿค”

coarse turtle
#

polygon collider should provide a collection of points

#

you can read it and try to inject it into a custom collider of sorts (not sure if you're using Unity Physics, I haven't used that so I can't say much there)

deft stump
#

2020.2's reorderable list is a godsend

deft stump
#

but it only works with some types

deft stump
#

Oh cool

#

ECS is smart enough to only referrence to one prefab entity

visual mist
#

alright I'm going to need some stupidity debugging here

#

I have a component, I'm adding a Translation and a RenderMesh, and I don't see it around, what could be missing?

frosty siren
#

@visual mist LocalToWorld, WorldRenderBounds, RenderMeshSystem if you don't use default world bootstrap

visual mist
#

ah, any keywords to look up the bootstrap?

frosty siren
#

if u don't implement your own bootstrap with ICustomBootstrap then it is not about your problem

visual mist
#

ah I needed RenderBounds!

frosty siren
#

if you will use conversion with meshes that can be converted then it will auto generate all needed stuff for rendering

craggy orbit
#

is there a way to hide or clear the subscene conversion log? i've reimported the scene, opened, closed, unloaded, and reloaded the scene over time and it just wont go away. i can't figure out what specifically is causing the error either

dry dune
#

hi need some help with C#
i need a generic method like this,

private static T WiredThing( T n ){
   // if T is float return n/3.0f
   // if T is integer return n+1
}

and i need it inside of a job so no objects allowed
can anyone help me with this?

#

but what to do with return type?

craggy orbit
#

if you need to make sure that T is blittable, you can do

private static T WiredThing( T n )
where T: struct
{
   // if T is float return n/3.0f
   // if T is integer return n+1
}```
dry dune
#

T isn't a struct it is float or int

coarse turtle
#

Why not just do 2 extension functions?

static int WiredThing(this ref int value) => value + 1;

static float WiredThing(this ref float value) => value / 0.3f;
craggy orbit
#

ah i missed that. whoops

dry dune
#

@coarse turtle yes but how to pick which to use when i don't know type of T ?

hollow sorrel
#

how are you gonna detect if it's float or int if you don't know T?

#

they're both 4 bytes and can be represented in both forms

coarse turtle
#

yeah - what Scorr stated

dry dune
#

i have T but don't know if it is int or float

coarse turtle
#

well if T happens to be a float/int

#

you would end up doing

// some_value can be float or int
var some_value = some_value_of_t;
some_value.WiredThing()
dry dune
#

hm, let me test it

trail burrow
#

float/int are struct

#

struct just short hand for value type

#

and they are value types

dry dune
#

surprise for me i was thinking it is a primitive types

trail burrow
#

they are

#

but they are also value types

#
static T WiredThing(T n) where T : unmanaged {

}

But switching on what T is requires accessing the type of object for T which is of the System.Type type which u cant do in burst afaik

dry dune
trail burrow
#

oh it does?

dry dune
#

just tested

trail burrow
#
static unsafe T WiredThing(T n) where T : unmanaged {
    if (n is float f) {
        f = f/3f;
        return *(T*)&f;
    }
 
    if (n is int i) {
        i = i+1;
        return *(T*)&i;
    }
        
    /// ...
}

@dry dune this should work then

#

fixed a small typo... coding in discord lol

dry dune
#

thanks have to learn about unmanaged unsafe code is a black magic for me ๐Ÿ™‚

trail burrow
#

oh right need unsafe also

#

well this should work... i think

#

didnt test it but well

shy pilot
#

Hi all. I'm trying to make a game in which players spawn on a ship and can move around freely in flight.
My current idea is to have an entity for every player with their input buffer
and then use a connection id in the components for everything that can be controlled by a player (the ship itself, guns, the player's characters in the ship etc)
and get the entity with the buffer in the update method of each controllable object
Side note: My plan is to make the player characters children of the ship
does anyone see any glaring problems with this approach?

stiff skiff
#

@trail burrow Wont the above allocate for boxing though?

#

Its kind of odd to even use a generic for this. The above looks more like a homework assignment

#

Actually nvm, it wont box. still wouldn't use an generic for this however.

dry dune
#

@stiff skiff if you see a generic solution without unsafe code please let me know how to do that

rancid geode
#

It doesn't make sense to use generic when you already know the type

trail burrow
#

i agree with zeroZshadow and Bruno here... but i just answered the question ๐Ÿ˜„

normal hound
#

Hello... I'm trying to start using DOTS in MMORPG based on dedicated server... Is there any good introduction to do this? I created my server using Tom Weiland's tutorials

#

oh, and Demo Project of NetCode is not working on my computer

amber flicker
amber flicker
shy pilot
#

@normal hound the netcode examples in the docs are out of date

stone osprey
#

What is the common technique to react to collision events ? Should we mark entitie as "CollisionStarted", "CollisionStayed", "CollisionExited" by ourself ?

stone osprey
#

@shy pilot Well i skipped trough it... looks like he is only writting rotation systems ^^

shy pilot
#

hmm

#

i haven't done this myself so i'm afraid i can't be of much help ๐Ÿ˜…

stone osprey
#

@shy pilot Its fine ^^ in theory i just would mark the entities... this way i could react to the tags.

#

Entities.ForEach((Player player, CollisionEntered ce) => { //Do something with that information })

shy pilot
#

ah i see

stone osprey
#

Atleast it would be pretty flexible... Entities.ForEach((Player player, CollisionEntered ce, OnCollisionExplode explode) => {});

stone osprey
#

Anyone having an idea when its usefull to use event-entities and when we should simply tag entities with components ?

#

e.g. i have an "Countdown" system... once it reaches zero, i fire an entity-event. Intead of firing that event i could also simply mark the "countdown" entity with a "Finished" component...

amber flicker
#

Instantiating event entities (rather than tagging other entities) is for when you don't want to tightly couple systems in code. The countdown entity is just another type of event entity.

stone osprey
#

@amber flicker Thanks, that already helps a lot ๐Ÿ™‚ Why does an event entity decouples our systems ? Lets say we wanna react to a finished countdown. We could either listen for the event-entity or iterate over all finished onces : Entites.ForEach((Countdown cd, Finished fc) => {})... so wouldnt the system reacting to this be "decoupled" aswell ?

#

Or should events be used for tasks which dont target a certain entity directly ? Like commands ? Global Events or notfications ? "Damage those", "Player loged in"

amber flicker
#

because Countdown is (imo) a type of event entity, I agree these aren't particularly tightly coupled - it seems reasonable that multiple systems could know about 'Countdowns'. However, when your weapon system wants to play a sound effect - I'd say your audio system doesn't want to have any coupling to the Weapons or weapon system so e.g. you could create an IntEvent ICD with a param 0124 (maybe an AudioEvent tag) - your audio system reacts to that event and plays the sound. I haven't ever needed a general event system because as soon as you do this, you may as well just create an AudioEvent entity and have the audio system consume them. If you have many different types of systems, having a generalised dispatcher and consumer I can see as useful but... as my friend says "Software is just data: input, processing and then output and my best code has always been that which does the simplest thing to get the job done."

#

i.e. I wouldn't write a general events system until I found I needed it

#

all just my opinion - I'm sure plenty would disagree with me

stone osprey
#

@amber flicker Thanks for your explanation ๐Ÿ™‚ It makes sense... and i agree with that one. So event entities only make sense when systems that do not belong to each other want to communicate. I made the mistake and used many of those event entities, my collision detection system depends on them ( Collision-Event ) and i was despaired because i could only iterate over the collision events, but not over some composition ( Player & Collision e.g. ). This should solve my problem ^^

tight blade
#

ehh, I deleted this question, but I think I actually need to ask it

#

does anyone know if you can prevent entities from being created in a conversion script? like in the convert method of an IConvertGameObjectToEntity

#

I tried just destroying the entity with the entity manager, but that appears to mess things up downstream

#

(the reason is that I'm trying to use an authoring component that, rather than creating entities during conversion, adds components to the parent gameobject's entity)

coarse turtle
#

I think you can defer that to a GameObjectConversionSystem instead. Target to parent entity given a child (or perform action of parent entity with existence of children)

tight blade
#

youd have to add some component to the parent though, like a marker, right?

#

otherwise what would you be querying on?

coarse turtle
#

Yeah you'd need some kind of marker/component attached

tight blade
#

yeah. I mean that's not that bad. Id prefer not to have it, but its not that high on the "my problems with DOTS" list

amber flicker
#

I'm not 100% on what you're trying to achieve but just thought I'd mention you can use existing monobehaviour techniques in combination with conversion if it's useful. i.e. on conversion: find parent gameobject, add what you want based on GetComponentsInChildren<MyComponent> then remove those same components so the conversion doesn't run for each of them. Just an example, not sure how helpful to you that is.

#

i.e. utilising the hierarchy, Monobehaviours etc but not doing 1:1 conversion. I do something similar to the above for my tagging asset: if my TagBlobAsset ICD doesn't exist, create it, find all Tag monobehaviours, create a blob with array of data - then for subsequent Tag conversions, the ICD exists so they don't do anything.

tight blade
frosty siren
#

Is there a way to get all dots built-in systems without my custom systems? Now DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default) gives me all default systems which is very handy, but i want to exclude all my systems. I know that i can filter by assertion or namespace, but maybe someone now more cleaner way.

pulsar jay
#

@deft stump I am still stuck at injecting my version number. Basically every approach I tried failed because they made a lot of the stuff in the platforms package internal am sealed

#

Previously it was as easy as inheriting BuildStep and drag drop it onto the pipeline

#

But now you can't inject a custom build step anymore. Would need to build a whole new pipeline just to add a single line of code ๐Ÿ˜ฉ

hollow mist
#

While using Unity.Netcode, if I have a ghost object spawned on the server and then mirrored to clients, the material flickers... no other objects in the scene do this... any insight?

stone osprey
#

Would you rather choose "Marker Components" or "State Components" ? Little example to explain the case : Entities.ForEach((Task task, TaskStarted started) => {}) or Entities.ForEach((Task task, TaskState state) => {});

#

State could contain multiple enums as different... well states. The marking variant is to simply mark the certain entity with its "state"

deft stump
#

I would choose marker components over state

#

But

#

If we just have a few entities. State components are fine too

stone osprey
#

@deft stump Thanks ! Is there a reason why you would choose marker components ? ^^

deft stump
#

Cache friendliness.
Best to have your entire cacheline stuff that you want to read/write.
Plus scales well on multiple cores.

#

Again not that it's wrong to use statecomponents.

#

cant wait to enable/disable components

stone osprey
#

Alright, thanks ^^

stiff skiff
#

statecomponents do mess with performance if you have to many though

#

So don't overdo it there hehe

shy pilot
#

i'm having a bit of trouble with rpcs, i know how to send them from the client to the server, but how does one go about sending one from the server to the client if the client can't delete the rpc afterwards?

#

Side question: How do you parse data through rpcs, whenever i put a field in an IRpcCommand i get errors :/

graceful mason
solar spire
#

the name being com.unity.kinematica for example

graceful mason
#

Is there a list anywhere?

#

Ill judt get entities and hybrid renderer, i think thats all i need

#

cant remember what I used to install ๐Ÿ˜„

#

Thanks tho ๐Ÿ˜„

#

i got it installing whoop

deft stump
#

@graceful mason

#

list

graceful mason
#

they already got preview tag, is that not enough ๐Ÿ˜„ maybe they need a experimental tag too for the bants

#

but thats amazingf thanks

deft stump
#

they just don't know why people are installing experimental packages so they removed it from listing straight out

graceful mason
#

well the packages are fairly mature, way easier to use than install

deft stump
#

new burst version

#

1.4.0-preview.5

#
[1.4.0-preview.5] - 2020-09-23
[Added]
  You can now select explicit x86/x64 architecture SIMD target for Universal Windows Platform.
  An error message if attempting to BurstCompiler.CompileFunctionPointer() on a multicast delegate, since this is not supported in Burst.
[Changed]
  When using "Executable Only" build type on Universal Windows Platform,   Burst will now only generate code for a single CPU architecture that you're building for.
  We now copy the lib_burst_generated.pdb into the root of the player build (in addition to being alongside the lib_burst_generated.dll), this allows the unity crash handler to resolve the callstacks from burst code.
  Improved eager-compilation performance
  Improved Burst Inspector loading time
  Improved Burst initialization time
#

oh wait... it was released in 23 haaaha I thought it was released today

ocean violet
#

Hi guys. I'm trying to build something using ECS. Is "too many components per entity" a thing I should worry about?

low tangle
#

no

#

but design wise, you do want to attempt to reduce them

#

but there are no issues with having lots

tawdry lotus
#

is it possible to mark a gameobject entity (prefab instance) in scene as prefab entity after convert to entity?

#

I want that for custom test scenes with custom values in my entities that I don't want as prefab variants in assets

#

and I need them to be "prefabs" to instantiate later multiple entities

deft stump
#

Hi guys. I'm trying to build something using ECS. Is "too many components per entity" a thing I should worry about?
embrace the fact that there WILL be lots.
but keep it reasonable as you don't want to fill an entire chunk with 1 entity because 1 entity has Lots of data

#

@ocean violet

ocean violet
#

@deft stump @low tangle thanks guys. I found working with entity is more natural than gameobject. but i end up attaching too many components to an entity (many = 5-10)

low tangle
#

thats not that many if the components are not too large

#

but even then, focus on getting the logic implmented

#

you can break up entities later on much easier than untangling object spaghetti

craggy orbit
#

is it safe to use optional types with the Burst Compiler (like float? myFloat = null;)

grim plinth
#

hmm I wonder if there is tempaltes that allow me to get started with jobs sytem for doing alot of enemies with random ai?

#

I'll have to toy around with it later perhaps

low tangle
#

dont think they are supported @craggy orbit

drifting cargo
#

Hi guys, I just started to learn DOTS, but I found that the tutorial on Unity website is design for 2018 and I notice things has changed. So my question is Hybrid Entity still available now?

deft stump
#

Hybrid workflow is still availablr

heady wraith
#

what is dots

solar spire
#

There are pinned messages that would explain this

zinc plinth
#

@drifting cargo hybrid entities are still a thing but you should avoid them at all cost

#

they would be used for stuff like Cameras and such

drifting cargo
#

@deft stump ya, found a more decent tutorial on unite video, thanks

#

@zinc plinth oh any idea why its not recommended

deft stump
#

perf cost

stone osprey
#

How do we achieve that a component only stays one frame ? For example i wanna mark one of my entities once it reached its location and then remove that "ReachedLocation" component after one frame.

amber flicker
#

just have a system that runs at end of frame and use EntityManager or an ECB to remove them all.. e.g. EntityManager.RemoveComponent<ReachedLocation>(myQuery); where e.g. myQuery = GetEntityQuery(typeof(ReachedLocation))

stone osprey
#

@amber flicker Alright thanks, thought theres already some sort of build in functionality ^^

amber flicker
#

haha I'm not sure how much more built-in than that it could be ๐Ÿ˜…

#

I mention this every time this comes up but doing structural changes with queries is really cheap so it's a good pattern to get into

deft stump
#

is it anymore cheaper than ecb?

stone osprey
#

@amber flicker Well something like "ReachedLocation : IComponentData, IOneFrame" would be great ๐Ÿ˜„ but probably this is a bit too much...

amber flicker
#

@deft stump if you can do all matching entities at once (via a query) it's massively faster than e.g. adding every entity to an ecb as instead of changing things per entity, it just essentially changes the entry for the archetype

gusty comet
#

Hi! I haven't used Unity in a year or so. Anyone know if the DOTS ECS is ready yet? I remember using it and was frustrated by how much the API was changing

tiny ore
#

no

#

not ready, still in preview, and not very close to production

deft stump
#

nope.
very experimental.

gusty comet
#

thanks (:

safe lintel
#

its ready if you are an insane madlad ๐Ÿ˜‰

deft stump
#

anything's ready if you're brave enough

#

๐Ÿ˜‰

safe lintel
#

i tried converting megacity's audio to the latest dspgraph, oh god that is a proper descent into madness

dull copper
#

@gusty comet it's so "ready" that Unity hid almost all DOTS packages from Package Manager now

#

that should give you some idea how ready Unity thinks this is ๐Ÿ˜„

#

basically you should treat it as "alpha"

gusty comet
#

oh wow ! okay, ty for the info!

lapis yoke
#

I seem to remember that there is a way to check is an entity is a parent of another entity, but I can't find anything about it...

lapis yoke
#

Yes, that's what i would like to do, but I can't find any documentation of how to get an entitys parent?

#

More precisely I would like to check if two trigger objects are in the same hierarchy. But if there isn't a fast way to check this in DOTS, I guess I have to attach a component with some "root parent" data...

sick prism
#

what's the common way to create a temporary buffer within a job?

#

var buf = new NativeArray<float>(count, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
this cool? i am writing the buffer fully

vapid hamlet
#

I am 100% new to unity but not new to development. I am staring a new multiplayer project and I am curious about the state of dots and specifically the dots netcode.

tight blade
#

its not ready for anything. If youre a good developer who has a steady paycheck and a mature grasp on multithreading or the ability to learn with only the use of the "goto definition" function of your IDE, then I'd say just stick it out with dots and maybe in 3 years you might be able to draw infinity cubes on screen and rake in the steam cash

#

@vapid hamlet

#

if you're dumb enough to stick with it, we'll be here for you to answer what questions we can and steal from you whatever insights you discover

vapid hamlet
#

lol

#

yes, this is currently a hobby but I am dedicated to learning it.

tight blade
vapid hamlet
#

Maybe it will help that I generally dislike OOP.

mint iron
#

i for one am glad Topher is still alive.

vapid hamlet
#

watching this "Understanding data-oriented design for entity component systems - Unity at GDC 2019" video

#

Love it

ionic pelican
#

Hey folks! Nice to see such an active group here!

Has anyone played around much with the new InputSystem yet? I'm trying to get 1.1.0 working with DOTS and the types of the auto-generated classes aren't aligning with what I'm seeing in examples (IE: this one https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/d616c1b077c306e6f31b41a3970799e4b132139b/UnityPhysicsSamples/Assets/Common/Scripts/DemoInputGatheringSystem.cs). I'm just getting something which implements IInputActionCollection2, IDisposable which don't have any of the methods I believe I need.

shy pilot
#

@ionic pelican my only suggestion would be to look at the sample code in the github repo

#

that should be up to date (unity doesn't do a great job of keeping preview docs up to date)

ionic pelican
#

Yeah that's what I've been looking at. I'll dive a bit deeper in to it, then - thanks!

shy pilot
#

your welcome :)

tight blade
#

@ionic pelican fyi, its not up to date. you've got about a 45% chance of using stuff that's up to date in the dots samples.

#

the samples repo in general, that is. maybe that particular one is. if you find that it is, please let us know

#

thats valuable information round these parts.

#

always hungry for up to date info.

ionic pelican
#

yeah, that's the impression i've been getting :(

i see above you mentioned you don't think DOTS is ready for anything - do you care to elaborate a little bit on that? I've been following it since it was announced but I've held off doing much with it due to its immaturity, but theyve been putting out impressive demos...

tight blade
#

does anyone more familiar with C# know how they accomplish the trick with the PhysicsBody authoring component where they selectively hide values depending on whether a Boolean is checked?

shy pilot
#

@tight blade they use an editor extension

#

i've never used it myself but with editor scripts you can do that

#

was always too much effort for too little gain for me ๐Ÿ˜†

tight blade
#

yeah, I've always wanted to get into them but never have also.

shy pilot
#

is anyone here using netcode?

tight blade
#

this particular use case is just pointless enough that I may be willing to invest time in it

shy pilot
#

can someone tell me if a client can delete an rpc entity that it has recieved?

safe lintel
tight blade
#

@ionic pelican we make jokes about dots to help set people's expectations. A lot of experienced game industry professionals come here and end up losing a lot of time against a production schedule backed by raised funds because they bet too heavily on the state of DOTS, and wind up frustrated because Unity has gravely underestimated the difficulty of launching dots while maintaining the gameobject flow

ionic pelican
#

@safe lintel wtf how did I not check that. I just assumed they hadn't updated anything for 14 months. Thanks! Let's see if this helps

tight blade
#

the state of DOTS is not something you want to rely on if you're counting on a particular outcome.

#

this chat is part knowledge base, part support group.

safe lintel
#

@tight blade look into custom inspectors, this folder probably has it Yourproject\Library\PackageCache\com.unity.physics@0.5.0-preview.1\Unity.Physics.Editor\Editors

tight blade
#

Yeah, I actually had just found it

#

time to make a button disappear

safe lintel
#

@ionic pelican its really easy to do, also always double check doc links if its using the latest version because there are tons of links out there to older versions that dont really make it that apparent you are on an old version

shy pilot
#

does anybody at all know if a client can delete a recieved rpc?

ionic pelican
#

@tight blade thanks for the breakdown my dude. Yeah that's kinda been the impression I've gotten from the patch notes. The ECS talks jesus and acton did have me totally hooked, but it's upsetting to know how far out a feature complete state is.

Do you use it in any real capacity or do you just keep this channel unmuted for shits and gigs?

tight blade
#

this chat is pretty cool. a lot of us keep this channel on, even when we stop working on Unity for weeks or months at a time. Because maybe, just maybe, someone will have new useful information related to something you're working on.

low tangle
#

I like the paradigm and data oriented tight packing, loose coupling of state to logic in general

tight blade
#

sometimes someone will ask a question, and weeks later show us some results, and then weeks later still some newcomer will come asking something similar and someone will pipe up and say "oh, I think @soandso was working on that" and soandso will come back from the dead to answer

low tangle
#

but its hard to keep working on ecs, when the engine isn't opening up the paths I need to finishing my game

#

I'm currently throwing away my 2yo dots/ecs game to rewrite it traditionally

#

which is painful

tight blade
#

as for me personally? I make jokes, but I very much intend to make something you will have heard of in 2 years time.

safe lintel
#

@low tangle aw man really?

tight blade
#

thats linear memory access being put to work

low tangle
#

yeah :| vr/rendering the decoupling of the entity world from the traditional renderer has been the thorn in my side for so long I had to just stop

ionic pelican
#

@low tangle your experience sounds painful ๐Ÿ˜ฆ I started playing around with DOTS back in 2017 i think (is that around when it was announced?) and I saw then that it was gonna be a shit show. I'm really surprised you kept going with it

when the engine isn't opening up the paths I need

What, if I may ask, are the paths? I've not been able to find an explicit answer on the major engine features not available

low tangle
#

the fast majority of my performance was getting sucked up from the copy in copy out

ionic pelican
#

@tight blade that's sick lol

low tangle
#

well, the main three are the traditional physics engine (physx), the legacy render pipeline, and the forced switch to the new SRP's. and then the fact that the asset pipeline has been pushed off for ages at this point, making it impossible for me to support UGC how it was currently in the engine. that on top of the fact the engine performance just degraded around 2019.3 and never recovered

shy pilot
#

@low tangle the constant loading bars have been a pain for me ๐Ÿ˜†

low tangle
#

also at some point I figured I was spending far too much time making backend systems to support everything, instead of actually making the game, akin to just making a custom engine

#

that kind of unfocused development will literally run forever without a clearly defined project architecture, which you can't lock down with the state of UECS right now

#

I will note I'm not making a simple game, I'm making a ugc based vr sandbox game with a lot of physics dynamics

shy pilot
#

that may be one of the reasons they went public

low tangle
#

thats a tall order for traditional development or flat ecs

shy pilot
#

they just don't have the funds for this sort of total rewrite

#

at least that's my understanding

low tangle
#

yeah, so swallowing the hard pill and throwing it away is the best option I can come up with right now

#

during my free time I started exploring what a dots focused engine would be like and eventually will put it up on github. but thats a long ways out for sure

ionic pelican
#

@shy pilot that'd be surprising to me...Unity is a pretty massive (>$1bil) company

low tangle
#

unity feels like its held together with tape sometimes

ionic pelican
#

i think the gearless got it right in saying they underestimated how complicated a rewrite was gonna be when keeping features coming with the legacy system

low tangle
#

I think the start of the system was just so promising they dove right in

#

but gave way too optimistic expectations, and made the mistake of putting them into marketing material

shy pilot
#

and now they're torn between writing dots and keeping the main engine afloat

low tangle
#

its been two years and UECS currently for my complex game is no more possible than when it first came out

#

they have multiple teams

#

they are not torn

shy pilot
#

i know

low tangle
#

I'm sure there are internal struggles though

ionic pelican
#

@low tangle thanks for the write up my dude. Your project sounds interesting.

The asset pipeline stuff is what's most concerning to me, but I'm in the early stages of my project so i can suppress that anxiety for a few years ๐Ÿ˜‚ ๐Ÿ”ซ

shy pilot
#

but instead of having the whole of unity working to maintain and develop one product

low tangle
#

I remember rumblings of them having trouble getting the graphics teams (who were busy with HDRP and URP) to add in features DOTS needed badly for hybrid v2

shy pilot
#

mmm

#

i only started a coupe of weeks ago

#

well

#

properly started

#

i had been poking at the netcube sample for about 2 months to realise it was out of date

low tangle
#

so theres some internal friction with DOTS getting the lower priority I think

shy pilot
#

yeah

low tangle
#

kinda makes sense with the slower external releases?

safe lintel
#

i mean the srps have a bunch of issues on their own without factoring in support for dots ๐Ÿ˜ฉ

shy pilot
#

yep

safe lintel
#

and the whole making them compatible with each other.. wondering how thats gonna pan out

low tangle
#

choose your technical debt wisely

shy pilot
#

yes

#

eventual deprecation or flying blind

#

if it ever gets there it'll put unreal far behind as far as i can tell

#

but until then .__.

ionic pelican
#

Yeah, I think an ECS engine for the masses would be industry-changing

safe lintel
#

my own worry is that we are waiting for all of this to come to fruition but even when it finally does, its gonna be bare bones. everything is on performance but tbh featurewise unreal is kinda leaving them in the dust and the whole asset community will take a while to pick up the slack, not that i want them to i want new features baked in as standard

shy pilot
#

yep

#

there's just no support for the things that has traditionally made unity amazing to use (pathfinding support, good ui system etc)

#

even the simple fact that you have to use a traditional camera is driving me insane ๐Ÿ˜†

low tangle
#

theres a lot of engine there behind why you still have to have those objects

shy pilot
#

i know

#

but still

glossy summit
#

Is it mentioned anywhere what the different NativeArray allocators are doing behind the scenes, and what are the pros/cons for each of them?

sour flax
glossy summit
#

Ah, so they do actually have a builtin deallocation lifetime interesting

#

does that mean I don't have to manually Dispose of a Temp NativeArray ?

vagrant surge
#

@low tangle at the speed unity is going with DOTS, either OurMachinery (ECS from the start) or ue5 adds ECS happens before unity ecs being stable

#

there is now a full unity style ECS embedded into latest ue4 version, for the cinematic system for some reason (not exposed)

low tangle
#

yeah

#

pretty sure I can finish my ecs engine before they get it stable

#

but its not really the same thing

vagrant surge
#

the unity ecs is proably doomed

#

until they actually use it themselves

#

at unity corp

#

they need more tech demos, or an actual game

#

take that cool battle simulation techdemo and turn it into something similar to Total war, with some basic AI, and different types of units

pulsar jay
#

Is there a conversion workflow for scriptable objects? I would like to convert a tileset (basically a list of prefabs) into a component with a blobasset containing the converted prefab entities

amber flicker
#

has anyone got the non guided-tour examples to work with Data Flow Graph?

pulsar jay
#

@amber flicker whats the guided tour examples?

amber flicker
#

examples that come with the DFG package

pulsar jay
#

oh thx didnt even know about that

amber flicker
#

yea, it's very little known at this point - no docs or anything

pulsar jay
#

sadly thats true for a lot of these dots packages

#

do is see that right that there is an event/message system included in the DataFlowGraph?

amber flicker
#

there's all sorts but I've no idea what can work standalone etc. If you're checking it out does e.g. the tween example work for you?

pulsar jay
#

I didn't check it out yet as I dont have the time right now but if I get to do it I can tell you

#

is there an easy way to cast a blobarray into a nativearray?

low tangle
#

check for a .AsNativeArray()

pulsar jay
#

@low tangle there does not seem to be an AsNativeArray method in the BLobArray class

#

only ToArray()

amber flicker
#

I think ToArray makes sense seeing as the data should be immutable?

pulsar jay
#

the problem is Manager.DestroyEntity needs a nativearray in order to destroy all the entities

amber flicker
#

Well.. managing BlobAsset lifetimes is a whole other thing... I think you have to manually destroy blobs your assets reference before destroying the entities. Which potentially ends up with reference counting if you share the blobs between entities. That's why there's BlobAssetStore - but that functionality seems limited to working with gameobjects. At least those were my previous conclusions/frustrations.

#

destroyEntity might do something smarter than I'm aware - couldn't find much info and my post on the forum got ignored so.. I stopped using them

pulsar jay
#

right now I am just trying to use the blobasset as a runtime entity prefab store

#

the idea was: convert prefabs to entities -> store in blob asset -> instantiate from blob asset when needed -> destroy prefab entites -> destroy blob asset

#

however I dont fully understand BlobAssetStore. Can it be reused to instantiate converted prefabs again?

amber flicker
#

Are you recreating the work of subscenes somewhat I wonder?

pulsar jay
#

kind of I guess

#

because I have a custom scene format for tilemaps

#

it is instantiating all the tile entities from prefabs

#

figured this would be more flexible concerning entity serialization changes and also would avoid problems with creating tilemaps at runtime

amber flicker
#

so, ideally you don't want to be converting at runtime right? which is why subscenes are great. Are you creating these blobs at edit time? Ideally there would be a converted prefab binary but as there isn't, at the moment putting prefabs in a subscene seems like a viable strategy to me.

#

In fact I wonder how different a 'converted prefab' looks in practice compared to just a single subscene with a prefab in.

pulsar jay
#

yeah I agree it would be ideal to convert at edit time

#

though I am porting the tilemap from a previous workflow which was using DrawMeshInstanced

#

right now it is easiest to convert prefabs at startup and instance them later on

amber flicker
#

Imo in that case - due to the complications with runtime blob creation and managing their lifetimes - you'd be better of putting all the converted entities into a hashmap or dynamicbuffer

pulsar jay
#

mhh I thought blobasstes would be great as they should not change after creation

#

but maybe they are more trouble than they are qorth

amber flicker
#

In my opinion, massively so. Blobs are good for large shared data accessed via jobs. Instantiating entities doesn't really have any overlap there. I get the immutable thing a bit but.. just don't overwrite your dynamic buffer? ๐Ÿ˜… I can't think of any performance you'd be missing out on (memory or cpu).

pulsar jay
#

well then I have to look into the dynamicbuffers. didnt use them yet ๐Ÿ˜…

stone osprey
#

Ahhh this is confusing... So ECS is about composition > inheritence, right ? Well... im currently designing my gameplay using composition. This way i can easily define certain logic by : "Entities.ForEach((Player player, OnCollisionEntered oce, Explode explode)) => {});"... But, i know some other ecs developers that hate composition for some reason and those are often say its better to define some sort of interface or other class handling the gameplay logic.... this way it would look like : "Entities.ForEach((Player player, OnCollisionInterface oci) => { // Call interface to execute some logic });... Is someone right in this discussion ? Or doesnt this matter at all ?

#

The advantage of composition is... the composition. I can easily remove the "Explode" component from my player and he wont explode anymore or attach other ones. Having such a "Interface" comes a long an disadvantage, it removes some parts of the composition.

pulsar jay
#

@stone osprey to me it seems like they are trying to work around the core concept of ecs