#archived-dots
1 messages ยท Page 179 of 1
hahaha
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
lemme check real quick
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
o0o0o another option would be to have a separate array for the muscles, and the HumanPoseWrapper would have a startIndex + length to its section.
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
https://hatebin.com/zfdjokzyas this what i was referring to in Unity.Physics
oh, there's also the FixedList collections you could use
like FixedListByte512
ooh, unity.collections package?
public struct HumanPose
{
public float3 LocalPosition;
public quaternion LocalRotation;
public FixedList512<float3> Muscles;
}
hmmm i cant seem to find it... which version of Unity is minimum for that?
on 2020.1.2f1
im on 2020.1.0b14 with collections 0.9.0-preview6
oh damn i think i know why, is package visible in package manager?
it should show your version in package manager yeah
they do it with code gen com.unity.collections@0.9.0-preview.6\Unity.Collections\FixedList.gen.cs
i think they may have removed it from the package manager, recently they did that for some packages
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
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
Is this ok that [GenerateAuthoringComponent] for IBufferElementData with Entity field doesn't show List<GameObject> in the inspector? Am i do something wrong?
Buffer authoring doesn't work with game objects yet afaik
You'll have to implement your own IConvertEntityToGameObject
and I believe you can't use list
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
I have a weird bug
squish it
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
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 ๐
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
thanks :)
so OnCreate is like Awake and OnStartRunning is like Start?
yep it works :) you are a legend @zenith wyvern!
What systems i need to add to get mono-entity conversion to work? I added ConvertToEntitySystem (under InitializationSystemGroup) but it doesn't work
everytime i see #497866432277643275 flashing, i am checking it if its the DOTS blog post that was mentioned in recent AMA ๐ฆ
@frosty siren i think just that system should do the trick
did you set your world as default injection world?
How to do it? ๐
Thank you๐
It's so nice to throw failed conversion to warnings
Still throw this warning even if i set my custom world as default injection world ๐ฆ
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
@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
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
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
the phrase pops up on the blog in many articles, but mostly in passing ๐
has anyone used assembly definitions in their ecs project ?
Is it considered bad practice to have systems with no behaviour in OnUpdate?
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
How would I go about managing these refs since they can't be static (multi-worlds)
Maybe a dictionary singleton with world-system lookup
I've found myself in that situation too. My spawn system doesn't use OnUpdate, just has methods to call the entity manager
where are you putting your logic?
hm, we can't use NativeHashMap<Entity, NativeHashMap<int, int>> ... how would I work around it?
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];
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...
ah yeah - if it's not a 1:1 mapping then multivalued hashmaps will be a better soln
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
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
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.
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
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?
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.
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
Cool - yea occasionally you have to mouse over to force I redraw I find
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. ๐ง
ah ok - good to know
When using dots, does everything need to be coded in the dot framwork or can I for example have a background element use monobehaviour.
@hasty condor You can do it hybrid. Unity Tiny would be in pure DOTS.
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 ?
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.
@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.
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 ๐
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.
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
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
okay this is odd now
@gusty comet
https://forum.unity.com/threads/visibility-changes-for-preview-packages-in-2020-1.910880/
@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
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)
@coarse turtle isn't that basically what a subscene is/does?
yeah pretty much hahaha
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()
Does anyone have any examples of how they're organizing their Entity structure outside of code?
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?
Does ECS work well with scriptableobjects?
they work fine I just convert them to blobassets
its compatible in the sense you can access them like regular non dots stuff
how do I reference specific entities in runtime?
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
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?
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.
Isn't hasComponent super slow? I guess that's why you mentioned IJobChunk, because you could make a hasComponent one chunk bases.
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 ๐
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?
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.
standard shader means not even shader graph things are allowed? ๐ฆ
or the terrain shader
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
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?
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.
i actually had no idea about that. so entities reduce the spawntime / loading screen time but not increase the performance while displaying them
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
@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.
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 ๐ฆ
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.
And for madlads. don't forget the madlads that's really trying to make a full game out of it XD
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.
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!
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?
any news about the new terrain dots engine ? i heard while back they working on terrain dots system or something
could anyone take a look at my code? For some reason nothing in the update will work
@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).
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
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 ?
I basically only wanna store a map or list of tuples in an component to iterate over it
Where do you download unity physics? I searched in my package amanaager and could not find it.
some packages are hidden in package manager
in short : press at plus button in package manager and write "com.unity.physics"
are pairs/tuples supported by dots ?
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?
@zenith wyvern It does not exist...
I'm looking at the source right now, UnsafeHashMap does have an enumerator
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
What version of Collections?
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
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
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()..
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
hmmm... then the documentation is not up to date either... im gonna restart unity
Appears it's in version 0.12 at least
collections-version 0.12 ?
Hmmm...
Still using 2019.3... that could be the reason
But i thought the packages are used for adding such content to multiple versions
I think you're in for a rough time doing anything with DOTS if you're not on at least 2020.1
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
Thanks ^^ great... so im forced to upgrade my project again xD
The cost of playing around with alpha stuff
it's experimental.. eventually we'll have to upgrade to 2021 I'd expect
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.
@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
that's not necessarily wrong.. I'm just curious how fast you expect dealing with strings to be vs what you're experiencing
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 ๐
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?
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 ? ๐
does anyone know what this is meant to mean?
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
thanks zero
@stiff skiff how do i specficy without burst? do I also lose a lot of speed by doing this?
You change Entities.ForEach.... into Entities.WithoutBurst().Foreach....
Speed loss depends on what the ForEach actually does
I looks for those with one component then does the colorchangelerp
Though you can't really "loose" speed, seeing as it doesn't work right now
true
Still, cant colorchangelerp be a static method?
Do lts versions have acess to the newer dots packages ? Like collection 0.12 ?
I tried but Time gets this under it
pass DeltaTime in as an argument to the lerp
^
Actually looking at that
it still wont work as Material is a reference as well
I think?
so ill need an argument there as well?
No, reference types as a while are not supported by burst
also all the lerp stuff is using old Mathematics
oh what should I use instead?
math.lerp()
unfortunately changing colours of materials is a painful example to start with
this is what I've got after changing it to static
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;
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
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
ill give it a read
and almost everything significant in unity that predates dots is reference types
cough does lts versions have acess to all package versions ? FOr example 2019.4 having the collections 0.12 ?
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
Any idea why my package manager does not find entities ?
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 ?
which Editor version are you using @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"
welcome to whose package is it anyway, the game where the dependencies aren't listed and the complaints don't matter.
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
I think I had a similar error I messed around with the Editor versions
@pliant pike Entity Editor or unity editor versions ?
Unity Editor
wait... praise the lord...
I got it, the damn "Adressables" need to be atleast version 1.16
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? ๐
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())
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
@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);
has the dots blog post happened yet?
the only one I've seen so far related to dots was the jobqueue optimization: https://blogs.unity3d.com/2020/09/21/new-performance-improvements-in-unity-2020-2/
can anyone give me a dumbed down explanation on the difference between ISharedComponent and IComponent?
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
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.
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
that means that Material/Renderer is a managed type
@low tangle nope lol
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)
that makes sense but why can't I use lists?
because Lists are also managed types
or arrays
because List is a class
ohh ty
you can use arrays
I might be remembering wrong then :D.
why are unsafe containers unsafe?
Because you have to manage their memory yourself
gc won't dispose that for you
is there a way to use hybrid somehow to just make a reference to a monobehaviour array when using a system?
If you mean storing it on a component - you can use SharedComponents
They can store non blittable types
@safe lintel 
ty a lot guys
otherwise managed IComponentData
some of the docs available might have what you're looking for @hasty condor
hrmmm is there a way to make a system run once?
like how GOConversionWorld's systems run only once?
I think you can override ShouldSystemUpdate - I think there's a virtual function like that
shouldsystemupdate huh...
ah sorry it's not a virtual function as I thought
I just set Enabled = false inside OnUpdate
does anyone know where to download the experiment.ai?
does anyone know what that is?
never heard of it
can you post a link or something where you got word of it?
there's no such package on registry
that's no package, it's a namespace
that's a namespace.
yeah, it's shipped with Unity binaries already
if it's in UnityEngine, it's in engine itself
I tried again I made a typo
this is also why you found the doc on regular engine docs and not in package docs
it works ty
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?
@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?
Does enabling/disabling systems have perf cost?
Lets say worst case scenario. Im doing it every frame
I'd hope it would be a very small overhead - something you can test?
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
@bright raft to ask the obvious question - you have burst enabled and safety systems disabled?
@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
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)
Noice now I can abuse it for even slighter optimizations XD
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?
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
is it possible to use entity query builders like systems do but from outside a system? like a monobehaviour start() or update() ?
@tawdry lotus yes if I understand what you mean - just use EntityManager.CreateEntityQuery()
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...
you want to... let's say... write MonoBehaviour class and perform stuff from a query?
If yes, you can. through EntityManager
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
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.
does anybody already use unitys build configuration files?
I do/have successfully built but only on Windows and I doubt I could tell you anything useful about them ๐
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
Ther was this blog post back then: https://blogs.unity3d.com/pt/2014/10/02/in-the-labs-custom-build-configurations/
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...
pretty sure they're quiet because it's still ~~experimental ~~preview with a lot in flux
why is it in japanese?
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?
I'm being lazy with my terminology - in preview
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
the main bit that was confusing for me was you have to add a 'classic build' step or something
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
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
I have a custom build step where I create the application version from git tags
so I have to somehow inject this build step
Ah ok - no idea how that works or what issues there are currently with that
the current state looks a bit ecs like as there are components and the build steps act upon them
I'm still trying to understand how to build for android with those XD
like what components must I use
it's a mysterrrryyyy ๐คช
but the components are defined in code:
{
typeof(ClassicBuildProfile),
typeof(SceneList),
typeof(GeneralSettings),
typeof(OutputBuildDirectory)
};```
goddammit unity XD
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?!
@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.
@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 ๐ฌ
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?
I am not currently. But I am just settings up a new project which will eventually use prefab conversion
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.
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
(obviously you can trawl through some of the source code to try and work out what's going on) was what I was going to say before you asked that ๐ - you can extend/modify but I don't think there's a way of doing it without having a local version of the package? That said I did see something about a c# attribute the other day: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.internalsvisibletoattribute?view=netcore-3.1
having a local version of the package?
@amber flicker yeah I thought I might get around this somehow
just good ol' reflection perhaps
mhh that would be the last resort I guess
peaj I love you
its just so frustrating because it worked before
sure hope it works ๐
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 ๐
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
Yeah I'm starting to have a similar set up - would love to know if that works out
problem is that project uses platforms 0.2.0
if it works. devops eccentrics will love it
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
ah right, I forgot the build pipelines had custom steps - I never tinkered with that before ๐ค
there's a get version from git? wow
there's a get version from git? wow
@deft stump thats my custom step ๐
aaah
but it is a great way of updating the version number imho
here is a blog entry about it: https://blog.redbluegames.com/version-numbering-for-games-in-unity-and-git-1d05fca83022
Setting it manually every time you make a commit would be a royal pain.
I agree with this because I'm doing that lol
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 ?
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)
@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 ?
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)
@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.
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.
@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.
Yes. I use ConvertToEntity ๐ The problem is that i trying create my own world. But can't force it to render converted things
@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
@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.
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.
you have the hybrid rendering package installed right?
Wow, there's a new sample in the samples repo for doing AI in ECS. They even go over every step of the design in detail. I hope we see more like this
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
finally an example that looks clean, well commented and relevant ๐ฅณ
(although if I'm reading this right, only the first player will be chased - not sure if that's deliberate - https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/ECSSamples/Assets/Use Case Samples/1. State Machine AI/LookForPlayerSystem.cs)
you have the hybrid rendering package installed right?
@amber flicker yes
Is that example still there @zenith wyvern Iโm on mobile and getting a 404 when I try to view it
Yeah, the link I posted is still working fine for me
Ah copy paste sorts it. Wow this is very in depth
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?
NativeContainers work with blittables only, thus it shouldn't be the case
and it's inconvenient at that
is there a version of AnimationCurve i can use inside a Job?
there is this one: https://github.com/5argon/JobAnimationCurve
but never tried
There is one in the dots animation package
how do I make my own system group?
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.
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
and with that u can use same query with different filters. i see ๐
how do I make my own system group?
@deft stump
[UpdateInGroup(...)]
class MySystemGroup : ComponentSystemGroup { }
noice
okay argh this doesn't make sense
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.
okay...
next problem
Index {0} is out of range of '{1}' Length.
how?
How is 0 out of range of 1 length?
thats because you have burst enabled, limited exception support, try disabling burst from the menu when you are about to see the error
So burst doesn't like a native array of 1 length?
it has nothing to do with array of 1 length
you can think of it like a "placeholder"
aaaaah Now i see what you meant
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
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.
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
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.
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
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 ๐
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
Found some regression I didn't expect. Using SystemBase instead of ComponentSystem causes
Entities.ForEachto ALWAYS mark a chunk dirty for components passed in asref
@stiff skiff in SystemBase you can use "in" instead of "ref" to tell Unity that you are only going to read from the component
any tips how can i generate GUID in burst job?
hmm are there any examples of ICustomBootstrap available to look at?
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.
@sage gate I know, but the issue is for conditional writes
heyo, quick question, Burst supports interfaces now, right?
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.
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
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.
Hello guys. I just wanted to ask. Is it https://www.reddit.com/r/Unity3D/comments/b4ncv2/visual_scripting_is_coming_to_unity_20201/ there? :))
Is Burst and Entities still in preview? Sorry I can't check rn
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 ๐ค
Visual scripting is still be in preview
Mkay.. last time I checked, it wasn't there at all
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
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 )
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.
@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 ๐
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
@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
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
@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 ^^
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
@coarse turtle heres my ICustomBootstrap
https://ghostbin.co/paste/vf6xx
@coarse turtle heres mine
https://ghostbin.co/paste/vf6xx
@low tangle thanks ๐
np
hai hai, how can one get the timings of a specific job from the profiler?
(with script)
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)
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)?
@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#
@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
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.
combining gameobjects with ecs works completely fine on Entitas, but its kinda designed around that
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.
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
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.
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
then i should create hashMap and set data by EntityManager at main thread?
searching over hashmap is faster than searching over integers array?
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.
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
@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. ๐
It's doable though depending on what you are working on https://github.com/Unity-Technologies/ProjectTinySamples.
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
nope
lol, dont know why I thought you might be able to.
I tried lol not so long ago.
but both EM and ECB just noped out
lol, well. oh well
can the fields of components be other components?
hmm
seems like you can so far.
@tight blade could you not have all the fields be arrays and use that to simulate multiple instances?
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?
is there a way to get something I can ForEach out of an EntityQuery?
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
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
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?
You can access/modify the data of entities by using ComponentDataFromEntity<T> or GetComponent/SetComponent inside system base
can i get someone's opinion on my architecture plan?
@north bay with EntityManager? with ScheduleParallel?
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?
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.
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
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
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.
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
"just have a component which has 3 prefab fields that are referenced when spawning occurs"
I'll go for this approach.
thanks
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
confound it, what is the name of that annotation that lets you alias the authoring components in the "add component" submenu?
"AddComponentMenu". found it!
does DOTS support conversion of Tilemap Renderers? or Polygon Collider 2Ds?
Nope nope
Sed sed
is it possible to somehow manually do this conversion in some reasonable way? or should you pretty much not use these with DOTS?
@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?
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 ๐ค
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)
2020.2's reorderable list is a godsend
but it only works with some types
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?
@visual mist LocalToWorld, WorldRenderBounds, RenderMeshSystem if you don't use default world bootstrap
ah, any keywords to look up the bootstrap?
if u don't implement your own bootstrap with ICustomBootstrap then it is not about your problem
ah I needed RenderBounds!
if you will use conversion with meshes that can be converted then it will auto generate all needed stuff for rendering
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
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?
i've found this to switch based on T https://docs.microsoft.com/en-us/dotnet/csharp/pattern-matching
but what to do with return type?
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
}```
T isn't a struct it is float or int
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;
ah i missed that. whoops
@coarse turtle yes but how to pick which to use when i don't know type of T ?
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
yeah - what Scorr stated
i have T but don't know if it is int or float
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()
hm, let me test it
float/int are struct
struct just short hand for value type
and they are value types
surprise for me i was thinking it is a primitive types
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
https://docs.microsoft.com/en-us/dotnet/csharp/pattern-matching works for me in a bursted job
oh it does?
just tested
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
thanks have to learn about unmanaged unsafe code is a black magic for me ๐
oh right need unsafe also
well this should work... i think
didnt test it but well
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?
@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.
@stiff skiff if you see a generic solution without unsafe code please let me know how to do that
It doesn't make sense to use generic when you already know the type
i agree with zeroZshadow and Bruno here... but i just answered the question ๐
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
lightmapping with hybrid renderer hopefully coming in the 2020.2 release cycle - https://forum.unity.com/threads/hybridrenderer-subscenes-lightmapping.976932/#post-6352881
Also who was it here who was very keen on a more reactive way of working with ecs? https://forum.unity.com/threads/component-remove-add-tracking-and-per-component-enable-disable-systems.978018/ - Joachim: "I think this is a good temporary solution until we have builtin support for Enable / Disable component built into the core of Unity.Entities."
@normal hound the netcode examples in the docs are out of date
use unity 2020.1 and the code from here https://github.com/Unity-Technologies/multiplayer/tree/master/sampleproject/Assets/Samples/NetCube
What is the common technique to react to collision events ? Should we mark entitie as "CollisionStarted", "CollisionStayed", "CollisionExited" by ourself ?
@stone osprey have you watched this? https://www.youtube.com/watch?v=68sUTX7rQiA
Join Our Community: https://student.dapperdino.co.uk/
Just Here To Plug My Social Media Stuff:
https://www.patreon.com/dapperdino
https://www.twitch.tv/dapper_dino
https...
@shy pilot Well i skipped trough it... looks like he is only writting rotation systems ^^
@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 })
ah i see
Atleast it would be pretty flexible... Entities.ForEach((Player player, CollisionEntered ce, OnCollisionExplode explode) => {});
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...
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.
@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"
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
@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 ^^
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)
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)
youd have to add some component to the parent though, like a marker, right?
otherwise what would you be querying on?
Yeah you'd need some kind of marker/component attached
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
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.
yeah, thats more or less what Im doing
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.
@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 ๐ฉ
Created another thread in the dots sub forum: https://forum.unity.com/threads/custom-build-step-with-platforms-package.978585/ but still no response
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?
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"
I would choose marker components over state
But
If we just have a few entities. State components are fine too
@deft stump Thanks ! Is there a reason why you would choose marker components ? ^^
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
Alright, thanks ^^
statecomponents do mess with performance if you have to many though
So don't overdo it there hehe
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 :/
please can someone help me find the damn packages?????? The tutorials I find say to go here: https://docs.unity3d.com/2020.2/Documentation/Manual/pack-preview.html and copy the git url , but now unity removed from there too
You should just be able to copy the name of the package into
the name being com.unity.kinematica for example
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
@graceful mason
list
they already got preview tag, is that not enough ๐ maybe they need a experimental tag too for the bants
but thats amazingf thanks
they just don't know why people are installing experimental packages so they removed it from listing straight out
well the packages are fairly mature, way easier to use than install
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
Hi guys. I'm trying to build something using ECS. Is "too many components per entity" a thing I should worry about?
no
but design wise, you do want to attempt to reduce them
but there are no issues with having lots
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
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
@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)
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
is it safe to use optional types with the Burst Compiler (like float? myFloat = null;)
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
dont think they are supported @craggy orbit
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?
Hybrid workflow is still availablr
what is dots
There are pinned messages that would explain this
@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
@deft stump ya, found a more decent tutorial on unite video, thanks
@zinc plinth oh any idea why its not recommended
perf cost
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.
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))
@amber flicker Alright thanks, thought theres already some sort of build in functionality ^^
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
is it anymore cheaper than ecb?
@amber flicker Well something like "ReachedLocation : IComponentData, IOneFrame" would be great ๐ but probably this is a bit too much...
@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
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
nope.
very experimental.
thanks (:
its ready if you are an insane madlad ๐
i tried converting megacity's audio to the latest dspgraph, oh god that is a proper descent into madness
@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"
oh wow ! okay, ty for the info!
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...
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...
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
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.
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
heres the wiki
https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki
and may God have mercy on your soul.
Maybe it will help that I generally dislike OOP.
i for one am glad Topher is still alive.
watching this "Understanding data-oriented design for entity component systems - Unity at GDC 2019" video
Love it
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.
@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)
Yeah that's what I've been looking at. I'll dive a bit deeper in to it, then - thanks!
your welcome :)
@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.
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...
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?
@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 ๐
yeah, I've always wanted to get into them but never have also.
is anyone here using netcode?
this particular use case is just pointless enough that I may be willing to invest time in it
can someone tell me if a client can delete an rpc entity that it has recieved?
@ionic pelican that link is from an old branch fyi, that repo is updated with current releases. i havent done a diff but heres the latest version of that file https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/a319c0da6c6a55baadc31c10c8120a28e959766b/UnityPhysicsSamples/Assets/Common/Scripts/DemoInputGatheringSystem.cs
@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
@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
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.
@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
@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
does anybody at all know if a client can delete a recieved rpc?
@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?
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.
I like the paradigm and data oriented tight packing, loose coupling of state to logic in general
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
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
as for me personally? I make jokes, but I very much intend to make something you will have heard of in 2 years time.
@low tangle aw man really?
Im actively working. check out my sweet waves, dog.
https://youtu.be/fK7Nuj-xNhc
thats linear memory access being put to work
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
@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
the fast majority of my performance was getting sucked up from the copy in copy out
@tight blade that's sick lol
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
@low tangle the constant loading bars have been a pain for me ๐
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
that may be one of the reasons they went public
thats a tall order for traditional development or flat ecs
they just don't have the funds for this sort of total rewrite
at least that's my understanding
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
@shy pilot that'd be surprising to me...Unity is a pretty massive (>$1bil) company
unity feels like its held together with tape sometimes
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
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
and now they're torn between writing dots and keeping the main engine afloat
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
i know
I'm sure there are internal struggles though
@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 ๐ ๐ซ
but instead of having the whole of unity working to maintain and develop one product
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
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
so theres some internal friction with DOTS getting the lower priority I think
yeah
kinda makes sense with the slower external releases?
i mean the srps have a bunch of issues on their own without factoring in support for dots ๐ฉ
yep
and the whole making them compatible with each other.. wondering how thats gonna pan out
choose your technical debt wisely
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 .__.
Yeah, I think an ECS engine for the masses would be industry-changing
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
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 ๐
theres a lot of engine there behind why you still have to have those objects
Is it mentioned anywhere what the different NativeArray allocators are doing behind the scenes, and what are the pros/cons for each of them?
I think temp job lasts 4 frames, temp 1 and persistent forever @glossy summit so the most important thing is lifetime but https://www.jacksondunstan.com/articles/5406
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 ?
@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)
yeah
pretty sure I can finish my ecs engine before they get it stable
but its not really the same thing
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
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
has anyone got the non guided-tour examples to work with Data Flow Graph?
@amber flicker whats the guided tour examples?
examples that come with the DFG package
oh thx didnt even know about that
yea, it's very little known at this point - no docs or anything
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?
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?
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?
check for a .AsNativeArray()
@low tangle there does not seem to be an AsNativeArray method in the BLobArray class
only ToArray()
I think ToArray makes sense seeing as the data should be immutable?
the problem is Manager.DestroyEntity needs a nativearray in order to destroy all the entities
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
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?
Are you recreating the work of subscenes somewhat I wonder?
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
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.
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
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
mhh I thought blobasstes would be great as they should not change after creation
but maybe they are more trouble than they are qorth
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).
well then I have to look into the dynamicbuffers. didnt use them yet ๐
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.
@stone osprey to me it seems like they are trying to work around the core concept of ecs