#archived-dots

1 messages · Page 254 of 1

haughty rampart
#

1.0 is huge

tranquil jay
#

damn, enable/disable would have been a huge optimization as well as simplified workflow

gusty comet
#

Are we reading the same roadmap?

#

Because that isn't huge, that is barely a repaint with some additions from other teams.

haughty rampart
gusty comet
#

I'm not seeing where they completely rewrote anything. Are you talking about ECS library implementation? Is a rewrite of that even a big deal for 1.0?

haughty rampart
#

source generators alone....

rotund token
#

0.50 was a pretty big rewrite

haughty rampart
#

btw, they'll have to rewrite the source generators again for 2022 i think / hope

#

well... not fully rewrite, but change them up fundamentally still

gusty comet
#

The time they took to get to source generators is nothing to write home about if I'm to be honest. There's practically nothing else, some limited support from other teams and that's it.

#

Not even animation.

#

You know, the team that took a year from communication just to focus on... you know... animation?

rotund token
#

I'm not happy with animation but I'm not really sure what you were existing from entities itself

haughty rampart
gusty comet
#

It seems you guys got used to lackluster development speed so this is just par for the course.

rotund token
#

Api wise I think it's mostly done. Tooling etc is the primary focus

haughty rampart
rotund token
#

I am definitely annoyed about the delayed animation though, kind of throws some plans in the air

rotund token
#

Don't expect a giant fundamental change to how systems and jobs work

haughty rampart
gusty comet
safe lintel
#

by the roadmap seems like 0.50 covers most of what 1.0 brings so I dunno if theres really more or its mostly just like an overall showing of what 1.0 has, which by definition also includes 0.50

tranquil jay
#

Anybody got a link on hand with the roadmap please?

safe lintel
gusty comet
#

https://forum.unity.com/threads/animation-status-update-q4-2020.1023445/

Existing animation tech will receive general maintenance and bug fixes throughout 2021 (and beyond). As always, we’ll do our best to back port as many fixes as possible to 2020 LTS.

New Animation Tech (i.e., DOTS)

We are actively working on building the foundation of future animation tools and technology

When will animation devs become more active in the forum?

We will still drop in on occasion, but will not be engaging in “front-line” support in the forum for the next few months.

That was from Animation Status Update (Q4 2020).

https://forum.unity.com/threads/animation-status-update-q2-2021.1125482/

The road to 2021.2

Advancing DOTS
We have been working with productions to ensure our new high-performance, multithreaded Data-Oriented Technology Stack is delivering on our vision of a scalable, streamable, networking ready and highly customizable platform.

Basically they've stopped working on animation for dots animation, any old feature was on maintenance and minor qol only mode... since 2020?

#

Anyway, the disappointment from that 1.0 is rather sobering, for me at least.

#

But DOTS got their roadmap page. Finally. I guess that's nice. ¯_(ツ)_/¯

haughty rampart
#

that was 2020. there's more than a year between that 'announcement' and today

gusty comet
#

I guess reading comprehension isn't your strong suit since you skipped the 2021.2 update. I'll be ignoring you from now on. Peace.

glacial bolt
past palmBOT
#

dynoSuccess TermsOfService#1906 has been warned.

safe lintel
#

so, anyone here going to gdc?

coarse turtle
#

no :( I was considering it until I saw the last minute plane tickets 😅

haughty rampart
hot basin
haughty rampart
hot basin
#

second link

haughty rampart
gusty comet
#

Does IJobEntity accept more than 8 ref/in parameters unlike Entities.ForEach?

worn valley
tranquil jay
#

@rotund token Hello friend, Collections had an issue with a NativeArray which you made a workaround to copy paste Collections and fix the change, is that needed anymore in 0.5 ?

gusty comet
#

Anyone else getting this error message while trying to resolve package dependencies for Entities 0.50?

Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities.Hybrid/GameObjectConversion/GameObjectConversionMappingSystem.cs(1093,36): error CS0030: Cannot convert type 'Unity.Entities.Chunk.<Buffer>e__FixedBuffer' to 'Unity.Entities.Entity*'
#
Library/PackageCache/com.unity.entities@0.50.0-preview.24/Unity.Entities.Hybrid/GameObjectConversion/GameObjectConversionMappingSystem.cs(1099,52): error CS0019: Operator '+' cannot be applied to operands of type 'Chunk.<Buffer>e__FixedBuffer' and 'int'
rotund token
#

Nope

#

what version of unity?

gusty comet
#

2020.3.31f1 (LTS)

rotund token
#

oh did 31 just come out?

#

i assume it doesn't break it

#

do you have custom package dependencies?

#

like on collections/maths/etc

gusty comet
#

As in specified in manifest.json?

rotund token
#

yes

gusty comet
#

Yeah, I'll get rid of them then

rotund token
#

haha this is a weird piece of code isn't it

#

var entities = (Entity*)chunk->Buffer;
public fixed byte Buffer[4];

#

but yeah should be fine

hot basin
gusty comet
#

Thanks guys!

#

@rotund token those packages no longer exist after upgrading Entities. I'll try downgrading to .30f1

rotund token
#

it would be amusing though if they broke it just 1 editor update later

gusty comet
#

Yeah that's just mean

hot basin
#

@rotund token as you upgraded some of your code, whats the best thing about 0.50? I read somewhere there is still no enabled/disabled state of components, so is there something really groundbreaking or just UX and QoL with some minor upgrades?

hot basin
#

i belive they did something similar in the past

rotund token
#

The profiler stuff is nice as well (I spend a lot of time optimizing so all these tools are really useful for me)

#

For most people though nothing will be ground breaking.

hot basin
#

do you have any info about plans for enabled/disabled feature?

rotund token
#

if I did I couldn't say!

#

though personally I'm not expecting it till after 1.0 (or ever 🤣)

hot basin
#

I mean if there was, i could missed something XD

gusty comet
#

@rotund token well darn Entities 0.50 broke your Event System package

Library/PackageCache/com.bovinelabs.event@1.2.2/BovineLabs.Event/Systems/ConsumeEventSystemBase.cs(13,5): error DC0058: All SystemBase-derived classes must be defined with the `partial` keyword, so that source generators can emit additional code into these classes. Please add the `partial` keyword to ConsumeEventSystemBase, as well as all the classes it is nested within.
rotund token
#

yeah you have to add partial to it

#

i've already fixed 2.0 in a 2.1 branch

#

i've fixed 1.2.2 in my work project (we use 1.X at work, but i personally only use the 2.x branch now)

#

i'll try find some time to upload a new 1.2.3 version that fixes it but yeah just copy it to the packages folder and unity will auto update it itself

gusty comet
#

Sure, I'll edit your code to fix the problems for now, but every time I modify package code the entire thing just regenerates. I have to do it twice each time

#

But for now you said to use the latest 1.x version?

rotund token
#

copy it out of library/packagecache

#

and put it in packages/

gusty comet
#

Ohhhh, thanks!

rotund token
#

i wasn't originally intending to update 1.X to 0.50 but it the only thing that actually broke was the unit tests and after fixing those everything pass first try

#

been using 2.X for a few months now and while it doesn't have the same test coverage I'm yet to have an issue with it

#

i'm just too lazy to write any documentation for it atm - also i'm too lazy to update my work project so i have to keep supporting it

gusty comet
#

Yeah that sounds like a ton of work. You're not obligated to maintain that... but it would be greatly appreciated

#

Ok, Unity is claiming ```
Packages/com.bovinelabs.event@1.2.2/BovineLabs.Event/Systems/EventSystemBase.Extensions.cs(244,38): error CS8377: The type 'T' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'

but you clearly constrained T like so 

public readonly struct Extensions<T>
where T : struct
{

rotund token
#

oh yeah actually

#

yeah i did have to make changes

#

all those need to be : unamanged now

#

a simple find and replace for

#

: struct
: unmanaged

#

anyway as i say, i'll try to get it up soon~ as i've already done all this work

gusty comet
#

Thanks a ton for the support!

safe lintel
#

Are either of you using any generic jobs in your projects and encountering play mode errors or issues with 0.5.0 ?

rotund token
#

yes i have a lot of generic jobs and systems

safe lintel
#

and after upgrading no issues?

tranquil jay
rotund token
#

i have a 2.X version of my event system i released it a good 6+ months ago but only on a git branch

#

it was designed in advance for 0.50 (and ISystem)

tranquil jay
#

Is the purpose of your events for DOTS to talk with Monos for things like collisions or what

rotund token
#

not really

#

it's to extract info out of jobs without having to worry about threading or safety

#

the most common us I use it for is a drawing library, but we also use it at work for telemetry etc

hot basin
safe lintel
#

hush you! was on mobile in the kitchen 😊

hot basin
#

can it be used in some different way?

safe lintel
#

I took a stab at updating the anim package to 0.50, its actually just those generic structs need to be unmanaged and an asmdef change but it silently fails on play, nothing happens unfortunately

hot basin
#

I wonder if I should use more interfaces

safe lintel
#

though on exiting playmode I get InvalidOperationException: Reflection data was not set up by a call to Initialize() and was wondering if you ran into this with any of your upgrades @rotund token

rotund token
#

hmm I saw a lot of errors but I don't ever recall seeing that

hot basin
safe lintel
#

I think its actually dataflowgraph which didnt have any compile issues that I can recall

#

anim package has those things

hot basin
#

so probably this with constantly changeing API of DOTS is main reason animation package is moved in time

safe lintel
#

dont need compute either, can do vertex skinning which is what I use currently. actually both compute and vertex are the same performance for me in the samples

hot basin
#

I mean I'm also using vertx shader for skinning

#

but I need instance data

#

and I send it by ComputeBuffer

safe lintel
hot basin
#

I don't remember either

#

I have my own custom solution

#

still not integrated with HR but I think I know how and it shouldn't be hard

#

main problem is how to feed animation data arrays into proper material before anything renders

safe lintel
#

is your shader shadergraph or code?

hot basin
#

I could bake them to textures but is seems cumbersome in handling

#

shadergraph with custom code node for skinning

safe lintel
#

oh

#

I did use shadergraph as a reference for mine, but it might be easier to look at joachim's gpu package if you havent already.

hot basin
#

I think I did, and I found older unity test of gpu instancing also I think

#

I did it this way to let artist do their stuff in shader graph

dull copper
#

btw, regarding GDC DOTS talks

safe lintel
#

you going @dull copper?

dull copper
#

nah

#

would be crazy expensive to go from here

#

plus I'm not fond of current covid situation still

#

also not too fond of the GDC monetization scheme either 😄

safe lintel
#

would love to go and ask questions

light badger
#

Question regarding Animator and Hybrid Components:

I've barely ever had to deal with hybrid DOTS before, but now with the animation package removed, I have no choice but to make my animated character hybrid

I was under the impression that simply drag n dropping a GameObject with a mecanim Animator component in a subscene would just work, but it looks like the mesh has no animation when I do this. Same problem if I instantiate the mesh at runtime via an ECB. But it does work if I don't put it in a subscene

Does anyone know what the hybrid workflow should look like, to get Animator to work on a converted Entity?

rotund token
#

imo your best approach is to just separate the entity converted part with the presentationg gameobject
have a 'key' on an entity component which references X gameobject then instantiate the gameobject (and bind it) at runtime

#

just keep a very basic separate presentation gameobject with renderer, animator, etc

#

that said, i've done a lot less experimentation with hybrid approaches but i believe the dots shooter demo did something like this and that's the approach i'm looking at going forward if i can't implement or don't have the time to implement a pure animations solution myself

safe lintel
#

@light badger what tertle said is more or less what I did. doesnt work in subscenes, kind of a fiddly mess. https://gfycat.com/unitedpoliticalasianporcupine it works, though its obviously not performant, and quite honestly I hate mixing monobehaviours(since you cant really avoid it for some animator callback stuff) with dots. end up writing a lot of intermediary systems just to communicate crap back and forth. that gif is from 2020 😩 fuck me cant believe been waiting so long just to wait even longer

#

also if its not clear, that is a pure ecs player/weapon and unity physics driving the collision + ragdoll for the mecanim enemies

tribal juniper
#

sorry @safe lintel it seems to be some damn problem with the unity dots. i found a solution in the forum for this and now everything works perfectly.

unkempt silo
#

does anyone know why unity apparently can not find these packages? although it recognises them AND links me to the changelog?

uncut rover
#

0.50 version of these packages are released. any particular reason you need those older versions ?

#

also what unity version are you using ?

unkempt silo
#

2021.2.19f

#

the reason I wanted them was so I could use DOTSNET

uncut rover
#

ok, I would recommend using all dots packages in 0.50 with unity 2020.3.30f1

unkempt silo
#

ok, why's that?

uncut rover
#

because older version were said not to be supported with unity 2021. Some made it work but no guaranty from unity. DOTS is already "fragile" as it is, I would not move away from the recommended version support.

#

the 0.50 includes the "essentials"
com.unity.entities
com.unity.rendering.hybrid
com.unity.netcode
com.unity.physics
com.havok.physics

unkempt silo
#

Ok thank you

#

I think I might do thatr

unkempt silo
#

what about 2020.3.31?

#

@uncut rover

uncut rover
#

should be good I suppose

unkempt silo
#

thats the one sitting there in my unity hub

haughty rampart
#

works

unkempt silo
#

@uncut rover I just grabbed the one that it says. Thanks for your help

tribal juniper
haughty rampart
#

you just used an invalid allocator. that's dangerous

tribal juniper
karmic basin
light badger
# karmic basin Hey, out of curiosity, is it `Rival` related ?

yes, I've started working on the update to 0.50. There are quite a bit of breaking changes, but the majority affect the samples project and not the core CC itself:

  • need a Hybrid replacement for animation
  • some Netcode stuff needs to change
  • Physics dependency handling has changed (as far as I remember, this is the only major thing that will need a manual fix in the CC user code)
devout prairie
#

I wonder the scope of manually porting the animation package to 0.5

#

TurboMakesGames has just posted a vid for anybody looking for an overview of 0.5 ( easier than trawling through discussions hehe ):

light badger
# devout prairie Argh, this is pain.. i hope you continue to include the option of using the ani...

I know it's disappointing, but for now I'll have to stick to Hybrid for animation. Trying to maintain the DOTS anim package may end up being more support work than I can handle, and for an asset store product I think it's important to use stuff that is as "standard" as possible...

But Unity did mention in the thread that there is still a plan to have a DOTS anim package eventually. As soon as this comes back, I'll change the animation handling again

One thing to remember though is that the animation handling in Rival is only in the samples; not in the core controller. So if you want to attempt using the old DOTS animation package with Rival, you may still be able to make it work

dense crypt
#

I'm working on some custom 2D rendering and need my system to run in the editor and during runtime. I'm using assembly definitions and I'm kinda confused on how to split my system to allow it to run during both play & editor.

I'm kinda stuck on how to get the relevant camera(s). In editor I need access to UnityEditor.SceneView.camera, but in runtime I'd just grab Camera.main. Is the idea here that I would simply IFDEF all the parts of my code that requires editor? If so I'm not sure how I would combine that with assembly definitions??

haughty rampart
#

instead of #if UNITY_EDITOR you could also use [Conditional("UNITY_EDITOR")]

viral sonnet
#

Binding GOs to entities is not that complicated. I just wonder why Unity doesn't provide that feature. It's highly annoying to not have a standardized package for this

#

it's finally time to test 0.50 in my project. wish me luck 😄

#

Or rather I should say, why did Unity support that feature but then decided to remove it. It's like the left hand doesn't know what the right one does

safe lintel
#

yeah companion gameobjects are a bit wonky, like conversion and subscenes. not even sure if companion gameobjects are here to stay or not, would be nice to get further details on their plans for hybrid to try to work around current limitations

viral sonnet
#

Uhm ... World.GetExistingSystem<TRSToLocalToWorldSystem>() doesn't work anymore?

#

it's a struct ISystem now

#

and they haven't fixed their dependency order

#

The system NZSpellCasting.TargetInfoSystem reads NZSpellCasting.TargetMatrix via TargetInfoSystem:CalculateTargetInfo but that type was not assigned to the Dependency property. To ensure correct behavior of other systems, the job or a dependency must be assigned to the Dependency property before returning from the OnUpdate method.

#

damn

#
[UpdateInGroup(typeof(Stage1SystemGroup), OrderFirst = true)]
public partial class CompleteDependenciesSystem : ComponentSystem
{
    TRSToLocalToWorldSystem tRSToLocalToWorldSystem;
    private ExportPhysicsWorld exportPhysicsWorld;

    protected override void OnCreate()
    {
        tRSToLocalToWorldSystem = World.GetExistingSystem<TRSToLocalToWorldSystem>();
        exportPhysicsWorld = World.GetExistingSystem<ExportPhysicsWorld>();
    }

    protected override void OnUpdate()
    {
        exportPhysicsWorld.GetOutputDependency().Complete();

        foreach (var eq in tRSToLocalToWorldSystem.EntityQueries)
            eq.CompleteDependency();
    }
} ```
#

I had this system to fix the problem

#

For some reason TRSToLocalToWorldSystem doesn't complete on the next frame. I don't understand why

#

I always was under the impression that every system completes before the next frame but that wasn't the case even in 0.17

#

well, I'm stumped. No idea how to get the entity queries now from that system.

#

and it's sitting right here in the ISystem with private EntityQuery m_Query;

#

no getter of course because why would it?

unkempt silo
#

does hybrid renderer2 still require URP or HDRP?

safe lintel
#

yes

dull copper
#

"still"?

#

has Unity messaged they will bring built-in support back?

#

I thought they deliberately removed that

safe lintel
#

yeah @unkempt silo builtin has been removed permanently from the hybridrenderer

#

and isnt coming back

viral sonnet
#

holy shit, I'm having dependency problems left and right. seems entities doesn't like it when you .Complete() a job - I mean, how could there be any dependency problems with it?

devout prairie
#

i saw philsa made this comment, not sure if it's related:

viral sonnet
#

from where is this, think it's related but I have other components too so it's really weird

#

deactivated some systems and now others are crying with the same error but other components.

devout prairie
safe lintel
#

has anyone noticed the companion transform update system producing garbage? is a thing/bug with 0.17 but havent yet updated my own project to 0.50

viral sonnet
#

is anyone of you using .Complete()? it seem completely broken

#

systems in my stage2 system group complain that some comps used in stage1 system groups are not in the dependency chain

#

this worked totally fine in 0.17

safe lintel
#

is it relating to physics? does seem like there are new requirements for setting up dependencies there

viral sonnet
#

I'm having too much errors right now but this seemed to fix it for one system

#

no, it's related to my other systems too. basically everywhere where I .Complete() a job

#

after the job runs I'm doing some MonoBehaviour UI setup so that's why I'm using it

#

I need to find out what's going on but right now my hunch is that things break when Dependency is not assigned

#

like something gets assigned to Dependency regardless but then the dependency safety checker doesn't know that the job actually completed. something like that

safe lintel
#

ugh cant they fix this stuff?

viral sonnet
#

big fun to have shit like that after 1 year of waiting ... hope it's something I'm not doing right but the project ran fine in 0.17 so ...

safe lintel
#

thats in 0.50

#

well some hiccups while upgrading sort of come with the territory

viral sonnet
#

huh, what's actually producing the garbage? m_TransformAccessArray?

safe lintel
#

i guess? its directly proportional to the amount of companions you have

viral sonnet
#

ouch, not sure what can be done with that though other than caching

#

the whole Transforms package has been pretty bad thus far. no idea who writes this stuff

safe lintel
#

i think mike acton was/is architect of the transform system

viral sonnet
#

lol, well he shouldn't put that on his CV

rotund token
#

for example query.GetComponentArray<T> will break now unless you do query.CompleteDependencies() first (or use the proper GetComponentArrayAsync<T>)

#

that said, i don't know why you need so many completes?

#

i literally have 0 in my entire project

#

if you were doing hybrid work i can understand 1 before your hybrid presentation interactions

viral sonnet
#

i sure have some unnecessary completes but that shouldn't be a reason to break stuff.

rotund token
#

they shouldn't break things no

#

but that means something is broken about your dependency chain

#

you've dropped a handle or something

#

i found a whole bunch of safety issues when i updated our project at work

#

from code that was 2+ years old

#

i suspect some of it caused some very rare crashes we had

#

so the update and stricter safety has been really good for us

viral sonnet
#

yeah, must be something like it. just weird that 0.17 didn't complain. it had dependency checks in place and was pretty strict about it

rotund token
#

i think the update has also slightly change system orders if you didn't have strict ordering

#

so there are cases where things wouldn't have broken in the past just because they finished in time

#

but now they occur earlier or at a different time

#

(oh and there's just quite a bit faster main thread work now as well)

viral sonnet
#

wish me luck 😄 time to untangle the systems

rotund token
#

took me 14 hours

#

was not fun

#

so yeah gl, get a heavy drink

#

3 hours personal project, 11 hours work project. did personal first so took more time than it would if i had done it second

#

huge range of code gen issues did not help

safe lintel
#

🙄 ugh gc still exists in a build

#

how does this slip by

viral sonnet
#

damn, that's a lot of time :/

#

To guarantee safety, you must include Broadphase:PrepareStaticBodyDataJob as a dependency of the newly scheduled job. - Do you know how I'd get this dependency?

rotund token
#

are you using the new registerphysicsdependency()

#

you shouldn't have to worry about physic dependencies anymore

viral sonnet
#

not yet, I need to read up about this

rotund token
#

they basically copied my implementation

#

but i'm cool with that because it's great

viral sonnet
#

where would you put it, beginning of frame?

rotund token
#

OnStartRunning()

#

this.RegisterPhysicsRuntimeSystemReadOnly() or
this.RegisterPhysicsRuntimeSystemReadWrite()

#

is how you handle physics dependencies now

#

they also said yesterday they're going to expose the physics world via singleton (in 1.0 probably)

#

so we'll probably have to go through and redo all this again in a future update 😐

viral sonnet
#

Thanks a lot. Gonna try it

rotund token
#

this is just to enable the extension method

#

on the system

#

(systembase)

#

PhysicsRuntimeExtensions

#

is where the extension methods were written

viral sonnet
#

ok got it, Unity.Physics.Systems namespace. man, I'd have never known

rotund token
#

its in the upgrade guide

#

but its only a tiny note in the actual manual

#

so anyone who is just starting out going to have trouble

viral sonnet
rotund token
#

https://docs.unity3d.com/Packages/com.unity.physics@0.50/changelog/CHANGELOG.html

Upgrade guide

RegisterPhysicsRuntimeSystemReadOnly() and RegisterPhysicsRuntimeSystemReadWrite() (both registered as extensions of SystemBase) should be used to manage physics data dependencies instead of the old AddInputDependency() and GetOutputDependency() approach. Users should declare their UpdateBefore and UpdateAfter systems as before and additionally only call one of the two new functions in their system's OnStartRunning(), which will be enough to get an automatic update of the Dependency property without the need for manually combining the dependencies as before. Note that things have not changed if you want to read or write physics runtime data directly in your system's OnUpdate() - in that case, you still need to ensure that jobs from previous systems touching physics runtime data are complete, by completing the Dependency. Also note that BuildPhysicsWorld.AddInputDependencyToComplete() still remains needed for jobs that need to finish before any changes are made to the PhysicsWorld, if your system is not scheduled in between other 2 physics systems that will do that for you.
#

but it's under [0.7.0-preview.3] - 2021-02-24

viral sonnet
#

ah there it is! stuff is all over the place. thanks for letting me know!

#

huh, that was basically it. that physics thing tripped up the whole dependency chain and resulted in garbge errors that had nothing to do with it

rotund token
#

that's convenient for you

viral sonnet
#

well, I had an early out from my biggest system so I'm not really done yet 😄

#

oh, haha, well everything works now. that was quicker and much more painless with your help. thanks a lot again. you saved my a couple of hours.

worn valley
rotund token
#

i'm pretty sure unity's solution to a lot of the transform issue is IAspect in 1.0

#

when i was reading it it sound designed very specifically for the annoyances for transform

viral sonnet
#

did you notice any general performance improvements in 0.50 and what do you think are the bigger changes with 0.50? I haven't invested much time yet and apart from the great tools we have now it seems quite similar

rotund token
#

actually i was about to benchmark my entities 0.17 version

#

i'll let you know if there are improvements in like 5min!

#

on an actual released game

viral sonnet
rotund token
#

(that is a huge mess and terribly coded) - so a great real world example!

viral sonnet
#

oh wow! haha nice timing then. good luck!

#

setting up the pointer every frame is freaking fast

rotund token
#

no difference 😄

viral sonnet
#

😦

rotund token
#

if anything, 1% lower fps
this is not very scientific though, just loading the same seed between 2 different builds

#

but yeah i didnt expect it in this project tbh

#

it's mostly capped by legacy monobehaviour code

worn valley
rotund token
#

i'll have to test on xboxone/ps4 as they are actually capped more by internal entity performance

#

but yeah seeing no different on windows

#

pretty sure last time i checked though, this project was garbage and had 86-91% idle time in my worker threads

#

oh wait i just remember this isn't a fair test, there might be some advantages on new entities

#

since it now has this debugging system every frame

#

in development builds

#

which the old one doesn't

#

i don't have release builds to compare atm

viral sonnet
#

This is what I'm using right now. The solution came from the need for a fast target system and random lookups being slow with struct copies

rotund token
#

i'm surprised burst treats this any different to just using the native array

viral sonnet
#

so now I'm just copying the pointers to the TargetMatrix and overall it was quite an improvement

#

ah, so if it has around the same timings it's actually around 1.6ms faster?

rotund token
#

yeah i pretty much left is new entities, right is old entities

#

that yellow strip at the bottom is the recording system

#

0.75-1.5ms/frame

#

but it's kind of hard to say

#

i'm very gpu capped here

#

got a good 3ms wait on gpu every frame

#

i have a 3900x but only a 1060gtx

#

though im testing this on min graphics and low res so i'm surprised it's still capped

#

anyway anecdotally i'd say at best it's a few % better by default. we haven't applied any new optimizations to our code (caching ComponentTypeHandles or using ISystem etc)

viral sonnet
rotund token
#

3900x its a few years old cpu now

#

i nearly bought myself a 3080gtx yesterday, they are like super cheap all of a sudden

#

was as low as $1100AUD (They were $1800AUD 2 months ago)

#

but who needs a graphic card

#

i just look at numbers all day 😄

#

good old capsule all i need for my player

viral sonnet
#

lol, that's the ryzen, not the geforce 😳

safe lintel
#

"cheap" 😅

viral sonnet
#

haha, right 😄 my 1080 is still working fine. gonna check the prices now, I'm like, when was it released? - 2 years ago and waiting for prices to drop

rotund token
viral sonnet
#

here it's still double the msrp

#

fucking europe

rotund token
#

they had 3060ti for $650, 360 for like 550?!

#

(aud)

#

1100 aud like 735 euro i think

viral sonnet
#

covid turned the gpu market even more to shit than the crypto miners

safe lintel
#

i actually did just pick up a 3060 from newegg at 400usd and ive been seeing stock alerts way more frequently so I do hope the market for them crashes finally

viral sonnet
#

if you think it can't get any worse ...

rotund token
#

yeah last month prices are tumbled though

viral sonnet
#

cool to hear, hope the prices soon cascade to us

#

ps5 is also totally sold out and double the price

rotund token
#

oh yeah cant get that here

#

at least not easily without a wait

#

but im not a console gamer (even though i've spent most of the last year doing console dev -_-)

#

it took us over a year to get a dev kit delivered...

viral sonnet
#

me neither, except when there's a game I really want. like bloodborne for ps4. basically why I even got one 😄

#

from sony? wow, that's a long time

rotund token
#

anyway way off topic, how good its ijobentity 😄

viral sonnet
#

I'm afraid I'm an IJobEntityBatch snob

rotund token
#

oh yeah i mostly use ijobentitybatch

#

im not a fan of entities.foreach

safe lintel
#

is there any reason not to use ISystem now? have they been improved since 0.17?

viral sonnet
#

Need to do some testing. All the job types before had some small differences in performance

rotund token
#

but for jobs that don't need chunk level optimization i have ijobentity now

viral sonnet
#

It's really nice to get rid of the boilerplate code

#

although I got so fast at typing it that I honestly don't care that much

#

much of Unity.Transform has been rewritten to ISystem now. Good place to look at when I start writing them myself

#

They seem largely fine now from what I heard but the most interesting thing is how they compare to a class SystemBase

#

IJobChunk, IJobEntityBatch, IJobEntityBatchWithIndex, and IJobParallelForDefer now have ByRef() versions of all .Schedule() and .Run() methods. These should be used in cases where the corresponding job struct is too large to pass by value to the existing methods (~10KB or larger). Functionality is otherwise the same as the existing methods.

safe lintel
#

I havent yet found any uses of updatebefore/after with them, I recall that not working prior

viral sonnet
#

This sounds interesting, I don't think I have a job struct that large. Some are rather big though

#

Could be a nice optimisation to use even with smaller structs. ByRef mostly paid off

#

and I'm not sure how this gets treated for multi threading. AFAIK the job struct gets copied to every worker thread. so with this, the same struct is used?

rotund token
#

yeah that could cause issues if you weren't careful

viral sonnet
#

my project has no differences in performance.

#

the archetype view is pretty great. to see all the bytes that are used up by each comp is really cool

rotund token
#

the journal is really interesting

#

but atm only accessed via breakpoints

#

but you can see the huge amount of interesting data that it records

#

and i expect tooling will come with it in the future

#

(or users will develop tooling from it)

#

also the profiler stuff is useful

viral sonnet
#

just got around to the journaling. pretty cool indeed. Without tools though, I don't know how helpful it actuall is

#

for something like networking it's a lot more useful I guess

unkempt silo
#

ok ive got 2020.3.30

#

cant see hybrid renderer

viral sonnet
#

you should be able to add it with the package manager. + icon -> from git url: com.unity.rendering.hybrid

#

missed opportunity that the Systems window is not linked to the profiler timeline

safe lintel
#

really want some damn buttons on the main editor that opens these various windows

rotund token
#

just bind hotkeys to them?

#

it's kind of nice you can just bind hotkeys to anything

#

personally i just have most of them docked permanently

safe lintel
#

theres lots of other windows and things I use often but not quite enough to bind to hotkeys but dislike hunting for them inside dropdown menus

#

i appreciate the hotkey tip though, for dots windows I will hotkey em

rotund token
#

i really should unbind the ctrl + X keys for the default windows

#

i literally never use those hotkeys

#

and they could be so useful for other tings

safe lintel
#

certain things like renderpipeline asset, should be a button somewhere that brings it up. I feel that theres wasted opportunity to allow for more editor visual customization(and customizing the top area with the play buttons is not just like making any old editor script)

rotund token
#

(and customizing the top area with the play buttons is not just like making any old editor script)
i actually wrote a script to easily add buttons there, dropdowns or anything there

safe lintel
#

like maya or zbrush, can turn literally any editor function into a custom button on the shelf or palette

#

dont suppose its on github or posted somewhere?

rotund token
#

like this is my work project where i injected a drop down to change game modes or skip startup

#

it was based off someone elses work from a previous version of unity

#

let me see if i can find it

#

i probably can't post it because it's technically work code

#

but it's basically based off this

#

it seems like they've updated for recent support

#

so should work fine

safe lintel
#

oh yeah reason I tend to need to open the entities window often was at least prior to 0.50 it was terrible for performance

rotund token
#

thankfully that's improved a lot

#

at least from my limited testing

safe lintel
#

alright removed all traces of animation 😒 lets see how this upgrade goes

rotund token
#

so something i haven't really seen mentioned

#

NativeArray<int> array = CollectionHelper.CreateNativeArray<int, RewindableAllocator>(5, ref World.UpdateAllocator);

#
    /// An allocator that is fast like a linear allocator, is threadsafe, and automatically invalidates
    /// all allocations made from it, when "rewound" by the user.
    /// </summary>
    [BurstCompile]
    public struct RewindableAllocator : AllocatorManager.IAllocator```
safe lintel
#

i have no idea why one would need to rewind an allocator?

rotund token
#

so based off the sample it doesn't need deallocating

#

i think based off the fact it's called World.UpdateAllocator

#

it just clears after each update

#

so you don't need to schedule dispose methods after your jobs, it's just handled for you

#

they used it in this example

    {
        // Calculate amount of entities in respective queries.
        var boidCount = m_BoidQuery.CalculateEntityCount();
        var obstacleCount = m_ObstacleQuery.CalculateEntityCount();
        var targetCount = m_TargetQuery.CalculateEntityCount();

        // Allocate arrays to store data equal to the amount of entities matching respective queries.
        var cellSeparation = CollectionHelper.CreateNativeArray<float3, RewindableAllocator>(boidCount, ref World.UpdateAllocator);
        var copyTargetPositions = CollectionHelper.CreateNativeArray<float3, RewindableAllocator>(targetCount, ref World.UpdateAllocator);
        var copyObstaclePositions = CollectionHelper.CreateNativeArray<float3, RewindableAllocator>(obstacleCount, ref World.UpdateAllocator);

        // Schedule job for respective arrays to be stored with respective queries.
        new CopyPositionsJob { CopyPositions = cellSeparation}.ScheduleParallel(m_BoidQuery);
        new CopyPositionsJob { CopyPositions = copyTargetPositions}.ScheduleParallel(m_TargetQuery);
        new CopyPositionsJob { CopyPositions = copyObstaclePositions}.ScheduleParallel(m_ObstacleQuery);
    }```
#

no disposes

robust scaffold
#

"automatic". But still, woah

rotund token
#

why is their slab and stack allocator internal 😦

#

i basically wrote my own versions of these before and was hoping to replace them with this

safe lintel
#

so much for using StreamBinaryReader too

rotund token
#

they even use 2 allocators alternating to avoid end frame syncs

        {
            var UpdateAllocator0 = (RewindableAllocator*)UnsafeUtility.AddressOf<RewindableAllocator>(ref UpdateAllocatorHelper0.Allocator);
            var UpdateAllocator1 = (RewindableAllocator*)UnsafeUtility.AddressOf<RewindableAllocator>(ref UpdateAllocatorHelper1.Allocator);
            UpdateAllocator = (UpdateAllocator == UpdateAllocator0) ? UpdateAllocator1 : UpdateAllocator0;
            UpdateAllocator->Rewind();
        }```
#

(Well it seem to reset in Initialization so I guess start frame syncs)

viral sonnet
#

That's funky to alternate two of those. I don't get it though 😄 Can someone explain?

rotund token
#

because then your previous frame jobs would have to be Complete() instead of allowed to run into the next frame

safe lintel
#

oh god its so painful adding partial one by one and it compiles

safe lintel
#

yeah i guess i have too many compile errors but that option doesnt show currently

river lake
#

ah probably too late but that means the partial isn't the problem yet 😄

#

i think most people just didn't update to 2020.3.30 before updating dots

safe lintel
#

hmm will try doing all the physics stuff first

rotund token
#

are you in safe mode?

#

the menu won't show in safe mode

#

i was basically able to enable this menu straight away even with 1000+ compile errors

safe lintel
#

nah out of safe mode now

#

i could delete the library but not convinced it would change things, ive restarted a few times so just gonna keep going

#

at least try to do all the physics stuff and see if it changes anything

#

ok well physics aint it

#

welp

#

suppose its not like transitioning off of IJFE

#

its also enlightening to see how many systems i dont use anymore but keep around

river lake
#

did anybody try using the [GenerateAuthoringCompoenent] attribute with unity's field attributes (NonSerialized, Header etc)?

safe lintel
#

I kept getting burst not in asmdef in my GenerateAuthoringComponent files even when it was included

#

just removed the decorator but wondering how much i screwed up my project in doing so

river lake
#

ahh yours is probably a diff issue haha

#

my unity attributes aren't getting copied over with the generated authoring components

#

not sure if it's just me

safe lintel
#

what exactly is codegen adding to systems now that require partial?

river lake
#

there's a temp file under your projects folder where u get to see the output

#

i was hoping it was easy to customize but ayy

safe lintel
#

crap just unity entities errors now

#

hm removing memory profiler package fixed it, maybe it needed a restart or something

river lake
#

gratz

#

now you get to fight codegen for the next boss

safe lintel
#

nope it finally plays!

#

and its utterly broken lol

#

and gotta wake up early tomorrow too 🛌

unkempt silo
#

So the dots animation package is not usable with the new 0.50

#

would it still be reasonably easy to adapt a baked vertex animation is the hyrbid renderer?

eager pawn
#

which unity version for entities?

#

2020 LTS? ://

#

2020.3,30?

light badger
#

Anyone else getting an endless spam of Internal: deleting an allocation that is older than its permitted lifetime of 4 frames whenever the Netcode package is present in the project? I tried a fresh new 2020.3.30 project with the Entities, Physics, HR and netcode packages, and repro'd the issue

safe lintel
#

i just read a thread stating it might be something to do with the framerate?

#

most recent thread in the netcode subforum

robust scaffold
worn valley
tranquil jay
#
The system TUK.Arena.Systems.OnHitDoDamageSystem writes TUK.Arena.ArenaHealthComp via OnHitDoDamageSystem:OnHitDoDamageSystemJob but that type was not assigned to the Dependency property. To ensure correct behavior of other systems, the job or a dependency must be assigned to the Dependency property before returning from the OnUpdate method.```
#

After upgrading to 0.5, I am getting this spammed, I don't understand what it wants >.> help please

rotund token
#

you need to write to Dependency

rotund token
tranquil jay
#

commandBuferSystem.AddJobHandleForPRoducer(Dependency ); ?

rotund token
#

Dependency = job.Schedule(X, Dependency);

#

this line here

#

you are only writing your jobhandle to a local variable

#

not back to the system

tranquil jay
#

but I don't have a jobHandle anymore to speak of

#
InvalidOperationException: The previously scheduled job Solver:ParallelApplyGravityAndCopyInputVelocitiesJob writes to the Unity.Collections.NativeArray`1[Unity.Physics.Velocity] ParallelApplyGravityAndCopyInputVelocitiesJob.InputVelocities. You are trying to schedule a new job OnHitDoDamageSystem:OnHitDoDamageSystemJob, which reads from the same Unity.Collections.NativeArray`1[Unity.Physics.Velocity] (via OnHitDoDamageSystemJob.EventReader.m_InputVelocities). To guarantee safety, you must include Solver:ParallelApplyGravityAndCopyInputVelocitiesJob as a dependency of the newly scheduled job.
Unity.Jobs.LowLevel.Unsafe.JobsUtility.Schedule (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters) (at <3be1a7ff939c43f181c0a10b5a0189ac>:0)```
rotund token
#

have you registered your dependency with the physics system?

#

using the new
this.RegisterPhysicsRuntimeSystemReadOnly();

tranquil jay
#

O_o I have not, i used to commandBuferSystem.AddJobHandleForProducer(jobHandle);

rotund token
#

that's not for physics

#

that's for command buffer system

#

previously you should have been getting output dependency of the physics system and making your job depend on it

#

but now you need to call this.RegisterPhysicsRuntimeSystemReadOnly(); (in OnStartRunning)

tranquil jay
#

Thanks @rotund token ❤️ ❤️ ❤️

tranquil jay
#

After 0.5 update, HideInInspector no longer has any effect :/ I don't wanna make multiple manual authorings just to hide a property or two. Anybody reproducing this?

    [GenerateAuthoringComponent]
    public struct ArenaFadeOutThenDestroy : IComponentData
    {
        [HideInInspector]
        public float timeCurrent;
    }
still violet
#

Starting a new project with DOTS. Is Version 0.17.0-preview.42 the most recent?

#

For the Entities package

coarse turtle
river lake
#

was pretty surprised no one was talking abt it, thought i was the only one using that [GenerateAuthoringComponent] attribute :X

tranquil jay
gusty comet
#

So I just saw that dots finally got some supposedly big update?

tranquil jay
#

@gusty comet Yup, 0.5 but it's a little buggy

gusty comet
#

I do not mind if its a little buggy I was honestly having no hope that DOTS was getting any updates. So anything is welcome at this point.

white island
#

has the way you spawn entity archetypes changed at all?

tranquil jay
#

While playing with material property and having fun at it, I started getting these errors, and my shaders are borked as you can see in the screenshot. Those are thin boxes bundled up into a big square, but it looks like the normals are flipped...

I tracked down the SRP compatibility and my super simple Shader Graph looks to be compatible but I still have issues. May I ask for help once more?

A Hybrid Renderer V2 batch is using a pass from the shader "Shader Graphs/WoodenShardSG", which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.
 public struct ColorMaterialProperty : IComponentData
 {
     [HideInInspector]
     public float4 color;
 }```
eager pawn
#

ig it's back to... upgrade again LOL

#

nevermind there is no 2021 LTS yet... ig it's coming soon?

#

gotta wait until Q2 ohh ok

rustic rain
#

new update? poggie woggie?

nocturne dust
rustic rain
#

why?

nocturne dust
#

I just can hear those words and see the visuals with that....

rustic rain
#

poggie woggie

#

🙂

nocturne dust
#

uhhhhhm the painnnnnnnm the suffering

haughty rampart
tranquil jay
haughty rampart
#

yeah but why is it going into alpha?

tranquil jay
haughty rampart
tranquil jay
#

tried with and without

haughty rampart
tranquil jay
haughty rampart
#

no idea what's happening there. if they're default boxes...

#

actually, might it be you are using the builtin render pipeline?

tranquil jay
#

URP

#

I downloaded the ECS URP Sample project and will dig there, maybe copy paste some stuff, see if there's a setting somwere

split cedar
#

where can i start with the DOTS thing, like one of those stupid tutorials where monkeys could understand... need such a tutorial XD

dense crypt
# split cedar where can i start with the DOTS thing, like one of those stupid tutorials where ...

You will have to do a lot of digging yourself so you're not off to a good start 😅
Also if you're not already very comfortable with Unity & C# I would highly advice against it. Anyway the docs for primer: https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/index.html

TurboMakesGames has some decent tutorials https://www.youtube.com/c/TurboMakesGames

Keep in mind it's experimental tech so a lot of stuff has changed since most videos/posts were made.

split cedar
#

im familiar with unity and c# but never touched dots

dense crypt
half jay
#

i tried to upgrade my project for IOS/Android to 0.50. Im on Unity 2020.3.21LTS. After Updating packages i have trouble with Platform Android package. Looks like its require 0.10.0 (i cant install higher) and on this version im getting error

Library\PackageCache\com.unity.platforms.android@0.10.0-preview.10\Editor\Unity.Build.Android\Components\AndroidKeystore.cs(12,25): error CS1929: 'HierarchicalComponentContainer<BuildConfiguration, IBuildComponent>.ReadOnly' does not contain a definition for 'GetBuildTargetGroup' and the best extension method overload 'BuildTargetExtensions.GetBuildTargetGroup(Platform)' requires a receiver of type 'Platform'
karmic basin
#

and platforms-specific packages disappeared now

#

you only need the main com.unity.platforms package

dull copper
#

was this here already?

#

there will be DOTS Q&A livestream session on GDC livestream day one

#

hmmm... "We’ll be streaming with some of our amazing creators for 3 days from March 23-25"

#

so I guess that DOTS Q&A will be on Wed

gusty comet
#

I thought roadmap was at day 1

#

are they not going to stream that session? 🤔

dull copper
#

they really do their best on making it confusing

#

roadmap schedule is only clearly communicated on this:

#

@gusty comet

#

but even that misses mention of the timezone (but it's San Francisco time)

gusty comet
#

well, that killed most of my enthusiasm 😩

#

Thanks for the clarification though! 👍

dull copper
#

we might get slides earlier but will see

dull copper
#

I honestly don't get who thought it was good idea to label those days like that

tranquil jay
#

Hi, I am returning with the following issue, due to not being able to find any solution.

Situation: My kinematic car drives on the road and hits a Box entity which "shatters it."
Goal: Shattering the box will result in instantiating from a Entity (Stored as a GameObject prefab) that has no components on it but it does have multiple children with dynamic physics and mesh on it. The system that does the spawning has to exist after the physics system because the car hits the box, which results in the shards being created after the collision

Issue: Regardless if I spawn the parent, or spawn each individual child, the children are spawned at 0,0,0
Attempts:

  1. Spawn and set position of parent, or individual children, still they go to 0,0,0
  2. Spawn the child, and recalculate position and rotation, they still go to 0,0,0
  3. Attempted to split creation of the children before Physics, so that whatever SET(0,0,0) does it's thing, and set them to my intended position/rotation after physics. Failed because I can't figure out how to have two CommandBuffers play nice with the same dependency.

This url was a promising solution but ultimately I could not succeed: https://forum.unity.com/threads/properly-moving-teleporting-a-physics-entity-with-its-children.874315/#post-5843251

My system: http://pastie.org/p/1p0wgyTXzbR0cCut9D1Xdt

coarse turtle
#

was there a setting that allowed us to edit the chunk size within Entities? I can't remember if that was possible in earlier iterations

hot basin
#

can I somehow apply textures from jobs?

safe lintel
river lake
trim lotus
#

Hi, I am new to DOTS but am trying to use it to increase performance for my Mobile game.
I have up to 2,000 objects from class 'ConsumableObject' that I use their Update() functions every frame. I also have a couple more classes that are children of this 'ConsumableObject' class.

I have a struct I made inside the 'ConsumableObject' class. This struct is called 'Data'.
Inside of a ConsumableObjectsManager class, it handles all the job's functionality. This class also contains the NativeArray of 'ConsumableObject.Data' for the jobs to run.

I fill this NativeArray whenever a new Level is loaded in, in my game and it does a FindAllObjects of type 'ConsumableObject', converts the Array into a List, and then parses it into the NativeArray.

I can post more code of these if needed.

However, the question I ask is; I am getting an error upon Level loading that says:

#

Any help would be greatly appreciated!

rotund token
#

or any managed data (arrays, strings*, etc)

trim lotus
#

Oh okay, how would I go about doing something like this? I used a class in the native array because I saw someone else do it

rotund token
#

ConsumableObject.Data needs to be a struct

trim lotus
#

Data is a struct inside of the ConsumableObject class

#

oh wait, sorry, hold on

#

so Data itself should be a struct inside of the ConsumableObject class, and then it should work?

rotund token
#

as long as Data doesn't have any managed data on it

trim lotus
#
public struct Data
    {
        // STORE DATA THAT ISNT TO BE CHANGED VIA INSPECTOR
        [Header("Consumable Object")]
        // Consumable Object
        private ConsumableObject consumableObject;
        
        private Vector3 staticPosition;

        public float yOffsetTrigger;
        private Transform transform;

        public MMFeedbacks feedbacks;

        // Constructor
        public Data(ConsumableObject _ConsumableObject)
        {
            transform = _ConsumableObject.transform;
            feedbacks = _ConsumableObject.GetComponentInParent<MMFeedbacks>();

            staticPosition = Vector3.zero;
            yOffsetTrigger = 0.5f;
            
            // Consumable Object
            consumableObject = _ConsumableObject;
        }

        // Update
        public void Update()
        {
            if (!consumableObject.isConsumed)
            {
                // Check the Y positional difference
                if (transform.position.y <= staticPosition.y - yOffsetTrigger)
                {
                    consumableObject.OnObjectConsumed();

                    if (consumableObject.feedbacks != null)
                    {
                        consumableObject.feedbacks.PlayFeedbacks();
                    }

                    consumableObject.isConsumed = true;
                }
            }
        }
    }
#

This is what the struct looks like currently

rotund token
#

yeah you can't have this

#

private ConsumableObject consumableObject;
private Transform transform;
and probably this since i assume it's a class
public MMFeedbacks feedbacks;

#

no classes

trim lotus
#

Ah so they can only be native values

#

How would I go about handling these other functionalities then?

trim lotus
#

Using these non-native classes

#

and references

rotund token
#

no references!

trim lotus
#

Would I use them outside of the struct, like normal monobehaviour?

rotund token
#

you can't use them in burst jobs
you can use
bool, sbyte, byte, short, ushort, int, uint, long, ulong, float, double, boolX, uintX, intX, floatX, enums, structs and pointers

#

structs/pointers include stuff like the native containers NativeArray, NativeList, etc

#

i would highly recommend trying to understand how to develop in a data oriented way and the limitations before you try to port existing code

#

you need a very different mindset to the OOP you'd be use to

trim lotus
#

Yeah, I understand. I have seen and do have some basic knowledge of the different mindset needed when programming in this way and considering how the compiler works, etc. I wanted to just sort this very first part out before delving further as I may not need to after this.

So, just to be clear for my understanding, I am still a little confused about if I shouldnt be using Jobs for this particular class

#

Is it still possible to, and if not, do I just do the needed functionality outside of the Data struct and in the Monobehaviour class that its still stored in?

rotund token
#

nothing in your Update function can be done in a job at the moment

trim lotus
#

Thats unfortunate. So I can only really use it on classes that contain completely native variables?

rotund token
#

yes that's the limitation of the burst compiler

#

but this limitation is what makes it fast

trim lotus
#

Okay, thats understood. Thank you for helping me!

#

But its still possible to change my code in a way that only uses Native values and then have another script outside that performs checks or something, and then performs appropriate functionality that way?

rotund token
# trim lotus But its still possible to change my code in a way that only uses Native values a...

there's nothing stopping you writing a job to process this, something like

{
    public bool IsConsumed;
    public Vector3 Position;
}

[BurstCompile]
public struct WasConsumedJob : IJobFor
{
    [ReadOnly] public NativeArray<Data> Data;
    [WriteOnly] public NativeArray<bool> WasConsumed;
    
    public float YOffsetTrigger;
    public Vector3 StaticPosition;

    public void Execute(int index)
    {
        var data = Data[index];

        if (!data.IsConsumed)
        {
            // Check the Y positional difference
            if (data.Position.y <= StaticPosition.y - YOffsetTrigger)
            {
                WasConsumed[index] = true;
            }
        }
   
    }
}```
trim lotus
# rotund token there's nothing stopping you writing a job to process this, something like ```p...

Ahh okay! This is great. I was thinking that I may have to do things this way. Basically still optimizes the script. Thank you for writing this up however. I do have a question. I see that in the Data struct, it is outside of any class. Would I just put this into my ConsumableObject class or does it have to be seperate still? Because if so, then how do I update the Position variable? Thanks

half jay
#

is there an easy way to update systems with partial keyword ?

tranquil jay
tranquil jay
rotund token
#

😅
i had a look at your code before but it's too messy to know what's happening with all the alternatives

#

and it has no indication of what your prefab was or how it was converted which is probably the more important part

rotund token
eager pawn
#

if i want exactly 1 shop, would i just make it a regular class and not an entity?

#

entities are things, never just a singular thing?

uncut rover
#

You can have a singleton entity

eager pawn
#

why would i tho?

uncut rover
#

Depends on your use case I guess. For me I use singletons entity to store blob asset reference of "cached" data. so it ocntains all data I need i my system for abilities (base attack, cooldown, cast time, range,...) for a shop I guest you could use it to store the list of items with the price and so on

#

is it a IAP shop or an in game "merchant" ?

eager pawn
#

i was thinking of this.. i have a GameHandler that creates one Shop, of course, the shop code could just go directly inside the GameHandler code, but i wanna separate it. The Shop then would be responsible for using the EntityManager and create a Entity with a ShopUnitComponent and populate a NativeHashTable with all entities holding said component

#

sorry im new to ecs i hope that makes sense?

#

what's IAP?

tranquil jay
# rotund token and it has no indication of what your prefab was or how it was converted which i...

My prefab is set as a reference into a Entity property in an authoring component.
I want to spawn that prefab and it's children at the collision point around (0,0,-4000)
Regardless if I spawn the prefab, or I individually spawn the children, they get reset to around (0,0,0)

I have a feeling it has something to do with LocalToWorld and WorldToLocal having different values and the physics systems (next frames) override my Translation.

A fix could be spawning them (next frame) before the Physics and setting the Translation AFTER them, but I dont know how to have two entityCommandBuffers with

    //TODO: move this into the struct;
    BufferFromEntity<LinkedEntityGroup> entityGroups = GetBufferFromEntity<LinkedEntityGroup>( true );

    for( int spawnIndex = 0; spawnIndex < doSpawnComponent.Length; spawnIndex++ )
    {
        //Prefab and spawn;
        Entity prefab = doSpawnComponent[ spawnIndex ].prefab;

        DynamicBuffer<LinkedEntityGroup> entityGroup = entityGroups[ prefab ];

        for( int spawnChildIndex = 0; spawnChildIndex < entityGroup.Length; spawnChildIndex++ )
        {
            Entity childPrefab = entityGroup[ spawnChildIndex ].Value;
            
            Translation _pos = GetComponentDataFromEntity<Translation>( true )[ childPrefab ];
            Rotation _rot = GetComponentDataFromEntity<Rotation>( true )[ childPrefab ];

            Entity spawn = entityCommandBuffer.Instantiate( entityInQueryIndex, childPrefab );

            _pos.Value += translation.Value;
            _rot.Value = rotation.Value.value + _rot.Value.value;
            
            //Translation;
            entityCommandBuffer.SetComponent( entityInQueryIndex, spawn, _pos );
            Debug.Log( $"  - child {_pos.Value}" );

            //Rotation;
            //    if( doSpawnComponent.doIgnoreRotation == false )
            //    {
            entityCommandBuffer.SetComponent( entityInQueryIndex, spawn, _rot );
        }
    }
uncut rover
# eager pawn what's IAP?

IAP = In App Puchase. in game item for $/£/€. so not your case. (I would have said to not use DOTS in IAP case 😉 )

eager pawn
#

also you mentioned baseAttack... that would be a constant right, im a bit confused as to where i should put my constants with ECS

#

do you just make a [ReadOnly] int baseAttack or whatever?

uncut rover
#

yes it is a constant. If you have static (constant) ready only I would advise to use BlobAsset

rotund token
eager pawn
#

ok ill read about blob assets

rotund token
# tranquil jay My prefab is set as a reference into a Entity property in an authoring component...

i'm literally doing something quite similar here atm

                {
                    var prefab = assetRegistry.FindEntityPrefab(fractures[i]);
                    var shardEntity = this.CreateFractureShard(batchIndex, prefab, parentTransform);
                    // ...

            private Entity CreateFractureShard(int batchIndex, Entity prefab, RigidTransform parentTransform)
            {
                var pos = this.Translations[prefab].Value;
                var rot = this.Rotations[prefab].Value;
                var localTransform = new RigidTransform(rot, pos);
                var worldTransform = math.mul(parentTransform, localTransform);
                var instance = this.CommandBuffer.Instantiate(batchIndex, prefab);
                this.CommandBuffer.SetComponent(batchIndex, instance, new Translation { Value = worldTransform.pos });
                this.CommandBuffer.SetComponent(batchIndex, instance, new Rotation { Value = worldTransform.rot });
                this.CommandBuffer.SetComponent(batchIndex, instance, new LocalToWorld { Value = new float4x4(worldTransform) });
                this.CommandBuffer.RemoveComponent<PhysicsVelocity>(batchIndex, instance); // make it static
                return instance;
            }```
#

i'm basically fracturing each large wall piece into 9 pre-computed pieces (random side note, red one simulated on server, rest are simulated on client)

eager pawn
#

i see most of u use var i, but i do int i, they're both fine right?

#

unity uses var in general?

uncut rover
#

yes

rotund token
eager pawn
#

since the docs and stuff uses var i might just change my code to do it more like the "unity way"

rotund token
#

use var when it makes sense, use make it explicit when it doesn't

uncut rover
#

when you start to have big type names it's a bit cleaner but not necessarly easier to read

#

I personnaly don't use var

eager pawn
rotund token
#

var myvalue = GetValue();
some would argue that isn't very clear
but
List<int> myList = new List<int>();
you obviously don't need the left side declaration because you can clearly see the type

#

just do whatever you prefer

#

many people var everything

#

some people dislike var

eager pawn
#

yeayea alrighty

tranquil jay
#

@rotund token why are you making your shards static ? Then I see that they are falling which would mean dynamic

rotund token
#

they are made static when they first fracture

#

then individually make dynamic when i break parts off

#

(i'm hitting a hotkey to randomly break pieces in that video)

#

the whole thing isn't meant to break at once, basically i'm meant ot be able to break pieces off the wall

#

but i don't want them to always shattered as that's way too many objects so i only shatter once a piece is broken

#

in that demo i just happen to break them all at once with a hotkey

#

hence they all change model at once

tranquil jay
#

I implemented what you wrote (quite elegant) and they still spawn around 0,0,0 worldMatrix destination for the children is correct
I will try to make them static and see if they spawn at the correct location.

rotund token
#

i don't think the static has anything to do with it, i tested them first as being dynamic

tranquil jay
haughty rampart
# rotund token

make sure you disable it again once it's upgraded all your scripts

eager pawn
#

NativeHashMap<int, Entity>
instead of using Entity here, would it be possible to use "Entity which holds a ShopUnitComponent"?

uncut rover
#

you can put whatever entity you want they are just a set of 2 int so they all have the same data structure. One thing to be cautious about though is that whenever you store a "reference" to an entity, if that entity gets invalidated (destroyed) you need to do the clean up yourself.

eager pawn
eager pawn
#

kk thx

dense crypt
#

There's no way to "reference" any data, except storing an Entity and looking up the data at a later date, assuming the Entity is still alive (and still has the component).

glacial hazel
#

Does anyone know about a rollback and fast forward physic state implementation with Unity Physics (ECS). I'm struggling in achieving that, and I've seen a couple of posts with similar questions, but haven't found a clear answer. It's like just a handful of people know enough to make it work, and they've had to change the package code to achieve it. For me, it's kind of contradictory that the package Unity Physics itself says that one of the main USP of the physics engine is that you can rollback and fast forward, but there is no easy way of doing it.

I was thinking of posting in the forum, but I figured that I should ask here first

rotund token
#

if you want time to go in reverse, that's going to take some effort on your behalf

#

if you just want to have previous physic states to test for networking or past snapshots that's pretty easy to do

#

for that you can just save the collision world every frame

#

this is what netcode does, you can see how they do it in
com.unity.netcode@0.50.0-preview.29\Runtime\Physics\PhysicsWorldHistory.cs

glacial hazel
#

What I'm trying to achieve is load back a previous physic state of a previous frame (let's say 5 frames ago), and then simulate a couple of frames forward, all of that within 1 frame

glacial hazel
uncut rover
#

Did anyone manage to make UITK and entities work in build ?

haughty rampart
#

sure

uncut rover
#

I'm having an issue in built but discord don't let me post the error message...

#

It seems to be samothing about a shader it can't find but I have no clue how to fix this... if someone has a suggestion it's welcome.

tranquil jay
#

@rotund token I succeeded! Can't thank you enough, and I will not stop being grateful V_V

eager pawn
uncut rover
#

yes

eager pawn
#

okay cool :))

trim lotus
#

Hi, I believe I am doing something wrong. I am new to Jobs and I am trying to dynamically add ~2000 objects of type 'ConsumableObject' which contains a struct (called Data) to be processed through Jobs.
I am however, trying to add a list of objects directly to a NativeArray of type <ConsumableObject.Data> but as I add things to this NativeArray, it is removing everything and so the size ends up being 0. Why is this? Any help is appreciated!

uncut rover
#

are you allocating the array before the job or in the job ?

trim lotus
#
consumableObjectDataArray = new NativeArray<ConsumableObject.Data>(consumableObjects.Count, Allocator.TempJob);
#

In this line here

#
protected List<ConsumableObject> consumableObjects; public List<ConsumableObject> ConsumableObjects { get; set; }

This is the first array I was talking about

#

I add the ConsumableObjects to this list whenever a Level is loaded and these objects are found within that Level

uncut rover
#

ok so you make a native array that has enough allocated space to take in all the data from the list. where/how are you populating the array with values of the list ?

trim lotus
#
// Consumable Objects
List<ConsumableObject> consumableObjectsList = new List<ConsumableObject>(objectsInLevel);
FindObjectOfType<ConsumableObjectsManager>().ConsumableObjects = consumableObjectsList; // Add the ConsumableObjects to the Manager
#

objectsInLevel is just a variable that has the amount of ConsumableObjects in the level

uncut rover
#

I don't follow, your list is empty. where do you set your data ?

trim lotus
#

so I convert it from this array, into a list (noted above)

uncut rover
#

ok and your issue is taht your native array is empty, correct ?

#

consumableObjectDataArray

trim lotus
#
[SerializeField] protected List<ConsumableObject> consumableObjects; public List<ConsumableObject> ConsumableObjects { get; set; }

This array is empty

#

which means that the NativeArray is empty as well

uncut rover
#

I may not be familiar with this notation but aren't consumableObjects and ConsumableObjects 2 different lists ?? so if you do
FindObjectOfType<ConsumableObjectsManager>().ConsumableObjects = consumableObjectsList;
it has no effect on consumableObjects which you then use in
consumableObjectDataArray = new NativeArray<ConsumableObject.Data>(consumableObjects.Count, Allocator.TempJob);

trim lotus
#

So now, this works and obtains all the objects and fills the array

uncut rover
#

ok good. not sure why you have 2 variable but glad if that works 😉

trim lotus
#
currentJobHandle = job.Schedule(consumableObjects.Count, currentJobHandle);
#

This line is where the error is pointing to

uncut rover
#

can you share your job declaration it seems you are not assigning the WasConsumed variable of you WasConsumedJob

#

job = ???

trim lotus
#
[BurstCompile]
public struct WasConsumedJob : IJobFor
{
    public NativeArray<ConsumableObject.Data> Data;
    public NativeArray<bool> WasConsumed;

    public float YOffsetTrigger;
    public Vector3 SavedPosition;

    public void Execute(int index)
    {
        var data = Data[index];

        if (!data.IsConsumed)
        {
            // Check the Y positional difference
            if (data.Position.y <= SavedPosition.y - YOffsetTrigger)
            {
                WasConsumed[index] = true;
            }
        }
    }
}
uncut rover
#

public NativeArray<bool> WasConsumed;

need to be assigned

#

like Data when you make your new WasConsumedJob

trim lotus
#
consumableObjectDataArray = new NativeArray<ConsumableObject.Data>(consumableObjects.Count, Allocator.TempJob);
        consumableObjectWasConsumedArray = new NativeArray<bool>(consumableObjects.Count, Allocator.TempJob);

        for (var i = 0; i < consumableObjects.Count; i++)
        {
            consumableObjectDataArray[i] = new ConsumableObject.Data(consumableObjects[i]);
            consumableObjectWasConsumedArray[i] = consumableObjects[i].isConsumed;
        }

        job = new WasConsumedJob
        {
            Data = consumableObjectDataArray,
            WasConsumed = consumableObjectWasConsumedArray
        };
#

No errors anymore but I do have this concern:

uncut rover
#

you need to deallocate the native arrays after the job.
consumableObjectDataArray.Dispose(currentJobHandle)
same thing for the other

#

and you probably need to assign your other job variable otherwise they'll have default values so 0 and (0,0,0)

trim lotus
#

I deallocate current in the OnDestroy but I did not include the currentJobHandle. I now do

#

In regards to the "other job variable", what do you mean by this?

uncut rover
#

doing it on on destroy will not be enough. the TempJob allocator is made for 4 frames max. after that you'll get the message you see indicating a probable memory leak.
If you want a native container to live for the duration of you app you need to allocate it on system creation with the persistent allocator and destroy it on system destroy (or on system start/stop running)

for the other variable, a job only work with copies of the data. Si when you use SavedPosition and YOffsetTrigger, it's using it's local copies.
If when you create the job (new job()) you don't assign those local variables, you'll get their default values so (0,0,0) for SavedPosition and 0 for YOffsetTrigger.

trim lotus
#

Ah okay, I understand the 2nd part clearly. As for the 1st, should I then call .Dispose after .Complete?

uncut rover
#

you should call dispose after scheduling the last job that use the native array.

#

with the job handle of that last job

trim lotus
#

Okay, so call .Dispose on both of my NativeArray's after scheduling the very last jobs in the appropriate array with the jobhandle

uncut rover
#

yes

trim lotus
#

and also, bit of a noob question just for my beginners knowledge sake, I am using this job to handle an Update() function that has been quite hefty. I was previously just checking every frame about the "isConsumed" variable but upon thousands of objects as well as a few more things, it got a bit slow. I created this job and now I use it to check if it WasConsumed or not. How do I then obtain that boolean within my original ConsumableObject class and check it? Also, doesnt that mean I still have to use the Update() function in my ConsumableObject class to check if the WasConsumed variable is true or false? I am a bit confused on this part as it seems like I am running in circles. If you could help me to understand, I would greatly appreciate that. I also appreciate all the help youve given me so far

uncut rover
#

So, to get it in you original list, you would need to copy back the data from the native array to the original list. And yes you would still need to have an update on your consumable to check if it was consumed or not.
If I may it seems you are facing a performance issue and that you jumped on the jobs to solve it but it may not be the best first step you could take.
From what I gather from our discussion, you have a scene with some number of object that based on proximity can be "consumed" (or picked up).
I would take advantage of the physics system to detect that the object is in range (player collider collides with object collider) and trigger the consumption logic.

trim lotus
#

Thank you for your suggestion also. You are pretty much correct except we use the Physics system a lot with tons of objects all being "Consumed" by a big hole you create in the ground, almost like a sink hole. The physics updates are also quite daunting on the performance and I have heard that you can use something similar to handle this? I am unsure and will have to look more into it potentially. The Update function of our ConsumableObject script was causing a bit of a chunk of processing however and seemed less of a scare than figuring out physics multithreading.

Also, for my own sake, how would I go about obtaining the completed data performed by the Job but inside of my class when there are thousands? I know an easy answer would be to obtain the value from the array but how does the ConsumableObject know it's related Index value?

Thank you

white island
#

Am I able to have an entity pathfind on a nav mesh yet?

uncut rover
trim lotus
uncut rover
trim lotus
#

Thanks for all your help

dull shell
#

this channel only for dots or also ECS in general?

haughty rampart
dull shell
#

ye i know but i mean other ECS implementation other than dots

haughty rampart
#

not really

dull copper
solar spire
#

Remind me to unpin that when it's over 😄

north bay
#

Did anyone try making an IL2CPP build with 0.50 yet?
I had to annotate all shared comps with [GeneratePropertyBag] to make sub scenes load properly

uncut rover
#

Yes but I don't use shared components

north bay
#

Same, but I even had to add that attribute to inbuilt components like Unity.Entities.SceneSection

uncut rover
#

Did you try to disable code stripping ?

north bay
#

Can't with IL2CPP

#

It defaults to low

uncut rover
#

You can with the scriptable build setting. At least it let you set the option don't know if it does anything :p

north bay
#

Yea you can set it but it uses 'low' stripping anyways 😄

uncut rover
#

lol ok

north bay
safe lintel
#

is that a netcode requirement or 0.50 for every sharedcomponent? @north bay

whole gyro
#

Hey, has anyone noticed that environment reflections stopped working with hybrid renderer in 0.50? The left is a game object and right is converted to an entity. This used to work just fine for me prior to updating (unity 2020.3.24f1 -> 2020.3.30f1, entities 0.17 -> 0.50, hybrid 0.11 -> 0.50)

north bay
rotund token
north bay
rotund token
#

What version of the property package do you have installed

#

Have you manually added one?

north bay
rotund token
#

We had a bunch of issues with the property package years ago but I had totally forgotten about it in recent times

north bay
rotund token
#

Not sure. The project I've built the most is my work project but we don't use build config for that as we don't have subscenes

#

I did build my own library with build config but didn't test it long

#

I might give it another shot

north bay
#

It happens during deserialization of shared components from subscenes

Unity.Entities.Serialization.ManagedObjectBinaryReader.ReadObject
Unity.Entities.Serialization.SerializeUtility.ReadSharedComponents
Unity.Entities.Serialization.SerializeUtility.EndDeserializeWorld
Unity.Scenes.AsyncLoadSceneOperation+AsyncLoadSceneJob.Execute
Unity.Jobs.IJobExtensions+JobStruct`1[T].Execute
Called from: UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception)
Unity.Scenes.SceneSectionStreamingSystem:UpdateLoadOperation(AsyncLoadSceneOperation, World, Entity, Boolean)
Unity.Scenes.SceneSectionStreamingSystem:ProcessActiveStreams()
Unity.Scenes.SceneSectionStreamingSystem:OnUpdate()```
rotund token
#

Ok well that's why it won't effect my work library

#

Let me get out of bed and test my own project

#

This is concerning and I'd like to bring it up with unity earlier than later if it's an issue

#

As it would break most platforms that you can't use mono on

north bay
mystic mountain
#

Are generic jobs not supported with IJobEntity?

rotund token
#

Haven't tested but probably not

#

I suspect it has the same generic rules as entities.Foreach

mystic mountain
#

Aha, sad. It was supported with IJobForEachWithEntity, and they wanted it upgraded to IJobEntity :/

rotund token
#

Learn to love ijobentitybatch! 💩

mystic mountain
#

Right, might still work with IJobChunk as well?

rotund token
#

No reason to use ijobchunk over ijobentitybatch

#

It'll be replaced at some point

#

But yes generics work fine in these jobs because there are no code gen

winter depot
#

I am having some real trouble here. I had created my UI in 2021 version, and now that I have migrated to .50 entities I had to go to 2020 version. So now I am getting an error about not finding "UIDocument". So I am not sure what to do, I was just hoping someone else here ran into this and could push me in the right direction. Not sure to ask here or UI section

rotund token
#

Have you instant the runtime ui package in 2020.3?

#

Installed *

winter depot
#

I just added these to manifest "com.unity.ui": "1.0.0-preview.18", "com.unity.ui.builder": "1.0.0-preview.18",

#

Is there another that I am missing

rotund token
#

Ok so is this error on starting untity?

#

Can you right click your file and reimport

#

Annoyingly I have to do this on 2 files every time I start unity

#

But then it solves itself

#

I believe it links to the wrong dll first time

winter depot
#

Which "file" do you mean?

rotund token
#

The ones that are missing uidocument

winter depot
#

It starts in safe mode, and gives that error alone. If it doesnt start in safe mode, I get 999error I guess missing all unity references

rotund token
#

Just click your error, it'll select the file

winter depot
#

Okay yeah ill give that a try

rotund token
#

Yeah you can't do this is safe mode so exit that

winter depot
#

Yeah that seems to solve it, now I need to figure out why zero unity references are working. Fun stuff thanks tertle, you are the goat

rotund token
#

My super hero name is 'bug man', I've just experienced and had to debug everyones bugs already 😢

hot basin
#

then it's rather "debug man"

#

still I wonder how or even if I should backport my renderer to 2020.3 for new entities

#

or rather wait for 0.51

rotund token
#

do you have the runtime UI toolkit package installed out of interest?

north bay
#

Do you want to submit a bug report or shall I?

rotund token
#

don't worry, i have a more direct line

whole gyro
# whole gyro Hey, has anyone noticed that environment reflections stopped working with hybrid...

Created a thread about this here: https://forum.unity.com/threads/environment-reflections-not-working-with-hybrid-renderer-0-50-0.1256121/. I'm curious if anyone else is encountering the same issue or has any ideas on what I might be doing wrong. Thanks!

karmic basin
rotund token
north bay
rotund token
#

Cheers

#

thanks i've reported it

winter depot
#

Finally able to work through the errors for my first run. Riddled with "This method should have been replaced by codegen" pretty much everywhere lol

safe lintel
#

dont suppose anyone has gotten these errors? TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations, size 795

rotund token
#

@north bay
Ok spent some time looking at this and did some dependency checks on the entities package and I can see the issue.
The problem was having the Properties package version 1.8.3 instead of the 1.7 that entities depends on. I didn't upgrade this directly but it was brought in by an upgrade to the serialization package 1.8.3. Downgrading the serialization package and this issue seems to resolve itself.

#

i.e. make sure your serialization and properties package are 1.7 not 1.8.3

#

I still get the error but now it's only on my own type.

MissingPropertyBagException: No PropertyBag was found for Type=[BovineLabs.AI.Data.AIGraphs`2[[Shattered.AI.Core.AIContext, Shattered.AI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[Shattered.AI.Core.AIStorage, Shattered.AI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]]. Please make sure all types are declared ahead of time using [GeneratePropertyBagAttribute], [GeneratePropertyBagsForTypeAttribute] or [GeneratePropertyBagsForTypesQualifiedWithAttribute]
So this is something I can fix without editing the packages.

#

That said, I would have expected

[assembly: RegisterGenericComponentType(typeof(AIGraphs<AIContext, AIStorage>))]
Would have been enough

uncut rover
#

hi, a few days latter than "tomorrow" but kind reminder 😉

rotund token
#

oh totally forgot

#

let me dump it

rotund token
#

there you go

viral sonnet
#

is there any way to deep profile a bursted job?

rotund token
#

add a lot of profilemarkers

viral sonnet
#

i've been running intel vtune but I want to do it in Unity

rotund token
#

you can use profile markers in burst to see in the profiler

#

using (new ProfileMarker("THIS IS SLOW").Auto())
{
}

viral sonnet
#

yikes 😄 profile markers ... 😄

#

i've already some profile markers. my code looks like a damn mess

#

the job I'm profiling has 1k loc or smth

#

hm, maybe I just need to profile unbursted then. Timings should stay relative

#

huh, deep profiling unbursted is a lot more insightful than I thought

#

quite the overhead

rotund token
#

i'd be careful with what you read with deep profiles and stuff in the entity system - it significantly inflates the costs

viral sonnet
#

I don't have much love for the change version approach. Maybe there's some underlying importance to it but I think it should be opt-in to track change versions of chunks

#

I'm aware I have to take this with a grain of salt. Vtune has a spike on the same line though

#

Bascially on any form of data acquisition 🙂

#

It's a line where I get a trigger map from the source and the target, so to be expected

safe lintel
#

damn physics collider display still sucks

north bay
#

Does it still run at 1fps when rendering terrain colliders?

#

I wrote my own physics collider rendering on top of aline which works pretty well

safe lintel
#

havent ever tried the terrain, I remember tertle did the same and was meaning to get around to my own. kinda was hoping it would be fixed by now

rotund token
#

yeah did the same, i have my owner drawer for physics (but on top of my own draw library similar to aline)

safe lintel
#

assuming I replaced Dependency = JobHandle.CombineDependencies(Dependency, exportPhysicsWorldSystem.GetOutputDependency());
with
exportPhysicsWorld.RegisterPhysicsRuntimeSystemReadWrite(); it should just work right? still getting errors about the physics world job must be completed

rotund token
#

gizmos are just slow

rotund token
safe lintel
#

no

rotund token
#

i'm noticing the Write, are you editing the physics simulation?

safe lintel
#

im modifying the velocities

rotund token
#

you still need to use BuildPhysicsWorld.AddInputDependencyToComplete() under some circumstances

#

Note that things have not changed if you want to read or write physics runtime data directly in your system's OnUpdate() - in that case, you still need to ensure that jobs from previous systems touching physics runtime data are complete, by completing the Dependency.

Also note that BuildPhysicsWorld.AddInputDependencyToComplete() still remains needed for jobs that need to finish before any changes are made to the PhysicsWorld, if your system is not scheduled in between other 2 physics systems that will do that for you.

safe lintel
#

wey that fixed it @rotund token

viral sonnet
#

stuff like this is also in release builds, right?

north bay
#

Not that I remember
It usually just segfaults if you access a component that doesn't exist

#

But maybe they changed something 🤷‍♂️

rotund token
#

no, all the asserts don't exist

#
        public void AssertEntityHasComponent(Entity entity, int componentType)
        {
            AssertEntityHasComponent(entity, ComponentType.FromTypeIndex(componentType));
        }```
#

all conditioned out

#

however they nicely added a UNITY_DOTS_DEBUG so you can debug builds easier in the entity component store (instead of segfaulting) (since ENABLE_UNITY_COLLECTIONS_CHECKS is always stripped)

viral sonnet
#

great! thanks!

#

Do we have a way to get rid of ENABLE_UNITY_COLLECTIONS_CHECKS? I'm not aware of any

rotund token
#

ENABLE_UNITY_COLLECTIONS_CHECKS is always stripped out of builds

#

you can't enable it (it breaks since unity engine won't care about your definition so native array always strips it in builds)

viral sonnet
#

i mean, can we disable it in editor?

rotund token
#

only in burst jobs

#

what this does

viral sonnet
#

alright, thanks

north bay
#

Did someone try the new netcode physics prediction out yet?

viral sonnet
#

will IAspect be userful for random lookups, like the target position, etc... or is it for something else?

north bay
#

Looking forward to have proper server authoritative vehicle physics 😍

rotund token
#

not a lot has been mentioned but from what i understand it seems useful for adding behaviour to things

#

like, all the missing transform methods that unityengine transform has

rotund token
#

not sure if you've read the documentation about them

north bay
#

Naa not yet
Let me take a look

rotund token
#

When using physics in client prediction all dynamic physics objects must be ghosts, you cannot have any client-only physics which means you cannot have particles or debris colliding against dynamic physics objects.

north bay
#

Oh I remember reading that part

#

Hmm I wonder if I can have static colliders in two worlds and have a separate physics world for client only stuff like fractured objects

viral sonnet
#

it was so exciting to read about cross platform determinism but that has been mostly scrapped now and due to this programming netcode has far less options what you can do with client side calculations

#

if you just want to make a shooter or something in that scope, it's pretty great i think

north bay
viral sonnet
#

i have not touched netcode 0.50 yet, seems it's great and just got a little easier, more streamlined

#

yeah, mine too 🙂

#

hm, how would you design a combat flag, data oriented? an attack can put someone into combat, so when processing the attack you'd have a random access to the target and its combat flag, not good. but how could this work any different without being a random access and without writing additional data that would only live for 1 frame?

#

I'm still stuck in OOP mode for some things. :/

#

I tried some intermediate approaches to this but then it couldn't outperform the naive approach of just writing to a random address.

north bay
#

Did you notice performance issues when you use the naive approach?
Like I wouldn't try to get stuck on stuff like that until you actually see that you have a bottleneck there

#

One of the coolest things about DOTS in my opinion is that it's super easy to just optimize things when you see them pop up in the profiler

#

All the separated execution logic makes this really easy

viral sonnet
#

Not really for that particular mechanic but it adds up

#

and I have a few places where this line of thinking applies and ends in random writes to a targets data

#

as this should work for netcode, one loop can run 8-12 times so it adds up even more

north bay
#

Not sure how I would optimize that myself
I wonder whether it's faster to write the attack flag into a bitarray instead of writing it directly to the other entity

viral sonnet
#

some overhead would be gone but you'd need some logic to determine which index an entity is in the bitarray and keep up with allocations of the bitarray itself when npcs/players spawn/despawn

#

i think it would come out pretty even

#

gonna take a look now at ArchetypeChunk.GetComponentDataPtrRO() and ArchetypeChunk.GetComponentDataPtrRW(). Did anyone play around with it?

viral sonnet
#

That's the correct GetNativeArray and looks familiar

#

so GetComponentDataPtrRO is using m_LookupCache which seems neat, GetNativeArray doesn't

#

I've read about lookup cache previously in some other context. I think it was for getting data in CDFE. No idea how relevant that is and why GetNativeArray wouldn't utilize it

#

The lookup cache is a fast path to skip the loop to acquire the correct index of a component array.

#

guess it only gets reset on structural changes

#

sorry if I'm talking to myself. hope anyone finds this interesting 😄

#

nice side effect of GetComponentDataPtrRO: I was raising the issue of getting a ref from a native array instead of a struct copy. with GetComponentDataPtrRO that's very easy now.

#

So I think every GetNativeArray should be replaced by this. We don't even have to rewrite the access to the array, code is the same. Only thing you'd need from the NativeArray is the length but we have that anyway in chunk.Count

viral sonnet
#

sadly, in my test it didn't make any difference even with a pretty high entity count of 250k

white island
#

What namespace is Transform and Rendermesh in nowadays? Or has it changed with 0.50? I can't find it anywhere

#
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
        EntityArchetype sceneryArchetype = entityManager.CreateArchetype(
            typeof(Translation),
            typeof(RenderMesh)
        );

//Define sceneryMesh also
Entity entity = entityManager.CreateEntity(sceneryArchetype);

                entityManager.AddSharedComponentData(
                    entity,
                    new RenderMesh
                    {
                        mesh = sceneryMesh
                    }
                );
#

Is this approach outdated now?

#

pardon the weird indentation lmao

#

oh, never mind. Found em

#

the question of "is this an outdated approach" still stands though

white island
#

hmm ok well. when my mesh is generated at runtime I can't seem to see it. troubling

#

When I look at the mesh object in the inspector it shows up correctly, though.

#

Question: Am I supposed to be able to click and drag entities around the inspector during runtime like GameObjects. Isn't that a feature now

safe lintel
#

and no, no picking yet(1.0 supposedly)

white island
#

Well. That would probably be less efficient.

#

I’ll take a second look at this in a minute. On my PC where the line wrapping doesn’t make everything look like crap

white island
#

Looks like I may be able to

rotund token
#

personally for my runtime meshes i just create a prefab entity via conversion rather than using the RenderMeshUtility

safe lintel
#

that RenderMeshDescription works in conversion(where I use it)

white island
#

Tried to create a spawn job like this, but it didn't like it. Drats.

public struct ScenerySpawnJob : IJobParallelFor
    {
        public Entity Prototype;
        public EntityCommandBuffer.ParallelWriter Ecb;

        public void Execute(int index)
        {
            //Instantiate
            Entity e = Ecb.Instantiate(index, Prototype);
            //Add components to entity
            RenderMeshUtility.AddComponents(
                e,
                World.DefaultGameObjectInjectionWorld.EntityManager,
                //create render mesh description
                new RenderMeshDescription(
                    meshData[index],
                    mat,
                    shadowCastingMode: ShadowCastingMode.On,
                    receiveShadows: true
                )
            );
            //TODO: Set transform
        }
    }
#

Unless... I called RenderMeshUtility on the prototype, and then set the mesh inside the job?

#

Im just thinking out loud pardon me

#

but how would I get the component from the prototype to set the mesh ?...

rotund token
#

it might sound weird in entities but i actually have a pool system for my dynamically created meshes

#

and i use Mesh.MeshDataArray to set the mesh data

#

then use Mesh.ApplyAndDisposeWritableMeshData to apply the data to the meshes

#

and I have the spare meshes stored in a List and this meshes are already referenced on the RenderMesh so i don't need to worry about setting the shared component data

#

but yeah you still need to call ApplyAndDisposeWritableMeshData on main thread

white island
#

Well, I dont totally know how to accomplish that. But what I do have is AddSharedComponent, but I'm not sure what the component I need to add is exactly.
Ecb.AddSharedComponent(index, e, something);

white island
eager pawn
#

i wanna create a collection of things so i can create entities later. i tried to make a list with a bunch of typeof(mycomponent), but System.Type is nullable. would i create a list of archetypes instead? or how do i create a list so i can create entities later on in general?

haughty rampart
#

not necessarily anything to do with dots, but i've got a quick low level question. i'm assigning a byte* (from a byte array) to a struct field that accepts a byte*, this operation throws an index out of range exception. what am i missing?

uncut rover
haughty rampart
uncut rover
#

Aren't you missing & ? Byte* clientDataJson = & b ?

haughty rampart
#

no, if it were so, it would throw a compiler error. and fixed takes care of that already. also, that is not the line that fails

uncut rover
#

Maybe it want b[0] to be assigned first ?

eager pawn
haughty rampart
viral sonnet
#

so, you can't GetExistingSystem with ISystem, right? How are we supposed to interact and change internal system variables? Fallback to GetSingleton?

eager pawn
#

i think im using the blobasset wrong.. is there any point in doing myComponent.blobReference.someValue = 0; instead of just doing myComponent.someValue = 0; from within a system?

viral sonnet
#

components are not immutable but you can design them like it. getting blob data is faster than getting a component

eager pawn
#

i will only access the blob once, which is the only time i access myComponent too

#

but yeah ig maybe im doing it right, since components are writeable and blobassets aren't (which is what i want, just a const int someValue)

viral sonnet
#

a component also reservers 16k of chunk data and an archetype so using a blobasset in your case is the right thing

eager pawn
viral sonnet
#

that's okay too.

north bay
#

Did someone manage to download burst 1.7?
I keep getting this error when I try to do so:

 [NotFound].
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()```
pulsar jay
#

Just found out that GetAllUniqueSharedComponentData still returns shared component data that is not used any more. Is there any way to find only the ones that are currently in use or to unload the unosed sharedcomponentdata's?

hot basin
pulsar jay
#

Atm I am doing it like this:

this.maps.Clear();
EntityManager.GetAllUniqueSharedComponentData(this.maps);
var map = this.maps[1];

Interestingly this consistently fails when loading the 5th map as the list of maps always gets longer even when unloading all entities that have this maps shared component

#

I guess I could filter by each one and check if it has entities but that sounds cumbersome

hot basin
#

shouldn't var map = this.maps[1]; be this var map = this.maps[0];?

#

you can always save value in some singleton component

pulsar jay
hot basin
#

sorry I never used it this way

pulsar jay
white island
#

what do the render bounds do on rendered entities? That might be why I cant see anything

rotund token
#

If you haven't set bounds you won't render anything

#

It'll just be culled

worn valley
#

Every frame the whole scene does quick pass to see what meshes should be used and the render bounds are used since it's very cheap to see if a camera sees a box or not.

white island
#

ooooh... okay...

#

so them being 0 is a bad thing

#

ok cool

worn valley
#

To get a proper bounds you just need to loop through every vertex in the mesh and encapsulate it within a bounds struct. Unity can do this for you as well by doing recalculate bounds.

eager pawn
#

is it unsafe to use unsafe? it seems like it's used for stuff similar to malloc/free and dynamic memory allocation stuff which im not very familiar with

white island
#

iirc

#

its called unsafe because if you dont do it right you could cause memory leaks n stuff

eager pawn
#

also is there fixed size equivalent to dynamic buffers?

white island
winter depot
#

Anyone else's "Application.Reload" hanging after making changes to code? I have had to force quit probably 4x today

white island
safe lintel
#

your localtoworld is invalid

white island
eager pawn
white island
#

i forge tthe namespace, i think unity.collections

eager pawn
#

I thought nativearray and nativehashmap etc didn't work on components 🤔

mystic mountain
#

Anyone else had issue with upgrading to new entities package for netcode?

Unity.NetCode.GhostAuthoringComponent.OnAfterDeserialize () (at Library/PackageCache/com.unity.netcode@0.50.0-preview.29/Runtime/Authoring/Hybrid/GhostAuthoringComponent.cs:320)```