#archived-dots
1 messages Β· Page 101 of 1
I have no clue why Run() for a IJobForEach job should return a handle either for example
what is it trying to tell me, that the job may not be completed?
That's what I'm saying, I never noticed it accepted/returned job handles
it's only for IJobForEach
My entire Unity Editor crashes when I do a blobAssetStore.Dispose();
No messages, no errors, no debugs. Entire process goes down. Any clue?
Youβre not allowed to dispose the asset store
@toxic walrus A man can dream π
Hello everyone! I started looking into DOTS very recently and I'm having trouble figure out what is the write way to code with this method. I've looked at many tutorials and they all seems to have their own way of doing things.
This tutorial was recently released, it's up to date and should give you a good idea of how to get started
@ashen flame https://www.youtube.com/watch?v=a9AUXNFBWt4
In this workshop style video we walk through an example project created by Unity Evangelist Mike Geig on how to script a Pong style game using Unity's Data Oriented Tech Stack (DOTS) including the Entity Component System (ECS). This video covers the latest syntax in Unity 201...
One tip you might want to keep in mind is that you don't need to use all of DOTS at once...
You could start with simple, non-job ECS first, then jobify some code, and then maybe optimize code for burst later.
It's also a useful way to prototype - just make something that vaguely does what you want it to in just ECS, and jobify once you know what you're going for.
Ok! Yeah from what I've seen it is not that hard to refactor the code to use jobs.
"I always like my code to be strongly typed, so I use a very loud keyboard." that guy lol
I don't understand why but as soon as I add some Data struct to my game object, it simply crash when I hit play.
Even though my game object is converted to an entity.
I tried disabling the Burst compilation but it did not change anything. I didn't even added a component system yet lol.
[2019-12-25T22:27:27.071Z][ERROR] [Unity Package Manager (Upm)]
Symbol file LoadedFromMemory doesn't match image C:\Dev\Unity Projects\Test 2019-03\Library\PackageCache\com.unity.ext.nunit@1.0.0\net35\unity-custom\nunit.framework.dll Native extension for WindowsStandalone target not found
* Assertion at ..\mono\metadata\metadata.c:1117, condition ``idx < t->rows' not met
is it worth having systems for task like input / camera? since is only one player controler
Hey ya'll I'm having trouble rotating hexes. Doing EM.SetComponentData(hex, new Rotation { Value = quaternion.RotateZ(180) }); turns this https://puu.sh/ETfFp/f610889b87.png into this https://puu.sh/ETfDC/4402f637ce.png
and thats what shows up in the debugger
i suck at trig so sorry if im missing something obvious here
@onyx mist it might* be because DOTS uses radians instead of degrees
(*there's a high probability but it could be something else)
I really love the new tag for generating an authoring component
Hi i'm using jobComponentsystem to fill and retrieve data to a compute shader and i like to find a way to know when all jobs of a system ended (an event, or anything) i've found OnStopRunning but i'm not sure this correspond to the end of all jobs of this system
You can at least force it with Complete() on the job handle. I don't recall whether it holds status info as well, but that's where I would expect to find it if it exist Aclard
guys, how to directly set object position via Jobs and ECS?
i have this code and i need somehow turn it to Jobs
You can set position in Translation component.
Can you do ScheduleSingle with the new JobComponentSystem Entities.Foreach lambdas?
Or some equivalent I mean
Had some time to investigate into the prediction code of the dots netcode today and have some concerns:
The code which is used for prediction on the client (ghostpredictionsystemgroup) is executed from the last received snapshot tick to the calculated server tick on the client.
For example if we have received snapshot tick 50 and have a calculated server tick of 55 then the code is executed 4 times (51,52,53,54,55)
So now to me concerns:
-
If the receive/delay between server/client gets higher than also the number of executions gets higher
At the netcube example the prediction code gets executed 30 times at 200ms recv/send delay (for EACH Frame)
So if i want to predict the complete player movement + abiltities this seems like a lot of overhead. -
Usually the snapshot received shouldn't be different from my prediction, right? This should only differ in case of unpredictable interactions (like stuns etc)
-> in the most cases there isn't a full rollback of states necessary. This seems to be not implemented by unity (there is always a full prediction from the last received snapshot) -
The ServerTick on the client is adjusted by the latency and therefore can change for each frame => also the amount of predicted executions changes => movement can jumps back and forth
Did anyone else also notice these things?
I am now trying to avoid client side prediction (don't need full authoritive server yet) and send the translation/rotation and other properties of the player with the commandtargetcomponent. (instead of sending the inputs)
Do you think this is a good idea?
@gusty comet
- the overhead is completely fine
- its common to always do the full rollback
- this seems like an implementation issue, it shouldn't do this
@trail burrow
I've no experience with client side prediction but nice to here that 1) and 2) are common implementations
Maybe i give the prediction a try. Do you have experience with the new prediction system (dots netcode) and would you recommend it?
@gusty comet the current dots netcode is many many months away from being production ready
@gusty comet well, a few years is included in many many months, maybe i was thinking on the order of 70-80 months? π
but sure yeah
well when someone say many many months, I usually think of it as less than a year timeframe
technically we could use many many many weeks and it would also be accurate?
π
sure, whatever... it's not even close to done is what i was trying to convey
Seems completely broken π
Starting the menu scene in editor takes like a minute, then pressing start shows a magenta quad and 999+ errors in the console
quality stuff they are putting out
@worldly pulsar crashed editor for me when i tried to play it
on mbp 13" with osx catalina
pressing start gives me a bunch of ArgumentException: All entities passed to EntityManager must exist. One of the entities has already been destroyed or was never created. then nothing happens
Β―_(γ)_/Β―
also this isn't what breaks it but they updated to entities 0.4.0 while using wrong burst package 
all these samples are starting to become 'well it works on our computers' level of stability
to be fair i don't think this one has been announced publically, just seems to be a public repo they're working in
but the other ones yea pretty much
@hollow sorrel well if they put it on their public github as a public repo...
it's like
tru
@hollow sorrel unity needs to (tm) the phrase Not Ready π
Hey guys, quick question: Which components do you need to render a mesh using the RenderMeshSystemV2? Right now I have a Translation, Rotation, NonUniformScale and RenderMesh on my component but it doesn't render.
It's though finding this stuff on the internet
needs a LTW too if i remember right
Okay, then I'm probably not setting my mesh correctly
is there a better way to deal with managed data in entities? for example a spawner that needs a reference to a Mesh to spawn
so far i've been dealing with these things by keeping an id int in a component and then looking it up in a dict when it needs to be used
but that means that for each iteration there's a dict lookup, whereas in OOP it'd just be a normal pointer ref
array would be nice but doesn't work when id doesn't start at 0
@hollow sorrel We've solved this in quantum neatly
we have the 'same' problem
i.e. a lot of native mem game state
but assets that are C# ref types
@hollow sorrel they added "class" components
that are normal C# managed types
but i havent tried them, just saw them on the patchnotes
that i dont know how they are implemented
and if they fuck chunks or not
i know that you cant do jobs on them
also no idea how they play with serialization
in the case of an int id it'll stay the same even if you save/load
I have references to Materials and ScriptableObjects in class components in subscenes, no problems so far
separate copy of the component? I'd assume so, I have different data in each component. Also they play nice with chunks, all my text entities are in the same chunk
Oh, just realized I completely misread your question. No idea if it duplicates the scriptables, will check in a sec
In build ReferenceEquals(component1.scriptable, component2.scriptable returns true (this is within the same subscene).
Which is the best idea I had to check if they are not duplicated
ah yea i thought they were like sharedcomponents with chunking but seems they act like regular
good to know it doesn't copy
i heard subscenes use same refs for same subscene but if you have 100 subscenes with each 10 refs to the same thing you'll still have 100 copies of that ref
but not sure if it does that in this case too
Don't have an easy way to check that right now :/
Oh shit, I'm actually rendering something using RenderMesh! Thanks for the help!
It's... it's... it's something!
Seriously though, unless you use simple conversion, rendermesh can be a major hassle.
@worldly pulsar scriptableobject as component seems to work pretty well so far, ty
but how do you get rid of the "scriptableobject must be created using createinstance instead of new" warning that ecs typemanager keeps throwing?
oh, I have a component with a reference to a scriptable in it
oic
(to be exact, it has a string, ScriptableObject and Material, all set in the authoring)
I have a PlayerAccount component I would like to save to disk (as a simple save progression system), is it possible in an easy way or should I rely on a dedicated class to handle serialization (that wouldn't be part of DOTS at all)? Thanks
forget my previous question... digging into the Entities dependencies, I found Unity.Serialization which does exactly what I'm looking for π
I have some problems with culling. When I rotate the camera down the voxel chunks begin appearing. Could this be the culling system in RenderMeshSystemV2?
I'm getting decent fps though! I only change the mesh when loading the voxel data in.
I see some stuff about RenderBounds, could that have something to do with it?
Interesting thing: The scene camera has the same kind of culling, but they are separate from each other. So when something in the game view is culled/invisible, it's still in the scene view, unless it's near the edge of the scene view cam
Yeah I had to set RenderBounds to something that's not only 1x1x1 of space in the corner of my entities
so on this whole dots stuff
Is unity eventually going to like stop supporting their current unity-type design and building on DOTS?
Also is the Data-Oriented Paradigm becoming a big thing that will replace OOP altogether?
I want to dive deep on dots xD
Okay I've answered some of my questions hmm
I jus tneed to find a big youtube talk on dots
Okay got all my questions answered, carry on c:
Are the (Ray/Sphere/Box)castCommand jobs accelerated by burst?
sweet I recreated ScaleWithScreenSize for the canvas in dots - I'm surprised it was pretty simple haha
Does anyone know how you install project tiny now? It isn't in the package manager as suggested by the docs
I found the link to the new version apparently with "TinyRacing". Apparently there is no 2D support anymore? Wasn't that one of the main things with Tiny?
Just add the packages via the manifest https://github.com/Unity-Technologies/ProjectTinySamples/blob/master/TinyRacing/Packages/manifest.json#L26
It does read like 2D isn't supported https://docs.google.com/document/d/1A8hen2hLFY5FLkC5gd3JP2Z-IpHfnAX-CpYLK3aOdwA/edit
Whatβs next?
Starting in 2020, will be delivering frequent incremental updates with features and bug fixes. Support for Unity.Physics and 2D are planned in January. During Q1 2020, we will lay out a more precise roadmap as well.
I'm really confused... I just downloaded the latest Jobs package via the package manager (preview.6 - 0.2.2, December 17 2019). According to the documentation there should be a number of different interfaces to implement different job types (IJob, IJobParallelFor, etc) - however I can only access UnityEngine.Jobs.IJobParallelForTransform in my project. I can't find any information about why everything else is missing so I'm not really sure what to do. Is this package version broken or something?
Looks like it's the only interface available according to the latest docs version: https://docs.unity3d.com/2019.3/Documentation/ScriptReference/Jobs.IJobParallelForTransform.html
This is super confusing π
Wait! They live in Unity.Jobs.IJob? Ohhh
that's still pretty confusing but at least I found them lol
how to get euler from quaternion?
hmmm
I'm actually baffled by Joachims response
that's just so naive
"you shouldn't need this"
Does anyone know how to solve this one?
Something went wrong while Post Processing the assembly (Assembly-CSharp.dll) :
Failed to resolve System.Collections.Generic.Queue`1
@trail burrow still curious about your neat solution to managed refs btw
π
Maybe it's related to
Unexpected exception Burst.Options.OptionException: Unexpected arguments: `--is-for-function-pointer --managed-function-pointer=0x000001B1BD06A410`
at Burst.Compiler.IL.Jit.JitCompilerService.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job) [0x0012a] in <3179d4839c86430ca331f2949f40ede5>:0
While compiling job: Unity.Entities.StructuralChange, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::AddComponentEntitiesBatchExecute(Unity.Entities.EntityComponentStore*, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|Unity.Collections.LowLevel.Unsafe.UnsafeList*, Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
Got some strange errors after upgrade π¦
you can see all kinds of funky stuff like that if you use nonmatching package versions
automated dependencies for packages don't always work
so you may need to install jobs, collections etc manually to latest versions
there was recently some mismatch on some of those (can't remember which) so had to manually force some package to newer version myself
Yep, already installed burst 1.2.0 p11 as suggested in forums. Will check the others. I just noticed the upgrade symbol is not always shown...
there's also tiny refresh icon on package manager
but the versions update with small delay there
it shouldn't be that many seconds tho
also in past, if you kept package manager always open, it didn't really update properly at all
so to avoid that, I usually just close package manager after use and open it again only when I need to
it's not the most reliable component in Unity editor :p
That's life when using experimental stuff π
Packages seems to be the latest ones...
You did the usual close Unity -> delete Library -> restart Unity?
yep, did that today morning while having breakfast
Seems burst doesn't like a line from the netcode docs:
var world = new World(defaultWorldName);
Error:
InvalidOperationException: Burst failed to compile the function pointer `Void AddComponentEntitiesBatchExecute(Unity.Entities.EntityComponentStore*, Unity.Collections.LowLevel.Unsafe.UnsafeList*, Int32)`
@silver dragon which dots packages and what Unity version are you using?
2019.3.0f4, entities 0.4.0 p10, burst 1.2.0 p11, collections 0.4.0 p6, netcode 0.4.0 p0, physics 0.2.5 p1
these are the ones I put to manifest myself (but I don't have netcode or transport here):
"com.unity.burst": "1.2.0-preview.11",
"com.unity.collections": "0.4.0-preview.6",
"com.unity.dots.editor": "0.1.0-preview.2",
"com.unity.entities": "0.4.0-preview.10",
"com.unity.physics": "0.2.5-preview.1",
"com.unity.rendering.hybrid": "0.3.1-preview.10",```
well, those do match
This is the full stack from the last error:
InvalidOperationException: Burst failed to compile the function pointer `Void AddComponentEntitiesBatchExecute(Unity.Entities.EntityComponentStore*, Unity.Collections.LowLevel.Unsafe.UnsafeList*, Int32)`
Unity.Burst.BurstCompiler.Compile[T] (T delegateObj, System.Boolean isFunctionPointer) (at Library/PackageCache/com.unity.burst@1.2.0-preview.11/Runtime/BurstCompiler.cs:160)
Unity.Burst.BurstCompiler.CompileFunctionPointer[T] (T delegateMethod) (at Library/PackageCache/com.unity.burst@1.2.0-preview.11/Runtime/BurstCompiler.cs:78)
Unity.Entities.StructuralChange.Initialize () (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/EntityManagerChangeArchetype.cs:58)
Unity.Entities.EntityManager..ctor (Unity.Entities.World world) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/EntityManager.cs:163)
Unity.Entities.World..ctor (System.String name) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/World.cs:115)
Local.Core.SlClientServerBootstrap.Initialize (System.String defaultWorldName) (at Assets/Game/Scripts/Core/SlClientServerBootstrap.cs:20)
Unity.Entities.DefaultWorldInitialization.Initialize (System.String defaultWorldName, System.Boolean editorWorld) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities.Hybrid/Injection/DefaultWorldInitialization.cs:123)
Unity.Entities.AutomaticWorldBootstrap.Initialize () (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities.Hybrid/Injection/AutomaticWorldBootstrap.cs:15)
I hope some Unity guys will check the forums, those errors are too strange for me π
btw, is this on compile, or on entering playmode?
I assumed it happened when @silver dragon just opened the project after updating packages?
Entering playmode
Did that, have to wait a bit because of another strange uissue ...
Something went wrong while Post Processing the assembly (Assembly-CSharp.dll) :
Failed to resolve System.Collections.Generic.Queue`1
Recompile takes some time...
Ok, seems disabling fast enter playmode changed something... i have more errors now, including the erros above π
Β―_(γ)_/Β―
Will pass some errors to their asset owners in the meantime π
after getting access to intrinsics in .net core 3.1...
i don't want to go back
lol
Is it possible to write to a DynamicBuffer (defined with IBufferElementData) in an IJobForeachWithEntity_EBC?
I see you can use SetBuffer, but in most cases I want to change a value in the buffer, not set a new one
you get the buffer as an argument in the Execute method
so you can read/write to it
How do you schedule the job?
With job.Schedule
Schedule(query) or Schedule(system)
and if Schedule(query) do you ask for ReadWrite in the query
job.Schedule(this, inputDeps) inside the OnUpdate(JobHandle inputDeps)
That's the system apparently?
try specifying the query and ask for ReadWrite on the buffer explicitly (I never use the Schedule(this) version so can't help you on this one)
(also: you probably want to use the new jobified ForEach)
Entities.WithAll<CompA>().ForEach((Entity e, DynamicBuffer<BuffElem> buffer) => {DoStuff(buffer);});
I actually use Entities.With now, but it still brings my fps to almost zero
Does Entities.With.Foreach run parallel?
it generates an IJobChunk (which is what IJobForEachWithEntity uses internally)
so yes, in general it runs in parallel
"Entities.ForEach β the job executes the lambda function on parallel background, job threads. Each job iterates over the entities in the chunks selected by the ForEach query. (A job instance processes the entities in a single chunk at minimum.)"
Note, you can combine with and foreach
Yeah, I got Entities.With.Foreach working, but it still clogs the game, as if it was running on the main thread
Entities.WithNone<Tagged>().ForEach((int entityInQueryIndex, Entity e, in Component component) => {...}).WithBurst().WithName("TagMe").Schedule(inputDeps);
maybe because all my entities are in the same chunk?
Depending on what you are doing?
@solar ridge you can skip WithBurst(), it's implicit
it's there if you want to provide burst options
Right, but I do it so I know verbosely that I am using burst
"In parallel" doesn't mean "over multiple frames"
if your job takes more than 16ms you'll have frame drops
That explains it I guess
Now... you "can" schedule a job that can be over multiple frames
but... you need to be more careful when doing so
as that is not how this system is designed primarily
so most of the easy methods to cascade the data together don't exist per se in that route. In example: ForEach assumes a single frame
Most of the Entities methods I think are built for 1 frame runtime
Oh, by the way, I think most of the work is in creating the mesh of every voxel chunk (an entity with 16x16x128 voxels)
Yes.... creating 256x128 meshes... would be a bog down in a frame
Unsure if you could do that in a single frame
Use the profiler, it'll tell you for sure what is slow
^
Yeah, that's a great plan!
(and yeah, you won't generate a minecraft world in 1 frame)
Thanks for the info! It's though starting with DOTS, but it sure as hell seems nice to work in, as soon as you get the hang of it.
No, generation should occur in a loading screen, but still I don't want the game to freeze while in the loading screen...
And i'm only taking my first steps into DOTS so loading screens are still far away.
So you'll want to split the workload over frames. likely one batch of 16^2 per frame
If even that
One day. I will get the final 2 pieces of my missing system: TCP Websockets in DOTS, and Burstable comparisons on BlobStrings
So if you use Foreach, can you use the EntityManager instead of the EntityCommandBuffer?
Adding and removing tag components
And why would you not want that in the ECB?
not if you want Burst/Multithreaded
Well..
It goes on further than that
If you modify by adding and removing, you create a sync point as well
Well, I don't really know how all this works, so π
structural changes mid frame are bad
So the ECB runs at the start of the frame
All 6(?) of them
These serve as one massive sync point
instead of splitting across the frame
This allows for data to be accessed without worry of the list mutating part way through
So in adding and removing you can use the ECB to add a component or remove a component anywhere in the frame, and the next frame it will do all the changes in a playback
If you were to do it with say the Emanager, you'd wind up stutter stopping due to entities being shifted around
It wouldnt be too noticeable with a handful of things, but as time goes on it would be a rather large problem
Since they made the ECB burstable, it is MUCH faster now. Now we merely need to wait a little bit for the ECB playback to be bursted
An alternative is also utilizing the ExclusiveEntityTransaction... but that is a little more of a learning curve
And the performance is very dependent on what is going on
Using EntityManager in a ForEach has the advantage of being super simple π And you get the changes applied instantly which usually makes the code much simpler
Un sure how the ECB is any less simple π
You have maybe 3-4 more lines 
And creating sync points is again, something to completely avoid unless you absolutely need them
The main issue is the "changes applied instantly" part. In gameplay code I have a ton of systems that do
- Attach SystemState component to entities matching a query that don't have them
- Update all entities with SystemState
and separating them into 2 systems before/after a sync point is a major pain
But then the way I use ECS is probably not what Unity intended π
The best thing I have read for game development: The more pain you alleviate for yourself in development time, the more you put it on the user.
Obviously this doesn't correlate to everything (Example: Editor extensions, etc), but the idea was rather interesting.
And makes the OOP vs DDD paradigms more understandable
OOP was very much, this is MUCH easier to code
but completely forgetting a user audience 
DDD is THIS IS SO MUCH MORE WORK... but my users shall be happy!
I'd argue with the "OOP is easier" tbh. I'm using ECS because I think it's easier than OOP for the game I'm making
(emphasis on the "I think" part, whether it actually is remains an open issue π )
And strong disagree that making your life easier has to impact users
It is more the way OOP tries to make your life easier
I think I might like this ECS way of programming way more than what I'm used to. It separates concerns nicely.
I've used a lot of MVC like frameworks in the past, this feels like taking it a step further
Out of curiosity, why do you need to wait a full frame before modifying your system state component?
Data related to other system states? Or is it independent?
I don't, that's the point
Why would you need two systems?
oh, sorry, the 1. 2. was in the same system
But why would you need to change something in the exact same frame? Wouldn't it be okay for most entities to change after the frame ends?
the point being I need the changes in 1. to be done by the time 2. executes
So, when you want to change an entity and run some more code, you can just wait a frame right?
and with ecb I'd need to Playback() it between 1. and 2. (which is a sync point)
using another system maybe
Unless you need data from another systemstate you don't need to wait
You can just do
AddComponent
SetComponent
All in the same job
But that is dependent on if you need something say like the full entity count (which you technically already have) or something else from one of the other system states (example a different entity ID per se)
You can even just AddComponent(e, new MyComponent(){});
I actually do that now:
var entity = buffer.CreateEntity(index);
buffer.AddComponent(index, entity, new Component() {BlobReference = BuildBlob(JsonUtility.FromJson<Event>(json))});
You also don't manually playback (assuming I'm reading incorrectly what you mentioned before)
ok, a more concrete case because I see my previous example was bad :)
Entities
.WithStructuralChanges()
.WithAll<AiMoveOptionSelection>()
.WithNone<HighlightDisplay>()
.ForEach((Entity e) =>
{
highlight = Instantiate(highlightDisplayPrefab);
Add(e, new HighlightDisplay
{
Entity = highlight
});
}).Run();
Entities
.WithStructuralChanges()
.WithNone<AiMoveOptionSelection>()
.ForEach((Entity e, HighlightDisplay display) =>
{
DestroyEntity(display.Entity);
Remove<HighlightDisplay>(e);
}).Run();
Entities
.WithoutBurst()
.ForEach((AiMoveOptionSelection aiSelector, HighlightDisplay display) =>
{
/// code that positions display.Entity based on data in aiSelector
}).Run();
note that the first 2 ForEach run rarely, mostly for new entities, and the 3rd runs every frame and has to have the first 2 applied by the time it runs (otherwise you get the newly created highlight entity rendered at some random position for 1 frame)
oh, and Instantiate(), Add() and DestroyEntity() are helpers that just call the corresponding EntityManager methods
so to avoid creating a sync point here would be a pain
wtf
I have a weird problem
I have no changes
all of a sudden when I try to look at one of my entities in the inspector I get:
InvalidCastException: Specified cast is not valid
I stashed my changes and it is still there
I'm so confused now
Yeah googling it I get UI stuff too
UIElements has ... some interesting issues
I seem to remember that happening when I was trying to store invalid references to entities (IE: the results of a command buffer.CreateEntity)
but I never changed anything of that
You have the debugger open?
It would give lots of bad erros when I tried to use the entity debugger on invalid entity references
The Entity Debugger? Yes.
It USED to be all the time on entity 0 which was hilarious
The entity only shows a physicscollider now
May need to restart the editor.
Mmmm I'm not going to say "don't do that" but that shouldn't fix the problem
BUT if it does 
I know, but I can try π
Also @worldly pulsar none of that code is parallelized and it is making me sad
I'm using a prefab to instantiate my entities. Maybe the prefab is broken?
I'd love to see a parallelized version of this that is not 3x in size π
(it's Entity)
also: this operates on like 6 entities total
Re: Scuba
so making it parallel would most likely be slower anyway (b/c job scheduling overhead)
Oddly while scheduling does take time, it may still benefit as you are full on blocking main thread from continuing until finished
Even going back a commit doesn't change anything
Rebuilding the entity cache doesn't do anything
Especialy since you can then burst the addComponents and positional data
I know. My whole point is that this version is super simple to write, debug and maintain, and doing this with command buffers would be 10x more complex
In a snapshot of the entites, if something is rendered and shouldn't be there is a problem with the logic. BUT, what ever you are happy with. If it works and doesnt degrade the performance, so be it
It looks to be a bug in com.unity.properties: https://issuetracker.unity3d.com/issues/invalidcastexception-is-thrown-when-gameobject-with-physics-shape-component-is-selected-in-entity-debugger
How to reproduce: 1. Open the attached project ("PhysicsBug.zip") and open SampleScene 2. Open Entity Debugger window (Window->An...
It's weird, I was trying to add a PhysicsShape to my entities yesterday and I couldn't get it to work. Now all of a sudden it adds the PhysicsShape and it breaks everything
In a snapshot of the entites, if something is rendered and shouldn't be there is a problem with the logic.
Not sure I understand that
In terms of a frame
The frame being a snapshot, you have entities that have components
Also to be clear: I'd love to do this without creating a sync point. But there is no easy way to do that (by easy I mean + ~5-10 lines of code)
the 3rd runs every frame and has to have the first 2 applied by the time it runs (otherwise you get the newly created highlight entity rendered at some random position for 1 frame)
referring to this?
You could just remove LocalToWorld while you prepare the entities. Then add it in the third run. It won't render without LocalToWorld
Assuming you're using rendermesh
Your first job... why not just set the position then?
As you could have the display and the selector
@zenith wyvern the prefab is 3 entities in a hierarchy, the children have meshes so that won't work (and again, complexity for little gain)
@solar ridge because what I pasted is a super simplified version and the real 3rd job is actually 2 jobs dependant on one another that take 2 more components and some additional data
@worldly pulsar you said earlier that using Entities.Foreach would parallelize jobs. I'm looking in the profiler and I see my systems running on the main thread taking 4000+ ms. Shouldn't I see the work on another thread than main?
wait. I think I'm missing something here.
I just do Entities.With(_query).Foreach in the Update of a ComponentSystem now
oh
nothing with either Run or Schedule
use JobComponentSystem
Okay, I think that is the problem then
the ComponentSystem Entities.ForEach is a completely different thing under the hood
But JobComponentSystem doesn't have Entities?
are you on Entities v0.3 or later?
yea ComponentSystem is main thread only
I installed it like a week ago, let me check
Looks like it's 0.1.1
but it says its up to date
are you on Unity 2019.3.0f1 or later? π
(I swear half this channel is just comparing version numbers xD )
j2019.2.17 right now
yea, the new ForEach requires 2019.3
is 2019.3 a preview?
To the Unity Hub!
hey, is it worth having an ecs system for player control or could be used as monobehaviour since its a single gameobject?
Define "worth it". If your player is a gameObject there is little difference, if it's an entity it's probably easier to use a system
also: anyone hit this one before?
(EDIT: and has a solution? π )
ArgumentException: The entity does not exist
Unity.Entities.EntityComponentStore.AssertCanAddComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/EntityComponentStoreDebug.cs:270)
Unity.Entities.EntityManager.AddComponent (Unity.Collections.NativeArray`1[T] entities, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/EntityManagerChangeArchetype.cs:306)
Unity.Transforms.ParentSystem.UpdateChangeParents () (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Transforms/ParentSystem.cs:295)
Unity.Transforms.ParentSystem.OnUpdate (Unity.Jobs.JobHandle inputDeps) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Transforms/ParentSystem.cs:377)
yeah but having a system that only affects a single entity?
Why not? I have a ton of systems that affect nothing most of the time
maybe as a single thread systems not multithread
that might be fine
also i hit that error
in a demo
I like the new styles in 2019.3! I was wondering in tutorials if that was a OS specific thing
Looks like Entities 0.4 preview is also here
in this demo
@gusty comet as of Entities 0.4 there are very few cases where you should use ComponentSystem over JobComponentSystem (if that's what you mean by "single thread systems not multithread")
i mean using Run instead of Scheduling
@gusty comet having a system for one entity would separate your concerns nicely right?
i find it wierd to have a whole system just to listen for player inputs nor update camera
I think the expectation is that you could have hundreds and hundreds of systems running and it should be fine. That is Unity's stated goal at least
also @worldly pulsar that error usually happens in jobs running burst.
Right now there's overhead for systems that shouldn't be doing anything, but they are working on it
guess ill just go for it since everyone is doing it kek
Disabling burst is on my list of things to do before asking on discord π
But that's the thing: you "could" have hundreds of systems running for hundreds and hundreds of entities, but it can also only be one entity. I don't see why not.
So if it makes sense to have a system just for the purpose of separating concerns and making your code easier to understand and work with, do it
@worldly pulsar there is that option in burst to enable that actually shows the line the error came from
i can't remember the name
I know where the error came from. I don't know why the Parent system thinks a destroyed entity needs a child π
LOL
Im usually in the boat of if I need to make a GO then either Im thinking about the problem wrong, or I must be patient
@worldly pulsar same happens in that demo, when you kill an entity that can attack you
i think is trying to call it right after it got destroyed but is too fast
and didn't acknowledged that it got destroyed
I get this on enter playmode π
welp, sorry, wish i knew more to help but dots its still pretty new
@worldly pulsar i'm a good rubber duck tho π
Is it normal that the rebuild entity cache option dissapears?
Just updated to 2019.3 and updated my packages
maybe restart for a sec π
yup, there is now a [ConverterVersion("username", 5)] you can apply to your IConvertGameObjectToEntity
and you bump the version number to let the caching system know it has to re-convert the entities
it reimports at a subscene granularity?
But you need the converterversion for authoring classes?
@gray flicker you don't need it, but it's a convenient way to 'wiggle something' π
i.e. you change the way the authoring works, bump the version number, everything that uses that authoring gets reconverted
And does it work when you change the authoring and only then add the version? I've had a problem with state management in Angular where the versioning system didn't work if you didn't version from the start
Jeez, reading the transform system is so depressing. FindMissingChildJob, parentsMissingChild, FixupChangedChildren
@gray flicker I usually add it the first time I change something, seems to work fine
Does the ENtities of a JobCOmponentSystem have something simular like the one in ComponentSystem, where you can add an entity query like: Entities.With(_query)?
With doesn't exist anymore
nope
Then how do you specify between Read and ReadWrite etc?
also can't do Entities.WithAll<X>().WithNone<Y>().ToEntityQuery();
if your lambda argument takes a component by ref, it's read/write, by in is read-only
You can capture the entity query that's generated by the foreach with WithStoreEntityQueryInField
I think dynamic buffers are always read/write but not sure about that
And it does it at compile time so you can use the query before you run the foreach
@zenith wyvern I know, the thing is I don't want to foreach that query, I want to .ToComponentDataArray() it
What if you want a DynamicBuffer in your WithAll?
just specify the element type
Anything in the foreach fields is implicitly in the query
also: any arguments in your lambda are implicitly WithAll
and you must not add them to WithAll (it complains otherwise)
Can you only use static methods inside a ForEach?
Unity is complaining: Lambda expression invokes ... on ... which is a reference type
With static methods it also doesn't work
you can use static methods in a ForEach
If you need to use a reference type
especially in a JobComponentSystem - you will need to use
Entities.WithoutBurst().ForEach((...)).Run();
Lol, 1.5h later, turns out if I add a child to one of the ConvertToEntity objects (and only that specific one) it causes the ParentSystem to crash. Completely no idea why.
It complained that I was calling UpdateChunk, which is a static method. I'll look into it more in a few hours
Playing Overwatch now π
You can use FunctionPointers for static methods
If it can be burst compiled, then use BurstCompiler.CompileFunctionPointer()
If it can't be then just get the marshalled pointer
Unity is complaining: Lambda expression invokes ... on ... which is a reference type
the "which is a reference type" is the problem here
can't have reference types if you .Schedule()
must be .WithoutBurst() and .Run()
yup π
Uh
Not sure about the scheduled part as I am using reference types with my job using FunctionPointers now
Unless a string has miraculously become a blittable type
Without burst sure, ...
It really depends on what the method does with said reference type
ah - I guess that's worth looking into, i havent passed function pointers into a job yet
It is rather handy
public static void BuildABlob(int index, ref EntityCommandBuffer.Concurrent buffer, string json)
That is a method I am turning into a function pointer and passing along to a job
en masse
how do you pass that string into the job? scheduling
struct Test : IJob { public string test; void Execute() {} }
yells at me as it always had
byte array or NativeString or using a blob
NativeString is nice; however, I am passing in an unknown sized amount of text
and allocating an array of 4096Bytes per element seems like a bad idea
Oh, yea, you can create managed types while executing the job (it's just running mono on a thread, you can do basically anything).
Calling a system method like @gray flicker probably does captures this which is a big no-no
To be fair I only read "Can you only use static methods inside a ForEach?"
Making food so slightly distracted π
deliciousness oriented design @solar ridge
Hi, is there someone for fast question?
I have loaded GameObject prefab in runtime. How to instantiate it as Entity? EntityManager.Instantiate creates empty entity.
Should I use Object.Instantiate?
@compact hound i mean... all entities are empty i thought that was the point.. no data encapsulation :D
@compact hound maybe some sort of gameobject -> ecs conversion workflow can help you though
@compact hound here's a piece of code where I go from GameObject prefabs to Instantiate:
https://gist.github.com/JacekPrzemieniecki/0565a8eb1956ec5d9bca2cb248ba46da
(would cut down the irrelevant parts but I've spent too much time on discord today anyway π )
@worldly pulsar yes but you have the prefab during conversion. Im loading my at runtime
Then instantiate as usual, then GameObjectConversionUtility.ConvertGameObjectHierarchy (I belive it's not deprecated? )
(btw. what do you mean by "loading a prefab at runtime"? From an asset bundle?)
from addresables
system starts, loads player settings and load prefabs from settings
I'm really looking forward to a full DOTS mode for projects in the Editor, though. Throws all this hybrid / conversion nonsense out the window.
Hybrid has its practical use cases of course. but for a greenfield project that you know is better suited for DOTS it's just a bunch of wasted time dealing with redundant abstractions and boilerplate to scaffold into the age old gameobject based Editor
I'm pretty sure the conversion workflow is here to stay for the foreseeable future
as in no plans for full dots mode
the Tiny editor was scrapped, they use conversion now
especially with Visual Scripting Graph being DOTS only
yeah it (project tiny) was a proof of concept only ofc
also hybrid and conversion workflow are completely different things
hybrid is using MonoBehaviours/GameObjects at runtime
like how you can query for MonoBehaviours in EntityQueries
conversion is all about having an editor-friendly authoring data representation (using MonoBehaviours because they happen to have a ton of tooling around them already), and turning them into runtime-friendly entity representation
ah, got it.
true
My thought is presumably an Editor or per project Editor mode (more likely) built for DOTS 100% from the ground up be able to avoid using conversion and the hybrid renderer, yeah?
hmm - question about hierarchies - if you delete a Child entity - does the DynamicBuffer<Child> on the parent entity get updated? π€
@coarse turtle should be
@worldly pulsar what paramters should have GameObjectConversionUtility.ConvertGameObjectHierarchy
ah wonderful - guess that's a case I don't need to worry about if it's handled already thnx
@compact hound don't remember, haven't used it since the conversion came out
@inland root I really doubt they'll invest a ton of effort into building and maintaining a separate editor for DOTS when conversion handles basically everything
re: dropping the hybrid renderer for a pure dots one - I hope that's on the roadmap, but haven't heard anything about it so far
@worldly pulsar If they want DOTS to be widely adopted they will eventually or at least make conversion 90%+ transparent. Of course the projects that need it will jump over whatever hurdles to use it anyway.
and yeah a replacement for hybrid renderer would be very welcome. joachim mentioned in a bug report they are at least planning to refactor the hybrid renderer in a significant way soon before addressing the issues i brought up with light conversion. which is expected being at 0.1.x stage in development Β―_(γ)_/Β―
Now I do agree that ECS needs a ton of tooling of its own (the EntityDebugger letting you edit the values being near the top)
To be honest once they allow more than 1 [GenerateAuthoringComponent] per file I'm not really sure what else I want from the conversion pipeline
Is there anyway to query entities with a proxy? (Hybrid) I'm trying to do the following:
Entities.WithAll<MyProxy, MyData>().ForEach((MyProxy myProxy, ref MyData myData) =>
{
//Do something
});
It unfortunately doesn't run if I'm trying to use the proxy, if I change the proxy to any other attached MonoBehaviour it works without problems.
Is there a reason for why "Game Object Entity" is no longer available in the component menu? The docs don't list it as being deprecated...
@balmy garnet game object not exist at ECS. you have entities and entities can be spawn from your code. you can convert your game objects to entity at runtime by ConvertToEntity components
but isn't that what the GameObjectEntity script was doing? and also left a reference to its GameObject? Does that mean there is no more hybrid proxy system?
@soft nova if its an object, i think it is possible, move MyProxy after MyData. i have not tested
@balmy garnet yes GameObjectEntity converting too. you can connect that to game object but it is not reference to that
@radiant sentinel Tried that already, but it didn't work
@soft nova compile error or runtime error?
No, no error, the system just doesn't run on the entity
@balmy garnet what is your package version? at my version, named "ConverToEntity"
@radiant sentinel I have the latest 0.4, but it's not about ConvertToEntity. It's about GameObjectEntity missing from the component menu and it not being documented in the docs/changelog
@soft nova why you are using WithAll? and MyProxy Gameobject is available?
@soft nova are you sure, your system is running?
@radiant sentinel I need it to run with entities that have a Monobehaviour and a componentdata (MyProxy, MyData) if I use a normal MonoBehaviour the system runs perfectly, but for convenience I changed it to a proxy and realize that it doesn't run when using a proxy.
Well it is not running since it doesn't find any entity, but with another MonoBehaviour instead of the proxy it works
@balmy garnet ok Use ConvertToEntity, its same.
it is not though, with just ConvertToEntity i have to work fully in the ECS world, is that not the case? With GameObjectEntity I was able to "sync changes" back to the GameObject world and thus have the best of both worlds
I want to slowly move towards ECS; without having to rewrite everything as jobs/systems at once
If you change to converttoentity to "Inject" rather than destroy it leaves your GO and all components intact and you can query for your non ecs components inside a system
It's up to you to sync the two representations of your object though
so it being left out of the documentation was just an oversight?
@radiant sentinel Yeah with a normal Mono it works, if you change that to be a proxy of TestData then it won't run
@balmy garnet i think its somewhat safe to say they dont want people using the old proxy/gameobjectentity workflow any more
yes it is, but there is an question. why foreach on proxy? you have data at entity. @soft nova
yeah I just realized that the data is no longer synchronising on get. Which is fine, if they would have communicated that
each day is different. its preview package. @soft nova if proxy is old, the only way is change your workflow. you can pass your data from ECS world to GO world only by systems. if anyone know other ways, i want know. i need it too.
@radiant sentinel for the same reason @balmy garnet has been asking, I'm trying to move everything slowly and the more convenient way to start is with proxies
you can create static hashtable of objects, then pass data from ComponentData to Objetcs. you can add new gobjects to static hashtable.
@radiant sentinel Hmmm I must be missing something, I did your exact same test right now and it's not running. Is there anything else the GO needs now that GameObjectEntity is not to be used?
I figured why my system wouldn't run, now I'm using IConvertGameObjectToEntity, but this unfortunately breaks the CharacterController since it won't move. This worked fine with proxies, anyone have any idea how to allow it to move the transform without GameObjectEntity?
@soft nova yes i have not used proxy or GameObjectEntity at my current project. you should change your game architecture to PureECS and a little hybrid ECS. i know its so hard and expensive. at your project, you can use IConvertGameObjectToEntity as an "author" for Controller ComponentData and controlling your character by system without any character controller. at GO side, for example you have animation on character, i have used my own pattern that named "Attachments" to sync character entity data with mechanim.
at attachment mechanism, i am create an ComponentData and authoringMonoBehaviourComponent like figure 1 and 2. and a monobehaviour to do attachments.
figure 1
figure 2
so, how dose this systems work? you can attach mechanim to your GO for example, and AttachGameobjectToEntity to mechanim gameobject. like this figures
these codes are GO side and not ECS
now when you are Instantiate your Entity, just call SpawnFor at childs. its spawning attachment at GO world for Instantiated Entity. now you have injected GO, at hybrid systems and sync points you can get Attach Gameobject only by component data and sync your data.
it is my idea that used at my project, but you can not use that for many objects, because its processing at main thread
and sry for my english
if you want know more i can send you example
Is it possible to write to an IBufferElementData buffer inside an IJobForeach?
If the buffer is a part of the query for that job then yes
You shouldn't really need to write an IJobForEach in most cases, the new lambdas are simpler to use and do the same thing
with new lambda I can't figure out how to use methods and stuff
What are you trying to do?
I'm creating mesh data from voxel data, I'm trying to set a buffer with triangles and a buffer with vertices so I can build a mesh in another system
Creating the mesh data is quite intensive, so I don't want to run it on the main thread, but it is also quite complicated, so I need a class or struct to do the job
Can you instantiate object inside the lambda? As in, move everything to a seperate class and such?
I just did exactly this last week. I mean I was building it from a heightmap but yeah, same thing
You shouldn't need a class at all
If I don't use methods or a class, i'm gonna have a 300 line lambda
I wrote my own interpretation of the greedy meshing system, and if I don't separate my code I will lose my mind π
Well the answer is no, you can't use any kind of class or managed object inside jobs or burst
Is a static class managed?
They did add a FunctionPointer thing to burst recently but I haven't messed with it
I should really know this stuff π
No, you can call static functions as long as they never touch any static data that isn't constant
So no changing fields?
Yes, basically the job needs to know absolutely everything about what's going into it and it can only touch that, unless it's in a nativecontainer
Well the answer is no, you can't use any kind of class or managed object inside jobs or burst
Welllll.... half true
If the job is not bursted and not scheduled you can use managed π
To an extent
I would highly advise against it, but in some areas it is unavoidable
So using run, and that is on the main thread?
Correct
If you have your mesh triangle and vert data in buffers then you should be able to do all your work on those using jobs and ECS. You can create as many separate static functions to pass in and modify your data as you need, as long as those functions aren't messing with mutatable static fields
But you keep the Entity foreach collection
In terms of buffer data, https://docs.unity3d.com/Packages/com.unity.entities@0.4/manual/entities_job_foreach.html
I mean if the job is not bursted and isn't scheduled then it's by definition not a job and not using burst
By what definition?
Meaning it's just...running on the main thread
An Ijob can be run on main thread
doesnt make it not a job
The performance gain is MUCH lower on main thread
but doesn't mean you strip it of its title for doing a poor job π
I think you might be meaning running as a job
True, but in this context we're talking about how we can use jobs to process vert and mesh data faster. If we just run it on a main thread and it isn't bursted it doesn't gain any benefit from being a job. In fact it may as well not be a job at all and could be a function
vs being a job
Note, I am allllll for non main thread bursted code
My particular use case unfortunately can't be bursted in many areas :\
but I love using burst where I can
Websocket server -> byte[] data -> json -> data blob with string information
Hahah, I noticed you seem to be living in string hell
Yeaaaa
What would be the downside of using an IJobForeach instead of an Entities.Foreach?
Since they both become jobs
Just having to write more boilerplate
Ijob has existed longer
Yeah, IJobForeach is more verbose?
The lambdas are much more expressive and easier to read and change
I don't mind writing the boilerplate if I can get it to work
imo
Used to be IJobProcessComponent<> or something similar
The lambdas are nice, but it is hard to see some magic in some cases
IE: a variable being captured in local context
vs IJob{ THIS VARIABLE EXISTS}

Yeah I usually just explicitly write out all the capture variables immediatley before the ForEach to keep it clear what's going on
Code that compiles fine in IDE, but doesnt sit well with the editor is at times annoying
Like an EntityQuery @zenith wyvern
Well, EntityQuery can exist on either
you create the query in create
not in update
You can't use EQ in the JobComponentSystem right?
Yeah you can capture the query from the Foreach, but it is very weird and magicky
You do Scuba
Hmm
The ComponentSystem class I have banned myself from using π
It feels like ComponentSystem will be deprecated at some point now
Well the query is assigned in both in similar ways
the Ijobforeach you assign when you go to schedule iirc
The EntitiesForeach, you use a method
I mean you can't do this:
Entities.With(_query)
WithStoreEntityQueryInField
Missed that one
The query is implicitly created by the combination of .WithAll, .WithNone, and whatever fields are in the lambda expression
^
And you can capture that implicit query with what Soaryn just wrote
the capture happens at compile time so you're free to use it before the foreach even runs
You know what would be fancy dancy magic: If they made a switch case for BlobStrings that is burstable
as they are already looking into Burstable string literals
So allocation of the BlobString would still be nonbursted
It can't be called 'With' because you're not passing in a query. You're getting a query from the foreach
but comparison would be faaast
Oh you mean the WithAll
Don't exactly know what BlobStrings are yet π I worked on a product that stored sheet data in a blob, but never worked on that part myself.
BlobStrings can only exist in Blobs
I guess they want to be explicit and separate it from "WithAny" and "WithNone"
but Blobs being immutable data is nice
as you just pass around a pointer to the data reference
This way, I can go from a json data object -> BlobStruct
Keep what I want and make it read only persistent data
I'm still not sure how to use blobs properly right now. I guess they're a way to pass around managed types inside components?
I haven't really read up on them too much
So I'm getting this error message:
InvalidOperationException: GreedyChunkMeshingJob.Data.Buffer is not declared [ReadOnly] in a IJobParallelFor job. The container does not support parallel writing. Please use a more suitable container type.
On an IJobForeach_EBBBCC where I call Add on the buffer. I thought I could write to a buffer in a JobComponentSystem. Isn't that correct?
If I have lots of systems that need said data, I have the understanding that data will never mutate
so it is pure read only
If I want to "replace the data" then the pointer is reassigned
Immutable is awesome, I worked with NGXS a lot, an immutable data store for Angular
@gray flicker If you want to write to buffers in parallel you need to add [NativeDisableParallelForContainerRestriction] on the container, but make sure you know 100% that you are never writing/reading from an index at the same time
"BlobAssets are made for zero cost deserialization for large amounts of data. AnimationClip, CollisionMesh, CurveData is a good example of what we think belongs into a BlobAsset." - Joachim
In my case, I can store an int, multiple blobstrings, and an enum for the data I need
Yeah I wrote it wrong, I fixed it in the edit...I think. It's something like that
NativeDisableParallelForRestriction
NativeDisableParallelForRestriction
It's very long and awkward
Yeah got it! π
I see so it lets you pass around some huge data structs without copying them on the stack all the time I guess
that didn't solve it. Weird
Yeah that would let you write to the buffers in parallel, I'm not sure about doing adds in parallel
I know you can for sure do a Resize inside a job
So you could resize the buffers and do parallel writes
Or https://docs.unity3d.com/ScriptReference/Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestrictionAttribute.html but I assume the safety system doesn't want you to do it for a good reason
Aaah wait
I'm adding my buffers incorrectly I think
Man, these buffers... I can't get it right
Could I use a nativearray in an IComponentData instead?
At least I know how to set a new component
There is some way but it requires unsafe code so I've never messed with it
So if I know for sure it's just gonna be set in one system, and read and removed in the other, it's fine?
If I use NativeDisabledContainerSafetyRestriction then
I think so. Based on the description on that page it sounds like that attribute might have some unexpected side effects that persist outside the job though so I couldn't say for sure
Seems like you can add to a buffer in foreach:
inputDeps = Entities
.ForEach((ref DynamicBuffer<IntBuffer> b) =>
{
if (b.Length < 10)
b.Add(5);
}).Schedule(inputDeps);
Works fine
I think it should be fine to use Vector3, but you should definitely be using float3
It's much more convenient when working with the math library
Somehow I'm not allowed to post a bunch of code
If it's too much you can use some pastebin thing
I see a few problems
You can't assign the results of a command buffer back to anything and expect it to survive outside the immediate loop
Anything returned from a command buffer is temporary, if you need to work with the results of it you should query for it in another job
If possible your buffers should all be on the same entity. This makes it really easy to work with them since they can all be in the foreach fields and the safety system will not complain about trying to do parallel operations between separate buffers
Okay, so I should add the buffer in the system that adds my tag to run this job?
And then add my buffers to that query?
The buffers are on the same entity, so that's a start π
If they are on the same entity what are you passing in to the job? Why aren't they just in the foreach parameters?
private bool[,] traversed;
The voxels buffer is where I store my voxels
Managed array inside a job
Ah damn
I thought I could add them to the entity when I actually need to add them, but guess I should add them beforehand
So your voxels array is just one big buffer of voxels, and you're intending to build your mesh data from that?
I have an IBufferElementData called Voxel, with three fields
So I guess you are correct?
I'm not really familiar with parallel programming, learned about threading in uni, but that's about it
Would it be better to store my voxel data in a native array?
So the voxels, tris, and verts buffers are all on the same entity right?
yes
So I tried instead of using these buffers to set a shared component data, but that's not possible right?
You need to use BufferFromEntity if you are trying to access another entities buffer, only just woke up but I believe its what you want
Good morning
He shouldn't need to if they're all on the same entity
No, I just need the data from the same entity luckily
Off topic: this discord is awesome. Lot of really cool people that want to help!
inputDeps = Entities
.ForEach((in DynamicBuffer<Voxel> voxels, ref DynamicBuffer<Vert> verts, ref DynamicBuffer<Tri> tris)=>)
{
for( int i = 0; i < voxels.Length; ++i )
{
tris.Add(MakeTris(voxels[i]));
verts.Add(MakeVerts(voxels[i]));
}
}.Schedule(inputDeps)
I guess somehting like this is what you're looking for?
With how you have it set up?
That's not really...parallel I guess
If its the same as voxel chunk and chunkupdatedtag why not add it into the job's component reqs?
@zenith wyvern it's way more complicated than just looping over the voxels once, but essentially yes that is what I am doing
That's pseudocode but maybe gives you an idea of what it should kinda look like
Did you hit a limit with trying ebbbbcc?
One b less
Not yet
EBBBCC
Also, I just removed the two c's, don't actually need that data so I'm using [RequireComponentTag(typeof(Chunk), typeof(ChunkUpdatedTag))] now
Ah I'm confusing commandbuffer with dynamicbuffer, yeah need more coffee
Haha
I'm drinking beer already
@zenith wyvern if my managed array wasn't a field, but a variable in methods, would that be ok?
Depends what the methods are accessing
It seems like you would want to store whatever the managed array was trying to do on the entity, or just pass it in as a nativearray
You can do NativeArray<bool2>
bool2?
Or I guess it's more likely you'd want a 1d array representing a 2d array of bools
Yeah I just converted it to a 1d array
I'm still getting the [Readonly] error, but I think I did everything you said. Could you take a look at my updated gist? I just pasted in all the code. https://gist.github.com/kayvanbree/47b4b9f767fd9f308a138e313c111cda
[NativeDisableParallelForRestriction] public DynamicBuffer<Vertex> _vertices;
[NativeDisableParallelForRestriction] public DynamicBuffer<Triangle> _triangles;
[NativeDisableParallelForRestriction] public DynamicBuffer<Voxel> _voxels;
[NativeDisableParallelForRestriction] private NativeArray<bool> traversed;
I'm not sure what these are supposed to be doing
They're public fields but you're not assigning anything to them when you create the job and you're trying to assign to them isnide the job which would do nothing
But I can't assign them from outside the job right? Because I would need an entity to find the buffer?
That's what the parameters in the foreach are doing, they are referencing the buffers on your entity. If you want to read or write to your buffers you do it through the parameters in the foreach
And you can add [ReadOnly] to the readonly parameters to let the safety system know you're not writing to that buffer
Which is really awkward which is why I vastly prefer the lambdas
private void UpdateChunk(Entity entity)
{
// Loop through the dimensions
for (int currentAxis = 0; currentAxis < 6; currentAxis++)
{
/**
* Loop through the layers of this dimension
*/
Axis axis = (Axis) currentAxis;
Vector3Int layerDimensions = GetAxisLayerDimensions(axis);
for (int currentLayer = 0; currentLayer < layerDimensions.z; currentLayer++)
{
RenderMask(layerDimensions, axis, currentLayer);
}
}
}
You're passing in an entity here and doing nothing with it? I guess this is just temporary while you figure out how to stop the first errors?
Yes
I still need to refactor some stuff
Just trying to get rid of the error, entity is gonna go
It seems like your job struct is insanely large
I would get rid of everything in there and put it into helper classes or something. It's just dirtying everything up and I can't even tell what the job is trying to do
Which is fine since it's not my code but if you want to help you, yeah
I need ot be able to understand what I'm reading
Well, it's my own interpretation of an algorithm I found that was even more complex, but all rammed in one method with variables that only have one letter
But what it does is not really the problem. The buffers are
I just commented everything, only added vertices.Add(new Vertex { Value = Vector3.down})
still get the readonly error
That's with the buffers in the IJobForeach
so in the parameters of the Execute method
[RequireComponentTag(typeof(Chunk), typeof(ChunkUpdatedTag))]
struct GreedyChunkMeshingJob : IJobForEachWithEntity_EBBB<Voxel, Vertex, Triangle>
{
public EntityCommandBuffer Buffer;
public void Execute(Entity entity, int index, [ReadOnly] DynamicBuffer<Voxel> voxels, DynamicBuffer<Vertex> vertices, DynamicBuffer<Triangle> triangles)
{
}
}
That's what your barebones job should look like
From there you can process your voxels as needed and push them to the vert and triangle buffers
Does that make sense?
That does make sense
That should compile
At the moment
I removed the traversed and only call vertices.Add in the execute
I get a null reference somewhere
Let me check it out
It's in generating the IJobForeach
no
It's in ExecuteChunk
NullReferenceException: Object reference not set to an instance of an object
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <7d22f8e71133418c87c7b26ea181f3e3>:0)
Unity.Entities.BufferAccessor1[T].get_Item (System.Int32 index) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/Iterators/ArchetypeChunkArray.cs:712) Unity.Entities.JobForEachExtensions+JobStruct_Process_EBBB4[T,T0,T1,T2].ExecuteChunk (Unity.Entities.JobForEachExtensions+JobStruct_Process_EBBB4[T,T0,T1,T2]& jobData, System.IntPtr bufferRangePatchData, System.Int32 begin, System.Int32 end, Unity.Entities.ArchetypeChunk* chunks, System.Int32* entityIndices) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/IJobForEach.gen.cs:3446) Unity.Entities.JobForEachExtensions+JobStruct_Process_EBBB4[T,T0,T1,T2].Execute (Unity.Entities.JobForEachExtensions+JobStruct_Process_EBBB`4[T,T0,T1,T2]& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at Library/PackageCache/com.unity.entities@0.4.0-preview.10/Unity.Entities/IJobForEach.gen.cs:3402)
That even happens without the vertices.add
No idea on that one
Just reduce your job more and more until it goes away, then figure out exactly what your'e adding that's causing it
I think it might actually be a bug
I Changed IJobForEachWithEntity_EBBB to IJobForEachWithEntity_EBBBC and it works
I had the bare bone minimum
Well now that you got rid of your errors you should be able to process your buffers at least
I also get the readonly error back when I add the EntityCommandBuffer back to the job
I can't paste 3 lines of code π¦
Oh, hahah. You need to use a concurrent command buffer because it's Foreach
Ooooh
I thought you were getting the readonly error from your buffers, but it was the command buffer
To paste code do:
```cs
Code here
Hahaha
I crashed unity
π
added back my code
I'm gettting other error messages now, but I'm gonna call it a day
Time for some Overwatch
Thank you for your help @zenith wyvern!
No worries dude, good luck
Looking for an idea for a case like this:
Imagine you are making FTL, you have your overworld map and your encounter screen. Each encounter should probably be a subscene (at least in my case it is), and any entities you spawn during the encounter you want destroyed when it ends. You still want things like the state of the ship etc around during the encounter. Like what in GameObjectLand you would do with SetActiveScene - you spawn all the new gameObjects into the encounter scene and unload it when you are done.
Current ideas:
- Tag all the encounter related entities and just Destroy(encounterRelatedQuery) at the end. This is annoying and error prone because you have to remember to do add the tag every single time you spawn an entity.
- Inject the encounter subscene into a new World (no idea how to do that actually), and destroy that world when done. Probably a better idea but still annoying b/c now I'd have to juggle some shared state (like the UI, mouseover state etc), and move the persistent state back and forth (like e.g. nr. of missiles in FTL)
Anyone has something better? Or knows how to load a subscene into another world?
That has the same problem as 1. - forget to do that in one place and you have a stray cannonball/spawner/vfx handle on the overworld map or next time you start an encounter
(my actual problem may be the mess I've made in the encounter code, I probably spawn entities in more places than necessary)
I still like the elegance of the old-style SetActiveScene solution - unload the scene and don't worry about anything else.
Use tags component - EncounterEntity, and a simple query to nuke all of them should be enough
Though, switching scenes seems more 'correct' to what you're trying to achieve
you use and abuse the tools you're given
If you go through with that, you probably use the gameobject style of switching scenes, and rebuild the encounter each time. Which sounds a bit cumbersome and error prone, but less so than having to remember to remove everything.
Unity has traditionally let users come up with the framework so since there's been nothing enforced, it's been more of "whatever works"
what's wrong with using a seperate scene for encounters
IMO there is nothing wrong with it. It's more of a preferred design thing
A singleton (IsInEncounter?) and tags (EncounterEntity) should be sufficient to disable any overworld logic while in an encounter, and also clean up after yourself afterwards.
For UI you prolly use gameobjects anyway, so do it the normal way, and other than that you can just have the overworld stuff be physically away from where the camera is during an encounter to hide it.
Scene change is probably the easier way to manage, since it's a full context switch, but I'll admit I dunno how ECS works with multiple loaded scenes, of which not all are active.
@tawdry tree rebuilding the encounter is not an issue (it's literally just a subscene load). My issue is that I know I will forget to tag stuff with EncounterEntity (or add to a collection as Topher suggested) and I'm looking to recreate the old style solution π
If you do it with subscenes, then can't you just nuke the subscene, which will be reloaded the next time? Assuming the scene load isn't particularly heavy
I'm talking about spawned entities
like in FTL you'd have rockets flying around
that are not associated with the subscene
Oh yeah
Archetypes, maybe?
My mind says something can be done with those. Using a base archetype which has EncounterEntity, and other stuff like projectiles and such having more specialized archetypes?
Keep in mind this is gameplay code, heavily iterative, changes 50 times a day. Any solution that involves "remember to do X every time you spawn an entity" will be error prone
Honestly, I don't think you should worry about missing one here or there - It can cause bugs, yes, but assuming you do other logic well (no simulating those while not in an encounter), they should be fairly easy to debug
^
You seem to want to track them, but are worried that you forget some
Yeah, it's prolly gonna happen, but then you fix it. woop woop
I'm actually thinking about going with separate world for the encounter entities (still looking for a way to load a subscene into a newly created world)
Hmm, having wrappers around Instantiate/CreateEntity might actually be the way to go (and now I feel dumb for not thinking about it earlier π )
Hey everyone! Quick question: I'm trying to download the 0.4.0 preview of the Entities package, but the package manager is only showing 0.1.1 . Is 0.4.0 not available for the Free version of Unity?
Yes it's available, maybe you need to update your version of Unity
I think the latest entities is only supported in 2019.3.1+
hmm for some reason the only version I'm seeing available to download is Unity 2019.2
I'll have a look and see what's going on. Thank you!
It's pre-release so it's in the beta versions
Well I guess I recently got anchoring/scaling - though it needs work on canvases with large hierarchy depths π
As a note, DOTS as a whole is free to use. It would be silly if they restricted access to features again, when just coming away from that paradigm
The ONLY thing I can really think of with feature limitation is the dark theme now, and eventhen... you can technically make your own
I wouldn't pay a cent for DOTS features since none of them is stable or actually usable.
@coarse turtle ask at ui-ux
@autumn sleet ? really, just don't upgrade packages if you has not bugs.
i got cup of my university parallel programing cup, only for ECS and Jobs Burst Presentation π
I have some trouble understanding the whole gimmick of scene conversion
As a concept, it is great. We prepare a batch of entities beforehand and basically just dynamically instantiate them. It's neat (though an actual editor for DOTS would've been better)
What I don't get is how it's realized.
Specifically, three questions:
-Why do we need to use StreamingAssets for such a thing?
-Why can't we ourselves manage the binary files and load them however we want?
-Why is such a thing subscene exclusive? I also want to have such a thing for normal prefabs.ffff
And also one thing about the blob assets. UT specifically says that they are designed for storing serialized data that you create or assign from the editor. But how in the world can that be a reasonable solution when data cannot be shared across different scenes and entity components (think an AnimationClip duped over 200 scenes)? This is just too baffling.
Alright that API link really opened my eyes on some of the stuff. Thanks
@solar ridge I dunno to what that note was for but you've probably seen earlier DOTS presentations where Joachim has told DOTS sources will be available for pro subscribers
that makes zero sense IMO
and it's only ever been communicated by Joachim on his presentations, none of the official docs/forum posts have indicated this in any way so it's always been weird notion
not having source access has always been one of the biggest disadvantages when using Unity and now they at least give package sources which is still better than nothing
would hate to see that going behind paywall again (altho I'm actually on Unity Plus myself)
I completely forgot about that, should have asked Joachim at Unite what was that deal about π
because it's close to impossible to get him answer that on the forums
that being said, I'd be totally fine if Unity gave pro users access to their internal dev repos to get earlier access to things, as long as it wouldn't mean they'd delay the official packages further because of that
it would give more value to pro subscribers and still wouldn't take anything out from others
please do π
because that was super confusing on earlier DOTS presentation, lead to a lot of speculation among community
yeah, that's what I assumed
was just throwing that out as a possiblity if Unity wants to give more value to pro subs etc
From copenhagen it was indicated that all dots sources were in and you can see them. Dots is viewable, Unity sources are locked iirc
If you want to see the black box code I believe you need Pro, but that has been true for a while
As for Dots, you can already see the sources in the packages no?
@radiant sentinel okay
@solar ridge if we talk about how things are today, you get full c# source code for most unity packages, excluding burst and any native c++ code these things depend on. You can license Unity's full source if you are on pro sub but it doesn't include it, it's very big $$$ fee on top to get that, you just have to be on pro to be able to license it.
the thing I was referring was two older DOTS presentations where Joachim advertised DOTS to ship with full source code for pro subscribers
the videos I'm referring to are (with timestamps):
https://youtu.be/7ons0eVjhDY?t=1650
https://youtu.be/aFFLEiDr3T0?t=841
Joachim Ante opens the ECS track by presenting what he and his team have been working on for the last 6 months.
More info: https://on.unity.com/2Q5KxR1
Joachim Ante (Unity Technologies)
March 23, 9:00 am (San Francisco) - Unity's CTO and Co-Founder, Joachim Ante shares the principles behind evolving Unity from a GameObject engine to be Entity Component System (ECS), and the benefits it will bring to developers.
Speakers:
Joachim Ante, CTO and Co-Founder a...
the GDC 2018 one was even more unclear as it was more like "what if", but Joachim was more specific of DOTS packages being pro licensed on Unite LA later on 2018
also we had c# package source access when those talks were held
so there's few possible reasons for all this:
- He assumed the c# source code wasn't available to all and wasn't kept up-to-date about it
- The grand plan was to expose c# source code to pro licensees only
- ?
@dull copper cant we already see all C# source of all entity/dots packages?
yes
or we talking about the native parts of dots?
and we did get them when those talks were held
we are talking about c# package source code, as mentioned by Joachim on those talks
well, the GDC talk didn't talk about packages but more of referred to it
but Unite LA talk is super clear that he means c# packages
In ECS, if I need to have an entity look at an other entity, do I need to do a copy of its location or can I reference a specific entity in my data?
You can reference to the other entity
public struct OtherEntity : IComponentData
{
public Entity Other; // <- Store the other entity there for lookups on its data
}
Ah nice! Thank you. I didn't know if this was a good practice or not.
Unity does this to keep hierarchy views so an entity knows its parent π
@dark egret shouldn't be, considering Burst uses SSE4 which has been supported by AMD after ancient Phenoms and there's also SSE2 fallback that's supported by 100% of current PC CPUs
so I'm guessing if one is worried about those old AMDs the only worry is if the fallback setup works right
I think there were some issues with it at first but I'd assume those issues have been long fixed by now
Sorry to be a bother, but what data type should I use to represent color data in ECS?
Translation uses float3.
float4 from the mathematics library?
That would be RGBA. If you only need RGB, then float3
i think UnityEngine.Color should actually be fine since it already is a struct
oh? nice! huge thanks to you both, I have enough to work with now.
I would imagine float4 is more Burst compatible, if it's recommended to use float3 over Vector3, which is also a struct.
I don't know if that's recommended though.
UnityEngine.Color uses 4 floats, wouldn't Burst be able to optimize that as a float4 if that's faster?
I can profile both and report back
oh float4 is also just a struct with 4 floats
dunno if Burst has like special consideration for that but if not i'd just use Color since rgba is more descriptive than xyzw
i try to use a dynamicbuffer for the first time, but it always throws a nativearray has been deallocated exception. Is it not allowed to add an element to a buffer and then read/index it in the same frame?
Ok found the solution. I was iterating through the bufferelements and created an entity with the entitymanager causing the buffer to be invalid.
Is there any way to remove a dynamicbuffer from an entity? There seems to be no method available in EntityCommandBuffer and EntityManager
@hollow sorrel I know this is from yday, but yes burst has special considerations for the built in new math types
Hey guys, is it possible to use WheelColliders with dots and the new physics stuff?
Hmm okay. Thank you
also none of the physx stuff works with Unity Physics package
as they are two completely different physics engines
you can implement your own wheel system with Unity Physics tho
and there's less than ideal example on Unity Physics samples on DOTS sample repo about it
okay cool I will look into that. Thank you
Hi all, i'm getting this error so i'd like to know if any job inside a jobcomponentsystem using commandbuffer must be scheduled or is there a way to add command to commandbuffer without scheduling the job, i'd love to schedule it but i need access for the moment to the entitymanager
Use EntityCommandBuffer instead of EntityCommandBuffer.Concurrent?
Testing
@worldly pulsar Working ! noice ! so what toConcurrent does ? i must admit i've used unity spawner scripts from samples ^^'
If you want to write to the buffer from multiple threads (like from IJobForEach) you need the concurrent version
ha yey got it thx a lot !!
@hollow sorrel here's a really good talk about Unity.Mathematics and simd that touches on the differences between explicit simd (which is what you get when using float4 and friends - they are hardcoded to generate simd instructions) vs autovectorization (the "try and make it fast" system used for any kind of 4 floats in a struct/array of floats etc situations).
It's also a nice intro to simd programming in general:
https://www.youtube.com/watch?v=BpwvXkoFcp8
This session addresses how we are expanding the scope of the Burst Compiler to enable even the most demanding, hand-coded engine and gameplay problems to be expressed in HPC# via direct CPU intrinsics. Andreas shares the reasoning and use cases; as well as discussing implemen...
@dull copper My trust for the article you linked dropped a bit when it said "Burst is generating SIMD instructions for both" under an asm listing with 1 simd instruction in it π (the Vec3 case is not simd at all)
I've removed an hybrid component from entities and i still find his behaviors in my profiler while my job using this script don't run anymore (logic since i've removed the component from the entities) so why is each instance of the script is still running ? Does remove don't destroy the component ?
@worldly pulsar how so?
he even gave the generated asm: ```
; Vector3
movss xmm0, dword ptr [rdx + rdi - 8]
movss xmm1, dword ptr [rdx + rdi - 4]
movss xmm2, dword ptr [rdx + rdi]
addss xmm0, dword ptr [rcx + rdi - 8]
addss xmm1, dword ptr [rcx + rdi - 4]
addss xmm2, dword ptr [rcx + rdi]
movss dword ptr [rsi + rdi - 8], xmm0
movss dword ptr [rsi + rdi - 4], xmm1
movss dword ptr [rsi + rdi], xmm2
; float3
movsd xmm0, qword ptr [rcx + rdi]
insertps xmm0, dword ptr [rcx + rdi + 8], 32
movsd xmm1, qword ptr [rdx + rdi]
insertps xmm1, dword ptr [rdx + rdi + 8], 32
addps xmm1, xmm0
movss dword ptr [rsi + rdi], xmm1
extractps dword ptr [rsi + rdi + 4], xmm1, 1
extractps dword ptr [rsi + rdi + 8], xmm1, 2```
The first set doesn't have any SIMD
Just regular load,add,store
addps is the SIMD instruction
ah right, only float3 is going wide
yes, so the blog post is not technically accurate (in other aspects as well)
It's a bit naive
I'm surprised the perf dif isn't bigger in that case
That's a bit obvious actually
maybe the amount of operations didn't show it yet
The bottleneck here is memory transfer, not CPU
And the transfer is the same amount...
So, analysis is naive, contains wrong information, and example is not particularly good (to say the least)
anyway, the main point still stands that you should use new math lib with Burst π
You should test
There are several examples in which Burst even makes code slower... FHolm posted a good article on the topic here before the holidays.
well, you do pay for interop overhead
Even for CPU intensive code in which your intuition says it should speedup things
so if you only do few things it's obviously going to struggle
there's similar thing going on with the job system
Unity recently added some workaround to run jobs in main thread I think to overcome that for simpler systems
@dull copper simd x4 wide code isnt faster than normal floats all the time
most of the time, having to pack those 4 floats into a vector register has overhead
on simple tests like doing very simple math on an array, its 100% memory bound
simd only really shows a proper xN speedup when its actual heavy calculation code
many times ive tried to manually vectorize a simple loop and it ended up same speed
a good practice for the kind of arr1[i] = f(arr2[i]); benchmarks is have memcpy as a baseline
yeah, I can imagine
Anyone knows what a blobAssetStore is? It is needed when using the GameObjectConversionUtility.ConvertGameObjectHierarchy(gameObject, GameObjectConversionSettings.FromWorld(world, _blobAssetStore));
Works when creating a new BlobAssetStore and disposing it at OnDestroy. But what is the usecase?
I'm trying to understand on a conceptual level how useful DOTS would be for procedural generation where everything needs to be processed one step after another (compared to Perlin noise where you can calculate each chunk individually). Specifically I'm working on a procedural city generator that grows from a single point. The fact that I can't calculate things in parallel makes me think that the usefulness I'd get from DOTS is fairly limited. Is that a fair assumption?
dots is still faster @verbal pewter
also, are you sure that your procgen cant be parallelized?
using jobs for a producer-consumer pipeline could work
@vagrant surge Alright, will give it a shot at some point then.
As for the possibility of being parallelized, I don't think so. If I take road generation as an example, the road that gets generated next is determined by a weighted list of possible road growth nodes. When a road gets added, a new growth node gets created. The roads need to be created in the same order every time so that the growth nodes are in the same order depending on the seed used. From my perspective it's important that each road be calculated one after another to ensure consistency. Maybe I'm just not aware of how it would be done?
There are some things like block subdivision and what not that could be parallelized, though.
@verbal pewter dunno about parallelization but there's a couple ways DOTS can help
if you're using gameobjects+monobehaviours replacing those with ecs will already be faster
not because ecs is so fast but because gameobjects+monos are just really slow
even replacing them with regular C# classes would be faster
then there's jobs you can use to even sequentially generate everything on different threads which will keep your main thread free
then you can apply burst on your jobs which is like telling compiler make it faster plz
Hmmm, I wasn't aware of the possibility of sequential calculation. Though I'm not sure it would apply in my case. If step 2 of generation depends on the result of step 1, it wouldn't be able to start processing step 2 until step 1 completes. Right?
But I understand what you're saying about the benefit vs Monobehaviours. In my case the generation is using C# classes and then creating objects based on the results of that.
you can chain jobs together, if you pass in a jobhandle when scheduling it'll wait for that job to finish before starting the next one
so sequential is fine if that's what you want
Oooooh, that's interesting. That's definitely something to look into.
The next thing I'm working on for it is a traffic simulation to upgrade roads, which right now I don't think needs to be sequential. Based on the paper I'm working off of that's the most processor heavy part of the whole process, so it seems like a good candidate for DOTS.
Thanks for your help, more to think about!
posting this here too as it probably affects DOTS hybrid users who use HDRP: https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/5414
HDRP is still the slowest part of the enter play mode thing, but now it takes something like 50ms instead 1200 which is more reasonable.