#archived-dots
1 messages Β· Page 52 of 1
System.IndexOutOfRangeException: Index {0} is out of range of '{1}' Length.
This Exception was thrown from a job compiled with Burst, which has limited exception support.
0x00007ffd010c4a13 (fb2c05e650545b2bd80ef220c2a61b9) _xmm
0x00007ffd010c495a (fb2c05e650545b2bd80ef220c2a61b9) _xmm
0x00007ffd010c4a79 (fb2c05e650545b2bd80ef220c2a61b9) _xmm
0x00007ffd010c44d1 (fb2c05e650545b2bd80ef220c2a61b9) _xmm
0x00007ffd010c4f09 (fb2c05e650545b2bd80ef220c2a61b9) _xmm
0x00007ffd010c4b75 (fb2c05e650545b2bd80ef220c2a61b9) _xmm
0x00007ffd010c4166 (fb2c05e650545b2bd80ef220c2a61b9) _real
THis error everytime is weirder
Ouch, race condition. Are you using the disable parallel safety attribute?
I do, but not on that
Could it be connected somehow?
well, i use [NativeDisableContainerSafetyRestriction]
But not on the same job
neither the same array
No, it's only on the field that follows it. To be honest, without code, there is very little we can do to help.
Other than you going one by one through the code and checking if the indices line up. It's boring, tedious, but you'll need to do it anyways. Every first iteration of my own code for example is filled with this stuff so you might as well get good at it.
This should be helpful I hope
But like, I don't get it. I have a readonly array that has 255 values. I then get a value and clamp it from 0 to 254. I then use that as the index of the array and get a value, that returns the error
lowerValue.y = func[floorIndex.y];
Does floorIndex.y ever go negative?
Check, comb through your code, add a debug.log($"{floorIndex.y}") right before it.
int len = func.Length - 1;
float4 floatIndex = math.clamp(value,0f,1f)*len;
int4 floorIndex = (int4)math.floor(floatIndex);
math.clamp(value,0f,1f) You can replace this with a math.saturate(value)
You dont need the math.floor if floatIndex never goes negative. An int cast will always truncate which is flooring for positive.
Did you add a debug.log?
Come on, debugging 101. If there's an error, slap debug.logs everywhere. Either that or use an actual debugger.
I did add a debug, but there are so many values debuggin that unity doesn't like it XD
Okay, but managed to catch one
error with 83
and 92
But there are plenty of 83 and 92 without errors
if this is multithreaded, the error may be triggering on an earlier index before the exception terminated the thread group.
Try Debug.Log($"{floorIndex.y} vs {func.Length}");
i really wish collections package logged an error
before throwing an exception
so we could read what the hell was going on
Yeah, that would be nice
Now the error doesn't want to appear
I dont know man, race conditions are pain. Are you on burst 1.8?
Yup, 1.8.2
Attach a managed debugger to unity. Enable break on exception and hopefully the debugger will be able to catch what is going on.
I think I've found the issue
No idea how to fix it
But it seems that accessing the array 4 times in a row is not cool for burst
lowerValue.x = func[floorIndex.x];
lowerValue.y = func[floorIndex.y];
lowerValue.z = func[floorIndex.z];
lowerValue.w = func[floorIndex.w];
this is bad
lowerValue = func[floorIndex.x];
this is good
shouldn't it be
lowerValue = func[floorIndex];
oh wait
func.Reinterpret<float4>()[floorIndex]
actually i guess your index would be wrong
you'd have to /4 or fix it above
wym?
i still find it unlikely this without some external influence this would cause issues
But would that give me with the righ indexes?
not unless you /4
But floor index can be, 250, 200, 167, 252
oh wait i'm reading what you're doing incorrectly
i thought you were taking 4 sequential values
but you aren't
yeah, im not
they are 4 random values
0 to 255
max length is 255
so 0 to 254 srry
So actually., If I close unity and reopen it and click play, the error doesn't appear
After a couple of play and stop it does
Does that give a hint to somethign?
The first play never returns errors
you aren't recompiling between play are you?
just wondering if burst is breaking
anyone here who has experience with RaycastCommands and batchscheduling raycasts?
Can source gameobject be accessed from baking system?
i haven't tried but probably if you put them on a [TemporaryBakingtype] from Baker
I wonder if baking world have any system which have map info GameObject -> baking Entity to get primary entity like Baker<T>.GetEntity()
Has there been any mention of future burst support for default interface implementations?
This worked. Too noob to realise you don't need to store the buffer in a component but can do so via entity reference alone (GetBuffer<>).
Thanks again!
i take it the dev Q&A will be devs replying to the questions on the discord and forum, not a call that is streamed or something like that
Yes, that's correct.
using IJE, how can I set a sharedcomponent filter? it's an unmanaged component too
You can't, shared components are always read only inside jobs
Oh, a filter
yeah I just want to filter π
You can't easily, you need to rebuild the auto generated query, and pass that to the IJE.Schedule method
It's pretty annoying atm
using Entities.ForEach it was simple, but I'm trying to reap the benefits of codegen as much as possible
I hope they add an overload to IJE similar to the old Entities.ForEach().WithSharedFilter
yeah thats what I was thinking, basically redo the query logic arg
It's not too bad with QueryBuilder being a thing now, but definitely more error prone than just setting it on the struct itself
I'm pretty sure they'll add an easier option sometime in the future though
yeah agreed, I'm hoping the dev team realizes that a lot of people really like the direction IJE is going in
and try to make sure all of the old logic bits and pieces are fully usable in IJE in the future π
I think they like it too, it makes DOTS more approachable and is less boilerplate
yup!
Especially with the new IJobEntityChunkBeginEnd interface
thanks for the tip, I'll simply hack away at this and add a TODO to revisit it in a future release!
For some parts of my code I worked around it by just scheduling a single job that uses the chunk's shared component value to do the required logic, but that only works if all chunks require the same logic (based on the value of the shared component)
It seems you don't need [NativeDisableParallelForRestriction] anymore when writing to a NativeStream.Writer in parallel, I wonder when that was fixed. Very cool π
Use UnityObjectRef<GoType> if you're trying to get it in a baking system.
Hi everyone, is it somehow possible to unit test a unsafe burst method to check if it causes a memory leak?
do you guys think dots will someday become the default workflow
i tried it multiple times in the past but making anything slightly more complex was at least troublesome
I use it as default workflow π
yeah same I'm not going back to using monobehaviour unless I have to in places
Remember everyone, DOTS Q&A is going on RIGHT NOW on the forums. Ask unity devs right now your pressing questions and get maybe some answers.
I like using monob for services
that is not relevant to game
whats the difference between NativeArray.Slice and NativeArray.GetSubArray ?
One returns a slice and another returns a native array
They're the same thing. Both are pointers with an additional length int that alias the same section of the array.
Actually, let me check. GetSubArray may copy the section of data
Yea, they're the exact same thing, pointers with int length. I guess get subarray allows you to get a slice without using the collections package.
@robust scaffold But those subarray are read only, what if im trying to replace a range?
They're direct pointers, you're free to write to it and it'll directly reference the range that you specified in the original array.
Just be careful, I dont know about how the safety system works so if you're doing this in parallel, it might cause race conditions.
im trying to write myself a wrapper for flatteting 3D arrays to a single native array... for some reason I imagined I was going to replace entire subarrays in one go but thiking of it thats not going to happen, ill be writing one value at a time
i've been using a 2D array flattened to a nativearray for a while, (read and write) but I dont need to access values in parrallel so
i mean the "same" value in parallel
You can, so long as the range is within the same axis in which you flattened it at. I use a lot of 2D flattened native arrays in my own code. X write is obviously linear but moving up the Y axis requires writing one by one.
You could using UnsafeUtility.MemCpyStride write "linearly" along a Y axis but it's very little performance benefit compared to just writing 1 by 1.
yes as long as your data is accessed in a linear manner without jumps between subbarray index ranges right?
sorry not used to using the AXIS idiom for arrays
Yea, if you had a bunch of "Y" axis subarrays or slices, you can replicate a 2D array but you're basically just doing the classic i = x + y * width
Using slices? Depends. Just using direct pointer offsets have the benefit of burst vectorization with no memory overhead. Slices requires allocating memory for safety (in editor) and the length int. This is getting into micro-optimization territory though and fairly advanced C# and burst concepts.
yep, well im processing about 70k values each frame so I start seeing the effect
and that is just for one command in a job
Yea, 70k is at the point where micro-optimizations become macro. Burst is a very deep rabbit hole and I am nowhere near qualified to teach people on it so all I can say is that try what you think is good, then go to the inspector and check if it vectorizes.
It's also possible to flatten 2D or 3D arrays using some more advanced indexing scheme such as Morton order, which helps memory accesses remain local in both X and Y directions, at the cost of some extra computation for the index. GPUs do this for texture data.
True, and I do use the standard Z order for partial differential equation jacobi iterations. It makes indexing a specific position more complex though.
@robust scaffold no worries, I'm not ready to go down that hole either
When using raw pointers, I think it's a good idea to start using NoAlias attributes to let Burst know that pointers don't alias with each other to get the best performance. This is automatic for many built-in containers like NativeArray, but it can't be done automatically on arbitrary pointers as those could be anything. Using the inspector is very good advice.
Definitely, if you weren't here a few days ago, i learned that the hard way. Now I slap that attribute everywhere:
I have to admit you two lost me. Can anyone recommend a good resource to help me get up to speed on pointers, unsafe stuff and vectorization?
and whatever sits in between i dont know about
im running out of "normal" optimisation opportunities
https://docs.unity3d.com/Packages/com.unity.burst@1.8/manual/index.html <- For the burst limitations.
As for pointers, try and see if things explode.
I supose learning c++ would help
I basically learned optimization from years of trial and error and seeing what is generally fastest. Even then, i still have to benchmark various methods.
That as well.
thanks!
C or C++ is definitely a good way to learn pointers
Does using IJobEntity instead of Entities.ForEach result in faster compilation times even when using Entities 0.51?
Not sure if it's faster but it's the preferred method.
Entities.ForEach was, according to among others the guy behind the Jobs system, a mistake in hindsight.
Can I look at baking world somehow to inspect entities and what is much important systems? Also is there a way to get entity having gameobject?
What?
Ok thanks.
- We can inspect runtime / editor / etc worlds. Can I somehow inspect baking world?
- Is there a way inside baking system to get entity from gameobject like it was
GameObjectConversionSystem.GetPrimaryEntity(GameObject)?
- No. 2. GetEntity() with no parameters returns the primary entity.
you mean inside Baker<T>. Yes, there is such method. But how can I do same inside baking system (system in baking world)?
In a baking system, that's a lot more difficult. I dont know if there's any better way but what I've been doing is getting the GO's InstanceID, storing it as an int, then generating a hashmap in a baking system that maps InstanceID to Entity. Then indexing that hashmap to find the target GO's entity.
The targeted GO being converted having a baking type that contains UnityObjectRef<GameObject> as a field and using the int within that struct as the InstanceID hash.
What we do in the Entities Graphics package currently is that we place a temporary component like this on the entity:```
[TemporaryBakingType]
struct MeshRendererBakingData : IComponentData
{
public UnityObjectRef<Renderer> MeshRenderer;
}
Then, when you are processing some entity, you can use the component value to get the corresponding gameobject. There's also public void GetEntitiesForAuthoringObject(UnityEngine.GameObject gameObject, NativeList<Entity> entities) in EntityManagerDebug.
@robust scaffold hey... sorry to interrupt, I just talked with someone about static methods, one thing led to another and he made me doubt what im doing with my flat array. What I mentioned earlier, is it still burst compatible? I though it wasnt a problem since im accessing my data one index after the other (as in 1,2,3 consecutive indexes, not 12, 46, 2992 ) but... yeah.
he made it sound like i was killing my performance somehow.
Actually that's what I'm looking for. Gotta rewrite a few bakers now...
I think it internally uses as hash map as well.
Static methods in general should be Burst compatible just fine, as long as you don't do anything in it that's incompatible with Burst (like Exceptions).
Dots dev blitz
All I care about is 2d support and it's just "provide feedback on the roadmap" bah
@pliant plover it's not really the static method that worries me, he said using a flattened array was not burst compatible... I wasnt sure how but..
One less hash map is always good.
or do it yourself. Welcome to the club. I wrote my own light renderer and i'm drawing up plans to write my own physics engine
Flattened arrays should work just fine. Depending on the array's specific type, that is. Blittable types and all π
I think there should be nothing wrong with using flattened arrays, and they should be a very good idea in general.
Yeah, I know, I know. Just a shame that 2d ecs support isn't a priority
I imagine a NativeArray is better performance but I've got a perfectly fine DynamicBuffer that works as a flattened array for a grid in a project right now.
Also, if something is not Burst compatible, I think Burst should give you an actual error message about it when you try to do it.
@pliant plover thank you for clarifying that
thats what I tought too but... he seemed sure haha
With anything performance related, I think the best advice is to always try profiling it and see what the numbers actually are. The Unity Profiler will also show you if it's actually running with Burst or not.
I use the profiler but I wasn't aware it could show you that info. Ill look into it
ty
I think by default it will show you Burst jobs in green, and non-Burst jobs in blue.
Code that's burst compiled has that light green colour iirc
Burst jobs should also have (Burst) appended to their name in the Profiler.
Is there any reason why math.up (job) for example creates (sets) fields every time?
// for compatibility?
/// <summary>
/// Unity's up axis (0, 1, 0).
/// </summary>
/// <remarks>Matches [https://docs.unity3d.com/ScriptReference/Vector3-up.html](https://docs.unity3d.com/ScriptReference/Vector3-up.html)</remarks>
/// <returns>The up axis.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float3 up() { return new float3(0.0f, 1.0f, 0.0f); } // for compatibility
awesome
and can I use NativeArray<NativeArray<>> ?? or I should use NativeMultiHash
See here for Green burst compiled code in profiler π
@true mirage funny you mention that, im using a flattened nativearray exactly for that need.
I'm not 100% sure, but I suspect the C# implementation is just a placeholder, and Burst will replace that with a custom machine code version when it's actually compiled. In general I think that's true for a lot of the math. functions.
NativeArray<NativeArray<T>> does not work AFAIK, but NativeArray<UnsafeList<T>> does.
Yes, because it is boring I define a static class for them :/ OK, thanks
I am scared when I see unsafe :/
It is a voxel game
Each chunk contains NativeArray<Voxel>
I guess NativeMultiHashMap is OK because there are not a lot of chunks
Unsafe is fun and exciting. Crashing the editor from segmentation faults is a rite of passage.
I think "unsafe" in the context of Unity Collections mostly means that there is no automatic race condition checking for jobs, and possibly less leak tracking. What you get in exchange is more options for memory allocation, and the ability to nest such containers within each other.
That's what I read too, nothing prevents you from "trying" to do two things at once with the same memory address, so you have to keep in mind how your code runs and will use it.
Crashing the editor by forwarding a DynamicBuffer reference from a component to a job constructor when the buffer is created and filled by a job in a separate system was a fun time I kept repeating because I didn't get why it failed lol.
PS The issue was structural changes invalidating the reference. Feels obvious in hindsight.
that is again how to get gameobject from entity, I want to get entity from gameobject in baking system. I'm trying to reimplement my custom parent-child conversion process
Perhaps EntityManagerDebug.GetEntitiesForAuthoringObject would help?
Inability to debug baking is indeed frustrating
The Data Oriented Technology Stack forum will be renamed to Entity Component System
@rotund token We've gone full circle finally. Back to Unity ECS. All we need now is [Inject] to complete the return.
lool
It should be possible to debug both bakers and baking systems, at least when Live Baking is enabled. It might not work with full subscene imports as those are done in background asset importer processes AFAIK.
All I wish for in the next Unity ECS release (almost typed dots...) is actually stable asset importer. It crashes so much...
yeah, editor workflow in general frustrating because of backgrounds processes
this is just one of them
can't wait for Unity to finally switch into .net CLR runtime
and "hybrid" ECS
Hybrid is dead. They've purged it. The guy on the forums I'm trying to get a roadmap on hybrid moving forward on has suggested just using a pooled GO and int index on an entity to find the corresponding GO.
Will try, thank you
tbh, rn I don't see it as a bad idea
it's just faster
Yea. But it's more work.
Scene is static anyway
you can't have multiple scenes, thus whatever game objects you have can live as long
I have been learning code gen recently and ngl, I can see how this can be automated too
Too much to read. Is there anything important I missed?
I wouldn't expect much important until new version at least
They've "officially" announced dots pre-release. Dots renamed to Unity ECS. The Q&A is going on now
Ugh, they're now full categories instead of subcategories under ECS. Annoying.
Yeah I'm much less likely to see new posts
I'm taking note of the above feedback! Will share it with the teams π
Yea. I always went to the root DOTS category and then browsed the subcategories when I finished reading anything new.
I haven't seen any particularly interesting questions let alone answers so far
ha
There's a lot of, I don't know how to do this questions
Heh, I want some solid answers so I dont need to think about it.
I mean, the really pressing questions arent really questions. Like when will the baker stop crashing. When will a more automated baking workflow arrive? Soon to both. What happened to animation? (crickets) What if I wanted to make my own transform system? Edit the packages with your own components.
Yeah my issue was more with the questions
I'm pretty sure I could have answered half of them
I do like just seeing activity though and a few unfamiliar faces interested in dots
You could but I think it's valuable to have an official unity answer in a google-able format for future reference.
Exactly. Now I need to find some more random questions that I had banging around and was too lazy to source dive to figure out the answers to.
I got my most important question answered anyways by the rendering folks. A triple rotating compute buffer to ensure gpu reading and cpu writing do not overlap is disappointing but simple to implement.
Hope we get another release by end of year but I'm not expecting it with Christmas
They have netcode .21 on feature lock from what I can infer from various answers but unknown about the whole ecosystem as they all drop at once.
Add <DepthSorted_Tag> to render entity and Z sorting works again..
ill be honest, i was expecting some master plan for the companion/hybrid questions like something is in the works but we cant talk about it yet, not yeah it they're quite awkward and rough to work with/no plans for companions
yeah, the worst is animations...uhm...yeah 2023 or smth π€·ββοΈ
my actual question would be simple, when does mega city stop crashing?
Not really no. Plenty of how to do X for future googling.
If you havent seen this: https://forum.unity.com/threads/generateauthoringcomponent-in-1-0.1342727/#post-8488502
"next release (sometime in late January I believe)"
Tertle, gib code now. I am waiting for lib 1.0 now.
i want a lib that reads my mind and tells me what i want.
we're not far off https://www.tiktok.com/t/ZTR4HsSLt/
was gonna say, try some ChatGPT π
the make art button arrived a while ago, bout time a make code button also exists π
its been pretty fun trying out chatgpt3 to write something in c and then redo it in asm lol
Sorry, a question, why do I need generic types instead of interface arguments?
avoid boxing? interface method call
interfaces are managed
you can't have manged objects in burst
so yes this avoids boxing and having managed objects
I cannot call even interface methods in job because they are ref types, yes. OK, thanks
Rainbow bracket plugin went paid on jetbrains. Wild.
Alright, let me just find a clone that's free.
what you don't want a monthly sub for some colored brackets? WILD!
subs are really the bane of software. hate it
Same, Im gonna enjoy codeglance while it's still free but if it goes paid, well i dont really need it.
you need to be a special kind of clown to want a sub for something that doesn't need maintenance
Is there a reason we can't add buffer to systemhandle? Its just referencing its m_Entity on AddComponent. I assume structural change invalidation would be too common?
You can, just use the buffer type in add component.
Then use GetBuffer<BufType>(sys)
Mmm so its just syntax they haven't updateD?
Components on SystemHandle don't count as singleton?
No, because the default query filters out system entities and get singleton uses that default query options.
I see, hmm maybe not worth doing then. Would have felt clean
i sadly forgot (maybe it's been fixed) system entities do count as singletons. either SystemAPI.GetSingleton or the normal GetSingleton works
just one of them doesn't include the systemEntities in query
Seems like SystemAPI does
yes, just checked
it failed for me with RequiresSingletonForUpdate - that one was missing it
probably others too, so make sure to test first
Yeah, same. No ability to disable filter for that?
Would be nice to have a RequireForUpdate<>().IgnoreFilter
Require does already ignore filter. Filters as in shared component filters, change and order filters.
What they need is RequireForUpdate<>().WithOptions()
Main things i was interested in:
Q - Physics - are there updates coming, can you share a roadmap of what's planned for it?
A - No
Q - Animation - can you give us some info on what/when/anything?
A - No
We should not define unity Native structs as readonly fields, right? because of copy every time when its method is invoked
You can. The warning is because of the safety checks and will get stripped out at build.
Yes, it is possible
So, I cannot mark my struct as readonly struct as well
You can also enforce readonly using { get; private set; }
public (readonly) struct CustomStruct
{
private (readonly) NativeArray<> array;
public void Method(){
// call array method
}
}
seems to work (ignore the comment, i just stuck this in a random component)
getter instead of readonly works, thanks
I think I should not use readonly fields in struct and instead apply getter
Bad habit to define readonly as much as possible
NativeX are basically pointers and a bunch of accessing methods. When a struct is copied (that warning), it only copies a ulong which is the pointer. You're fine.
NativeStream might be more copied as that's a bit different but you're fine.
Yes, but I mean I cannot think about these sh... warnings and know if it is OK or not. I should focus on algorithms and codes.
So, it is better to define getters at least for struct fields, disagree?
If I want them to be readonly
Depending on what you're doing, properties (fields with get-set) have more uncertain struct layouts. If you're trying to do fancy things with pointers and rely on byte offsets, it get-set might be a problem. Otherwise, yea.
I should remove unmanaged constraint because in my structs, there are some fields like NativeHashSet<int3>
int3 is not unmanaged type
public void Method<T1>(T1 t) where T1: unmanaged
{
}
type '' must be valid unmanaged type (simple numeric, 'bool', 'char', 'void', enumeration type or struct type with all fields of unmanaged types at any level of nesting) in order to use it as a type argument for 'TW' parameter
Ecs 1.0 pre-15 , what happened to LocalToWorldTransform? My ecs code base got wrecked with that missing
Where is the ECS Webgl sample mentioned on pre-release notes
It got renamed to LocalTransform.
Thanks, I will try that. I tried WorldTransform and the game did not behave like it did on exp-12/14
I have the feeling that is burst indeed breaking
yeah same π₯Ή
By not using unity's transform components, I have nearly tripled chunk capacity:
I looked at GO pooling for a manual companion GO implementation and I just gave up. Might as well make my own sprite renderer. So i revived my old circle and square renderer.
did you have trouble with the pooling itself or with the subsequent performance?
The pooling itself was just too roundabout.
And then managing the transforms. Might as well go the extra step of setting up a custom rendering call.
roundabout? that's how i spawn my GOs ```Entities
.WithoutBurst()
.WithStructuralChanges()
.ForEach((Entity entity, in HybridMainEntity hybridMainEntity, in HybridSpawnPrefab hybridEntity) =>
{
commandBuffer.DestroyEntity(entity);
var go = _poolSystem.Get(hybridEntity.prefab, out bool freshInstance); // use pooling system
transformMapping.AddTransform(go.transform, hybridMainEntity.entity);
var animator = go.GetComponentInChildren<Animator>();
if (animator != null)
EntityManager.AddComponentObject(hybridMainEntity.entity, animator);
}).Run();``` i have a pretty straight forward pooling systemBase
and the transformMapping deals with the syncing of position/transform
What kind of script directory hierarchy do you use for your ECS games? For example:
- /{Components,Systems}
- /{Characters,Terrain,...}/{Components,Systems}
- /{Characters,Terrain,...}/{Authoring,Components,Systems}
- /{Characters,Terrain,...}/{Authoring,Components,Systems}[/{Client,Server}]
i have a lot of assemblies π
i start it separated
i simply wrote a little tool to auto create assemblies for me
and link them, setup dependencies etc
so it's absolutely no effort for me to create assemblies
glad to see all these improvements for aspects coming in a future release: https://forum.unity.com/threads/future-of-aspects.1371612/#post-8647284
- Multiple aspects in a query can have overlapping components
- SystemAPI.QueryBuilder.WithAspect<>()
- IAspect.Lookup inside IJobEntity
- IAspect.Lookup.HasAspect(Entity)
- IAspect.Lookup.TryGetAspect(Entity)
π
Ya know, aspect as query parameter makes so much sense, why have I not thought of it myself?
It's gonna be in a few months though so we'll have to make due adding all of those types manually
I'm wondering, why should I calculate indexOfFirstEntityInQuery if I can just use an interlocked add?
not sure how they're even related ^_^'
I'm trying to copy all entities into one linear native array. I could use the calculated index from the scheduled job or I could just interlocked add the chunk's count to a single shared int to reserve a section of the array for this chunk's entities. Since the order of writing doesnt matter.
Question is, would it be faster and could I use a private field inside the job instead of a nativeArray<int> with size 1...
isn't that just what entityquery.ToNativeListAsync is for?
Yea but I would like to do multiple components at once. So a custom job.
ToComponentDataListAsync ^_^'
It does one component at a time and wow, they really expanded that functionality with introduction of enabled bits
im not sure what you mean by that
it memcpys each chunk
{
v128 maskCopy = chunkEnabledMask;
int rangeStart = 0;
int rangeEnd = 0;
while (EnabledBitUtility.GetNextRange(ref maskCopy, ref rangeStart, ref rangeEnd))
{
int rangeCount = rangeEnd - rangeStart;
UnsafeUtility.MemCpy(dstBytes, srcBytes + rangeStart * typeSize, rangeCount * typeSize);
dstBytes += rangeCount * typeSize;
}
}
else
{
UnsafeUtility.MemCpy(dstBytes, srcBytes, chunk.Count * typeSize);
}```
straight memcpy if no filter
It only produces the data for a single component type. I need 3. Yes, i can schedule 3 of these in parallel but 1 is faster.
And not that much work, I'm just caught up on the idea that I could use an interlocked add instead of requiring the precomputing of chunk entity offsets.
i dont think you need the offsets?
or are you doing each chunk in parallel not each component?
because i'm not sure combining this will be faster than just doing 1 component per thread
Which is why the interlocked would work. If each job before copying interlocked added a single int the amount of entities within the chunk, it can "reserve" a section of the array for it to copy into.
I mean, it's accessing the same chunks so 1 job should be faster than 3.
It some micro optimization but it reduces the need for scheduling one small job.
Something like this
you know, you've just replicated NativeList.AddRangeNoResize
i guess you're saving 2 interlocks though
since it woudl have to do it once per list
i take it order of entities doesn't matter for you?
Nope, just that the data gets aligned in one array
Ya know, I thought this was familiar. Although can native list be added in parallel?
yes
{
CheckArgPositive(count);
#if ENABLE_UNITY_COLLECTIONS_CHECKS
AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
#endif
var idx = Interlocked.Add(ref ListData->m_length, count) - count;
CheckSufficientCapacity(ListData->Capacity, idx + count);
var sizeOf = sizeof(T);
void* dst = (byte*)ListData->Ptr + idx * sizeOf;
UnsafeUtility.MemCpy(dst, ptr, count * sizeOf);
}```
on ParallelWriter
are baking systems run after all bakers, or is it just random?
docs arent really clear on this
after all
well
you can run before
^
that was like first 1.0 version but i don't think it's changed much
do the docs show that overview somewhere or is that from gleaning package code?
i just looked at the code
its literally just
SystemGroup.Update
BakingSystem.Update
SystemGroup.Update
SystemGroup.Update
SystemGroup.Update
etc
ho hum didnt get an answer to my physics authoring components question π₯²
they said they'll answer more questions in the coming days, so if your question isn't answered yet, it may still be later
Is GPU Instancing possible with Entities? The default behavior with it enabled doesn't seem to be doing any batching at all.
entities graphics already implement rendering
you don't need to implement any instancing unless you want to draw smth super custom
Is this metric wrong then?
not wrong
but it just does something different these days
that isn't measured by this
There is a class VoxelWorld to manipulate some data (voxels) and create chunk mesh, etc. There are a bunch of methods inside, GetVoxel(), AddVoxel(), RemoveVoxel(), etc. and some query methods.
Inside path finding procedure (it is a job), I use some methods of VoxelWorld.
How can I handle it?
Implement a struct with voxel native array data inside and methods to manipulate it, then use it inside VoxelWorld class and in path finding job?
public class VoxelWorld{ // it is used in many classes,..
public VoxelWorldData WorldData;
//...
}
public strut VoxelWorldData{
private NativeArray<Voxel> voxels;
//...
}
public struct PathFinding{ //job
public VoxelWorldData WorldData;
}
my approach is basically firstly make voxelworld a struct/unmanaged and then store it on a singleton component that can be read from anywhere
Thanks you, A struct?
It is a big work:/
public class VoxelWorld
{
//public VoxelWorldData WorldData;
public List<ChunkObject> ChunkObjects { get; private set; }
public FirstDownwardBlockedVoxel[,,] FirstDownwardBlockedVoxels { get; }
private readonly WorldSetting _worldSetting;
private readonly IElementRepository _elementRepository;
private readonly RoadSystem _roadSystem;
private readonly int _chunkSize;
well yeah but this is a basically a requirement of using dots/ecs
ChunkObjects --> List of chunks (mono/ gameobjects)
IElementRepository --> A respository to query voxel stats data (scriptable objects)
RoadSystem --> It is a class to update/add roads or check if a voxel is road
WorldSetting --> it is a SO
i usually recommend against people porting existing games to entities
you can optimize critical code paths with jobs/burst
I can forget VoxelWorld and let it be a class but extract some methods and data I want to use in path finding job for example and put it in struct
but porting an existing game causes a lot of issues
and from experience, would take less time to write it from scratch if it was a sufficient enough project
Have bakers BlobAssetStore or equivalent?
Oh, ok, I see that AddBlobAsset automatically resolve duplicates
ECS Baking Question: Hey, I have a problem - I don't understand when a GameObject's scale becomes a NonUniformScale during Subscene Baking, and whether that is my bug or someone else's bug. The problem already occasionally occurred before with some sort of quaternion normalization error, but now it is 100% reproducible and visible due to a bug in the new Entities that causes a baking error. π
The first image is a GameObject (which is a connected Prefab Variant Instance) to be baked, it has a PhysicsBody and a PhysicsShape with a Mesh to build a convex hull for. It has 1 child object with a simple meshrenderer and meshfilter for Quad.mesh, at local origin, and local scale 1. It bakes fine.
The second image is that same GameObject rotated any value around Y, and this will have a ** baking error** (but the error isn't the problem, just an indication, the problem is that actually the scale is treated as nonuniform or something?)
Question: Why does the 2nd Image result in PhysicsBaker adding a PropagateLocalToWorld and non-uniform scale to the Entity?
(this triggers the physics baking bug mentioned in the release notes for Entities 1.0.0-pre.15, but the problem is, my objects technically are all uniformly scaled, [1,1,1])
I'm trying to find out what causes this wrong "classification".
More amazingly, THIS is OKAY and does not trigger the bug or scale being treated as non-uniform, only rotations of more than 20Β° ... lolwut? (90 is also not fine, 180 is fine, ... so weird)
For X, the threshold is at + or -5Β°.
We can send ref data (or array) to struct ctor in job and then create native array based on it inside or get struct field of that instance (ref type), right?
or it is better to make it outside and then pass them to job ctor
bakers can't work with derived classes? like when I have derived class and baker for base class, then derived instance won't be baked
I think they are type specific
hold on
are you talking about 0.51 or 1.0?
1.0
then it's probably type specific
in 1.0 they don't favor OOP at all
in baking
so no inheritance π
see no reason to do so, cause authoring lives completely in oop world
not anymore
why?
lol why
I mean ok, when dealing with baking/editor/runtime/build lets go DOD
bit what the deal with authoring monobehaviours
they are oop, why strip theirs functionality if we use them to authoring data
monob is not oop for baking though
you have literally no functionality for it
aside from data holding
hmm, I actually like how they make this baking conversion, because this time we have baking world and can query pre-result entities instead of some wierd authoring entities with components attached as managed IComponentData. Also now authorings can depends on each other, because they stay alive during/after conversion happened
I can declare methods for such mono-authorings, so they will perform calculations for bakers. This is functionality, and inheritance there may be helpful
so you can do with IComponentData structs
but as we know, it only makes things worse
π
yeah, but what If i want to make calculations depending on transform hierarchy or some other unity built-in component functionality?
yes I am π’
I guess
the indended approach
is you write your own baker for built in component
do whatever you want with it
and then let baking system finish job
is the base class abstract?
i could make a generic baker work
can be abstract
where TAuthoringType : ScriptableObjectConverterBase
where TSOClass : ScriptableObject, IConvertToBlob<TBlobStruct>
where TBlobStruct : unmanaged
where TBlobReference : unmanaged, IComponentData, IBlobAssetReference<TBlobStruct>
{
public override void Bake(TAuthoringType converter)```
TAuthoringType is the important part that needs to be defined in the overriden baker and in the base abstract class
{
//[HideInInspector]
public List<string> scriptableObjects;
public bool autoLoad = false;
public string scriptableObjectType;
public void GatherScriptableObjects()
{
scriptableObjects = new List<string>();
if (string.IsNullOrEmpty(scriptableObjectType) || !autoLoad)
return;
var guids = AssetDatabase.FindAssets("t: " + scriptableObjectType);
foreach (var guid in guids)
{
scriptableObjects.Add(guid);
}
}
}``` probably not relevant to you. i think you can just use a monobehaviour as contraint
then you only need to implement the classes/structs you want public class ResourceItemConverter : ScriptableObjectConverterBase { } public class ResourceItemConversionSystem : ScriptableObjectConverter_Baker<ResourceItemConverter, SO_ResourceItem, ResourceItemBlobAsset, ResourceItemBlobReference> { }
Can someone enlight me about unity 2022.2.0f1? Ive it installed on windows and plastic scm seems fine there, but the same version of the engine has not shown the option to open plastic scm on unity 2022.2.0f1 on Ubuntu. (My personal pc has windows but at the lab i gotta use Ubuntu)> Someone said me its now a package. Could someone give direction to what should i do on Ubuntu to run Plastic SCM?
Thank you for your approach, feels good for complex project. Definitely gonna use in my current main project π
Can't I use struct with serialize field inside in jobs?
I want to use it in jobs and also as serialized data in another situation
or wrap that struct type to a serializable class type
OK, structs cannot be serialized
I installed the Entities 1.0 package on Unity 2022.2.0f1, got a pop-up saying that the Burst version used by my project changed and that I had to restart the Editor to continue, so after it was done installing the package and its dependencies I tried to close the Editor and it crashed in burst_signal_handler. Is this "normal"?
The bug reporter always wants me to upload my entire project directory but I have 2 Mbit/s upload.
I don't know if I'm supposed to remove it and only upload the Assets, Packages and ProjectSettings subdirectories.
do you keep crashing with more restarts?
You're welcome. Took me a bit of time when I wrote it. It was much much easier to write in a GOCS.
crashes with new installed burst version is "normal"
No.
Ok.
Is it a good strategy to use math type data(int3, float3) every where unless I have to use Vector3 and Vector3Int, etc. For example to serialize them or in the inspector
Because if I mix these types, I have to convert them in many classes back and forth
Rival has been updated to the 1.0 pre-release?
Yep
I'm pretty sure I looked at the asset store page yesterday and it said Unity 2021.
Well that's really nice.
https://forum.unity.com/threads/dots-development-status-and-next-milestones-november-2022.1366989/#post-8648730 It updated about 30 minutes ago
Woah.
The asset store page says it was updated today.
I was about to try to update it myself lol, these are really good news.
For readonly fields in a struct (job), do you define [ReadOnly] as well as readonly keyword for it? or [ReadOnly] attribute is enough to boost performance?
and suppose some fields can change, is it better to create it (copy data) again using ctor? so they can be all ReadOnly or not
New sample?
Works better now.
Rare error.
I tried to add a thin client while playing and this happened.
The server didn't close its listen port properly. I can't play again now.
Thin clients are broken even after restarting Unity and setting the number of thin clients to 1 before entering play mode.
I don't have this error anymore.
After restarting Unity, this time I don't get this error after exiting then re-entering play mode.
yeah his fps sample is pretty dope
How does chunks/archetypes behave for huge entities ?
I heard that they increase the internal capacity ? Is this true ?
If so... When exactly ? And to how many kb ?
a chunk is always 16k
the archetype size defines how many entities can go into such a chunk
if you'd have a 16k archetype you can get 1 entity into 1 chunk. anything above will probably error out
Really ? I really thought someone told me that the archetype actually increases the chunks capacity to like 32,64 for bigger entities if they are "too big".
It would also make sense since bigger chunks will perform better for bigger entities since less chunk switching is required then
no, size doesn't increase. it's a constant in code defining how much bytes are allocated
the constant can be changed
where did you read that chunks can be increased to 32k with bigger archetypes? pretty certain it wasn't in this discord or the forum
I'll be looking into making the thin clients tool work for this project. I had made the decision a while ago (before joining Unity) to just opt out of the default netcode bootstrap, and I was assuming I was opting out of this tool as well by doing so. But maybe I can still make it work
Thanks.
Does calculate entity count cause a dependency.complete call?
Ugh, systembase calls complete at start of update anyways.
TIL: Do not put ref fields inside of an aspect. It will crash unity
Ref fields?
What? That's news to me
Does anyone use LocalTransform rotation, and is it working for you?
Position and Scale seem to work fine, but Rotation not so much
the rotation in LocalTransform works fine for me
Hello, I'm once back again here trying to understand a bug that I've been having for the past week
Race conditions are only possible when you write to data, right?
And so, if a field has the [ReadOnly] attribute it shouldn't be even possible for that to happen, right?
Thanks, I guess something I am doing is breaking it.
It's possible that something else is writing to the data you're only reading from.
If you're 100% this is not the case, I guess you'll need to provide some more info π
I've been trying to find why it's happening. My latest conclusion is that it's a burst compiler problem
Apart from that, if you search for my previous comments you will find previous tries of other people to try to fix it with me
like public ref int value => ref _privateValue;
This only means it's completing its own dependencies from last frame. (Like the comment explains)
With some unsafe fiddling you could log some members of the native array struct you're trying to read from.
The values that you're interested in are:
length, minIndex & maxIndex
They determine whether your index is in range.
Burst supports logging, so right before you get the exception in burst your logs should explain why. (also log the index you're using)
If it's a really nasty race condition your logs could miss it, but let's pray not π
Yea, that's what I mean when I said systems call complete at start of update.
ah i see but it's just the handle from the previous update. should be okay, right?
Eh, yea. I need to do more testing to see if it really matters.
It should only call complete when the query has a ChangeFilter active or an Enableable component in the query.
Edit: ChangeFilter
Is it possible to opt out of the SRP batcher with entities? Disabling it in the URP settings just stops rendering the entities altogether.
Thanks, couldn't find anything indicating that in the docs for the life of me
Follow-up: Is there anything to be done as far as optimizing out draw calls with SRP on the user side, or am I pretty much at the mercy of the blackbox
Use as many identical meshes. Per instance modification, like color or world position, is far more performant than unique meshes and mesh deformation. Otherwise, it's just the same indirect procedural draw call as any other more complex systems. You can do nearly the same thing if you're willing to code it.
Yeah I'm just running into CPU bottleneck earlier than I'd have hoped, even with a single mesh in the pipeline. Was hoping there might be some extra tricks.
CPU? Unless you're rendering a 10,000 vertex mesh and deforming it every frame, you shouldnt be having a problem. Entity rendering does have a significant overhead though.
Standard capsule, just a ton of instances.
I'm still getting around 110fps with 10k instances on pretty old hardware, so it's leaps and bounds better than gameobjects. Just wanna make sure I'm pushing the new pipeline as much as it can be
Oh, that'll do it.
The renderer right now does not have a really robust LOD and LOS culling mechanism so that might also be a problem.
Yeah that's with zero culling. I'm sure there's things I can do to thin out what's actually being sent to the renderer. I'm just limit testing to see how feasible the concept I have in mind is, because it relies on thousands of entities.
If you have a lot of identical meshes, you might be able to optimize for your use case by constructing a custom renderer. Not too difficult but that's if you know exactly what to optimize for. I got a custom light renderer for purely circular lights and up to 8192 visible at once. Far more performant than the built in URP 2d lighting but far less customization.
I looked into Graphics.RenderMeshInstanced but haven't experimented with it yet. I'm worried about how z depth sorting would work with it.
Yea.... you'll need to do that manually. Z fighting thankfully isnt an issue with lighting as it's purely additive but at least depth sorting is well documented and there's a lot of tutorials.
Sure
I hate baking systems
is it possible to create additional entities in a baking system (not baker)?
Yes? Tertle and Enzi did some experiments a while back that did result in entities showing up but I think it required some asmref hacks to get to internal methods.
I struggled with this too. But it's possible without hacks.
The trick is to add the correct SceneSection shared component to the entity otherwise it won't get picked up.
You can leave the SectionIndex to 0, but the GUID needs to be correct.
You can use the GetSceneGUID() inside a Baker<T> and somehow feed it it through on an entity to the BakingSystem.
Or you could grab the SceneSection from a random other entity during the bake (haven't confirmed this approach).
what editor version do I need to get com.unity.entities@1.0.0-exp.12 (latest) to work without throwing errors immediately upon install?
I use 2022.2.0b16, works fine for me
hmm same as me, yet its giving me a bunch of compiler errors...not sure why
i.e.
I must be missing something
Not sure why it's compiling the tests from the entities package, mmh.
Is it a brand new project or are you upgrading an older one?
I can reproduce it if I add the package as a testable to my project, did you maybe do that by accident?
You can check your manifest to see if it's in the testables.
i dont think it is, reported additional entities in baking systems not getting serialized properly as a bug and its been reproduced
upgrading, I'll try with a new project I guess
anyhow, you'll need to figure out why the tests are included from the entities packages.
This can have multiple reasons (You added the package as a 'testable' in the manifest or you copied the package directly into your project or something else)
that's probably what happened, I remember we used to have to manually edit the manifests
@hazy acorn yep, testables in my manifest, leftover from probably 3 years ago when I put it there (copy pasting from whatever example project of the time)
dots DOTS support large world coordinates?
Not in 1.0, but it's on the roadmap
I mean, technically yes. If you're willing to code everything for it.
I'm making my own transform system and wow, its surprisingly hard.
Can you share what challenges you've run into?
Mainly it's just design phase overthinking. Transform components are the bedrock of the entire entity world so any changes to their structure changes everything in the project. So nailing down a specific format from the start is key to not wasting hours of time. Especially since I use pointers very liberally and make hard-coded assumptions about field offsets which bites me in the ass later when I change a field and then unity crashes from a segfault.
So the main debate I had with myself is whether to use unity's new TransformV2 format where all the transform elements are gathered in 1 component or use the V1 format of individual components per concept. I initially designed my 2D transform component along the lines of TransformV2 as having one singular component was extremely convenient for rendering (I declined to create a LocalToWorld component so every matrix is being re-generated every frame from raw transforms).
However, as I continued fleshing out other parts of my project and particularly in regions of high performance requirement (e.g. within the predicted simulation loop of netcode), I found myself having to constantly "extract" specific elements of the combined transform component for vectorization. Basically for extremely optimized code sections, I've been using mem-cpy-stride liberally to create SoA stack allocated buffers that are then multiplied component-wise manually to maximize Burst vectorization and unrolling potential.
Furthermore, I've structured my jobs to use one element of transform at a time, position only in this job, then rotation, maybe scale. By shoving in a giant 2DLocalTransform component and only using 2/4 of the floats in it at most wastes valuable cache space. Regular LocalTransform is even worse in that aspect with 2D gameplay, 2 floats out of 8 is wasteful.
And frankly, for rendering, a transform aspect has completely filled the niche that a combined LocalTransform component filled. I stick my L2W matrix generation as a method in the aspect and pull that every frame for uploading to the GPU. Works very well.
Here's an example of where I "extract" the first and second floats of a float2 position component into a linear and separate X and Y buffer for vectorized hash calculation.
And this is the function that generates the spatial hash given the position vector of each 2D physics body. I opted for a more simplistic spatial hashing compared to my old BVH tree due to the speed of rebuilding provided by a parallel hash generation. My old BVH while extremely effective for broadphase collision detection and raycast solutions was singlethreaded and expensive to regenerate. Which is a major problem in netcode where for a predicted physics world the physics step must be replayed multiple times proportional to the roundtrip ping experienced by the client.
TL;DR: I spent a few hours today converting my custom transform components from a V2 conglomerated component to V1 divided triple component setup as I found myself using only specific parts of transforms per job. A transform aspect filled the niche of V2 in generating local to world rendering matrices easily.
And I'm currently wondering if I should go the final step and just have a PositionX float component and PositionY component...
My god, coding my own entity viewer UI was one of the best decisions I've made so far. I'm checking an entity and wished that the archetype it was a part of was highlighted when the entity was clicked and not just when I clicked the chunk header. Then I realized I coded it myself and I can do that.
Although now that i have ComponentX and ComponentY variants, I'm getting the urge to re-code the entirety of entity inspector to allow for a hybrid Aspect-Component view...
As I make everything XY variants, I realize this pretty much is only possible for 1D (?) and 2D worlds. More dimensions would balloon the required types even more.
QueryBuilder's restriction of 2 types per RW addition however aligns perfectly with a fragmented XY vector component. I think this singlehandedly justifies my decision.
That's new c# feature though, no?
Oh wait
Property
I see
A field is C11, I messed up my terminology but yea, a ref property inside an aspect crashes unity when viewed in the inspector
Should report it as a bug
ehh
PAIN
!Bug
If you have a Unity bug you would like to report, follow these guidelines! https://unity3d.com/unity/qa/bug-reporting
The problem is I dont have a reproducable. I reported the more frequent one that occurred in exp.8 which thankfully got fixed.
Even just the crash logs/dump with an explanation on how to get there could help, but I understand. If it's something that keeps happening (all those crashes look painful) then I'm sure the DOTS team(s) will help out. You could try the forums as well.
They're all asset importer crashes. Either freezing the editor or corrupting entity headers. Both requiring a full editor restart but no actual data loss thankfully.
They actually miss it, minindex, maxindex and length shown are always in range, but the error appears.
We tried that yesterday I think, i don't have good connection right now, but if you search for my nametag you will see some messages and images of the different logs
And it happens randomly too, more often after the first play mode. (first one is alright, second and so on have the bug)
Disabling burst makes the error disappear also
Oh, i see you don't mean the same values to check, okay, will debug those and see what i get
How do you avoid copying data when passing struct types contained NativeArray and some value type fields in methods?
Can I use ref?
in/ref
ref var structData= ref method();
Also for return types?
return type should be ref for this
Thanks, so I cannot trust AggressiveInline, right?
Every private methods should return ref for struct types?
At least, NativeArray copy is cheap but inside my structs, there are some int3 as well (4,5)
and is NativeArray/NativeList faster than List and standard Array even if they are not used in jobs?
why not?
for which part?
trust aggressiveinline or should return ref for returned struct types
For example, in a private method, I create a List and add some data then return it.
Is it better to convert it to NativeList even if it is not used in jobs?
private List<> Method(){
List<> list= new List<>();
for(){
//...
}
return list;
}
B depends on A.
A is a struct type used in job but B is a normal class.
This Private Method is in B.
depends on application
generally if it's game logic, you'd want to avoid GC allocations
Is it a good approach to use math type data(int3, float3) every where unless I have to use Vector3 and Vector3Int, etc. For example to serialize them or in the inspector, raycast hit, etc.
Because if I mix these types, I have to convert them in many classes back and forth
How BakeDerivedTypes works?
UPD: ok, I see https://docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Entities.BakeDerivedTypesAttribute.html
ugh.. sometimes we have section in docs, sometimes it is in API docs and sometimes just in source code comments
Heyoo,
I just started with dots but I already ran into a issue that I can't find on the forum and multiple tutorials don't seem to have. My ecs transforms and aspect are getting their positions changed but the GameObject itself is not moving. Does anyone know what the problem could be?
There is a definition list (scriptable objects and POCO class types). I use them (query) in job routines.
Should I convert them to a native hash type for example and use it in jobs?
Because it is used in different job procedures, it is suitable to define it as Singleton component?
GameObject?
Entity*
But nothing from the entity menu seems to actually move it visually.
Are you sure that your system moves it then?
Well the transform components in the inspectors are changing
Did the previous transform values you saw in the inspector match what your system did?
Yep
π€
Thats why i'm confused.
Oh wait I misread that.
And it also has all the correct entity system rendering components so that shouldnt be the problem either
I thought you could move it from the inspector.
Oooh no i literally just have a very simple moving to the right thing from the code monkey dots 1.0 in 60 minutes.
And i wouldnt be so confused if it wouldnt actually change the entity transform components
yeah, why not?
I am nooob π
Thanks, you helped a lot, remove a lot of confusion and doubt
That video says to use TransformAspect.Position and the docs say it was obsoleted by .WorldPosition, not by .LocalPosition.
https://docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Transforms.TransformAspect.Position.html#Unity_Transforms_TransformAspect_Position
Have you tried using .WorldPosition instead?
Yep tried that as well. Also tried translateworld. Remaking an entirely new project atm to see if its something corrupted in the project.
@covert lagoon Remade the project. With the exact same scripts drag and dropped in. And it works. :)
:')
π
Whenever that happens, first completely delete the Library folder and then test before switching to a new project
need quick primer : how do i replace translationLookUp = systemBase.GetComponentLookup<Translation>();
with the transform aspect?
i cant use codegen here. need to write a jobchunk
some useful methods are missing from lookup. tertle complained about it π
the codegen of the aspect
ah
sry i am not getting it yet
translationLookUp = systemBase.GetComponentLookup<TransformAspect>(); complains that it needs an ICompData
and there is no GetAspectTypeHandle is there?
SystemAPI.GetAspectRO<TransformAspect>();
and this needs an entity as param?
var lookup = new StateAspect.Lookup(ref state, false);
you were faster π just loaded up my project. yes, just new it. that's the codegen from the lookup ```public struct Lookup
{
bool _IsReadOnly
{
get { return __IsReadOnly == 1; }
set { __IsReadOnly = value ? (byte) 1 : (byte) 0; }
}
private byte __IsReadOnly;
global::Unity.Transforms.TransformAspect.Lookup Transform;
public Lookup(ref global::Unity.Entities.SystemState state, bool isReadOnly)
{
__IsReadOnly = isReadOnly ? (byte) 1u : (byte) 0u;
this.Transform = new global::Unity.Transforms.TransformAspect.Lookup(ref state, isReadOnly);
}
public void Update(ref global::Unity.Entities.SystemState state)
{
this.Transform.Update(ref state);
}
public SpellCasterAspect this[global::Unity.Entities.Entity entity]
{
get
{
return new SpellCasterAspect(this.Transform[entity]);
}
}
}```
it's just a wrapper really
does SystemAPI support it though or do we have to call Update ourselves. i don't know
(not using aspects) π
Same. I only use aspects in IJE per component anyways. If I need lookups, I do the per component version.
i am very sorry but i still dont get it :S. My TransformAspect has no .LookUp?
maybe cause some codegen did not run yet
ill only update the transform system for now and see how i like it. i suspect ill use them very rarely
oh wait a sec. does Transform V1 work with aspect too?
since i need to stay on V1 for now
I dont think V1 has aspect support.
ah i thought V1 would support transforms already and ill just transition to them to make the later transition to V2 easier
I've disabled transforms entirely in my project so I cant check if I'm wrong. There should be an aspect though logically thinking about it.
But IIRC V1 transform aspect was very limited.
You can make a transform aspect yourself if you wish. Easy enough to do with V1 components.
Tertles Core Package is giving me Errors on his Extension Methods for the TransformLookUps . Probably cause i need to use V1 π¦ they seem useful
For some reason an IJobEntity job is only giving me the option to execute it using Run(), not ScheduleParallel()
Anyone else have this problem?
missing Unity.Jobs namespace perhaps?
hm, just checked. using Unity.Jobs; is needed. is the whole method not recognized or just a parameter missing?
Oh interesting it's being referenced from Unity.Entities
Yeah it's set to ISystem
does state state.Dependency = testJob.Schedule(state.Dependency); work?
Nope the Schedule method doesn't exist
my system with IJE only has using Unity.Burst; using Unity.Entities; namespaces
hm, that's weird
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine.UI;
using Unity.Jobs;
[UpdateInGroup(typeof(SimulationSystemGroup))]
[UpdateAfter(typeof(SteeringSystem))]
public partial struct MoveSystem : ISystem
{
public void OnCreate(ref SystemState state)
{
}
public void OnDestroy(ref SystemState state)
{
}
public void OnUpdate(ref SystemState state)
{
var testJob = new TestJob();
testJob.Run();
}
[BurstCompile]
private partial struct TestJob : IJobEntity
{
public void Execute(TransformAspect transform)
{
transform.WorldPosition = float3.zero;
}
}
}```
Just upgraded to 2022.2 and Entities, so there's a bunch of compile errors - maybe something to do with that?
Oh right on the ISystem struct?
and for OnCreate/Destroy/Update too
Oh yeah thanks
A question i actually had for a long time now : Are we supposed to manage GlobalEntitySceneDependency.asset in git or should it be ignored?
for some reason i quite often get changes in there when there shouldnt be any
i think you can safely ignore it. same goes for anything in sceneDependencies or what it's called. I don't even know why that stuff is in the assets folder and not library
Legacy
thanks! its what i assumed but it really made me think twice cause usually nothing in the assets folder is ignored
Are aspects compatible with SystemBase Entities.Foreach jobs?
What's the easiest way to port the Translation/Rotation components in those jobs now that they're replaced?
Port?
They've been wholesale replaced by Local/WorldTransform which contain both translation, rotation, and scale in one component.
use IJobEntity instead of ForEach btw
Yeah agree but for now I'm just looking to have the project compile
Making IJE is as fast as making ForEach
I shouldn't be writing to WorldTransform right? The manual says it's "derived" so changes to it won't stick
if you just want it to compile you should first use the tranforms V1
then upgrade later to v2
there are enough problems with updating to 1.0 without transform system causing issues
Is there a compiler flag for that?
1 sec. i need to look it up. editor hangs because i need to remove thousands of converttoentity scripts :S
Oh sorry found it: ENABLE_TRANSFORM_V1
Is NativeArray and NativeList faster than List and standard Array
How do we access unmanaged shared components? It's one of the best things about 1.0 imo
Is it just getting a list from EntityManager.GetAllUniqueSharedComponents() and iterate through a loop while setting a AddSharedComponentFilter() to an entity query?
Inside a IJobEntity or IJobChunk?
How can I log those values?
It's inaccessible
IJobEntity
Just a in SharedType shared in the Execute() parameter list will get it. Do you want to filter by a shared component?
Oh cool didn't realize that. Nope no filtering in this case thanks
All the special types that can be used in an IJobEntity. IJobChunk is slightly more difficult.
does DOTS with with VR?
Does it work with VR? Yes, with a bit of work.
I doubt there's any resources on how to get started?
Nope.
How can I log those values
Should we add [ReadOnly] attribute for ReadOnly native array types?
Yes.
Can Singleton component data change after creation?
yes
Whats up with warnings such as those: [Worker14] 1 entities in the scene 'UnitsSubscene' had no SceneSection and as a result were not serialized at all.
it feels like every subscene gives me this warning once
am i supposed to manually add SceneSection somewhere?
One of the less annoying baker bugs. It's harmless.
ah okay. i had hoped those issues would be resolved with the preview release. we all learned to live with strange warnings in ecs for some time now π
well, the crashing on editor domain reload has (largely) been fixed. I'll take a random ignorable warning over constant editor restarts.
as you write that my baking crashed π
Ha, it still happens. Maybe once every 30 min instead of once every 3.
But yea, living with errors and crashes is kinda the name of the game right now with dots unity ecs. It's strange they call it "production ready" now. I hate to agree with acid arrow with anything but he does have a point, ecs is nowhere near stable.
i hope at least the core API is now stable. the unity team is doing great work. pretty sure they get those crashes fixed till full release
π₯² Looks like I'm hitting ECB bug that at editor everything works nicely but actual game build ECB keep spamming instantiate entity until throw u error then crash
So, what's the best/fastest way to detect and transfrom float3(nan,nan,nan) to float3(0,0,0)
Why are you ending up with NaN values?
So, after I updated my packages from experimental to preview I started getting this error in editor
Problems of mesh vertex vectorization, when the resolution is not multiple of 4
So these values only need to be "repaired" once, not every frame?
That would be ideal yes
Since it sounds like this needs to be very fast, it's hard to say. Unless you manage to somehow index which vertices are incorrect, you would probably just need to iterate over it
(which is also very fast, but may not be fast enough for what you are doing)
i see
Anyone else getting this when trying to upgrade from 2022.2.0b8 to 2022.2f1? The URP upgrade fails and the editor freezes up.
yeah calling it production ready for the version that's most unstable since 2020.3 is kind of ironic
0.51 was stable enough
Any ideas as to why my spotlights don't illuminate an object? Shadows work just fine but the damn thing won't light up at all. If I drag it out of the subscene it works fine (even with the actual light source still in there). Is this a known thing that just doesn't work or am I missing something?
Any lights but direction haven't worked in subscenes since forever I think
I see... hm. That's unfortunate.
would be interesting to check whether light sources as GO affect entities
A quick test would suggest a big fat "nope"
did you check or just assumption?
Just a really quick test in a, currently rather messy, scene
should also check in runtime π
don't think entities graphics work properly in edit mode
Doesn't seem to change anything
There is a mention of entities packages in changelog so I would assume that yes
Hasn't crashed yet.
what about baker errors?
Anyone know how to fix this build error?
UnityEditor.Build.Pipeline.ContentPipeline:BuildAssetBundles```
Haven't had that while trying the Rival OnlineFPS sample.
But I had not tried 1.0-exp.
Only 0.51 and now 1.0-pre.
Well, for me this pops up in -pre (when it didn't in -exp) when I use a prefab with physics body (with interpolation turned on) in a baker for some reason
But somehow in playmode it still works as it was before
That's a known bug. I'll be fixed soon ish
anyone knows how to use mathematics package matrix similar to transform.InverseTransformVector & transform.TransformVector
You guys have any ideas about other ECS frameworks for Unity?
I need temporary production ready solution π
Bevy!
Well, now I have an issue with implementing collisions
for unity
Ya know, I wonder what happened to the people who wanted bevy. They've gotten really quiet over the years
[BurstCompile]
public partial struct MagicMissileSystem : ISystem
{
[BurstCompile]
public partial struct MissileCollisionEvent : ICollisionEventsJob
{
public ComponentLookup<ProjectileData> projectileData;
public ComponentLookup<EnemyData> enemyData;
public void Execute(CollisionEvent collisionEvent)
{
Entity entityA = collisionEvent.EntityA;
Entity entityB = collisionEvent.EntityB;
bool isEntityAProjectile = projectileData.HasComponent(entityA);
bool isEntityBProjectile = projectileData.HasComponent(entityB);
bool isEntityAEnemy = enemyData.HasComponent(entityA);
bool isEntityBEnemy = enemyData.HasComponent(entityB);
if(isEntityAProjectile & isEntityBEnemy)
{
}
else if(isEntityAEnemy & isEntityBProjectile)
{
}
}
}
public void OnUpdate(ref SystemState state)
{
(...)
state.Dependency = new MissileCollisionEvent
{
projectileData = SystemAPI.GetComponentLookup<ProjectileData>(),
enemyData = SystemAPI.GetComponentLookup<EnemyData>()
}.Schedule(SystemAPI.GetSingleton<SimulationSingleton>());
}
}
Whats stopping you from rolling 25 arrays in a static class?
I tried doing it like it was shown in documentation
But it doesn't like SystemAPI.GetSingleton<SimulationSingleton>() as a parameter for Schedule()
I mean, if you have little to no structural changes, it works decently well.
Development time is at value here
Even though it is exactly what is shown to be used in documentation
Then uh, 0.51 is still extremely stable. Just less features.
I need proper compatibility with reference types
Well, you're out of luck then.
I am trying to learn how to make simple projects that are easy to be implemented into other Unity projects
kind of "minigames"
Does anyone use cleanup components?
So, no one knows what is wrong on my end?
You have to do Schedule(SystemAPI.GetSingleton<SimulationSingleton>(), state.Dependency) instead
Well, I don't get any errors anymore
But for some reason it doesn't do anything when entities collide
This is how my struct looks like
[BurstCompile]
public partial struct MissileCollisionEvent : ICollisionEventsJob
{
public ComponentLookup<ProjectileData> projectileData;
public ComponentLookup<EnemyData> enemyData;
public void Execute(CollisionEvent collisionEvent)
{
Entity entityA = collisionEvent.EntityA;
Entity entityB = collisionEvent.EntityB;
bool isEntityAProjectile = projectileData.HasComponent(entityA);
bool isEntityBProjectile = projectileData.HasComponent(entityB);
bool isEntityAEnemy = enemyData.HasComponent(entityA);
bool isEntityBEnemy = enemyData.HasComponent(entityB);
if(isEntityAProjectile && isEntityBEnemy)
{
var temp = enemyData[entityB];
temp.hp -= projectileData[entityA].damage;
enemyData[entityB] = temp;
}
else if(isEntityAEnemy && isEntityBProjectile)
{
var temp = enemyData[entityA];
temp.hp -= projectileData[entityB].damage;
enemyData[entityA] = temp;
}
}
}
just debug it
Ive downloaded the 2022.2.0f1 on Ubuntu but it came out without Plastic SCM option on Windows list inside unity, do I've to install a package to use it? Which and how?
this entire time I forgot to change collision response on physics shape
How are people reading scriptable objects in systems? Does it involve turning each SO into singleton entities?
i convert them to blobs
I used to reference them directly with addressables but with ISystems that's no longer possible
probably best to stick with standard SystemBase in that case then
SO aren't meant to be singleton though
you still can
you can either create data in baker
or in monob's start or awake
Yeah baker
Ok, one more question for today
Are there any easy ways to implement an equivalent of button onClick() for menus?
what UI do you even use?
When do you se readonly and readonly ref struct for job data?
Well, was planning to use TMPro for now for buttons
if it's uGUI
just use whatever uGUI uses generally
because it's independent
same as UI Toolkit tbh
anyone knows the equivalent of transform vector ? https://forum.unity.com/threads/transform-inversetransformdirection-for-ecs.652543/#post-7448927
do someone know if unity plus license allows to edit dots (or any other) packages for commercial use?
or do I need pro (or higher) which allows me to edit source code?
No? You can go to your library folder then copy paste the entire DOTS package to your packages folder and edit the source.
I meant it from legal standpoint
Huh, in a production sense, I think you might need a license.
Licensed under the Unity Companion License for Unity-dependent projects--see Unity Companion License.
Entities Β© 2018 Unity Technologies
Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license).
Unless expressly provided otherwise, the Software under this license is made available strictly on an βAS ISβ BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.
hmm I found this one: https://unity.com/legal/licenses/unity-package-distribution-license
3.1 You own your content. In this License, βderivative worksβ means derivatives of the Work itself--works derived only from the Work by you under this License (for example, modifying the code of the Work itself to improve its efficacy); βderivative worksβ of the Work do not include, for example, games, apps, or content that you create with the Work. You keep all right, title, and interest in your own content.
Seems like it's okay, as long as you use the unity engine
You can create a bug report via the editor, or since I'm here at the moment you can share what the bug is so we can see if a report is necessary
public partial struct FixedTickSystem : ISystem
In standard characters
for some reason it uses this code in OnUpdate
if (!SystemAPI.HasSingleton<Singleton>())
{
Entity singletonEntity = state.EntityManager.CreateEntity();
state.EntityManager.AddComponentData(singletonEntity, new Singleton());
}
which causes exception in singleton that doesn't exist
in other systems
if this system got updated later than them
simply moving this code to OnCreate fixes it and makes OnUpdate slightly faster
Ah yes I see. I put this in the update just in case someone accidentally deletes the singleton, but i'll make sure i also create it in OnCreate by default. No need for a report, thanks!
I think if someone deletes singleton that wasn't created by them, it should be on them π
That's true, but I was thinking maybe some people might attempt to reset scenes by deleting all entities and whatnot. I'm probably overthinking this π
I think that throws an error if it's done manually right? I tried a looooong time ago when I was first starting out in ecs (2019?) and it exploded on me. never again
I never tried it to be honest
Where would you store data which neither really belongs to an entity nor system ?
For example Collision or AOI ( Area of influence/interest ) data ?
Imagine we wanna track new, staying and left collisions for each entity. We then would fire events to react on them.
However, each entity actually needs several lists to do the tracking... Like a list with all collisions this frame and all from the last frame to determine entered and left collisions.
We could either put those lists into the entity itself (CollisionsComponent{ UnsafeList<...> } or buffer) or the system (Dictionary<Entity, List<CollisionStruct>>) which handles them to fire events.
Where would you put those lists ?
@signal phoenix btw, I tried to look into character implementation and it seems like it's all done in one system: velocity evaluation, transform modification and etc
Have you considered splitting it though?
This way there is a way to modify data of controller's step by 3rd party, simply by updating after velocity evaluation and before it's applied to transforms (similiar to how physics work now)
and there won't be a need to make checks like friction floor, because friction floor will be able to make it's modification manually instead
You can use a DynamicBuffer<CollisionStruct> on the entity.
I've only looked at rival once but from what I recall each module is a seperate struct and it was promoted to implement it yourself with features you need
Sure, but i wonder whats the "cleanest" way to do that... since the data does not really belong to the entity ^^ Actually it would always require 3 Lists/sets... one for entered, one for stayed and one for left collisions.
Unity physics implementation of StatefulEvents is done using DynamicBuffer on separate entity
This sort of code design question keeps me up at night. Good luck.
so that probably sounds like cleanest one I guess
Ugh, i have a system that needs to conduct iterative steps but the problem is one half of it must be done in series and the other should be done in parallel. I need to somehow reimplement something like a first-lane wave intrinsic with unity jobs.
What I'm thinking is a NA<int>[2] value that all available threads interlocked increment the [0] and check the return value. If it's 1, that means the current thread is a "first-lane" and should conduct the first half series data. Once the "first-lane" completes, it should set [1] to true (1). Other threads should remain idle in a while(true) loop until the [1] value returns true and conduct the parallel portion.
I wonder if there's a built in way to conduct this cross-thread synchronization scheme other than hacking it together using a nativearray buffer.
It's something I've considered for sure, but I ended up choosing to keep things simple in the "standard" characters (which can just be seen as starting points).
But as a user you'd be free to split it in multiple steps:
- grounding update
- velocity handling
- move
The thing is; there will be cases where you'll need even more splitting than this. What if you want to insert a step between parent movement and ground detection? What if you want to replace the default moving platform detection step with your own? Etc... In the end, the correct amount of splitting depends on the specifics of the project, so I decided to make this the user's responsibility. More splitting means more places to pass data to jobs when a character step needs access to custon data lookups & singletons, so there's a bit of a ease-of-use price to pay for splitting things
yeah, that's true
Rival has interesting glitches kek
Looks right to me
speedrun community approves
now that's funny
So I tried to write to a NativeParallelMultiHashMap in an IJobParallelFor and got
InvalidOperationException: PopulateNeighborsJob._neighbors is not declared [ReadOnly] in a IJobParallelFor job. The container does not support parallel writing. Please use a more suitable container type.```
Is there any documentation anywhere about which containers support parallel writes?
You need to use the ParallelWriter struct
(for the respective container type)
e.g. NativeParallelMultiHashMap.ParallelWriter
You can get one by calling AsParallel on the container
All containers that have Parallel in the name support parallel writing, as well as NativeMultiHashMap, which is currently named incorrectly
Beautiful thank you π
Basically anything that you can call AsParallelWriter on
Just note that a lot of parallel containers do not support allocating additional memory when used in parallel, e.g. NativeList. So it may throw an error if it needs to resize
Oh interesting I see they also have a different API for writing. I can't simply use the indexer
I have to use TryWrite?
Oh sorry - actually NativeParallelMultiHashMap.ParallelWriter only has Add() which returns void So I guess if there's a memory issue it will fail with some kind of exception?
It's NativeParallelHashMap.ParallelWriter that has the TryAdd - which is documented to fail/return false if the key exists already
Yes, if the key is present in a NativeParallelHashMap it will just not do anything, but it can still run out of memory and throw an exception
It throws an InvalidOperationException if it's full and you attempt to add something wile using a ParallelWriter
Hmmm now this leads to a new issue for me.
I'm using a NativeParallelHashMap to store distances per-coordinate for a pathfinding algorithm. I know for sure each thread is going to be dealing with unique sets of keys (they are partitioned beforehand), but I need each execution to be able to read and write from the HashMap
Is that possible?
Are they mutually exclusive? Meaning no keys are shared
yes
You can use a NativeStream in that case
Basically each parallel writer will open an index for it to write to, and then afterwards you can read each index
You'll still need to write and read after each other, since doing both at the same time is not thread safe
Unless I'm misunderstanding what you are attempting to do
But I'm a little confused, you just need the container as a lookup inside the job?
Yeah - the short story is I'm doing a BFS on a different area of a graph in each execution of the job. Think of it like... doing BFS on separate islands of a graph, and storing the distance to the starting point for each node in the hashmap. Each execution is working on a disjoint part of the graph and there's no chance of overlap, but they're still using the same HashMap to store everything
In order to get the distance to a given node, I need to read the distance of the node it is a neighbor of and add one
But you do need the result outside of the job?
Which was calculated earlier in the algorithm
yeah the result is needed outside the job
What type of job is it?
IJobParallelFor
So this is only running for a single graph at a time
Ok let me drop the veil here a bit. It's for a grid pathfinding system. There are multiple different destinations an AI can navigate to. I'm running a job that marks each tile on the grid with a number representing how far it is from the destination. To do that I do a BFS from the destination radiating outward on the grid and add 1 to the previous node's distance to get the new distance.
The parallel part is that I'm doing this in parallel for each potential destination.
So it's the same graph for every execution but a different destination.
Is there EqualityComparer (Assert) for float2,int2,float3,int3 in testing?
Is there a reason you don't want to just check Assert.IsTrue(float3 == float3)?
The keys in the NativeParallelHashMap are a pair of (tile, destinationTile). So since each thread is using a different destinationTile, the keys are always unique per thread.
Do the following jobs need all results or just the results for each partition?
Exactly I have written it like you
but it is not a good way to show errors
Can you show some code? Since all mathematics types certainly have their equals override implemented, so I'm not sure what issue you are having
Right now all but it could theoretically be broken up
Also, float3.Equals(float3) not ==
My router just decided to reboot so gimme a few minutes to come back online lol
It depends on what you are doing, Equals returns a bool, while == returns a bool3
I know
Assert.IsTrue() it does not work I mean with ==
What issue are you having?
Yes, or Assert.IsTrue(math.all(float3 == float3))
I said. I want to show the meaningful logs like expected and value
Assert.IsTrue returns only true or false not meaningful texts
The second parameter is a message
OK, I convert int3,float3 to Vector3 and Vector3Int and then use EqualityComparer, thanks
I think you have not written test codes or I cannot say my meaning
You want to assert, and have the exception print the expected value
When I write Assert.Equals(float,float), it says exactly the expected value is ... float value and the result value is ... float value
You cannot achieve it with Asset.IsTrue
What assertion class are you using?
I want something like it for float3
AssertUtility.AreEqual(data.LocalPos, localPos);
I have written EqualityComparer for Vector3 before. It is perfect
Vector3IntEqualityComparer --> unity class
public static class AssertUtility
{
private static readonly Vector3EqualityComparer Vector3EqualityComparer = new(10e-5f);
private static readonly Vector2EqualityComparer Vector2EqualityComparer = new(10e-5f);
private static readonly Vector3IntEqualityComparer Vector3IntEqualityComparer = new();
public static void AreEqual(Vector3 expected, Vector3 actual)
{
Assert.That(actual, Is.EqualTo(expected).Using(Vector3EqualityComparer));
}
public static void AreEqual(Vector2 expected, Vector2 actual)
{
Assert.That(actual, Is.EqualTo(expected).Using(Vector2EqualityComparer));
}
public static void AreEqual(Vector3Int expected, Vector3Int actual)
{
Assert.That(actual, Is.EqualTo(expected).Using(Vector3IntEqualityComparer));
}
}
Sorry my router decided to crap out. Back now. Right now I have the next job depending on all the results of this (all partitions being done).
So maybe you should start with the fact that you are using NUnit, since you are mixing Assert classes
Yes, but it is also a class in Unity.Assertions
I think you will have to do some kind of map-reduce-esque operation with a job following it that gathers the results into a single hashmap. There might be some way you can do it completely in parallel with disabling safety but I've never tried
Ok - I'm going to try some stuff. Thanks for your insights.
Good luck, sorry to not really be of help
You were of a lot of help actually π
I still don't know what your issue is, it prints correctly for me
So?
I have used the nunit one
Can you show me your output?
π
What output are you getting?
I switched my unity from 2019 to 2021
In my old project, I cannot see it when using Assert.IsTrue :/
Perfect, probably my wrong
Well it will not show for Assert.IsTrue since you've converted the input to a boolean...
For which screenshot?
.
yesss
Appreciated, the generic one
public static void AreEqual<T>(T expected, T actual, string message) => Assert.AreEqual<T>(expected, actual, message, (IEqualityComparer<T>) EqualityComparer<T>.Default);
I think it does not exist in 2019. Awesome
How do I check if an entity exists now, I'm sure there used to be an Entity.exists() method
in a job or main thread?
in an IJobEntity
does that work in 0.51
well not systemapi
but you can get it from a system instead
GetStorageInfoFromEntity()
Can you check if this is still happening if you add a TrackedTransformAuthoring to the sphere you're jumping on? It's basically the component you put on bodies that the character can stand on, like moving platforms and such
I'll see if there's a way to make the behaviour less weird when the component's not there though
awesome I'll try that thanks
cool it worked
@light badger Do you have any examples of smoothing the prediction of rotational components?
I would've sworn there was one but I cant find it anymore. And the linear smoothing of course doesnt work with radians.
Is it good to define fields as static ones in struct types to avoid copying as much as possible?