#archived-dots

1 messages ยท Page 282 of 1

rustic rain
#

you need to create a complex stuff

#

I needed tweening

devout prairie
#

did the dotween port not work out?

rustic rain
#

nah, Polymorph components break on generic types

#

and I couldn't fix it quickly enough, before I burn out

devout prairie
#

yeah

#

damn

#

i'm sure a pure dots tween engine wil be possible

#

maybe someone will invest the time

rustic rain
#

it is possible

#

I already know how to make it

#

but I am not doing it without either fixed codegen in polymorph

#

or some other fancy way to achieve struct conversion

solemn hollow
#

the whole point is to be in unmanaged land as long as possible ^^. I just spawn a gameobject for an entity from a prefab and do all my managed stuff on there. its not really that hard and you still get to use pure dots for everything else

devout prairie
#

maybe just avoid polymorphism completely as it's kinda the opposite of dod right

rustic rain
#

meanwhile it's not even used in it's capabilities

#

since amount of entities is always small

solemn hollow
rustic rain
solemn hollow
#

yah go for it. just dont say stuff like you like the hybrid workflow. cause u aint using it ๐Ÿ˜„

remote crater
#

Yup, I'm a moron, I already had a user interface gameobject doing just that, and I can slap her on that. I been so long in the tech depths I forgot my brain exists.

rustic rain
#

wait what

#

someone is using Unity not for games, but for utility application

#

๐Ÿค”

#

considering possibilities of such fast calculations with burst seems understandable

#

also you have any sort of UI framework to work with

#

also ability to easily port it to literally any platform

solemn hollow
#

ofc. i wrote a GIT projectmanagement graph tool in unity. even without dots it was used for applications

rustic rain
#

๐Ÿค”

#

Oh man, I didn't even realise

solemn hollow
#

GameEngines are also commonly used by now for filmmaking, motiontracking etc

rustic rain
#

yeah, filmmaking is totally understandable
Especially considering Unity is officially supporting it

#

but desktop utility app, oh man

#

smth not very obvious

karmic basin
#

architecture, car industry, digital twins, serious games, ... the list goes on and on

viral sonnet
#

our mobile app is 99.9% a 2d tool app and in unity. why make something native, in react, xamarin or the other trash when you have unity? ๐Ÿ˜€

#

we had long discussions about it and the worst fears were projected on this decision. we had 0 problems

#

i'm at a point where i'd do pretty much anything, client side in unity

rustic rain
#

are there any cameras?

#

or simply just UI?

viral sonnet
#

just ui but i've recently added some particles:)

rustic rain
#

welp, you assured me

viral sonnet
#

unity ui, uielements wasn't around

#

now i'd do it in uielements

rustic rain
#

now I will certainly use Unity for any desktop app

#

kek

#

at least try

viral sonnet
#

yeah i mean why not. especially on desktop. even on mobile battery usage isnt much of a problem. sure if anyone uses it for like 3 hours a native app would win but who does that?

solemn hollow
#

how do you guys spawn a staticoptimizedprefab at runtime? all children end up in 0,0,0 for me because ofc they are not moving with the virtual parententity i can set the transloation of....

#

Is the static tag even used anywhere in the transform systems (cant find it)? or is it just a tag for debug purposes? spawn the prefeb without it beeing static and then remove Translation,Rot,Scale from it?

rotund token
#

I think it's used somewhere but I can't remember

#

Maybe renderer

remote crater
#

Stuck on compiling a standalone again

#

The hell that is compiling a standalone with UNITYs experimental packages never ends... I just wish they didn't depreciate packages that did work.

#

I don't want to update my steam page telling the reason I can't get the promised update is due to Unity having tons of bugs.

#

But it's been 100 hours of this nonsense and its looking like no choice.

#

I just don't get... why if addressables worked in last standalone compile and nothing changed except an extra rebuild... why would they not work again?

viral sonnet
#

don't you have a repo with a working state?

remote crater
#

Its the same one as what I have here.

#

I literally didn't change addressables at all, but they won't work anymore.

viral sonnet
#

and unity and entities has the same version?

remote crater
#

I distinctly remember addressables not working on a new build of addressables(just misclicked the build button and let it cycle through) back in the version it worked in.

#

Its like sometimes addressables just doesn't work. I saw the issue online. Someone said it takes 20 to 50 tries for a standalone to work.

solemn hollow
#

try clearing all caches and start a clean build

remote crater
#

I did that like 30x

#

Wait

#

I can clean liberary too

#

I think maybe what I did was... I manually copied a directory of data from my Editor to my live and it worked last time

#

But I'll delete library and restartit

#

good first step

remote crater
#

I didn't go into work today, I promised my users a patch.

viral sonnet
#

some pitfalls in addressables, the build target is not correct, like win32 != win64. the addressable cache got corrupted or the addressable cache still has editor loaded so win64 isn't loading. best to test on a pc that never had the unity editor running.

remote crater
#

I think maybe my build target is not correct.

#

I just use out of the box build targets, but I compile to D:/starfighter

#

I tried targetting D:/starfighter and it seemed like I got more errors

viral sonnet
#

are you loading the addressables with cache? it's just a buildIndex that is set

remote crater
#

Addressables is not advanced technology, it was in FlashPlayer and earlier techs... Loading on the fly shouldn't be crazy hard to pull off as it'd been done for decades... On top of this, I never saw an IDE which promised to build standalones that couldn't.... I'm a teeny bit frustrated, but I love Unity and I'll roll with it.

viral sonnet
#

I rephrase that, do you load them from a server?

remote crater
#

no

#

I just want gameobjects that load on the fly as the game plays

#

It saves my game loading time from 8 minutes seconds to 3 seconds.

#

All my files are local

#

The worst part is I simply used the resources folder and everything was awesome, but that solid functionality got depreciated to not work in a few ways before the "experimental" package was fully functional. I'll be fine, I'll roll with this especially if someone can help me consistently compile a standalone without grief... It's just been a long 100 hours the past 3 weeks wrestling with these Unity Bugs.

viral sonnet
#

have you checked all addressable assets that they have valid scripts on them? also, as stated here, you can do it manually Addressables needs some files at runtime to know how and what to load. Those files are generated when you build Addressables data, and wind up in the StreamingAssets folder. This is a special folder in Unity that causes all files in that folder to be included in the build. When you build content, we do not immediately put files into this folder. Instead they are staged in the Library. When you build the player, we copy the requried files over, do the build, then delete them. This is done so that a user can build data for multiple platforms, but only get the relevant data included in their build.

#

check if the library folder has all files and are correct

#

and yeah, I agree, addressables can be quite finicky. resources folder was more straight forward. less "magic" that can break

remote crater
viral sonnet
#

resources folder is not deprecated?

remote crater
remote crater
# viral sonnet resources folder is not deprecated?

I was doing fancy things with the resources folder, and I was told the reason my fancy things no longer compiles was because what I was using was depreciated... I may have gotten bad advice tho, so maybe it wasn't.

viral sonnet
#

the last time I've used addresables was a non-dots game. maybe the new build mode screws things up or smth?

remote crater
#

I think I have to find out where streaming assets compiles to my main project and manually copy it by hand to the build folder, but I'm not sure why Unity doesn't have that as default behavior.

viral sonnet
#

not sure what you were doing but resources folder works still the same

remote crater
#

Like the resource folder data wasn't being copied to my standalone directory

#

In the past year, I spent about 500 hours just trying to get standalones now that I think of it since this isn't my first 100 hour rodeo.

viral sonnet
#

hm, that's weird. i instantiate and convert a prefab from the resources folder. works fine

remote crater
#

Did you build to standalone and convert to entity?

#

I can do all that stuff in the editor as well

#

It only breaks on standalone

viral sonnet
#

also for builds

remote crater
#

Then I get the error messages of not being able to find the data, because Unity didn't bring it with the .exe

#

Here. I'll do a sub 1 minute video, you'll see what I mean. (can't make video til my library rebuilds, normally takes a half hour or more)

viral sonnet
#

so adressables AND resources folder aren't working? i can reall only think of a broken prefab

#

some deleted script or smth

#

the addressable build process shoukd tell you that though ๐Ÿค”

remote crater
#

The addressables build works fine

#

I think what is happening is: Unity is not copying over the data files it built for addressables to my location of my build.

#

I remember if I copy/pasta it from my unityProject directory to my unityRelease directory (d:/starfighter), it may work

#

I need to find out what to copy, but a Unity user should not have to do this ever

viral sonnet
#

how does your addressable profile look?

remote crater
#

Enzi, thank you so much for trying to help. If I make MMORPG bank, let me know you remembered and I'll help you out.

#

My paths look odd

rotund token
#

Why are you using custom paths

#

And is there a reason you're loading via remote path not local?

#

Do you upload your bundles to a server?

viral sonnet
#

he said no server

#

yeah your paths look odd

rotund token
#

Then why is it setup to be loaded via a server

viral sonnet
#

good catch

#

yep, load path should be LocalLoadPath

remote crater
#

Still ain't working, I'm just exasperated

#

The player.log says AssetBundle.Unload was called while the asset bundle had an async load operation in progress. The main thread will wait for the async load operation to complete.

#

And I never called that

viral sonnet
#

what are your new paths?

remote crater
#

Thats my player.logs, too big for paste.bin

#

Localbuildpath and localloadpath

#

Localbuildpath: [UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]

#

Localloadpath: {UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]

#

Its probably my paths.

#

If programming is like reading a clock and telling time, some children might think it difficult, but it isn't when you get to know how to do it. What is difficult is interfacing with some random engineer's API. That's when it becomes mind reading. Imagine buying a new Toyota truck, you get a clock, its off an hour, but how do you set the clock? Is there a set button, press the radio buttons, maybe windshield wiper, pump the break in a rhythm or play a zelda ocarina of time tune on your stick shift. There really is no way to know how to change the clock despite knowing how to tell the time, you're at the mercy of guessing what a Japanese engineer was thinking.

#

I coded all day today, literally since I woke til now, well it ain't coding, but trying to get this a standalone... This is what the last 100 hours of my life has been like: https://youtu.be/MvDZjxp9dSA Now I must sleep for I am exhausted trying this, it wears a man thin. I don't want to have to give my user base on Steam the truth: Unity engine bugs are holding me back.

Love API, hate that you can't compile to a windows standalone easy anymore.

โ–ถ Play video
viral sonnet
#

You are putting me off with this blame game tbh. Own up for the mistakes and/or inexperience. It'll be okay in the end.

karmic basin
#

Wise words

viral sonnet
#

hm, I made a nice comment in code that I should confirm this. I remove keys from a NativeParallelMultiHashMap in parallel. I checked the code and it should be threadsafe. Am I in the clear?

rotund token
#

what's the code?

#

the default remove keys is definitely not thread safe

viral sonnet
#

oh nothing special, like mapCombatEffectsSpellIds.Remove(element.hash); the keys are unique.

#

hm, then I have to schedule this part? ParallelWriter has no remove

#
        {
            // First find the slot based on the hash
            int* buckets = (int*)data->buckets;
            int* nextPtrs = (int*)data->next;
            int bucket = it.key.GetHashCode() & data->bucketCapacityMask;

            int entryIdx = buckets[bucket];

            if (entryIdx == it.EntryIndex)
            {
                buckets[bucket] = nextPtrs[entryIdx];
            }
            else
            {
                while (entryIdx >= 0 && nextPtrs[entryIdx] != it.EntryIndex)
                {
                    entryIdx = nextPtrs[entryIdx];
                }

                if (entryIdx < 0)
                {
                    ThrowInvalidIterator();
                }

                nextPtrs[entryIdx] = nextPtrs[it.EntryIndex];
            }

            // And free the index
            nextPtrs[it.EntryIndex] = data->firstFreeTLS[0];
            data->firstFreeTLS[0] = it.EntryIndex;
        }```
#

looks threadsafe to me except the last part. hm

remote crater
#

Not being able to compile a windows.exe is Unity's fault and not mine, it's been like this for many on the scriptable build pipeline.

#

Addressables should work out of the box, it does not. This too is a bug of unity. It ain't a blame game, just fix Unity, plz.

#

I'm doing my absolute best to say nice things about Unity to this point. You guys have been greatly helpful, but Unity is the only IDE I saw since 1980 which will not compile a standalone when it claims it should.

rotund token
#
                {
                    entryIdx = nextPtrs[entryIdx];
                }```
you have a loop, if a value in the loop changes it can easily lead to an infinite loop (trust me run into that on hashmap before >_>)
#
// Someone writes to data->firstFreeTLS[0]
data->firstFreeTLS[0] = it.EntryIndex;```
viral sonnet
#

as no same keys are removed the index access should be unique have no race conditions. the last part is problematic though. yeah I dunno, do you have an idea to remove keys in parallel?

rotund token
#

it'd still share the same bucket

#

and rewrite the chain

#

that you are in the middle of iterating

viral sonnet
#

no adding is happening at this stage.

rotund token
#

oh so it's only removing in parallel

#

but no adding

viral sonnet
#

correct

#

yet I wonder if this is an oversight or smth. removing should be supported in a ParallelWriter, right?

rotund token
#

hmm not sure i agree

viral sonnet
#

me neither ๐Ÿคฃ

#

but removing doesn't seem that much out of the ordinary in parallel. there must be a reason though that it's not supported

#

even if they'd support it. I'd probably just complain that it's slow ... haha

#

oh man, //todo InvalidOperationException: HashMap is full that 100% has to do with the firstFreeTLS being overwritten because I was wondering why the hashmap is full yet the capacity is correct. well ... shit. gonna need to think of something else then. I'm building hashmaps with pointers to effects. now I'll be damned if I need to use a DB for that!

rotund token
#

yeah the one big difference between the native map and say my dynamic hashmap

#

is i removed the tls array

#

(basically what gives native hash map parallel support)

viral sonnet
#

hm there's ```internal static unsafe void FreeEntry(UnsafeParallelHashMapData* data, int idx, int threadIndex)
{
int* nextPtrs = (int*)data->next;
int next = -1;

        do
        {
            next = data->firstFreeTLS[threadIndex * UnsafeParallelHashMapData.IntsPerCacheLine];
            nextPtrs[idx] = next;
        }
        while (Interlocked.CompareExchange(
            ref data->firstFreeTLS[threadIndex * UnsafeParallelHashMapData.IntsPerCacheLine]
            , idx
            , next
               ) != next
        );
    }```
#
                    if (TryGetFirstValueAtomic(data, key, out tempItem, out tempIt))
                    {
                        // Put back the entry in the free list if someone else added it while trying to add
                        FreeEntry(data, idx, threadIndex);

                        return false;
                    }``` maybe I can use that
remote crater
#

Its like making a yacht that you cannot take out of port. I'm not the only one with this issue. I see lots of people with this problem dating back two years when the scriptable build pipeline was made. So why not just fix it?

#

Heck just hire me for a few weeks and I'll fix it for you.

remote crater
#

Actually, I just realized the pressure is off me now, my users don't expect frequent patches now, so I can focus on code and improving my game. Then when Unity gets around to doing basic .exe windows compiles again, I'll have a game ready. Thank God. I hate tech nightmares. I'd rather just make elaborate software architecture.

viral sonnet
#

My code is immaculate. ๐Ÿ‘Œ

#

You say you can't compile. Isn't your game technically just crashing?

rotund token
#

Unity & addressables builds fine - thousands of companies use it (mine included). I would not expect any changes that fix your problem.

#

You're not going to solve the issue until you take responsibility for it...

#

Also you should be making a build every week bare minimum

remote crater
# rotund token Unity & addressables builds fine - thousands of companies use it (mine included)...

I'm one of the absolute best UI guys on Earth, only knowing a couple better than myself. I have helped Google identify their Google ads website is bad, and still bad after their rework. I'm helping ebay in their redesign. I knew 98 websites were bad in 98 pointing to the future of menu based websites that came later. I knew more than the top guys at Carnegie Mellon when they pioneered a course of UI as they just were trying to figure stuff out. I love you for all the help you've given me in the past. You're knowledgable, helpful and a good guy. You are wrong here. If addressables does not compile for everyone right out of the box, it's trash tier design. I'll say it again: If you make a new technology and the default settings do not give the desired behavior everyone expects, it is trash tier design. Unity is not trash. Unity is a great software, but the addressables compile and scriptable build pipeline is trash that could be fixed easier than denying it is bugged for public relations/brand awareness falsehoods.

remote crater
rotund token
#

it does compile out of the box, literally go make a new project, add addressables, use default settings and add an asset to addressables and make a build

#

it will work

remote crater
# rotund token it will work

I like the cut of your jib. Though I think export my entire 14.5 GB MMO to an asset, and reimporting it might tax Unity in other ways.

#

Where we go tho, is isolate exactly where the bug is and reduce it to the bare minimum so that Unity could fix it. I believe I have your attention like I showed the IBufferElementData bug yesterday with authoring.

rotund token
#

IBufferElementData with Entity is a well known bug in 0.51

remote crater
#

This actually brings up a great point: Why is there no 'reset to default settings' with addressables.

remote crater
#

Look, in no way shape or form do I want to trash Unity. I think Unity is awesome.

rotund token
#

i'd be shocked if a preview package didn't have a bug

#

that's the risk you take using a preview package...

#

there are a lot more bugs than just that in entities 0.51

#

but that has nothing to do with addressables?

remote crater
# rotund token i'd be shocked if a preview package didn't have a bug

I'm fine with bugs happening, but the very first test every Unity dev should take is see if it compiles to windows standalone. You don't need remote assets building from websites. You don't need servers compiling for you. You don't need to reinvent version control for builds. Before you go fancy, just make sure windows compiles to windows.

#

Its like attaching nitrous to a car before you put on tires or put in an engine.

#

Much love to all you guys especially tertle and Enzi. I hope you don't get tribally opposed to me.

#

I just see a problem and I fix it, but if the problem is something I can't fix, I get exasperated. I see the UI as a problem, should be compile and go for everyone. Tertle brought up a great point for me to isolate the problem to the bare minimum, which might take another 100 hours on my end, so I'm just taking a breather.

viral sonnet
#

look, we wouldn't tell you this stuff if we wouldn't know you can fix the problem locally. unity can't/won't help you much here unless you have enterprise or whatever plan you need to get actual tech support. under normal circumstances addressables work out of the box. i would bet top dollar it's just a setting that breaks stuff.

#

you said addressables build fine. the exe builds fine but the game crashes while loading addressables. so ...

remote crater
#

In the editor it works

#

It is not the user that should figure out why the editor cannot be mimiced to standalone

viral sonnet
#

i know, the editor doesn't use addressables

remote crater
#

It does.

#

If I do not load them, my game won't play.

viral sonnet
#

acutally, it's a setting. default it loads them in a different way

#

that's why it works in editor and doesn't in build

rotund token
#

you have to build addressables then manually tell it to use your bundle instead

#

and anytime you make a file change, you have to rebuild addressables

#

this is why it does not use addressables - otherwise it's a 10min+ build between changes

remote crater
#

It's worked once before, but not again. Some people say they get it working 1 in 20 or 1 in 50.

#

Optimally: I load in code, then use the ui already there to pick what ones I want packaged (since I don't expect a code skimmer written), and you have that already.

rotund token
#

the pseucode looks like this

    if (editor)
        AssetDatabase.LoadAsset<T>()
    else
        Addressasbles.LoadAsset<T>();```
#

unless you select

#

Use Existing Build

#

you are not using addressables in editor

remote crater
#

I have many loadassetasync

#

The way I use Addressables is to load things on the fly.

rotund token
#

that doesn't mean it's using addressables look at my above code

#

in the editor, the mode it uses, is determined by the play mode script option

remote crater
#

Addressables.LoadAssetAsync<AudioClip>("Assets/Standard Assets/music/_sorted/CombatSpaceEasy1.wav").Completed += OnLoadDoneCombatEasy;

#

Thats a sample line of my code

rotund token
#

yes

remote crater
#

Addressables does work in my standalone

rotund token
#

thats not using addressables in editor

remote crater
#

I got it working once

#

Well in the editor when I'm playing the game

#

It works.

#

I think our vocabulary is mixed

viral sonnet
#

no you are not listening to what tertle says ๐Ÿ™‚

rotund token
#

let me repeat, **__That is not using addressables in the editor __**unless you change your option

remote crater
rotund token
#

I know it works in the live play version in Unity too now, stuff loads on the fly.
it works because you're not using it

remote crater
#

I just can't get it working standalone again. I think I copied a directory from my Unity Project into my standalone directory.... I just forget what I did, and I'm wondering why I have to.

#

I'm 100% using Addressables.

#

If I load without addressables, it takes 8 minutes to start my game instead of 5 sec

rotund token
#

take a screenshot of this

#

what setting do you have

remote crater
#

I changed it around constantly the last 10 hours as I tried to get it to work by changing random things.

rotund token
#

changing this will break your game

#

if you do not have a proper build

remote crater
#

I can use any of the three, and it plays in editor.

#

Nothing I choose plays in standalone.

rotund token
#

this settings do not affect standalone

remote crater
#

My standalone plays, but the stuff that loads on the fly 'addressables' does not.

#

I can give you a few videos to demonstrate or make one up for you.

viral sonnet
#

I'm still convinced you have a problem in your paths

remote crater
#

Enzi is correct

#

I'm almost 100% certain Enzi is right with paths.

rotund token
#

based on last error he posted

#

pretty sure he's doing something like Resources.UnloadUnusedAssets

remote crater
#

To get it to work last time, I think had to copy pasta a directory from my UnityProjectfile to my Standalone directory.

rotund token
#

if you have to copy/paste the directory you're build won't work because it hasn't included the link.xml when compiling

#

so it's stripped out all the resource loading stuff

viral sonnet
#

something in the path is not correct, that confuses unity and it's not copying the addressables to the StreamingAssets folder automatically

remote crater
#

Enzi, those are my paths again. I believe they're wrong. I want to set them to default, but there is no option. Tertle gave me a great idea to open a new project to copy from theirs.

#

There's no reset to defaults in this UI panel.

viral sonnet
remote crater
#

This has the best odds of solving things in a short period of time.

#

I have 3

rotund token
#

these are defaults

#

since you're not using remote paths they're identical

#

your paths are fine

remote crater
#

Oh remote doesn't matter?

rotund token
#

remote is only for if you're downloading from server

#

which you are not doing

#

you've told it only to use local

remote crater
# rotund token

which of these should I pick: Use Asset Database, Simulate groups or Use Existing Build?

rotund token
#

simulate is a bit meh - i never use it

#

you should use asset database for development

#

and only use existing build when you are testing addressable loading

remote crater
#

Use Existing Build sounds like it tests it

rotund token
#

to make sure you have set it up right

remote crater
#

Makes mucho sense

rotund token
#

you have to build a fresh addressables for it though so it's bad for development

#

what version of addressables are you using?

#

you are missing so many settings from the assetsettings compared to what i see

remote crater
#

But for me, not being able to make a standalone, its like an iterim step and could be valuable

#

1.19.19

#

the latest

rotund token
#

ok so it's because i'm out of date

#

(not surprising we don't update packages often at work

#

wait no

#

im on 1.19.19 as well

#

ah

remote crater
#

It may be just some components aren't arrow keyed out focused

rotund token
#

i have all these components on my settings

viral sonnet
#

i need to sleep ๐Ÿ˜„ good luck you two

remote crater
#

Thank you!

#

God bless your sleep! I know it ain't why you help, but if I do well, I want to help you guys back someday.

viral sonnet
#

oh before i forget tertle, var multiplicative = mores[index] * lesss[index]; are you already having the product of all more stats in the mores[index] saved?

rotund token
#

yes

#

though i've since used Manarz suggestion and merged the 2 more/less arrays

#
{
    var statValueBuffer = statValueBuffers[entityIndex].AsNativeArray();
    if (statValueBuffer.Length == 0)
    {
        continue;
    }

    this.statModifiers.Reset();

    for (var index = 0; index < statValueBuffer.Length; index++)
    {
        this.statModifiers.Add(*statValueBuffer[index].Effect);
    }

    var stats = statBuffers[entityIndex].AsNativeArray().Reinterpret<float>();
    StatCalc.FromModifiers(this.StatSchemas, this.statModifiers, stats);
}```
#

basically what my loop looks like

#

this.statModifiers.Add(*statValueBuffer[index].Effect);
is looping the buffer and populating each of the arrays

public void Add(in StatEffect stat)
{
    switch (stat.ModifyType)
    {
        case StatModifyType.Added:
            this.AddAdded(stat.Type, stat.Value.Short);
            break;
        case StatModifyType.Increased:
            this.AddIncreased(stat.Type, stat.Value.Half);
            break;
        case StatModifyType.Reduced:
            this.AddReduced(stat.Type, stat.Value.Half);
            break;
        case StatModifyType.More:
            this.AddMore(stat.Type, stat.Value.Half);
            break;
        case StatModifyType.Less:
            this.AddLess(stat.Type, stat.Value.Half);
            break;
    }
}```
viral sonnet
#

thanks, gonna take a more detailed look at it tomorrow

solemn hollow
#

its interesting how nestedprefabs work together with declarereferencedprefabs. it seems like using the same nested prefab in multiple different bigger prefabs will lead to multiple conversions of the nested prefab. those bigger prefabs cannot share the nested entity prefab.

#

kinda makes sense for loading speed i guess but it does bloat the converted entity scene quite a bit.

rotund token
#

each subscene gets its own set of prefabs as well

solemn hollow
#

is this design chosen deliberately for better streaming or would you expect changes in the future?

#

my artist made a dirty randomgeneration like this :

#

each of those houses again have such generate on point scripts which chose random objects (like doors etc)

#

so now i have 6x the same roof prefab converted per scene ^^^

rotund token
#

each bundle in addressables brings its own dependencies in

#

if 2 addressable bundles reference the same texture, 2 copies of this texture exist

#

this is actually really useful for memory management

#

however, addressables does let you explicitly add the dependencies to a bundle and ensure only 1 copy

solemn hollow
rotund token
#

an asset bundle won't unload from memory until every asset is released

#

so if you load, texture A and then load texture B

#

if you release texture B, texture B won't be released from memory

#

until texture A is also released from memory

#

this is why isolation of assets is really important in addressables

solemn hollow
#

i see. and the same principle is used for subscenes?

rotund token
#

pretty much

#

when you close a subscene all the subscene memory is unloaded

#

sometimes though, as you say, it would be nice to have option of sharing memory

#

maybe you never unload a subscene etc

#

or this asset is always in memory regardless, why make duplicates

solemn hollow
#

thanks. this means i need to think about i actually want to split my world in multiple subscenes (or even split at all)

rotund token
#

i should point out though that i have not studied how memory management works that closely in subscenes

#

and it was pre-0.17 so things could have changed

solemn hollow
#

ye i still expect alot of changes comming in regards to subscenes

rotund token
#

i've seen people use addressables and put every asset in just 1 bundle

#

means none of their memory will ever unload

#

quite bad

#

whole reasons we moved away from resources

#

because resources was effectively just 1 asset bundle!

solemn hollow
#

so as an example should an npc be its own assetbundle? or group multiple npcs together?

rotund token
#

depends on your game

#

more asset bundles slower it takes to load

#

but overall probably better runtime memory

#

but also much larger file size

#

there is an option to split every asset in a single bundle into its own bundle when building

#

so you dont actually have to manage 342134 bundles

solemn hollow
#

oof that got complicated quickly ๐Ÿ™‚

rotund token
#

at work we have around 40 bundles

#

game is procedurally generated

#

so its hard to manage memory

#

so i wrote a script to auto generate the like world templates into bundles where they could spawn

#

forest
desert
forest-desert

#

etc

#

we still have memory issues on old consoles though

#

no one really ever thought about memory management in early development (way before i joined) and especially not on restricted platforms like consoles

#

and it's a tough problem to fix

solemn hollow
#

hmm im glad im doing 2D. we also wanna do random worldgen but i probably wont have to optimize too much

rotund token
#

the subnautica devs did a good blog on this

solemn hollow
#

oh perfect primer. thx alot

#

@rotund token i had another quick question for you. i need to make EntityHierarchies that i spawn in at runtime static. Do i need to do more than just remove Translation,Rotation,Scale and mark it as static? I cannot find the actual code where this is done with StaticOptimizeEntity to copy it

rotund token
#

not sure sorry never tried

#

i actually have very few hierarchies

#

i hate dealing with them

#

i can show you teh code though

solemn hollow
#

yep huge PITA but artists ๐Ÿ™‚

solemn hollow
rotund token
#

TransformConversion is where it adds the components

#

static is added in GameObjectConversionMappingSystem

#

and the flag is set also in GameObjectConversionMappingSystem

#

(static entities have no hierarchy)

solemn hollow
#

thats exactly what i was looking for. thx! pretty hidden

solemn hollow
#

but probably its easier

#

id like to have the possibility to have transform parents but without the child beeing localtoparent. that would be useful

#

but doesnt seem possible atm (atleast not without too much hassle)

dense crypt
solemn hollow
solemn hollow
#

i am just now getting around to looking at the DOTS authoring Talk GDC2022. i dont like this api:

#

i hope this doesnt make the cut ๐Ÿ™‚

rotund token
#

curious how would you propose they implement code gen in a struct based system?

#

seemed like a reasonable way to get around c# limitations

solemn hollow
#

well i wouldnt have a solution for that. i dont know the reasons for this API. i just wouldnt like to write it this way

rotund token
#

that example is implementing Entities.ForEach in struct based ISystem

#

structs can't inherit from a base struct so that can't just have a stub in the base class

rustic rain
#

what is idea behind struct based?

solemn hollow
#

yes i see. still doesnt mean i have to like the looks of it ^^ i hope they find other workarounds. Not that it matters much though. ill stick with writing jobs anyways

rustic rain
#

sitting outside of heap even more?

rotund token
#

you can burst compile the entire system

rustic rain
#

or is it about bursting ?

#

oooh

rotund token
#

that's the whole point of ISystem

#

(you can already do this)

rustic rain
#

that's really interesting

#

And then someone from Unity will write a book

rotund token
#

there are 3 main benefits for this

  1. faster query lookup
  2. faster job scheduling
  3. faster job dependency combining
rustic rain
#

"How we turned C# into C++"

#

xD

rotund token
#

the limitation of most application is the main thread and if you can utilize it ISystem plays a pretty important roll in significantly increasing the number of systems you can run

rustic rain
#

I'm way more interested in Paralleling managed code

#

for smth that is 100% safe in parallel

#

just let us do parallel Run/Schedule

rotund token
#

that's very easy

#

lock

#

done

rotund token
#

parallel run/schedule is parallelschedule

rustic rain
#

if you do WithoutBurst().Run()
that would run whole job on main thread, right?

rotund token
#

Run runs on main thread

#

that's what it does

rustic rain
#

yeah, what I'd want

#

is to make it stealable

#

while it runs on main thread

#

or make it schedulable

#

but I don't know any logic behind it

#

so

rotund token
#

you mean
WithoutBurst().ScheduleParallel()?

rustic rain
#

yeah

rotund token
#

because you can do that

rustic rain
#

wait, really?

rotund token
#

what's stopping you

rustic rain
#

It always errored

#

and said

#

"You can only do Withoutburst().Run()"

#

because code is managed

rotund token
#

so you can't pass managed code to jobs

#

but you can use managed code in parallel jobs

#

if you acquire it from within the job

rustic rain
#

๐Ÿค”

#

so

#

type handles of managed code

#

components*

rotund token
#

but the question is

#

why

rustic rain
#

can be made parallel?

rotund token
#

why not just use Tasks

rustic rain
#

that's really pog

rustic rain
#

and overall flow of job

rotund token
#

there is no safety system for managed code

rustic rain
#

would be great if you could just schedule literally whole game code

rotund token
#

nothing stopping you from using them when in parallel

rustic rain
#

and then boom

#

it's all calculated in 1 pass to workers

rotund token
#

i believe it's called entities ๐Ÿ˜†

rustic rain
rustic rain
#

At least

#

I didn't know it was possible

#

until now

rotund token
#

i have a SharedComponentDataFromEntity

#

that i use in parallel jobs

rustic rain
#

oh man

#

I didn't know

#

I have so much to improve

solemn hollow
#

spawning hierarchies is really annoying me. the only easy solution i got now that should work with all of unitys systems is to spawn a hierarchy let unity do all its parenting and transform logic in first frame and then in second frame reduce the hierarchy to ashes (by simply removing the parent component). id wish i could remove it in first frame already but then transforms are all bugged.

rustic rain
#

because I needed it upon instantiation

#

but it requires EntityManager

solemn hollow
#

you mean you build the child buffer yourself?

rustic rain
#

yep

#

painful xD

#

btw

solemn hollow
#

yes i wont do it for now. maybe in later stages when i really need to optimize. for now i go for flexibility

rustic rain
#

there's also another buffer

#

afaik it only exists on main prefab entity

solemn hollow
#

LinkedEntityGroup yeah

fresh oak
#

Friends I have a couple of questions about unity, could you answer them if you know something.

  1. When will dots andย  Entities ? Next year?

  2. When will weta digital tools be released?

  3. What innovations await enlight GI? HDRP? What new unity will bring us with the arrival of dots in terms of graphics?

  4. Expect the appearance of an analogue of nanite or innovation in lods

  5. When will there be a New state machine for animation?

  6. When will the animation graph from the roadmap be released? With the arrival of dots?

  7. When will motion matching that was in the plans in the roadmap be ready?

  8. Will the IK be updated?

rotund token
#

i think it means more, if the device doesn't support Vulkan it won't render at all

misty wedge
#

Anyone else constantly get this error?
System.IO.IOException: Cannot create '...\Temp\GeneratedCode\Schnozzle.Actors' because a file or directory with the same name already exists.

safe lintel
#

not personally but I made a script to delete that temp folder from other issues(tertle mentioned theres someone made another that does it with a hotkey on the forums somewhere)

rustic rain
#

but this is warning

#

so I ignore it

misty wedge
hot basin
#

Is reading data from blobs heavy? I have some readonly data (mostly definitions like i.e. statistics of units etc.) and I put them into a blob. Is it efficient or should I consider putting it into another component?

#

Maybe chunk component?

rustic rain
#

actual data is somewhere else

hot basin
#

i know what it is

#

but is it fast

rustic rain
#

Can't say for sure: but I assume it just depends on amount of data.
If it'll be too big to load - it might ruin cpu cache.
But take it with a huge grain of salt. I don't know how it actually might work internally.

safe lintel
hot basin
#

even if I pass reference to the job and get data there?

rustic rain
#

it'll be just random access data, no?

#

same as accessing ComponentDataArray through entity

safe lintel
#

I think the only way you will get a clear answer for it is to profile it

#

are you actually encountering a problem or just theorizing one?

hot basin
#

i'm rewriting few of my systems and wondering if I've done things right

rustic rain
#

there should be nothing wrong if you use native dots instruments

hot basin
rustic rain
#

I read some info about how CPU cache works internally

#

you might want too, if you're interested in cache optimizations

hot basin
#

so maybe should I gather data per entity before and then process it in two different jobs?

#

so it would be still random access but calculation part should be faster this way?

viral sonnet
# hot basin but is it fast

They can be quite heavy in terms of memory access but that's how it goes. There's not really a better solution.

#

They are faster than CDFE. Just one pointer access.

viral sonnet
gentle harness
#

When can I use variables that Entities.ForEach modifies?

OnUpdate()
{
  int count = 0;
  Entities.ForEach((in Component c) => count++).Schedule();
  UnityEngine.Debug.Log(count);
}

In this code, will count accurately reflect the amount of entities that has Component, or will the job finish sometime after Debug.Log?

solemn hollow
rustic rain
#

Log runs right after schedule, but before job is run

solemn hollow
#

except for if you use .Run()

rustic rain
#

if you do Run() it'll run right now and only then Log will

misty wedge
#

Did 0.50/0.51 add additional restrictions to using containers in the "incorrect" way? I can't schedule a job in parallel that uses a native container even if I add NativeDisableParallelForRestriction

gleaming surge
misty wedge
#

InvalidOperationException: ChunkPathfindingJob.JobData.ClosedSet.m_Data is not declared [ReadOnly] in a IJobParallelFor job. The container does not support parallel writing. Please use a more suitable container type. Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor

#
[NativeDisableContainerSafetyRestriction, NativeDisableParallelForRestriction]
private NativeParallelHashSet<int2> ClosedSet;
solemn hollow
#

hmm wasnt aware that you cant turn off all restrictions. but im the wrong one to solve this. i always try to stay in the safe world even if i lose out on some performance. id only remove restrictions if i absolutly need that performance. often feels like im quite alone with that approach when reading forum and discord ๐Ÿ˜„

misty wedge
#

I'm creating a pretty large native collection inside the job and would like it to be re-used from chunk to chunk for each thread

coarse turtle
#

are you writing into the hashset across multiple threads?

misty wedge
#

No, I'm creating the hashset inside the job

#

That's why it's marked private

solemn hollow
#

hm thats weird then. since you are not writing in parallel to it from multiple threads. each thread has its own copy and writes in order. so not sure why safety kicks in

misty wedge
#

Well the safety doesn't actually check the writing afaik, it only checks on scheduling

solemn hollow
#

wait are you allocating outside?

misty wedge
#

No, inside

#

How would I, it's private

solemn hollow
#

uh sry

#

but its weird. i did this too with a NativeHashMap without problems

coarse turtle
#

my guess is b/c NativeParallelHashSet is just a wrapper for NativeParallelHashMap ๐Ÿค” so the [NativeDisableContainerSafetyRestriction] would also need to be existent on m_Data

misty wedge
solemn hollow
#

yes its in a parallel job

misty wedge
misty wedge
#

I guess the alternative is just to use an UnsafeParallelHashSet

solemn hollow
#

btw for my usecase sharing the hashmap was slower than allocating one per entity. you might wanna profile that

misty wedge
#

How can that be?

solemn hollow
#

i had the choice between 1 big defensive shared hashmap and many small perfectly sized ones. the big one was much slower

#

even when i made the shared one small it eventually grew through automatic resizing so much that it got slow again.

#

for my case it was a factor of 2x (with auto resize)

misty wedge
#

Ah, that probably won't matter in my use-case. It's just reusing containers used for pathfinding, they are cleared between every run anyways

solemn hollow
#

mine where cleared too

misty wedge
#

Yeah but I don't have the option to use "smaller" containers

#

They will grow to whatever size they need to

solemn hollow
#

yes but say you have a lot of entities that would need a very small hashset and one entity that needs a really big one. and now that one big one allocates at the start. every other entity uses a much bigger hashset than necassary now. this was what cost me performance

#

if its pathfinding you might find some heuristic of how big that Hashmap needs to be before allocating (like just pure distance).

misty wedge
#

Makes sense, but I think they will be equally in size. The pathfinding is divided into three steps, with the first one being very fast, and the second one only going from step to step of the one above it, so the distances should be roughly the same each time

#

I'm still having some trouble optimizing this since it's pretty slow at the moment, so I'm just trying stuff out. Currently it uses HashMaps to store node data, and a potential performacne for memory tradeoff would be to use a very large native array instead, that's why I asked about the caching, since that array would be the same size each time

solemn hollow
#

well in that case yes sharing should be more performant. and nativearrays can be shared like you wanted to. no idea whats up with NativeHashSet

misty wedge
#

It works if I use UnsafeParallelHashSet ๐Ÿคท

#

Doesn't change the fact that I may have written the world's slowest pathfinding algorithm...

#

It's gotta count for something though right? pensive

viral sonnet
#

how many entities for 2ms?

#

yeah if only that would be parallel ๐Ÿ˜€

misty wedge
viral sonnet
#

oh snap, yeah that's slow

misty wedge
#

I'm rasterizing my world anyways, so creating a mesh at that point would probably be pretty easy

#

This is the path it was searching, I think just using the underlying voronoi cells for the mesh shouldn't be too hard to do

#

I'd still like to know why it's so slow though

viral sonnet
#

post code ๐Ÿ™‚

#

otherwise, use some ProfilerMarkers to get the hot paths

#

VS profiling can also be useful (if it works)

misty wedge
#

Yeah I'm in the process of putting profilermarkers everywhere

viral sonnet
#

don't overdo it. I'm guilty of this. ๐Ÿ˜„ profilemarkers don't profile themself so you can get pretty garbage results

#

and because I didn't know you can use using(new ProfilerMarker("path1").Auto()) { you code }

misty wedge
#

Yeah, that's what I'm doing

viral sonnet
#

ah great, I created them in system and used as a parameter. such a pain ...

misty wedge
#

Everything is equally slow ๐Ÿ‘Œ

viral sonnet
#

how does the timeline look?

misty wedge
#

It's only a single thread

#

Hmm, I feel it's pretty difficult to compare profiled runs vs non profiler runs if the profiling is so slow

solemn hollow
#

cant you just use unitys navmeshbuilder api?

misty wedge
#

Maybe, I have no experience with it

#

Can it be generated during runtime?

solemn hollow
#

yes and its incremental.

#

so its actually pretty fast to expand around the player for example

misty wedge
#

What function is used to build the data during runtime, NavMeshBuilder.BuildNavMeshData?

solemn hollow
#

yes

misty wedge
#

Can you handle pathfinding requests inside jobs?

#

And can you have multiple nav meshes that you can then tell actors to selectively use?

solemn hollow
#

yes and yes

#

but inside jobs i havent done myself.

#

i think its experimental api

#

you need to write your own navmeshagent for ecs. using hybrid agent is just an insane PITA

misty wedge
#

Sounds pretty promising, but I guess I'll have to read into it. Basically each agent in my project only has a small area around it that that has spawned objects, and if it moves away again those objects despawn

#

So I guess I would have to generate the mavmesh each time a piece of the world is created, and remove it again if it is destroyed

solemn hollow
#

so its not created deterministicly?

misty wedge
#

It is, but the world is too large to spawn at once

#

It's just seed based

solemn hollow
#

yes but then you can keep the navmesh around and share it between actors

#

just incrementally build it

misty wedge
#

How would I use it in any jobs though? All of the code seems to use managed objects

solemn hollow
#

there are some experimental APIs in some obscure package i think. as i said i havent looked into it much. i just use the managed version atm in systems running on mainthread. its fast and easy enough for me RN. 100 units take around 0.3ms mainthread

#

ofc they dont all pathfind each frame

misty wedge
#

I think at least for my world pathfinding that would be pretty useful. I have a lower resolution version of the world cached, and currently I path find on that first and then pathfind multiple times until the actual destination is found

#

So I'm guessing the flow is use NavMeshBuilder to create a NavMeshData, then add that using NavMesh.AddNavMeshData?

#

and then NavMesh.CalculatePath

solemn hollow
#

yes. a very easy to understand implementation of it is in the navmeshcomponents package

#

just look at the navmeshsurface 2D. actually all you would have to do is call NavMeshSurface2D.BuildNavmesh at runtime

#

or UpdateNavmesh()

misty wedge
#

I can't see anything with 2D in it's name? Unless I'm missing something

devout prairie
#

Vrising thing on unity twitch atm

solemn hollow
#

oh damn look at the normal NavmeshSurface component. i got another package for 2D

misty wedge
#

What do you use for 2D? Since I also only need 2d

#

ah, thanks ๐Ÿ˜…

solemn hollow
#

and since pathfinding is multithreaded anyways i didnt bother looking at the new NavmeshApis that would allow me to write jobs

viral sonnet
#

and you wouldn't compare profiled vs non-profiled. just watch out for markers that are quite large in the timeline

solemn hollow
viral sonnet
#

tertle said he uses bursted navmesh to query paths

solemn hollow
#

he did roll his own thing though

viral sonnet
#

he wrote about it in a forum post

solemn hollow
#

thats what i linked i think

viral sonnet
#

yeah later on

#

both are based on recast though. might use the unity one. pretty sure his one is faster ๐Ÿ™‚

solemn hollow
#

but not maintained ๐Ÿ˜„

#

though that doesnt mean much. Navmeshagents are unusable as is despite beeing "maintained"

misty wedge
#

Thanks for all the tips @solemn hollow , I'll definitely check it out

solemn hollow
#

if you look at that API for jobs id appreciate if you tell me how it went. if its easy to do id probably spend the time implementing it

#

Just ATM there are bigger fish to convert

rustic rain
#

bbbruuuuh

#

I decided to switch into Unity conversion workflow

#

aaaaand, it converts components I don't want -_-

#

is there a way to exclude Transform components from conversion?

solemn hollow
#

thats basically what i asked about yesterday.

#

for me it was the physics components

#

you can destroy the converted transform components at the end of conversion.

#

I hope at some point they do add writegroups to conversionsystems

rustic rain
#

yep

#

sadly for now it seems like I need to exclude manually

#

hmm

#

it's fine

solemn hollow
#

but why do you even convert an entity that should not have a transform in the first place?

rustic rain
solemn hollow
#

yah dont do that. convert and inject is the worst you can do

rustic rain
#

I mean

solemn hollow
#

it said in a thread it wont be supported in the future too

rustic rain
#

I have managed world anyway

rustic rain
#

the most annoying part: there are authoring components added in conversion

solemn hollow
#

well i do use the animator. i just dont use Inject

rustic rain
#

idk why

oak sapphire
solemn hollow
rustic rain
#

I know

solemn hollow
#

thats so you can query them in systems and still effect the gameobject.

rustic rain
#

but the fact that they occupy component slot

#

is uuugh

solemn hollow
#

basically its what you did yesterday by hand

rustic rain
solemn hollow
#

rly cant help you with your problems if you decide to use outdated workflows or workarounds ^^

rustic rain
#

not about convert and inject

solemn hollow
#

its about subscenes. just use them

rustic rain
#

I rely on transform

#

since I need DoTween

solemn hollow
#

convert your gameobjects to pure entities and then let every entity spawn a gameobject from a prefab of what you need to be on a monobehaviour. basically like a companionobject but you have full control over it

rustic rain
#

the odd part

#

is that this workflow is not even supported, meanwhile inject one is xD

solemn hollow
#

why would it not be supported?

rustic rain
#

hmm, will Subscene even keep reference to prefab game object?

solemn hollow
#

why shouldnt an entity spawn a gameobject? IMO this is the only really solid Hybrid way. Entities always control the logic. gameobjects are just there to be rendered until the missing features are there for entities

#

then i can just delete those gameobjects and everything still works

solemn hollow
rustic rain
#

๐Ÿค”

#

that does sound like a possible solution

solemn hollow
#

i've literally gone through every other workflow. and this is the easiest one to maintain. syncing in 2 directions gets really stupid really fast.

rustic rain
#

hmm
Now how would I create game object and then grab all classic components from it as components for entities?

#

๐Ÿค”

#

inject does it for me somehow

#

and what's more curious

#

it does without warnings

#

about addings MonoBehavior as component

solemn hollow
#

i just have a managed component on the Entity which has a reference to the spawned gameobject and all the components i might need from it

rustic rain
#

Well yeah, but in my case the whole point of entity - keep references to components

#

and since Unity can do it natively

#

I do wonder how I can too

solemn hollow
#
{
    public GameObject artPrefab;
    public GameObject artInstance;
    public Animator animator;
}```
rustic rain
#

this is one way

#

but there's the one where Unity already references all components somehow

#

so either such components are declared already

#

or you can attach existing mono as component somehow

solemn hollow
#

you dont want to do it though. since those components will get lost when serializing to subscene since the gameobjects actually having those components are destroyed

rustic rain
#

like this

#

but I mostly care just about having references

#

on new objects

#

which will be created by entity

solemn hollow
#

so whats wrong with that snippet i posted?

rustic rain
#

I'll have to declare components for every mono

#

not much, but seems like just doing smth wrong, since there's a native way

solemn hollow
#

why? you can fill the componentreferences in a single (runtime)conversion system

#

whats stopping you from adding an audiosource here?

#

you have 1 managed component containing all references to that gameobject you wanna steer

devout prairie
#

the V Rising stream is actually pretty interesting, definitely goes into more DOTS detail in the second half

#

They have an interesting approach to physics, i think they rebuilt the build physics world system.. my basic understanding is all their moving colliders ( for say characters that roam the world ) are actually static colliders, but they do move them, and use physics casts to manually check for collisions

solemn hollow
#

oh its going on. damn

devout prairie
#

nearly finished i think

#

worth a listen though, just to hear some of the details of what they've done.. some nice bits

solemn hollow
#

can u link again?

devout prairie
solemn hollow
#

thx

safe lintel
#

i noticed their transform system group looked stripped down/different from whats builtin so mustve done changes there too, didnt get a chance to listen to it yet

pliant pike
#

they talk with the V Rising guys that's really cool

devout prairie
#

yeah maybe just stripping away all of the Translation Rotation etc and doing their own writes to LocalToWorld

solemn hollow
#

not sure why they would have done that. it didnt seem like much is moving in their scenes. no reason to otimize this bit. maybe they had some problems with their networking solution and transform system

devout prairie
#

yeah i'm not sure but i think there could be optimization benefits by basically removing all of that stuff and not running those systems and just focusing on updating ltw exactly when needed

#

the transform system does feel like a bit of a rats nest, maybe easier to just strip it away

solemn hollow
#

cant imagine working like that ๐Ÿ™‚ incrementally building up the transform changes over multiple systems is really convenient

devout prairie
#

well i'm kinda thinking you could basically still do that, but without having Translation, Rotation, LocalToParent, LocalToWorld, Composite Scale, etc etc.. which i think are basically just helper components.. Just have LTW

#

That's my basic understanding though

solemn hollow
#

yes but then youd always have to do the costly matrix operations.

devout prairie
#

well say for example most transform related systems u probs need pos/rot - so you can do ltw.Position and ltw.Rotation

#

but again, that's just my basic understanding, there might be more to it than that

#

getting position from the 4x4 is just the last row for example

solemn hollow
#

yes but thats still slower than pulling in exactly the data you need and having that in an array already without the need to pull it out of anywhere

devout prairie
#

yeah that's true

solemn hollow
#

kinda like why you split up big authoring components in multiple sub components too. each system can get the perfect subset of data

devout prairie
#

yep

#

i think my issue with transforms is just knowing exactly what is what

#

i remember having issues a while back with getting the right data from the right components, things not updating, not knowing what was local or parent relative and what was world/global etc

#

so i'm kinda like, could this not be simpler

viral sonnet
#

developing and babys. my attention span is down to a pigeon or smth ๐Ÿ˜…

solemn hollow
misty wedge
solemn hollow
solemn hollow
misty wedge
#

ah alright

viral sonnet
#

i shortly tuned into the vrising stream and they were showing of hot reload. damn. some tools are awesome

safe lintel
#

wait is hot reload something that works now?

#

or their own custom implementation?

devout prairie
viral sonnet
#

they didn't answer antthing about it. pretty sure it's custom

#

still very awesome. they just put a debug log in a server script spawn method and voila

devout prairie
#

They're converting mono to ecs on the fly in runtime I think

viral sonnet
#

huh,. i remember they specifically said that part isnt burst but they convert data into esc streams. looked like most is built on graph's

devout prairie
#

Ah yeah possibly

solemn hollow
#

man i am really afraid of all that breaking changes that might be comming

#

rewrite of conversion (baking)

#

new transform system

#

aspects

safe lintel
#

im ready for improvements everywhere

#

they were pretty adamant that 0.17 -> .50 would be breaking changes but the upgrade process was fairly reasonable for me

#

so I'm assuming there will be a reasonable amount of api updaters for anything thats truly breaking

viral sonnet
#

I think when you are using job structs you are on the safer side

#

lambda jobs could be a total pain. changes look substantial

solemn hollow
#

but maybe old api will still be supported for a few versions

viral sonnet
#

hey, i have a simple use case. i want a job to only run when a certain input is made. so a change filter on UserInput or smth. problem here, the naive ways of updating input is with a system that writes to it so every version gets bumped. I can think of the job (that is updating the input) really only running on an input but are there any better solutions?

safe lintel
#

apparently theyre gonna be renaming hybrid renderer into entities graphics, should help clear up misunderstandings ๐Ÿ™‚

viral sonnet
#

good hybrid renderer always was a bad name for it

solemn hollow
#

when disable enable comes around that should be the way to go for input

viral sonnet
#

tertle wrote into a seperate array and did a memcmp, then acquired a write handle and memcopied the data.

#

there must be some more reasonabke solutions. i had many bools to check changes. but meh

solemn hollow
#

disable enable wouldnt be reasonable?

viral sonnet
#

sure but that's far off ๐Ÿ™‚

solemn hollow
#

i mean you also could subscribe systems to inputevents and set a bool to run or not

viral sonnet
#

and I'm the guy who REALLY wanted enable/disable but now I'm planning to never use them ๐Ÿ˜„

solemn hollow
#

haha same xD

viral sonnet
#

true on the input, I just took it as example. I have tons of applications for it if I have a good solution

#

there's also the roundabout way of manually bumping the chunk version.

solemn hollow
#

ah so you search for the famous event solution

viral sonnet
#

you could call them events ๐Ÿ˜„ isn't everything that is happening some kind of event?

solemn hollow
#

well if you define it as an update event sure

#

for me there is no clear cut solution in sight. every problem needs a diffrent approach. enable, disable / tag / NativeStreams / entity spawn / bruteforce poll / changefilter

viral sonnet
#

that is something very different. i'm currently just focusing on DidChange

solemn hollow
#

btw a nice pattern i found is using a basically empty component + changefilter on it to trigger systemupdates

#

very easy to avoid an accidental write on the component this way

viral sonnet
#

because you guys said DidChange works on a component level and I thought it just works on chunk level. so I want to rethink how I can implement some

solemn hollow
#

it is only written to when an "event" should fire

#

that gets around the biggest issue i have with changefilters. alot of systems just have to declare write access to a component which destroys changefiltering

#

having such a proxy component solves that

viral sonnet
#

hm, true dat. sounds reasonable

#

so changefilter even works for a comp that has no data? interesting didn't know or expected that

solemn hollow
#

no it does not work for tag components. you need a little bit of data in there

viral sonnet
#

ah ok

solemn hollow
#

might as well use it for useful debugging stuff

#

i think this gets pretty close to enable / disable feature anyways

#

might even be better for single events tbh

#

usability wise

viral sonnet
#

how would you manage this comp though? you can't acquire a write handle for it all the time so the handle has to be acquired on some condition

#

alternative would be to access it with a CDFE

solemn hollow
#

no you can get a write handle without triggering changeversion bump

#

i showed you this before i think. GetNativeArray triggers the bump

#

or you manually bump it

#

i was too lazy to search for how that works lol

#

probably much more performant ๐Ÿ˜„

viral sonnet
#

wait, that's my point. getting the array bumps the version, so I can only get it on some condition

#

i could get RO pointers and manually bump

solemn hollow
#

yes so in the case you want sth to happen in another system you get this array

#

in my case i only get this array for a certain number of chunks so that all my AI Systems only run for those chunks

#

but inside that job you could also just check for any condition and get the array to trigger the "event" for the whole chunk

viral sonnet
#

i hate this internal stuff so much ... ahhh. can't get a Chunk* and its SetChangeVersion method because it's internal.

solemn hollow
#

huh. pretty sure there was a way

rotund token
#

Is internal really any different to public these days

#

Asmref ๐Ÿ’ฉ

solemn hollow
#

:S

viral sonnet
#

yeah ๐Ÿ˜„ sucks though to do that very time. and the last time I did it I realized I can't use Chunk* in my code context

#

it's just annoying. I mean, I get that not everything should be public for noobs but some compiler directive would be nice

#

anyway, tertle, didn't you mention you are bumping your archetypeChunks manually? Did you just write an internal method in your library for it?

rustic rain
#

hmmm
So will it be possible?
I want to have a game object. During conversion it will be converted and one authoring component supposed to create a prefab out of that game object minus all authoring components.
And then instantiate that same game object again.

#

Meanwhile everything kind of supposed to be saved in subscene

solemn hollow
#

creating a prefab during conversion does not sound like a good idea. why not just create a prefab you actually wanna spawn and have an authoring gameobject that just holds the reference to the prefab.

rustic rain
#

because that would mean I'll have 2 prefabs

solemn hollow
#

not sure why that is a problem. might even be better for loadingtimes of scenes if you have a smaller authoring GameObject and a bigger Prefab with all the heavy assets and stuff

#

for my project its pretty good cause we dont have the full bonehierarchy of our characters loaded while authoring

rustic rain
#

well in my case, there are almost none unmanaged components

#

so authoring process will look more like doubling prefabs minus authoring comps

#

and considering huge amount of prefabs I have to work with, this does not sound fun at all

solemn hollow
#

im a little lost now. you either need the MonoBehaviours for authoring or for runtime right?. so you can split them up and should not have any copies.

#

every authoring logic you would run would never be needed at runtime and vice versa

rustic rain
#

that was my first workflow

#

I might go back to it, tbh

#

I just don't see how I can avoid it, to make authoring easier

rotund token
solemn hollow
#

honestly i cant help you more. told you how it works perfectly fine for me and how you could implement all your requirements you gave. it doesnt make it easy if you wanna support running everything everywhere...

viral sonnet
solemn hollow
#

you either want dots or GO architecture. you said you want to do dots for your gamelogic cause its nicer to write. so skip GOs

rotund token
#

no need to be fancy

rustic rain
#

this is indeed very not entities friendly project

viral sonnet
#

yeah, I've overcomplicated this with wanting to call SetChangeVersion :/ thanks man

devout prairie
viral sonnet
#

there was a slide in the last presentation and it had some syntax changes

#

i'm pretty sure they can code-gen these changes though

solemn hollow
#

but it was for ISystem

#

i dont think they throw out the current way just yet

devout prairie
#

i really need to check wtf ISystem actually is

solemn hollow
#

just a struct based Systembase

devout prairie
#

instead of using systembase as a class?

solemn hollow
#

yes so you can burst the whole system

#

scheduling and all

devout prairie
#

ahh

#

ohhh

#

interesting

#

so where is ISystem called from ๐Ÿ˜›

#

is it turtles all the way down?

viral sonnet
solemn hollow
#

public struct MySystem : ISystem{}
just like SystemBase

viral sonnet
#

this is what I was referring to

solemn hollow
#

yep talked with tertle about it some hours ago.

rotund token
#

yeah my understanding was this was just the api for ISystem

#

but maybe they'll make it consistent, who knows

viral sonnet
#

I hope so, reads much better tbh

rotund token
#

haha Manarz hates it

#

aren't APIs funny like that

#

my concern is it reads ok atm

#

but how does it read when you have a bunch of WithReadOnly, WithNone, WithAll and other properties on that query

viral sonnet
#

i dislike everything that resembles LINQ so don't take me too seriously ๐Ÿ˜„

solemn hollow
#

i mainly dont like that type and name of the variables are split

devout prairie
#

so the query is an actual query as part of the for each

#

yeah i don't like that it's split either

viral sonnet
#

true, that can be confusing and a pitfall for dumb mistakes

devout prairie
#

as tertle says not sure how WithAll etc would work

viral sonnet
#

but then again, it should be obvious as we're dealing with strongly typed structs

safe lintel
#

linq seems so confusing to me, i see on stackoverflow its like why not use this handy dandy linq expression and its just a bunch of gibberish

devout prairie
#

also slow as hell

#

unless i'm mistaken

viral sonnet
#

that's 90% of why I don't like it

rotund token
#

linq is great ๐Ÿ˜„

viral sonnet
#

as I started web-deving in C# around 2008 and this guy LOVED LINQ so I had to write everything in it. then it turned out the queries it created where total garbage and I had to manually look at every LINQ query and optimize. total pain. just writing the SQL statement would've been so much easier ... that said, I think LINQ for sql is much better now

rotund token
#

i find things like

    .SelectMany(s => s.GetTypes())
    .Where(t => t != type)
    .Where(t => t.IsClass && !t.IsInterface && !t.IsAbstract)
    .Where(t => !t.ContainsGenericParameters)
    .Where(t => type.IsAssignableFrom(t));```
quite clean and easy to read
devout prairie
#

so are ISystems just picked up automatically and run, similar to SystemBase, without requiring to be instantiated or called anywhere

safe lintel
#

using the builtin bootstrap and they are @devout prairie

viral sonnet
#

linq has its place for exactly that stuff tertle. i would also not erite it any other way ๐Ÿ˜€

solemn hollow
#

didnt somebody write some burstable linq for ecs?^^

devout prairie
solemn hollow
#

how many arrays does linq actually allocate in that example? hopefully not 1 for every .Where

rotund token
solemn hollow
#

tell that to the poor dev that waits for the codeanalyzer to be finished

#

(me)

devout prairie
#

that whole article is like an enormous recursive nested if statement with a thousand branches

#

i mean there's some useful bits of information in there

#

but did you need to read all of that to be able to reliably set local/global pos/rot/scale in any other context

solemn hollow
#

idk did u?

#

you get the idea pretty quickly i guess ^^

#

maybe they just datamined that doc

#

lol

devout prairie
#

yeah it's too much that they have to explain if this then this over and over etc

#

i get there's a need for some of it, and a parenting system ( debatable )

#

but say a noob is coming in to this and they have one system writing to Translation, another writing to LocalToParent, and another writing to LocalToWorld, etc etc

#

it's all a bit silly

#

imo

solemn hollow
#

dont be a noob?

#

i mean they clearly tell you in the first lines of the doc that you are supposed to write to Transform,Rot,Scale

devout prairie
#

yeahhhhhhh

safe lintel
#

that sequencer graph in the v-rising talk ๐Ÿคค

solemn hollow
#

guys did they deprecate OnDrawGizmo or sth?

#

public class GizmosRunner : MonoBehaviour
{
    void OnDrawGizmos()
    {
        foreach (var world in Unity.Entities.World.All)
        {
            foreach (var system in world.Systems)
            {
                if (system is IGizmoDrawing gizmoDrawingSystem)
                {
                    gizmoDrawingSystem.OnDrawGizmos();
                }
            }
        }
    }
}```
#

that was my way to run gizmos from systems

#

its not updating anymore

#

wtf

safe lintel
#

dont think its datamined, anyway its not overly complex so much as it goes into and repeats a lot of depth that when youre starting out you dont necessarily need to know right away

#

I actually wish it went into a little more depth on some of the more esoteric combinations ๐Ÿ™‚

devout prairie
#

just looking at RigidTransform, seems to have some useful methods

safe lintel
#

i hate how physics is split from the transform system

rotund token
#

probably bite me really hard though

solemn hollow
#

are gizmos running for any of you in 2021.3f5?

rotund token
#

don't use gizmos

#

super slow

solemn hollow
#

im aware that its slow. i just dont know what else to use ^^

#

probably entities ๐Ÿ˜„

karmic basin
#

you can find some line drawing library

solemn hollow
#

its an old tool though which i need to get running. and somehow gizmos dont update at all anymore

rotund token
#

i have my own draw library but i always recommend aline if you don't want to roll your own

solemn hollow
#

oh nice it even works from bursted jobs

rotund token
#

yes

#

having a burstable draw library is a requirement imo

#

drawing makes debugging so much easier

#

especially if you can output text to the screen

#

(which aline supports)

solemn hollow
#

oh man thats great

rotund token
#

apart from that's it's like 100x faster than gizmos

solemn hollow
#

guess ill get it ^^ how much provision you get? ๐Ÿ™‚

rotund token
#

i really need to get myself an affiliate link ๐Ÿ˜„

rotund token
#
    where T : struct, IBufferElementData
{
    var typeIndexInArchetype = ChunkDataUtility.GetIndexInTypeArray(chunk.m_Chunk->Archetype, handle.m_TypeIndex);
    if (typeIndexInArchetype == -1)
    {
        return;
    }

    // This should (=S) be thread safe int writes are atomic in c#
    chunk.m_Chunk->SetChangeVersion(typeIndexInArchetype, handle.GlobalSystemVersion);
}```
#

yeah just wrote a tiny little utility for myself in my internal library

viral sonnet
#

alright, that was my plan ๐Ÿ™‚

solemn hollow
#

is GetNativeArray that much slower?

rotund token
#

it fails safety checks

solemn hollow
#

i dont quite understand why it shouldnt be safe? does it circumvent the dependency management of the systems?

rotund token
#

what if you did GetNativeArray in the same archetypechunk in different threads

#

then wrote to it

#

normally archetypechunk are split per thread

#

but for what i'm doing multiple different threads can update the change filter

#

so actually accessing the data for writing is unsafe

solemn hollow
#

ah so i shouldnt run in this issue

viral sonnet
#

here's mine for IComp which uses the lookupcache ```public static void SetChangeFilter<T>(this ArchetypeChunk chunk, ComponentTypeHandle<T> handle)
where T : struct, IComponentData
{
ChunkDataUtility.GetIndexInTypeArray(chunk.m_Chunk->Archetype, handle.m_TypeIndex, ref handle.m_LookupCache);

        if (handle.m_LookupCache == -1)
            return;

        chunk.m_Chunk->SetChangeVersion(handle.m_LookupCache, handle.GlobalSystemVersion);
    }```
#

a gist or resource for how globalSystemVersion works? I use it but I don't know where it actually increments? on every frame start?

#

GlobalSystemVersion should be the same so even on race conditions, the correct value should be applied. I don't know too much about the atomic implications of int but I just trust you on this one ๐Ÿ™‚

rotund token
#

it increments in every system in BeforeOnUpdate

viral sonnet
#

makes sense, thanks

#

now that I dug in the code, yeah every type has its own version. not sure how I missed that

solemn hollow
#

how could i get which system is selected in the systems window for an editor tool? is there an easy way to access this?

#

sth like EntitySelection.selectedEntity just for systems

rotund token
#

probably need to reflect the system window

#

hmm maybe not

#

honestly haven't looked

solemn hollow
#

how i solved it until now was having proxy objects either in a graphview or in the hierarchy representing the systems. so i could mark one of those objects and draw debug data into the scene.

#

i just now wondered if i can skip this proxy object but it seems like i cant

#

Even Unity is solving their EntitySelection by wrapping it in a Scriptable Object

solemn hollow
#

wait a second. with the upgrade to 2021 Unity now supports default interface methods of c#8 !!!!

rotund token
#

seems like it's SystemTreeView.SelectedSystem

#

though SystemTreeView is internal unfortunately

solemn hollow
#

yes thats where i stopped digging yesterday.
I should be able to make this work.

solemn hollow
#

well that SelectedSystem variable turned out to always be default due to this.

rotund token
#

Time for reflection

solemn hollow
#

shit i got it to work. but lets not talk about UX

#

so turns out everything is set correctly if you NOT select a system in the systems window but instead get it to be selected by selecting a relationship or sth

karmic basin
#

Generate authoring attribute bug ?

#

Try delete Temp folder

solemn hollow
#

@gusty comet if youd use subscenes all your objects would already be converted when the scene loads. I didnt get your second problem sry. conversion should write from authoring monobehaviours to Icomponentdatas in the Conversion Step. This usually happens before OnCreate.

woeful comet
#

Is there a good guide on using subscenes at runtime (in code) for loading assets? I haven't been able to find one.

devout prairie
#

Unity.Physics.Math has some useful helper methods, but ToEulerAngles is marked as internal because apparently they intend to move it to Unity.Mathematics..

#

So basically if you're looking for dots versions of some of the old methods like SignedAngle, FromToRotaion, etc etc, have a look in Physics.Math

#

Unfortunately have to copy the code out of the package until they're public

rotund token
#

they're all internal so you can just use asmref trick to access them

#

but yeah they have a lot of replicated behaviour from UnityEngine

#

which is great for converting existing code

devout prairie
#

what's the asmref trick? set up an asmdef and add as a reference?

#

i wonder how they decide which methods to aggressively inline and which not, for example ToEuler is but Angle isn't, in the above clip

#

maybe just arbitrary depending on usage while they've been building the library

rustic rain
devout prairie
rustic rain
#

I don't really know why someone would tweak around that, unless they are building library or tool or their game is already finished and they are actually optmizing it

rotund token
#

however com.unity.platforms.windows results in errors with 0.51 entities
these platforms are all deprecated and no longer work

late mural
#

add components with the search function and a bit of luck, you dont need the platform thingies, they are included with dots by default, to change settings and stuff, im pretty sure they can be found in the component menu, which is a bit broken, but use the search function to your advantage, the top one should be what you typed

misty wedge
#

Any idea what is going on here?

(0,0): Burst error BC1045: Struct `Unity.Entities.JobEntityBatchExtensions/JobEntityBatchWrapper`1<Schnozzle.InterestManagement.Systems.InterestManagementSystem/PlayerOverlapViewInterest_Job>&` with auto layout is not supported

It's just a normal Entities.ForEach job

late mural
#

yup it works great if used weirdly, let me explain, basically use the search function

#

general settings i think, also something else i dont remember, check the samples on the dots github, sorry for not knowing lol

#

i gtg to bed now, but i wish you luck in getting your build working!

muted star
#

Hi everyone, I'm currently creating a world manually. There is only on problem. When I exit playmode the world doesn't seem to be destroyed automagically.
What is a good way to do this?

frosty siren
#

also you can Application.onQuitting += but in editor you should reload this delegate on every entering to playmode

muted star
#

okay I'll try that ๐Ÿ‘

#

This seems to work like a charm

Application.quitting += () =>
        {
            if (world.IsCreated)
            {
                world.Dispose();
            }
        };```