#archived-dots

1 messages ยท Page 46 of 1

rotund token
#
        {
            var map = new NativeParallelHashMap<ulong, ComponentType>(64, Allocator.Persistent);
            foreach (var t in TypeManager.AllTypes)
            {
                if (EffectUtil.ValidateTypeInfoForEnableable(t))
                {
                    var componentType = ComponentType.FromTypeIndex(t.TypeIndex);
                    map.Add(t.StableTypeHash, componentType);
                    state.AddSystemDependency(t.TypeIndex);
                }
            }

            return map;
        }```
#

i need to convert the saved stablehashes into component types

#

so i just make a map in oncreate

#

if i made this map from user supplied data it'd kind of just work

#

it is still a bit more workflow annoyance though

#

i guess i could take user supplied data + grab the data during baking

#

and make a final map

#

this way only runtime set components would need to be manually registered

#

everything else would register automatically

#

actually taking it from baking a bad idea, would be tied to subscene

#

i could find all prefab authorings at a bare minimum and auto populate

#

anyway something to investigate now

solemn hollow
#

sounds like a plan though

rotund token
#

currently i'm trying to get myself into the habit of using aspects

#

wrote my first, i intend to write a lot more

#

just something i've neglected in 1.0 as i had too much stuff to update

#

even though it was what i considered to be the most important feature

#

so time to start writing them

solemn hollow
#

same for me. but i think i wait till others figure out some pattern to use with them

#

i have a feeling some people are overusing them atm

rotund token
#

well i've used one, and it might already be in the overuse case ๐Ÿ˜„

#

haha and it broke my unit tests

#

oh wait no that's unrelated

#

forgot a NativeDisableUnsafePtrRestriction on some previous code

#
    {
        private readonly RefRO<EffectActive> effectActive;
        private readonly RefRO<EffectActivePrevious> effectActivePrevious;

        public bool WasActivatedThisFrame => this.effectActive.ValueRO.Value && !this.effectActivePrevious.ValueRO.Value;

        public bool WasDeactivatedThisFrame => !this.effectActive.ValueRO.Value && this.effectActivePrevious.ValueRO.Value;
    }```
#

what an amazing aspect

solemn hollow
#

i am a little confused about how readonly / readwrite with aspects works. sounds to me like i will create alot of unwanted dependencies when i create aspects with too many components that need to be written to

rotund token
#

i have saved 2 lines of code over 2 files and added 8 ๐Ÿ˜„

solemn hollow
#

๐Ÿ˜„

rotund token
#

i just wanted a pointer to EntityDataAccess

#

for a custom Lookup

rotund token
#

i am strongly against exposing anything unsafe to users

#

no user should need to touch a pointer to use any of my libraries

solemn hollow
#

not saying you dont make your users feel safe ๐Ÿ˜„

rotund token
#

i don't think you realize how many safety checks i have

#

i never bypass safety

#

i would rather my code ran slow

#

than to not be safe

solemn hollow
#

okay i apologize! its true ive never seen any unsafe code from you. i only mean you live in unsafe lands

rotund token
#

oh totally

solemn hollow
#

i dont even dare going there^^

rotund token
#

but funny enough i was just thinking this the other day

#

i haven't crashed my editor in months

#

i used to crash it frequently doing unsafe things

#

(my editor has crashed, just not my fault =D)

solemn hollow
#

๐Ÿ˜„ my crashes vanished since i replaced the new NativeHashmap

rotund token
#

yeah that was a bit dodgy

#

but yeah i've been scared by bugs in unsafe code (that others have written and i had to track down)

#

i spent 3 weeks of work tracking down a single super rare timing bug

solemn hollow
rotund token
#

1 step at a time!

#

i think for the most part though i'll keep my aspects small

#

just an easy way to ensure if i make a change to some logic it's propagated to all systems

solemn hollow
#

yep and i totally see that working for reading. its a good feature. just afraid of having unintended write dependencies and essentially killing parallel execution for a lot of systemchains

rotund token
#

it is an interesting point
i think i'd only add write access to an aspect if that's the purpose of an aspect

#

is having 2 aspects for 1 set of features that bad? hmm no idea

solemn hollow
#

yes i was considering a write and read version of aspects... seems not that great

rotund token
#

it could also add a bunch of extra dependencies you don't need

solemn hollow
#

i guess the problems start when you have multiple components that can be written to in one aspect

rotund token
#

which is what i care about 90% of time

#

only 2 systems care about change of state

#

i guess i'd just use the component directly

solemn hollow
#

oh you mean cause the system only interested in EffectActive now would have to wait for Systems that write to EffectActivePrevious

rotund token
#

yep

#

and i just realized if i wanted both i should only pass in EffectActiveChangedAspect

#

so i've just explosed the underlying value

#
    {
        private readonly RefRO<EffectActive> effectActive;
        private readonly RefRO<EffectActivePrevious> effectActivePrevious;

        public bool IsActive => this.effectActive.ValueRO.Value;

        public bool WasActivatedThisFrame => this.effectActive.ValueRO.Value && !this.effectActivePrevious.ValueRO.Value;

        public bool WasDeactivatedThisFrame => !this.effectActive.ValueRO.Value && this.effectActivePrevious.ValueRO.Value;
    }```
solemn hollow
#

i guess this discussion is only really relevent for really highly parallized high throughput systems though right?

rotund token
#

(which is what my effect library is)

#

im going to check how burst code gen differs

#

before i use this

solemn hollow
#

since most of the time you have enough space on the workers to live with some jobs waiting a bit

solemn hollow
rotund token
#

oh yeah i agree

solemn hollow
#

though im not too sure about how transform aspect is going to work

#

cause lets face it. gameplay is moving things around

rotund token
#

yeah that seems like it's going to add a chain of dependencies

#

though i will probably just write a readonly version

#

literally copy/paste remove the setters

#

i'm much more often only reading

solemn hollow
#

yep but i bet they (unity) will realize this problem too (if it is one) when doing physics

rotund token
#

it'd be kind of nice if you could just do it with safety

#

unless it already works this way ๐Ÿค”

#

if you pass by in

#

does it just do a read only safety

#

i'll need to check codegen

solemn hollow
#

yes as i understand it

rotund token
#

because honestly that'd be the best way to handle it

solemn hollow
#

not sure if it was mentioned in docs or in some forum post

rotund token
#

annoyingly i currently have the opposite issue everyone seems to have

#

and my codegen isn't showing up in rider

solemn hollow
rotund token
#

ije and isystem

#

were showing up for me like a month ago

solemn hollow
#

IJE shows too. sry

rotund token
#

not sure if a unity or rider update changed the behaviour

#

but yeah all my ije show as unused now

solemn hollow
#

i could have sworn i didnt see IJE the last time i checked

#

yes its unused for me too

rotund token
#

dont show up in find window anymore

#

basically i can't browse to them unless i load up explorer

solemn hollow
#

should IJE be shown as a LambdaJob ?

#

seems wrong

rotund token
#

its probably because my source generators dont even appear

#

except

#

this one for some reason

#

oh wait no, they appear under analyzers not generators

#

๐Ÿคทโ€โ™‚๏ธ

#

either way, can't browse to generated code for some reason

proud jackal
#

Huh, that is really odd ๐Ÿค”

rotund token
#

not sure if unity or rider issue, but wasn't working in unity 2022.2 b14 and now b16

#

or latest rider 2022.2.4

#

hasnt worked for a few weeks at least

#

dont recall exactly when it stopped working

proud jackal
#

I mean it could be either, not unheard of in both cases. Tho i am curious what the MonoSctiotGenerator is, never seen that before and why that for some reason is also the exception to the rule ๐Ÿ˜†

rotund token
#

well ok

#

i just fixed it

#

and now i'm even more curious so let me confirm why it's fixed

#

and they now appear in list as expected

#

yep

#

it doesn't like when i add the stylecop roslyn analyzer

#

it adds the monoscript generator back

#

(no idea what that is and why it's related to stylecop going to check)

#

and removes the generated code

solemn hollow
#

hm but why am i seeing the same. got all the Generators inside Analyzers too. and i dont see a MonoScriptGenerator

rotund token
#

this monoscriptgenerator definitely a unity thing

#

no idea what it is

solemn hollow
#

i am doing a rider update first. lets see if its fixed then

#

didnt realize im on an old version for a while now

rotund token
#

well i have a solution for those who want to remove the find on these ๐Ÿ˜„

#

i don't know if this is stylecop specifically on my analyzer library that auto adds analyziers to projects without having to go through unitys cumbersome way that i could not find a way to add .json based configs

solemn hollow
#

after update it looks like this:

rotund token
#

there you go

#

if you open those source generators up

#

you should see it?

solemn hollow
#

yep. just to understand all those analyzers are basically generators that didnt find something to generate?

rotund token
#

i think a lot of those are actual analyzers

#

like, partial required on a system

#

kind of stuff

solemn hollow
#

ah ok. was just confused why you said your generators where analyzers. first time i see them like this tbh ^^

rotund token
#

oh yeah was my mistake

#

i was confused because i could see stuff there but not under source generators

#

and i was like, why are they appearing under that

#

@proud jackal i can tell you what is causing the issue

        {
            XDocument xml = XDocument.Parse(contents);

            UpgradeProjectFile(xml);

            // Write to the csproj file:
            using (Utf8StringWriter str = new Utf8StringWriter())
            {
                xml.Save(str);
                return str.ToString();
            }```
making changes to project in a AssetPostprocessor
i'm only adding to the Analyzer and AdditionalFile xml, not removing anything =S
```                switch (extension)
                {
                    case ".dll":
                    {
                        var reference = new XElement(xmlns + "Analyzer");
                        reference.Add(new XAttribute("Include", file));
                        itemGroup.Add(reference);
                        break;
                    }

                    case ".json":
                    {
                        var reference = new XElement(xmlns + "AdditionalFiles");
                        reference.Add(new XAttribute("Include", file));
                        itemGroup.Add(reference);
                        break;
                    }```
Going to investigate this further to see if/what i'm breaking
solemn hollow
#

so now i the codegen is not appearing in my searches anymore. i like it

#

wtf the whole codegen looks completely different now

#

and i think i got around 10 fps more in editor 0.o i might be imagining things

rotund token
#

these are only changes i made to the project, somehow it breaks it

#

oh wow it is not what i expected

#

it's failing purely from adding a .json to additional files

#

it has no issue with the dlls

#

all this json has is my header template

  "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
  "settings": {
    "documentationRules": {
      "companyName": "BovineLabs",
      "copyrightText": "    Copyright (c) BovineLabs. All rights reserved.",
      "documentInternalElements": false
    }
  }
}
#

that's a super odd bug

#

i guess it's more likely to be the <AdditionalFiles /> than the json in particular

covert spire
#

So I have a managed component that holds various ComputeBuffers. Where would I Dispose/Release the buffers?

rotund token
#

usually the system responsible for creating them

vital sandal
#

Where is Quaternion.Lerp in Unity.Mathematics?

rotund token
vital sandal
#

aaah yes of course

#

ty

hushed fjord
#

is it bad practice to have components and authoring in the same file? it seems like whatever is in the component code is also in the authoring code, so wouldn't it make sense to put them in the same place for convenience?

rotund token
#

hmm i'm not sure there would be community agreement on this

#

personally my authoring exists in an editor only assembly

#

baking is editor only so why should it exist in a runtime assembly?

#

so for me, no, components/authoring are always in different scripts

#

also i think you'll eventually find your components to authoring don't map 1:1

#

it's much easier workflow to have 1 authoring script setup an entire feature which is likely a handful of components

#

in which case you would start having, 5, 10, 20? components in a single script

hushed fjord
#

thanks for the info, didn't know that things could be separated by editor/runtime

#

also, another question: aren't aspects sort of like classes? i'm watching an intro to dots by codemonkey, and the way he uses an aspect, i feel, is similar to a class. won't this sort of defeat the point of ecs?

balmy thistle
#

No, because it's compositional, the components are still in the entity data store

#

there's an argument to be made that it encourages instance oriented programming, but I'm not sure that's so different with Execute() style jobs either

#

ultimately it's scaffolding on top of ecs which you can always "descend" if you want to make sure you're taking advantage of every amortization opportunity

hushed fjord
#

bit of jargon in those 3 messages ๐Ÿ˜… but I guess the takeaway is that it builds on top of ecs rather than changing its structure?

rustic rain
#

very far from oop

muted field
#

what is inner loop batch count for the job schedule method ?

solemn hollow
muted field
#

it seems to still be there when scheduling jobs with IJobParallelFor

solemn hollow
#

yes i just checked. true

#

they removed it from the higher level jobs only

muted field
#

how come

solemn hollow
#

cause IJobFor is not for entities only id imagine. so whatever you schedule there is not necassarily already split up into chunks

muted field
#

ah fair enough

muted field
#

kind've annoying mesh data is vector3 and not float3

#

have to make copies and alloc more memory every time i want to modify mesh data

rotund token
#

you can reinterpret float3/vector3

#

no need to copy it

#

they have the same memory layout

muted field
#

i am trying to work out how to use those functions but not understanding them so far

rotund token
#

NativeArray<float3> array = new NativeArray<float3>(1234);
NativeArray<Vector3> array2 = array.Reinterpret<Vector3>();

#

these point to the same thing in memory

#

changes to 1 will affect the other

muted field
#

first im trying to copy it to the native array like this :

        var buffer = new NativeArray<float3>(_verts.Length, Allocator.Temp);
        buffer.ReinterpretStore(0, _buffer);
``` but says vector3[] cannot be nullable
#

_buffer is my Vector3[] copy of the original verts array

rotund token
#

yeah that doesn't work

#

but you don't need to do this either

#
    var buffer = new NativeArray<float3>(_verts.Length, Allocator.Temp);
#

is memcpy

muted field
#

your code is just native to native though

#

mesh functions dont accept native array only normal array or list

rotund token
#

here

#

i wrote this up for someone the other day

#

you can make a nativearray and a [] point to the same memory

#

so editing the nativearray will edit the []

#

no need to copy the array to native array

muted field
#

oh ill take a read of it ๐Ÿ™‚ thanks

vernal cypress
#

how do you manage unmanaged system dependencies ?

#

let's say i want system A dependencies to complete before System B

solemn hollow
#

@vernal cypress wont attributes do the job for you?

vernal cypress
fallen pilot
#

Hey, What's the use for Burst Compiler and how is it different from il2cpp

#

??

rotund token
#

One of the things LLVM can do is auto vectorization of your code allowing you to execute 4+ instructions at once

fallen pilot
#

So it adds in more performance to the unmanned code on top of compiling it to machine code?

rustic rain
#

Burst code is extremely fast if you code properly

#

It's perfect to process large chunks of data

#

On top of it you can use il2cpp

covert lagoon
#

All major C++ compilers can autovectorize well anyway as far as I know.

#

But IL2CPP doesn't let you choose the target instruction set vector extensions I think so it probably uses the compiler default which should be SSE2 for x86-64.

#

Whereas Burst lets you generate a version of the code targeting AVX2 for example.

#

And I think I read that the vector and matrix struct types in com.unity.mathematics are replaced with compiler built-in vector types when using Burst.

#

So it's mostly explicit vectorization really.

dense crypt
#

How do I write to a NativeStream in IJobEntity? I need to use Begin & End Index but I can only do it once per index. Would it be fine to do a single write per index?

In IJobEntityBatch I could easily use the batchIndex.

edgy fulcrum
#

mmm I'm trying to figure out how to use Interlocked.Increment on a field obtained through a ComponentLookup, and is unable to find examples...

#

seems like I need to use NativeReference, but that doesn't seem to do what I need?

rotund token
rotund token
#

Ns usually reserved for ijobchunk or ijobfor

#

However it'll be fine unless you are doing something extreme

true mirage
#

Can we have NativeArray<NativeArray<int>> or I have to use MultiHashMap?

worn umbra
#

How can I install netcode [1.0.0-pre.15]? The package manager allows me just exp.13. I was adding it by name com.unity.netcode
// nvm, I just specified the version ๐Ÿ˜„ for some reason I was stuck on experimental version ๐Ÿ™ˆ same for entities.graphics and physics, wow

#

Interesting, I just refreshed physics page and it shown 1.0.0-pre.15, is it released just now? cuz there is date from 16th November ๐Ÿ˜„

#

ah, 2022.2.0f1 is out facepalm

rotund token
worn umbra
sterile zodiac
#

was trying to upgrade to 2022.1.23 from 2021.3.11 -- on entities 0.51 -- I'm not seeing anything get generated in Temp/NetCodeGenerated, even after running Multiplayer -> Force Code Generation and reimporting assets --- any ideas on what to check to get these files to generate?

rotund token
#

you can't use entities 0.51 on 2022

#

only supported on 2021.3

sterile zodiac
#

easy solution, thanks

worn umbra
#

I literally refreshed page and pre version appeared. I was soooo confused ๐Ÿ˜„

rotund token
#

SystemAPI.GetXTypeHandle to easily get cached and .Update'd handles :3
haha :3

#

dani

orchid ginkgo
rotund token
#

IJobEntityChunkBeginEnd - allowing you to run code at the start and end of chunk iteration.

#

wait what, you did it?! ๐Ÿ˜

worn umbra
#

It will be a long night... TRANSFORMS_V2 - 1000 errors ๐Ÿคฃ

rotund token
#

this is a good day

worn umbra
#

Since when GetNativeArray was deprecated ๐Ÿ˜ฎ ๐Ÿ‘€

#

It is not in the changelog

idle heath
#

Bonjours

#

You are speak french??

rotund token
#

i noticed there is a new ref version

worn umbra
idle heath
#

Ahh ok cool

rotund token
#

chunk.GetNativeArray<LocalToWorld>(ref LocalToWorldTypeHandleInfo);

#

seems to be what they're doing internally now

idle heath
#

Give me money please

rotund token
#

do i win

worn umbra
#

I had the same thing!! ๐Ÿ˜‚ I'm fixing all errors in safe mode now ๐Ÿ˜„

rotund token
#
      at UnityEditorInternal.InternalEditorUtility:SaveToSerializedFileAndForgetInternal <0x000f6>
      at UnityEditorInternal.InternalEditorUtility:SaveToSerializedFileAndForget <0x00092>
      at UnityEditor.WindowLayout:SaveSplitViewAndChildren <0x0036a>
      at UnityEditor.WindowLayout:MaximizePrepare <0x008b2>
      at UnityEditor.WindowLayout:Maximize <0x00092>
      at UnityEditor.EditorWindow:set_maximized <0x0018a>
      at <>c__DisplayClass86_0:<WindowMaximizeStateOnDoubleClick>b__0 <0x000a2>```
#

you double click to maximize a window and next thing you've 'closed' it ๐Ÿ˜„

worn umbra
#

This is the future ๐Ÿ˜‡

rotund token
#

i find this weird

#

why is ref readonly not allowed

#

seems like it's just removing a layer of safety

worn umbra
#

Maybe there were a few breaking changes, so they wanted to make the changelog longer. ๐Ÿ˜„

rotund token
#

nevermind

#

SystemAPI.ManagedAPI

#

i forgot that was being added

#

this entities has everything i want

#

except default interface implementations for ISystem OnCreate/OnDestroy

#

deleted hundreds of lines of code in minutes

#
Parameter name: type
System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) (at <8f06425e63004caf99a79845675f751e>:0)
System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) (at <8f06425e63004caf99a79845675f751e>:0)
System.Activator.CreateInstance (System.Type type) (at <8f06425e63004caf99a79845675f751e>:0)
UnityEditor.SceneTemplate.SceneTemplateAsset.CreatePipeline () (at <b1ffc38ca9d3409db9b51da2ce9185db>:0)
UnityEditor.SceneTemplate.SceneTemplateUtils+<>c.<GetSceneTemplateInfos>b__26_1 (UnityEditor.Tuple`2[T1,T2] templateData) (at <b1ffc38ca9d3409db9b51da2ce9185db>:0)
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].ToList () (at <7e91c7d737f04acfa67ccef9a61afddb>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <7e91c7d737f04acfa67ccef9a61afddb>:0)
UnityEditor.SceneTemplate.SceneTemplateUtils.GetSceneTemplateInfos () (at <b1ffc38ca9d3409db9b51da2ce9185db>:0)
UnityEditor.SceneTemplate.SceneTemplateService.UpdateSceneTemplatesOnSceneSave (UnityEngine.SceneManagement.Scene scene) (at <b1ffc38ca9d3409db9b51da2ce9185db>:0)
UnityEditor.SceneTemplate.SceneTemplateService.OnSceneSaved (UnityEngine.SceneManagement.Scene scene) (at <b1ffc38ca9d3409db9b51da2ce9185db>:0)
UnityEditor.SceneManagement.EditorSceneManager.Internal_SceneSaved (UnityEngine.SceneManagement.Scene scene) (at <73e8d78521f6493493e0128fd6894857>:0)
UnityEditor.SceneManagement.EditorSceneManager:SaveModifiedScenesIfUserWantsTo(Scene[])
Unity.Scenes.Editor.SubSceneInspectorUtility:CloseAndAskSaveIfUserWantsTo(SubScene[]) (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Scenes.Editor/SubSceneInspectorUtility.cs:204)```
first exception
#

doesn't seem to break anything

covert lagoon
#

Yeah I think I'll stick to 0.51 on Unity 2021 LTS.

rotund token
#

screw that 1.0 is great

#

longer you take to update more painful it is!

covert lagoon
#

Has Rival been updated to 1.0 yet?

rotund token
#

i don't use rival but I think you'll need to wait for updated samples from what i heard

covert lagoon
#

Yeah I can't wait much.

#

I want to start working on the game by the end of this year.

#

And I'll work on it only for a few months.

rotund token
#

oh fair enough if it's a short term project

#

we're sticking with 0.51 for our game full launch (and 2020.3 actually)

#

but we have ~1500 jobs so an update is likely never going to happen

covert lagoon
#

Right.

rotund token
#

anyone else getting

[Worker6] 1 entities in the scene 'Empty' had no SceneSection and as a result were not serialized at all.
1 entity not serialized

#

i'm getting this in an empty subscene

#

so only possibility i can think of is a baking system of mine was adding one but i disabled them all and it still happens

robust scaffold
#

Has 1.0 pre come out?

#

Player stripping levels higher than minimal would fail to build with burst if they used String.Formatters, String Copy, or BurstDiscard.
Burst 1.8.2 from a few days back. Might be the cause of some IL2CPP builds breaking.

rotund token
robust scaffold
rotund token
#

i haven't had a corrupt subscene once

robust scaffold
#

Oh yes?

rotund token
#

though time will tell

#

and they snuck in my request!

IJobEntityChunkBeginEnd - allowing you to run code at the start and end of chunk iteration.

#

best day ever

robust scaffold
#

Im checking the changelogs right now. I check burst every morning so I only saw... holy shit

#

Tertle for Unity CTO when?

#

You got my vote

rotund token
#

and obviously

SystemAPI.GetXTypeHandle to easily get cached and .Update'd handles :3

#

ive deleted so much code

#

in just an hour this morning

robust scaffold
#

Ugh, gonna have to make my way to the lab for internet...

rotund token
#

i have to start work in an hour ๐Ÿ˜ฆ

#

back on 0.51

robust scaffold
#

oof

#

Support for RefRW<T>, RefRO<T>, EnabledRefRW<T> and EnabledRefRO<T> parameters in IJE
Actually pretty important as you can pull pointers from this...

rotund token
#

oh i need to test if leak detection is working yet

robust scaffold
#

A isReadOnly field (with default arg) to TryGetSingletonBuffer
Nice. That was annoying to get around in SAPI.

whole gyro
#

Curious about the new content management stuff in pre.15

rotund token
#

oh it is

#

var leak = new NativeArray<int>(1, Allocator.TempJob);
jsut spamming a leak every frame

whole gyro
#

Wondering if it will work for referencing scene game objects from a subscene

robust scaffold
#

IJobEntityChunkBeginEnd - allowing you to run code at the start and end of chunk iteration.
And that invalidates any reason to use IJC anymore. Sweet.

robust scaffold
whole gyro
#

or if its only for referencing assets and loading async

safe lintel
#

support for animation curves in component objects was kind of a random thing to see in the added changelog

rotund token
#

but no it hasn't been working for most versions of 2022

robust scaffold
rotund token
#

oh wait no, full stack trace doesn't seem to work

#

just stopped showing leaks

robust scaffold
rotund token
robust scaffold
#

SystemAPI.GetXTypeHandle to easily get cached and .Update'd handles :3
Ha, that ":3" at the end, yea someone who frequents this discord definitely wrote that.

rotund token
whole gyro
#

Hmm, didn't see anything in the changelog for disabling IEnableableComponents in bakers. And no fixes for aspects.

rotund token
#

it just didn't work with open subscenes

#

because there was no differ (i think that was the problem)

whole gyro
#

yeah I meant for open subscenes. I'll have to test

robust scaffold
whole gyro
#

I'm hopeful that this content building stuff can be used for a nice hybrid workflow

rotund token
#

i have 8 left in my effect library

#

1 is generic so i can't get rid of that

rotund token
#

1 is doing a whole chunk memcpy

robust scaffold
#

WorldUnmanaged.CurrentTime renamed to WorldUnamanged.Time
What? Hopefully that's a typo.

rotund token
#
                var effectActives = chunk.GetNativeArray(ref this.EffectActiveHandle);
                effectActivePreviouses.Reinterpret<bool>().CopyFrom(effectActives.Reinterpret<bool>());```
#

so that isn't going

whole gyro
#

what unity version should I be on before updating?

#

to pre.15

robust scaffold
rotund token
#

that's true

#

but i'm not sure why that'd actually be better ๐Ÿ˜„

#

i'd still have same overhead of passing in handle

robust scaffold
#

Getting chunk count though is gonna be difficult and roundabout. So yea.

rotund token
#

yeah i think in this library i can only remove 3 of my remaining 8

#

but those 5 are very specialized jobs

whole gyro
#

anyone using unity 2022.2.0b16?

rotund token
#

2022.2.0f1 is out

whole gyro
#

oh

robust scaffold
#

Renamed the DOTS Hierarchy window to Entities Hierarchy.
Renamed the DOTS sub-menu from the top-level Window menu to Entities.
Renamed the DOTS section in the Preferences window to Entities.
Huh, going back to Unity ECS? It's a full circle now.

rotund token
#

it kind of makes sense

#

jobs/burst were in their own windows

#

and they are dots

#

so what really was the dots preference window, it was just entities

whole gyro
safe lintel
#

seems like this is the package that updates physics to the new transform system

robust scaffold
#

IJobEntity scheduling calls now can contain calls to SystemAPI calls and other JobEntity scheduling
OH MY GOD!!!. WOOOOOOOOO

rotund token
#

yep lines deleted

whole gyro
robust scaffold
#

Can system API be used inside IJE now? I think i skipped over something that said that and I cant find it anymore

safe lintel
#

i dont either but an example from the docs shows use of LocalTransform and all my translation rotation code is broken in my project ๐Ÿฅฒ

robust scaffold
#

Has havoc been released with this pre?

#

Yes. Huh

safe lintel
#

says in the docs if you dont own pro or industrial, physics wont work in editor or runtime

whole gyro
#

hmm yeah it does look like they added a few "ENABLE_TRANSFORM_V1" branches to the physics code. I'm surprised their aren't more diffs actually.

safe lintel
#

also GameObjectConversionSystem seems to have been removed, got a lot of disableautocreation for those but gotta just prune it completely now

rotund token
#

oh transform v2

#

is a bit different than it was in exp

safe lintel
# robust scaffold Havoc?

Licence warning pop-up: adding the com.havok.physics package in your project without the Unity Pro, Enterprise or Unity Industrial Collection license will prevent you from simulating Havok Physics in the editor and builds.

robust scaffold
safe lintel
#

i didnt even get around to testing it in exp or trying out any of the aspects(or the replacement for EFE), so many things to upgrade!

#

@robust scaffold yeah, sucks ๐Ÿ˜ข

rotund token
#

though most people seemed to refuse to believe it ^_^'

safe lintel
#

i was hoping it was a miscommunication

robust scaffold
#

Does the student pack count as pro?

#

Because at this rate, I'm gonna be a terminal student...

rotund token
#

i feel like it'd count as a plus license

#

but i don't know for certain

whole gyro
#

Wow, totally missed the ColliderAspect in the physics package

robust scaffold
#

No, it counts as pro

#

I'm gonna have to see if havoc accepts it though.

rotund token
#

winning

robust scaffold
#

I've been using the free tier this entire time though perfectly fine. And with 2D physics, I dont think havoc will really help in any way

rotund token
#

but it's cool and exclusive

robust scaffold
#

I can flex on the poors with my $40k student loan debt.

#

Oh no, looks like netcode supports transform v2. How in the world am I gonna convert the existing custom serialization code for V1 to V2 for 2D transform components.

whole gyro
#

You can disable v2 still

robust scaffold
#

exception thrown by the hierarchy window if a scene entity does not have a SubScene component.
Nice. That always broke my thin client viewer.

robust scaffold
rotund token
#

i will be honest though

#

i am slightly concerned about the archetype size of this new transform system

robust scaffold
whole gyro
#

Yeah:

The new tag component PropagateLocalToWorld must be added to any entity which needs its children to inherit its full LocalToWorld matrix, instead of the more compact WorldTransform representation. This path is slightly slower, but supports additional features like PostTransformMatrix (for non-uniform scale), and interpolation by the Physics and Netcode packages.

robust scaffold
#

Ah, not optional for those using the P&N packages...

whole gyro
#

yeah just saw that part about interpolation

robust scaffold
#

Physics itself doesnt seem to have changed anything.

safe lintel
#

rip transform v1, i will miss that giant docs page that I admire someone had to suffer through and put together, complete with the ascii art representation

whole gyro
#

Honestly, thought it'd be worse

rotund token
#

what happened to staticoptimizeentity ๐Ÿค”

robust scaffold
rotund token
#

yeah but the component could just nicely set the flags for me

#

instead of me having to write a new one!

robust scaffold
#

Right, I think that's all the changelogs. Gonna head to civilization for fiber optics to download prerelease.

#

Todo list: TransformV2. Convert some of the last holdouts of IJC to IJEBE. See if baking actually works. Remove Distance Importance scaling (been broken for a while).

safe lintel
#

I dont quite understand why you have a LocalTransform component that has float3 float and quaternion for pos scale and rot, but isnt that kind of duplicated with the LocalToWorld's 4x4(and setting TRS.float4x4(pos,rot,scale)?

rotund token
#

couldn't be found in the SystemRegistry. (This is likely a bug in an ILPostprocessor.)
nooooooooooooo

safe lintel
#

oh local transformations i guess

robust scaffold
rotund token
#

it's still happening

robust scaffold
rotund token
#

i dont have netcode in this library

robust scaffold
#

oh

#

F

rotund token
#

it didnt corrupt my subscenes

#

i just couldn't bake it anymore

#

with those systems listed

robust scaffold
#

Editor restart needed then?

rotund token
#

it did

#

we'll see if it happens again andi 'll experiment

#

first time in 2 hours though

#

so ah, that's at least a huge improvement

rotund token
#

it just adds them by default and anything but manual (remove all) does nothing

robust scaffold
robust scaffold
#

I think, that's what I saw in the src back in exp land.

rotund token
#

oh no

#

now takes you to 0.0

robust scaffold
#

Latest is broken for entities which is annoying because I have that link bookmarked

muted field
#

getting an error but dont know the cause or how to fix it... :

Burst error BC1002: Unable to find interface method `IBezier.Lerp(System.Single& modreq(System.Runtime.InteropServices.InAttribute))` from type `object`
#

it occurs when i open unity - but i can clear the console and i never get the error again

#

very strange

#

it also wont take me to a line of code when i double click it

#

but i think i know what line it refers to

rotund token
#

what is IBezier

#

seems like a 3rd party library

muted field
#

its an interface but my method restricts it to struct for the generic

robust scaffold
#

If it's not persistent, I think it's fine to ignore...

rotund token
#

but it just seems like a generic issue maybe?

muted field
#

where T : struct, IBezier is what i have

#

ill try unmanaged didn't know that was a keyword

rotund token
#

yes but a struct can have a class on it

robust scaffold
#

where T : unmanaged, IBezier

muted field
#

oh i see

#

good point

rotund token
#

public struct MyStruct {
public MyClass Class;
}

muted field
#

lets see if that fixed it now

#

damn it still pops up when i reopen unity

rotund token
#

it won't actually fix anything unless you get a compile error

muted field
#

what is the error actually trying to tell me

rotund token
#

it won't change how burst behaves, just make it so you can't accidently break it

#

what version of burst

muted field
#

how do i check ? i didn't install a package for it. im on 2022.1 so i dunno if its just built in ?

rotund token
#

2022.1 is an odd version

#

not using entities?

muted field
#

no just jobs

rotund token
#

it'll probably be 1.7.x i think

muted field
#

maybe

#

ok i fixed it

#

seems every function that received IBezier has to be generic with unmanaged

#

kind've tedious but at least it resolved the error

safe lintel
#

so uh whats the replacement in transform v2 for euler rotations?

whole gyro
#

But that's not new

safe lintel
#

but if you want to always keep something in euler format? i gotta make my own mini euler component now?

whole gyro
safe lintel
#

no? you could have a float3 euler component that would auto get "baked" into a quaternion during runtime

#

i thought the whole pre rotation and post rotation for adding little modifers was also kind of novel and cool, in fact if v2 doesnt handle any of this stuff im actually super underwhelmed by it

balmy thistle
#

It's a more constrained system

whole gyro
#

Converting back to euler angles to read would be a pain though

#

But at least now you can write an Aspect to hide all of this with a nice api

safe lintel
#

perhaps, but felt like maybe the entire ordering of data transformation/jobs might be important to the transform process, which now is my responsibility to intercept and modify? i feel like that old page really was long winded and not the best explained but it wasnt advanced at all, and that whole system was incredibly useful for me as I am quite terrible at maths outside of using helper functions

whole gyro
#

So now you can do stuff like localTransform.InverseTransformRotation(someRotation)

#

Don't have to do any math.mul() calls yourself

safe lintel
#

yeah Ill have to take a look at that

#

can you use aspects in ijobchunk?

whole gyro
#

Actually, they might work. I was thinking of how IAspect.Lookup can't be used in IJobEntity. Or at least it couldn't in earlier 1.0 versions.

safe lintel
#

docs only show example for IJE, and on first inspection, transform systems seem to use regular typehandles. oh well maybe just as well, gotta fix all these errors first

robust scaffold
#

Huh, a dev blitz for dots specifically, neat.

#

This place is gonna get really noisy on december 8th

#

We're gonna need to start pooling questions. Im still overwhelmed by 1.0 pre so I got nothing

safe lintel
#

gotta think up good issues, last blitz thing I only saw during the day so completely whiffed on a chance to ask pertinent questions

robust scaffold
#

Weโ€™re progressing towards a highly performant, customizable 3D animation system that leverages data-oriented technologies
Seems like DOTS 1.1 will be animation

#
  1. What is the status of hybrid components beyond that explicitly whitelisted by unity?
  2. Has there been any effort within unity to resurrect Tiny from the dead, or at least brush up the experimental graphics API that allowed DOTS direct sprite rendering?
  3. Any consideration to expanding the maximum entity count per chunk to 256 using v256 as enabled masks?
  4. Can the Hybrid Rendering / Entities Rendering team please provide an example where they synchronized GPU execution to follow CPU write using a compute buffer BeginWrite() in a job?
balmy thistle
#
  1. There's no current plan to extend that list, although we're actively discussing alternatives.
  2. It's not a current priority.
  3. That's definitely a possibility, not in the current round of optimizations we're trying out.
  4. I'll get back to you.
robust scaffold
#

Yea, just those 4 questions. IJobEntityBeginEnd pretty much fills in the codegen hole I wanted for IJC. The problems Im experiencing now is purely rendering and how DOTS just does not like to play well with custom rendering code style.

safe lintel
#

@balmy thistle re: 2) ok tiny specifically as a small lightweight runtime isnt a priority but does that also cover native 2d entities packages?

balmy thistle
robust scaffold
#

Oh my god, they listened to me. No more LocalToWorldTransform, it's only called LocalTransform. I might be able to slot this comp type handle with other components without Rider's vertical alignment making everything ugly.

safe lintel
#

@robust scaffold ooo oo where did you see that mentioned about animation?

#

literally such a key package for me

robust scaffold
#

At the very bottom. Nothing explicit but it looks like animation will be the next major push

#

Since I do everything 2D, I think this DOTS release is pretty much the final exciting build for the near future. Gotta have to roll my own solutions for everything now.

#

I wonder, does unity recommend using the transform aspect or directly accessing the transform components?

rotund token
#

well, i suspect they'd recommend using the aspect

#

you are adding extra dependencies though potentially if all you're doing is reading

balmy thistle
#

yop

robust scaffold
#

Hrm, true. Most of the time I just need position and maybe rotation. Rarely scale. That's all inside one component LT now. WorldTransform is highly recommended to be readonly and LTW has always been.

#

I dont think there's any additional dependencies being added when using the transform aspect compared to direct accessing LT.

#

@safe lintel These are in euler rotations.

rotund token
#

yep

#

some of the lines i got to delete

#

one thing that's left is how can i query an aspect with SystemAPI?

#

or have i overlooked something

robust scaffold
rotund token
#

doesnt work

#

says not valid

#

it seems i need to use EntityQueryDesc still via GetEntityQuery

robust scaffold
#

Oh well, I guess LT works.

rotund token
#

based off what i saw IJE codegen

#
            {
                All = ComponentType.Combine(
                    new[] { ComponentType.ReadOnly<TestComponent>(), },
                    Unity.Transforms.TransformAspect.RequiredComponents),
            });```
#

kind of thing

#

also not burst compatible ๐Ÿ˜ฆ

robust scaffold
#

Huh, so the code gen'ed on create for IJE isnt bursted?

#

Oh, it's an array. No burst allowed.

rotund token
#

yep

robust scaffold
#

Oh, question 5: Will there be a AspectLookup<IAspect> type? I know there's the IAspect.Lookup but it sticks out like a sore thumb surrounded by ComponentLookup and BufferLookup variants.

whole gyro
robust scaffold
#

That's on our radar but we have to do some extra generator magic to make it work since c# does not support static interface.
Without generator magic, you would have to write AspectLookup<MyAspect, MyAspect.Lookup>, which kinda defeats the purpose.
Oof, shame.

whole gyro
#

What is TransformAspect.Query?

robust scaffold
whole gyro
#

Its in the codegen

robust scaffold
whole gyro
#

Ah yeah yeah

#

Anyone know how unparenting works in transform v2?

#

Does it update the local transform to match the world transform? Or do we still need to manually edit stuff to avoid things teleporting?

robust scaffold
#

It's beautiful.

robust scaffold
whole gyro
#

At least ParentTransform is automatically added and removed when adding or removing a Parent. So many times I was scratching my head wondering why the parenting wasn't working, only to find out I forgot to add a LocalToParent.

robust scaffold
#

Huh, is the physics body baker broken?

whole gyro
#

uh oh

#

I'm not at the point of testing baking yet

robust scaffold
#

Im gonna try the good old remove component, clear cache, restart, and readd component to see if that fixes anything

#

Hrmmmmm, looks like Physics + Netcode does not allow physics bodies to have smoothed bodies.

robust scaffold
#

Damn, TransformV2 really is beefy.

whole gyro
#

And that is without a parent

#

What is PostTransformScale? Is that automatically added to all entities?

#

Oh thats for non-uniform scaling

#

I'm curious if they will eventually support physics interpolation without LocalToWorld. Doesn't seem like it would require it since you can easily interpolate the (float3, quaternion, float) format of the WorldTransform.

robust scaffold
#

I think it's just mandatory for any scale other than 1, 1, 1

#

Because my scale is uniform at 0.4, 0.4, 0.4

whole gyro
#

uh that seems wrong. LocalTransform and WorldTransform both have a float scale

#

From the new docs:

The PostTransformScale component
Transform components only support uniform scale. To render nonuniformly scaled geometry, you may use a PostTransformScale (float3x3). This will be applied in the following manner:

robust scaffold
#

This is 1, 1, 1. No PTS

whole gyro
#

Do you have that little lock icon toggle on in the inspector?

#

Next to transform Scale

robust scaffold
#

0.4, 0.4, 0.4

whole gyro
#

Try clicking that little lock

robust scaffold
#

Lock?

whole gyro
#

"Enable Constrained Proportions"

robust scaffold
#

Doesnt do anything

whole gyro
#

Was curious if that changed the output of baking

#

Checking that enforces uniform scaling

robust scaffold
whole gyro
#

actually I was mistaken anyways. Looks like it enforces uniform scaling on any future scaling.

robust scaffold
#

Question 6: For the netcode devs. Option for dark mode netdbg viewer please.

whole gyro
#

From TransformBaking.cs

robust scaffold
# whole gyro

It's added by the physics baker for scales other than 1.

whole gyro
#

Ah got it

rotund token
#

scale ๐Ÿคข

rotund token
#

i guess it's because it bakes scale into the collider and leaves entity at 111 instead

#

and adds it in post

robust scaffold
#

Annoying because rendering requires scale.

#

Ya know, off all the things they baked, physics body really shouldnt be baked. At least key parts like layers.

#

This is one feature I wish I could use from Latios' framework. But them introducing their own transform variant breaks compatibility with netcode and that's a no-go for me.

robust scaffold
#

Strange warnings. All entities clearly have scene section component

rotund token
#

oh good

balmy thistle
#

Should be harmless, is that actually causing any problems?

drowsy pagoda
#

I want to add a Material to the RenderMeshArray. Can I do that using a Baker and how can I get access to that shared component?

muted field
#

why do we need to use TempJob if we pass native array to the job instead of just Temp

brave field
#

Can I still stay at TransformV1? Lots of things breaking. ๐Ÿฅฒ

muted field
#

my step through debugger is really buggy when checking job code

#

jumping all over the place

#

kind've a pain when trying to debug stuff

balmy thistle
brave field
rustic rain
#

new version?

#

is baking still borked?

robust scaffold
#

Lots of warnings but warnings don't block compilation

rustic rain
#

๐Ÿ‘

robust scaffold
robust scaffold
rustic rain
#

I don't have either ๐Ÿ˜…

robust scaffold
#

Well you're good then.

#

I disabled physics interpolation and I saw 0 difference in graphics so eh.

rotund token
#

work done

#

back to 1.0 let's go

#

been thinking about aspects all day, whether i love or hate them ^_^'

rotund token
#

Loading Entity Scene failed because the entity header file couldn't be resolved. This might be caused by a failed import of the entity scene.

#

[Worker1] Exception thrown during SubScene import: System.ArgumentException: __UnmanagedPostProcessorOutput__220684074 must already be filtered by ComponentSystemBase or ISystem
same previous issue unfortunately

#

so subscene issues aren't completely solved

#

EntitiesJournaling: Failed to resolve system handle for global system version 112085.
UnityEngine.Debug:LogError (object)
Unity.Entities.EntitiesJournaling/JournalingState:GetSystemHandle (Unity.Entities.EntityComponentStore*,uint) (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/Journaling/EntitiesJournaling+State.cs:501)
new one when i turned on journaling outside of play mode

rotund token
brave field
rotund token
#

i didnt get it once in 2hours this morning

#

but now i've got it twice in 2 recompiles

brave field
#

But I guess it's still much better than before?

rotund token
#

well it was this morning, it's not right this second ๐Ÿ˜…

#

doing a full library nuke as a longshot

proud jackal
# robust scaffold It's beautiful.

Glad you like it, managed to sneak in GetXTypeHandle :3

Fun fact there's an IJobEntityChunkBeginEnd now too to get a callback of when chunk iteration begins and ends inside an IJobEntity! :3

rotund token
#

Oh we noticed

#

First thing I squealed about ๐Ÿ˜„

proud jackal
#

Hehe, I remember you mentioning it quite a lot, I even gave you a sample of how to do it yourself.. Now you don't have to ๐Ÿ˜†

rotund token
#

This has version has pretty much everything I want except default interface methods for isystem

#

So much code cleaned up

proud jackal
#

Wait, we dont? Could you check again? ๐Ÿ˜†

rotund token
#
    public interface ISystem
    {
        [RequiredMember]
        void OnCreate(ref SystemState state);

        [RequiredMember]
        void OnDestroy(ref SystemState state);```
#

confirmed coming?!

#

๐Ÿ˜„

proud jackal
#

Whaaaaaa.... ๐Ÿ‘€ Forget i said anything hehe๐Ÿ˜†

rotund token
#

i really need to figure out what the hell this monoscriptgenerator is

#

i add my own rosyln analyzer to project and it causes a bazillion warnings on it now

#

well ok it's coming from the actual unity engine
2022.2.0f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.SourceGenerators.dll

brave field
#

@proud jackal Now is that possible to ecb.CreateCommandBuffer inside IJobEntity?

viral sonnet
#

Fixed an issue where inspecting an Entity in play mode would mark its chunk as changed every frame.
finally!

viral sonnet
#

yeah, it doesn't screw with it anymore

viral sonnet
#

nice to see my fix made it into HierarchyGameObjectChanges ๐Ÿ™‚

rotund token
#

okkkkkkkkkkkkk

#

finally tracked down this source generator issue

#

seems like AdditionalFiles in csproj breaks source generators in rider

#

huge waste of time, and i have no workaround atm

proud jackal
pulsar jay
#

Is it possible to exclude components directly in jobs ord do I have to provide a query for that?

viral sonnet
#

is new physics on the new transform system?

#

Translation/Rotation can't be found anymore so it seems so

rustic rain
#

new physics? ๐Ÿ‘€

viral sonnet
#

entities and physics are now on pre.15

#

adding ENABLE_TRANSFORM_V1 at least fixed the compile errors. now on to the rest

#

PropertyInspector moved to Unity.Entities.UI.Editor

pulsar jay
rustic rain
pulsar jay
rustic rain
pulsar jay
gusty comet
viral sonnet
#

ah cool, time to change then ๐Ÿ˜„

pulsar jay
#

Does the new Physics version handle Colliders in parent/child hierarchies? We are still on 0.51 atm.

safe lintel
#

@rotund token what dont you care for about with aspects?

#

also @pulsar jay i havent yet fixed all my compile errors ๐Ÿ˜ข but my blind assumption is its the same as it was before(static yes, dynamic no), I didnt see any indication things would change and I did lobby hard for physics rigidbodies to respect the old transform system

pulsar jay
#

Also spawning objects with joints is really broken as the part are disconnected and spawn in their original position before physics moves them to their dedicated joint position

gusty comet
pulsar jay
#

I would really like to just stick to colliders in a hierarchy and do physics checks against them

#

But they either get combined or unparented (even in kinematic mode)

#

Or is this even the latest preview version? The 1.0 is still experimental is it?

safe lintel
safe lintel
#

I hope santa unity is listening ๐ŸŽ… ๐Ÿ™

pulsar jay
#

Is it possible for components to reference other component types?
Thinking of building a generic RemoveComponentOnEntity component which can have the target component type as a value.

pulsar jay
rustic rain
#

it's not gonna be persistent between instances of game

pulsar jay
#

A System.Type does not work because it is not a value type

#

A RemoveComponentOnEntity component would need to have the ability to store which type of component to remove

rustic rain
#

nothing stops you from doing that

#

just keep in mind, that data between game instances can vary for component types and indexes

pulsar jay
rustic rain
#

no

#

only runtime

#

it's initialized during world creation

brave field
pulsar jay
rustic rain
#

what generics? ๐Ÿค”

pulsar jay
brave field
#

Unity 2022.2.0f1 looks like can't build android properly ๐Ÿฅฒ

brave field
safe lintel
pulsar jay
misty wedge
#

If I need to make an array of differently typed structs available inside a job (as as blob), do you think it makes more sense to store this inside a blob array as a union of all types or a blob array that holds blobreferences to each other instance (that is then also a blob)

#

I guess another alternative would just store an array of intptrs or something inside the blobarray, but I'm pretty sure the safety system doesn't like that

storm ravine
oblique cosmos
#

Does DOTS offer any tools for dealing with generics of some description? For instance, say I have 3 different spawners, one spawns stuff in a cube, one in a triangle and one in a sphere or whatever. Is that typically a problem one solves by throwing boilerplate at the problem, that is make a new component and system for each type, or are there some tools to help with such things? I imagine interfaces don't play very well with DOTS, right? Inheritance probably doesn't, either? How do people typically approach things like this?

rustic rain
oblique cosmos
#

Well, that's the thing though, they are fairly similar. Like, take the example, cube and pyramid are almost identical and sphere just needs a radius rather than 3 dimension lengths, but ultimately they're all still following the same pattern. It feels a bit silly to write out the whole thing for each of these minor variations?!

rustic rain
#

if you can make it so it depends on just variables - then can probably be merged

#

otherwise no, different logic = different systems

#

nothing wrong with it though

#

by separating different logic into different jobs you actually optimize stuff

oblique cosmos
#

Well, it's not just the system, I need entirely new components and everything

rustic rain
#

not really

pulsar jay
rustic rain
#

you can split shared data into separate components

misty wedge
#

It really depends on what you are doing imo, dots physics handles different colliders within the same system

pulsar jay
#

Technically it should be possible to use generics but only with jobs that dont use code generation. E.g. IJobChunk

oblique cosmos
rustic rain
misty wedge
#

I'm assuming @oblique cosmos has a limited set of components (triangle, sphere, etc) going from his message

#

That's why I said it depends, it's hard to say from the outside

misty wedge
balmy thistle
pulsar jay
#

In this special case you could split it into separate jobs. One for each shape to generate spawn positions and another one that spawns at arbitrary positions

oblique cosmos
#

Yea, so, I'm basically just testing stuff out. So the situation is I have 3 different shapes. A cube, a pyramid and a sphere. All of them need different logic to find a spawn point inside of them and, in the case of the sphere, a different variable. But that's it, prime example of interface usage, for example. But I'm guessing that doesn't really play well with ECS?

oblique cosmos
#

I guess merging those systems and just making different jobs would be another way to go ๐Ÿค”

#

By which I mean way more sensible, for some reason I just didn't think of it lol

pulsar jay
#

you could also do the same just with static methods

#

having a static spawnAtPositions(NativaArray ...) method and call it in each of the 3

#

so at least you dont have redundant code

#

but still have the boilerplate of the 3 jobs/systems

oblique cosmos
#

Well, right now I'm already using a static method for each of the calculations, so it's essentially one line either way and technically no repetition on that one :P

#

Hm. Well, I mostly just came here to figure out whether I'm crazy or whether that's just how people do things. Looks like it's just how people do things, so I suppose my question is answered

#

Was just curious if any of such conveniences have survived the ECS treatment, but I didn't really expected them to, since that's kinda antithetical to the whole point

pulsar jay
#

I tried to implement my own simple version of it but stopped after realising it wont work with IJobEntity

#

I just got a burst error in AddSharedComponent ๐Ÿ˜ฌ
Is this an ecs bug?

(0,0): Burst error BC1051: Invalid managed type found for the field `EqualFn` of the struct `Unity.Entities.FastEquality.TypeInfo`.: the type `System.Delegate` is a managed type and  is not supported
signal phoenix
safe lintel
#

Does 1.0 pre15 appear in the package manager yet? (Iโ€™m traveling and just on mobile) Kinda wondering if dots addressables is out but just hidden visibility on the package manager, seems weโ€™re getting kinda close to release but the absence of dots addressables is a bit sus given there was talk of it being included in 1.0 rollout

humble vault
pulsar jay
pulsar jay
#

Otherwise I am to anxious to use it / maintain it throughout the ecs version changes ๐Ÿ˜ฌ

pulsar jay
brave field
misty wedge
pulsar jay
misty wedge
#

Can you pase the SplineBlobHolder component?

#

or is that the only field in it

pulsar jay
#
public struct SplineBlobHolder : ISharedComponentData
{
    public BlobAssetReference<SplineBlobAsset> splineBlobReference;
}
#

just that

misty wedge
#

Ah, you are on 0.51?

pulsar jay
#

yes. Is this a known bug?

misty wedge
#

Where are you calling AddComponentShared?

pulsar jay
#

from IJobEntity

misty wedge
#

Are you burst compiling it?

pulsar jay
misty wedge
#

You cannot reference shared components in a burst compiled method in 0.51

#

only 1.0+ supports unmanaged shared components

pulsar jay
gusty comet
robust scaffold
gusty comet
drowsy pagoda
#

Is there a way to inject a Material created by authoring into the world's RenderMeshArray during Baking phase? Or am I looking at picking it up on the first frame of ECS runtime and inject it via ISystemBase?

brave field
rustic rain
rotund token
# safe lintel <@133111808562036737> what dont you care for about with aspects?

Firstly I'm far from set in stone in my opinion about this and I have absolutely no issue for reading, it's an elegant system and my concern is more fundamental with writing and what it implies.

Over the years I've been slowly drifting towards ensuring only a single system is responsible for writing to a component. Many reads, 1 write.

Long term I have found this to be a much easier to maintain, develop and debugging experience.

Aspects, when writing is allowed, seem to promote the opposite.

balmy thistle
#

What would you say the benefits are in having a single system which writes a particular component?

rotund token
# balmy thistle What would you say the benefits are in having a single system which writes a par...

Much easier to debug where values are set. Journalling has greatly helped in this regard but it's still just easier to debug if it's only 1 place you know the data is being set.

It mostly eliminates ordering issues. No accidental write, read, write, read throughout the world. All systems reading will read the same value and I have complete control over timing, I know always when and where something will be set.

Refactoring is easier, only 1 place to care about if I need to change behaviour.

#

Timing issues have been the biggest large project multi developer issue we've been facing. Large parts of the project just write/read without much though and anecdotally the features that have strict ownership over components have had significantly less issues long term.

balmy thistle
#

Do you ever find it restricting or difficult to work with?

rotund token
#

Personally no, but I think a lot of people would

balmy thistle
#

I could imagine having to create components types just to cache writes in order to collect them later on

#

for example if you wanted to intercept all the places throughout the frame where people might want to write transforms

rotund token
#

I should clarify, it's not everything. I have plenty of components that have multi writers but these are usually for triggering behaviour elsewhere in the project.

#

Like I have this very thorough cleanup/destroy pipeline where every entity must go through for cleanup throughout all my libraries. I only have 1 single DestroyEntity in the entire project and you can only trigger it by setting a byte to 1 on EntityDestroy component.

balmy thistle
#

I'm not sure I see how aspects necessarily change the approach - you don't want people writing transforms mid-frame, you don't want them using aspects either

#

in both cases you have to have an alternative state-change-collecting component that you resolve later on and actually apply the transform

rotund token
robust scaffold
#

I like the concept of aspects but frankly I find myself never using them. Direct access of the specific component I need is what I'm finding most used.

signal phoenix
#

One thing I find Aspects good at is to provide a container for several component types, which can then be "passed around" as parameter to functions that need to read/write those components. Instead of having functions taking 12 components by ref, you can just have functions that take an Aspect containing these 12 components as parameter.

A practical example would be writing a state machine for "Enemy AI". Each state would have its own separate function taking the EnemyAspect as parameter. EnemyAspect can then contain all the component data that any state update might need access to, and so state functions are free to operate on that data. Here we're assuming that we're dealing with a case where an archetype-based state machine would be a poor choice

In practice there have been few cases where I've felt like Aspects were necessary, but those few cases would've involved a hellish amount of boilerplate and maintenance costs if Aspects didn't exist

frosty siren
# signal phoenix One thing I find Aspects good at is to provide a container for several component...

Some years ago when dots was only starting I remember recommendations to not access data we don't use. Sometimes even filtering could be better then accessing everything in your world, of course depending on scale. Aspect as I understand would trigger all 12 components to gather from chunks, which sounds not as performance by default (sorry me for appealing to this). So maybe dealing with aspects in this way isn't the best case.

rustic rain
#

that's kind of why I don't really like Transform aspect

signal phoenix
# frosty siren Some years ago when dots was only starting I remember recommendations to not acc...

This is true most of the time, but there'll also be other times were the performance costs of trying to set things up for idiomatic ECS iteration will actually outweigh its benefits. It may be because it involves too many structural changes all the time, or because it involves too many jobs to schedule, or because it is checking for changes all the time, etc...

Basically, there's a point where structural changes and job scheduling costs become a much bigger evil than imperfect memory access patterns

frosty siren
rotund token
#

transform aspect definitely solves one of the biggest issues that < 1.0 had

#

but there are a bunch of what feels like incomplete features in transform v2 atm

#

so i'm trying to reserve judgement until those are (hopefully) resolved

#

(staticoptimizeentity is gone with no viable replacement as far as i can see as TransformUsageFlags currently don't work except for ManualOverride, so we just have giant archetypes atm)

drowsy pagoda
#

Currently I just created a managed IComponentData that holds a reference to that material which is assembled during baking. Then in an ISystemBase I have a job that looks for that managed component, and then EntityManager.GetAllUniqueSharedComponentsManaged<RenderMeshArray>() and add that material to the renderMeshArray.Materials array. If there is a simpler way, I'm all ears ๐Ÿ™‚

frosty siren
drowsy pagoda
frosty siren
drowsy pagoda
robust scaffold
# gusty comet looking forward to seeing your creations!

Tried playing around with the content management tools and I'm way over my head. Please send a note to the netcode folks to try and publish a sample using their package that incorporates this loading pathway. Things like predicted spawning, ghosts, and hybrid components really dont play well with asynchronous loading.

viral sonnet
#

heh, i just wanted to ask if anyone has tried this new content management thingy.

#

seems complicated ^^

robust scaffold
#

Yea. Right now I have a thread bound full scene (not subscene) load and switch which causes a 4 second lag but otherwise does everything automagically.

#

I have unconverted game objects, a few scenes, and entities with sprite renderer hybrid components.

viral sonnet
#

i need to wrap my head around it before i convert anything with it. this is basically assetbundles for dots, right?

robust scaffold
#

Maybe? I never used asset bundles outside some free assets on the store

autumn elm
#

hey everyone
i want to try pre.15, but build fails with

Shader error in 'Universal Render Pipeline/Lit': Program 'LitPassFragment', error X4567: maximum cbuffer exceeded. target has 14 slots at line 98 (on d3d11)

#

2022.2.16 dx12 and dx11 api enabled if that matters

robust scaffold
autumn elm
#

trying it rn

#

yes, error still occurs

robust scaffold
autumn elm
#

i don't have any custom rendering code in this project

muted field
#

in the debugger what colour indicates the job was using burst?

rotund token
#

green

muted field
#

ah hmm they are blue and i dont know why

#

i used the attribute BurstCompile

rotund token
#

what version

muted field
#

of burst or unity?

rotund token
#

unity

muted field
#

2022.1.23f

rotund token
#

show 1 example of code

#

they shouldn't not compile anymore without an error

muted field
#
    [BurstCompile]
    private struct DeformJob<T> : IJobParallelFor where T : unmanaged, ISpline
    {
        NativeArray<float3> _vertices;
        NativeArray<float3> _original;
        T _s;
        float _tMin;
        float _tMax;
        public DeformJob(in T spline, in float tMin, in float tMax, in NativeArray<float3> vertices, in NativeArray<float3> original)
        {
            _original = original;
            _vertices = vertices;
            _s = spline;
            _tMin = math.clamp(math.min(tMin, tMax), 0, 1);
            _tMax = math.clamp(math.max(tMin, tMax), 0, 1);
        }
        [BurstCompile]
        public void Execute(int i)
        {
            Set(_s, _tMin, _tMax, _original[i], out float3 result);
            _vertices[i] = result;
        }
    }
#

this is my job

rotund token
#

generic job

#

how are you calling it

muted field
#
        var no = new NativeArray<float3>(original.Length, Allocator.TempJob);
        var nv = new NativeArray<float3>(vertices.Length, Allocator.TempJob);

        MemCpy(original, no);

        var t1 = math.clamp(math.min(tMin, tMax), 0, 1);
        var t2 = math.clamp(math.max(tMin, tMax), 0, 1);

        var job = new DeformJob<T2>(spline, t1, t2, nv, no);
        var handle = job.Schedule(vertices.Length, 4);
        handle.Complete();

        MemCpy(nv, vertices);

        no.Dispose();
        nv.Dispose();
#

like this

rotund token
#

yeah this won't work

muted field
#

why not ?

#

doesnt support generics ?

rotund token
#

burst requires types of be explicitly defined

#

new DeformJob<int>(spline, t1, t2, nv, no);

#

would be fine

muted field
#

damn

muted field
#

i guess i can do an overload method instead with the type defined then

rotund token
#

you need to somewhere in your project explicitly define each variation of the generic job

#

there are a few tricks you can do

muted field
#

i could do a swtich statement on the generic type to cast to the precise type

rotund token
#
{
    public virtual Job<T> Job { get; }
    
    public struct Job<T> : IJob {
    
        public void Execute()
        {
        
        }
    }
}```
#

is my current workaround for this

muted field
#

like this perhaps ? case Bezier b: job = new DeformJob<Bezier>();

rotund token
#

theres an attribute

#

[RegisterGenericJobType(typeof())

misty wedge
#

If the leak detection is part of the allocator in the future, that would mean that it would also detect leaking blob asset references, right?

#

iirc they didn't have dispose sentinels in the past

muted field
rotund token
#

hmm it might be

#

i honestly not sure if it does anything special

#

simply having the implementation somewhere is good enough

muted field
#

yeh it seems its part of entities so i might wait for 2022.2

rotund token
#

in an attribute is just a nice place

muted field
#

ill use a simple switch for now

#

and remind myself to change it when entities is fully done ๐Ÿ˜„

drowsy pagoda
drowsy pagoda
# frosty siren I have sprite rendering system and i do exactly the same to get materials to pro...

I'm getting strange behavior. Can you show me how you modified the renderMeshArray.Materials array in the shared component? Each time to change it's size by adding my own Material reference and write that back to all entities that hold it (either individually or using query), all the meshes that appear in scene disappear and their MaterialMeshInfo indicies all become negative numbers, and the shared component they have have null reference to Materials!

robust scaffold
#

Ya know, after staring at the docs for netcode custom templates for a few hours, i think I now know what it's doing. Kinda. Lack of linters or any sort of code coloring is pain. My previous 2d variants for transform (needed to convert from V1 to V2) was broken because I forgot a semicolon and has been broken for weeks.
With no error. It's pain

misty wedge
#

Are blob references somehow being magically auto discarded?

#

Because I thought that's not a thing

#

however

#
Debug.Log(AbilityNodes[i].IsCreated);
AbilityNodes[i].Dispose();
#

What's going on here?

robust scaffold
rotund token
misty wedge
#

BlobBuilder.CreateBlobAssetReference

rotund token
#

yes but where

#

during baking

misty wedge
#

Runtime

rotund token
#

are you using a blob asset store

misty wedge
#

No blob asset store

rotund token
#

then it should be fine

#

are you disposing in separate parts of your project?

misty wedge
#

The builder allocator is is temp and the blob is persistent

rotund token
#

are you writing back the disposed blob?

robust scaffold
#

Obviously baked blob colliders are reference counted but even runtime blob assets seem to be automatically disposed.

rotund token
#

i dispose plenty of blobs without issue

misty wedge
#

I can't see how they are either, they just allocate memory

rotund token
#
        where T : unmanaged
    {
#if !NET_DOTS
        [Properties.CreateProperty]
#endif
        internal BlobAssetReferenceData m_data;```
#

blob asset reference

#

doesn't hold a pointer to it's data

robust scaffold
# rotund token pretty sure they're not

I've been cloning colliders to overwrite their filters and disposing the old ones. Not the original colliders from baking but 2 clones away. Yet I can not dispose of them strangely.

misty wedge
#

I mean it kind of does, that struct has a pointer

#

Oh you mean the data of the reference

rotund token
#

var a = default(BlobAssetReference<int>)

var a = b;
var c = b;

a.Dispose();

#

what does c hold?

drowsy pagoda
#

I wish to add a Material into the RenderMeshArray. However, after I apply the new material array to renderMeshArray.Materials and then write that back to each entity that had the original shared component. All the meshes disappear, and each of their MaterialMeshInfo component shows negative indices and their RenderMeshArray shared component shows a NULL reference to the Materials array.
What am I not understanding here? Is this a bug, or is there something I need to oversee when writing the new array?

robust scaffold
#

And will blob colliders without reference trigger the leak detector?

rotund token
#

from my test yesterday, at least tempjob is tracked on normal leak detection but tracking disappears when you put full stack trace on

#

i do not believe they will be though

misty wedge
robust scaffold
misty wedge
#

They are only being disposed once, since I'm logging it and not disposing it anywhere else

#

Something is definitely breaking somehow

#

If I dispose of the blobs unity crashes

#

and it crashes in a really weird spot too

#

I if I don't dispose it everything is fine, although I have no idea if it's leaking

#

Are there any issues with storing a blob asset reference inside a blob?

rotund token
#

just tested

#

i have no issue disposing a blob asset

misty wedge
#

How would I store a pointer inside a blob then? as an IntPtr?

rotund token
#

blobptr

misty wedge
#

I thought that's only if the memory is in the same blob

#

It's not

#

It's a separate blob

rotund token
misty wedge
#

Why can't it store a memory address?

#

e.g. create blob1, create blob2.
blob1 has a field BlobAssetReference<Blob2Type> reference, set that to blob2

rotund token
#

look at BlobBuilderArray.CreateBlobAssetReference

misty wedge
#

You mean BlobBuilder.CreateBlobAssetReference?

#

I think maybe the issue is I'm copying the blob, although I'm still confused why that would be an issue

#

Since the data would be the same, including the memory address of the referenced blob I want to dispose

rotund token
#

wait

#

you have a list of blobassetreferences

#

so your blobassetreferences in this list also in the blobasset?

misty wedge
#

I have one blob with a BlobArray<BlobAssetReference<T>>

#

but the "parent" blob is not in that array

#

if that's what you meant

#

The weird thing is, I also have other blobs that have blob asset references in them, and they work fine and dispose fine without issue

#

e.g.

#

Maybe the issue is that its in a blobarray somehow? Although I don't see how that would matter

rotund token
#

yeah i was about to say that blob objects move their memory

#

when creating

#

they put everything in the same block

misty wedge
#

But the blob asset reference in that screenshot is also in that block

#

a blobarray is just "multiple" blocks

misty wedge
#

as long as the blob ptr is allocated to the correct size initially casting it back to the fake header size seems to work fine

#

I initially misunderstood what blobptrs are for, so maybe Ill just use them instead of blob asset references (inside of blobs)

#

I'm assuming the "ptr" is also disposed together with the entire blob (since the "ptr" in this case is just a place inside the allocated memory block for that blob asset)

rotund token
#

honestly, i would just not use blobs here at all

#

if you're doing it at runtime

misty wedge
#

I have a lot of nested data structures

rotund token
#

so restrictive

misty wedge
rotund token
#

do you only dispose this once at end?

misty wedge
#

I dispose it when the client or server shuts down

#

(and create it when the client or server starts)

rotund token
#

i just wrote my own simple memory allocator for this

#

and just use a custom memory allocator

#

then just dispose that

#

rather than every element

misty wedge
#

So like a collection of pointers?

rotund token
#

don't have the annoying blob ref limits etc

misty wedge
#

You mean that you can't copy any blob data?

#

I guess the difference to your version is that it's not all in one block

#

unless you use a single struct

#

without any pointers

rotund token
#

i have other allocators that keep memory together

misty wedge
#

I just mean that that's kind of the reason blobs have these weird restrictions

#

Whether or not they make sense is a different question I guess

#

I don't really mind them at this point

#

@rotund token any idea why disposing the blob crashes unity though? I have no idea why

#

It has to be disposing the wrong memory for some reason

#

Huh, interesting. In a more simple example unity actually detects that I am doing stuff that isn't allowed

#

I guess through 28 different layers of generics that detection breaks

#

I'm very confused why my other blob asset references inside blobs aren't causing any issues then...

#

And I also don't fully understand why storing a pointer inside a blob isn't allowed. I understand it breaks the "a blob is a single memory block thing", but that pointer should still be valid

autumn elm
#

for some reason my custom baked component disappears from entity when i close subscene, is this the expected behavior? it was different in 0.17 UnityChanThink

#

replacing TransformAspect with LocalTransform helped, but .. why lol

misty wedge
#

magic

#

For anyone wondering it was crashing because I was copying the blob

drowsy pagoda
#

Can someone please help me figure out how to inject my own material into the RenderMeshArray?

muted field
#

@rotund tokensorry for ping again - i did some changes with my generics thinking this would fix it but now i get an error about boxing a value type to a managed object

        JobHandle handle;
        switch (spline)
        {
            case Bezier b:
                handle = new DeformJob<Bezier>(b, t1, t2, nv, no).Schedule(vertices.Length, 4);
                break;
            case LineSegment l:
                handle = new DeformJob<LineSegment>(l, t1, t2, nv, no).Schedule(vertices.Length, 4);
                break;
            default: return;
        }

Thought this would work because im specifically defining the type?