#archived-dots
1 messages ยท Page 124 of 1
if anything RooBubba's using a future version afai can tell ๐
I was using 0.2.2 preview 7 but have switched down to 0.2.1 preview 4 following timboc's pic up there
restart unity?
yeah I'll kill the library again too sec
and ultimate advice, delete library folder ๐
yeah already did that before, will do again now I've 'downgraded' some packages
Dreaming of the day when UPM can figure this out on it's own
I can only imagine the unholy hell of trying to code a package manager
WOO we're there, I'll have to rewrite a load of old JobComponentSystems now in the new style with SystemBase but that's all manageable. Thank you very much for your help, @amber flicker @zenith wyvern @warped trail
but first, another backup ๐
Glad to hear it.. obviously not good that happened but good if you can get going again
well you expect a certain amount of this with preview packages, it's all good ๐
yes.. I have my own nightmare to track down... it would appear CreateAdditionalEntity on conversion not actually creating any entities in a very specific scenario (but works fine in another project) so I think some nightmarish timing issue
yikes. I ended up making a big chain of systems for loading time where each one runs once on an event component being present, deletes it then creates the next component in the chain
works surprisingly nicely even if conceptually it's horrible ๐
Entity archetype component data is too large. Previous archetype size per instance {archetype->InstanceSizeWithOverhead} bytes. Attempting to add component size {componentInstanceSize} bytes. Maximum chunk size {chunkDataSize}.
Uh, help
put smaller/less components on your archetypes perhaps
I can't
Your component is too large to fit inside a chunk
Your archetype rather
If your entity has dynamic buffers on it you can add [InternalBufferCapacity(0)] to force it to allocate on the heap so it doesn't impact how much space in the chunk your entity takes up
It does use dynamic buffers, more specifically 2-capacity (Entity), 1024-capacity and 2048-capacity (double).
But heap is slower, right?
Is there no way to make chunks bigger?
I don't think so
So many gosh darn limitations
2 whole days of drowning in errors
Well, that worked
Thanks a lot
Nice, I reverted my file quite a long period of time back in time to get a function I removed for some reason
But then I couldn't revert back into the present
Even though I did not save changes after arriving into the past
I love Visual Studio
Ouch
@frail seal the point of dynamic buffers is for them to be very small
if they are large they shouldnt be dynamic buffers, but more stuff like native-list
as a rule of thumb, the smaller your components, the better the ecs works
I practically wasted 3 hours
But you can't attach a nativelist to an entity
you cant?
Unless I'm missing something
If you need a resizable list on an entity, Dynamic Buffer is the solution
But heap is slower, right? chunks are on the heap too; its just adding one more ptr dereference.
true, but its still fast i think
yeah with the amount of hoops the defualt collections jump through already with their access methods i'd be surprised if the difference is significant.
But you can't attach a nativelist to an entity true but you can add an UnsafeList to an entity. It might be faster to manage it yourself but DynamicBuffers are basically the same thing with added benefits like being automatically deallocated.
i heard this a lot of times DynamicBuffers being automatically deallocated but i don't fully understand this ๐ค
I haven't tried that, is it really as simple as just adding Unsafe* as a member of the component struct? You don't need pointers or anything?
DynamicBuffers is basically just component, why do you need to deallocate component๐ค
@zenith wyvern they have been adding "Unsafe" prefixed versions of the collections in recent versions; most of the safe versions now are just wrappers around the unsafe version and add safety. UnsafeList can just be a member of an IComponentData and exposes all the same list methods you'd expect.
The only difference being you have to manually call dispose before removing the component?
exactly
Huh, good to know
I thought you would still have to use pointers with the Unsafe version of the containers so I was too scared to use them, hahah
@warped trail yeah if you go beyond the default size allowed for a dynamic buffer in a chunk, then it copies the data out elsewhere and all the DynamicBuffer methods can auto switch between in and out of chunk locations. So if you've forced it to go out of chunk, then its been 'allocated' and needs to be free'd at some point. When chunks remove entities, they have to go through and deallocate any space the buffers might have created. Its just going through every buffer component and calling Dispose() on it.
wait, you don't have to dispose fixel lists๐ค
FixedList is "faking" a resizable list
It's always a fixed size in memory regardless of how much you add to it or remove from it
Same as FixedString
wait, im just confused๐ You can add unsafe version of NativeList to components?
A dynamic buffer isn't nessesarily fixed. It does have some fixed space set aside in the chunk for it to use.
but if it needs more than that amount, it then starts pointing to a location elsewhere.
if you remove enough items, then it goes back to using the chunk space again.
@warped trail yep you can - you do lose some serialized debugging in the entity debugger tho
the default is actually quite small unless specified, most people will be using non-chunk dynamic buffer space id wager
I thought Unity would need to know the exact size of the component to properly fit it in a chunk. I thought that's why you need to explicitly specify the "default" size of a a dynamic buffer
So it can move it out if it needs to like @mint iron described
So I'm confused how that works with UnsafeList
I guess that's why it's called UnsafeList. But I don't think ECS actually needs to know component size, they just fill in entities into the component until it's filled, then create a new chunk
0.2 ms too (9 nodes)
@vagrant surge I didn't check it yet, seems to be yet another DOTS game project
the actual component data a DynamicBuffer uses has BufferHeader https://pastebin.com/raw/72bLEAK6 but then is directly followed by the in-chunk space reserved, so you need to stride with the SizeInChunk from the IBufferElementData's TypeInfo
I wouldn't be surprised if it's just some quick demo
(or something propagated from hackweek)
500 nodes is only 7 ms, DOTS is awesome
@zenith wyvern UnsafeList is basically just a pointer stored on the component to a list, which is a constant size
the actual contents will never be in the chunk
I can finally sleep
@hollow sorrel Ahh okay, thank you
Nice one @frail seal - hope itโs faster than your old version ๐
About 10x faster
That makes sense, then I guess in that case you don't really have your data nicely laid out in memory
Malloc likely calls the C like implementation - so it's likely just pointing to a place on the heap too
@vagrant surge I am running 3 foreach loops per frame, within each I loop 1024 times per entity - I either grab values from other entities and store them into buffer or do maths between buffers of a single entity
Something like that
thats a looot of loops
Yup, I am doing sound generation after all
Via node tree
Basically a synth, but digital instead of analogue
yea that's why dynamicbuffer lets you choose
when you iterate a component with a dynamicbuffer in a system ForEach and you're only touching the component data + buffer data, if it's all in the same component array it should be slightly faster than looking up a seperate array outside the chunk
I guess using UnsafeList would be similar to just using DynamicBuffers that are always allocated on the heap then? Except you have to dispose it yourself
yeah pretty much
ah, thats absolutely not an ECS thing @frail seal
thats the sort of thing you sholdnt use the ecs for
i think dynamicbuffer handles serialization for you tho if you're using that and unsafe versions don't
In pursuit of performance, DOTS community slowly adapting assembler
but just direct jobs and burst api
Thanks for explaining so clearly, feels good to learn things ๐ค
thats jobs or burst, ecs is not needed for that
An IJobParallelFor will still run in parallel and gives you better control over batch sizes per thread
@frail seal the ECS is a "bag" data structure, you use it when you have tons of systems you want semi-autoparallelized, and have quite changing objects with different sets of components
if you have a given "algorithm", its not a good idea to use the ECS for it
just use the jobs api for the muleithreading and the burst compiler stuff, and you will get quite better perf
because you have more control
@frail seal ecs has a lot of overheads that are intended to make it flexible (chunks, adding/removing components), if you're doing something that needs extreme performance it would be faster to write something specialized and then run it in burst jobs directly without ECS.
as an example, instead of having your stuff as entities, have your stuff in a contiguous array
and to connect stuff to each other (graph), use int IDs to that array
this will be much faster than having entities accessing other entities
DOTS = ECS + Burst + Jobs.
@vagrant surge So I should just store all my data in multiple NativeArrays, where each one represents a component of my node or something?
indeed. But that depends on your algorithm
I am quite shaky at the moment with understanding where ECS's performance even comes from, so I am not sure how I should even organize my data
ECS perf comes from burst and jobs, and from linear data layouts
when you do a query (for-each), the layout of the components is generally equivalent-ish to structure of arrays, contiguous
components are on arrays by their type
entity ID is used to index into them
also chunk layout stuff. Takes a while to explain, so better to just watch one of the many unity talks about it
rest well - nice work making the progress you have so far
Is there an issue with Jobs preview package 0.2.7?
0.2.6 works good. I update to 0.2.7 and I can't compile. The compile error isn't from my code
is there a Unity forum for Jobs. I'm having issues locating it
0.2.7p11 works for me, could be other dependencies if you upgraded them manually
the dots forum is the forum for jobs
notably there is an issue with properties if you changed that to the latest instead of what the various dots packages rely on
@safe lintel thank you for all this
the issue might be that I don't have the DOTS package
I'm just using Jobs and burst
dots is just an umbrella term for those packages(as well as entities etc)
I thought they have a package called dots now. Maybe I'm getting confused with entities. I slimmed it down when I was trying to figure out what was causing some crashing issues
well somewhat confusingly there is a package called dots editor, which maybe should be renamed entities editor but im just the messenger ๐
haha yeah
mm yeah you're right this is a dependencies issue
unity.collections doesn't have the right dependencies
anyways I'll figure this out
thanks for your help
pretty sure Ive read at least a few complaints on the forums with other people running into this
I have to use the Burst preview and not the release burst package I think
but Jobs package doesn't enforce this dependency
Is the physics debugger supposed to not work while the editor is playing?
Physics Debug Display?@zenith wyvern
it needs to be converted to an entity
Yeah I mean how it shows colored boxes for all the physics shapes - it's only showing until I press play
They are entities
damn i just screenshotted mine ๐
yeah, the physics debugger only shows before you enter play mode because they are physx objects prior to converson
I feel it would be better to just use physics shape and physics body instead to make it more clear
it shows what it gets created to in editor though as a wireframe
well, it's not 100% accurate still
Now to figure out why this is happening
using the new authoring components that is
or are you talking about the new physics debug display script?
@zenith wyvern i suggest to use Draw Collider Edges๐
me? if you use the authoring shape, it shows the actual dots collider, not the physx equivalent
Not sure what this means
are you just using the stock authoring components? hard to tell from a debug display
also the debug display is kinda irritating with the clipping
don't use draw colliders๐
I am for the one on the right, the one on the left is dynamically generated. It looks like the collider it's ending up with is malformed
Has anyone used MeshCollider.Create from the physics package?
might be the mass component and the center of mass?
Hello. How can i find Animation package in PackageManager?
This package is existed in DotsSample Project
add it manually through the packagemanifest
YourProject/Packages/<something like manifest>.xml
OK, Thank you
Getting close. I set the center of mass to the center of the object but it's still...not right
I dont fully understand what ive been doing ๐ but ive been using
var massProperties = MassProperties.UnitSphere;
var kinematicMass = PhysicsMass.CreateKinematic(massProperties);
var dynamicMass = PhysicsMass.CreateDynamic(massProperties, body.mass);
Hello, I have another question. If I spawn a Gameobject attached with Convert To Entity script in runtime. Will the Entity be only spawned in World.DefaultGameObjectInjectionWorld ?
yeah
Yay, it works. I was giving it a nonsense center of mass. Thanks @safe lintel @warped trail
I had some really strange ragdoll results until I started using that ๐
Do you guys know how to get Entity's unique ID in the world?
entity.Index
isn't Entity itself a unique ID ?๐ค
its actually not i think, since entities are reused, their ID is same, but whenever they destroyed and reused their 'version' increments
When was i ever wrong ๐ค
but you can't have entity which points to different tables at same time?
does HybridRenderer support Built In Pipeline?
It does right now. Moving forward I think they will only support srp
that mean ECS with Built In is not a viable choice ?
If you want to benefit from future updates to hybrid renderer then no, I would not go with built-in
If I remember right the new v2 doesn't support built-in shaders
@dull copper Would know most likely
Are there any character controllers available made for DOTS?
Thank you so much ๐โโ๏ธ
Can I turn off a System within code with an Attribute like UpdateAfter? Didn't find anything searching the code ๐ค
there's [DisableAutoCreation] if you want it to not show up in the world.
^yea that
@naive parrot @zenith wyvern that's true, hybrid renderer v2 is only for SRPs
and we'd expect v1 to be deprecated
that being said, nobody forces you to use hybrid renderer at all if you just want to use entities, but it does make some things more convenient
Thanks @mint iron it works ๐
is there a parallel version of IJobNativeMultiHashMapMergedSharedKeyIndices
there each hashkey gets divided into a parallel job
rather than 1 thread per hashkey
@digital kestrel I haven't worked with it, but your question doesn't seem to make much sense?
You're saying each hashkey gets divided into a parallel job. Aren't they running on different threads?
The first installment of our 2020 roadmap is coming soon! Join us this Wednesday at 9 am PDT for our Unity 2020: Core Engine & Creator Tools roadmap session.
We know you'll have a lot of questions about the roadmap, so we're hosting a Q&A on the Unity forum. Product experts f...
new Tiny package ๐ฅณ
new burst though looks minor
- Double math builtins in `Unity.Mathematics` now use double vector implementations from SLEEF.
- Fixed a bug with `lzcnt`, `tzcnt`, and `countbits` which when called with `long` types could produce invalid codegen.
- New F16C X86 intrinsics. These are gated on AVX2 support, as our AVX2 detection requires the AVX2, FMA, and F16C features.
- Add user documentation about generic jobs and restrictions.
- Add new experimental compiler intrinsics `Loop.ExpectVectorized()` and `Loop.ExpectNotVectorized()` that let users express assumptions about loop vectorization, and have those assumptions validated at compile-time.Enabled with `UNITY_BURST_EXPERIMENTAL_LOOP_INTRINSICS`.
### Changed
- Changed how `Unity.Mathematics` functions behave during loop vectorization and constant folding to substantially improve code generation.
- Our SSE4.2 support was implicitly dependent on the POPCNT extended instruction set, but this was not reflected in our CPU identification code. This is now fixed so that SSE4.2 is gated on SSE4.2 and POPCNT support.
- The popcnt intrinsics now live in their own static class `Unity.Burst.Intrinsics.Popcnt` to match the new F16C intrinsics.
- Deferred when we load the SLEEF builtins to where they are actually used, decreasing compile time with Burst by 4.29% on average.
### Fixed
- Fix an issue where a generic job instance (e.g `MyGenericJob<int>`) when used through a generic argument of a method or type would not be detected by the Burst compiler when building a standalone player.
- [DlIimport("__Internal")] for iOS now handled correctly. Fixes crashes when using native plugins on iOS.```
ah, these are not in the bintray
gotta come up with some way to poll the new registry :p
there was some commandline tool that let you browse even bintray in past
anymore remember what it was called?
I do like this one: ```Add new experimental compiler intrinsics Loop.ExpectVectorized() and Loop.ExpectNotVectorized() that let users express assumptions about loop vectorization, and have those assumptions validated at compile-time.Enabled with UNITY_BURST_EXPERIMENTAL_LOOP_INTRINSICS.
yea, likewise
oh hey thats super useful
Almost more curious if the roadmap talk is some dude in his house doing it or if its like in a professional setting than the roadmap itself at this point
๐
also about the burst vectorizing thing, I think the burst debugger / whatever it's called already tells on 1.3 if it failed to autovectorize something but it's not as straight forward than directly throwing a warning to users about it (I haven't checked if it does output it on console with this new thing)
my point being, it was possible to tell if it succeeded in past too, but they probably made it more convenient now
@dull copper did you get a chance to try out that repo for TheHardestGame? just noticed its gone, was gonna try it today
huh
I think I cloned it but I think they pushed some update after it
but I should have the first version locally here ๐
I tend to grab these asap in case they do things like... immediately remove the repo after ๐
yeah I meant to but just also lazy ๐
they used internal registry for it's packages
I can check if we have access to these without
also wonder if the new registry we now use is on this same server: "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
haven't checked if the IPs match :p
but yeah, that game doesn't seem to even use bleeding edge packages, it tries to use one older collections package that doesn't exist but I'm sure it can be replaced by some other version
gonna miss browsing bintray
I'm currently trying to figure out a way to list the current registry here :p
it should be a npm registry, you at least could list bintrays contents using some nodejs tool
so while there's no bintray, if it's a public access registry and uses same protocol, one should be able to list the contents without unity package manager
got the packages resolved finally from that hardest game thing:
I have a relatively simple but large world. Think rimworld (or pokemon without the forrests). so large open terrains and in between I have maybe mountains that are a plateau for themselves, i.e. I can only access them from certain directions. What would be the cheapest way to do pathfinding in dots? is there something implented already?
I want a lot of entities but since the terrain does not change to often I could precalculate some stuff if that is possible
omg ๐
I can tell this game is impossible
looks like a gamejam project
thats why it is called hardest game ๐
just go up or down
yeah, I tried ๐
Wow, kiss goodbye to your Gamer Cred
you can't even position the player so precisely that it would be in right place for that
๐
this would be hard even in slow motion
it is kinda easy really
he says without playing it ๐
yeah, it was totally easy on my mind too
I totally get how you should move to zigzag through that
oh wait
it's using simulationgroup
so it's tied to framerate :p
I put fixed timestep to 10x slower and game crawls now
so I don't think I got even fair chance :p
this is so broken ๐
basically player movement is tied to framerate
but those moving blocks are not
Did anyone try the update project tiny samples?
The runtime mesh one doesn't work for me
I remember this game
works fine๐ค
Are you using the same version of unity they made it with?
but i guess you can't run it in editor at all๐
Oh
latest 2020
Yeah if I do a manual build it does work, weird
30 mins until stream ๐
The first installment of our 2020 roadmap is coming soon! Join us this Wednesday at 9 am PDT for our Unity 2020: Core Engine & Creator Tools roadmap session.
We know you'll have a lot of questions about the roadmap, so we're hosting a Q&A on the Unity forum. Product experts f...
it is not weird at all๐
As far as I know we are supposed to be able to run these in the editor
i guess this part is in heavy development๐
...has no dependency on the existing UnityEngine. Our goal is to ensure that if a project is compatible with the DOTS Runtime, it also works in DOTS Hybrid / Unity. (Weโre not there yet.)
oo that's cool
not so cool, if you want to test things in editor๐
things that will work in editor, won't work in build and vice versa
but it is cool, that i can build and play tiny project faster, than i can compile and enter playmode in classic Unity๐
for an example of that taken to the absolute limit, check OurMachinery
ECS runtime, and the entire engine itself is a bunch of plugin dlls
the editor is just a standalone app that loads this plugin dlls (including your game dlls) and has the whole editor thing, but you dont need it at all, and could ignore it enterely if you wanted
Yeah the other samples work fine in the editor so it just seems like a bug in that specific sample
i don't think it is bug๐ค
Then why would the other samples work but not this one?
because Tiny has their own renderer which don't work in editor
It does work. It works fine in every other sample...
so you have authoring components, in editor conversion system converts them to Unity hybrid renderer, in dotruntime they convert them to different renderer
just look at package code
at runtime they use glfw for input and window management and bgfx for rendering
5 minutes to roadmap talk ^
is project tiny thought for 2d games in general or for ads?
and unity mathematics offers no matrix operations does it?
when i initially saw tiny it seemed aimed at ads and I was like oh hell no! but now im assuming more and more its an efficient alternative for 2d in general(when it matures)
also, supposed to become the de facto way to publish for web eventually
@warped trail I can run the Tiny3D racing sample in the editor. It renders fine, it plays fine. I cannot run the runtime mesh sample. They are both using the same renderer. If one of them doesn't work, how is that not a bug?
Tiny is not just for 2D, they are making it for lightweight 3d as well
and unity mathematics offers no matrix operations does it?
@junior fjord
Yes it does, float4x4 is identical to a Matrix4x4
stream started: https://www.youtube.com/watch?v=dDjsS4NPqFU
The first installment of our 2020 roadmap is coming soon! Join us this Wednesday at 9 am PDT for our Unity 2020: Core Engine & Creator Tools roadmap session.
We know you'll have a lot of questions about the roadmap, so we're hosting a Q&A on the Unity forum. Product experts f...
still counting down
when you run Tiny3D racing in editor it may look the same, but is not the same under the hood
@zenith wyvern oh great
This roadmap looks on course to take an hour tell us what we know already.... ๐ง
well, we know most of the things already :p
but we don't know the new estimates for the feats to land at
most of us here keep up with this stuff but id expect a majority dont
oh snap
crap
yeah
bloody hell
):
they make another demo shooter? ๐
they want that sweet battle royale money
New resolver ๐ฅณ
But pretty happy that they're working on stability/UX rather than new features
Ooh Performance Counter API ๐
mmorpg checkbox plzzzz ๐ค
Haha the FPS code is barely working as is
And I think they focus on RTS and Fighting games first
Huh. I remember a time when they said they would never support runtime recompiling
With Burst and LiveLink it's a lot easier tho
I'm guessing burst enables them to do this
I think that's the idea behind livelink
why there is no word about Visual scripting only for DOTS ?
isnt visual scripting only for DOTS by unity? ๐ค
I havent tried that package yet
yes
the point was more like, they could have mentioned it's for DOTS
people who have not followed the development and watch this stream may think they can use it for regular monobehaviours
hierachy folders, wow
so instead of parenting transforms to organize, we could use folders?
That's great. Too many people use GameObjects like folders already without thinking about the performance cost
ah, they are bringing kinematica still to dots
wait I missed the hierarchy folders - what does it do? ๐ค
kinematica, is that even available as preview?
i know right
so they will release kinematica before DOTS animation?
yeah, thats nice. I wonder if its a step in the direction of GOs without transforms someday
just a folder apparently @coarse turtle , i would assume no gameobject involved
ah - that's cool
"still in early development"
I wonder what happened to Cinecast ๐ค
this talk could have been just the slides
That's a lot of cameras, but I wonder if they're all rendering ๐ค
its mostly just reading the slides slowly over an hour
@wooden canopy you haven't seen earlier unity roadmap talks?
it's always going through slides
yeah but I think they explain a bit the bullet points
well, they usually got other talks for this
this is for giving an overview of the roadmap
maybe the speackers moving on the stage entertained me a bit ๐
IMO it's always the best talk ๐
speakers
well, main dots talk has been quite good usually
too bad we didn't get it now for gdc
that's pretty cool
tbh I was hoping for a bit more than 5x ... but still.. it's in the right direction ๐ - I'm greedy
Did they even mention URP with hybrid renderer?
true - they're missing a lot currently I think
wow.. netcode.. vague
so yeah, there wasn't really much info about dots at all
@amber flicker He did state like 3 times to watch the other video on the 1st ๐
haha - I was only half paying attention.. his voice is getting a little monotonous now haha ๐
If you wait a bit you can put the speed to x1.5 ๐
they've also almost totally omitted targets for the in development things
they've mentioned some targets for things that have practically landed already
but they are way more cautious now for giving estimates of future work
did they say anything about ui elements and "full" DOTS?
no
he keeps saying "and finally" which keeps making me think its over ๐
Yeah lol
Done
alright it really does look over now ๐
Unless, after summary he says 'and finally' again
damn wanted more dots talk ๐ฉ
ยฏ_(ใ)_/ยฏ
heh, they moderate each question(?)
This message is awaiting moderator approval, and is invisible to normal visitors.
yea - you would have thought they could auto-remove requests for free dark skin ๐คฃ
Isn't that already out though? ๐ค
free dark skin is out?๐
for students it is
I didn't know that actually.. makes sense to get them hooked though ๐ฌ
first answered question haha
Hello. I have noted that on ConvertToEntity script have a Convert and Inject GameObject mode. What does this mode do?
It "attaches" all the monobehaviours on the gameobject to an entity without destroying the original gameobject. The monobehaviours can be queried from ECS like normal ecs components
Thank you. Where can I find some example about this?
about query monobehaviours in ECS
Then give us some proper documentation/usage examples on Subscenes
I thought subscenes were just supposed to be used for static stuff, like environments etc 
And isn't ConvertToEntity needed for things like the camera right now which has no ECS equivalent?
I am thinking how I can access animator in ECS if using Convert and Inject GameObject
about query monobehaviours in ECS
@south falcon
After you "ConvertAndInject" your gameobject you do
Entities.WithoutBurst().ForEach((Animator animator)=>
{
// Do whatever
}).Run();
can't wait for better story around prefabs + dots very soon ๐
huh
I posted my message when there still wasn't any posts
and it's still waiting for moderation ๐ค
ah, was commenting to the roadmap forum threads QA
@digital scarab is there any documentation on what happens with the camera now?
how can I get magnitude of float3?
math.length
thx
?
Hey @digital scarab is that true for 2D Entities too with the texture?
You declare the Texture as an Entity and attach a ComponentObject to it?
ooo I hadn't seen that example. I was just thinking it'd be nice to get some gizmos in DOTS
this is only for Tiny2D, isn't it?๐ค
Seems like it - I'm just checking out the 2D Entities package docs lol
I don't think UnityEngine.Object can exist in Tiny runtime
^
Whatever they're using to represent textures it's probably not a HybridComponent
no dependency on the existing UnityEngine ๐
Right ๐ค
Turns out, I shouldn't have used node tree at all.
.NET already has an expression library, which can compile "expressions" into lambda functions.
God. -_-
So, now I'll be writing my 3rd attempt at fast digital sound synthesizer.
@digital scarab I was more annoyed that the hybrid camera that gets auto converted/added/whatever isnt really mentioned anywhere, and after upgrading the package it doesnt use the settings of whatever the main scene camera had(even if it was the only camera in scene).
kinda spent more time than id like to admit trying to figure out what was happening given that the companion object is hidden from hierarchy, so after an upgrade I had a convert&inject camera not rendering by default or using postprocessing/urp renderpasses and seemingly no other changes other than the entities package.
ah so I took a look at 2D Entities package, I guess Textures and Materials are stored as ISCDs
@zenith wyvern If I using "ConvertAndInject" and have a self-create-mono script MyScript on gameobject, is that the as same way as accessing animator?
@south falcon cs Entities.WithoutBurst().ForEach((MyScript myScript)=> { // Do whatever }).Run();
Yeah
@warped trail @zenith wyvern Thank you ๐
anyone else's project take >2 minutes to re-import every time it's opened? using 2020.1.0b2.3333 and I only have a handful of small textures and scripts in there.
Maybe it's always this slow and I'm just noticing because of the timer for all blocking processes Unity's added recently
how does one destroy an entity in an entity query? (or flag for destruction at the end of this frame)
well, i do, but my pc is potat
I think its just the timer
@glacial widget cmdBuffer.DestroyEntity(...)
just timed a non-DOTS project on 2019.3.5 that was about 1/3 my other project size and it took about 1/3 the time
the cmdBuffer will playback in a CommandBufferSystem at the start of the next frame depending on the system group it is a part of
i don't think next frame is correct ๐ค
you mean EntityCommandBuffer? how do i get a handle to that? or do i just make a new one with a contructor?
if you record command to BeginSimulationECB in initialization group it will playback in current frame ๐
World.GetOrCreateSystem<BeginPresentationCommandBufferSystem>() if your system is in the PresentationSystemGroup or use the simulated one if its in the SImulatedSystemGroup
which group is a regular ComponentSystem falling into? ๐ค
uhh by default I believe SimulatedSystemGroup
@glacial widget cs BeginInitializationEntityCommandBufferSystem ecbSystem; protected override void OnCreate() { ecbSystem = World.GetOrCreateSystem<BeginInitializationEntityCommandBufferSystem>(); } protected override void OnUpdate() { var ecb = ecbSystem.CreateCommandBuffer().ToConcurrent(); Entities .ForEach((Entity entity, int entityInQueryIndex, ref LevelComponent levelComponent)=> { ecb.DestroyEntity(entityInQueryIndex, entity) }) .ScheduleParallel(); }
so for the last piece of information, is there a query that has an entity handle so i can feed it to the buffer?
trying to do something as simple as
i don't understand what you mean๐ค
problem is this kind of query only has component handles
i edited code๐
oh, it comes as an optional argument ๐ฎ
i strongly recommend to read documentation and official ECS samples project๐
I'm reading package manual, is that equivalent to documentation?
actually entity query doc doesn't have a use case with an entity handle ๐ค
i wonder if there will be some kind of HDRP renderer in Tiny๐
I'd love to know what's the end goal for DOTS rendering
but it feels that even Unity doesn't know that yet
shouldnt it be... render everything properly ? ๐
If I want MySystemGroup update after TransformSystemGroup, I need to add [UpdateAfter(typeof(TransformSystemGroup))] to MySystemGroup. Is that right?
yes
Or I have to add [UpdateAfter(typeof(TransformSystemGroup))] to each system belong to MySystemGroup?
if your system has UpdateInGroup attribute for typeof MySystemGroup, then you can just do that
if your system doesnt belong to MySytemGroup then yeah you have to add the attribute to your system
There is the problem. Once I add [UpdateAfter(typeof(TransformSystemGroup))] to MySystemGroup, and create this MySystemGroup and add update to SimulationSystemGroup, unity log error once I play
what does the log say
Oh, I may know what the problem is.
Maybe I can't update my transform sync position system after TransformSystemGroup.
once I update my system before TransformSystemGroup is fine
never heard a case like that, i know for physics stuff such as catching triggers/collisons and ray/collider cast you have to update after step physics world, but never heard of your case
but if your problem is solved then yay ๐
I sync the gameobject's position with entity's, so maybe has some order limitation with systems. I guess
why are you manually creating your system group ?
Do you mean not using [UpdateIn(typeof(MySystemGroup))] ?
You can use copytransformToGameObject or FromGameObject components for that
i mean thiscreate this MySystemGroup and add update to SimulationSystemGroup
yes, I want to add this systemGroup into SimulationSystemGroup
You can use copytransformToGameObject or FromGameObject components for that
@opaque ledge Good to know ๐
[UpdateIn(typeof(SimulationSystemGroup))] this will update your system or system group in simulation group
i think i just misunderstood you ๐
[UpdateIn(typeof(SimulationSystemGroup))] this will update your system or system group in simulation group
@warped trail I want to control some system's update order
one is NormalUpdateGroup and another is LateUpdateGroup
fps sample should show you how to create your own custom system order
once I have entered battle scene, I create default world then add these 2 group into SimulationSystemGroup update list
all the self made system use [DisableAutoCreation]
why?๐ค
Because outside my battle scene is a main page which is not using dots
๐
if I use autocreation, unity will log error crazy in that scene. updating all systems with some null data
why not use some singlton entities for example?๐ค
and why your system should update if there is nothing in query๐ค
some systems have to get some data from a mono script that only existing in battle scene
if this script reference is null, log error
But I am interesting in singleton entities, I may need this later for some global data.
How to create that ?\
when this mono script that only existing in battle scene it creates singlton entity with OkImHereThereIsNoNullReferencesYouCanUpdateSafely component ๐
your system Requires this singlton and updates only that this entity exists๐ค
is this a bad idea?
That is a way to do. But it only sounds not habitual to me ๐ . I don't want those unrelative system in my world. May have some unexpected.
why would it be?, that's what I did for a pause system
what do you mean by unrelative system?๐ค
I will even destroy the world once I am out of battle scene and let all existing entities dead with it
singlton entity is just an entity it will be destroyed with world๐ค
staff answer on the roadmap QA thread:```The new entity debugger is still very early, but expect update throughout the year.
I do want to mention some what related, that visualising job dependencies in the profiler is coming in 2020.1. ```
For example, If this battleA is a racing game logic, it does will have some racing systems. But battleB is a rts game logic๏ผsome of those racing systems no longer wanted and need to remove
so... not really much new
being able to see the dependencies would be really great
@south falcon if you want racing systems not to update you will just remove singlton entity
Like a switch turn and off๐
Racing game logic creates singlton entity with RacingLogic component -> RacingSystems updates. RacingLogic finishes and deletes RacingLogic entity-> RacingSystems don't update
rts game logic creates and deletes entity with RTSLogic component
๐
i think this would be better than creating and deleting systems at runtime๐ค
By the way, how to create singleton componentData? any example?
Thank you
visualizing job dependencies is cool
hi i want to ask about dots's status. are ecs and networking enough for production? especially big worlds with too much players? will we will have to handle stability problem of framework besides of game mechanics?
its not recommended for production, but now is as good a time as any to start learning
I dunno about networking though
also don't know if the stability should be first concern, it's just quite raw atm and not much info around
its not recommended for production, but now is as good a time as any to start learning
@safe lintel i am planning to develop a competitive game. rooms are for 32 players .so it is not stable you said. i will use mirror. but i am worry about latency and bloaty servers.
well they will have another roadmap on april 1st about the roadmap for networking/connected games
hey I've never used native containers. In my game, the player can click all over the map and add targets to the queue which are then dequeued as the player object moved from one to the next. Does a native queue stored in an IComponentData on the player sound like the right way to go about this?
You cant store nativecontainers in components. You can use unsafe containers or use a dynamic buffer.
Hey guys, I know it's not the ideal place to ask about this, but there's not much talk about Graphics.DrawMesh outside of this channel... (or anywhere online for that matter)
What I can't seem to find any information about, is how am I supposed to split the material (atlas) and draw Graphics.DrawMesh onto each quad
It seems like I could use texture2d, but that would just be applying a new, big texture instead of inside the quads themselfs?
I've also been trying to look at how you do it in your latest project, @zenith wyvern but I can't find how you render any of it ๐
not sure what you're asking @gusty comet
If you wanted to take a slice of a texture atlas you would assign a mesh particular uv coordinates
Hmm.. basically how should i go about drawing the quads using Graphics.DrawMesh i guess
DrawMesh operates on materials, not textures. Calling DrawMesh every frame is pretty much the same as putting a material and mesh in a MeshRenderer - atlases and textures are a separate issue
Oh. Well, that clears up some stuff
umm... in that case once my mesh is readt, its hould be a new material of its own to render it with DrawMesh?
well you should have a material associated so that you can render it
since you'd be passing the material as an argument in Graphics.DrawMesh - so something like this
The material as in, the new tilemap i created for that mesh?
well - no the Material asset effectively
(unless you're creating a material on runtime)
what if my material is the sprite atlas then? is that what the key[i] is referencing out of the atlas?
oh i guess not
yea this is out of context - just took a snippet of my code in this case
what I do is foreach material/texture - they're declared as entities and are linked to rendering entities so I can have a render pass draw some stuff for me in my project
technically I can use Graphics.DrawMesh - but I'm using a command buffer so I can do some orthographic projection (couldnt figure out how to do it with the Graphics static functions)
Oh i see. I'm just trying to have a mesh full of quads to render textures out of my atlas. I guess its completely not DOTS related i suppose if G.DrawMesh doesn;t take part of that
The easy way would be to use Texture2D but it seems widely inefficient
Thanks for your input anyway. I atleast got some better understanding of what i should and shouldn't use
what's the diff between systembase and jobcomponentsystem
SystemBase is the up-to-date api
I'd treat both jobcomponentsystem and componentsystem as deprecated
@gusty comet It sounds like you have your mesh vertices set up but you might not know how uv mapping works? You should definitely google uv mapping to understand better but basically you assign coordinates of your material texture to the uv of each vertex on your quad such that it maps the sprite from your texture onto the quad of your mesh
Thank you Sark, yes. It's exactly as you said. Finally tho, after 3 days of research and psuong's input i managed to ask the right questions to find the answer @_@
basically setting uv[0-3] is all i need to do to make a particular texture to render in it
so stupid
If you need an example check InitializeVerts in https://github.com/sarkahn/rltk_unity/blob/master/Assets/Runtime/RLTK/Consoles/Backend/SimpleMeshBackend.cs
Oh. Cheers! It will surely help
Or UvJob rather
In jobs aswell... Pure goldmine
Can someone help me out with this? On executing this 2 separate entities are being created in the EntityDebugger. The difference is one has a Prefab component and the other has a Physics Velocity component.
If I do not add a velocity in the code below, one entity has a Prefab tag, rest are same.
private void Start()
{
Entity playerTankEntity = manager.Instantiate(tankEntity);
Vector3 dir = new Vector3(UnityEngine.Random.Range(0, 3) == 0 ? -1 : 1, UnityEngine.Random.Range(0f, 3f), 2f).normalized;
Vector3 speed = dir * 5f;
PhysicsVelocity velocity = new PhysicsVelocity()
{
Linear = speed,
Angular = float3.zero
};
manager.AddComponentData(playerTankEntity, velocity);
}
what is tankEntity?
private void Awake()
{
blobAsset = new BlobAssetStore();
manager = World.DefaultGameObjectInjectionWorld.EntityManager;
GameObjectConversionSettings settings = GameObjectConversionSettings.FromWorld(World.DefaultGameObjectInjectionWorld, blobAsset);
tankEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(tankPrefab, settings);
}
Just a cube prefab I'm converting to an entity
prefab is a prefab ๐ it shows that entity is a prefab
unless you explicitly say so, queries wont include prefab and disabled entities
Yes but why are two being created
because you are instantiating ๐
instantiating is basically making a copy of an entity
on Awake you create Entity with prefab component, on Start you are Instantiating(creating a copy of entity with prefab and removing prefab component)
so, 1 when you convert your game object to entity (which has the prefab component) 2 when you instantiate which makes a copy of your prefab entity
tankEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(tankPrefab, settings); this creates Entity with prefab component
Got it, thank you. my understanding was that i create a temp variable in 'tankEntity' which could be later used for instantiating it.
Finally understood that I just create a prefab entity in the Awake method ๐คฆโโ๏ธ
Getting these errors on importing into 19.3.5f1
project tiny- tinyracing project ^
All the packages are updated!!
i don't think that updating packages is a good idea while using Tiny๐ค
it works fine if i open tiny racing project in 2020๐ค
weird. I'll delete the whole thing and reimport it again and hope :x
why does my FixedList have a capacity of 0?
IndexOutOfRangeException: NewLength 1 is out of range of '0' Capacity.
have you added anything to your fixedlist before using it ?
yeah its happening when im trying to add something to it
you are using FixedList<T> right ?
well.. I want a list of strings FixedList128<FixedString128>
yeah, the thing is the number that comes after FixedList indicates amount of bytes, not 'items', and internally 2 bytes are used, so in FixedList128 you actually can use up to 126 bytes, thats why fixedstring128 doesnt fit in, hence capacity is 0
btw, i am not sure what your use cases, but you most likely dont need strings in your components
I have a weird issue. Even thought I have installed the package "Entities" from the "Package manager", I cannot seem to access "Unity.Entities" from my code. Is there any additional step necessary to access it?
@opaque ledge Yeah I might have an idea to avoid using it
@digital scarab It is the classic " type or namespace name 'Entities' does not exist in the namespace 'Unity' (are you missing an assembly reference?)"
Even thought I am writing "using Unity.Entities"
Wait, ill show you the code
using UnityEngine;
using Unity.Entities;
public class Main : MonoBehaviour
{
void Start()
{
EntityManager foo;
}
}
It doesnt get much simpler than this...
@eager oracle I'd check the console for errors
Let me see
if there's some other errors, they may prevent loading that
And it's not a Tiny project?
isnt it Unity.Entity
No
maybe just restart editor
Delete library folder too maybe
The library folder in your top-level project folder
Ok, lets see what that does...
I have to close Unity to delete the folder
Ok, done. Restarting Unity...
Also restarting Visual Studio after that
Well, the greeting message now was a little worse
๐จ
If that doesn't work, maybe removing entities package, make sure you don't have any errors once it's gone, and install entities again
update Burst maybe๐ค
Burst is up-to-date. Actually "Unity.Burst" DOES get recognized by my editor
HRv2 time?
@fallow mason I have HybridRenderer 0.4.0
Sorry, I wrote that in response to b3 @eager oracle
@eager oracle what version of Burst is installed?
update burst๐
Yeah that old. 1.3.0 is latest, no?
Lies
Then how can I update it, if the package manager wont recognize a newer version?
Oh, seeing the "other versions"
Installing...
But shouldnt "Entities" be usable, without the Burst compiler, anyway??
how can i download it ๐
Still nothing happening... Im gonna try to rebooting the editor
doesn't look like it @opaque ledge .. unless they require b3 to appear
aww, k thanks
from 8.0 to 9.0๐ค
@warped trail https://unity3d.com/beta/2020.1b
Install version from Unity Hub
๐
Apparently I had run out of space in my HDD. Time to empty the trash ๐
Ok, yes... that worked
๐คฆโโ๏ธ
Don't you guys think that the whole DOTS stack should be one single package? I mean, this compatibility issues are silly.
eh, some things like Jobs can be used without ECS. They're trying to be as modular as possible, which I get.
In that case, the package manager needs to have better dependency management
Plus they have different teams working on each part. Making everything one package would slow down release iteration and that's especially important when its in preview and being evaluated.
Yes, it does.
Well, at least it works now. Thanks everyone for your help!!!
I see that World.Active is no more...
World.DefaultGameObjectInjectionWorld I think
Still getting these errors on just opening the TinyRacing project in editor, all are ScriptAssemblies errors?!
ooo formatted busy timer in the b3 ๐
@fallow mason Great! Much shorter!
@dusty scarab I just got one of those errors after opening my project in the latest beta. Restarting the editor fixed it for me.
Restarting... ๐ฟ
@fallow mason Nope, the number went down from 20 to 12 but still there
Is it normal that there is an entity "WorldTime" by default in the scene?
i guess you better post this error in Tiny forum if you can't open tiny racing project๐ค
wtf, the errors actually came back
forum it is then
@warped trail What version of Project tiny are you on which it works?
i just download projects from github and launching them๐
in DOTS, Time.deltaTime is written now as Time.DeltaTime??
@eager oracle yes
holy frog
same tbh why isn't it working ๐ข
hello
i was wonderink
what about unity asset store assets
they dont work with dots
ofc some are small and easy to remake
but other are big and remaking them in ecs would take ages
soo how does unity see this
My take is 1) Monobehaviours aren't going anywhere - a lot of tools will still work, they just won't be working natively with the new dots stuff, 2) assets (like models) don't need to change, 3) the new render pipelines are probably more disruptive than dots (especially to e.g. shader assets), 4) existing authors will hopefully be encouraged to update their assets (they'll get better performance) and 5) there's plenty of space for a new wave of assets
- you should always carefully consider what dependencies you introduce to your pipeline outside of Unity for when Unity changes things or the assets stop being supported
(coming from the perspective of someone who's making a DOTS asset for the store)
@amber flicker Definitely they are not going anywhere
What components are needed to render a Mesh with an entity, besides "RenderMesh" and "LocalToWorld"?
I think I remember reading you need WorldRenderBounds or similar - best to check out a cube in the entity debugger or something to check
It would be nice to set dependencies between Components
"RenderBounds" seems to be enough
beware you may get some rendering artifacts if you don't initialize it properly and only add the component
Not really sure what is the right way to do that. All my tutorials seem rather outdated ๐
i guess recommended way is to convert prefab to entity๐ค
probably
This doesnt work anymore for systems?
Entities.ForEach((ref Comp1 comp1, ref Comp2 comp2) => {...})
Aparently the lambda can only have 1 parameter now?
Mmm... now it is gone... probably was because I made Comp2 a "class" and not an "struct"
(and it definitely works still)
Components must be always structs, right?
and it finally works ๐ค
So beta 3 is out. Anyone got hybrid v2 to work? I'm getting black cubes in spawner sample
it worked for me, but no ambient light
@worn stag you've coupled it with correct HDRP?
just one directional light and thats all๐
I'm using HDRP from SRP master
yes 9.0
is URP intended to be functional with v2?
can you execute entityquery in gameobject update?
@digital kestrel yes
@mint iron ultimately at least, I dunno how functional it is today
they said they want to support core URP functionality on the forum thread
@mint iron Official URP support (minimal feature set)๐
@mint iron
entityquery is system stuff ๐ค
var myQuery = World.DefaultGameObjectInjectionWorld.EntityManager.CreateEntityQuery(
ComponentType.ReadWrite<EcsTestData>());
myQuery.CalculateEntityCount();
ah ok, thanks ๐
oh, didn't know you can do this
I looked for GetEntityQuery and missed that
where is this?
iirc, in SRP github
Is it possible to add the TransformSystemGroup also into ClientPresentationSystemGroup? ๐ง
hmm, i dont think you can add a system twice, but perhaps you can manually update it ๐ค
tho i never tried something so exotic
@worn stag I only know of the hybrid test projects in the SRP repo but I don't think they refer to those on that
so, I wonder if they just add those two to current samples repo
also don't really see immediate gain of having such sample projects myself
what would be more useful would be just a simple list on what a) works with these b) what doesn't work with these
@opaque ledge Seems to work, thanks!
Ahh, we have 2020.1b3 but since we don't have URP/HDRP 9 yet we can't use Hybrid v2 yet right?
yeah, i think i will wait until they are released and then i will upgrade
without issues i hope D:
did the 2020 roadmap talk about hybrid renderer v2 @dull copper
I wanted to try the "Visual Scription ECS" package, but it is not listed for me. Isnt that available for everyone?
Tried v2 in another scene and it works correctly but indeed without ambient light. It's also less performant for me than v1.๐คทโโ๏ธ
Yes they've said it will perform worse until we have the correct SRP packages too which are not released yet
i'm using it with the github master branch which is 9.0
Did you follow the steps from https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@0.4/manual/index.html#enabling-hybrid-renderer
yeah
Well that doesn't sound good
I wouldn't read into it too much though until they've officially released the packages
Hey, been looking at Tensors to understand dynamic physics bodies. Does someone know what the Interia Tensor describes?
It says "Resistance to angular motion". Does a higher value on X mean no angular motion in direction X?
I noticed, making the Tensor smaller and then applying velocity on one direction to my capsule makes the capsule tilt faster ๐ค
I'm trying to update Burst and I've been sitting on this one part of importing for like 20 minutes now. If I Terminate Unity is it going to break my project? Or is this supposed to be a really long wait?
this exact script is taking this long not the entire process
Apparently when I terminated Unity and reopened it now it's installed package lol. So sorry everyone
Thanks @dull copper, hard topic to understand but it's getting clearer.
Anyone know what MTranfrom stands for? It holds a
float3x3 roation,
float3 translation,
could it have anything to do with LocalToWorld?
afaik updating burst shouldnt have any effect on your project @gusty comet , just might have to delete the package cache in the library if it doesnt update properly
guys
why when i remove model leg
other body parts get alll stupid
and bigger and deformed
perhaps you can rephrase the question with more info
every time I have to look up some math documentation, I die a little bit inside
thats what my ide does when i look into the math definitions ๐
its infuriating. and you know some web dev was thinking "should I add pagination? nah, documentation never gets that long!" ๐ฉ
i do despise the package docs ๐ i guess theyre permanent though, was hoping they would get the same treatment as the old main manual for the editor/api
I typically just use the github math class and search through there, but it doesn't have an implementation that I've seen used in some of the physics demos
any idea what math.forward(quaternion q) does?
gets the forward vector for that rotation
kinda like what transform.forward was for gameobjects(though there is LocalToWorld.Forward)
That's what I thought. I'd really like to get the up vector, but there isn't a math.up(quaternion) function (at least in my version of math)
Right now, I'm pulling in ltw just for the local up, but I'm already using the Rotation component, so it would be nice to just use that
someone else can correct me if this is wrong but you can do math.mul(quaternion, float3(0,1,0))
I'll reformulate my question as it had too many details:
is there a way I can create a persisting(between systems) 2d grid of entities in ecs and be able to access it's members by it's coordinates [x, y] within systems ?
You can represent your grid in a collapsed 1d dynamic buffer, and you just convert between 1d and 2d indices as needed
so the whole grid including all the stuff on each tile would be in a single entity with a dynamic buffer for each component ?
Each element of the buffer is a tile. You can represent the tile however you want. If your tiles are meant to contain many things then things get a lot more complicated
In my game my tiles are only used for rendering. I have a separate buffer to represent the "state" of the map that gets updated every frame and details collision and references to whatever entity is in a tile
for the context this is the grid I'll use to place buildings on(city builder prototype), so I need to pathfinding between them and apply some area effect from other buildings for example.
so for each use of a grid representation, I could have a component with a buffer containing the data I need(pathfinding and heat for now) ?
and have everything that does not absolutly need to be aware of it's neighbors in their own entities
how do u step through entity.foreach jobs?
for now I don't have anything in code yet, I have the game written in OOP, and I'm trying to figure out how to go back from scratch in ecs
oops thought that was sark lol
A component doesnt contain a buffer, a buffer lives on an entity. If this is your first time using ECS I would strongly recommend something simpler to start with
anyone knows how to successfully modify a SharedComponent such as RenderMesh? (trying to do a simple quad deformation from a component system)
doc mentions having to use memcpy but they didn't provide a snippet on how to actually do that
var renderMesh = EntityManager.GetSharedComponentData<RenderMesh>(entity);
var mesh = renderMesh.mesh;
//Do your thing
renderMesh.mesh = mesh;
EntityManager.SetSharedComponentData(entity,renderMesh);```
something like this i guess๐ค
i wasn't setting shared data, thought it works just like modifying components in queries, lets see if this works
nothing happens still ๐ค
im finding an entity handle through a hack but shouldn't this work?
oops, there's a typo in SetShared
but passing entity handle from a query throws an exception, so this hack is actually accounted for
if you are using entitymanager in ForEach you have to use .WithoutBurst() .WithStructuralChanges()
and i think mesh.vertices returns a copy of vertices๐ค
afaik in vanilla Unity it was done through mesh filters but I don't think we have a component for that
I've searched for it already ๐ฆ
i mean that you have to mesh.SetVertices() to set vertices๐ค
ok so I actually got this to compile
and this is what the console thinks about it:
"Entities.ForEach Lambda expression makes a structural change with a Schedule call. Structural changes are only supported with .Run()"
yeah, you have to use .Run() instead of .Schedule()๐
and i think you should consider to use SystemBase instead of JobComponentSystem๐ค
I've been using ComponentSystem before but it didn't have .WithoutBurst().WithStructuralChanges() for queries
so ive been reading the documentation and it seems like those come from JobComponentSystem
so here I am
JobComponentSystem is on its way to be deprecated
good, i hate it already ๐
success ๐ฎ this works:
had to change "ref" to "in" for RenderMesh component and don't actually need to get that shared data from entity manager
another caveat: if you use SetSharedComponentData on a RenderMesh and just pass mesh (with no material), he will reset the material to null and the mesh won't render
maybe try thiscs var mesh = renderMesh.mesh; //your work renderMesh.mesh = mesh; _entityManager.SetSharedComponentData(entity, rendermesh)
maybe try without in?๐ค
lets see ๐ค
without ref or in it should pass component by value
oh that works, right, since im setting through SetShared i don't actually need ref or anything like that
i bet you can do this through shaders in upcoming hybridrendererV2๐
I'm thinking about this in the context of 2D sprites (skeletal 2D animations), things like Spine usually modify the mesh (or mesh filter I guess) at runtime, this way you can easily use whatever shader you want (eg: Sprite-Lit shader for LWRP lighting, shaders that display outlines or any specific effect)
so quiet ๐ฆ
Alright, a question for you @mint iron ๐ What is the difference between NativeList and UnsafeList exactly ?
One from me too,
[UpdateInGroup(typeof(SimulationSystemGroup))]```
Why is this required? Isn't Simulation the default SystemGroup
NativeList has safety mechanisms and UnsafeList does not, also UnsafeList<T> can be cast to an UnsafeList untyped version because they share the same members. All members of NativeList<T> are passed by ref/ptr (stored in the internal UnsafeList), but UnsafeList has length etc that will stay when copied by value.
yeah but what is the practical meaning of having safety mechanicsm turned off ?
like.. will my pc explode if i try to access an index number that is more than capacity ?
I'm guessing it means you could end up with weird outcomes, like variables not incrementing properly
like several threads accessing the same data each reading and writing it at different times you end up with a result that doesn't make sense
I've had that happen
yeah i assume most of them get stripped out when safety checks are turned off, but you're still limited to how you can use it because of the class members.
you pc will collapse into black hole๐
๐ฑ
no thats only if you divide by zero 
i heard something like, you can put pointers in structs (meaning that they are blittable), that true ?
isn't that only true for shared component ?
One from me too,
[UpdateInGroup(typeof(SimulationSystemGroup))]``` Why is this required? Isn't Simulation the default SystemGroup
@dusty scarab
It isn't required, unless you [DisableAutoCreation] or change the default behaviour Unity will do this automatically to any system you create.
@zenith wyvern was in the TinyRacing example and had me pegged on why it was being used. Thanks btw!
i guess Tiny is different๐
What do you mean?
I'm not sure if Tiny uses the same world initialization stuff as default. My assumption would be that they don't actually need to be doing that
Since they use the same Entities package as normal Unity
But I don't know for sure
What exactly is the difference between Tiny and the entire group of packages? All i could get was that tiny is being used to develop smaller size projects
I'm looking at Tiny examples to understand the ECS workflow
Tiny doesn't use any normal Unity stuff. It's basically a whole different engine using bits and pieces of other open source software
They pretty much just use Unity for the editor workflows
And for the ECS stuff of course
The scripting for both is essentially same right. All I can understand online is that in Tiny ECS is enforced, and it uses a different pipelines. (I'm looking over these examples to get started coding in dots. so any changes I would have to adjust to?)
in tiny you can't use anything from UnityEngine
Right. in DOTS I can use MonoBehaviours
No gameobjects, no camera, no mesh, nothing that isn't in the packages
Tiny is as pure DOTS as it can get๐ค
Anything from the editor has to be converted to an entity inside a subscene
no mesh? isn't mesh in the hybrid renderer package?
I see. Back to working in ecs then. way too much to learn to dive into tiny
they don't use hybrid renderer
@zenith wyvern it does have meshes now
you can do procgen meshes on the 3d tiny
but 3d tiny not being compatible with 2d tiny is..... impressive
Yeah I saw that, I'm going to poke at it this weekend. Seems very complicated right now
Hello
will my monobehaviour based game benefit from DOTS performance if i decide to spawn only visual things (like houses, mountains, etc, often static, that dont have code on their own) with ECS? e.g with convert to entity component?
Anyone pro with FilterWriteGroup ?
hmm, it's weird that atm you can't use the latest versions of entities + physics + hybrid renderer together 
hoo ye, updated collection manually and now it works :D
write groups are interesting ๐ค
how do you organize your files in ecs, just have Assets/Scripts/Components and Assets/Scripts/Systems or ?
Hey, I'm playing around with Angular Velocity and I wonder if it's commonly used to rotate characters? I have been looking at Witcher3 for inspiration and it looks like when rotating, his arms are affected by centrifugal force. It seems to me that the arms are connected to the body via Joints and this is whats moving them when rotating. Tho I could be wrong and it's just an animation playing, hence my question if Angular Velocity is the way to go when rotating a character with a dynamic physics body.
I'm trying to use WriteGroups but its not working when loading an assembly at runtime, and Im trying to figure out where to start looking
Like it'll work if the writegroup is in the same assembly as the engine, but if its loaded in as a DLL, it doesnt
can you have helper functions in components for code that might be used by multiple system ?
like translating a world pos to a grid pos
In components? I dont think you're supposed to
so you have to repeat that code each time ? 
I think Joachim ante has said static functions are okay, but I think he meant on Systems
I use global static functions for that purpose https://github.com/sarkahn/dots-blockworld/blob/master/Assets/BlockGame/GridUtility.cs
How specifically relevant, lol
alright, will probably do the same I think
also am wondering, for dynamic buffers, are the buffers in the 64K chunks and count towards the limit, or are they elsewhere in memory ?
it depends, you can set InternalBufferCapacity attribute on your IBufferElementData, or by default it will use 128 / elementSize in the chunk. If you go beyond the defined size, it allocates new space elsewhere.
is there a way for a test assembly to access internal members of a different asmdef used for package runtime? i dont want to expose some members as public, but it also doesn't seem like a good idea to put my tests inside the runtime package assembly.
seems like Unity.Entities packages are doing exactly this but i can't seem to figure out how.
[InternalsVisibleTo] maybe?
ahh yes thats how its done, thank you
Hi,
I'm trying to figure out what the correct pattern is for accessing a shared component from within a Job. So far I've been using chunk.GetSharedComponentData(RenderType, World.DefaultGameObjectInjectionWorld.EntityManager); but from skimming the Unity forums that seems unintentional and not thread-safe?
World.DefaultGameObjectInjectionWorld does not necessarily have anything to do with the World owning the system you're working with
so that code is just broken
Yeah, the question is what's the correct way to do it
I need to access RenderMesh from a Job to get the bounds data
you don't, if you're using Burst
might be able to copy some of that into another component in an Entity depending on needs, but SharedComponents are by design not really data containers
they're a grouping tool
Yeah but I need that data to calculate the size of a UI element
And it runs on a large number of entities
Any time RenderMesh changes
I've got a world canvas that scales with model size
grab that data up front?
How would I do that for an IJobChunk?
Is there a way to get the shared component data in a way that I can link it from the Job?
you read whatever blittable types you're interested in and park them in an Entity
(well, component belonging to one)
with the new SystemBase we don't necessarily need to create a struct for a job, but if we prefer to still use it, do we know if it's going to get deprecated at some point ?
loosely this is how groups in the transform hierarchy work
(re: @raven grail)
hierarchy is inherently not parallel
So like a catch all component that contains fields for all the shared data I'm interested in and a system to copy-paste it all?
you can put all that in a component, as mentioned
it is possible to have an Entity field and access the properties with the accessor structs
this will limit parallelism, though, so it might not be a good fit for jobs
innately
Just seems hacky to me. Rule of thumb is when you're copy-pasting code you're doing something wrong
not at all true
inlining, etc. Again, if you need one copy of something, put it in an Entity or use a singleton
and use an Entity field in a component to establish that link
you can access component data for Entities other than the one being processed in a ForEach job
Not really what I'm after. Really all I need is the bounds per chunk since it's shared
Ideally I'd have a IJobChunk Execute() that accesses the bounds once, calculates what it needs from those and then moves onto Entity-specific calculations
It's actually a lot closer to the actual mechanism the theoretical SharedComponent approach would use. Chunks internally store a shared component index so there's always an indirection
Wouldn't it be possible to access that index? I've seen some methods that return collections of shared data but the documentation is vague or non-existent
it's available directly from the chunk
GetSharedComponentIndex<> or something to that effect
you need the EntityManager to turn that into a shared component reference, which is a no-go for Burst
Yeah but wouldn't it be possible to get it from the System and pass to the Job as parameter?