#archived-dots
1 messages ยท Page 48 of 1
Yep
I don't really have crazy performance requirements so it's not a big issue for me
Was this that booleans were sometimes "skipped" by the server in commands?
you can't use bools
What do you recommend for shooter character and gun animations around Entities 0.51?
How are you supposed to predict one off actions then?
the old strategy was to byte increment
Maybe this is related my issue where the InputEvent state doesn't match the other sent data in the command
is anyone using new skinning from Entities.Graphics?
or GO with animator is still preferred way?
whoops that was too long, let me put that in pastebin instead
im feeling so lost right now, this job works perfectly as long as the number of cells (how many times the for loop runs) is under 32, but if it ever goes above it starts completely messing up everything, with triangles getting mixed up and joining in ways they shouldn't, have i accidentally created a race condition????
https://hastebin.com/somapoqozu.cs
What is BetterTriTable
Also you are writing to NumTris[0] in parallel, making the result undefined
Also I'm assuming you are using 32 for your innerloop batch count, meaning your job was never thread safe in the first place
(which explains why it breaks if you go higher)
fascinating, better tri table is just a simple marching cube tri table, and also NumTris[0] isnt undefined for some reason, the number stays correct somehow,
I dont quite get how having the innerloop batch count being 32 makes my job thread unsafe, im a bit of a noob, sorry lol
Your job just isn't thread safe. Since your inner loop batch count is set to 32, when your job is scheduled, it is picked up by threads in batches of 32, meaning value less than that makes the job single threaded
Set your inner loop batch count to 1, and schedule it with 2, it will also break
(at least I am assuming it will)
oh fascinating, ill try that quickly and report back
NumTris[0] isnt undefined for some reason, the number stays correct somehow
The number stays correct because anything less than 32 is single threaded
Above that the result will be undefined
ok yup you are definitely correct, now how do i make it threadsafe then?
It depends on what you are doing, the code you posted doesn't actually show how you use the result. All you are doing is writing vertex positions to a NativeList
How are you calculating the triangles?
i.e. which vertices belong to which triangle
ah ill add the rest of the code then quickly, it will be a bit of a mess though as most of it is copied from my old marching cube fluid renderer that i adapted to work with perlin noise, brb
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Does ECS have a problem with very large negative values? https://www.reddit.com/r/Unity3D/comments/z6hyel/can_someone_take_a_look_at_this_weirdness_im/
0 votes and 0 comments so far on Reddit
You are determining the vertices that belong to a triangle by the order they were written to the array. The order is undefined in a parallel context, that is probably your issue.
ah that would make sense, also probably the undefined triangle thing you were talking about earlier, which btw how do i make it actually count properly and not be undefined?
The easiest way is to write how many triangles each thread created separately, and then add them together afterwards
ah ok, that makes sense, thanks a ton!
The maximum amount of threads that can work on the job in parallel is defined by JobsUtility.JobWorkerMaximumCount
You can get the currently running thread index in your job by adding an int field with the [NativeSetThreadIndex] attribute
ok fascinating, im not quite sure how that would help, but ill keep that in mind!
Create a NativeArray[JobsUtility.JobWorkerMaximumCount], and then in your job do CountArray[ThreadIndex]++
That way each thread is counting up its own counter
ok cool, that sounds useful in someway, ill think about it and try writing down the logic with a pencil and paper and see if i can get something working, thanks so much!
This isn't an issue related to DOTS, it's a limitation of 32 bit floating point values
Floating point based calculations will stop being very accurate around 100000, unity even gives you a warning related to it
You will need to write your own transform system that use 64 bit values
What works fine?
Physics calculations will stop working
And pretty much everything else will also not work correctly
That's not the point
I'm talking about a specific bug.
GameObjects can handle a very large negative
ECS cannot it appears
Has anyone discussed this before, is there a bug report, etc?
Probably not, but even if it would render, you cannot work with numbers this large
There's a bunch of other games that have dealt with this issue in very different ways
It works fine with Gameobjects, I'm looking for more efficiency with ECS
I'd take a look at those
I guarantee you it's certainly not possible with 32 bit floating point precision
So it's just a bug in ECS,fine, I'll move my center into somewhere in giga +
...
Why do you think unity prints that warning for game objects far from the center?
I don't need collision and alot of stuff
even if it works it does not mean it wont break ๐
You're changing the subject from a clear cut bug.
It works fine in Gameobject land
Not that I'm aware of, if it's not a problem please include a project that illustrates the discrepancy between GO & ECS
I'm not sure if I'd characterize it as a bug, because I'm not sure that's a supported use case, but I'd be interested in seeing it
My game objects populate all around me,but as they convert to Entities, they are either not rendered or rendered in the + range
I'm doing a warp effect, using the true stars as particles, not just goofy made up ones like Nomanssky's hack
so any negative value is not rendering?
Watch the video in link
here's raw video:
We run a guild. Opportunity: I can teach you how to make games for free better they teach at expensive universities. If you help us, you get revshare.
#1 Senna NA mastery I saw no hate ever in arcades. Choose love. Also #1 world in Starcraft/Broodwar/Warcraft3/Diablo2/C&C3/SC2 2v2. No gamer has been #1 world in as ...
and it look like one side is dark, and if you are in (0,0,0)ish position with your camera
that means all negative values from at least one axis are broken
not just big numbers
Have you tried with smaller numbers?
We all know negative entity numbers works
You can try and find the limit where the issue appears
You're right its the 32 bit thing, but it is still a bug because GameObjects allow it
but yours do not work
I would assume it's 32
It's not 32 ๐
I could do a lot of things to track this down. All my bug reports get tossed out like a dilbert comic, so why waste time.
see if -3.40282347E+37 works
I can't see how large your number is from the screenshot
So the community literarly didn't know this
It's probably not a supported use case
I can't say I've run into that one yet, no
and I have saved at least one dilbert cartoon
your conclusion is plainly wrong, so what should community know in this case?
I'm sorry, what was my conclusion? I didn't know I issued one.
Not the final frontier, the final chapter.
the undiscovered country
Back to trying to figure out input events :[
I'll go back to space I guess
I should make a sector dedicated to outsoruced officer workers
if you do happen to file a bug please lmk
I don't file bugs anymore, all mine get thrown out as 'no one cares' jargon, despite me giving cause/effect/repeatability and fix since I'm a software developer.
File bug, officer worker stamps it as not important, files away. Ez job.
I think that reduces the chances of it being fixed
I understand, that does sound frustrating. Even if you did file this one I can't promise it would be fixed, as I'm not sure I'd characterize it as a supported use case. But I would be interested to see why there's a discrepancy just the same. Anyway, no worries.
Just convert the engine to 64 bit, done.
big oof
I'm also not updating Unity any time soon. I'm tired of everything breaking in updates. I'll wait til I hit a real brick wall... I just wanted to ask if there was a work around for this bug before I did.
I mean your conclusion about big numbers, and only providing a video with you moving camera around, I personally don't see why black screen was caused by 32bit precision or any other bug with big number
I linked a reddit post earlier
0 votes and 0 comments so far on Reddit
Has screen shots of clearly negative values
Could be due to the way the graphics package handles rendering, maybe rounding errors ๐คทโโ๏ธ
but only one cube of how many cubes in 3d are there, rendered
9 above, 9 below
how many on sides?
8
9+9+8 and only one rendered, its clearly saying its negative, but not rendering: Could be not showing or scurried over into positive
Only one cube of stars is rendered, like it is +x,+y,+z it means all negative numbers are not rendered not only the big ones
The scale is MASSIVE
so what looks like only a little to the left
are those stars billboards?
My guess is degenerate bounding volume generation, but it's tough to say absent a working sample
If a star was close by, I'd be rendered IN IT
I can give a sample, quite easy:
Just generate spheres with randompositions -Very far, to 0
I'll give you the code you need
sec
I understand what you mean by "space distances" but the bug is "only +x,+y,+z spheres are rendering" and you should look for bug with that in mind
more probable than a bug with big negative numbers
i think its safe to say, something in entities.graphics, probably culling is breaking down
I'm making sure this is a completely encompassing easy to import package
i vaguely remember some constraints for this
Similar thoughts
the question is, why not render a cubemap with scaled down values? are players able to reach those far away stars?
also you can render scaled down versions closer, and scale them up as you get closer
looks like I repoduced it very minimally
I'll export the package as a runnable Unity thingamabob asset type thing
how do you Debug.Log a Hash128 in a bursted job?
Upload it, where, bug reporto?
Why do you need it bursted?
Scratch that, new weirdness showed
the problem happens when the job is bursted, thus I need to closely look at the value ๐ฆ
You could log the hash's uint4, since what the hash is made of
Ah, long time no see old friend.
I just realized something stupid... All this time I wanted to give people my DOTS ECS system tutorials, but couldn't because I couldn't start from scratch... I could have just copied my project and deleted everything but the guts.
A lot has also changed since 0.51
yup
thats why I wanted to get everyone hoked on my systesm
๐
If you get everyone using your system as the proprietary standard, its harder to remove key features that it depends on.
I know the chess match all too well
I just forgot how to move a knight...
I don't follow, unity mentioned 0.51 wasn't production ready
Understandably so, it was a very advanced concept called wag the dog.
.51 was not production ready, and I knew it would change a lot
didnt see anyone mention it
so my desire was to do a cool youtube video(my DOTS/ECS videos do get views), and give free source code on the systems I especially did not want changed.
but burst default precision is medium
ty tertle, I'm still reducing my project for UNITY to review
FloatPrecision.High: Provides an accuracy of 1.0 ulp.
FloatPrecision.Medium: Provides an accuracy of 3.5 ulp.
FloatPrecision.Low: Has an accuracy defined per function, and functions might specify a restricted range of valid inputs.```
Project is 40 GB so backing up before the surgery starts takes like 10minutes, almost done
Again I was making no conclusion, heck maybe a rogue system in my code is going bonkers, but seems less plausible.
but yeah even at full precision anything above 1.4mill with floats
is very inaccurate
well it's relative
my objects are 10000000000 m big
don't need accuracy ๐
it could waver 10000000 units, no one notices even the slightest jitter
Just doing a no collision fly by
that's about the accuracy you'd have ^_^'
exactly and no one notices!
Funny how stuff that people think shouldn't work does
I predicted the electric car in 96
My fellow Physics students and profs at Carnegie Mellon all disagreed or stayed silent
I think it depends on whether or not you characterize "no interaction" as "works" ๐
I have lots of stuff I fought hive mind and won, just cuz no one thinks things through as they should, all go with the flow types
The easier approach is to do what KSP did, move the world instead of the player
Angband's autosquelch the hive fought me for months on usenet, Angband vs Nethack is like Kirk vs Picard, its deep nerd lore... Well I designed the autosquelch despite protests, Andrew White coded it, and now its a must have or don't play design.
you gotta, you gotta be trying stuff that seems peculiar, do the calculations and such, don't just conform to meta. If you come at life on off meta, then if it doesn't work, do what everyone else is doing.
In fact I had so many successful multibillion ideas my friends make fun of me for always predicting the next big things in tech saying I should get a site: I thought of it first dot com, lol
On the right track, not moving, get run over, ok, enough useless platitudes, copy over, time to load up the new forked project and cut out all the assets.
i think noise.cnoise is perlin noise, but im not certain, is this what perlin noise i supposed to look like when using marching cubes?
Definitely not.
Stray triangles shouldnt happen with marching cubes
we all do, we just don't brag about it if we fail to make them reality ^^
my marching cubes implementation is very blunt, it doesnt do the fancy thing of moving towards where the isosurface is, hence why floating triangles occurs
unusual,
Some of them take a team: Dating sites, instant messaging, MMORPG, etc, made some reality and corporations ripped me off over a mil, now living in a place without water, but guess what? I have Jesus and I'm happy with life. ๐ All that matters is love and eternity.
Its funny, big guys, you'd think they'd be happy with their normal revenue, but ripping off indies is a side hustle I spose. Hoping Valve is cool.
Spend a few thousand hours here, a few thousand there in games, and contracts only are enforceable by the party with more money.
im calculating my perlin noise for my marching cubes using something similar to this, anything obviously wrong with it?```cs
UpdatedCell.Vert0 = noise.cnoise((Cells[i].Pos + (VertexPosTable[0] * HalfLength)) * NoiseScale);
UpdatedCell.Vert1 = noise.cnoise((Cells[i].Pos + (VertexPosTable[1] * HalfLength)) * NoiseScale);
UpdatedCell.Vert2 = noise.cnoise((Cells[i].Pos + (VertexPosTable[2] * HalfLength)) * NoiseScale);
UpdatedCell.Vert3 = noise.cnoise((Cells[i].Pos + (VertexPosTable[3] * HalfLength)) * NoiseScale);
UpdatedCell.Vert4 = noise.cnoise((Cells[i].Pos + (VertexPosTable[4] * HalfLength)) * NoiseScale);
UpdatedCell.Vert5 = noise.cnoise((Cells[i].Pos + (VertexPosTable[5] * HalfLength)) * NoiseScale);
UpdatedCell.Vert6 = noise.cnoise((Cells[i].Pos + (VertexPosTable[6] * HalfLength)) * NoiseScale);
UpdatedCell.Vert7 = noise.cnoise((Cells[i].Pos + (VertexPosTable[7] * HalfLength)) * NoiseScale);
iirc I ran into issues if I just rolled a random number for the seed, since it got wonky if the position values were very high, which is why I cast it to a short
oh fascinating, so should i cast it to a short, then back to a float?
ok thanks!
aha, turns out that by multiplying it by a small number like 0.1 it makes it small enough that it does perlin stuff properly
A lot of things in life obey you if you threaten em with math.
this also means that i can set it to a high number in order to make the perlin noise generater create some lovely regular noise
I just remember my world map looked wonky with high seeds
this does raise an unfortunate truth, due to perlin noise getting weirder the larger the input, the further away from 0,0 the less normal the map will look sadly
I must have deleted some rogue HDRP component when reducing: https://pastebin.com/fSfz1h0e
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Can someone help me get hdrp back on its feet for the kind unity devs to review this bug?
*(possible bug)
Oh there's an hdrp wizrobe, cool
What's funny is... the artifacts of shaking mean some of the stars twinkle
Do you think God coded the universe in 32 bit to save on video card rendering?
yah its not my scripts, totally reduced, its a Unity issue, No shame in it, most people not doing this
I'm just glad DOTS works!
Man Dots is a lifesaver, I was gonna code parallel processing from the ground up
wondering how does this perlin noise pick its seed, as it seems to change seed every frame, anyway to force it to have a certain seed?
there is no seed. the same value in will return the same value out.
it isnt though
im giving it the same xyz, and getting different results depending on the frame
That's odd
you're overlooking something
I think so too
probably lol
is multiplication deterministic? As aside from that i really cant see how im overlooking anything else, as i only have 3 variables that affect how the noise is generated...
If you're using burst, yes.
i hope im using burst
welp im going to assume im not using burst, cause that is the only option, how do i use burst then?
Do you have [BurstCompile] as an attribute to the Job?
yes
Then you're using burst.
what
That is all you need to do, to start using burst at least.
why do i only see burst 1.8.0-pre.2 in package manager when there's burst 1.8.2?
im so confused then, as im doing the noise on 1 frame with a position multiplied by 0.1, then on another frame i do the exact same thing, but get a different result
gotta type in the versions manually. You've been around long enough to know that unity never lets the pubbies play around with the most broken advanced packages.
Then your noise seed is changing somehow
but ive been assured by tertle and schnozzlecat that there is no seed
yeah but 1.8 is now out of pre. lol, i dunno ๐ manual editing it is then
I wasnt there to see ya code so I'm gonna assume they're right. Something in your code is wrong then.
i know, but ive tested all 3 variables, and i can safely guarrentee that it isnt the position changing, it isnt the scale changing, it isnt the multiplication not being deterministic, meaning what on earth could it be?
Attach a debugger and step though the job frame by frame.
im quite a noob, how do i do that?
also im on 0.5something, the 2021 lts version, btw
I personally dont use the debugger so I cant answer that. What I do instead is fill the job with debug logs and see what it says.
i shall try that, i didnt even know you could do that, thought debug logs were not thread safe lol, thanks so much
In burst, you cant do Debug.Log(var). You must instead do Debug.Log($"{var}") Annoying but thats how burst does it.
ah clever, thanks!
ah im an idiot, too hard to explain how im an idiot, but trust me i am one, there was a secret 4th variable i didnt realise, welp thanks so much!
Ha
This small set of UI took me over 16 hours in total to get working. Ya think 0.17 DOTS was undocumented, UIElements is just as undocumented and source is not available. So I'm blindly stumbling around to get this working.
And there's no intellicomplete on CSS documents so I'm just typing in anything and seeing if it works. And invalid CSS doesnt even throw a compiler error, it just doesnt work.
And I cant tell if it doesnt work because it might just be hidden
stellar work! uielements is indeed quite hard to start with. it gets easier after a while
My goal is the combine the best (IMO) features of the numerous DOTS 1.0 windows with the compact readability and usability of 0.17 Entity Debugger.
I love assembly refs.
i wish i didn't need them
i dislike how it generates the project for the target and adds it to your ide
requiring code analysis to run on it
and then just randomly getting errors like this
Surprisingly, getting system list wasnt the hardest part.
The hardest part is the continual editor crashes.
Something in the scenes (dont know if full scene or subscene) doesnt like what im doing
Yo, where do I post this 11 mb project so official unity devs can fix it
100% a Unity bug. I don't think I need entities to simulate a warp effect
Easiest way is just to leave em GameObjects for now, see if it looks good.
When it starts to lag in a few months I'll do it right
Off chance its fixed and I upgraded my dots
UIElements is meant to work on through UI Builder
that's practically, the only way to see properly what you do
also it hot loads code from custom visual elements
Unity really could use some codegen with UI toolkit
UI Builder helps with some things but it's fairly bare bones. I'm working with a custom multi column list and data and that all must be done c# side.
not really
you're just using it wrong ๐
show me in UI builder how to connect this using CSS:
allthough, I really hope to see a way to add some "example" elements to collections in UI builder
so far it's only possible if you create custom VE
and quite literally add them from here
I used to do this by defining some Label or smth inside List and attaching all CSS to it
and then in code I would grab all CSS from this element
and attach it to actual template
this is one way you can achieve behaviour of seeing what you editing in Lists
also, just checked and turns out elements inherit CSS from Lists
hey, im currently using unity 2021 and dont want to upgrade to 2022 for DOTS. what would be my options to run multithreaded code? im kinda confused with the options. there is ECS, C# Job System, Dots, C# threading, some options use parts of the others.
you can use burst and jobs without entities and these run fine in 2021
that's a really old version but yes
jobs is the multi threading
burst is a extremely performant compiler that works on jobs but has restrictions on what you can do (code must be unmanaged)
outside of this, the classic c# approach is just to use tasks
i see. thank you
trying to check if a float3 is equal to 0,0,0, i would assume to do it like this:
if (WhateverFloat3 == float3.zero)
{
}
except this mysteriously gives me the error " cannot implicitly convert type 'Unity.Mathematics.bool3' to 'bool' ", guessing im doing something wrong?
aha found a good forum post
i assume you figured it out but yes
== will return a bool3
what you want is just WhateverFloat3.Equals(float3.zero)
or math.all(WhateverFloat3 == float3.zero)
ah, i got none of those, and the one i found on the forum didnt even work, so i shall try those 2, thanks a ton!
I'm having problems with 1.0-pre15 trying to schedule IJobEntity from an ISystem.
There is no boxing conversion from FooJob to 'Unity.Entities.InternalCompilerInterface.IIsFullyUnmanaged'. I don't see any difference to the examples in the docs, what am I missing?
The job itself
[BurstCompile]
public partial struct DriftJob : IJobEntity
{
public float deltaTime;
[BurstCompile]
void Execute(
ref LocalTransform localTransform,
in DriftData driftData
)
{
localTransform.Position += new float3(0, 0, -deltaTime * driftData.Speed);
}
}
Wait, you're right, that right there, might be an issue!
what is DriftData
public struct DriftData : IComponentData {
public float Speed;
}
oh wait your error is just on the job schedule
does this error happen in unity
or just in your ide?
I haven't refactored all my transforms to the pre15 format yet, I'll try to find the specific error in the sea if unity reports it as well
i believe this usually happens if the source generators haven't run or your ide / project isn't linking to them for some reason
if this is the case, it would not be an error in unity and it'd run fine
if you have other compile errors i would try solve those first
and then confirm if it's actually an error or not
That would be great, I'll complete the update and see if it fixes itself
outside of just, project completely uncompiling the only thing i know that breaks this atm is if you add <AdditionalFiles> to the csproj in rider which is basically just a super obscure edge case that affects me and i haven't seen anyone else report it
(you'd have to be doing csproj post processing so it's unlikely the cause)
if this doesn't work let me know, i just had a check and the error i get from what i'm discussing is a bit different to yours and if it's not the issue i have a couple of other thoughts
I think it worked, the error is gone and no errors when running in editor. The systems don't work yet like before, but it compiles successfully
Soo it's a false alert :)
If you use the IJobEntityChunkBeginEnd interface and return false from the OnChunkBegin method, I'm assuming the change version is untouched even if you requested write permission inside the Execute body?
This seems like an oversight. It's requesting the native arrays / buffer accessors before checking if the chunk should be executed, bumping the change version regardless
(Unless I'm missing something)
@proud jackal I'm seeing the same problem in my code from time to time too with the IIsFullyUnmanaged thingy ๐ฆ
clearing out the Library and restarting the editor typically fixes the problem tho
That's an IJE right? I think that's known because DBs are always write and therefore bumped.
shouldn't work like that
It's the same with an IComponentData
It calls chunk.GetNativeArray before checking if the chunk is actually executed
i thought comp uses GetComponentDataRO?
Not if it has write permission
hm, what do you expect with write permissions?
For it to call chunk.GetNativeArray after checking if the job is actually going to be executed
oh i see, yeah!
My example was bad since I used a buffer
Here it is with an IComponentData
It gets a RW pointer to the component type, bumping the version, even if shouldExecuteChunk below it is false
Pretty cool though, makes IJE more usable for optimization scenarios
Especially if you need to pre-calculate some data based on a shared or chunk component for that chunk. I guess it is kind of weird still since you'd need to write that data to the executing job struct...
anyone else seeing this? The delegate type Unity.Entities.FastEquality+TypeInfo+GetHashCodeDelegate should be decorated with [UnmanagedFunctionPointer(CallingConvention.Cdecl)] to ensure runtime interoperabilty between managed code and Burst-compiled code.
Not this. But I had a similar problem with fast equality when trying to access SharedComponents in a burst compiled method
mmm interesting, dont think thats my problem tho ๐ฆ
im trying to figure out addressable loading of entities via subscenes, is there a good doc for 1.0?
as of now I'm getting subsceneGUID of 0000 after loading the scene which contains the subscene gameobject
I dont even know if this is possible. I tried to avoid subscenes for now and load entities via converted addressable prefabs
I am eagerly waiting for addressable entities
https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/content-management.html
Have you seen this? Never used addressables myself but I've heard this is the equivalent.
Thats interseting. Is this really the addressables replacement? Because it seems to only work with game objects and scenes ๐ค
I too was left a little disappointed it doesnt really deal with entities. i was hoping for something where id mark a prefab as dots addressable, and it would automatically put it into a subscene that would get baked, and thus could access the entity prefab in a system. given we have the SystemAPI for handling caching of certain things, maybe it could even handle getting the singleton entity and we just use it in a job without any extra setup
that's reeeally unintended behaviour
yes I know. but as long as there is no working intended behaviour for my use case I have no choice
why subscene is not an option?
Subscene is desgined around static content
Does not work for tilemaps, user generated content, level editors or modding
ahem
This Runtime Data != Editing Data paradigm breaks down pretty much with any user or runtime generated content
it's definetely not meant for level editors (runtime)
no idea about tilemaps
but I could argue about user generated content and modding
How would a user create a custom level/map with subscenes?
with Unity editor
you don't have to recreate all tools yourself ๐
that's what I aim towards for my project
ah - anyone have any issues with scene catalog not being initialized? ๐ค
so far the only trouble around it - burst bug where loading additional assemblies doesn't work
kinda also makes certain editor tools kinda odd, like if you want to use physics to place objects organically in a scene, are you meant to code using physx and then also use unity physics at runtime or use try to use unity physics in scene mode, kind of feels a bit like the whole srp dillema
and then if you want runtime user gen content to also work in a similar way, you obviously cant rely on physx
Yeah thats exactly the problem I had with the level editor. I would have to code it twice to work in editor and runtime.
I ended up creating an editor world and actually painting entities in editor.
And I know thats definitely not intended behaviour and sometimes painful ๐
if your world is procedural you are kind of stuck with runtime
in my case I just develop all tools for world generation for runtime
not even wasting time for serialization of it
instead using seeds
I'm lazy and just use an intermediary format like JSON 
Json is great and universally accepted. +1 to json
I am also using a custom file format. So its Editor Entities -> Custom format -> Load and convert prefabs -> Runtime Entities
I just serialize scriptable objects to JSON which are then converted to blobs at runtime
Same. But would be nice to convert them at edit time and load via Addressable Entities
@pulsar jay i assume you have to serialize manually then?
Yes tilemaps have a custom format
If you use entities yes, the scriptable objects you can obviously load via addressables
Yes thats true. But they in turn often reference Prefabs to spawn and convert
A lot of my stuff is procedural, so they usually just reference a single prefab and set values
But that probably won't work if you want to do something funky with a mod
The other issue is netcode, since iirc netcode checks type hashes to see if the client and server have the same ghosts. I might be misremembering though
As much as I appreciate the help of the parent/child tree view in the Entities Hierarchy, is there a way to use the <= 0.50 view? In some cases, I need to know if the parent and child were actually decoupled from an authoring go that had a hierarchy.
Switch the hierarchy view from authoring to play mode. The orange circle thing
Yeah I remember it was there once, but for some reason with their latest update, that option is gone for me. But it is still available in the Inspector.
Is there a way to get the currently inspected entity in the inspector?
yes
it's called
EntitySelectionProxy
you need internal access though
Is it a static class or how do you use it?
one sec it's changed a bit in 1.0
there might be a nicer way to do this i can't remember
it's a scriptable object
Like an editor singleton?
{
public static bool IsSelected => Selection.activeObject is EntitySelectionProxy;
public static World World => ((EntitySelectionProxy)Selection.activeObject).World;
public static Entity Entity => ((EntitySelectionProxy)Selection.activeObject).Entity;
}```
seems to be a little helper static i have in my library
(no idea when i wrote this, i don't seem to use it)
Ah, it's a scriptable object internally
Awesome, thanks
Now tell me where to store my ability state 
in the cloud
very modern
having random 'infinite loops' from this AssetDatabaseExperimental.ProduceArtifact(ArtifactKey artifactKey) method occasionally
bit annoying
never returns from the native call
Why is FixedBytes getting removed in the future?
That comment has been there since March of 2021; I'll follow up with the dev who added it
i'm surprised you have a use case for this anyway
well that's not true
16 is pretty useful, but i think you're better off just replicating your own since apart from 16, the rest of the sizes are really awkward
I initially saw it here, which is definitely somewhat misleading
Is it not possible to have a static function return a ref to a ref struct that was passed in?
show code what you're trying to do?
love this method, so lazy ๐
yep
I don't know how better to store small information across frames from a node that is executing
Well there's definitely better ways but I'm lazy
So I'm going with the "small memory block that can be anything" approach, and I will probably regret it in the future when I accidentally cast it to something that is larger and my computer explodes
oh i just mean, you're wrapping a single line method with another single line method
I know right, pretty epic
So many generic arguments, I can't type that every time
my fingers will break off
can someone sanity check me
{
/// <inheritdoc/>
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
var drawer = SystemAPI.GetSingleton<DrawSystem.Singleton>().CreateDrawer<ORCADrawSystem>();
var obstacles = SystemAPI.GetSingleton<ORCASystem.Obstacles>().Value;
new DrawObstacleJob { Drawer = drawer, Obstacles = obstacles }.Schedule();
}
public partial class ORCASystem : SystemBase
{
/// <inheritdoc/>
protected override void OnDestroy()
{
SystemAPI.GetSingletonRW<AgentStates>().ValueRW.Value.Dispose();
SystemAPI.GetSingletonRW<Obstacles>().ValueRW.Value.Dispose();
}
}```
InvalidOperationException: The previously scheduled job ORCADrawSystem:DrawObstacleJob reads from the Unity.Collections.NativeList`1[BovineLabs.ORCA.Data.ORCAObstacle] DrawObstacleJob.Obstacles. You must call JobHandle.Complete() on the job
i have like 3 uses of this singleton, but only this one is having issues OnDestroy
Try calling CompleteDependencies before the OnDestroy, I had a similar issue when writing to a singletonRW
I would expect it not to be an issue when systems are in the process of being destroyed...
yes but i don't like this and i'm trying to figure out why
how does physics get away with this
public void OnDestroy(ref SystemState state)
{
ref var buildPhysicsData = ref state.EntityManager.GetComponentDataRW<BuildPhysicsWorldData>(state.SystemHandle).ValueRW;
buildPhysicsData.PhysicsData.Dispose();```
aw they're using EM to do the dependency
new PhysicsWorldSingleton
{
PhysicsWorld = physicsData.PhysicsWorld,
PhysicsWorldIndex = worldFilter
});```
it is stored on a singleton, they are just disposing it that way
ok yeah that's fine
thats what i missed, thanks
hmm nno
that didn't help
{
this.EntityManager.GetComponentDataRW<AgentStates>(this.SystemHandle).ValueRW.Value.Dispose();
this.EntityManager.GetComponentDataRW<Obstacles>(this.SystemHandle).ValueRW.Value.Dispose();```
How often are you destroying this system that this is an issue? Or do you just want to understand why it's throwing the error
every time i leave play mode
But it should only stall for one frametime shouldn't it?
Not even, since you are only completing the dependencies of the preceding systems
Is there any reasong ORCASystem is a SysteBase ?
i simply havent upated it
im doing that atm
its not about stalling
this.EntityManager.GetComponentDataRW
should be completing the dependency
DependencyManager->CompleteWriteDependency(typeIndex);
I just meant if you wanted to know why this happens or if adding the line to complete dependencies was like a performance bottleneck or something ๐
can you also check the order the systems updates ?
i know order systems update
all my drawers are in a debug system group in presentation
where my ORCA simulation is in simulation
i don't actually know ondestroy order though
ah shit i see issue
{
/// <inheritdoc/>
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
var drawer = SystemAPI.GetSingleton<DrawSystem.Singleton>().CreateDrawer<ORCADrawSystem>();
var obstacles = SystemAPI.GetSingleton<ORCASystem.Obstacles>().Value;
new DrawObstacleJob { Drawer = drawer, Obstacles = obstacles }.Schedule();
}```
i changed DrawObstacleJob from IJobEntity to IJob
needs to pass dependencies
and then everything works fine, even the original getsingleton stuff
i've been replacing a deferredbuffer implementation i used to have
(so hacky, but so cool)
with just singletons with nativelists on them now
TLDR: buffer/list needs to be chain passed through a few jobs, calling GetBuffer is a sync so I made a way to return a deferred NativeArray from a dynamicbuffer to solve this
But with Native containers on components i can remove this hack and just use NativeList stored in system + on singletons for dependencies
Do you still need to disable safety when writing to a native container inside a component?
no
you just have to pass container / component into job
and not query it from the job
Ah ok, that's what I meant
native containers on components are only good for singletons
Yeah it'd be cool if you could put them on components though
Alternatively more variations of DynamicBuffer that mimic those implementations
even if it was possible i would never do it, managing the memory is a pain
well have a dynamichashmap and dynamicmultihashmap implementations already
so yeah i agree with you on that
When the leak detection works again, the entire detection is based off of the allocator, right?
i tested this 2 days ago
in f1 tempjob was working for me with Enabled
but not with Enabled with stack trace
f1?
yeah 2022.2.0f1
Ah
Really? I thought I tested it on f1
I just get this message
To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.
how did you get 2022.2.0f1 ?
KornFlaks sent me a secret link
for some reason its not on hub
unityhub://2022.2.0f1/1c1f8590be28```
no idea how sionzee found it seconds after it was out
I also get this, but that's not very useful without a stacktrace of any kind ๐
yes
i'm just relying on my god tier coding skills to not write leaks copium
The reason I was asking, if the detection is bound to the allocator, it should then also detect leaking blob assets, right?
(i look forward to having a dozen leaks when we get this back)
I don't think I have any leaks there, but it'd be nice to have the peace of mind
same haha
@pulsar jay so you convert prefabs via baking then serialize them somehow?
safety ๐
When is UNITY_ASSERTIONS actually true? Is it true even in a development build? Or are all builds stripped of it automatically
I couldn't find anything online for some reason
All method calls will be conditionally included only in a development build, unless specified explicitly. See BuildOptions.ForceEnableAssertions. The inclusion of an assertion is controlled by the UNITY_ASSERTIONS define.
you didn't look hard enough ^_^'
first result
BuildOptions.ForceEnableAssertions
Include assertions in the build. By default, the assertions are only included in development builds.```
so i was wrong, they are included in development builds
Yeah I must have googled it and immediately given up, thanks for checking ๐
Anyone gotten this? Pops up randomly sometimes
NullReferenceException: Object reference not set to an instance of an object
Unity.Entities.Editor.SystemScheduleWindow.UpdatePreferences () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities.Editor/SystemSchedule/SystemScheduleWindow.cs:284)
haven't seen that one
seems to be calling SystemScheduleWindow before OnEnable is called
which seems improbable since UpdatePreferences is called from OnUpdate
๐คทโโ๏ธ
happens sometimes after compiling, and it will then log the error once per second until I compile again
i don't usually have the system window focused/in view
so probably just stealthily avoiding the timing issue
There's no way to return a void function using the switch pattern matching syntax is there?
what do you mean
there's a gross workaround
(stringValue switch
{
"Add" => (Action) Add,
"Subtract" => Subtract,
_ => throw new ArgumentOutOfRangeException()
})();
return a delegate invoke straight away
again, gross ^_^'
I see
I think at that point I'd rather just use a regular switch case statement ๐
But good to know ๐
i believe this requirement is being relaxed
in the future
(or maybe it has been already? not keeping that up to date with c#11)
That'd be nice, since I think it's cleaner than a normal switch statement
Still undecided if I should make the context struct that is passed to abilities huge, or use an ECB to signal changes
Now recreate the rest of the editor
Yep...
Iโm having some trouble wrapping my head around the dots concept. Letโs say you need to change a material property or update a renderer state. How would you do it?
I guess it kind of depends on if you are using mono rendering or dots rendering. Assuming you have the data on a component, just query that component and modify it
Not sure what's the deal with these two. Let me see if I can find anything
I'm fairly new to the implementation of this, been on my to-do list for a while but now with 1.0 decided to give it a try
Is mono renderer the hybrid renderer?
anything prefaced with "mono-" means the usual monobehavior GameObject way. In this case, it's the regular mesh or whatever renderers
Hybrid renderer or now renamed Entities Renderer is the DOTS rendering pathway.
Can you not use an ArchetypeChunk to set the state of a zero-sized IEnableableComponent?
You should be able to.
I do not know ๐ I'm researching the topic but can only find old forum threads
Weird, maybe the query is the issue? I'm only querying on my enableable component and Simulate
Yea, that's the problem with dots. Lots of old outdated threads.
This is the error:
System.ArgumentException: ArchetypeChunk.GetDynamicComponentDataArrayReinterpret<{0}> cannot be called on zero-sized IComponentData
Maybe not on IJobEntity. Try IJobChunk.
Yea, dont do that. For one, chunkEnabledMask is the combined & of all required components.
So what you're doing there in chunk.SetComponentEnabled is basically setting enabled components to enabled.
That's... what I want to do
๐
Oh
I see what you mean
But the query has the option to use disabled components
As in already enabled components. Not IEnableableComponent
The enumerator filters for only enabled indexes
Without using the enumerator
I see, I thought it took the query into account
I assume I will still get the exception even with that change
Alright, the query using .WithNone<>() might flip the bitmask.
I meant .WithOptions(EntityQueryOptions.IgnoreComponentEnabledState)
Is the error at enumerator.NextEntityIndex or at SetComponentEnabled
Try chunk.GetEnabledMask(ref tagComp)
And then set by mask[index] = true
Nevermind, the issue is netcode
I think it can't sync the enabled bit of a zero-sized component
Oh, it can

you need to add an attribute
I did
Wait, it just came to me, yea. netcode cant
[GhostEnabledBit]
I remember now, you must have some field inside the component to sync them
they recommend having a single byte field to sync enabled status
Sorry, I just remembered looking at the netcode docs
that's shit!
i just added enabled saving to 0 zero components in my library
wasn't that hard
I think the issue is the auto-generated serialization part
you just check elementsize = 0 and skip the get/set data parts
Might not be enough bytes actually. You're gonna need to make that struct unsafe then do public fixed byte bytes[16*1024];
NullReferenceException: Object reference not set to an instance of an object
at Unity.Entities.BlobAssetReference`1[T].get_IsCreated () [0x00001] in C:\Users\porri\Documents\Projects\Unity\cartediem\Packages\com.unity.entities@1.0.0-exp.8\Unity.Entities\Blobs.cs:349
at Unity.Scenes.SceneSystem.GetScenePath (Unity.Entities.SystemState& state, Unity.Entities.Hash128 sceneGUID) [0x0000d] in C:\Projects\Unity\cartediem\Packages\com.unity.entities@1.0.0-exp.8\Unity.Scenes\SceneSystem.cs:155
Wondering if anyone else got this when trying to load a subscene (after the initial subscene loads) or if I messed something up ๐
Thanks, I'll try that 
I havent updated to pre.15 yet too
exp.8
The experimental bakers are very much broken. So it might be your fault, might not.
hmm alright ๐ค
@robust scaffold have you use the new netcode input system? I can't figure out how to correctly send a payload with an input event...
Eh, I dont use it because they force allocate 64 size buffers inside a chunk (which isnt that bad when you consider it should exist only on a player singleton). But otherwise it isnt that hard.
For some reason the payload sometimes isn't present in a frame on the server where the IsSet value is true
Even if I always set it on the same frame on the client
Are you using the special component tag for IInputCommand?
There's a special tag?
InputEvent or whatever they named it now
Yeah, that's what I'm using
The question is how to send additional data with that event
It sometimes doesn't line up on the server
Input event are for boolean "has this event occurred". Doesnt contain any actual data with it. Good for one off actions like jumping where it requires only a stimulus and it can be simulated without any actual data
if you want additional data, you're better off using an RPC which takes a while to get to the server but it guaranteed to get there eventually
The issue with that is that you can't predict RPC calls afaik
What do you mean?
For the prediction loop you need to get the correct input data at a specific tick
IInputCommanData handles that automatically for you
What are you trying to synchronize?
Ability usage on the client
Hrm, I see.
It also seems like an oversight that you can't include additional data in the InputEvent. I can think of a lot of scenarios where that would be useful
Might be better off as a [GhostComponent]
And then just setting a boolean?
I send a guid which the client and server can interpret
Have a: csharp [GhostComponent] public struct Abilities : IComponentData { [GhostField] public int Flags; }
Cant really see how abilities that run off timers would work with prediction though
Something I've been wondering, since I haven't done a lot of prediction stuff, what is even the point of it? Since the data needs to be set as a GhostField so that the client can actually roll back the data correctly, why re-simulate it? Is it just the timing of it?
Basically, is it just the client taking the latest tick and simulating again to "catch up" to the server?
Prediction is basically you get a snapshot from the server of the factual state of a component 150ms ago (assuming 300ms round trip ping). Then the client simulates what might have occurred based on the stored input command buffers of the ticks since (about 75 ticks) until you reach "now"
not 75, 7 ticks
"now" being the (hopefully) same time as the server?
Same time yes. Hence "prediction"
Ok, then I think I get it. But that means any side effects from the prediction need to be sent by the server, since otherwise you will apply state changes incorrectly
(since that data wouldn't be "rolled back")
for timers, you might have a: csharp [GhostComponent] [InternalBufferCapacity(0)] public struct TimedAbilities : IBufferElement { [GhostField] public half DurationLeft; }
Wouldn't the DurationLeft also need to be a GhostField?
Also, assuming I am using a counter here, is SystemAPI.Time.DeltaTime the "correct" value to use for deltatime? Since I know netcode scales it in weird ways and the prediction loop can run multiple times
Rollback only happens clientside, when they receive a new packet from the server. I dont know what triggers rollback and resimulation, probably some large difference between predicted value and "actual" server sent value
No. And i have no clue about that. There's some strange network time singleton that you need to interpolate
I guess I'll look into that
Something else, is it correct that it can happen that a ghost field boolean can be "true" on two prediction loops even if it was only true on a single frame for the client?
Because I think the docs mention that in regards to predicted spawning
In the prediction system code the NetworkTime.IsFirstTimeFullyPredictingTick value needs to be checked in order to prevent the spawned object from being spawned multiple times as data is rolled back and redeployed as part of the prediction loop.
I dont know about predicted spawning either. I need to look into that myself.
It looked simpler than earlier versions though. afaik all you need to do is spawn the entity inside the prediction loop
pretty much all optimized unity jobs use GetComponentDataPtrRO/RW. time to fully ditch chunk.GetNativeArray ๐
pointers are love, pointers are life.
GetNativeArray has quite a bit of overhead from what i saw in profiling. if you replace it in the whole project chances are you save a few 0.x milliseconds
some really low hanging fruit optimizations in here ```public readonly NativeArray<T> GetNativeArray<T>(ref ComponentTypeHandle<T> typeHandle)
where T : unmanaged, IComponentData
{
CheckZeroSizedComponentData(typeHandle);
#if ENABLE_UNITY_COLLECTIONS_CHECKS
AtomicSafetyHandle.CheckReadAndThrow(typeHandle.m_Safety);
#endif
// TODO(DOTS-5748): use type handle's LookupCache here
var typeIndexInArchetype = ChunkDataUtility.GetIndexInTypeArray(m_Chunk->Archetype, typeHandle.m_TypeIndex);
if (typeIndexInArchetype == -1)
{
var emptyResult =
NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<T>(null, 0, 0);
#if ENABLE_UNITY_COLLECTIONS_CHECKS
NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref emptyResult, typeHandle.m_Safety);
#endif
return emptyResult;
}
var archetype = m_Chunk->Archetype;
var typeSize = archetype->SizeOfs[typeIndexInArchetype];
byte* ptr = (typeHandle.IsReadOnly)
? ChunkDataUtility.GetComponentDataRO(m_Chunk, 0, typeIndexInArchetype)
: ChunkDataUtility.GetComponentDataRW(m_Chunk, 0, typeIndexInArchetype, typeHandle.GlobalSystemVersion);
var result = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<T>(ptr, Count, Allocator.None);
#if ENABLE_UNITY_COLLECTIONS_CHECKS
NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref result, typeHandle.m_Safety);
#endif
#if (UNITY_EDITOR || DEVELOPMENT_BUILD) && !DISABLE_ENTITIES_JOURNALING
if (Hint.Unlikely(m_EntityComponentStore->m_RecordToJournal != 0) && !typeHandle.IsReadOnly)
JournalAddRecordGetComponentDataRW(ref typeHandle, ptr, typeSize * Count);
#endif
return result;
}```
- typeIndex is already in the componentTypeHandle
- typeSize is only required with entities journaling
that alone gets rid most of the code in it
and i see this line so much // TODO(DOTS-5748): use type handle's LookupCache here i mean, great, at least this got a todo comment ๐
i think i started reporting this in 0.17
it's not that hard to implement -.-
and i think the biggest problem with using chunk.GetNativeArray is that you can't get a ref to the element easily.
To the element in the array?
yeah
UnsafeUtility has a method for it
it's possible but not very convenient
compared to ptrs ref var aiController = ref aiControllers[i];
Yep
funny enough, many unity jobs are getting the ptrs now but they don't use ref. so, hm, what's the point? ๐
i'm mostly talking about this currently because of this post: https://forum.unity.com/threads/1-0-0-pre-15-full-dots-review.1366446/#post-8620377
this guy fixed the exact problem you were mentioning today schnozzle
What problem was that?
bumping the version when nothing is executed. that case checks for chunk.Has
So your telling me he is stealing my spotlight!?
At bare minimum, the system list at least is fully functional. Including clicking to open the inspector although I am debating on retaining this feature. Does anyone use the click system to see the queries? I think I'm gonna port over Entity Debugger's thing.
exactly! ๐
Do you already have a name for the engine?
Engine?
It was a joke, referring to earlier when I told you to rebuild the entire UI 
well your problem was with IJE which is much more widespread than just a mistake in LocalToWorldSystem
heh
So you're telling me I have a chance?
you can HAZ bigger light!
I'm pretty sure they know already
if you pinged dani, 100% chance
a fine connoisseur of statistics
Still pretty good odds I reckon
did anyone stress test transform v1 against v2?
as if you dont have an ElementAt extensions already!
but yeah
thats only the parenting
Thats because of a bad change filter
is that v1 against v2? ok, missed that
it drops to 0.5ms when it's fixed
yeah theyve fixed it
it's still higher
yea
so now my comps have LTW and LocalTransform. which is the same but 1 float for scale additonaly
and jobs run slower
big meh ๐
overall it should be faster though. some tests would be great
hm, so if i just rotate i trigger a change for everything that involves the position.
who thought this through??
hmm i guess pre.15 doesn't solve my SceneSystem BlobAssetStore catalogData getting invalidated ๐ค
it'd be pretty rare that translation isn't write opened in a game every frame
well, i'm not really grasping the reason of merging pos/rot/scale. seems anti dod to me
is LocalTransform even simd friendly? i remember having bit of trouble with structs
Why are entity command buffers actually so "fast" and efficient compared to regular entity creation and operations ?
they aren't? ๐
They are not ? Last time i checked in everyone said they are the way to go ๐ฆ
I guess it depends on the context. They can be faster if they otherwise force you to have sync points
They said it was impossible on /r/unity3d yesterday https://old.reddit.com/r/spacesimgames/comments/z7efn5/starfighter_general_added_warp_of_11_size_of/? so I did it today:https://youtu.be/sJkNxhC_m8k
The goal was to make it so when you enter warp drive, you aim at the stars you want to go to, and spatially aware of the galaxy you can see them whip past you.
They said it wasn't possible & were absurdly rude and mean to me for no reason: https://old.reddit.com/r/Unity3D/comments/z6hyel/can_someone_take_a_look_at_this_weirdness_im/
www.sta...
But if you need to create a lot of entities it's faster to just create those pre-emptively
you don't want structural changes causing sync points through your application
so you group them all together in command buffers to only have 1
but the actual operation shouldn't be any faster
this thread is hilarious.
Official Unity devs were perplexed just like all of younz, but when I explained it, they were wowed by the genius of it.
I'd actually like to read this quote. seems i've missed it
We don't need to humour this.
@orchid ginkgo , there's no memes here.
Why the hate? There was indeed confusion, and people arguing with me here that I was wrong, it only happened yesterday. You can see the obvious hate on that reddit thread. I tell you that love is the way, and you don't like me? Such is this fallen world.
I try and be nice to all, but people bring it to me. I don't get it.
no hate man, i was there yesterday and all i read was, working as intended. so i wondered what i've missed.
You missed the official Unity dev declare it a bug, ask for me to trim down my package and send it to Unity. I spent 3 hours just so I could package it and send a bug report. It is hate, or you wouldn't be calling me a liar. What gain is there in it for you to pick on me?
I'm here to help the community, you seem to approve of the hate I got in that thread.
Why do you not like me?
If you cannot answer it, stop bothering me.
Cuz as far as I know, I have done nothing but help the community and Unity./
You can pm me, stop making your beef in the open
I don't need this nor do they
I said we're not humouring this, take it to DMs.
i've no beef with you. i said that thread is hilarious (the responses), not you are. geez
One feature I really missed from Entity Debugger is the "All Entities" selection. Problem is, that row didnt have any useful data on it so I decided to fix that:
this is getting better and better by the hour
There's just so much empty space in the current dispersed entity inspectors. Sure, I think the main complaint that Unity received about the old debugger is how dense and unreadable it was but for someone coding in DOTS for hours, days, weeks on end. Compact and dense is how inspectors should be.
yeah it's really spread out and not interconnected which is my biggest problem with it. like i want to know what entities an archetype has and vice versa
Well found the root issue - turns out my GUIDs were somehow not matching in a build so i was trying to unload an invalid scene ๐ค
That's what I aim to fix. Now the question is, do people want the chunk utilization graphic or the archetype construction list?
Maybe both? As a toggle? There's plenty of space in the toolbar for both buttons...
is the archetype construction list what we have now in the archetype debug panel?
this is cool info. what's also great is how much bytes an archetype has allocated and how much is unused. what i don't like about it is the wall of ids and that you can't filter by components
yea. What i will do is by selecting an entity, it'll show the archetype of that entity as well.
pretty much every filter is useless
That way you dont need to find the specific archetype of the entity from a list of randomly generated names.
who filters by any of this? seriously.
Yea, the filters except maybe the hierarchy one (debatable) are completely useless.
But did you ever use the chunk utilization graphic?
yeah, the feature i miss the most
I mean it was interesting as an overview but the archetype construction tells that in a far easier to generate way.
Hrm, alright
I'll try to recreate it. Any suggestions on how to improve it?
I know for one it was incredibly difficult to understand.
i've not used it excessively. from what i read on the forum the most useful thing about it was to see chunk fragmentation
And for archetypes with a lot of components, it the archetype construction gets so long.
I'll probably have 2 tabs. This visualization on the far right and the construction list next to it. Both non-resizable though. Getting 1 resizable panel was painful enough.
what about they style of the new one (above image) with chunk utilization stats?
huh... huuuuuh.
That's a great idea
And just have the components list be initially foldered
yes!
Do people care about the name though?
you can filter by components
hm, the id? i don't ๐
damn TIL ๐
I know you can but most of the time I just go down the list clicking one by one until I find the archetype I'm looking for...
haha didn't expect that. man that's really inconsistent. the comp auto complete is so nice
such a control is surely reusable
But yea, 83 archetypes in a production setting. I guess in cases like that, one should switch to the actual DOTS inspectors as there's less white space.
i'd have like 6000 to search through at work
In those cases, Unity's design decisions around these UI inspectors do make sense.
The old entity debugger would keel over and die with those amounts
hmm
it doesn't do too badly actually
we still have devs who use it
only use it*
Even in 0.51?
hm, if i have a root entity is LocalTransform just pure overhead? i mean i could use LocalToWorld as well which is mandatory anyway then, right?
LocalTransform is always required. WorldTransform is the overhead.
Netcode and physics requires the existence of WorldTransform, L2W, and PostTransformScale regardless of if they're needed. Meaning about 150 bytes of wasted floats.
entities with just LocalToWorld are not a thing anymore then?
i'm confused. will read some docs then.
Nope, replaced with just LocalTransform
You can generate a LTW from a LT
Also:
I have a giant chunk of empty space in my planning. What can I put here?
oh it's been replaced. where's the matrix stored then?
You can either have a L2W component storing the matrix or just constantly generate a new one from LocalTransform.
put a picture there of our lord and saviour, joachim ante
Yes
I just realized there's one more window. I've never used the component list myself:
huh, no matrix caching sounds kind of expensive.
It's a bit too dense though. I'm all for density but the component list just doesnt seem to fit. Maybe it should be an option like chunk info.
It is unless you have your own custom rendering or no rendering at all.
If you're only needing to pull the L2W once using a custom renderer, that's the same cost as generating a new L2W and caching it. Except now with the cache, you waste 16 floats or 64 bytes.
Ya know, the components as an additional window to the left of chunk info makes sense. Especially if one can click on a component and filter the entities and archetype list with it...
Filtering by selection priority will go first by system, then component, then archetype.
And maybe a easter egg button where there's Joachim Ante's face as a window...
If I ever complete this and publish it, I'm gonna put a donation link for commissioning an artist to paint Ante's face like those old saint images:
sipping that burst juice
well, i'm not too sure about the performance implications yet. need to rewrite the rest of my codebase and then profile.
just have a feeling it will run a bit worse
good luck, using netcode + physics means I have no choice in that matter anyways
Entities with only LocalToWorld should absolutely still be a thing; the transform systems shouldn't touch them. If that's not the case, it's a bug that we'll need to fix ASAP.
Is the fact that none of the transform flags other then manual override work intended?
definitely not, but I know somebody's working on it.
Okay, good.
Actually I just implemented this TODO last week. It was a nice boost across the board. No more linear searches through the archetype's components for every single ArchetypeChunk/ComponentLookup/BufferLookup call.
Moving away from chunk.GetNativeArray() is the correct opinion, so long as you promise not to access out of bounds indices. Most of the extra safety checks of a full NativeArray vs. a raw ptr don't make sense in the context of working within a single chunk.
Maybe a chunk.GetSpan<T>() best of both worlds?
I fixed the LocalToWorldSystem change-version issue as well, but that's worth applying locally in the meantime. It was a great spot.
It turns out this is a perfect window in our development cycle for behind-the-scenes optimizations.
Chunk.GetSpan<T>() and Chunk.GetReadonlySpan<T>()? Maybe?? I mean, I dont use spans outside of hunting down memory leaks and then reverting back to pointers when Im done but maybe?
ISTR there's some Good Reason(tm) why we're not using Span<T> more than we are. Or maybe there used to be a good reason, but there isn't any more and news travels slowly.
Eh, just an idea. Pointers and wildly assuming that index access doesnt go out of bounds is good enough. Unity crashing constantly is a good way to find if there's any issue anyways.
thanks for all the info. appreciate it!
Meanwhile, as unity crashes constantly for me right now in UI development. Hrmmmm
@rotund torrent If you're not gone already, I just want to check if this error is something you recognize:
I've been getting this hardcrash nearly constantly domain reloading following a code change in my DOTS editor development.
It's saying segmentation fault except I'm not actually using pointers anywhere in my editor code and I'm 99% sure I'm within bounds with my game code (which isnt running anyways).
no, I'm afraid it's not something I'm familiar with; sorry
damn, i'll see if I can get a reproduceable error done. It's off and on.
searching our slack for some of the stack trace entries didn't turn up anything either
I've disabled rider plugin automatic refresh on save as it seems to always require a domain reload on window focus switch into editor anyways. And i havent gotten a crash yet.
Oh yeah I did this 5 years ago
Reduced random crashes by like 80%
No one at work uses auto refresh
It's suicide
How does one typically deal with child objects? For instance, I have an object made up of a bunch of random cubes and spheres and things, as you do, and I'm trying to access certain children's transforms in order to rotate them around and whatnot. Think a tank/turret, perhaps. So I made a component that's on the parent which stores the children as entities, because I assume that's the only way to actually get something resembling a reference, yes? Surely I can't store the transforms directly, as everything is a struct and would just pointlessly copy stuff around, correct? Either way, I've been bashing my head against a wall trying to figure out how to run this in a job. I have my component/aspect with my child-entities, but can't figure out how to actually get access to their transforms without being greeted by particularly unhelpful errors. This approach struck me as fairly logical and straightforward, but I'm starting to think I'm on a completely wrong track here? Any insights?
The parent already has a DynamicBuffer<Child> that contains a list of all the child entities, so you don't need to manage that yourself.
As for accessing the child transforms from a job, since you're accessing data on an entity other than the one being iterated over (the parent), you don't really have a choice other than ComponentLookup (or ComponentDataFromEntity, pre-1.0). And if you're writing to those transforms, you'll need to use something like [NativeDisableParallelForRestriction] on the ComponentLookup job field to suppress the safety warning it would usually give you about random-access component writes in parallel (since that is, technically, a race condition).
Hm. I've had to read that several times to parse that, still very much in the learning phase of things. But I think I've done something like that before, guess I just got tripped up by the fact that we're talking about children here, not random, other objects. But, in ECS, I suppose that's not really that much of a difference, really. Old way of thinking creeping in, I guess. Anyway, so the generally idea would be to throw tags on them and then look through that buffer, yea? Hm. Might be time for another template ๐ค
Hi all mates devs! I want to create functionality for screen image recognition, just in a flat screen, nothing related to AR or VR, and I only find info on the web and this forum related to AR, but the purpose is just to detect an image when it appears on the screen, any help?
The idea is to manually introduce a sprite in a program, and when this sprite appears on the screen, do something
No I dont. That would be the ideal way and I hope that Entity Addressables will make that possible. I am currently loading via addressable and then converting at runtime
I guess such tasks isn't related to dots at all except if you need to provide to recognition algorithm more performance๐
Uppss.....I was in code-advanced forum, I made a search of image recognition and I still thought I was there....do not know how I travelled here....thanks mate!
Did you try b9?
Guys, where you think I should post a thread about my sprite rendering package? DOTS general section or DOTS Graphics? Asking because it seems like DOTS Graphics is only for unity's dots-graphics packages like Graphics (Hybrid Renderer), etc.
https://forum.unity.com/threads/share-our-dots-showcases.1010215/
You could reply to as a post here also
HI all.
I was thinking that we have general WIP thread, letting show of users their projects.
However it would be nice, to have at least similar...
Yep, I will, when make a video, but know I want to make separate thread to be able to discuss project, if someone wants to ๐
@pulsar jay yeah seems like I will have to wait for addressable subscene entities to solve my problem as I cannot convert during runtime without massive stalls - trying to load building prefabs from KitBash3D, which is hundreds of megs big ๐ฆ
Well that sucks. For me its negligible currently as we populate the map from just a few prafabs
I'll be on the lookout for the thread ๐ (I don't mind if its in DOTS general/DOTS graphics subforum)
yeah, I was hoping the new Baker workflow would help but it seems like the baked entity is getting nowhere when building the addressable subscene ๐ฆ
Are you trying to load subscene using addressables?
yes, as of now I'm testing via 2 projects (A and B), baking the subscene in A with KB3D prefab then loading the catalog in B then asyncSceneLoad the scene containing the subscene
after loading the scene I'm getting subsceneGUID of 0 and all I see is regular gameobject loaded with no entities anywhere
How are you storing subscene in addressables?
You need several assets as far as I know
GameObject and serialized data file
yeah I have a multiple asset workflow but it still doesnt work
KB3D prefab gameobject asset, instantiated in scene, then separate scene containing subscene pointing to the other scene, then yet another gameobject prefab containing the GUIDs of everything and marking all of the above assets addressable
after building the addressable assets I see huge 600meg files dumped in the destination dir but none of them contain any entities (all are regular GOs)
yes regular unity scenes with nothing else except the subscene in the master and the prefab in the subscene scene
Hmm
I can enter play mode and see the GO serialized into entity via baking
I need to check it when I get home
yeah that would be helpful!
But rn it seems like you are saving wrong asset ๐
Although could be wrong. I still don't get what exactly you are saving
I just want to load the building prefab at runtime via addressable without doing conversion so I thought I could bake it in the editor and save the baked entity then load that
There is actual subscene asset that gets created somewhere
This is what you need to save and pass between projects
yeah I think I saw in some unity forum that I have to go through the normal build process to generate the baked scene file
instead of going through the addressable build process
then somehow get that baked scene file and pass that to the addressable system... seems like a hack
Although it's also possible it's not supported at all
Hmmm
Actually
Try to build game
And see what gets generated
so maybe it's worthwhile for me to just wait for Unity to figure it out and give me a cleaner workflow ๐
Maybe build can deserialize it with hardcoded path
Current workflow for passing code between project builds includes building
So it's not like it's some tainted workflow
yeah good idea! trying to build the KB3D master scene now
Is there an equivalent of Mesh.CombineMeshes for ECS?
@calm edge you need to write your own code using https://docs.unity3d.com/ScriptReference/Mesh.MeshDataArray.html
as far as I know there's no "official" way of doing Mesh.CombineMeshes and Mesh.Optimize via jobs
Whats the minimum unity version to use full dots environment ? (Jobs, ECS, Burst) Cuz im trying on 2021.3.5f1, and 2022.2.0b8, and even enabling the preview packages it stills doesnt shows up neither ECS or Jobs for installing.
You need to add manually afaik
Do you guys use Assembly Definition Files in your projects? It just occurred to me that asmdefs should be setup differently because ecs assemblies are different
Did you happen to get a bug # on that?
And for 1.0 its 22.2
So i add manually from unity package manager right? Its not showing up even turning on the preview package toggle
Yes, it's experimental packages. For some reason they decided to not show them anymore.
Got it, so there is no way to use them?
What?
Just click "Add package from git URL" in the package manager window and type com.unity.entities. Then repeat for other packages.
lol, one of my jobs has gone to total shit with transformV2 - usually a 3.5ms job, now up to 20ms. first thing i found is the chunk capacity has gone down a lot because v2 wants to put everything it possibly can on the entity -.-
Gez this shouldnt be this hard im struggling to find a way just to install them, now i cant find the URL for installing
What are you saying.
You just click a button, type com.unity.entities, then press Enter.
Repeat for com.unity.entities.graphics/com.unity.rendering.hybrid and whatever else you want from com.unity.physics and com.unity.netcode.
I guess the same will work with jobs right?
I appreciate the help @covert lagoon thank you very much
It's already a dependency of the com.unity.entities package.
So if you have that installed, you don't need to manually install com.unity.jobs too.
com.unity.entities also depends on com.unity.burst, com.unity.mathematics and more.
That makes it much more easier. Thank you for the info, is downloading here, I'll remember this for future installations.
just add graphics or hybrid it will install entities too
hybrid for 2021
graphics fro 2022
i've no idea what's going on yet. it's not even the chunk capacity makes a big difference
profiling with superluminal looks the same. the relations to what takes long is the same. no apparent code that would lead to transformV2. yet the job and only this job takes 5.7 times longer
and i restarted unity and the job is again at 20ms. whaaat? ๐
oh wait, i updated to burst 1.8.2 (reverting to 1.7.4 didn't change anything) back to 20ms ... haha
JobComponentSystem is now renamed or doesnt exists anymore?
for a very long time. there's SystemBase and ISystem now
Im sorta new to dots and im using a old template to learn, thanks for the input
well, that's not good. entities has changed a lot over the years. here are 1.0exp samples: https://github.com/Unity-Technologies/EntityComponentSystemSamples
Thats very usefull thank you! The thing is that im trying to port this Path Finding algorithm to he new syntaxes, i sorta need this A* like in DOTS, guess ive no choice but porting every class its wrong in it
But I'll download this too, I guess it will be better for learning purposes indeed.
i'm getting more and more the feeling this is a 1.0pre problem. i didn't do any stress test since then
@blissful bobcat you could check out https://github.com/dotsnav/dotsnav (no idea if you can use it with 1.0)
reverted to my exp-8 entities state and it runs normal
Will check it out definetly!
Question, do i need mandatory my rendering pipeline to be URP or HDRP to run DOTS? The examples of this github is giving me errors on HDRP and URP, but when i delet the folders it brings more errors, my project is Built-In
entities.graphics, for when you want to render entities, needs urp or hdrp. entities alone works with builtin as well
I see! Well this template from unity is not making it easy idk what to delet to make it run, dik which templates are using those ressources, aperently deleting the hdrp, urp and physics folders wrent enough, since it shows even more errors, which means the examples withing ecs samples may use some of those too, or maybe are the materials who knows. I'll keep trying it here, anyway i really appreciate the help, thank you.
samples mostly use URP. you can't just delete a folder from the assets folder to get rid of urp as it is a package. manage those in package manager. samples can be just imported as new project. worked fine the last time i tested.
So cant I run the samples in a Built-In rendering pipeline anyway?
no
https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/ECSSamples/Packages/manifest.json
uses: "com.unity.render-pipelines.universal": "14.0.3",
thank you, will give it a try
how are you importing the samples? the process is to go to unity hub, add project from disk and point to ECSSamples that contains the Assets folder
otherwise you miss a lot of packages that are required
(those listed in manifest.json)
I've downloaded the repository git folder as a zip file
whole repo from root?
That's probably not gonna work
Owe tho it wouldnt matter as lont as I've already installed the packages, first i've installed unity.entities package manager
What the right way tho? in this case for entities
just download the folder of sample
and use it as unity project
one sample at a time
isnt that what i've already done tho?
what is your root folder name?
Assets/EntityComponentSystemSamples
eh, that's not it
guess it has a master in the name too, but guess its not it either
download this exact folder
and open this exact folder as unity project
you can donwload whole repo, just open as project this folder
oh got it but i want the jobs samples too
any sample of your choice
just make sure Assets and Packages folder are present here, they are key for Unity Project and contain all data
along with ProjectSettings I guess
guess the other packages werent being found cuz they werent on the root