#archived-dots

1 messages ยท Page 275 of 1

rotund token
#

not sure it'd make much difference though tbh

covert lagoon
rotund token
#

but i guess if stuck worth a try

rotund token
#

there is likely very few if any changes though

rustic rain
#

wait what

covert lagoon
#

But it's already available in the package manager?

rustic rain
#

is it released?

rotund token
#

yes

covert lagoon
#

I can use DOTS with Unity 2021 now?

rustic rain
#

so, what version is stable now?

rotund token
#

upgrading project atm, we'll find out

rustic rain
#

any links to official source?

#

Can't find it in google

rotund token
#

i will say they have broken a bunch of my tooling

#

[Obsolete("UnsafeHashMap is renamed to UnsafeParallelHashMap. (UnityUpgradable) -> UnsafeParallelHashMap<TKey, TValue>", false)]

#

[Obsolete("NativeHashMap is renamed to NativeParallelHashMap. (UnityUpgradable) -> NativeParallelHashMap<TKey, TValue>", false)]

#

=S

viral sonnet
#

interesting ๐Ÿ™‚ just a rename? need to make some diff

rustic rain
#

I don't get it, what version do I need? xD

covert lagoon
#

0.51 was made on May 4?

rotund token
#

0.50/0.51 is still based on an internal state of from memory like september last year

#

there wasn't much that needed to change 0.51 to make it work in 21 as far as i can tell, it's mostly editor side of things

covert lagoon
#

Ok

tranquil jay
#

Strange, 2021.3.3 works to install but 2021.3.4 does not

#

i dont know how to get into 3.2.0 hub

rotund token
#

bottom left is a switch channel button or something i think

tranquil jay
#

found it ty

viral sonnet
#

it's just a rename. I'm honestly not amused about calling something Parallel that has shitty performance and uses Interlocked

covert lagoon
rotund token
#

Enzi 2 months ago - interlock everything
Enzi today - interlock is the devil
๐Ÿคฃ

#

i get the concern though

#

but to be fair, for most applications it's pretty fast

viral sonnet
#

haha, I never said interlock everything ๐Ÿ˜„ only if it's faster in practice than other solutions.

rotund token
#

ok project compiling

#

in 2020.3

#

time to upgrade

viral sonnet
viral sonnet
#

just test a NativeList.Add in parallel and then in single thread. single thread runs many times faster. - Isn't atomic operations the general term? Mutex is like the old version of interlocked i think

covert lagoon
#

This is the first time I hear interlock instead of mutex or just lock

rustic rain
#

sirs. Is new target version of unity known yet?

rotund token
#

it has a block per thread and only if it runs out of space it needs to allocate a new one

viral sonnet
#
            // a non-null head which means we need to do more checks...
            if (Interlocked.CompareExchange(ref buckets[bucket], idx, -1) != -1)``` check the source, it's used a lot. - Yeah NativeQueue is also block based.
covert lagoon
#

From what I've seen, NativeQueue is not a circular list but a list of blocks, is that correct?

rotund token
#

everyone forgets about the poor nativequeue, the original boy

covert lagoon
#

Does that help with performance when adding/removing elements because you don't have to allocate as much memory when growing the capacity?

#

Also, how do you implement parallel writing to a data structure without mutexes?

rotund token
#

1 list per thread

#

but yes for anything more complicated than just that you do need something

covert lagoon
#

How do you know in advance how many lists you'll want?

rotund token
#

there are only 128 worker threads

#

you create 128

#

JobsUtility.JobWorkerCount

covert lagoon
#

Ok

rotund token
#

ok upgrade hasn't gone so well so far

silk current
#

Hey guys, is it known what GameObjectConversionUtility.ConversionFlags.ForceStaticOptimization exactly does?

rotund token
#

1 error a frame about replacing code gen in the hybrid renderer package

#

time for a nuke

rotund token
#

which removes translation/rotation

#

adds Static component

#

so it should only be left with LocalToWorld which won't update

silk current
#

Oooooh, I see!
How about SceneViewLiveConversion and GameViewLiveConversion?

rotund token
#

those are for subscenes

#

to determine what view you see

#

you shouldn't touch that i don't think, as it's just part of the subscene conversion stuff

#

(well you shouldn't touch GameObjectConversionUtility either imo ๐Ÿ˜† )

silk current
#

oooh, really? why, and what would be the alternative?

rotund token
#

subscenes

#

runtime conversion is not great

silk current
#

I need to convert a prefab gameobject to spawn it randomly during gameplay
the gameobject has a ConvertToEntity component, but I haven't figured out yet how to do it from code

#

what could I use?

#

I'm using EntityManager.Instantiate(Entity, int, Allocator) to spawn it right now

tranquil jay
#

Anybody >.>

silk current
#

I need a couple thousand and quickly, so GameObject.Instantinate isn't a good idea

rustic rain
rotund token
rustic rain
#

then just assign GameObject prefab to serialized field

rustic rain
#

and future entity will be Entity prefab

rotund token
# tranquil jay i have

it kind of sounds like (based off your previous issue) that the exe is just being nuked

#

when it's downloaded

rotund token
#

and then just instantiate what you need at runtime

#

2021.3.4 + 0.51 in project is a go! (just needed a library deletion...)

#

wait nevermind still having issues on codegen

#

๐Ÿ˜ฆ

covert lagoon
#

Oh

silk current
#

I'm not sure I understand tbh
I have a prefab, which I locate with Resources.load
then I convert it to entity with GameObjectConversionUtility.ConvertGameObjectHierarchy
then I instantinate it with EntityManager.Instantiate(Entity, int, Allocator)

also, I must use 2020.3

covert lagoon
#

The Netcode for Entities manual has taught me to do it another way

rotund token
covert lagoon
#

The Netcode for Entities manual has taught me to do something like this:

[GenerateAuthoringComponent]
public struct PlayerSpawner : IComponentData
{
    public Entity Prefab;
}
#

Then you create an empty GameObject in a subscene, give it this authoring component, and set the prefab GameObject you want

#

The prefab GameObject is seemingly converted to a prefab entity

silk current
#

ah
wait
so you attach the GameObject prefab to Entity field?

covert lagoon
#

In your code you do GetSingleton<PlayerSpawner>().Prefab and you have your prefab entity

covert lagoon
#

I don't see how else it would work

silk current
#

uuuuuuu, I see
that's a cool solution indeed, much better than what I have

#

alright, I'll try this now then

covert lagoon
#

But you'll also need to add RequireSingletonForUpdate<PlayerSpawner>() in your system's OnCreate() so your system doesn't run before the PlayerSpawner singleton is loaded from the subscene

#

And if you add that call to RequireSingletonForUpdate<T>() in your OnCreate(), then I think you need to explicitly list all your other requirements too, they won't be automatically generated from your entity queries anymore

rotund token
#

bugger - 0.51 + 2021.3.4 runs fine for my save library

#

just my game that has code gen issues

rustic rain
#

2021.3.4+

#

3.4+

#

huh

rotund token
#

?

rustic rain
#

oh

#

I didn't realise

#

it is latest 2021

#

xD

#

all right, time to break my project too

hot basin
#

AT LAST

#

do anyone have any problems with upgrading?

#

it will take me awhile as I need to do whole 0.17->0.50 upgrade guide

rustic rain
#

seems pretty simple

#

most problems are from native packages

#

like input/Ui

rotund token
#

i'm seeing some weird issues with netcode

#

get an error on codegen preventing doing anything on a library that has no netcode in it

#

but another library references it that does use netcode

#

and it wont compile/codegen until the first library gets a reference to netcode even though it doesn't use it =S

hot basin
#

but only with netcode?

#

I don't see the option for adding partial keyword

#

funny thing

#

can't see it because it don't compile

#

why it don't compile? because of missing partial word

rotund token
#

yeah it needs to compile once

hot basin
#

I have error with conversion of buffer element with entity field

silk current
#

Hey, is there a way to get an Entity field in the inspector of a MonoBehaviour?

#

I know you can get it on a struct with [GenerateAuthoringComponent], but I was wondering about a monobehaviour

hot basin
#

you can't as how exacly you want to set it up?

#

I mean, Entity on the component is just a prefab/GameObject as it would be converted

#

and how should Entity field work in MB?

#

you can always have GameObject field and convert it by hand

silk current
#

I want to have a singleton monobehaviour, from which a system gets the Entity prefab to instantinate

#

I was told converting by hand is bad?

hot basin
#

you can always make singleton component

#

with entity field

silk current
#

that solves my problem, although it's a bit silly xd

hot basin
#

and use RequireSingletonForUpdate<>();

silk current
#

although... I kinda need the prefab in OnCreate

#

so ikd

#

idk

hot basin
#

I think OnCreate is after conversion?

#

maybe not

silk current
#

I don't know, but since OnCreate is before OnUpdate, then I guess I don't really need to RequireSingletonForUpdate...

#

since I need the singleton before it anyway

#

doesn't matter I guess

hot basin
#

have anyone errors in runtime with converted IBufferElement with Entity field?

#
[GenerateAuthoringComponent]
    public struct SpawnerEntityReference : IBufferElementData
    {
        public Entity entity;
    }
rustic rain
#

I suggest use RequireSingleton

#

and getting one time thingies related to that singleton in OnStartRunning

silk current
rustic rain
#

subscenes usually load only after a bit of time after world started running

rustic rain
#

from what I noticed

silk current
rustic rain
#

nnah

#

from what I noticed

#

they are only invoked if queries changes

#

as in, if system requires singleton

#

it will do oNstartrunning only after it appeared in world

rotund token
#

technically start running is invoked if the previous frame system didn't run and the next it did

rustic rain
#

and onstoprunning after it dissappeared

rotund token
#

(or on first frame)

#

99% of the time this is from queries as you say

#

but it can be from Enabled toggling etc

rustic rain
#

I don't trust Enabled toggling xD

#

to me it's only debugging tool

rotund token
#

oh i don't think it should be used to toggle

silk current
rotund token
#

but disabling a system perm is useful

#

if you all care about is OnCreate

rustic rain
#

I really like your idea about using entities as state defines, btw

#

Kind of curious whether with increased shared comp capacity

#

I could use one shared component and use it's filter for state requirement on systems

viral sonnet
#

what's so great about it? seems over engineered on paper. ๐Ÿค”

rustic rain
viral sonnet
#

i dunno, it just moves a if to someplace else?

rustic rain
#

switching states of game becomes very simple

#

and doesn't rely on other modules

#

Allthough it does raise a question, whether it's perfomance justified

viral sonnet
#

don't get me wrong, it sounds convenient. if it's not too many systems even perf wouldn't be a problem. still I think an easier, equally convenient solution can be made with sharedstatic or smth

rustic rain
#

well, in case of a lot of similiar cases

viral sonnet
#

is newtonsoft json now totally gone from 0.51?

rustic rain
#

when systems would require same component

#

I could just create group with that requirment

#

kek

viral sonnet
#

great, I see a lot more caching in low level entities methods

silk current
#

what do I need to do, to be able to use this code without writing WithoutBurst() at the end?
I can't really tell what isn't allowed, aside from the fact that any line of this code produces the error

hot basin
#

cache Time.DeltaTime outside of ForEach

#

are components structs or classes?

silk current
#

all structs

hot basin
#

i don't know about that Vector3

#

you can use float3.up

#

was it helpful?

silk current
#

unfortunately problem still appears

hot basin
#

what error says

silk current
#

googling didn't help unfortunately

hot basin
#

show new code

rustic rain
#

You can't use properties in lambda

silk current
rustic rain
#

Prep your variables before for each loop

silk current
#

oh my

hot basin
silk current
#

yea

#

I just noticed

#

that

#

It works after fixing that

#

damn

hot basin
#

๐Ÿ‘Œ

silk current
hot basin
# hot basin

ok i'm giving up, don't know why it's broken and how to fixed it

rustic rain
#

Dots has it's own random

hot basin
silk current
#

yea yea, I know. That's what I'm using

hot basin
#

you need to make random variable before foreach

silk current
#

I have it

hot basin
#

I think I just lied to you ๐Ÿ˜› you don't have to do it before in case of Mathematics.Random

silk current
#

either way, I think using random breaks it. Imma check

rustic rain
#

I put my random on entities

hot basin
#

I'm using random system with number of random variables

rustic rain
#

So each entity has it's own random

hot basin
#

it was posted on the forum while ago

viral sonnet
#

the safety system got a bit more dumb. can't use a NativeList in a scheduled IJobParallelForTransform

silk current
#

and rotations speeds xd

#

I commented out the calls to random and it still screams :/

viral sonnet
#

my project runs fine now in 2021.3.4f1 and entities 0.51

silk current
#

oooh, I probably can't reference global objects, can I

hot basin
silk current
#

as in variables in the class

rustic rain
#

No static in lambda either

silk current
#

still doesn't work wth

#

OUCH

#

I figured this out

#

I can't use functions

#

from the class

rustic rain
#

Only static methods work

viral sonnet
silk current
hot basin
rustic rain
#

Make it static

silk current
#

hell yeaaaaaaa

#

finally works

viral sonnet
#

did you try without the tag?

hot basin
#

do you mean [GenerateAuthoringComponent]?

viral sonnet
#

yeah, rewrite to IConvertGameObjectToEntity

hot basin
#

it's last thing I didn't try as I have quite a lot of buffers

viral sonnet
#

oh boy ^^

hot basin
viral sonnet
#

hashmaps

#

doesn't mean it will fit in your case. hashmaps is also not quite true. mostly they are linear key/value arrays that are indexed

silk current
#

does anyone have any idea why GetSingleton is claiming that there are 0 instances of a singleton, when it clearly is in the loaded scene? It doesn't exist even after waiting a while...

#

nevermind, had to make it an entity

late mural
#

im quite new to dots, so this is probably not a clever question, but can i convert unity terrain into dots physics collider thing, and if so, can i have it so non dots stuff still collides with it, or should i instead have 2 terrains, one for the dots and one for non-dots?

late mural
#

also is there a list anywhere of all the packages needed for dots to work?

safe lintel
#

terrain isnt really officially supported yet

#

one cludgy workflow might be to export terrain as a mesh and use that for your collider

#

for needed to work, generally if you install a package it will auto install its dependencies, ie physics will pull in everything it needs, same with hybrid renderer so with those two thats more or less covering all basic dots stuff(entities, collections, burst, math), then theres also netcode

#

maybe platforms as well to build stuff

late mural
#

ok thank you so much, ill try out the converting of the terrain to a collider to dots, and see how it goes, thanks!

safe lintel
#

the samples repo should have some useful cases to look at as a beginner, theres physics samples inside it

late mural
#

yup i saw them, they are super useful, thanks lol

late mural
safe lintel
#

shouldnt matter

late mural
#

perhaps it is urp, does dots support that?

safe lintel
#

it does, you may have to restart the editor

late mural
#

i have tried restarting it, multiple times, doesnt seem to help, like it doesnt even install the packages, it just says it couldnt

safe lintel
#

has to be 2020 lts or 2021 lts

late mural
#

yup im running one of the many 2021 lts versions,

#

here is the error message, incase it helps

safe lintel
#

odd, ive not gotten that error before

late mural
#

welp that is annoying then, any ideas what could be causing it?

#

i dont think it is space, cause i have almost a tb of space left, it wont be admin, cause i launch unity / unity hub as admin

safe lintel
#

dont really know what that error means besides the obvious, but going through these kinds of hiccups are kinda a rite of passage with the dots onboarding experience ๐Ÿ˜…

late mural
#

welp lol, ill go do research, and try it on my laptop to see if it is device specific, but thanks for all the help!

safe lintel
#

good luck! maybe someone else will chime in later here

late mural
#

yup, after a bit of messing around, i found the one package that has no dependencies that break, the dot editor, but it breaking in other ways it appears, how fascinating

safe lintel
#

oh dots editor shouldve been rolled into entities package now so remove it

late mural
safe lintel
#

are you upgrading an existing project or is this a brand new project and installing dots?

late mural
late mural
#

after much research, it seems this issue has never been seen before, atleast it hides in the shadows it has been seen before, no known solutions can be found with googling, trial and error isnt helping much either, very odd, i suppose it is a preview package, makes sense that it is unstable, but im determined, eventually there must be a way to fix it!

rustic rain
late mural
rustic rain
#

oh god ,living without 2D physics is pain

#

I literally consider using Hybrid 2D physics xD

late mural
#

atleast you have something working lol, but i wish you luck anyways for whatever your doing!

rustic rain
#

it becomes so much easier when you finally get that ECS thinking click

late mural
#

ye, i cant wait till i am able to start learning, but so far ive had no luck in installing it

rustic rain
#

installing?

#

just add Hybrid Renderer

#

it will install itself

#

kek

late mural
#

does not work

rustic rain
#

what version are you on?

#

unity

late mural
#

one of the many lts versions of 2021

rustic rain
#

only 1 will work

late mural
#

oh only that version will work?

rustic rain
#

yeah

late mural
#

welp i feel like a fool now

rustic rain
#

and that on 2020

late mural
#

sorry lol, i thought any 2021 lts version would work

#

oh i cant install that editor version

#

apparrenty it requires over 550 gb of space

rustic rain
#

wha

#

lol

#

no it's not

late mural
#

i know

#

unity does this to me every install

#

it checks for space in my f drive, but installed in my d drive

#

i do not have an f drive though

rustic rain
late mural
#

yup

#

as such i now have to go find a drive to plug in and be my f drive, and it needs to have enough space, so that i can install unity onto my d drive

#

installing unity is a pain

rustic rain
#

why not just reinstall Hub to drive you want?

late mural
#

hub is installed on the drive i want

#

it is installed on my d drive

#

but hub likes the f drive, just like visual studio, and visual studio code, and omni sharp, and so many other programs

#

despite me not having one

#

no clue why my computer does this, cant seem to fix it either, as such i just have to go find something to be an f drive whenever this occurs

#

welp guess ive either gotta go find something to be my f drive, or just deal with not having dots

#

sometimes i just wish there was an option to install without checking for space

#

because there is no space, cause the drive does not exist

covert lagoon
#

That's what I was using

rustic rain
#

well, I heard someone was using it either without a problem

#

pretty sure since you are using it

#

you know better

#

xD

covert lagoon
#

Also all the DOTS packages say 2020.3.0f1 in their package.json

rotund token
#

it needs to be 3.30f1+

rustic rain
#

Any idea whether Companion Game object Update Transform system has any write group filters?

#

I might want to disable it at some point

rotund token
#

your as capable as anyone else in here to look at the source yourself ๐Ÿ˜„

rustic rain
#

Can't find it

#

I only found disabling/enabling companion link

rotund token
#

CompanionGameObjectUpdateTransformSystem

#

but no it doesn't

#

because it doesn't write to an actual component

#

and write groups require a component to write to

rustic rain
#

welp

#

Transform is also component

#

just managed

#

kek

rotund token
#

it doesn't have Transform

#

in it's query

#

i think you are probably the first person to ever think

#

you know, even though they're meant to be the same thing, i don't want my gameobject companion to be the same as the entity that represents it

rustic rain
#

welp, yeah xD

#

Literally everything is done through hybrid atm

#

animations, rendering and even physics

#

since no 2D

#

so at some point I just want to disable companion link update on entity

#

so it drops dead through classic physics

rotund token
#

has anyone got unity + il2cpp building without errors in 0.51 + 2021.3.4f1?

#

i can build mono fine no issue, soon as i try build il2cpp and run the game

#

flooded with
ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+CompareImpl`1[[Unity.Physics.PhysicsWorldIndex, Unity.Physics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::CompareFunc' for which no ahead of time (AOT) code was generated. at Unity.Entities.FastEquality.Equals (System.Void* lhsPtr, System.Void* rhsPtr, Unity.Entities.FastEquality+TypeInfo typeInfo) [0x00000] in

rustic rain
#

yep, I found how it does it. Sadge

#

hmm, so write group will only work if I try to write to that component of group?

#

How that would work with managed component?

#

I want to try and mod this system's query

#
            m_ExistingQuery = GetEntityQuery(
                new EntityQueryDesc
                {
                    All = new[]
                    {
                        ComponentType.ReadOnly<CompanionLink>(),
                        ComponentType.ReadOnly<CompanionGameObjectUpdateTransformSystemState>(),
                        ComponentType.ReadOnly<LocalToWorld>(),
                    }
                }
            );

Here's the query that system uses to write to. All read only ๐Ÿ˜

#

hmm, if I simply put different query with readwrite on CompanionLink

#

and Write group filter

#

is that going to work?

hot basin
#

I wonder why there is no official post about 0.51 yet

rotund token
#

never tried on a managed component

#

in theory yes

#

(if you add write group to the query as well)

rustic rain
#

yeah, will try that through reflection

#

btw, is there any attribute that I can use to some static method to be executed during WOrld init phases?

#

like after OnCreate of systems

rotund token
#

no that sounds gross

#

i guess if you use the default bootstrap

#

you could just do the next stage of RuntimeInitializeOnLoadMethod

rustic rain
#

nnah

#

I'll just use other system for that injection I guess

hot basin
#

@rotund token had you maybe the problem with autogenerated IBufferElements with Entity field?

rotund token
#

what?

viral sonnet
#

ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+CompareImpl`1[[Unity.Physics.PhysicsWorldIndex, Unity.Physics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::CompareFunc' for which no ahead of time (AOT) code was generated. at Unity.Entities.FastEquality.Equals (System.Void* lhsPtr, System.Void* rhsPtr, Unity.Entities.FastEquality+TypeInfo typeInfo) [0x00000] in <00000000000000000000000000000000>:0 at Unity.Entities.FastEquality.Equals[T] (T& lhs, T& rhs, Unity.Entities.FastEquality+TypeInfo typeInfo) [0x00000] in <00000000000000000000000000000000>:0 at Unity.Entities.TypeManager.Equals[T] (T& left, T& right) [0x00000] in <00000000000000000000000000000000>:0 at Unity.Entities.ManagedComponentStore.FindSharedComponentIndex[T] (System.Int32 typeIndex, T newData) [0x00000] in <00000000000000000000000000000000>:0 yep, I think I have the same problem as @rotund token

rotund token
#

it happens in an empty project

#

with just dots packages

#

and an empty scene

#

tested other properties packages with no luck

#

already forwarded it over to unity

#

at least it builds with mono...

#

also having a lot of code gen issues that need an editor restart to fix - not an ideal work flow

viral sonnet
#

waiting for half a year and getting errors. meh ๐Ÿ˜’

hot basin
#
[GenerateAuthoringComponent]
    public struct SpawnerEntityReference : IBufferElementData
    {
        public Entity entity;
    }
#

@rotund token this

viral sonnet
#

i hope they at least sent you a shirt by now for all the things you found tertle

rotund token
#

but wouldn't surprise me

#

there's a lot of odd errors btw

#

error SGICE004: Seeing this error indicates a bug in the dots compiler.
or
info SGICE006: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\DotNetSdkRoslyn\Temp\GeneratedCode\X

hot basin
#

line 11 is creating buffer for entity in generated script

#

so null ref in something that basic seems very odd

rotund token
#

though that's not breaking, just annoying

#

so yeah not really recommending anyone upgrade atm

hot basin
#

it's too late

#

I'm too hyped to back down ๐Ÿ˜„

#

seemd strange but managed comonent nedded to have all public fields

#

due to new code generators

rotund token
#

when you have to restart the editor every time you make a code change

rustic rain
hot basin
#

nice I figured it out

#

they make an array of entities is autogenerated code

#

which is never initialized

#

and then they are trying to use it

#
public class TileUnitAuthoring : UnityEngine.MonoBehaviour, Unity.Entities.IConvertGameObjectToEntity
    {
        public Unity.Entities.Entity[] Values;
        public void Convert(Unity.Entities.Entity __entity, Unity.Entities.EntityManager __dstManager, GameObjectConversionSystem _)
        {
            Unity.Entities.DynamicBuffer<_YourHighness.Map.TileUnit> dynamicBuffer = __dstManager.AddBuffer<_YourHighness.Map.TileUnit>(__entity);
            dynamicBuffer.ResizeUninitialized(Values.Length);
            for (int i = 0; i < dynamicBuffer.Length; i++)
            {
                dynamicBuffer[i] = new _YourHighness.Map.TileUnit{unit = Values[i]};
            }
        }
    }
#

seems it will work in case when type will be serialized as inspector will initialize it

#

I can confirm that was the case

#

haha

#

I have another strange error

#
UnityEngine.Debug:LogError (object)```
#
protected override void OnUpdate()
        {
            var ecb = entityCommandBufferSystem.CreateCommandBuffer();

            var attacks = attackQuery.ToComponentDataArray<Attack>(Allocator.TempJob);
            var healths = GetComponentDataFromEntity<Health>(true);
   
            
            var map = new NativeParallelHashMap<Entity, int>(attacks.Length, Allocator.TempJob);
            var jobHandle = new SortAttacks
            {
                attacks = attacks,
                map = map.AsParallelWriter()
            }.Schedule(attacks.Length, 5, Dependency);

            jobHandle = new ApplyAttacks
            {
                map = map,
                healths = healths,
                ecb = ecb,
            }.Schedule(jobHandle);

            ecb.DestroyEntitiesForEntityQuery(attackQuery);
            jobHandle = map.Dispose(jobHandle);
            
            Dependency = jobHandle;

            entityCommandBufferSystem.AddJobHandleForProducer(Dependency);
        }
silk current
#

Hey, does anyone have any idea why just adding ref Scale scale into my Entities.Foreach break basically everything?

hot basin
#

and the job itself has [ReadOnly] public ComponentDataFromEntity<Health> healths;

silk current
hot basin
hot basin
#

they probably don't

silk current
#

hmm, they do not indeed

#

how would I add it?

#

I kinda thought it would add automatically like translation and rotation

hot basin
#

I think there is no easy way

silk current
#

I think I figured it out, I need to add it with EntityManager

#

or am I wrong?

hot basin
#

only when scale isn't 1,1,1 it will be automatically added

silk current
#

oh no
it breaks burst

hot basin
silk current
#

With a struct Scale and a float named Value? Would that work??

#

and just add it to the gameobject prefab?

hot basin
#

make sure you use Unity.Transforms one and not one from i.e. UiElements

#

it should be burstable

rustic rain
#

Scale and NonUniformScale

hot basin
#

oh yeah, I forgot about that

rustic rain
#

idk why they did it that way

#

so annoying

#

so painful to work with

#

ngl

hot basin
#

I moved out from using Unity.Transforms

rustic rain
#

how so?

#

I wish I could do that too xD

hot basin
#

I use only LocalToWorld

rustic rain
#

Since I have 2D

silk current
#

unfortunatley, NonUniformScale breaks things as well

hot basin
#

you still need to add it to entity

silk current
#

I guess I could try making the object have something like 1.0001 scale... I'm gonna reset it anyway

#

lmao that works

hot basin
#

yep

#

you should just make a authoring script for Scale/NonUniformScale

viral sonnet
hot basin
#

are there any resources on this?

viral sonnet
#

not really, the safety system just complains where it didn't before

#

so technically it was a mistake that wasn't catched

viral sonnet
#

only some tips, check the line where it is thrown

#

sometimes the error in itself is pure garbage

#

and only take the first time such an error is thrown seriously, others are cascading errors from the first one

hot basin
#

it's at ecb.DestroyEntitiesForEntityQuery(attackQuery);

viral sonnet
#

what also helps is putting some jobHandle.Complete() in places you are suspicious about. if it fixes it, you know where the problem is

hot basin
#

moving it before the jobs helped

#

wtf

pliant pike
#

I'm trying to access a buffer after a job where I've populated it but I'm getting this error Attempted to access BufferFromEntity<PotentialMoveBuff> which has been invalidated by a structural change.

#

I have jobhandle.complete and Dependency().Complete straight after the job

rustic rain
#

buffers are invalidated by structural changes

#

after any structural change you need to get buffer again

pliant pike
#

I even create a new GetBufferFromEntity after the job, I'm not sure what is happening ๐Ÿ˜•

#

yeah I am getting the buffer again or so I think

#

I do this before the job var potentbuff = GetBufferFromEntity<PotentialMoveBuff>(); var realbuff = potentbuff[PotentMoveBuffEnt];

#

and then this after var newent = GetSingletonEntity<PotentialMoveBuff>(); var oldnewbuff = GetBufferFromEntity<PotentialMoveBuff>(); var newbuff = oldnewbuff[newent];

solid estuary
#

so is jobs production ready or should I bother learning how to multithread by myself?

rustic rain
#

jobs are

#

jobs + burst

silk current
#

hey, is there a way to change surface type of the material on an entity?

#

from a job

#

preferably without EntityManager

#

I really really need to get transparent objects to work somehow

#

wow. I needed to enable zwrite in inspector in debug mode, and changing it to normal mode breaks it again

#

I can't click on the material

#

thatis so silly wth

rustic rain
#

all right, I'm done with hybrid

#

looks like physics is the only way

#

๐Ÿ•ฏ๏ธ

misty wedge
#

Do the source generators in 0.51 force you to use only public instance types?

rustic rain
#

Any idea about unity physics debug display?

#

I created entity with that component but I don't see any visualisation

remote crater
#

1 week of 40 hours of work and more 20+ of fret, I have addressables take over the resources folder's duty. I have a few other possible problems, but it looks promising. Thanks guys for the help. Standalones should be hard let alone this hard, but with solid, friendly help like yourselves at least they're doable.

hot basin
#

try to build one a week next time, companies setup whole CI/CD pipelines to prevent such situations

#

but build once a week should be plenty

remote crater
#

So I beat a couple issues, but I am left with: AssertionException: Ensure TypeManager.Initialize has been called before using the TypeManager.... I think Editor runs slower and my code works there because of a fortunate race condition. What is the proper way to Initialize TypeManager MORE INFO HERE: https://pastebin.com/hBvgGXBf

remote crater
#

That feeling when the google search return only result is your question from 4 days ago:

#

Oh tertle said to try disabling entities journaling

#

I disabled it in the menu, I still get the errors.

rustic rain
#

are collisions still only done through ICollisionEventJob interface?

#

I need to make managed collision events loop

remote crater
#

There is one that checks triggers too

#

What you do is check the collisions in that job

#

then you check each entity based on some components

#

and then filter the collison based on what hit what

#

Everything is done through ICollisonEventsJob and ITriggerEventsJob I believe if those are the names

rustic rain
#

yeah, I know

#

I just wondered

#

whether it's still the only way

#

cause I never liked it

#

I really find inability to manually choose which collision events to query really troubling

safe lintel
#

yeah havent been any major changes to physics

remote crater
#

You do not want to be querying collision events

safe lintel
#

kinda sad, physics improvements were moving at a really good pace prior to that year long wait

remote crater
#

query is for information always there that you want to process

#

a collision is a one time deal

rustic rain
#

wdym?
How do I get collision events then?

#

in case I need custom logic on collision

muted field
#

is it possible to wrap a native collection into a read only version like this:

private NativeArray<float2> _v;
//public ReadOnlyNativeArray<float2> Vertices => _v;
...
remote crater
#

Once you receive the two entities that collide, you process their components

#

Are you able to detect when two entities collide with your Job?

#

An event is different than a query

rustic rain
#

well, that's what I was complaining about: I get 2 entities, but not context

#

and I have to figure out from what context are they

remote crater
#

When you have two entities, you have components attached

#

You can get the data to process them from their components.

#

Sec, let me help you

#

What does your Onupdate look like?

rustic rain
#
        protected override void UpdateWithBuffer(EntityCommandBuffer buffer)
        {
            Dependency = new GroundCollisionJob { buffer = buffer, playerEntity = _player }.Schedule(
                _stepWorldSystem.Simulation,
                Dependency);
        }
remote crater
#

See that's the problem

#

You don't pass components in

#

You can't read components into your execute

#

unless you pass em, click my pastebin

#

Then I'll show you my execute

rustic rain
#

I don't really get it

remote crater
#

appologies for mass comments in my code, I use em like ship wrecks

rustic rain
#

is there some kind of secret codegen behind?

remote crater
#

Notice I pass Entity Data and Translation

#

EntityData is a custom component I give useful information to my entities

rustic rain
#

yep, that's what I was talking about

remote crater
#

Translation is the position n stuff

rustic rain
#

you go through each entity and figure out which one is which

remote crater
#

Then In your execute, you can process em

#

Click the second pastebin, most recent

#

That shows how once you pass a component in, you can read it in the execute

#

Now that you have custom components you made in, you can process how entities handle the collision if its a bullet, rocket, person, wall, exploding barrel, etc

rustic rain
#

hmmm, can I adjust entity to stop creating collision events?

remote crater
#

Take away its collider

#

You can disable its physicsshape or body or something

rustic rain
#

it's singleton

#

I only need to disable raising events

#

cause I still need collision to be processed

remote crater
#

Oh that's a sub chceck box

rustic rain
#

removing collider is not an option

#

yeah, and I need to change it in code

remote crater
#

under material->Collisionresponse in the component

#

You should be able to find that in the Physics Shape component

rustic rain
#

yeah, but that's authoring

#

and I need runtime

remote crater
#

Look at the GUI of it on its attached

#

You can change that in run time

rustic rain
#

how?

remote crater
#

First get the Physics Shape Component

rustic rain
#

Inside code

#

I already have PhysicsCollider

remote crater
#

Physics Shape is where the ability to turn on and off the events is

rustic rain
#

But I only have Physics Collider

remote crater
#

Every Entity that collides has both

rustic rain
#

Physics Shape is authoring component

safe lintel
rustic rain
#

wait what

#

how do I get material/

#

?

safe lintel
#

its a property of the collider blob

rustic rain
#

hmm

safe lintel
#

the code is in the spoiler tag

rustic rain
#

I don't see it

#

oooh

#

spoiler tag

#

lul

#

oh, casting into other type I see

coarse turtle
muted field
#

ah true

viral sonnet
rustic rain
#

hmm

#

I am also considering it atm

viral sonnet
#

i find physic shapes only good to use for basic collisions. i. e. character controllers. for everything else, the colliders being immutable makes things difficult

rustic rain
#

in my case I have floor

#

wwaaaait a second

#

I don't think it'll work

#

damn it

#

I need a way to determine whether my entity hits the floor

#

and when it does, usually you can't catch that with simple cast

#

or overlap

viral sonnet
#

hm, for a floor the default ICollisonEventsJob works best

rustic rain
#

since almost all the time it'll hit only between ticks

#

yeah

viral sonnet
#

some capsule cast with velocity would work

safe lintel
#

you need an iterative solver i guess

viral sonnet
#

should catch everything even between frames when the cast length is the velocity distance for the frame

gleaming surge
muted field
#

does unity plan to expose native arrays etc to the inspector in future?

#

kind've annoying not being able to add test data in them

rotund token
#

what do you mean to the inspector?

#

i can't think of a scenario, except a custom debug windows, where this would ever make sense

muted field
#

i want to fill a native array (persistent one) with vertex float2 data

#

so i can then run it to test collision stuff

#

right now i have to use a list then populate a native array from the list which is just verbose and annoying

rotund token
#

but you cant have an allocated native array just sitting on a settings file?

muted field
#

why not when you can have a list serialised

#

if its persistent whats so different about it

safe lintel
#

@gleaming surge they teased some things like lower fidelity physics for particle sim, also better api's for collision, some better joint authoring, im not really convinced by the split physics shape/body either. oh and I know terrain colliders are also something others need. anyway the speed of visible development just kinda dried up

void girder
#

Entities 0.51 is giving compile error with JobsUtility, such as "Library/PackageCache/com.unity.entities@0.51.0-preview.32/Unity.Entities/DefaultWorld.cs(26,25): error CS0117: 'JobsUtility' does not contain a definition for 'ClearSystemIds'"

Any suggestions?

hot basin
#

seems like you missed something

void girder
#

Currently upgrading my Unity editor version

hot basin
#

and remember that 2021.3LTS is current latest version of unity

void girder
#

Yeah upgrading to 2021.3.4 from 2021.3.0 worked

frosty siren
#

Who can enlighten me about how to initialize blob asset when it is a BlobArray itself?

remote crater
# rotund token but you cant have an allocated native array just sitting on a settings file?

Yo tertle, adding the precompiler command: DISABLE_ENTITIES_JOURNALING Got me past that Standalone Error. I'm now stuck on some weird thing where the addressables aren't packing themselves properly: https://forum.unity.com/threads/please-please-please-help-me-get-a-standalone-scriptable-build-pipeline-isnt-documented.1294917/

#

We closing in on a nice revenue stream and a dream realized man.

misty wedge
#

Does Unity have any unbuilt inbuilt ways to test the performance of DOTS systems?

rustic rain
#

wdym unbuilt?

#

@misty wedge

misty wedge
#

Oops, should have been inbuilt

rustic rain
#

you mean built in?

misty wedge
rustic rain
#

eeeeh, still not sure what it would mean in that context, but system debugger literally has profiler built in

#

is that smth you're looking for?

misty wedge
#

I meant more of a benchmarking tool

#

e.g. set up (in this case build the world state) -> benchmark / test -> tear down workflow

#

I guess the unity test runner can probably do it, but I was wondering if there was something specifically for dots

rustic rain
#

Anyone had any perfomance problems with Physics?
For some reason for me with just 2 physics shapes one of which is static
I get 5 ms in step physics world system

#

and overall it jumps to 10ms

rotund token
#

Do you have integrity checks off?

rotund token
viral sonnet
#

tertle, did you solve the physics bug in builds?

safe lintel
#

@rustic rain are you profiling the timeline or hierarchy?

rustic rain
rustic rain
#

and physics systems go to 50ms

#

sometimes

safe lintel
#

should use the profiler because sometimes systems can be waiting on other jobs(spawned from other systems) to complete and you get an inaccurate view of ms timings

rotund token
rotund token
#

That just means physics causes a sync point and it's waiting on that

rustic rain
#

well, I don't have any systems that are related to physics atm

rotund token
#

Do your systems use translation or rotation?

rustic rain
#

literally just 2 entities with physics components and fully vanilla

rotund token
#

Because then they are related

rustic rain
#

hm

rotund token
#

You just need to look at profiler

rustic rain
#

I'm not sure what to look at it

#

seems like it's the first systems all together to run

rotund token
#

Looks like you have full stack trace on to me

rustic rain
#

huh

#

indeed it helped

#

but still, 2ms for physics

#

uugh

safe lintel
#

also click the 3 dots and enable flow events

#

it shows what system created what job

rustic rain
safe lintel
rustic rain
#

huh

#

interesting, thanks

#

sometimes in peaks it just lags

viral sonnet
misty wedge
#

It was orders of magnitude faster in a build

rustic rain
#

I hope it will, this is supposedly mobile project xD

rotund token
#

Just using the workaround on forums for now

rotund token
rustic rain
#

so, that's also a reason? xD

rotund token
#

yes, jobs debugger adds a lot of main thread slowdown

#

you really shouldn't profile with any safety on

#

there's no point

#

my step physics with 1000 falling cubes is 0.70ms in editor

#

with jobs debugger on 1.75ms

rustic rain
#

meanwhile my 2 entities 1.5ms with jobs debugger

#

xD

pliant pike
#

yeah I have a job which is like 2000ms and goes down to 60 odd I think without safety checks

safe lintel
#

I think to an extent theres overhead with physics kinda like the hybrid renderer, though I suppose it depends what your hardware is to determine what that is exactly

rustic rain
#

I just wish they roll out 2d physics as soon as possible

safe lintel
#

I wish for many things with dots ๐Ÿฅฒ

viral sonnet
viral sonnet
#

oh, I didn't try that. never thought this would work tbh ๐Ÿ˜„

pliant pike
#

stupid question but I don't suppose anyone knows why I get this error Attempted to access BufferTypeHandle<PotentialMoveBuff> which has been invalidated by a structural change. when trying to access the length value of a buffer

#

I'm not structurally changing it anywhere near this code I 'm just getting the length ๐Ÿ˜•

rotund token
#

basically it means you use entity manager

#

after accessing buffer

pliant pike
#

huh, so I can't do that

#

I see entitymanager is a structural change

rotund token
#

all buffers are invalidated by any structural change

#

just in case the buffer might have moved chunks

#

its just a safety measure

#

it would be costly for unity to validate which buffers have/haven't moved

#

so it's just faster/safer to invalidate everything

pliant pike
#

so how do I even read teh buffer then

rotund token
#

you read it

#

you just don't use entity manager until you're done reading it

#

it's in the manual ๐Ÿ˜„

pliant pike
#

well that's a new addition I'm sure, they keep updating this stuff dammit

rotund token
#

your solutions are really either
a) copy the buffer to a native array
b) use a command buffer and playback after the loop

pliant pike
#

yeah I maybe slightly behind in reading it leahHMM

rotund token
#

real programmers don't read manuals am i right?!

#

source code is where it's at

pliant pike
#

actually I normally do check that page quite often when I use dynamicbuffers just don't think I scrolled down than far ๐Ÿ˜†

rotund token
#

anyway yeah that's your problem

#

a pretty classic one

pliant pike
#

yeah the small print don't matter all I need is the setup

#

well thanks for clearing that up

sharp stump
#

So ECS has no animation system. I am told that to have entities that animate I have to convert them from GameObjects. Is this so? Can I get entities that I can animate by converting gameobjects?

rotund token
#

that seems like odd advice

#

if ecs had an animation system you would convert entities from gameobjects (which is what you should be doing anyway)

#

generally you animate using a hybrid approach of having gameobjects with the animator

#

which is referenced by an entity

#

otherwise you need to go into shader animation territory

misty wedge
#

Just don't have any animations taps forehead

#

That's my trick

sharp stump
rustic rain
#

which is integral to ecs

sharp stump
rustic rain
#

so unless Unity fully gets rid of game object, I don't see how it can become obsolete for ECS

sharp stump
#

That can't be the case. Why would you just throw away all of your GameObject based features just because you have an ECS alternative?

#

Also, why would I have a workflow that uses GameObjects to create entities if I didn't have to? Seems like doing it twice

rotund token
#

because thats the intended workflow of entities

#

author your entities via gameobjects in subscenes

#

i.e.
gameobjects - authoring state
entities - runtime state

#

1.0 significantly expands on this further

rustic rain
#

hmm

#

it seems like I can't modify Collider without knowing it's type beforehand?

rotund token
#

not sure what you mean by that

#

you mean a unity physics collider?

#

you can get the type from it

rustic rain
#

I am trying to modify current physics into 2D

#

rn what I want is to go through all converted GOs

#

and modify their colliders to be at Z == 0

#

offset

#

depending on converted LTW

rotund token
#

yeah what's stopping you?

#

(though weird)

rustic rain
#

Can't figure out how to modify collider

#

since I get generic type of

#

Collider

#

which wouldn't allow such modifications

rotund token
#

Collider has a field called Type

rustic rain
#

what about casting?

rotund token
#

you get the ptr

#

and cast it

rustic rain
#
var boxCollider = (BoxCollider*)e.ColliderPtr;
#

hmm

#

all right, seems to work

#

mmm

#

seems like changing Center is not allowed normally

rotund token
#

well colliders are blob assets

rustic rain
#

ah, it's private field

rotund token
#

blob assets are meant to be immutable

rustic rain
#

but I assume if I modify it through reflection

#

it'll change?

rotund token
#

i certainly would not use reflection

rustic rain
#

how else would I change private field?

#

this is one time conversion process

rotund token
#

but i wouldn't do it this way at all

#

i'd just write my own physics conversion for physics2d components

rustic rain
#

hm

#

standard physics shape authoring has so many nice features tho xD

rotund token
#

including setting center

#

so why do you need to change it then?

rustic rain
#

I don't want to modify it every time

#

I change Z

#

on every game object

#

I'm trying to simplify my authoring process

late mural
#

wondering, can you instantiate prefabs with dots like regular prefabs, and if so do they require more processing power to instantiate then non dots prefabs, or less?

late mural
late mural
# rustic rain EntityManager.Instantiate

due to me being completely new to everything dots, do you have to create an entity manager manually, or is it auto created when it detects that the scene has dots in it? (sorry if this is a stupid question, the docs for the dots api are quite vague or im being quite dumb)

rustic rain
#

it's property of SystemBase

#

or any other system classes you might use

late mural
#

let me check the docs brb

rustic rain
#

just go to manual kek

late mural
#

lol

late mural
#

oh thanks lol

late mural
rustic rain
#

just keep reading xD
It's totally different world from game objects

#

at a point it'll get to examples

#

and all you read will finally start to make sense

late mural
#

yup lol, im excited to learn this, im gonna feel dumb once i understand this

#

ok ive kept reading, and it seems that each different archetype (list of all entities that are exactly the same component wise) each have their own entity manager, i think, this is so fascinating lol!

#

and each system is part of a world, which is like the entity version of the scene, except you can have multiple worlds in one scene, and multiple scenes in one world

rotund token
#

there is 1 entity manager per world

rustic rain
#

wha

#

since when pasting code is illegal?

late mural
#

also is it normal and good for dots to really hate one random script that doesnt even use dots?

#

huh unity discord is not enjoying you pasting that code, unlucky

rotund token
#

im a fast reader issue but i can't read all that code in 0.1s

rustic rain
#

What am I doing wrong?

#

trying to make a constraint joint

#

so entity can only move in X,Y and rotate around Z

#

results in NaN

late mural
#

is this normal, the file doesnt even use dots?

rustic rain
late mural
#

ok i will thanks

rotund token
#

you can just delete the directory as well

#

to avoid editor restart

late mural
#

delete what directory? the assembly c sharp thing?

rotund token
#

yeah just everything in temp directory

late mural
#

ok, and it wont break anything?

rotund token
#

its a temp directory

late mural
#

ok good

rotund token
#

just reimport something aftewards

#

for some reason

#

its creating files instead of directories in there sometimes

late mural
#

ok got it

late mural
#

ok im a bit confused, im trying to interact with an entity, which means i cannot use a mono behavior, but if i dont use a monobehavior then i cannot atatch the script to a game object, therefore i cannot make it run?

rustic rain
#

create a class that inherits from SystemBase

#

and make your logic in there

#

no game objects

late mural
#

ok, so i dont need to attach my script to a game object then if i do that, i can just let it rot in some folder somewhere?

late mural
rustic rain
#

I suggest to keep looking through manual

#

it has examples

late mural
# rustic rain it has examples

this makes sense, but the manual ended after one page, with no examples, i tried searching around for the rest of the pages of the manual, but it appears that they have scattered in the wind, or atleast they are evading my grasp

rustic rain
#

you just keep going through each page kek

late mural
#

oh those things, i didnt realise they were pages...

late mural
#

something like ```csharp
public class whatever_name : ComponentSystem
{
stuff here
}

rustic rain
#

SystemBase

late mural
#

oh ok!

#

fascinating, my no error code has suddenly gained quite a few errors, but they look fun to debug, thank you so much!

#

this is gonna be yet another stupid question, how do you run the for each of the entities thing, as it seems most info about it is nolonger working, i would assume outdated judging by how most info is from 2020, and the documents in the manual thing are equally unhelpful, being quite vague in description. Infact the best information about it i can find would be in the error message which tells me to either use schedule, scheduleparallel, or run, but if i dare do any of these it gets even angrier, how odd

late mural
#

sorry i phrased things weirdly

late mural
#

ive already been there, nothing there helps me, the more i follow the guide, the less things work

#

it seems that you need to have schedule, parrallelschedue, or run, none of which i am allowed to use for unknown reasons

#

im guessing im missing something extremely obvious?

rustic rain
#

To execute a job lambda function, you either schedule the job using Schedule() and ScheduleParallel(), or execute it immediately (on the main thread) with Run()

#

this is from manual ๐Ÿ™‚

late mural
#

yes, i read that, unfortunately none of them work

#

if i dare use one, i get told off

rustic rain
#

paste code

#

that doesn't work for you

late mural
#

curse it ill screenshot it

#

sure one bit is cut off, but that bit never raises any errors

#

also ignore my snake_case i know it isnt proper c sharp style, but i find it hard to read CamelCase, dont know why i do, but i do

rustic rain
#

I can see an error already, kek. Hold on, a bit busy

late mural
#

it's ok, take as much time to do whatever, im in no hurry

rustic rain
#

Errors in ECS are really helpful

#

so, pay attention to them

#

there are so many safety checks inside

#

it will shout on you on literally every possible error

late mural
#

oh ok, lesson learnt, and when do i do teh with structural changes thing, and are there any things i need to pass into it?

rustic rain
#

if you do structural changes, you need this attrubte

#

and also need to Run

#

as structural changes can only happen on main thread

late mural
#

im really feeling like an idiot at the moment, what on earth are structural changes, and which attribute, on which one of the things?

rustic rain
#

in this case you are allowed to do managed code inside your lambda

#

WithStructuralChanges() is attrubute I talk about (could be wrong terminology)

#

structural changes are described in manual ๐Ÿ™‚

late mural
#

oh, i clearly have not gotten to that point in the manual yet, im only up to page 3 so far, but thank you!

rustic rain
late mural
#

ok that makes sense, i still dont know which one needs it, but atleast it is a good starting point for research!

#

ok from reading it, it seams somthing somewhere of somekind needs it, i still cant work out exactly what, but im getting closer

#

also the more i read, the less and less this seems like an attribute, the more it seems like it is a method of some kind

#

how you attach a method, to a thing i have no clue (i dont actually know the technical name for the thingys that contain and are and exist and stuff, im sorry im very stupid lol)

#

but this is a fun mystery!

late mural
# rustic rain

also according that that, there are no structural changes in my code, which raises the question, why do i need the structural change thing anyway, it definitely seems required, but as to why, the manual seems to disagree with the reality

rustic rain
#

adding/removing components

#

also changing shared component

#

are structural

#

destroying entity also

late mural
# rustic rain creating entity

oh, ye that would make sense, sorry i am an idiot, im up to page 5 now, and still no sign of anything to do with structural changes, so i hope i find the page soon

#

i did manage to find another page that described the for each entity thing, but that made no mention of structural stuff anywhere sadly, i hope i find wherever this knowledge is kept, it seems to be well hidden

rustic rain
#

it's creating

late mural
#

aha i found something about structural changes! It is super vague, and i dont know how to use it, and it has no examples, but atleast it is confirming the existance of it!

#

they get this small paragraph, and are not mentioned anywhere else judging by my research, so imma trial and error this thing all over my code until i figure out what it does, and how to use it

devout prairie
#

One of the things i admittedly struggle with when moving away from Transforms and gameobjects etc some of the helper methods we take for granted for example transform.RotateAround() etc, things that involve quaternions and matrices that i have no idea the math behind

rustic rain
#

and you can't do structural changes with that

#

so you need to disable burst and enable main thread

devout prairie
#

Obviously we can pick up some little tricks like converting a position or rotation from global to local space etc etc, but when there are more complex transformations required the maths is a bit of a black box

late mural
rustic rain
#

or you can simply do it inside OnUpdate without ForEach loop

#

ForEach is only required if you need to access entities

#

in World

#

nothing stops you from doing your own bookkeeping

#

inside System

late mural
#

ok, how do i do any of that?

devout prairie
#

For example if you google 'unity rotate a point around another point' or try and find the code behind transform.RotateAround you just get a ton of references to transform.RotateAround..

late mural
#

cause as far as i was aware from reading the manual then the for each loop was the only way of finding entities...

devout prairie
#

Would be nice for Unity to start providing some learning materials around how to do this, in order to transport some of this logic into bursted jobs

late mural
rustic rain
#

you should read conversion workflow part

#

in manual

late mural
#

yup lol, i just wanna istantiate 1 entity that exists, and i have to deal with trial and error due to there being no documentation on the structural changes thing

rustic rain
#

this is how you are supposed to create entities

late mural
#

you cant convert while instantiating, because there is nothing to convert about it

rustic rain
#

EntityManager.CreateEntity

#

to create entity without components

late mural
#

yup i know that, i dont see how that helps me, sorry lol, im a bit of an idiot

rustic rain
#

you can do it inside OnCreate of System

late mural
#

once again, i dont understand how this helps me with istantiating, im sorry...

rustic rain
#

just tell what you want to achieve in the first place

#

I suggest you to start learning how manual suggest - with rotating cubes xD

late mural
#

i shall probably try that, but what i am trying to achieve currently is creating one entity with a few components like colliders and rigidbodies, and then istantiate that one entity a bunch, i have already achieved the creating of the 1 entity, it is the instantiating part im stuck on

rustic rain
#

like colliders and rigid bodies xD

#

that's like highest level

#

of ECS

#

kek

late mural
#

eh, well atleast they are easy to make

#

im starting small

rustic rain
#

they are not easy to make

late mural
#

oh, then i somehow stumbled my way into doing it then, i dont know lol

rustic rain
#

anything related to physics is advanced

late mural
#

oh

#

well i now that somehow i do have the physics stuff, i no longer need to touch them, all i need to do, is create more of them

#

luckilly there are so many tutorials everywhere on how to do instantiaing with dots, but all are out of date sadly and no longer work

rustic rain
#

try moetsi dots manual

late mural
#

that is multiplayer and stuff, i dont want to touch advanced stuff yet, i just wanna duplicate stuff, im really an idiot im guessing

rustic rain
#

it's not

#

it's total newb tutorial

#

which helped me a lot

#

to get into ECS

late mural
#

oh is it, ok welp ill go through it, thank you so much, sorry you are having to put up with my stupidity

rustic rain
#

netcode stuff is like part 4 of it

#

which is after physics

late mural
#

so far i have managed to heavily distort the dots text in the entity hierarchy thing to the point of almost unreadability, i cannot appear to replicate this amusing bug, but ill still consider it a personal win!

#

and it seems when i add my first entity i drop from around 400 fps to 10 fps, so quite the slow down so far, but im certain i must be doing something wrong to get such a performance drop

rustic rain
#

can't help until you show what you do

late mural
#

haha i got it working!!!

#

this clump of ominous spheres might not be the exact result i wanted, but hey im just so happy that my instantiating script works!!!