#archived-dots
1 messages ยท Page 152 of 1
That sounds crazy
yeah, not sure what's going on there
Do subscenes also contain the textures and all that stuff?
i think sub scenes copies in assets
all of my entities are just flat planes that all reference the same 4k texture (which is a sprite sheet)
not sure that they have those excluded properly yet
yeah, you're right in that all of the .bundle files are the same size
the entities might be the same size because each one is 10,000 GameObjects with the same number of components
i wonder if I could get away with just deleting all but 1 bundle ๐
nope
well that's unfortunate that I can't control that, guess I'll have to wait for that feature
or spawn my entities in at runtime instead of using subscenes
Is Dots Editor incompatible with the latest entities?
Is there an efficient way to instantiate multiple different prefabs with the EntityManager?
I have a job that has a bunch of Entity (Prefab) references that I want to Instantiate. Unfortunately they're not all the same. Is there anything short of grouping them by the same Entity (Prefab) in order to be able to use the EntityManager batch operations?
DOTS Editor is for project Tiny, not "normal" DOTS
What do you mean multiple different prefabs?
You can just grab each of the Entity values for them?
Let me give some context.
what key reasons do I need to consider to go for Tiny than normal DOTS?
It's for my ability system. And in the off chance in one frame a thousand archers and mages will shoot their projectiles.
Doing it 1 by 1 with an entity command buffer (despite burst and all) will take almost 16ms for 1000+ projectiles.
Are you sure it's only for Tiny?
Honestly, with only that I'd say "don't worry about it"
Key is they're mixed (say Arrows and Fireballs)
So I have an array of Entities to be instantiated
So I just saw this batch method
Unless you have experienced the issue in a stress-test, probably not an issue
the 4th one
srcEntities -> outputEntities
I guess that could work
Shove the arrows and fireball prefab entities on the srcEntities 1000 or so times, call the method and loop again to give them their velocities and whatnot.
So you want to basically "collect" all the projectiles that should be spawned in one or more collections, and spawn a number based on them, then set the positions and whatnot?
yup
I suspect that unless you do it really clever it will be cheaper to just do it ECB where you already do it
Right now I'm doing
var prefabEntityInstance = beginSimulationEntityCommandBuffer.Instantiate(entityInQueryIndex, prefabEntity); of sorts.
Though, do put this to a stress-test!
Oh, how are the prefab entities made? do they have any extraneous components?
It's a "prefab registry".
Basically on scene load it'll convert a bunch of prefabs, so that I can get a reference any where in the code through a tiny system with a nativehashmap.
The ECB playback is killing performance ๐ข
Gonna try the batch version.
Maybe I can prepare the component data a job and set them with another batch call.
whoa!
The purpose is to enable procedural generation scenarios where instantiation on big scale must happen on jobs
Seems spot on
Ooh, my experience with automatic conversion is that it's messy and adds a bunch of unnecessary components, so making one or more manual IConvertGameObjectToEntity monobehaviors to override it and get just what you need might improve perf
With that many entities, each unneeded component is extra time spent allocating and such...
Hm, my arrows entities do have a trailrenderer.... let me try without it really quick.
hardly any difference, it really is that it's playing back 1:1, 1000+ times individually
Gonna give the "ExclusiveEntityTransaction" and the EntityManager."Batch" a try ๐ Thanks guys
Dots Editor is not just for Tiny for the record. Apparently it only works if you have your api compatability level set to .net 2.0
@zenith wyvern hm, after reading some more, I'm not sure if ExclusiveEntityTransaction is what I want to use ๐ค Seems more intended for "let's load a million objects" asynchronously in a different world, as opposed to "I need 1000 projectiles in this frame".
Did you check the components of the prefab entities? As I mentioned, you could be able to improve perf by stripping away unnecessary ones
They're pretty simple.
Yeah, doesn't look like you can trim much there. Maybe LinkdEntityGroup, but...
Have you made a "real" stress test, though? Seems unlikely to me that you'd get all of them firing in the same frame, and even spreading it out by a few can make a huge diff on FPS
i dont know if all threads do the same work why one takes a lot to finish ๐ฆ
any suggest ?
Could it be that some work is a lot heavier than the rest?
Like, depending on the inputs, it can take short or long
Also, that's a LOT of idling
Out of curiosity, is this a one-time thing, or does it run like every frame?
one time i guess
Anyone seen this?
InvalidOperationException: The writeable Unity.Collections.NativeList`1[Game.ECS.Building.Construction.ConstructBuildingCommandMessage] <>c__DisplayClass_OnUpdate_LambdaJob0.messageContainer.LocalPlayerList is the same Unity.Collections.NativeList`1[Game.ECS.Building.Construction.ConstructBuildingCommandMessage] as <>c__DisplayClass_OnUpdate_LambdaJob0.messageContainer.Player1List, two containers may not be the same (aliasing).
Because if it's one-time, you can shove it into a non-frame job
key part is two containers may not be the same (aliasing). i think
//Rellena los datos de los componentes RenderBounds and LocalToWorldMatrix
JobHandle jobhandle_RenderBounds_and_LocalToWorld = Entities
.WithStoreEntityQueryInField(ref occluder_query)
.ForEach((int entityInQueryIndex, ref RenderBounds rb, ref LocalToWorld l) =>
{
rb.Value = new Unity.Mathematics.AABB { Center = list_bounds[entityInQueryIndex].center, Extents = list_bounds[entityInQueryIndex].extents };
l.Value = list_localToWorldMatrix[entityInQueryIndex];
})
.WithDeallocateOnJobCompletion(list_localToWorldMatrix)
.WithDeallocateOnJobCompletion(list_bounds)
.ScheduleParallel(this.Dependency);
this is the lambda funct
Do this for C# highlighting, useful for such big blocks :)
```cs
[code]
```
ou sorry ๐ , next time
You can just edit the message
ah okey on my way
@ocean tundra Does it happen in an Entities.ForEach?
the "cs" must be on same line as the first backticks, and no space after - just linebreak directly
just peaking at the DOTS decompiler to see if that has any hints
Do you have a "DisplayClass"?
Display Class??
are you asking me ?
๐
I take that as a no, Roycon. The error says it happens in a class called that
lmml, does this run every frame, like it seems to?
@tawdry tree Looking at the decompiled code there is a display class created
not at all , i have an own inspector script with a button that call a funct of the system base and this is a part of the internal code
i call it on edit mode
so i think it is called once by main thread
every time i check profiler i get the same results so i think yes
so did some googling, seems my error is cause i have something like
var nativeCollection = new.....
var collection2 = nativeCollection;
i really lost cause i dont know when u answer me or roy xd
they are the same collection but the safty system blows up
lmml, if you do it only in edit mode, and not often... it hardly seems like an issue to me ๐
Roycon, NativeCollection is a struct, not class, so you copy the "value" of the nativecontainer itself. I think it doesn't copy the values it contains, but either way, danger!
so , u dont think it is a problem ?
@tawdry tree yea im aware of that, vaules for sure arnt copied so i was hoping to have a 'shortcut' so i wouldnt need to do a lookup on my clients
lmml, if it's not being done at runtime, then it won't affect the end user, and if you're only doing it rarely "on demand" (maybe one time per second at most), then the impact is minimal
Roycon, what are you trying to achieve here? What's the use case?
Missing enough context to say much about how to solve that...
@tawdry tree theres a ton of context ๐ basicly networked game. there are a ton of different messages created for things. they go into native lists each one matching a player and then sent off via the network
BUT for when the player is hosting their own game, the local player list for each message type is set to the same collection of that player
but it seems unity hates that ๐ so i think ill just make it its own list again and copy all the items between lists at set times
is there a quick way to say Take all from this list and put into this list?
hmmm maybe, but as there are a ton of lists i dont really want to use linq
It might also be possible to grab a reference of the list, which would seem more correct
i might actually be able to just swap the lists
as the server 'should' have the same list but empty (all messages processed)
also another issue, my unity is locking up and maxing CPU when i run, any ideas how to find out whats causing it?
๐คฆโโ๏ธ
i changed the code gen and then didnt run it
Check task manager with show all cores
This option (from right click)
If it's all single-threaded when it locks up... that happens to me sometimes, not sure why, but usually disabling or changing some code fixes (or just randomly after rebuild)
Oh, so it's just building
I noticed that got really bad with Unit 2020 vs 2019, but different projects - the 2019 one used Assembly Definitions.
AsmDefs can greatly speed up build time, as it only needs to build the specific ones that changed/need rebuilding
https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html
i have so many asmdefs
maybe too many ๐
not sure its building
as that happens when i click play
Did you change a code in bunch of them? Or one that many depends on?
Well, when you click play it has to build to be ready yo play, no?
Also, which unity version?
It build on play if it hasn't done it beforehand
Either way, that 3min work should not be needed particularly often - if it is... Uh, maybe bug? I don't know what it actually does there
except some of my code does run
i checked the editor.log
must be something im breaking then?
What happens if you toggle pause and then hit play? (it should pause instantly)
ooo great idea
just restarting unity
yup its fine
i think something in my code is causing it
im spamming log messages
so will see if i can track those back
Alternatively, start commenting out systems, particularly those you've changed lately
Huh
its like unity isnt calling my update method again
its a monobehaviour im using for my start up stuff
like wtf?
well i found it
Im updating the PlayerLoop to add my custom worlds in there
something seems to be wrong with GetCurrentPlayerLoop
thanks for the help @tawdry tree I think one of your first guesses was right, one of my systems somewhere is super weird
But thats a tomorrow issue to fix
Thanks again
I find that the Monobehaviour scripts don't work on Entities even when converting using the ConvertAndInjectGameObject.
Still busy playing around with it
check entity debugger if your entity has that monobehaviour
What is the monobehaviors supposed to do? because you need to sync the changes, somehow.
For Transform, there is built-in functionality for that, but anything else I think you have to code yourself
No the monobehaviour is not on the Enitity it seems
I tried adding it on manually as well after spawning
Same result
How a function convert-and-inject GO looks in our project
I believe the grayed out ones in the bottom is from the "link"
But if you have ConvertToEntity, it's super easy to see wheter it works - with convert and destroy, GO disappears, with convert and inject, it stays. Either case gives you entity.
One thing to note is that updating the entity does not automatically change the GO
Not sure, if this is the right channel, if to ask questions about tiny mode; but didn't find a web channel, so this seems most appropriate one, as tiny uses ECS. As by now the documentation of tiny mode is ... a bit tiny, I was wondering, if anybody has infos / hints about interaction with javascript. Only found very outdated infos, the days tiny was still using ts.
i rarely see anyone talking about Tiny in this channel, you better off asking in forums imo
Tiny should have their own forums
@opaque ledge alright thx. does that implicitly also mean, that tiny is not yet in a state to investigate?
@prime cipher The only time I've heard people speak about tiny is in the use of 2D DOTS in Unity, but I would have no clue when it would be used with javascript at all. Especially if we are talking Unity since the last version of Unity that actively used JS is quite far back in the versions by now.
for the records, I found a corresponding forum post: https://forum.unity.com/threads/how-do-you-call-javascript-functions-from-tiny-c-systems.697223/#post-4667738 which is stated to still work, not yet tried myself though.
the mentioned sample .. I did not find though
Why do you wish to do this btw?
This is probably a bit of a different use case ... however I think with DOTS / ECS in tiny there might be a fast alternative to render big data volumes visually. The data would have to be injected from outside. Basically, injecting javascript (like e.g. a user name) would be probably easier than to double api calls in unity again.
Are you thinking of using unity to render like massive graphs or such things?
got me
hm...
Yeah, I don't know, unity games tend to be pretty closed for security measures.
web enabled, small footprint, components and systems, burst ... sounded like a match to give a try
I mean, you for sure can do this, but I don't know how it would work in a website.
Like making a desktop program that can render these kind of data super fast is no big deal, but to convert it to a webpage and take inputs from javascript may be a bit tricky.
that is what I want to find out, if there is an interlinkage possible.
or if it is to sandboxed
I don't really know if the web conversion of unity allows like startup parameters and such
so basically c# calling javascript to read a state that is set by the browser environment.
me neither, will try to check out ๐
Yeah, the dllimport may work, but this is a very specialized area of expertise I imagine ^^; Might be difficult finding people who know about this
noomie, you might want to look at existing javascript libraries, and better yet, libraries utilizing WebAssembly. I don't know of any free ones, though. In the end you need JS for interop anyway, so a decent JS library using webGL should be quite fast enough. For heavy calculations (if you're doing that for some reason), that could be offloaded to WebAssembly.
Hello guys, Iโd like to instantiate object using GameObject.Instantiate in a SystemBase but recover the Entity converted as soon as possible to link it by ref to another object, any idea ?
So you're spawning from a prefab?
First, consider doing this in OnCreate instead, adding a Prefab component, and then then using EntitManager.Instantiate(prefabEntity)
As for how to actually convert gameobject to entity, you could grab it by name, but it's cleaner to use GameObjectConversionUtility
Yes Iโฏspawn from a Prefab.. If Iโฏuse EntityManager.Instantiate, the GameObject is not instanced "old unity way" and then the NavMeshSurface cannot be computed ๐ฆ
Oh yeah, DOTS has no navmesh support yet
Yes Iโฏknow it is why Iโฏhave to use an hybrid approach
This thread discusses it, and has a few ways to do it in DOTS:
https://forum.unity.com/threads/dots-navigation.758690/
I cannot wait for this feature to be released even in preview
The only problem is that I need to GameObject.Instantiate my walls .. to have them in the navmesh..
But Iโฏalso need to link the entity created to an other one to be able to destroy it later
Do you dynamically add and remove the walls?
sure ๐
That means less shortcuts are available
If you didn't change it after spawning you could just set it up correctly in editor
yes but it is generated ๐
Or build just the navigation stuff in GO, and make entities to represent it
https://openupm.com/packages/com.reese.nav/ This is a package for DOTS navigation
(linked from the thread above)
Yes Iโฏkind of evaluated it
Thanks for you help .. I will try to hack a bit then ...
There is no way to recover the โEntityโ from the Instanced GameObject ?
GameObjectConversionUtility.ConvertGameObjectHierarchy returns an Entity
Will try it ๐ thank you
Is there a way to draw gizmos which hybrid render ?
we only want to draw some cubes with a query ecs entity components
we also accept handlers
You can poll the EntityManager from GOs
Which I assume would let you do it how you normally draw gizmos
@undone torrent maybe check out DebugStream class
i have never tried it, but i heard some people using it to draw stuff
tho not entirely sure if it was gizmos
Got a question about DOTS and Burst in general, Would it make a loop that runs on a separate thread or would it be better to let all the single calculation of a loop work in a different thread?
I have a need for a triple for-loop since I am spawning a chunk of vertices which goes in each and every axis, but I think it would be nice to separate all the vertice calculations out on the worker threads, I heard burst compilers do this automatically with loops somehow, but how would I best go about this?
How do you determine if a subscene that you load with LoadSceneAsync has finished loading?
Nevermind found it, SceneSystem.IsSceneLoaded
@cursive cosmos burst compiler doesn't do that but the jobs system can be used to schedule jobs in parallel. You could use either Entities.ForEach with .ScheduleParallel() or if your data is in your own structures use an IJobParallelFor https://docs.unity3d.com/ScriptReference/Unity.Jobs.IJobParallelFor.html as for if you should it depends entirely on how much work is being done - if you're over the threshold of scheduling overheads (both from the start and data consolidation afterwards).
I have a large float array that I modify with jobs. I'm using a persistent native array since the size will not change.
Aside from the modifications and some other job utilizing queries on the array, I occasionally need to know the value of a particular index in theain thread.
Is there any need to keep a separate non native array for the value checking? I'm new to the job system and native arrays so I'm asking here.
@signal sand i don't think there's a need to keep a managed copy because both managed and unmanaged code can use native collections without issues. Caveats being 1) that the default c# collections tend to be a bit faster when run outside of burst and 2) if you're reading and writing it from different threads.
@mint iron No.2 is what I'm worried about. Unlikely to matter much since at most I'll be reading slightly old data.
I will not be modifying it at all in the main thread.
@mint iron https://docs.unity3d.com/Packages/com.unity.burst@0.2/manual/index.html#memory-aliasing-and-noalias
Sure seems like it's optimizing on the fly to me.
Anyone know how I can calculate this into a mathematical float3 instead?
for (int x = 0; x < xMax; x++) {
for (int y = 0; y < yMax; y++) {
for (int z = 0; z < zMax; z++) {
//whatevs
}
}
}
The order it calculates is important, z > y > x.
I used something like this before:
var pos3D = new float3(index % xMax, (index / xMax) % zMax, (index / (xMax * zMax)) % yMax);
But I don't think this calculate it in the right order.
using this inside one IJobFor made my life earlier relatively easy, but I am no math genius...
its not on the fly in the sense i'm thinking about. But if you mean can it in some circumstances compile vectorized assembly, then it can.
i think this one is row major on Z, Y second priority and X worst.
https://gist.github.com/jeffvella/82412e91135df041cc8e836bd22cd505
https://github.com/jeffvella/UnityAStarNavigation/blob/017cdc81c292ba5825f8b21bd280eae8d5f5825f/Assets/Plugins/Navigation/Helpers/Collections/NativeArray3D.cs
if its really important that something get SIMD you'll have the best results by using int4/float4/bool4/math.select to queue the compiler as to what you need.
the first link ain't working @mint iron , but I need to look into this...
public int3 Get3DIndexes(int idx)
{
int x = idx / (_yzLength);
idx -= (x * _yzLength);
int y = idx / _zLength;
int z = idx % _zLength;
return new int3(x, y, z);
}
This should be all I need
just need to make sure the math is right
yeah, no, that did not work...
ahh it was private repo sorry, updated link.
var coords = new int3(index / (size * size), (index / size) % size, index % size);
This calculation works if my chunk is always the same size as a cube, but does not work as a rectangle. I just input the index of the loop and I get the right positions for the vector, something like this is what I would need for the IJobFor so I can just take that index and work through the coordinates.
I wish there was like a math forum here in unity x)
Maybe 3D could help...
Might have solved it with:
var coord = new int3((index / (ZMax * YMax)) % XMax,
(index / ZMax) % YMax,
index % ZMax);
huh new entities package
WOOOOO
oh god, did they change a lot? D:
i dont see it
seems pretty minor?
still in the preview package source?
Fixed
Prevented remapping of hybrid components during deserialization which caused IL2CPP builds to fail on a missing property bags.
Fixed exceptions being thrown when inspecting an entity with a GameObject added through EntityManager.AddComponentObject
Fixed load order of JobReflection static methods which were causing InvalidOperationException: Reflection data was not set up by code generation exceptions in player builds.
Changed
An exception is now thrown during serialization if a shared component containing entity references is encountered.
Removed
Removed expired API World.AllWorlds.
Removed expired API EntityComponentStore.CreateChunks(Archetype*, ArchetypeChunk*, int, int).
Removed expired API EntityManager.CreateChunk(EntityArchetype, NativeArray<ArchetypeChunk>, int).
Removed expired API EntityManager.LockChunk(ArchetypeChunk).
Removed expired API EntityManager.LockChunk(NativeArray<ArchetypeChunk>).
Removed expired API EntityManager.UnlockChunk(ArchetypeChunk).
Removed expired API ArchetypeChunk.Locked().
Removed expired API struct NativeArraySharedValues<S>
0.11.1p4
yeah, updating to the 0.12 now, let's see if it breaks something ๐
i always hope for a major version ๐
i want that new component enabling/disabling thing
i want it all! dots team release the kraken!
some sort of code rewrite/inspection thing
it looks at your compiled dlls and does things to them
๐
kinky
haha
ive seen lots of unity games use it for modding
im hoping i should be able to dynamily load code during game start, so that i can have modding built in to the game
thats one thing i wish unity had far better support for
anyone tried dynamic code loading and ECS? i worry that the Systems/burst wont like it
burst wont work with it
now the important part, to run the shit and hope it works
but burst is a runtime compile step yes? so as long as the dlls are loaded before it does that it should work?
from what i understand modders wouldnt be able to write their own burst jobs
well that will be a issue
oh well worry about that much later
already got data loadable as mods so maybe that will be enough ๐
nice
theres a way to burst compile a function pointer on demand right? ive seen that somewhere
i guess i could have some sort of system that loops over a list of those function pointers that modders to make/add
it would actually be a very advanced modder who could even make burst compatable mods, like took me weeks to get my head around structs, they would need to do the same
its probably not even worth it
Updating to new entities packages just to see if it breaks something...
there is a new entities package ? ๐
looks like a small maintenance/depracation update
aww
yea - AddComponentObject fix is welcome and it looks like NativeList has a couple of new remove methods but that's about it
what is the fix ?
mostly that it broke the entity debugger for an entity that you did AddComponentObject with
ah okay
- Fixed exceptions being thrown when inspecting an entity with a GameObject added through
EntityManager.AddComponentObject
also I assume this will be important for some:
* Prevented remapping of hybrid components during deserialization which caused IL2CPP builds to fail on a missing property bags.
I have a 2d array operation that I am converting to use jobs.
One of the things I'm doing with it is adding values from another 2d array at an offset postion.
I converted it to a flattened native array.
It's possible that one of the arrays is smaller. In which case I optimized via finding the common rectangular section and looping over that.
This means that I skipped over cols that do not need to be modified.
This is how that looked: https://pastebin.com/A5TfgJvW
Now if I use parallel for, I can't skip like that.
Parallel for jobs are scheduled with a startIndex and a length. Which means it will try to read the entire row sequentially.
Would a normal IJob be better?
Will try it ๐ thank you
@sudden comet It seems thatconversionSystem.AddHybridComponent(_collider);during conversion did the trick
I also had to make this NavMesh update calls
.WithChangeFilter<RenderEntityComponent>()
.WithAll<RenderEntityComponent>()
.ForEach((Entity entity) =>
{
NavMeshSurface navMeshSurface = GameObject.Find("NavMeshGround").GetComponent<NavMeshSurface>(); //:TODO: :HARDCODED: :FIX: this
navMeshSurface.BuildNavMesh();
Debug.Log($"{nameof(navMeshSurface.BuildNavMesh)}");
}).WithoutBurst().Run();```
to be updated after
`[UpdateAfter(typeof(CompanionGameObjectUpdateTransformSystem))]`
Is there a simple way to tell unity that I don't need the results of a job?
Like: The entity who requested it died. It was uding persistent native arrays.
And I have to keep track of evry job handle and complete them before disposing those.
Anyone else gets URP 9.0 errors in Unity 2020.2.0a15?
you use the ancient preview from package manager?
I wouldn't wonder if it's broken by now
if you dont mind extra git clone, I have a branch here that should work for URP, this is up-to-date with current master and hdrp/staging from github (so bleeding edge 10.x URP + HDRP)
https://github.com/0lento/Graphics/tree/a15-staging, but like with any Graphics repo fork you need to clone it with git lfs for it to work
I've reverted two changes on that branch that require c++ changes that haven't landed on a15 yet
other is for URP's 2D fixes and other is for HDRP's fast memory access
@viral sonnet ^
@ocean tundra I am using an asset UMod that Im able to load ECS mod code with (with a few manual stopgaps) but no luck with Burst so far
do note that since it's bleeding edge, a lot of things can be broken + it also has upcoming shader graph change (so your SGs will look totally different)
but I also don't really understand Burst well enough to know how to approach getting it to work
oh thanks ... didn't notice the URP package manager version is old ... why is unity doing this ...
well, they simply haven't released a new version
there's a ton of work going on atm so I'm guessing they haven't gotten a setup that's stabilized enough for a new release
yeah i see, not really a problem. i'll just stay on the current version which is stable for me (2020.2.0a13 and URP9)
Can anybody help me brainstorming? How would you go about using a grid in ECS?
I am currently having CellPosition components and a System which reads from it and writes the resulting position into the Position component
But its kind of weird to access unitys grid in the system to read its values and then having to "copy" its CellToWorld method because I cannot use it directly
I am thinking if it may make sense to have a shared component which is basically a copy of the grid settings (size etc.)
@pulsar jay I personally don't think the grid is even needed, just create your own grid overlay and have positions/coordinates decide the rest. The gird I feel just makes it more complex.
@cursive cosmos so you mean I do not need the Unity Grid component? I guess even if I dont use it I would need some way of authoring the custom grid
Question: when and why do i want to use class icd's?
@deft stump store link to material, mesh, or texture. Any managed data...
and bake this managed data in SubScene
I mean, a custom grid component does not take too long to make.
In the end, the grid is only a visualization of a flat coordinate system.
Class ICDs make their data effectively exists "outside" the DOTS system. the documentation suggests this might be useful while porting code from gameobjects. It might also be useful if you have a specific thing you want to do that isn't allowed for a struct ICD.
@cursive cosmos Sure I was just wondering how to integrate it into ECS. I guess using the conversion workflow with an authoring component wouldnt make much sense would it? Because I would only have one grid and would have to access it together with each CellPosition component
So I thought maybe it should be a shared component? Haven't found much about the workflow with those though.
@pulsar jay What are you trying to achieve here? What's the use case?
Have a grid of tiles or something?
Yeah thats basically it. But it can be various different tiles which can be "painted" onto the grid
Painted at runtime, or just in editor?
in best case both
At runtime you would need some system (as in mechanic, not necessarily ECS) to get the position of that and selected tile etc, and you'd design the system to be a bit more flexible. if it was editor only you could do a much simpler "convert once" from the gameobject tilemap or something like that.
@pulsar jay I prefer doing everything in code, so I actually stopped using the conversion system
+1 I am not too fond of the conversion system. Good for quickly making things that work, but rather messy - if nothing else I would want custom IConvertgameObjectToEntity to get things exactly how I want it.
I actually had a kind of conversion workflow going on before using ecs where it would use gameobjects in edit mode but DrawInstanced of custom batches at runtime
Now, this is the Data Oriented tech Stack here, and my thoughts is that you need a good representation of the data (ie. grid), and some way to translate that to visuals
But it adds some error potential and some stuff has to be implemented twice
So more questions! Do you have a set size of the grid? Like, do you know when you spawn the entity it that it will be X*Y, and never change? There could still be multiple grids in the game, of course,.
If you either need infinite size or don't know how big it will be, you need chunking, ie. splitting into into "chunks" (non-ECS) of tiles
atm it is basically a randomly sorted list of cell positions and indices
it is not limited
So unlimited size grid?
yep
I am also still torn between just serializing the entities or using my own (more compact) format
There we're into very familiar territory... I have discussed and thought a lot about procedurally generating block/tile worlds. This, of course, first requires you to have a method to hold all that data.
Some conclusions, decisions and assumptions, which might not apply to you:
-I want to support an arbitrary sized world
-I want fewer entities to reason about
-I want to split systems into the smallest pieces that make sense
Thus I need:
-A good way to hold the data of a Chunk of my world.
-->This means flat collections
-->Each chunk is one entity, and one entity only (special cases allowed for pieces therein)
-->Sizes are constant during runtime, the same on all axes, and defined by some constant in the code so I can experiment with different sizes
-A system to create chunks around the player
-A system to load/generate the data as needed
-->And another to save
-A system to read the chunk data and create the visuals (in this case, create a RenderMesh)
-Helpers to make working within this easier (convert between world, chunk, and block-within-chunk("chunkInternal") coordinates
-Helpers to convert between 3D positions and flat array indices
This is for Minecraft-style 3D block(voxel) terrain - 2d makes things somewhat simpler.
Possibly the most complex part is creating the visuals from the data - I've done this before in gameobjects and will apply a similar method once I get there in my DOTS VoxelGen toy project.
The complexity is in working with RenderMesh, especially when it comes to textures - a texture atlas with all tiles and setting the UV coordinates is the way i'm gonna do it
Sounds like its going in a similar direction. I guess chunks and loading/unloading at runtime wont be necessary for my current use case though as it will not get this big
I guess instancing will help a lot in my case as many of the tiles are the same mesh
Your use case sounds a lot like Minecraft btw.
That also came into my mind when I thought about interesting testcases for ecs
In my case, each chunk (size not decided yet, but probably larger than 8x8x8) is one mesh, procedurally built, and the entire thing has one texture.
And yeah, I'm basically remaking Minecraft's worldgen systems in ECS. As I said, toy project ( to learn more about ECS)
Are you doing 2d or 3d?
And yeah, I'm basically remaking Minecraft's worldgen systems in ECS. As I said, toy project ( to learn more about ECS)
@tawdry tree Sounds really interesting
I am doing 3d
Blocks(+other simple models) or arbitrary models? because the latter means it becomes a lot harder to do one entity with one mesh like I'm doing
And if you suddenly need a entity for each thing in the grid... that gets real big real fast
its arbitrary models. I figured the conversion worklow might work well for that case though. I can build the Tiles as prefabs, convert them to entities and than duplicate it all around the map based on the map data
That sounds reasonable
having on one entity for each tile is the current plan. The map is kind of "limited" btw. there is just no fixed limit
In such a case you'd still want a helper to have world<->grid conversion in one place (to avoid different code leading to misplaced things
So arbitrary, but finite size
So arbitrary, but finite size
@tawdry tree thats correct
Then it should be fine-er to do one entity per grid position. At least if it's pretty flat (so not 100+ meshes per horizontal grid cell) and/or sparse (not every cell is occupied)
yeah its more like a height offset + multiple layers than a complete grid in y direction
atm I have a system which sets the position component with the data it gets from the cellposition component
but I basically just read each of the values out of the grid into value types to get it into the lambda expression which feels wrong
because I cannot pass references into the lambda expression
@toxic mural Sweet thanks for letting me know, at least you got some code loading
Yeah there are some "gotchas" I ran into, but I think if the ECS code is compiled with Unity, I dont know why Burst wouldn't work
@pulsar jay Is this on conversion?
Because what I'd do there is to basically convert whatever your data source is into an array containing a little struct of int3 cellPosition and whatever data you need to place the cell contents - preferably an int, if or some other identifier to use against a lookup, if possible.
But I also barely/dont understand what burst is, so I dunno
@toxic mural Full code based mod support is way down on my TODO list ๐
maybe by the time i get to it Burst can be called on demand
It's a compiler. It takes human-readable code, and makes it into machine-runnable code.
The default C# compiler compile to a format which needs an interpreter to work (so you need to have .NET installed to run it), but other languages (and other C# compilers) go straight to usable machine-code
Personally I'd say just spend the $40 for an asset that does it, or 90% of it
Yeah atm I have scriptable objects basically containing lists of int3 and int and have a MonoBehavour which reads it and creates all the entites. the system will just move them to the correct position afterwards
hmmm maybe, my stuff feels pretty custom tho
If the asset is done well and work, and is battle-tested, then for sure
@tawdry tree For Burst specifically, does it only ever happen at runtime? Like it takes the compiled stuff and redoes it into burst? Or is it a compile time thing where a DLL can contain bursted code?
Whatevr you make would likely be a bit more specialized, but also inferior in most other aspects
I thought Burst was runtime into a cache
You mean compilation? That's on build. I don't know the specifics, but if I had to guess Burst either makes directly runnable code, or code which is hyper-optimized for the interpreter to use effectively. My understanding is that it bypasses a lot of the normal interpreter things to have more control (and also more danger)
Yea it's compiled to a dll file and loaded on runtime
Thats cool
ty for the test
Someone was saying we wouldn't be able to have bursted code in mods so I've been trying to find out exactly why
but maybe we can it seems
hmmm i thought it was runtime compiled for mono builds
but maybe you could grab that burst generated dll somehow and load that dynamicly?
Theres an article "analyzing burst generated assemblies" buts its about two years beyond what I understand
I should probably focus on making the game happen first rather than making it fast
@toxic mural haha i keep doing the same thing too, wanting to play with optmization stuff instead of working on core game features
that article looks great, going to read it now
maybe a dumb question, unrelated to burst things.
Is it worth centering my game map so 0,0,0 is the Center? Currently its a corner
the maps are expected to become quite large but not insane
What magnitude are we talking here? 100's of Unity units? 1000's? 10000's? Anything in that range should be fine unless you have things which needs really high precision
@ocean tundra URP has relative rendering so it doesn't matter anymore as long as you stay in float min/max absolutely in coordinates
Probably within 10k but its a RTS so would love to go MASSIVE ๐
@viral sonnet Didnt realise that had made its way into URP, thought it was HDRP only
If you find the width to be limiting, just go UP!
in standard rendering lightning breaks further away long before float is exceeded
maybe i will center it but it will likely only ever be 10k
then it won't be a problem
yea
@tawdry tree if all your blocks are going to have the same size texture, you can use TextureArrays instead of a sprite sheet, letting you keep all your UVs the same.
Hmm, shader stuff.
I really should learn more about that, but my mind was pretty much fired after each session of the graphics programming course back in school, so I have no fond memories of it...
TextureArrays are pretty simple, and I think can be done in ShaderGraph now.
I think you still need an editor script in order to create a texture array asset, though.
as far as I know, Unity never provided a way to do it through the GUI
Is DefaultGameObjectInjectionWorld the most control we have over the hybrid conversion process? We can't like put a component on a gameobject that causes it to spawn in a specific world?
If your using subscenes or gameobjectconversionutility you can control the target world
but that gameobjectentity thing you have to mess with that Default World variable
there is a issue with it
its slow
so for every gameobject you want to convert, it will create/setup a whole conversion world. do the conversion, then clean it all up
so i've wrapped mine up in a mainmenu background process and then cache the results (world serialization)
but subscenes would be best if you dont need to convert at runtime
Oh ha main menu background process, so like while the user is clicking New Game you're in the background processing things and serializing them?
on game start basicly
so when sitting in mainmenu, all game setup, any logos/splash things ill do my conversion
Yeah thats cool
but i also store the caches in streaming assets, so when playing in editor it makes them all on play and then bundles them with the game
so they should only ever rebuild if the player messes with the mod lists or i do a data only update
Dang thats smart. I'll try and do that too actually
sweet
i have some code that may help
the issue with world serialization is it just gives you a array of Unity Objects
things like mesh's and materials
saving those at runtime is a PITA
and is silly as they should be game assets
so i built a thing to take a asset and give me its Addressable address so i can load it next time
when you get to world serialization let me know and ill share it
Will do
its my biggest annoyance with Addressables, why cant i get the address from something ive already loaded
I thought Addressables might be a solution to a different problem of mine, I took one look at making a custom resources locator and nope'd out
I mean at least the manual seems thorough
a custom resources locator?? i barley know what that is, what will you use it for?
My problem is, the mod solution I'm using has its own LoadAsset() way of doing things, so I need a way to let Addressables see into the mod objects
on addressables groups made asset and add those to mod objects should it solve it in your case?
in your script it should find them from the mod asset group
The problem is all the Addressables meta data that gets generated, I can include it in the mod file but I'm not sure how to load it at runtime so addressables can add it to its catalogue
there is a method somewhere in addressables to load a catalogue
i plan on using that for mods that add assets
does anyone know why Entities 0.11.1/Burst 1.3.2 on Unity 2019.4LTS might be throwing 300+ errors of this nature on every single assembly recompile?
Looks like it is caused by an ExecuteAlways system we use to manager instanced renderer material properties, but I'm not sure why ExecuteAlways system would be invoked in the middle of solution rebuild. How can I stop this?
are you using subscenes?
Not that I'm aware of, just one traditional scene
it's an editor targeting system that's supposed to work on renderers even in edit mode so gating it by isPlaying doesn't make sense, sorry
oh its only for in editor...
it's for both, hence ExecuteAlways
is there a bool somewhere in unity like is building/is compiling?
also im guessing your creating a bunch of native containers in oncreate and destorying them in ondestory?
there is, it's EditorApplication.isCompiling. but what would I do with it? the fundamental issue is that OnUpdate of systems is called by Entities while that value is true, so gating individual systems feels like a bandaid. what's more, OnUpdate methods aren't allowed to bail or return null, they must return a JobHandle
oh use system base
is that something new? I just updated from 0.1 to 0.11 today
**ComponentSystems are deprecated
oh that's good to know
they are only still around cause some conversion stuff needs them
my guess is the assembly reload isnt letting you finish safely or not calling on destroy so your native collections die
I'll get to that then! could you tell me if 3 previous issues I hit with 0.1 to 0.11 upgrade sound right?
- World.Active is no longer a thing. Since the only places where it was referenced were external utility things creating entities and not systems, I just replaced it with World.DefaultGameObjectInjectionWorld
- SetFilter is no longer a thing. I'm assuming its equivalent is SetSharedComponentFilter (renamed to reflect its only intended for shared components?)
- GetComponentVersion for chunks seemed to be renamed to GetChangeVersion
you updated from 0.1 directly to 0.11 ? o.0
World.DefaultGameObjectInjectionWorld yup thats fine, but not inside systems. just use World for that
SetFilter again that sounds right, i dont actually use any filters so not 100% sure on usage or anything
yeah we were using 0.1 along with 2019.2 for a very long time and just updated to 2019.4 LTS today, so we figured it might be a good time to jump forward to latest entities package
haven't had time to follow every release over past year
oh you should keep updating and go to 2020.1beta
they said after the next update all entities packages will be 2020+ only
I don't think it's appropriate for a project on legacy pipeline that's supposed to release in 3-4 months and has lots of third party dependencies.
where did they say this ? @ocean tundra
oh yea no if thats your timeline dont update
so we'll be sticking with whatever would be available for 2019.4 lts
am I understanding right that package manager would just ignore any versions higher than compatible ones and there is no need to keep track of exact releases that are last to support it?
yea pretty sure thats right
I find it pretty weird in a bad way that you have to be on a beta to get the latest versions..
when making a package you have to say what version of unity it supports, as long as they update that correctly you wont see newer packages
@zinc plinth it actually makes sense to me, 90% of entities is all in the package, but a small bit needs unity core changes, they can only really make those in the latest betas
I didn't say it didn't make sense, it really does
I meant that policy-wise
its annoying tho
yes
i really need to update tho
im on 2020.1b7 and entitys v0.10 i think
always terrified of updates
where can I find a reference page highlighting differences of new SystemBase vs JobComponentSystem? there is no information whatsoever in the package changelog
and i dont even have far to go
unless 0.12 fixes my weird af bug with broken physicscolliders I don't think I'll upgrade
@plush stirrup i think the main docs is your best bet
oh wow it had a update
this bit is the main links
Entities.ForEach -- the simplest way to iterate over ECS component data.
Job.WithCode -- execute a lambda function as a single, background job.
IJobChunk -- a "lower level" mechanism for iterating over ECS component data chunk-by-chunk.
C# Job System -- create and schedule general purpose C# jobs.
umm the key things i remember
ForEach does magic code gen
you can use 'in' to mark a component type as read only, that means its change version number wont increase
for JobComponentSystem/IJobForEach/JobHandle equivalent, is the Job.WithCode example the correct one, or is simple ForEach capable of doing same thing?
you can do the same thing with ForEach
when you do .schedule there is a overload where you can pass a job handle
and it will return a job handel
is that in addition to or instead of ScheduleParallel overload?
ScheduleParallel should have the same option
ah alright, I'll try that, thank you!
you can also mess with the Dependancy property yourself
im unsure how good that is tho
is there a way to post code snippets here or is this Discord usually using some code pasting website? I can't seem to get standard code shortcut (triple tilde) to work
oh, it no longer shows up in post preview while you type, weird. sorry then!
use cs after the 3 ` and it will format it as c#
so I'm a bit confused about job handles and Schedule. previously what you did was declare a method like this, which was dependent on also declaring an IJobForEach struct:
{
var job = new PropertyAnimationJob ()
{
};
return job.Schedule (this, inputDeps);
}```
however if you use new SystemBase, you don't declare any structs, which means you can't be responsible for setting a unique job up (you just use that ForEach lambda thing), and can't really pass input dependencies through. does that mean I actually don't have to worry about providing any arguments to .Schedule () call?
is a reference to currently running system and input dependencies implicitly provided already?
here is a simple example of a system that does nothing but increment the version. is this a correct way to update it from JobComponentSystem to SystemBase?
[UpdateBefore(typeof(PhantomRendererSyncSystemV2)), AlwaysUpdateSystem]
[ExecuteAlways]
public class PhantomRendererPropertyAnimationSystem : JobComponentSystem
{
struct PropertyAnimationJob : IJobForEach<AnimatingTag, PropertyVersion>
{
public void Execute([ReadOnly] ref AnimatingTag tag, ref PropertyVersion property)
{
property.version++;
}
}
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
var job = new PropertyAnimationJob ()
{
};
return job.Schedule (this, inputDeps);
}
}
[UpdateInGroup (typeof(PresentationSystemGroup))]
[UpdateBefore(typeof(PhantomRendererSyncSystemV2)), AlwaysUpdateSystem]
[ExecuteAlways]
public class PhantomRendererPropertyAnimationSystem2 : SystemBase
{
protected override void OnUpdate()
{
Entities.ForEach
(
(ref PropertyVersion property, in AnimatingTag tag) =>
{
property.version++;
}
)
.Schedule();
}
}```
close
{
protected override void OnUpdate()
{
Entities.ForEach
(x =>
(ref PropertyVersion property, in AnimatingTag tag) =>
{
property.version++;
}
)
.Schedule();
}
}```
missed x=>
does that mean that the example in the documentation is incorrect?
๐
you can also use Entities.WithAll<AnimatingTag >
instead of marking it as 'in'
but thats only if you dont use it
does that also imply its read only?
in = readonly
yeah, and same with WithAll?
ah
so WithAll is equivalent of generic arguments on old IJobForEach and signature within ForEach block is equivalent to old Execute method signature?
{
public void Execute([ReadOnly] ref AnimatingTag tag, ref PropertyVersion property)
...```
with all is just about filitering to select just entities that have that component
but dosnt read/write to it
ah right. that's a nice syntax, reminds me of Entitas queries
is specific order of these overloads important?
e.g. With* always first, Schedule* always last?
ok then just for style consistency
schedle probaly has to always be last
is the body of ForEach lambda expression subject to any code generation shenanigans that might break if I skip curly brackets for a one liner content?
ok I'll play it safe till I see everything works and I'll try then ๐
you can see the code gen tho
if nothing else, this is already a giant reduction in line count
DOTS => Dots Compiler
yup[
way nice
theres also some sort of IEntityJob comming soon
for people who dont like the lamder
EntityQueryDescValidationException: EntityQuery contains a filter with duplicate component type name PropertyVersion. Queries can only contain a single component of a given type in a filter.
{
Entities.WithAll<PropertyVersion, AnimatingTag> ()
.ForEach
(
(ref PropertyVersion property, in AnimatingTag tag) =>
{
property.version++;
}
)
.Schedule();
}```
I guess that means that PropertyVersion is now always implicitly filtered for?
so dont have the component is both with all and the foreach
the animation tag should be in with all (as you dont read or write)
and property version in just foreach (as you do read/write)
ah, I see - the only reason to use in with that second one would've been actually reading something from that component in the body of the function
makes sense
yes
uhh, how about no, Unity:
error DC0032: Entities.ForEach Lambda expression exists in JobComponentSystem PropertyAnimationSystem marked with ExecuteAlways. This will result in a temporary exception being thrown during compilation, using it is not supported yet. Please move this code out to a non-jobified ComponentSystem. This will be fixed in an upcoming 2020.2 release.
it actually looks like no exceptions are being thrown on my side anymore, moving it to SystemBase nicely fixed all exceptions JobComponentSystem had
thanks for guiding me through it @ocean tundra !
apparently, at least till 2020.2. they always seemed to work fine so I'm not sure what changed there.
good to know!
does it make sense to just wrap that in conditional compilation?
.Run()
#else
.Schedule()
#endif
yea probably a good idea
same warning. I think I'll just live with the warning, it seems to trigger no matter whether I use Run or Schedule.
oh i thought those were the new compile errors
good thing is, now that Entities have separate order version and change version and per array checks we might not even need this version incrementing system anymore. with those in place we can potentially change our rendering system to still detect chunk changes and upload parts of the buffer to GPU without having to manage a special tag and hijacking versioning.
it's awesome how far it came from 0.1
for change filters theres WithChangeFilter
it only works on the internal component version
which only goes up when you use Ref
and if you use a job chunk thing you can manually control when that component version goes up (as its per chunk)
anyone know how to build inspectors for DOTS yet?
I want to show the string of a guid there
burst 1.3.2 is up ๐
## [1.3.2] - 2020-06-16
### Added
### Removed
### Changed
### Fixed
- Burst package has been upgraded popup could fire erroneously under shutdown conditions.
- Debug information for anonymous structs could be created partially multiple times for the same type.
- IntPtr.Size now correctly returns int32 size (rather than UInt64) - fixes an assert.
- Fix safety checks in editor to not log a warning. Safety checks are now restored to true when restarting the editor and are no longer stored as an editor preference.
can anybody tell me what the advantage is of using reciprocal squareroot for normalization in math library: rsqrt(dot(x, x)) * x
just curious
since the dots math library is designed for vectorization, I assume they will take advantage of reciprocal sqrt instruction sets when you do things properly
some people still use that fast inverse trick, but that isn't faster anymore, its actually slower
so there is a specific reciprocal sqrt instruction that will be used by burst compiler?
I don't know what burst does under the hood, but I would be surprised if it didn't
arm had that in their instruction set for years iirc
so did intel
I'm a bit fuzzy on intel though, I might be remembering their avx512 stuff
not really a simd guy myself
good to know. I am not well versed in this simd and vectorization stuff
Btw. I am trying to extend math atm. At first I was happy that its partial because I thought I could just extend it. Figured that didnt work because of different assemblies ๐ I guess this is more of a convention thing but how would you go about extending math? Making a new class in the same namespace with the same conventions (e.g. math_extensions) using a separate namespace etc.
It seems to be the intended workflow to use "using static Unity.Mathematics.math;" when using math but I guess there is no way of getting cutom methods into this without requiring a second using static for another class or is there?
Quick questions... hopefully someone can answer me my question fast
How do i listen for click events on entities using dots ?
For example... we have gameobject spawned in, we click on one... we wanna print a message... is this possible with dots ?
Did I miss something? I cannot see hybrid renderer package anymore in the package manager now using 2020.1.
it didn't show up even before that by default @prime cipher
preview packages are hidden by default
what did change however is the way you enable preview packages visibility on package manager
in past it was on the package managers top menu dropdown, now it's enabled from project settings
@dull copper That was it, I missed that option. Was thinking it is enabled as I saw preview packages, but just the ones converted from older sdk, as I updated the project to 2020.1. Thx!
how convert tilemap to entity?
I am getting unsafe pointer exception from this...
https://hatebin.com/uhfihynmiz
why?
oh, there's been small entities update
## [Entities 0.11.1] - 2020-06-09
### Fixed
* Prevented remapping of hybrid components during deserialization which caused IL2CPP builds to fail on a missing property bags.
* Fixed exceptions being thrown when inspecting an entity with a GameObject added through `EntityManager.AddComponentObject`
* Fixed load order of JobReflection static methods which were causing `InvalidOperationException: Reflection data was not set up by code generation` exceptions in player builds.
### Changed
* An exception is now thrown during serialization if a shared component containing entity references is encountered.
### Removed
* Removed expired API `World.AllWorlds`.
* Removed expired API `EntityComponentStore.CreateChunks(Archetype*, ArchetypeChunk*, int, int)`.
* Removed expired API `EntityManager.CreateChunk(EntityArchetype, NativeArray<ArchetypeChunk>, int)`.
* Removed expired API `EntityManager.LockChunk(ArchetypeChunk)`.
* Removed expired API `EntityManager.LockChunk(NativeArray<ArchetypeChunk>)`.
* Removed expired API `EntityManager.UnlockChunk(ArchetypeChunk)`.
* Removed expired API `ArchetypeChunk.Locked()`.
* Removed expired API `struct NativeArraySharedValues<S>`.```
oh, new physics package also landed today ๐
changelog for the Unity.Physics 0.4.0-preview.5 is too long to paste here
there are some good stuff at least ? ๐
so no one know?
ah the changelog (and 0.4 docs) are live here: https://docs.unity3d.com/Packages/com.unity.physics@0.4/changelog/CHANGELOG.html
ooo nice physics update
I'm guessing this one has that solid stateless stacking now which they showcased on the Unite Now talk
some highlights here https://forum.unity.com/threads/unity-physics-0-4-0-steps-onto-the-stage.914972/
Learn whatโs new with Unity Physics and Havok Physics for Unity. In this video you will get a brief recap of our Unite Copenhagen talk, then a deepdive into a cool example of how you can convert a GameObject-based simulation over to the Data-Oriented Technology Stack (DOTS).
...
is it this?
PhysicsStep.SolverStabilizationHeuristicSettings to enable and configure solver stabilization heuristic. This can improve behavior in stacking scenarios, as well as overall stability of bodies and piles, but may result in behavior artifacts. It is off by default to avoid breaking existing behavior. Setting it to true enables the heuristic and its default parameters.
I'm trying to thumbs up Scorr's forum link but discord keeps putting it into wrong messages ๐
I hate this current setup where they don't put reactions on the same line height
hahah
how convert tilemap to entity?
@halcyon plume
are you talking about unity's 2d tilemap? you can't really convert that into entities but you can reference it from ecs or maybe add it as a managed component
hmmmm... Havok.Physics 0.3.0-preview.2 that is compatible with the new Unity.Physics release is also out now!
it's not on the registry query
also PM only lists 0.2.2
@halcyon plume if you don't have to read it at runtime i'd prob use the tilemap as a 'baked' thing and convert anything you need to read from it (e.g. colliders if you're using ecs colliders) to entities at runtime when game starts (could also maybe bake it before game starts but that's more work)
woah that's a big post on heuristics
I need for random map generation, which means working in runtime
anyway, from that forum thread:
Here are some highlights from the release:
* NOTE: This update required making some changes to the authoring data layout for physics material settings. This change affects both PhysicsShapeAuthoring components and PhysicsMaterialTemplate assets. To ensure all your prefabs and scenes are upgraded correctly, back-up your project and then run the data upgrade tool immediately after updating Unity Physics. You can access this tool in the main menu under Window -> DOTS -> Physics -> Upgrade Data
* Added new settings for improved Solver Stability. Discussion thread here.
* Added Data Flow Graph nodes for querying objects in a collision world
* Changed various pair interfaces to direct accessors (ex. EntityPair is now EntityA and EntityB)
* New APIs and data protocol for joints to permit modifying constraints at run-time without using unsafe code. See the new Modify Joints scene in the sample project for example usage.
* Various new components and utility methods to simplify common operations, such as applying explosion forces (1c. Conversion samples), matching kinematic bodies to direct/animation input (5d. Kinematic Motion sample) and temporarily changing a dynamic bodyโs kinematic state (5a. Change Motion Type sample)
* New AddInputDependency() and GetOutputDependency() methods on core physics systems to provide proper control over custom system scheduling
* Added support for multiple PhysicsShapeAuthoring components on a single GameObject to create a compound collider
* Reworked collision and trigger event samples with all-new DynamicBuffer-based approach for more robust stateful event handling.
* API compatibility with upcoming Entities 0.12.0. Unity Physics should be ready to use as-is once it is released!
* Bug fixes!
* General performance improvements!
upcoming Entities 0.12.0 ๐
well, it's likely to be 0.12 after 0.11 ๐
i wonder what kind of improvement they are going to do
last few were.. very abstract to me, like.. stuff that only %1 of the users would do
hopefully we will see more juicy stuff
i REALLY would like to create entity prefabs
I woudn't mind if they just actually... kept refining and stabilizing the api for 1.0
instead of redoing the API every second release ๐
oh i forgot, enable/disable will come as well, at one point
Don't forget unmanaged systems
I have multiple entities that each hold a DynamicBuffer with information (populated by a targeting system); I would already be elated to get this to work with a single IComponentData.
I want a system for multiple other entities, that each have a ComponentData referring to one of the other entities, to pick an element from that buffer and modify another ComponentData on themselves.
How do I do this in SystemBase, ideally parallelizable?
I tried something with chunks but that always results in the native arrays of the targeting (first) entities to be zero length.
public class PickTargetsFromProviders : SystemBase
{
private EntityQuery m_Group;
protected override void OnCreate()
{
m_Group = GetEntityQuery(
ComponentType.ReadOnly<AimAxis>(),
ComponentType.ReadOnly<LocalToWorld>());
}
//Aiming Entities observe TargetProviders as subjects and pick their favourite target
protected override void OnUpdate()
{
var subjectType = GetArchetypeChunkComponentType<TargetProvider>();
var targetType = GetArchetypeChunkComponentType<Target>();
var chunks = m_Group.CreateArchetypeChunkArray(Allocator.TempJob);
Entities
.WithReadOnly(subjectType)
.WithReadOnly(targetType)
.WithDeallocateOnJobCompletion(chunks)
.ForEach((ref Aim observer, in LocalToWorld localToWorld, in Owner owner) =>
{
//Reset Aim positions...
observer.position = localToWorld.Position + localToWorld.Forward;
//Try to find targets and write fresh aim positions
for (int c = 0; c < chunks.Length; c++)
{
var chunk = chunks[c];
var subjects = chunk.GetNativeArray(subjectType);
var targets = chunk.GetNativeArray(targetType);
for (int i = 0; i < chunk.Count; i++)
{
if (subjects[i].entity.Equals(owner.entity))
{
//pick target provided from subject
observer.position = targets[i].position;
}
}
}
}).ScheduleParallel();
}
}
I'm generally having an annoyingly hard time to have entities communicate with each other.
(in high frequency scenarios)
This code even tries to do it with JUST a simple ComponentData, not even a Buffer. It doesn't work for some reason.
(well, the reason is I don't understand chunks in respect to Entities.foreach)
The problem is that targets is length == 0
Ah oh. I think I'm using the chunk array wrong.
The entity query describes an observer, but it would have to describe a subject.
If I change the entitiy query, it doesn't run at all - of course, because I have no entities that have both TargetProvider and Aim.
I haven't fully processed the above but quick question - are you familiar with GetComponentDataFromEntity (GetComponent in SystemBase) and GetBufferFromEntity?
Yes,
I didn't realize it was GetComponent though.
But getComponent needs an entity.
That seems like it's one of these sync points going through entitymanager?
Yeah ok so I have a ComponentDataFromEntity, but I can't iterate over it.
That's why attempted something with chunks.
The original idea was to just look up the target provider directly (from ComponentDataFromEntity), BUT ... that leaves the exact same problem when I actually try to wire these connections up. (actually worse, because the hierarchy is kind of complex - so I'd have to change the structure of a lot of entities in a hierarchy, repeatedly, based on whether the parents are the same as in the original subject's component, which boils down to the same issue.)
I basically need a nested iteration over 2 entity archetypes.
Trying to look up best practices for save/load systems in the ecs way of things. Gโgling did not help, also in the forums search I did not find posts related to ecs. I thought there is maybe something I can use for my advantage instead of parsing and recreating entities according save file manually.
public class PickTargetsFromProviders : SystemBase
{
//Aiming Entities observe TargetProviders as subjects and pick their favourite target
protected override void OnUpdate()
{
var subjects = GetComponentDataFromEntity<TargetProvider>(true);
var targets = GetComponentDataFromEntity<Target>(true);
var lists = GetBufferFromEntity<TargetListElement>();
Entities
.ForEach((ref Aim observer, in LocalToWorld localToWorld, in Owner owner) =>
{
//Reset Aim positions...
observer.position = localToWorld.Position + localToWorld.Forward;
//Try to find targets and write fresh aim positions
//Trivial case.
var target = targets[owner.entity];
observer.position = target.position;
//List case
var list = lists[owner.entity];
// ... then do some selection math...
}).ScheduleParallel();
}
}
So this is how I imagine it, but now I need a way to teach each observer in a hierarchy who their TargetProviders are. this is, effectively, the same problem as before (but lower frequency, so I guess I can afford a sync point).
@prime cipher found a nice blog entry on entity serialization: https://medium.com/@5argon/unity-ecs-serializing-ecs-data-252231e5b16d
you can basically just reade write the whole entity chunks
^ was just about to link that ๐
@pulsar jay wow, thanks. Will have a Look. Mmmh, should have used serialization as search term too ...
@warm panther It's hard to guess what the relationship between these things should be. 'teaching an observer.. who their targetproviders are'? What is this sync point you're worried about? There's nothing obvious I can see from your scenario that requires one.
I have a multi-level hierarchy (4 or more levels deep) of entities (Parent and Child components); I know the "root" entity.
How do I iterate over all sub-entities that have a certain Archetype (componentdatas, tags, or otherwise), ideally without touching those that I don't care about?
(iterating this hierarchy is how I'd assign a TargetProvider to all the Aiming Systems, these are at different depths in that hierarchy)
Sync Point is: Code that must run on the main thread. Any time you need to ask the EntityManager for anything, you usually create a hard sync point. You then have to .Run your job instead of .Scheduling it.
Currently I'm considering, at conversion time, to create a registry of all these entities in the form of DynamicBuffers, and build a basic graph that way. It feels distinctly smelly, codewise. The hierarchy is right there, expressed in the entities. Why do I need a flat array that gathers them? And then, another array that gathers the arrays, etc. It feels... off.
These structures rarely change so maybe it will work, but there has got to be a better way.
I could build a selective structure somewhat like LinkedEntityGroup I guess.
i think what youre considering is the best or at least how I would address it, if your entity count is small enough you could try using the fixedlists components
Entity count is up to ~100 per hierarchy.
But fixedlists could help with some stuff, good point.
(and often near ~100, not rarely)
i dont think theres another way currently and im not sure if they really plan to make the transform system as accessible as the old gameobject version was
I don't think so either, actually. So... hmm. What I think other ECS like Entitas do right is that if you WANT, you could just do myEntity.hasTransformComponent or something, and decide on the fly, at no performance cost. (obviously the theoretical performance maximum of such a system is limited, as it lives entirely in managed code)
never used entitas or any other ecs personally ๐
Havok Physics and physics samples on ECS samples repo both updated now
It's quite nice but I think it could have drastically benefited from command buffers. Systems can change entity structure directly and it can be a mess, and most of your systems trigger on structural changes, which is very different from DOTS.
It's one thing I miss, I would like to have a reactive system that triggers when a component is added or removed from an entity, and doesn't do anything else. I think the ChangedFilter in queries can do that to some extent.
yeah was going through all the physics changes, i think i have tons of stuff to fix when i update the package
## [Havok Physics 0.3.0-preview.1] - 2020-06-18
### Changed
- Updated minimum Unity Editor version from `2019.3.0f1` to `2019.4.0f1`
- Updated Unity Physics from `0.3.0-preview` to `0.4.0-preview.4`
- Removed expired API `HavokSimulation.ScheduleStepJobs()` signature without callbacks and thread count hint.
### Fixed
- Fixed a crash when number of solver iterations is bigger than 255.
- Fixed incorrect contact point positions reported through collision events.
- Fixed behavior of joints to properly incorporate provided `Constraint.SpringDamping` and `Constraint.SpringFrequency`.
@warm panther A couple of thoughts - you can iterate through the linked entity buffers and check presence of components. You can also link things up in the editor - either via an exposed field or by eg using scriptableobjects set on a component that gets converted (letting you preserve some hierarchal independence).
probably a good thing I never tried entitas as I had no expectations of how an ecs package is really meant to work. cant be too disappointed if youve never known any better ๐
Timboc, thanks - that's kind of my thinking. I think I need to link it all up at conversion time. Later i want these lists to be editable (i.e. hardpoints to place turrets on, etc.), so... I guess lots of buffers. ๐
@warm panther In my case I have a component (just a fancy property draw that stores a reference to a subasset) then on conversion I add a component to the entity with just the instanceid of the asset. Later I have a system that recurses down linkedentity buffers to find ones that match the id. Obviously isn't the fastest method possible but it provides a nice editor experience I think. Depending on your own data structure you could do something similar but smarter (e.g. if you have ISCDs because of meshes for example). You can also very simply create an authoring component with a public Entity and it gets displayed as a GameObject field in the editor you can just drag a reference into. Not sure if that helps exactly, just some thoughts. A lot of it will also depend on when you know the structure - e.g. runtime vs edit time etc.
(Not sure I was explaining this well - the subasset that backs it)
Hey Guys, Are native Queues thread safe?
Like can i have JobA adding items to the queue and JobB reading them (if there are any there?)
More context/questions, I have Job(s) producing messages every update, then putting those messages in a NativeList which are then read by other jobs, each message type is its own native container
The producer jobs and consumer jobs are in different worlds too
I think they are not, and even worse, the "Concurrent" variant isn't either for most purposes.
What about Native Streams?
Hey Guys, Are native Queues thread safe?
Like can i have JobA adding items to the queue and JobB reading them (if there are any there?)
@ocean tundra Yes you can. But if you need determinism - NativeStream.
no i dont need determinism all i want is to be able to have the write and read jobs schedules and run at the same time
if no messages to read, just read them next frame
Simple sample
public class SimpleQueue : SystemBase
{
private NativeQueue<int> _messagesQueue;
[BurstCompile]
private struct Producer : IJobFor
{
public NativeQueue<int>.ParallelWriter MessagesQueue;
public void Execute(int index)
{
MessagesQueue.Enqueue(index);
}
}
[BurstCompile]
private struct Consumer : IJob
{
public NativeQueue<int> MessagesQueue;
public void Execute()
{
while (MessagesQueue.Count > 0)
{
var val = MessagesQueue.Dequeue();
Debug.Log($"Consumed - {val}");
}
}
}
protected override void OnCreate()
{
_messagesQueue = new NativeQueue<int>(Allocator.Persistent);
}
protected override void OnDestroy()
{
if (_messagesQueue.IsCreated)
_messagesQueue.Dispose();
}
protected override void OnUpdate()
{
Debug.Log($" --- FRAME --- ");
Dependency = new Producer()
{
MessagesQueue = _messagesQueue.AsParallelWriter()
}.ScheduleParallel(5, 1, Dependency);
Dependency = new Consumer()
{
MessagesQueue = _messagesQueue
}.Schedule(Dependency);
}
}
If jobs in different systems you of course should handle dependency between them by your self. But there is just simple general idea with NativeQueue.
Wait so read is dependant on write? so it wont run till after the write is done?
Yes of course, otherwise it's race condition and for this sort of things it's very bad idea of trying to write and read at the same time, no matter which NativeContainer you're using.
yea i figured it was a bad idea ๐ but i want to have no dependency between these jobs
as its my Server world sending to my Local Client world
so weird im having more issues with not having networking going ๐ when all the messages went via socket there were no issues
Even if you write your own container, based on interlocks for writing\reading in parallel at the same time (which is already hard to write this type of code) this will be very unpredictable in performance (as it like a time bomb which REALLY hard to predict, when and where it blows)
yea... im thinking now ill separate the native containers, and then copy messages from the server container to the local player container
I don't get what you mean
If it's server and client world - they separate by default, by design etc.
With own containers
only connection between them is requests
currently i share the same native container between worlds (server and local client)
and you anyway have its own queue of requests
for my messages
currently i share the same native container between worlds (server and local client)
@ocean tundra It's pointless
When your server and client will be on different machines
oh yea in this case its the same instance
They wouldn't have any shared containers etc
like player is hosting and playing
when networking between machines everything is fine
other players on other devices
For P2P (as it;s your case I guess) you anyway should separate Client and Server in the same way
yea but i dont want to have serialization/local socket connection for single player/local player
but i see seperating the containers seems like a good idea
then having something to copy the messages between them
You don't need serialization etc. here of course, what I mean it's have the same queue mechanism for host client
how you fill that queue up to you
for remote it will be serialization\request\deserialization
for host client it will be just queue with raw request\response data
Probably a dumb question, but what is the current entity as I loop over a chunk in IJobChunk ?
Asking because I want to do something like this:
private struct FindTargetJob : IJobChunk {
[ReadOnly]
public NativeArray<Entity> TargetableEntities;
[ReadOnly]
public ComponentDataFromEntity<Translation> TranslationFromEntity;
public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex) {
for (var entityIndex = 0; entityIndex < chunk.Count; entityIndex++) {
var translationOfCurrentEntity = TranslationFromEntity[???]; // <---
}
}
}
Note: The reason I'm not doing
[ReadOnly]
public ArchetypeChunkComponentType<Translation> TranslationChunk;
is because I also need to loop over the translation of OTHER entities in TargetableEntities.
I mean I could just mix the two approaches, but that doesn't feel right either.
I am not using anything dots related yet, but since everyone here is someone might know, I am using unity 2019.4.0f1 and if I am on play mode, and open either a tab with asset store or the project settings, the console gets swamped with
Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
no stacktrace or anything else to know where this is coming from
it keeps pumping the last warning
@wooden canopy did you turn on the Menu->Jobs->JobsDebugger?
no, because I don't even have the jobs package
not using it myself
seems to be something on unity side
Entities depends on jobs...
not using entities, nothing dots related
oh then its a bug in unity somehwere
asked here, because you all are using those, and the job system is core, so maybe you already saw something like this, or knew how to check
will try to add the jobs package and see if the debugger helps
na dont think it will
thats a bug in unity or a package somewhere
ive seen it
but i just keep updating so it disapeared
Probably a dumb question, but what is the current
entityas I loop over a chunk inIJobChunk?
@spark glade
Answering my own question from above, there is ArchetypeChunkEntityType if you need the Entity itself in a IJobHunk โค๏ธ
well, no, added jobs package, have job debugger enabled and leak detection with full stacktrace and nothing was shown
now added full native logging for warnings in the console and shows this
Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
#0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 ThreadsafeLinearAllocator::Deallocate(void*)
#3 ThreadsafeLinearAllocator::TryDeallocate(void*)
#4 MemoryManager::Deallocate(void*, MemLabelId const&, char const*, int)
#5 UI::UIGeometryJob(UI::UIGeometryJobData*)
#6 JobQueue::Exec(JobInfo*, long long, int)
#7 JobQueue::Steal(JobGroup*, JobInfo*, long long, int, bool)
#8 JobQueue::WaitForJobGroupID(JobGroupID, JobQueue::JobQueueWorkStealMode)
#9 CompleteFenceInternal(JobFence&, WorkStealMode)
#10 GeometryJobTasks::EndGeometryJobFrame(GfxDevice&)
#11 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&)
#12 GfxDeviceWorkerAutoreleasePoolProxy
#13 GfxDeviceWorker::RunExt(ThreadedStreamBuffer&)
#14 GfxDeviceWorker::RunGfxDeviceWorker(void*)
#15 Thread::RunThreadWrapper(void*)
#16 _pthread_start
#17 thread_start
@wooden canopy your best best is to submit a bug report
and new animation package ๐คฉ
shouldnt matter
you need to use the new build pipeline for them to be included
Platforms package and the sub platform(ie windows)
so I need to take another trip to the package manager
and new animation package ๐คฉ
@safe lintel whwaaaaaaaatttttttatatata???
no mention of URP in the changelog ๐ข
kinda wondering if urp wont come til the api stabilizes a bit
welp I dunno XD
dam i always forget im URP so cant use some of this stuff
roycon, how do I include subscene in the build?
I already tried adding the subscene in the build settings.
and also getting the platform Windows package
im not sure.. i thought it was automatic when you had the windows package
i dont use subscenes
instead kinda made my own
@deft stump what unity version + packages?
2020.1.0b12 + latest packges
hmmm that sounds right to me
and you have Platforms + windows platform
im not sure if they are still 2 packages
not sure then sorry
someone said something about a checkbox on the scene
but ive only see one for live link
i have three platforms packages, Platforms, Platforms Desktop and Platforms Windows
i had so many issues with sub scenes
I'm starting to feel your pain
yea. the idea is really good... but just didnt like me
soo
back tracking the chat
I need to use the new build pipeline...
but
I can't find it
is it in code?
if it is... why?
I can't find it
@deft stump you can't find the new build pipeline?
its controlled via attributes or a interface of some sort
walk me through it Nicolas.
its controlled via attributes or a interface of some sort
@ocean tundra wait seriously?

I'm having an anime girl moment right now
yea i think so.. they did experiment with a asset based pipleine
but think they back tracked on that
i could be wrong ๐
yeah, it took me a minute to find it myself, lol
The set it up something like this:
Note the "Scene List" does NOT need the subscenes.
yea i thought the backtracked on that>
so I just need to add the "Main" scene, build, and it'll work properly now
Also, do NOT use this anymore.
I keep doing it occasionally still ๐
why are there 2 ways to build a game in unity now...
well, this is the new way
until recently you couldn't even do the "BUild App BUndle" in the new system. So it's evolving rather quickly.
At this point, I just wish they make a separate editor JUST for dots
This is sooooo much more flexible.
@deft stump thats project Tiny i think
@spark glade have the confirmed thats the build system they are going to keep?
i'm also going to guess that we cant use Ctrl + b anymore
Touche, don't think I remember an official comment.
But by all logic this seems to be the right way to go.... ๐
Yeah subscenes are pretty great but also quite the pain still. I'm planning to use it to "prebake" all my prefabs into "binary format" ๐
Biggest headache right now is that there is no easy way to force them to rebuild.
๐ช
but i want to keep it as it allows easy modding
but some assets will make sense to be in a subscene
things that cant be modded
that way i dont need to build a 3rd custom conversion pipline
god I feel so stupid rn
I spent the last 3 weeks trying to understand why my specific setup was making Unity Physics debug component to shit itself
@spark glade is there a doc I can refer to about the new build pipeline?
turns out the Physics Debug Display Component is supposed to be a singleton
and I had it multiple times in my scene
so it just threw NativeArray deallocated error because OnUpdate was exiting before actually updating that array
there should be a throw here instead of just quietly exiting >< protected override void OnUpdate() { //Debug.Log("drawing component OnUpdate"); if (!HasSingleton<PhysicsDebugDisplayData>()) { return; }
make a post on the DOTS physics forum
they are even more active then the main DOTS forum
adding a debug.logerror or warning there will take 10 seconds
did a thread
sweet
I kinda did the advanced stupid move by finding that "bug", because unity already tries to keep this component as a singleton and doesn't let you spawn multiple of them if you spawn them "normally"
๐
I need to spawn those manually
would be very easy to fall into the same trap
need to do a "singleton entity" go and throw eveything in there
i cant use GO's
im trying to keep the game as 'pure' dots as i can
eventually ill need some GO's in the clients for effects and things
but server im sticking to the rule of no 'Old' Unity
as i dream of being able to use project Tiny for dedicated servers
Ho lord
okay
I don't have thzt kind of dedication haha
๐
the subscenes are built properly now
sweet
it still boggers my mind why we need 2 build commands.
yea thats why i thought it was all merged
are there any docs on it?
i will need to get it working with my build pipline after i upgrade
I'm actually looking for it
hovering over the options on the build pipeline doesn't tell me what those are
@spark glade is there a doc I can refer to about the new build pipeline?
@deft stump sorry, I did everything by trial and error ๐
turns out the Physics Debug Display Component is supposed to be a singleton
@zinc plinth haha yeah i had it on almost every single entity at one point ๐
dam it unity
just changing some random code, and unity explodes and dies
happening so often now
is there such a thing as too many asmdefs?
is this normal?
I'm just moving sprites around
It is the rendering side soooo... do I assume that it's normal? since well ecs so fast that my gpu can't keep up?
that means your job is waiting for another job to finish
most likely one of the Transform systems
ah nvm its gfx
I'm looking at the profiler with question marks in my brain...
i guess rendering is taking too much time
but it shouldnt i think..
do you have like 1 million sprite in your screen ?
is vsync enabled ?
disabled
I see not problem with that. Haven't seen it myself, but also haven't dug around in the profiler
Okay, that's... probably not entirely optimal
What's packages are you using? Gfx-related
it flats out when I spam the movement buttons.
but when i just tap on it, it spikes up
And I'm just moving 3 sprites
XD
there must be something else going on then
looking at the forums it's like a long standing issue.
when you disable your system that moves the sprite, what happens ? everything goes normal ?
If I dont move it's normal
@ocean tundra With asmdefs you want to minimize dependencies as much as possible, since everything depending on the assembly you're changing needs to be rebuilt. DOTS should make that pretty easy, though.
Apart from some common components and helpers, pretty much everything should be pretty separated.
perhaps Unity thinks your sprite is static ? so when you try to move it, it gets broken
i mean you can see plenty of videos that moves 1 million sprite without any issue
also, when you say sprite... what ECS components are in play?
I see nothing about visuals here, are you using linked gameobject?
Can you open Entity Debugger and observe what systems are taking long ?
no system are taking that long
Oh right, the linked gameobject (convert-and-inject) has SpriteRenderer (grayed out here), my bad
can you specific DynamicBuffers inside a CreateArchetype ?
adding the element type doesn't seem to do anything and using DynamicBuffer<type> throws by the TypeManager
?
I think it's just fine to do entityManager.CreateArchetype(typeof(bob)); where public struct bob: IBufferElementData; - are you saying that gives you errors? Compile time? Runtime? cc @zinc plinth
if I create an archetype with a IBED, it doesn't create the buffer when I want to get it after setting the archetype for the entity
so I have to Add it again when I convert my entity
and that's kinda supid because the archetype is supposed to take care of that..
that does sound annoying - your IBED has an [InternalBufferCapacity] set to something reasonable?
I set it to one & imediately set the size to what I really want (only known at runtime, and I want the buffer to be in heap and not in chunks)
but that shouldn't even matter
cuz the buffer simply doesn't exist after SetArchetype :/
is it just me having weird behavior again or do you know this ?
I haven't ever tried to create an archetype with a buffer - I've just been adding them later. Though at some point I might also want to do the same so let me know if you work it out. Could be worth posting on the forum unless anyone else here knows more.
I have a simply implementation of an ITriggerEventJob (no changes, component adds or anything in execute, nor do I use GetComponentFromEntity to access anything), resulting in the error shown. I understand, that TriggerJob might need to access this NativeArray behind the scenes, but that should not cause issues on my side, or? Don't get it
InvalidOperationException: The previously scheduled job NingrelTriggerSystem:TriggerJob reads from the Unity.Collections.NativeArray1[Unity.Physics.RigidBody] TriggerJob.EventReader.m_Bodies. You must call JobHandle.Complete() on the job NingrelTriggerSystem:TriggerJob, before you can deallocate the Unity.Collections.NativeArray1[Unity.Physics.RigidBody] safely.
Mmmhh, error is gon after adding physics bodies to the GOs before conversion. but no triggers seem to be handled.
hoooo interesting
seels like I was wrong, buffers are create with archetypes
but
if you're handling a buffer, and in that time you set a shared component for anothe entity, it moves the buffer and thus makes the instance we have to point at freed memory
it's normal that it does this, I just didn't think about it >.>
Did anybody else find the Build Manger in the Platforms package? Seems to be somehow connected to DOTS builds but I cannot find any documentation or anything ๐ค
does... ML agents work with DOTS? Oh... unity is prototyping it
Gfx.WaitForPresent is usually indicator that vsync is on or game is gpu-bound.
with ECS CPU is doing things so fast that it needs to wait for GPU to finish what its doing, hence its now GPU bound.
If thereโs a call to Gfx.WaitForPresent in there and says โcall is taking a considerable amount of timeโ, it means that the CPU is waiting for the GPU to finish processing all the rendering commands and, thus, weโre GPU bound
Soooooo...
it IS normal
30 ms tho
Yeah...
so thats more than just being GPU bound ๐

