#archived-dots

1 messages ยท Page 155 of 1

storm ravine
#

@scarlet inlet How many jobs you're scheduling? Is there any for loop where you scheduling many Job's?

scarlet inlet
#

our code didn't change at all before/after the update

storm ravine
#

If no I guess it's definitely bug with latest Havoc jobs changes

scarlet inlet
#

it could be either havok/physic or uecs .11

storm ravine
#

uecs .11 no

scarlet inlet
#

if you tell me that .11 is fine, then it's surely havok/phusics

storm ravine
#

havoc\physics - yes

#

I'm on latest DOTS packages always

scarlet inlet
#

you know anything about the fallback allocation btw? regardless this problem

storm ravine
#

you know anything about the fallback allocation btw? regardless this problem
in this case or?

amber flicker
storm ravine
#

In this case it's not about fallback allocations I think (not directly and not In meaning how I see that)

scarlet inlet
#

not in this case

#

in generael

storm ravine
#

Case of fallback allocations which I meant was about Temp allocator behaviour inside jobs when not enough space in preallocated memory and it fallback to slower allocation path

scarlet inlet
#

I have been told that it happens when the temp and temp job buffers are full

#

which I find also VERY strange

#

and even if it's right, how can I have bigger buffers?

#

how can I at least debug the memory

storm ravine
#

nothing strange for me, I mean this is expected, they speedup memory allocations in this case by preallocating some buffers and then excluding allocations and just reuse that memory ๐Ÿ™‚ Faster allocation is not allocate at all ๐Ÿ˜„ But when not enough - they fallback and allocate new memory

scarlet inlet
#

well

#

the Temp and Tempjob buffers make a lot of sense for games

#

I would have done the same thing myself, but since UECS has one..

#

however if the size is not configurable it;'s a problem

#

as well as if I don't know what;s taking so much in them

#

a lot of native containers rely on those buffers

#

I use tempjob 108 times in our project ๐Ÿ˜‰

#

but a LOT of them come from physic ecs

storm ravine
#

If you use them with these allocators ๐Ÿ˜„ In our game we allocate once and reuse it inside jobs ๐Ÿ™‚ I mean allocating inside job - rare case for us

scarlet inlet
#

we don't allocate inside jobs

amber flicker
#

^I know that's just an example but none of those look like particularly runtime usages? Not to say there aren't any.

storm ravine
#

This two articles will be good for understanding how Temp allocator implemented ๐Ÿ™‚

scarlet inlet
#

understanding how it works is not my problem though

#

my problem is that the size of the pool should be user configurable

#

I will double check for temp inside jobs, it's surely the first thing to check. I remember one actually

#

but it's not necessary

#

it we use it it's because we may think it's better to use Temp instead of TempJob

#

which I start to think it's not the case

pulsar jay
#

@scarlet inlet would I need to iterate over each chunk of the group on the main thread and then make an inner loop iterating over the entities in parallel?

scarlet inlet
#

if you need SystemBase.ForEach you won't need to do that

#

ForEach will take care of everything

#

like in the code I wrote above (which is burstified and in jobs if I remember it right)

#

the only bad part in my code is the .Complete()

#

but it's a burstified schedule parallel

pulsar jay
#

I am unsure which of the components is the shared component in your case

scarlet inlet
#

in the image you can see I ask Unity to give me ALL the UECSSveltoGroupID shared components and then I use each of them in the ForEach using the WithSharedComponentFilter

#

ah yes now I got what you mean, yes, the iteration of the groups is done in the mainthread

#

but that is an acceptable overhead

pulsar jay
#

I see. But then I could access the data of the sharedcomponent on the main thread an hand it into the foreach I guess

scarlet inlet
#

yes I guess that's right

pulsar jay
#

ok thx I will try that

scarlet inlet
#

just remember that in my case I use them really just to group different entities according their shared component value

pulsar jay
#

yeah I see. but I guess it totally makes sense to iterate over the grids and then push this data into the enitity loop

#

I dont know how I would model the Tile <-> Grid relationship with ECS otherwise

#

@scarlet inlet your example isnt jobified is it?

scarlet inlet
#

ScheduleParallel() jobifies it

#

it's a SystemBase thing

pulsar jay
#

I see. I am still using JobComponentSystem. From what I red just now it seems like SystemBase is about to replace the JobComponentSystem

opaque ledge
#

that happened long time ago ๐Ÿ˜„

#

tho difference between those 2 pretty low

#

instead of jobhandle parameter you use Dependency property, and SystemBase has Get/Set/HasComponent methods to reduce code boilerplate

scarlet inlet
#

just for curiosity

#

do you know it?

#

am I missing out something?

storm ravine
#

Yep this is two "new" tabs Systems\Entities

#

You can find post on forum about this functionality

#

It's replacement for EntityDebugger eventually

#

But not earlier than they will have parity in functionality

scarlet inlet
#

Cool thanks

wary ibex
#
mypackage\Runtime\EntitySender.cs(16,66): error CS0246: The type or namespace name 'GameObjectConversionSystem' could not be found (are you missing a using directive or an assembly reference?)

Why am I still getting these reference errors when I have already included the GUIDs and package dependencies in my package? ๐Ÿ˜

storm ravine
#

Unity.Entities.Hybrid

tawdry tree
#

To expand on that for future reference: A lot of the packages add things to higher-namespaces than their package name would imply.
To find out where a method class, or struct actually lies, you can consider what it does and which package it may come from. In this case, for example, it has to do with conversion, which is a Hybrid concept.
You can also google the class/struct with full namespace + package manual (here: Unity.Entities.GameObjectConversionSystem IIRC)

keen lion
#

Are entities able to access singleton instances in their OnUpdate method? I'm playing with an RVO2 implementation, and it uses a Simulator.Instance (Non MonoBehaviour if that matters) to move game agents around. I'd like to try it out with DOTS. Is this a no-go? Google isn't helping me out much, and I'm very new to DOTS, so it would take quite a while to try it out myself, and I'd never know if I just messed up my implementation or if this is simply not possible.

Thanks

tawdry tree
#

Entities don't have OnUpdate, systems do. But yes, systems can access statics in OnUpdate. If you want to use something in a lambda (Job.WithCode or Entities.ForEach) you need to grab it locally inside OnUpdate, though:

class SomeSystem : SystemBase {
  private int _someCounter;
  private static object SomeSingletonAccessor; //pretend full implementation

  void OnUpdate() {
    //Local references/values
    var localCounter = _someCounter;
    var localSingleton = SomeSingletonAccessor;
    var localSomeOtherStaticThing = OtherStaticObject.OtherThing;
    //Lambdas (note that these generally don't like reference types, ie classes
    Entities.ForEach(/*...*/);
    Job.WithCode(/*...*/);
    //Can also use static methods freely within both here and lambdas
    //Careful with what state said methods change, though
  }
}
keen lion
#

Oh wow, ok thanks for the detailed reply. I wasn't sure if I could even try that. I'm still not sure if mutiple jobs reading/writing to the class via the singleton methods will cause any issues though. Do you know anything about that?

#

I found that article trying to search for the answer to my earlier question. Seemed relevant but wasn't sure it answered it. I'll check it out. Thanks

tawdry tree
#

I think the safety system will stop you from using the singleton methods in jobs, but also be aware that it sounds like you're doing something rather antipattern here.
Consider formulating what you're trying to accomplish and simply asking here how to do it in a correct-to-DOTS way.

keen lion
#

That makes sense. I figured that was the case, but wasn't sure if Unity had some sort of magic going on behind the scenes to make it possible. This is definitely against what DOTS seems to be about, but it would have been a quick workaround to try it out. Thanks for the replies!

#

I did test out simply calling one method of the singleton in a job, and it didn't seem to complain, so it's still a possibility. I'll give it a go later. Thanks again

tawdry tree
#

If you do .Run, more things are safe than if you do .Schedule or .ScheduleParallel.
.ScheduleParallel means you'll (potentially) have multiple versions of that very same job running multithreaded, which can get all sorts of hairy if you use stateful static methods

keen lion
#

Looks like I'll need to do a lot more research to make this happen. Long term backburner project, sounds like haha. I was just following CodeMonkey's tutorial on RTS Unity selection with ECS. Googled local obstacle avoidance (so units avoid colliding into eachother like StarCraft 2) and found a very nice working unity project under apache 2.0 license. I was wondering how much of a nightmare it might be to combine the two. Looking through the RVO2 code, I don't see any sort of states though, so it might not be too terrible. If I modified it to ECS though, in order to use it I'd have to document any/all changes to it due to the license (I think) which sounds nightmarish

tawdry tree
#

.Run = Run on main thread, now
.Schedule = schedule to run on a worker thread
.ScheduleParallel = Schedule to run parallel on potentially many worker threads

keen lion
#

Yeah, I'd definitely want it to be scheduled Parallel if I was going to do it

tawdry tree
#

That means any mutation is potentailly really bad

keen lion
#

Yeah that makes sense. Looks like there's a lot to learn on the subject. Thanks again

deft stump
#

doesn't .ScheduleParallel run on multiple worker thread if your Entities.ForEach covers multiple chunks?

#

1 thread = 1 chunk?

tawdry tree
#

Yes, hence why potentially many

#

Docs says:

ScheduleParallel() -- schedules the work to be done in parallel using the C# Job system. Each parallel job instance processes at least one chunk of entities at a time. In other words, if all the selected entities are in the same chunk, then only one job instance is spawned.

storm ravine
#

@scarlet inlet congratulations on being added to ext-dots ๐Ÿ™‚

wary ibex
tawdry tree
#

That sounds like the input package, am I right?

wary ibex
#

yes it belongs to Unity.InputSystem

#

just like GameObjectConversionSystem belonged to Unity.Entities, with no reference to Unity.Entities.Hybrid

#

but I only have these 3 options for input assemblies

tawdry tree
#

I haven't used the input system package with AsmDefs, so not sure

#

If the Unity.InputSystem assembly isn't correct...

wary ibex
#

do you know if these are important at all?

tawdry tree
#

What's those dependencies for?

wary ibex
#

I don't understand why we have both these dependencies and asmdefs. It seems so redundant.

#

what do you mean?

#

It's a local package I'm developing ๐Ÿ˜›

tawdry tree
#

Ah. The package info and AsmDefs are completely separate, though - the package dependencies are the other packages that must be installed in order for that one to work. The package can (and most official ones do!) have multiple AsmDefs, for example one for code and one for tests, or however you yourself split your code.

wary ibex
#

Okay

tawdry tree
#

The only solution I can come up with would be to interact with that particular package one outside a defined assembly.
You might want some use-specific DOTS "interfaces" for the input system anyway

#

It sounds weird that it doesn't work with the InputSystem reference, though

#

Doesn't it generate some files for you? Double-check where those lie

wary ibex
#

what files?

storm ravine
#

@wary ibex You speaking about InputAction class?

#

Do you have using UnityEngine.InputSystem; in place where you want to use InputAction ?

eager jungle
#

hey guys. What is the best way in your opinion to have a hashmap on a component? My actual problem is to create a NetworkedEntityManager, in which i can link my netIDs with Ecs entities. I was going to use a singleton with a component and a hashmap, but it doesn't seem to be allowed

coarse turtle
#

UnsafeHashMap<int, Entity>?

#

You can put those onto components, but you'll need to manually dispose those structures when you're done using them

eager jungle
#

oh can i, let me try that. I was trying to use NativeHashMap

#

seems to be pretty much the same as a NativeHashMap, is there a real difference?

coarse turtle
#

NativeHashMaps use UnsafeHashMaps internally

#

the major difference between the two is that NativeHashMap has a disposal sentinel check so you can see whether or not there is a mem leak easily in the console

eager jungle
#

good stuff, thanks a bunch

pulsar jay
#

What is the best way to destroy all the entities I created? I was instantiating converted prefabs and atteched a shared component to it. Then I used a query for that shared component to destroy the entities.

#

But I get this: DestroyEntity(EntityQuery query) is destroying entity Entity(214:1) which contains a LinkedEntityGroup and the entity Entity(224:1) in that group is not included in the query. If you want to destroy entities using a query all linked entities must be contained in the query..

mint iron
#

sounds like you'll have to make sure all of your linked entity group have a common component and include them in the query through it. I may be wrong but i think LinkedEntityGroup is from prefabs with children, and ideally the destroy method would be able to also destroy the children ๐Ÿ˜ฆ

pulsar jay
#

Thats a bit impractical at least ๐Ÿค”

mint iron
#

i believe when i encoutnered the issue before i had to iterate though each child via the component and remove them individually

pulsar jay
#

would be great if unity could do that by default

#

would be interesting how unity handles this case with subscenes

#

I guess they should have the same problem

stone osprey
#

How do i check if a entity has a "type" ( The Type-Class) attached ? So instead of manager.HasCOmponent<Health>(entity)... a check with a type... any ideas ?

pulsar jay
#

@stone osprey what do you mean by has a type?

stone osprey
#

Instead of .HasComponent<Health>(entity) .HasComponent(entity, typeof(Health))

#

is this possible ?

mint iron
#

its possible with some hackery

#

if you get the typeInfo (which i think u can do in jobs now) or know the typeIndex

#

you can then write the index to an existing ArchetypeChunkComponentType for example, and call its exists method

amber flicker
#

I wonder if you could do it through a systembase extension method? maybe not

opaque ledge
#

is there a reason for you to do that Genar ?

#

if you are thinking of assigning a type to a variable and do .HasComponent(entity, typeof(variableName)) that wont work with Burst, since dynamic stuff isnt allowed

stone osprey
#

Thanks ! That should already help ๐Ÿ™‚ Im working on a reactive system... one for burst and jobs and one for single threaded activities... Some of those callbacks should only run if the entity has certain other components attached... HealthReactiveSystem.RegisterAddListener((...) -> {}, typeof(Player)) this callback should only run if a health component was added but theres already a player component attached to the entity

#

Such systems are great for ui stuff... or for client/server communication or for asynchron stuff

pulsar jay
#

I took a look at the SceneSystem.UnloadScene method but I cannot quite comprehend what they are doing in there to destroy all entities ๐Ÿค”

blazing igloo
#

OOP worse than DOP/DOT ?

stone osprey
#

@blazing igloo Not that flexible and performant

blazing igloo
#

Is it easier to write code with ?

#

Why has it become an industry standart?

stone osprey
#

OOP is great for applications that dont change their structure that often... DOD is great for things that change often and consist of data only ( Composition over inheritence e.g. )... Not "easier" just different... you need a lot of boilerplate code, but once you have the base its pretty easy to add new features ( Chicken + Fire = Fire Chicken ) with a couple of lines

blazing igloo
#

also while you are here

#

Is it better to make a lot of scripts and organize stuff by their function or make fewer scripts
which is better for performance

stone osprey
#

A lot of scripts ( Each one spezialized on one certain thing ) > huge scripts managing all

#

Well atleast for organisation... not sure about performance

#

But it shouldnt have a huge impact at all

blazing igloo
#

I should clarify I am not doing DOD im using old scripting

#

So it doesn't matter?

#

Then why am I getting 50fps on my mobile game that barely has anything in it

stone osprey
#

Well it does... but not that much as far as i know... you probably shouldnt use the update method in every single script

blazing igloo
#

pretty sure I wrote efficiant code

stone osprey
#

Oh that has many reasons... you should profile your project... could be update methods, rendering, too many polygons etc.

blazing igloo
#

Oke, new to profiler

#

is it hard?

#

I can pick it up in a day right ?

stone osprey
#

Yep, its pretty simple... it shows you what in your project is draining your performance

blazing igloo
#

Cool like Task Manager?

stone osprey
blazing igloo
#

Okej thanks

pulsar jay
#

I red that DestroyEntity(NativeArray) can destroy the LinkedEntities but DestoryEntity(EntityQuery) will not

#

Is there a way to create a NativeArray from a Query?

blazing igloo
#

When is ECS going to become a standard?

#

This year or the following year?

safe lintel
#

maybe not for a few years at the current rate

dull copper
#

it would need to get ready first

#

which Unity estimated year ago to be somewhat production ready by ~2022

#

and it's not looking like it's happening by that

#

and even when that's done, majority of the users will not use it

#

so... maybe never, or in 10 years, who knows

opaque ledge
#

Can someone remind me how to do profile sample thingie for bursted jobs ?

#

first time i need it ๐Ÿ˜„ i have a job that takes 230 ms in bursted job, i am thinking sorting array does that

wary ibex
#

What could cause objects just disappearing/entities not being rendered once the scene starts?

#

I just copied demo files from one project to another, ensuring I had all the packages. I get no errors, and I can see the objects in the scene view, but once I hit play it's all gone. I can see entities and components in entity debugger though

glacial bolt
#

Not remembering to offset the camera on z on updates

#

And that's #archived-dots of which I know nothing about... Still, the cause usually render getting clipped by near plane of the camera.

wary ibex
#

Even when everything is gone from scene view?

glacial bolt
#

Do they use the wrong world space coordinate as a center?

wary ibex
#

No

#

Actually, everything that I convert to entity is just gone as soon as I hit play

opaque ledge
#

can you check DOTS -> Live Link Mode ?

#

should be SceneView : Live Game State

#

i thinl

wary ibex
opaque ledge
#

yeah make it Live Game State, maybe it will work

wary ibex
#

unfortunately it didn't :/

opaque ledge
#

๐Ÿ˜ฆ

wary ibex
#

thanks though

opaque ledge
#

well only think i can think of is hybrid renderer package, but you already said you had the packages so not really sure

wary ibex
#

no idea what's the difference between the 2 projects to be causing this

opaque ledge
#

so you can see your entities in edit mode but they dissapear when you go play mode ?

wary ibex
#

yeah

#

and they are active because I can see them in the entity debugger, they're just invisible

#

I'll try reinstalling the hybrid renderer but I doubt that'll do anything. I already trying deleting Library folder & restarting many times

coarse turtle
#

Can someone remind me how to do profile sample thingie for bursted jobs ?
@opaque ledge The ProfilerMarker api?

eager jungle
#

hey. What's the expected behaviour when calling EntityManager.AddBuffer twice?

storm ravine
#

It will just silently return internally on second Add and all other AddBuffer, as under hood it using EntityDataAccess* -> AddComponent which in turn check that component already exist

eager jungle
#

do you agree the result above is weird then?

storm ravine
#

First of all I don't see all your code

#

Second is you using Child buffer (Unity built-in from transform systems) I suppose?

eager jungle
#

The issue might very well come from my code, I'm trying my best to check that and couldn't figure it out, wanted to check the expected behaviour before getting in deeper.
Yes I'm adding child entities to a parent for the transform system

#

are they maybe auto added by some other system on some condition?

storm ravine
#

Child buffer involved in parent system of course as it's used by them, moreover is ISystemStateBufferElementData not just IBufferElementData which means it tracked a bit differently. I'm 100% sure problem in your code. Describe what you trying to do, I'll help you. When and where you adding buffer. entity to which you adding buffer created from code or by conversion workflow etc.

eager jungle
#

thanks. Entity is spawned from a system directly, from an ecs prefab, in a non burst code simply using the EntityManager. I'm doing the above code right after instantiation, and have no other reference to Child in my code.

storm ravine
#

And show inspector of this entity (from EntityDebugger selected entity)

eager jungle
#

if i remove the above two lines, it seems like Childs are still created (I'm adding Parent and LocalToParent to to child entity, maybe that's the reason).
but weirdly enough, if i only use the first line, it seems ok and i end up with 3

storm ravine
#

ParentSystem tracks changes of chunks with Parent\Child

#

For building hierarchy you only need add Parent to your childs

#

m_NewParentsGroup will handle that and will add child buffer

#

This is the reason of Child is ISystemStateBufferElementData

#

As parent system responsible for that buffer and only this system tracks adding\removing this state buffer

eager jungle
#

ok, so Parent + LocalToParent will do just fine in all cases?

storm ravine
#

Parent, LocalToWorld, LocalToParent

eager jungle
#

yep OK, understood

storm ravine
#

Then it runs chain of jobs on change filters

#

collect unique parents and "fix" missing childs

#

That's all "magic"

eager jungle
#

great stuff thanks

#

Still kind of a mystery why it was not producing 6 childs with the first line of code only

#

i would have expected 9 actually

storm ravine
#

As it's state this is the reason why you don't see Child buffer first frame after conversion

eager jungle
#

ic

storm ravine
#

Ok lets figuring that out. You have system yes?

eager jungle
#

sure

storm ravine
#

You creating entity yes?

#

Just at OnUpdate start yes?

eager jungle
#

actually its called on update when i receive a snapshot from a game server, for an entity that doesn't exist already

storm ravine
#

Ok, anyway, you creating that entity AND immediately add Child buffer? You already have Parent,LocalToParent ar add it right after Child?

eager jungle
#

correct

storm ravine
#

How many entities you creating and child's you're adding?

#

I mean just show it ๐Ÿ™‚

eager jungle
#

in that case 3, on the same parent entity which already exists

storm ravine
#

Whole part which creating entities and adding buffer

#

It will be faster

eager jungle
#

and basically this is called 3 time in a row, in the same update call, for 3 child of one entity already spawned (same parentEcsEntity)

#

in a basic foreach loop, no jobs, no burst

storm ravine
#

Ok good

#

Now final most interesting part

#

What is your prefab?

eager jungle
#

a simple cube, with no parent of children

storm ravine
#

and basically this is called 3 time in a row, in the same update call, for 3 child of one entity already spawned (same parentEcsEntity)
@eager jungle thus your parent should have these 3 childs right?

#

Like this

#

Right?

eager jungle
#

absolutely

storm ravine
#

Can you now comment second if statement and show me EntityDebugger inspector for that parent cube?

eager jungle
#

same as DM but 6 items

#

no Null item

storm ravine
#

Show it ๐Ÿ™‚

#

I'm interested in other components too

#

with commented if(_parentSynchEna....

eager jungle
#

the Parent on top is... strange

storm ravine
#

Yes ๐Ÿ™‚

#

And as if(_parentSynchEna.... commented

eager jungle
#

it is

storm ravine
#

which means not this code adding entities to buffer at all as you haven't here Add now ๐Ÿ™‚

#

And about parentEcsEntity, which you told is just root cube then it shouldn't have Parent ๐Ÿ™‚

#

And as I see

#

as it's the same name as childs

#

SmallCubeClient

eager jungle
#

hmm let me try to follow you

storm ravine
#

And show inspector for your prefab entity

#

in EntityDebugger

eager jungle
#

let me show you that first, maybe

storm ravine
#

And hierarchy please

opaque ledge
#

@coarse turtle yeah, but i think i figured it out thanks

storm ravine
#

Of opened prefab

eager jungle
storm ravine
#

No need hierarchy

eager jungle
storm ravine
#

I see that it's one entity itself in LinkedEntityGroup

#

Yep I see that from EntityDebugger

#

Prefab itself - good

#

Now question where this prefab also used

#

And what is more important

#

Are you sure you by accident using one of created childs

#

by overriding your prefab value

eager jungle
#

stored on Scriptable with Client/Server prefab pair, which is then converted to prefab entity using conversionSystem.GetPrimaryEntity

#

Are you sure you by accident using one of created childs
by overriding your prefab value
can you explicit that?

storm ravine
#

parentSrcEntity

#

where it involved

#

As problem exactly with this prefab

#

Not with prefab itself

#

but with how you storing (writing) in that field and where

eager jungle
#

parentEcsEntity is something that i get via a hashmap

storm ravine
#

As problem not in code snippet from above

eager jungle
#

where i save all the already instantiated networked entities

#

just to be clear, what would you expect ?

  • when commented out , the instance should not have Parent?
  • when commented out, should still show 3 and not 6?
opaque ledge
#

Native Array sorting takes too much time D:

#

sorting 1000 entities

#

i guess i have to find a workaround

storm ravine
#

@eager jungle just to be clear, what would you expect ?

  • when commented out , the instance should not have Parent?
  • when commented out, should still show 3 and not 6?
    Nothing yet as I still don't saw where and how you instantiating and storing parentEcsEntity
#

Which is core of evil

#

If your parentEcsEntity it's the same simple cube with nothing, to which you adding new childs - with commented buffer if(_parentSynchEna.... I expect it will be without parent (if it's root entity in your case) and no Child buffer at all

eager jungle
#

why no Child? isn't it supposed to be added automatically because of children referencing it as we discussed above?

storm ravine
#

with commented buffer if(_parentSynchEna....

#

Why it should if we not adding anything?

eager jungle
#

geez, you wanted me to comment out the entire thing xD

#

i just removed the condition!

storm ravine
eager jungle
#

yea i get it now!

#

will give you results in a minute, meanwhile, do you know why it has a Parent:Null?

storm ravine
#

Also what is netEntity? I suppose some component which is key in hashmap of you client\server prefabs?

#

If so - how you calculate hash code as it can be problem if you getting parentEcsEntity from this hash map

eager jungle
#

as expected for the test without the entire block of code

storm ravine
#

That's good then we returned to what I told before - parentEcsEntity is root of evil

#

Also what is netEntity? I suppose some component which is key in hashmap of you client\server prefabs?

#

If so - how you calculate hash code as it can be problem if you getting parentEcsEntity from this hash map

eager jungle
#

Also what is netEntity? I suppose some component which is key in hashmap of you client\server prefabs?
If so - how you calculate hash code as it can be problem if you getting parentEcsEntity from this hash map
that's correct, it is a simple index. Actually im using the server side unity ecs entity index as the "network id"

#

hashcode = return index

storm ravine
#

simple int right?

eager jungle
#

correct

storm ravine
#

And server entities persistent, and not destroying? ๐Ÿ™‚

#

As Index can represent not one entity through entities lifecycle, as after destroying this entity and creating some other entity at some point you will have entity with the same Index but different version ๐Ÿ™‚

eager jungle
#

not destroyed

storm ravine
#

That's good then problem only in getting parentEcsEntity from networkedEntities

#

As you see in your code snippet

#

your networkedEntities stores all entities (including childs)

eager jungle
#

yes

storm ravine
#

And side question do you have some unparenting\destroying of these entities? or it's only this hash map and Adding?

eager jungle
#

no weird things tbh, instantiate, add buffers/components, add to hash map

storm ravine
#

And one last thing - var prefab

#

you just get it from SO right?

#

I mean convert - store to SO - get from SO?

#

But yeah it's irrelevant

eager jungle
#

SO array on an authoring, declare all prefabs, GetPrimaryEntity, everything stored in a singleton

#

maybe weird question, but im kind of loosing track. What do you think is the problem again? can we summarize ? :p

storm ravine
#

Well my advice then - debug your networkedEntities->parentEcsEntity as problem somewhere around that which cause this weird thing as parentEcsEntity messing up and starting to have Parent (but definitely shouldn't), as I haven't all your code context I can't say much at this point and it's up to you ๐Ÿ™‚ But you can be sure snippet above it's not the root of problem but result of messing parentEcsEntity ๐Ÿ™‚

eager jungle
#

parentEcsEntity having a parent, i think i just found the reason why, and it was simply because i commented out the if line only, it was expected behaviour in that specific case so no worries

#

if that's what's bothering you, i think its fine

storm ravine
#

Put Debug.Log(11111) under your if(_parentSynchEna.... it will appear in console 3 times right?

eager jungle
#

yea ofc, first thing i tried ^^

#

would you expect 3 or 6 in the buf after your code? because basically what is happening is that i have this log saying 3 at the time of spawn, but 6 (or3 sometimes it seems) in the buf in the inspector

storm ravine
#

My code above (last screenshot you reposted) show 3 and 3 in buffer as expected

#

This is why I still bothered by parentEcsEntity

eager jungle
#

trust me there is absolutely no other place where i use Child struct

storm ravine
#

put

if(EntityManager.HasComponent<Child>(parentEcsEntity))
            Debug.Log("WTF?!");

before if(_parentSynchEna....

#

I mean your if(shouldSpawn)is inside loop I guess then this WTF should only throw 2 times as at first call we haven't child buffer yet

eager jungle
#

i think i get it, give me one sec

storm ravine
#

and this loop called in one frame?

eager jungle
#

that's what im checking

#

seems like it

#

UnityEngine.Debug.Log($"tick:{UnityEngine.Time.frameCount} parent:{parentEcsEntity} child:{ecsEntity} len={EntityManager.AddBuffer<Child>(parentEcsEntity).Length}");

#

same frame count

#

for all 3

storm ravine
#

"WTF?!" appeared 2 times?

eager jungle
storm ravine
#

Yes that's good

#

One last thing

#

Put Debug.Break(); after whole loop

#

when all childs added

#

EntityDebugger will show you 6 entities on Child buffer? And in Console you'll see only these 3 messages? (excluding WTF?!)

eager jungle
#

yes ๐Ÿ˜„

storm ravine
#

On which Entities you're?

eager jungle
#

.11

#

can it be making a change that my prefabs have LinkedEntitygroups?

storm ravine
#

Nope

#

It's involved only on instantiation\destroying

#

and we saw in your prefab it has only itself as it haven't child's (prefab itself)

eager jungle
#

yep

storm ravine
#

As for me all works as expected
sent wrong image

eager jungle
#

can you try to delay the parent creation by one frame before the 3 loop ?

#

on my end, its done in another system as well, if that can make a difference

#

ok i checked, so
SystemA runs first on frame N, and instanciate parent
SystemB runs second on frame N as well (same frame), and runs the 3 loop
result is 6 in buffer

storm ravine
#

Ah

#

Well

#

I see why you see 6 now ๐Ÿ™‚

eager jungle
#

thats a good thing for both of us i guess xD

storm ravine
#

Add PreviousParent to your parentEcsEntity

#

And you stop looking 6

#

with your code snippet

#

just AddComponent<PreviousParent>

eager jungle
#

yes because blocking the add from the unity systems running on the query you show earlier, right?

storm ravine
#

Well reason for that is

#

it first checking what I sent you before

#

and as adding Child in this way - not intended as it tracked automatically

#

And then how it works:

#

You adding 3 entities

#

Then TransformSystem see new Parents without PreviousParent

eager jungle
#

why is it 3 in your sample? is it because you're adding the 3 entities in the same system the parent is being instantiated?

storm ravine
#

Well I'm a bit sleeping and my mind can do the tricks with me ๐Ÿ™‚ PreviousParent wouldn't solve that...

eager jungle
#

i mean, if we agree thats its just a side effect of systemstates and that the actual fix is to simply not create the Child buffer, then im good

storm ravine
#

Not creating Child is intended

#

As ParentSystem only own it

eager jungle
#

great

storm ravine
#

And this is why it messing up as you adding it by yourself but Unity system still add same childs again

eager jungle
#

that's good enough of an answer for me, i thank you a lot for your help

#

and time spent

storm ravine
#

Np, there was not much help as I was tired ๐Ÿ™‚

eager jungle
#

just curious, you from?

storm ravine
#

Russia

eager jungle
#

super late indeed

storm ravine
#

02.00 AM

eager jungle
#

west russia then^^

storm ravine
#

Close to Moscow

#

+3 timezone

eager jungle
#

well cheers from france, 1am here. Thanks again, I'll wrap up with the fix and stop working... xD

storm ravine
#

PreviousParent will solve IF you put parent to it ๐Ÿ™‚

#

Then you'll cheat ParentSystem

#

Well all as I desribed

#

You adding 3 child's

#

it adds 3 entities

#

then ParentSystem adds them again

#

But it call RemoveFromParent from PreviousParent

#

And remove only if != Entity.Null

#

And if you add your parent

#

It will remove childs and then add them again ๐Ÿ™‚

#

THis is if you WANT do weird things from above ๐Ÿ™‚

#

When you doing that as intended - just Parent and LocalToParent

#

It will work the same out of box without any stuff from last messages ๐Ÿ™‚

eager jungle
#

spaghetti, but understood! I don't want to do weird things, but I think we're both just trying to understand why the weird stuff is indeed weird even we don't want to do it ๐Ÿ™‚

storm ravine
#

Well, I knew that before ๐Ÿ˜„ but it was so long time ago and I completely forgot why we shouldn't add Child and I just used Parent from the time being (as, well, why I shouldn't do it wrong if I know how do it right) this is why it takes so many time (with tiredness in addition) ๐Ÿ™‚

eager jungle
#

thats absolutely fine, thanks @storm ravine

storm ravine
#

So many posts and DOTS versions went through me after all these years of DOTS existence, my mind starts filter unnecessary knowledge as I'm not interested in them anymore when we have right approach ๐Ÿ™‚

eager jungle
#

i understand. One quick question, are you aware when 0.12 is supposed to be released?

#

waiting on the fixed simulation group for physics

storm ravine
#

Don't asked that from DOTS team, can't tell more

eager jungle
#

k

zinc plinth
#

what's the diference between the Parent & PreviousParent components ?

#
    [WriteGroup(typeof(LocalToWorld))]
    public struct Parent : IComponentData
    {
        public Entity Value;
    }

    [Serializable]
    public struct PreviousParent : ISystemStateComponentData
    {
        public Entity Value;
    }``` so we always need both or ?
ocean tundra
#

@zinc plinth You shouldnt need to touch PreviousParent

#

its managed by the transform systems

zinc plinth
#

ye I saw it gets added by some transform system

ocean tundra
#

will be added/updated/removed by those

#

System state components are usually meant to be used and controlled just by their systems (usually 1 system)

zinc plinth
#

also, in the case of a child, I just need LocalToParent and not LocalToWorld right ?

ocean tundra
#

um i think you need local to world too

#

i guess your creating children manually?

zinc plinth
#

yea adding converting go to already created entities

ocean tundra
#

just trying to find my code that does it

#

rewriting most of it ๐Ÿ˜›

#

yea so i add these:

#
            em.AddComponent<LocalToParent>(combatEntity);
            em.AddComponent<Translation>(combatEntity);
            em.AddComponent<Rotation>(combatEntity);```
#

and i add Parent

#

and then finally on the parent entity

#

i update the LinkedEntityGroup

#

i dont update the child buffer... not sure if i should

zinc plinth
#

LocalToWorld, Translation & Rotation already are already present tho

ocean tundra
#

thats cool then dont add those

#

just add local to parent and parent

ocean tundra
#

how bad is it to be reading a native list length using its unsafe pointer?

#

im trying to make some debugging tools to show me the sizes of a bunch of native lists im using

#

mainly to see if the list is filling up and exploding

storm ravine
#

what's the diference between the Parent & PreviousParent components ?
@zinc plinth Purpose of PreviousParent is removing child entity from Child buffer of PreviousParent entity when you changing Parent component on that child. Like You have A - some entity and B - child of A, B has Parent - A and PreviousParent - A, then you changing Parent of B (which equal A) to C now your B is: Parent - C, PreviousParent - A. ParentSystem handle Parent changes and removes B from A Child buffer by PreviousParent and adds B to C Child buffer by Parent (LocalToParent and LocalToWorld also here but for simplicity I just not mention them)

#

how bad is it to be reading a native list length using its unsafe pointer?
@ocean tundra by UnsafeList* -> Length ?

ocean tundra
#

@storm ravine Yup exactly that

storm ravine
#

Nothing bad as NativeList.Length property is exactly m_ListData->Length where m_ListData is UnsafeList*

ocean tundra
#

also doing the same for capacity

#

but the native list length has that threading safty check thing

#

all i want for this tool is to see the lists filling up and if they are expanding

#

which it seems to be doing fine atm

storm ravine
#

but the native list length has that threading safty check thing
@ocean tundra of course as this is difference why we have NativeList instead of just UnsafeList ๐Ÿ™‚

#

if you want to use pointer exactly then all safety checks up to you ๐Ÿ™‚

ocean tundra
#

sweet

#

will see what happens then

#

i dont mind if im reading old values by a frame or 2

storm ravine
#

? By pointer you'll get always current values in memory no matter you store this pointer 5 or 10 frames ago, values will be the same as in current frame ๐Ÿ™‚ (if address not changed of course, which wouldn't change in case of UnsafeList* itself (only internal buffers changes) if you not disposing that and just use NativeList as usual)

ocean tundra
#

what if job x is adding things into that list, and then over on my main thread im reading from it would it be a old value?

storm ravine
#

what if job x is adding things into that list, and then over on my main thread im reading from it would it be a old value?
@ocean tundra if job running at the same time - it will be race condition

#

Which mean you don't know that you will get ๐Ÿ™‚

ocean tundra
#

well will see what happens

#

i guess another idea is to record the list sizes from a job into a native array and then use that to display the numbers

storm ravine
#

Because the thread scheduling algorithm (not jobs but threads itself) can swap between threads at any time, you donโ€™t know the order in which the threads will attempt to access the shared data. Therefore, the result of the change in data is dependent on the thread scheduling algorithm, i.e. both threads are โ€œracingโ€ to access/change the data.

#

And it even can lead to crash depends on data as it will produce "random" things in memory ๐Ÿ™‚

ocean tundra
#

well that really dosnt sound good

storm ravine
#

Yes as you not mentioned in your initial question that you want do that Length check from pointer for concurrent work ๐Ÿ™‚

#

Just accessing UnsafeList*->Length (and other) in non-concurrent context - absolutely fine, in concurrent - become a race condition ๐Ÿ™‚

ocean tundra
#

sweet

storm ravine
#

This is why we have all these safety checks, multithreading itself has atomics etc. ๐Ÿ™‚

ocean tundra
#

ill leave it as is for now but in a day or 2 swap it to have a "reader" job that gathers the sizes of my lists

opaque ledge
#

Eizen what do you think of native array sorting ? it just takes too much time, i am sorting 1k struct and each takes 0.5 ms and i have 2k entities running this sort, am i doing something wrong or should i try to find a workaround

#

i find native array sort forum topic, everyone says its sort performance is good, but definitely not in my case D:

ocean tundra
#

@opaque ledge Theres a sort overload that allows you to only sort x part of the list

wary ibex
#

Any ideas why I have a project that's simply not rendering any entities? As soon as the game starts, the entities are gone from game view and scene view

#

(I can still find them in the entity debugger)

ocean tundra
#

@wary ibex do you have hybrid renderer?

wary ibex
#

I have the package installed yes

storm ravine
#

I have the package installed yes
@wary ibex Entities created from code or conversion?

wary ibex
#

both.

storm ravine
#

If from code you should have LocalToWorld, RenderMesh, RenderBounds

#

i find native array sort forum topic, everyone says its sort performance is good, but definitely not in my case D:
@opaque ledge which one? With DreamingImLatios answer?

wary ibex
#

This same code worked in another project so I think it's something to do with settings, but I dont know what

storm ravine
#

This same code worked in another project so I think it's something to do with settings, but I dont know what
@wary ibex Are you sure HybridRenderer package installed properly? Show mainfest\PackageManager

opaque ledge
#

yeah

wary ibex
storm ravine
#

Show inspector for any your entitty which should be rendered (from EntityDebugger)

#

Eizen what do you think of native array sorting ? it just takes too much time, i am sorting 1k struct and each takes 0.5 ms and i have 2k entities running this sort, am i doing something wrong or should i try to find a workaround
@opaque ledge well 2k here is "wrong" thing ๐Ÿ™‚ In meaning of this sort is fast for low count, for big amount of data (2k is big in context of this sorting, as this sorter not scales well by design of algorithm) you should implement different sort algorithm ๐Ÿ™‚

wary ibex
#

I'll compare that with the other project where it renders

opaque ledge
#

hmm alright, are you aware any open source DOTS sort algorithm ?

storm ravine
#

They not DOTS related tbh, you can try to implement similar to Dreaming - radix sort

opaque ledge
#

i am only sorting 1k btw, 2k entities doing this sorting, but i guess its still low performance

#

ah alright, maybe i can find it on forums

storm ravine
#

i am only sorting 1k btw, 2k entities doing this sorting, but i guess its still low performance
@opaque ledge You mean every entity from 2k entities call sort for 1k lists ??

opaque ledge
#

yeah, each of 2k entity doing a sort of a dynamic buffer of size 1k

storm ravine
#

@storm ravine
@wary ibex GPU instancing checkbox enabled on material?

opaque ledge
#

so i guess i am sorting 2m elements in total ๐Ÿ˜„

storm ravine
#

ooof

#

definitely not a good idea with default sorter

opaque ledge
#

yeah its a threat management, where spaceship tries to calculate which enemy ship they should target

storm ravine
#

Naive way ๐Ÿ™‚

#

You should implement space portioning algorithm, Spatial Grid at least

wary ibex
#

@storm ravine yes it's enabled

storm ravine
#

Or better - octree

wary ibex
opaque ledge
#

yeah, didnt know sort could be a problem ๐Ÿ˜„ buffer has ALL the enemy ships whetever they are in range or not, i will most likely try to split the buffer

wary ibex
#

this is the difference between the project that doesnt work and the one that does

storm ravine
#

Left haven't WorldRenderBounds, but it should be added by RenderBounds automatically

wary ibex
#

๐Ÿค”

storm ravine
#

This entity from conversion or from code?

wary ibex
#

from code, but the same happens when I convert from the script (ConvertToEntity)

opaque ledge
#

maybe its something about using Hybrid renderer v1 or v2 ?

wary ibex
#

Both projects are using v1 I think since the editor is 2019.4

storm ravine
#

HR version not relative here

wary ibex
#

I can try just pasting all project settings and see if it works I guess

storm ravine
#

Show me EntityDebugger itself

#

with systems list and worlds dropdown

#

And\Or Systems\Entities windows

wary ibex
storm ravine
#

You're using networking?

wary ibex
#

not now

storm ravine
#

Then why your world is empty ๐Ÿ™‚

wary ibex
#

this is the other project

storm ravine
#

Yes and this is correct one

wary ibex
#

It's just a demo

#

But it's the same scene. What should I change?

storm ravine
#

This is the answer why it's not rendered as there is no systems which will render, add required components etc.

wary ibex
#

I thought those were included in scripts?

storm ravine
#

Open project settings

#

But no

#

stop

#

not necessery

wary ibex
#

ok

#

so I'm missing the systems

storm ravine
#

Left one has networking systems already right one - haven't

#

Show worlds dropdown for not working project

wary ibex
#

that's probably because I installed the netcode package

storm ravine
#

I think you'll see Server\Client worlds

wary ibex
#

you're right, server/client worlds are populated and default world is empty

storm ravine
#

And in this case you should configure Ghosts, Prefabs mapping for them etc ๐Ÿ™‚

wary ibex
#

how can I change the world I'm viewing in the scene view?

storm ravine
#

It's not how it works ๐Ÿ™‚

wary ibex
#

okay

storm ravine
#

You see all of them, but only system relative to rendering and depends on components set decide to render it or not

#

And in case of networking - your authorings should be configured properly

wary ibex
#

ok, thanks

#

I wasn't aware the netcode package would just break the project like that. I'll get rid of it for now then

opaque ledge
#

netcode package is kinda source of all evil, many tears were shed because of it D:

wary ibex
#

There's no explanation for it. It's just stupid to ship a package that suddenly changes everything in the project and you can't even select a world to view

#

So for every little scene I need to make sure all ghost authoring components are set up? That's just ridiculous. From the point of view that sometimes I just want a client-only scene to test stuff, and not use networking

dull copper
#

There's no explanation for it. It's just stupid to ship a package that suddenly changes everything in the project and you can't even select a world to view
@wary ibex I take it that you are very new to DOTS in general

#

There's been huge changes throughout the previews

storm ravine
#

There's no explanation for it. It's just stupid to ship a package that suddenly changes everything in the project and you can't even select a world to view
@wary ibex it's preview ๐Ÿ™‚ That's all ๐Ÿ™‚This require strong knowledge and reverse engineering and guarantee nothing, they're here not for production or casual usage, they're here for tracking how they grow\evolve, like backstage ticket๐Ÿ™‚

dull copper
#

They basically have freedom to change everything without thinking twice as long as there is no actual release

wary ibex
#

Fair enough

opaque ledge
#

they always have been stable about Entities package tho, there was no 'breaking' change i think, MAYBE except one time where they moved from entity query to IJobForEach

storm ravine
#

Unity probably can hide everything and just do what they want and how they see that and will get less rage in process, BUT in the end it will be better as package will be much closer to what users want and not what Unity think users want

opaque ledge
#

but i guess its not the same with netcode or animations packages

storm ravine
#

except one time where they moved from entity query to IJobForEach
@opaque ledge are you sure this sentence correct? ๐Ÿ™‚

opaque ledge
#

tbh not really, i wasnt there but sounds like a 'big' change to me ๐Ÿ˜„

#

i will put a "maybe" in there ๐Ÿ˜›

storm ravine
#

I mean they not moved from EntityQuery to IJobForEach ๐Ÿ™‚ As they just different things, maybe you mean deprecating IJobForEach and moving to Entities.ForEach? ๐Ÿ™‚

opaque ledge
#

wasnt EntityQuery first way to iterate over entities for their data just like we do with ForEach now ?

storm ravine
#

EntityQuery works the same as it worked always (with minor changes)

opaque ledge
#

yeah but while it still has useful its not the 'main' way to do ECS stuff right ? Entities.ForEach is the main way now

storm ravine
#

it's simplest way ๐Ÿ™‚

#

As less boilerplate

#

And all depends on case of course

#

as IJobChunk or even manual chunks iteration sometimes will be faster than ForEach as you operating on chunk level and has access to them, which is impossible in ForEach body itself (but chunk version of lambda in their mind)

opaque ledge
#

ah yeah, there is also IJobChunk ๐Ÿ˜„ i never used it tbh

low tangle
#

you might be thinking of the ComponentSystem -> JobSystem -> SystemBase migration
along with all the ways you used to be able to iterate back in the early days. JobForEach<T> etc

opaque ledge
#

hmm, well i guess i must be remembering incorrectly, i remember watching Joachim's video in 2018 where he introduced EntityQuery, i thought that was the only way to iterate over entities back when, oh well ๐Ÿคท

#

when i started learning ECS (tried to at least) IJobForEach was the thing, never did any entity query

low tangle
#

entity querys are basically a filter

#

still very important and used throughout the framework

zinc plinth
#

the fuck

#

getting a segfault on UnloadAssetBundle on 2020.1.13b when I stop the game thonk

#

feels like loading & using asset bundles in system is really not a good combo

#

ok so the real bug seems to be that ConvertToEntity will make the editor crash if it's inside an asset that's being built into an asset bundle ???

#

why tho

#

guess I'll just add the component at runtime for now..

zinc plinth
#

nvm it's 2 bugs --'

both ConvertToEntity crashes the editor if in an assetbundle, and I'm getting a segfault on UnloadAssetBundle(native code) when I stop the game within editor (idk how to reproduce 2nd one)

#

hope 19.4 is more stable..

dull copper
#

if you go to 2019.4, you'll be stuck with DOTS packages available today and will not get any updates anymore

zinc plinth
#

it'd be nice for my editor not to crash every 5 seconds on native code then --'

#

I already knew about 2020.1 & dots, but I can't just wait and pray that it'll be fixed in the next beta

#

if it's even fixed before 2020.1 comes out

#

and we're 1 month past the middle of the year with it still not out with no date announced

deft stump
#

it's probably going to come out very late of the year

zinc plinth
#

I'd be really surprised if it's out before september at this point..

deft stump
#

I'll give it a november

zinc plinth
#

"2 release-year cycle"

#

/s

deft stump
#

next year, it'll be 1 tech release and 1 lts release.
and the year after that, it'll just be lts release every year

#

:lul:

dull copper
#

oh, Burst 1.4

#
## [Burst 1.4.0-preview.1] - 2020-06-25

### Added
- Experimental support for tvOS
- Add intrinsics support for `AtomicSafetyHandle.NewStaticSafetyId<T>`
- A new option `[BurstCompile(DisableSafetyChecks = true)]` that allows per job or function-pointer disabling of safety checks. This allows users to have blessed code run fast always.
- Improve Editor experience by scheduling compilation immediately after assemblies are changed, instead of waiting until Play Mode is entered.
- Improved our aliasing detection to allow `DynamicBuffer` structs to be easily vectorizable.
- Added a compiler warning for any use of throwing an exception from a method **not guarded by** `[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]`. Since exceptions in Burst are only supported in the editor, this provides a useful warning to users who may be relying on try/catch behaviors for control-flow which is not supported in final game builds.
- Burst compilation status is now displayed in the Background Tasks window in Unity 2020.1 and above (click the spinner in the bottom-right of the Editor to open this window).
- Upgraded Burst to use LLVM Version 10.0.0 by default, bringing the latest optimization improvements from the LLVM project.
- Add support for try/finally and using/foreach for IDisposable patterns.
- Add `BurstCompiler.IsEnabled` API.
#
### Changed
- Made the compiler better at constant-folding complex static readonly constructors.
- Bursted DOTS Runtime Jobs are now decorated with `[NativePInvokeCallback]` instead of `[MonoPInvokeCallback]` which could generate callback wrappers which could cause native code to inadvertently interop with the managed VM.
- The Burst menu-item `Safety Checks` has been changed to a modal choice of `Off`, `On`, and `Force On`. `Force On` will overwrite any user job or function-pointer with `DisableSafetyChecks = true`. To avoid users falling into the consistent trap of having `Safety Checks` set to `Off`, any reload of the Editor will issue a warning telling the user that `Safety Checks` have been reset to `On`.
- Use platform provided memory intrinsics for iOS, tvOS, WASM, and console platforms.
- Updated Cross Compilation Tooling To LLVM 10
- The command line option `--burst-disable-compilation` is now disabling entirely Burst, including the AppDomain.

### Fixed
- Fixed incorrect struct layout for certain configurations of explicit-layout structs with overlapping fields
- Fixes a caching issue where stale cached libraries may have been used if a project was copied to a different folder, or Unity was upgraded to a newer version
- Burst will now error if a `cpblk` was used to copy into a `[ReadOnly]` parameter or field.
- Fixed a bug where the mm256_cvtepi32_ps intrinsic would crash the compiler.
- Fixed a bug with constant expressions that could cause a compile-time hang.
- Debug symbols are now output when using the native toolchain on mac.
- Sleef fallback to scalar float for WASM.
#
- ABI struct ret/by val for trivial aggregates for WASM is now respected.
- Fixed a bug with float/double vector constructors of `Unity.Mathematics` that take half or half vector parameters.
- Debug information for anonymous structs could be created partially multiple times for the same type.
- Filter symbol warnings to prevent them reaching logs.- Fixed an issue where UNITY_DOTSPLAYER builds not building for NET_DOTS would be unable to compile do to references to UnityEngine.
- Fixed handling of conversion from signed integer to pointer which caused issues as discovered by Zuntatos on the forums.
- Allow to call `[BurstCompile]` functions from other `[BurstCompile]` functions
- IntPtr.Size now correctly returns int32 size (rather than UInt64) - fixes an assert.
- Burst package has been upgraded popup could fire erroneously under shutdown conditions.
- Fixed an issue preventing player builds to succeed when burst compilation is disabled.
- Debug symbols for function names on some platforms are no longer hashes.
- Job Entry point symbols should now reflect the job name and type rather than a hash in callstacks/native profilers
- Job entry points without symbols now use the Execute location rather than pointing to unknown/unknown
- Dwarf symbols from multiple modules (e.g. multithreaded AOT compilation) now have correct compilation unit information.

### Known Issues
- Output of `Debug.Log` is temporarily disabled in Burst Function Pointers/Jobs to avoid a deadlock on a domain reload. A fix for the Unity editor is being developed.
amber flicker
#

'blessed code' ๐Ÿคฃ ๐Ÿคฉ

dull copper
#

this is nice:
- Improve Editor experience by scheduling compilation immediately after assemblies are changed, instead of waiting until Play Mode is entered.

#

it probably still locks the editor though

#

if they can do it without locking, it would be pretty sweet

#

that background status thing does imply it wouldn't lock.. so will need to test

#

debug log being out temporarily is kinda bummer

#

I feel that Unity should have some api check tool so they could actually fix this with some messagebox popup if people install package that requires different setting

#

you shouldn't need to decipher it yourself

#

they do this for example when you load SRPs with player set to gamma instead of linear, would like to see similar thing for the scripting api level

vagrant surge
#

@dull copper removing support from 19.4 means that LTS users wont be able to use ECS at all...

dull copper
#

yes

#

well, they are not removing the support from existing packages, more like only supporting 2020.x for the upcoming updates

#

2019.4 LTS has never been final target for ECS

#

I do get it will suck but then again, since DOTS still evolves a lot, locking things to 2019.4 API would just slow them even more

#

testing first time this new entities view... first thing I test on it sucks already ๐Ÿ˜„

#

I hope I can somehow set the field name, instead of getting "Entity (2:2)" for it

#

it does use gameobject name with empty gameobject converted

#

and there is only one entity here

#

so.. wonder what's up with that

amber flicker
#

it also doesn't show anything for the first frame (unlike the old one)

dull copper
#

what do you mean by that?

amber flicker
#

select pause then press play

deft stump
#

yup. the entities view suck

#

I just use the debugger, coz I got used to it plus, I see the chunk structure

dull copper
#

oh I get it

#

also, the name got fixed after I once went to play mode and back ๐Ÿ˜„

#

I'd really love to have this entity view though

#

it's cool to have easy to navigate hierarchy

#

another thing that kinda sucks is that when you select something in the entities tab, it doesn't actually keep selection "selected" in the entities tab

#

inspector keeps showing it tho

#

would be nice to have it show that as long as the inspector is still used for the selection

#

regular scene hierarchy works like this

#

lol... C:\Unity\Graphics\com.unity.render-pipelines.core\Runtime\AssemblyInfo.cs(4,8): error CS1029: #error: 'Core SRP 10.0.0 or newer with Hybrid Renderer V2 requires at least version 0.6.0 of com.unity.rendering.hybrid'

#

oh well, I tried

#

this is from trying Hybird 0.5.4 with bleeding edge SRP from github on latest 2020.2 alpha

opaque ledge
#

kinda awesome how they put that note even tho its not 'publicly' released

dull copper
#

after bypassing the error, I get this: A Hybrid Renderer V2 batch is using the shader "Hidden/Internal-Loading", but the shader is either not compatible with Hybrid Renderer V2, is missing the DOTS_INSTANCING_ON variant, or there is a problem with the DOTS_INSTANCING_ON variant.

#

nothing renders on hybrid 0.5.4 atm, probably because they changed something here

#

I mean, while using bleeding edge HDRP

#

should still work on older versions

pulsar jay
#

Does it make sense to find an entity by specific component values? E.g. find entity which has a TilePos value of Vector2Int(3,5)?

dull copper
#

0.6.0 is so last season already

#

and here we are stuck with 0.5.2-preview.4

#

ah it actually works on bleeding edge HDRP after I revert that commit

safe lintel
#

when are the next srp packages arriving, feels like ive been stuck on 9.0 preview for like forever, and hybrid rendererv2 hasnt really gotten a significant update in a while either.

dull copper
#

@safe lintel my educated guess on the SRPs would be at least month+ still

#

9.x will remain always in preview and 10.x will be the official release for 2020.2

#

but both of these are under heavy activity atm as they keep patching the major SG change

#

so, I wouldn't expect 10.x release any time soon, 9.x is more likely because it's preview and they can afford previews breaking things more than stable releases

safe lintel
#

the number is more or less inconsequential, just wondering aloud when some sort of update will arrive. considering previous large versions have received more incremental package releases makes the current situation kinda strange

dull copper
#

yeah I wouldn't hold my breath waiting for these any time soon

safe lintel
#

ive been using a custom shader for all my urp stuff, its kinda simple but still not shadergraph based. im just wary of a humongous package update between universal and hybrid, vs getting regular incremental updates that make it easier to update alongside. ah cest la vie

dull copper
#

there's a16 coming up any moment now so will do one for it as well with more recent SRP

#

doing custom srp shaders will be PITA to maintain

#

I've done that in past

#

never again

safe lintel
#

my brain seizes up trying to keep track of hdrp's changes on top of dots, universal is all i can muster

#

universal so far seems simple enough? im nowhere near being a shader guru either

dull copper
#

what for you need those custom shaders?

#

if you can use custom function node in SG, you save yourself a ton of headache

safe lintel
#

half lambert light shading on models, and linear light falloff as well as the option for vertex jitter

dull copper
#

ah, well, I'll shut up then ๐Ÿ˜„

safe lintel
#

im dreading what changes i need to make for proper v2 compatibility though, my project goes pink with v2 and latest alpha+packages but it does that in a blank project too so ๐Ÿ˜…

dull copper
#

pretty sure you need custom SRP now, like that a15 branch I just linked

#

but you also need git lfs to clone it as all Graphics repo forks require it

#

I'm currently trying to test if virtual texturing has any chance of working with hybrid renderer but they've also totally changed the VT workflow since I last tried it

#

still trying to figure this out

#

that being said, I doubt it works

#

would just be glorious if you could combine dots streaming and virtual texturing as you could just get the game running asap without much loading time

safe lintel
#

wonder if that sample(battle royale esque thing?) will feature vt at all

#

seems like the right kind of demo to feature it, streaming subscenes, huge scale

dull copper
#

well, at first glance, VT does seem to work with hybrid

wary ibex
#

does the new math package use radians for trig methods?

dull copper
#

should

wary ibex
#

ok ty

dull copper
#

does dots subscenes use asset bundles somehow?

#

I'm getting this error while trying to build with DOTS subscene and virtual texturing on one shader graph:
Material 'Shader Graphs_New Shader Graph' was built for an AssetBundle while it contains a Texture Stacks. Texture Stacks can not be part of an AssetBundle.

#

asset bundle is not assigned on that SG

#

from VT doc: AssetBundles are not supported, including Adressables and Live Link.

mint iron
#

AssetBundles are not supported, including Adressables and Live Link. that doesn't even make sense lol, addressables and live link are not asset bundles - ESL maybe...

dull copper
#

hmmm, I fiddled with build setup and now it built

#

I don't think I had live link enabled tho

#

well, the VT SG didn't work on build for dots subscene/hybrid rendering: A Hybrid Renderer V2 batch is using a pass from the shader "Shader Graphs/New Shader Graph", which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.

mint iron
#

interesting, the batcher apparently was causing the psychedelic issues last year, so is there solution to disable it?

dull copper
#

you can disable it via code or through debug menus

#

but I'd really need to have it to have any kind of decent perf

#

this test I'm doing is for more open world game setup, so would need it to work

#

it's kinda weird it does work in the editor though

dull copper
#

I also did try that without dots subscene but it really seems like it fails because of hybrid rendering pass

#

it's also totally possible it's just not compatible enough with the old hybrid renderer

dull copper
#

it also doesn't show anything for the first frame (unlike the old one)
@amber flicker it does show things in editor already though if you have things on dots subscene(?)

#

I just realized that it does display stuff from regular scenes as well once you hit play, unlike the old dots editor

#

like, all converted entities show up in the entities tab regardless if they come from dots subscene or regular scene

#

but then again, I guess this should have been obvious to me as it's not really substitute for the conversion preview but rather entity debugger

mint iron
#

i've been trying to update my project today and it seems like the current hybrid/editor configuration is buggy as hell, they're probably gearing everything at this point to the next release version.

dull copper
#

hybrid is kinda tricky as they haven't released in a while: a) new hybrid b) new srp packages

#

I got hybrid 0.5.2 running here on bleeding edge SRP with just released 2020.2.0a16, but this could have some extra bugs as they've probably assumed you'd only use this with the latest hybrid which isn't out for us

mint iron
#

for example, as soon as i put a shape in a subscene (like a default gameObject sphere or cylinder) and hit play, it crashes the editor, and the .dmp says its a divide by zero exception :S

safe lintel
#

using the latest packages + alpha crashes every time entering play mode with hybridv2 enabled in player scripting settings, that is in a new plank project

mint iron
#

oh good, at least its not just me then. I've been going through my project trying to figure out which part of it caused the issue.

safe lintel
#

only tested with universal though, not sure about hdrp

#

also this is just latest by the pm, not github

dull copper
#

there's actually new 9.x preview today on the PM

#

for URP and HDRP that is

#

didn't see that one coming

#

no hybrid update yet tho

gusty comet
#

So what is the official release date for DOTS?

#

Also has anyone heard any good books in pipeline?

ocean tundra
#

@gusty comet Still no dates

#

but parts of it are stable and 1.0ed

dull copper
#

and rest can be super sketchy :p

ocean tundra
#

but even when DOTS is officially released all the supporting bits wont be done
Things like animations, sounds, vfx

dull copper
#

I mean, actual entities has been pretty solid in terms of not being super buggy most of the way throughout previews

#

they've changed the workflow a lot and api has gone through gazillion changes

zinc plinth
#

if stuff wouldn't crash on the version they tell us to be on to get updates it would be a damn good first step

dull copper
#

but we still don't know if the workflow we have now is what we'll get on entities 1.0

ocean tundra
#

oh yea definitely, the core DOTS is so nice to use

dull copper
#

core is basically the thing that will be on 1.0, Unity has not even said they'll release anything else but entites package this year

#

rest of the DOTS is currently estimated to be ready by 2022

ocean tundra
#

@zinc plinth Yea my project jumps around in stability, ive found that spending the time to cleanup when you stop playing has made it WAY more stable

dull copper
#

and that's not some figure I threw from my hat, it's from their original dots roadmap

zinc plinth
#

I've spent the last 10 hours getting native code crashes on 2020.1; being saltier than the dead sea would be an understatement rn

ocean tundra
#

dam that sucks

zinc plinth
#

I just fucking want an asset management system that automatically build it's stuff; but apparently that's too hard

ocean tundra
#

are you talking about subscenes?

zinc plinth
#

AssetBundle straight doesn't work on 2020.1 with ecs ; Addressables doesn't want to build from an assetpostprocessor

dull copper
#

is it supposed to be compatible?

zinc plinth
#

why wouldn't it be

dull copper
#

every time I've asked about DOTS support from Addressables guys they've said they will get to it at some point

#

so I totally assumed it's not compatible

ocean tundra
#

I have no issues with addressables and DOTS

zinc plinth
#

I didn't even get to that point with Addressables lol

ocean tundra
#

but i do runtime convert them after loading

#

im guessing your trying to pre convert?

zinc plinth
#

I just want automatic asset packing builds ;-;

I don't want to have to manually build it, because we all know we'll forget to do it at some point and wonder why things go haywire or don't work

#

that's all I'm trying to get lol

ocean tundra
#

you mean building the addressables?

zinc plinth
#

yea

ocean tundra
#

yea its annoying thats not automatic

#

but easy enough to script into a build step

zinc plinth
#

o.0

#

hemmmmn, how did you do it ? ^^'

ocean tundra
#

im unsure about the 'new' build system

#

need to upgrade to that

#

just looking for my script now

#

so i made a menu item to trigger my build

#

and its also called via my build server

#
private static void DoBuild(string[] scenes, string[] scriptingDefines, BuildOptions options,
        string fileName)
    {
        BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
        buildPlayerOptions.scenes = scenes;
        buildPlayerOptions.locationPathName = fileName;
        buildPlayerOptions.target = BuildTarget.StandaloneWindows64;
        buildPlayerOptions.options = options;
        buildPlayerOptions.extraScriptingDefines = scriptingDefines;


        BuildReport report = BuildPipeline.BuildPlayer(buildPlayerOptions);
    }```
#

then you can add bits like

 AddressableAssetSettings.CleanPlayerContent(
            AddressableAssetSettingsDefaultObject.Settings.ActivePlayerDataBuilder);
        AddressableAssetSettings.BuildPlayerContent();```
zinc plinth
#

that's to create a standalone build isn't it ? not done within/for editor ?

pulsar jay
#

The built system in the Platfroms package looks great to me but I only find it by accident as there is no real documentation on it

ocean tundra
#

yea its to make a standalone

zinc plinth
#

ha

#

I thought you meant like something that triggers before everything else when you hit "play" ^^'

ocean tundra
#

why would you need that?

zinc plinth
#

to make sure that my packed assets are up to date

ocean tundra
#

if your using addressables in editor you shouldnt use packed mode

pulsar jay
#

I thought you meant like something that triggers before everything else when you hit "play" ^^'
@zinc plinth that would be really useful. I was looking for sth like that for a long time

zinc plinth
#

holdup; what's the default behavior of Addressables in editor ?

pulsar jay
#

its simulated

zinc plinth
#

you have to manually build it don't you ?

ocean tundra
#

nope

zinc plinth
#

wdym simulated

#

OMG

pulsar jay
#

you dont have to built to use them in editor

zinc plinth
ocean tundra
#

i think you must have that last option picked

#

which is great for debugging

#

but only right at the end before you release a build

zinc plinth
#

I didn't, but I had no idea what the behavior was because the docs are really not that clear

#

urggggggg

ocean tundra
#

๐Ÿ˜›

zinc plinth
#

don't know if I should cry, scream, or knock myself unconscious on my desk facepalm

proven minnow
#

The tagline of DOTS: The Movie

ocean tundra
#

when using IConvertGameObjectToEntity whats the right way to get all entities

#

like all the children and their children

#

i thought a linked entity group but gives me a exception saying its not added

spark glade
#

Not sure, but I remember that LinkedEntityGroup doesn't get added when in a subscene.

ocean tundra
#

i am just starting to use subscenes

spark glade
ocean tundra
#

thats unexpected

#

theres a conversionSystem.GetEntities gona try that

#

also whats that attribute we should be using for sub scene conversion stuff?

spark glade
#

Let me know if you find something that works, I was gonna do something similar, because I want to pluck certain bodyparts from my models, so that I can easily get the "hand" or whatever of a unit when I need to cast a spell.

ocean tundra
#

so looks like get entities is only for the object that gets passed in

#

not children

#

looks like a child buffer is added

#

but you would need to recursively process those

spark glade
#

Maybe you can dig around in that method and see what it does

#

or even just use the linkedentityhgroup it'll produce for you

#

which should be a flat list of all children of all depths

ocean tundra
#

i did see that

#

yea now it has that buffer

#

but i dont think i can see it

#

yea that code just configures it to be added

#

dosnt add it right then

#

oh well in this specific case i dont have children

#

so not too bad ๐Ÿ˜›

#

now how do i load a subscene into a world

ocean tundra
#

How are we to get the Hash of a subscene to load it?

spark glade
#

when using IConvertGameObjectToEntity whats the right way to get all entities
@ocean tundra do you really need all entities?

You could maybe also do the reverse approach. Add a little IConvertGameObjectToEntity on the children and then use GetPrimaryEntity to add some data to the root/primary entity.

https://forum.unity.com/threads/finding-child-entity-during-gameobject-conversion.843826/

ocean tundra
#

Yup i dont really need them all

#

but was wanting to mark them all as prefabs

ocean tundra
#

So how do we load subscenes, I have this:

  var sceneId = sceneSystem.GetSceneGUID("CoreGameAssets_SubScene");
            _loadSceneEntity = sceneSystem.LoadSceneAsync(sceneId);
#

but it needs some sort of catalog data and crashes as its null

#

theres meant to be a 'catalog.bin' in my streaming assets folder

ocean tundra
#

Curse these subscenes

opaque ledge
#

yeah, i never used them

opaque ledge
#

hmm, burst 1.4 doesnt show up for me ๐Ÿ˜ฑ

#

ah its preview thats why

eager jungle
#

Hey guys. I'm working on a system that i need to specify and make use of generics. It seems like Entities queries & jobs using <T> are not allowed. What is my best alternative?

pulsar jay
#

Can anybody help me finding a specific entity by component value? It seems I can only filter by shared component values

ocean tundra
#

@eager jungle Code gen is the best way

#

or you can use Jobs directly, so no Entities foreach or Jobs WithCode

#

personally i have a mix of both

#

Tons of code gened systems but i also have started writing jobs using generics

#

@pulsar jay Yea thats right, depending on how often the lookup value changes I would have a 'find' system that loops over every findable entity and puts it into a native hash map and then use that for lookup

pulsar jay
#

@ocean tundra how would I tell that system what to find? Would I have to create an entity with a special component "findvithvalue" or is there any better way to pass information like that to a system?

ocean tundra
#

it wont be a generic system, what is the entity your trying to find?

pulsar jay
#

it is basically an object on a grid. It has a cell position and I am trying to find the object on cell (5,3) for example

ocean tundra
#

ok cool

#

thought it would be something like that

pulsar jay
#

I am still unsure if I should have an additional data structure for that

#

before ecs i was using a dictionary

ocean tundra
#

there are a ton of ways to do that with DOTS and which is best is super hard to tell

#

my advice is pick a way and then get it working, if you have performance issues then look at the different approachs

eager jungle
#

thanks @ocean tundra . Any good starting point for codegen?

ocean tundra
#

Now the 'ways' :P

  • A 'tile' entity, has a shared component for easy lookup of its tile pos, and has a dynamic buffer of entities. the lookup entities add/remove themselfs from the tile entity
  • A native muti hashmap, key is the tile pos, value is the entities, again 'findable' entities add/remove themselfs
#

those are the simple ones

#

ive seen people doing things like quad trees ect

#

and thats more around a RTS FOW as thats what im planning on doing

#

if you dont have many things in 1 tile pos then a normal native hashmap would work

#

@eager jungle Yup, lookup tt templates, thats what i use

#

and i use them in preprocessor mode

#

so first you write the tt template, then you pre process it in Visual Studio or rider, then from unity i have a scriptable object that will execute the template and pass it some data. That SO also has the File write code that takes the string text and puts it into a file

pulsar jay
#

I thought about the shared components. I guess it is not that efficient if I only have single to a few objects per cell position. Its even designed to use layers so there should only ever be 1 object per layer per cell

#

I guess the native hasmap is the way to go then. I was about to ask if there is a DOTS alternative to dictionaries anyway ๐Ÿ˜…

ocean tundra
#

yea theres a bunch of awesome native collections

#

they cant go on a entity tho

#

so you expose them from a system

pulsar jay
#

So they need to be a static member of a system?

ocean tundra
#

and you also lose out on the magic ECS dependency management, so if you have Job A writing to List A and then Job B reading you need to handle the job dependencies yourself

#

not a static member, but a public one

#

and not a property, a public field

pulsar jay
#

ah so I can get the system by "GetOrCreateSystem" and then set the values?

ocean tundra
#

yup

#

have the system that 'owns' the collection be the only one writing to it if you can

#

makes things clearer

pulsar jay
#

alright thanks

#

Right now DOTS land feels more and more like Workaround land for me ๐Ÿ™„

ocean tundra
#

haha yea, it takes a bit

#

but once it 'clicks' its amazing

#

but dont think of the native collections as workarounds they are a core part of DOTS

pulsar jay
#

The core part of ECS seems to be iteration over linear 1D data structures. Games usually are 2-3 dimensional however. It seems to me this clashes every time I try to do sth. spatial with ECS.

ocean tundra
#

yea they could do with some more spatial bits somehow, but i find i dont spend much time on spatial problems

#

admittingly my major problem will probably be FOW and i havnt started that yet

pulsar jay
#

FOW?

ocean tundra
#

Fog of War

#

for a RTS game

#

it will also effect my networking stuff

pulsar jay
#

Was just about to say that its a good problem for the GPU to handle

ocean tundra
#

yea but i need it for networking

pulsar jay
#

but networking will make it a bit more complicated

ocean tundra
#

:/

#

yup

#

networking makes everything more complicated

#

๐Ÿ˜›

pulsar jay
#

yeah I know the trouble ๐Ÿ˜…

amber flicker
#

as @ocean tundra says there are many ways - additional things that may affect your decision: 1) Number of tiles, 2) Frequency tiles/overall size changes, 3) Regular tasks (data access patterns) you will want to do - i.e. checking neighbours

pulsar jay
#

I feel I have a lot of spatial problems to solve. And the most obvious example is collision detection. The whole Havoc and Unity physics talks at unity also felt a bit like workarounds. It was like "we just copy all the stuff into native buffers do our stuff and thatn copy it back"

ocean tundra
#

yea but its fast

#

have you seen any of ther performance posts? theres probably some on you tube now

pulsar jay
#

yeah I have seen the impressive performance improvements

#

maybe its just my programming habit that I feel I have to strictly follow a pattern... ๐Ÿค”

ocean tundra
#

i think its more about learning the new patterns

amber flicker
#

It is probably more difficult than it should be to both a) implement these common spatial lookups and b) not do everything ecs once you start ๐Ÿ˜…

ocean tundra
#

all this struct and ref stuff, not using properties really threw me through a loop

#

im so used to them from a enterprise software background

amber flicker
#

also e.g. CDFE myTiles[associatedTileEntity] can do a lot of heavy lifting without necessarily making 'the most performant' backing data structure imo

ocean tundra
#

yea and don't get hung up on writing the most performant either, you will get stuck for days, already with ECS + Jobs + Burst your way faster
Get it going then come back when you have 20k entities and it isnt performing well

pulsar jay
#

I am not even trying to make it performant atm ๐Ÿ˜… Its more about redundancy I guess (keeping track of several lists representing the same map)

#

@amber flicker whats a CDFE?

opaque ledge
#

Component Data From Entity

pulsar jay
#

So you mean maintaining a tile list on a single entity?

#

Ah I see it gives me a list of all entities with that component. Didnt know that. Thx

amber flicker
#

it's what sits behind as e.g. 'GetComponent' in SystemBase - if you're not generally using them that will definitely make your life a bit easier but it's not a cure-all

pulsar jay
#

Thanks for all the help with navigating the DOTS jungle ๐Ÿ˜€ I will see how far I get with these new tools

amber flicker
#

np - we all go through the same pains - just keep framing it around the data

#

if you frequently want to know about a tiles neighbours for example then adding a buffer to every entity with e.g. the 8 neighbours entities means you can easily use CDFE to find properties for a neighbouring tile

#

(if your tiles are mostly static / created once) - you wouldn't want to do that every frame

pulsar jay
#

yeah right now I am mostly concerned about map building e.g. changing multiple tiles at once etc. It might be a good idea to have that buffer

#

I am still wondering if I should have cellposition as shared component data as @ocean tundra proposed as it my be interesting to get units on a specific cell later on

amber flicker
#

SCDs are good provided you're not overly fragmenting your entities. i.e. you don't want to iterate those entities frequently. If you had many e.g. 10,000+ tiles and every frame you updated that tile's resources or something, you'd want to be iterating the resources independently of the entities otherwise you'd be iterating over 10,000 chunks. Not necessarily a big deal - just something to be aware of.

pulsar jay
#

Yeah thats why I didnt meke CellPos a shared component yet as I was afraid it would fragment the data into many nearly empty chunks with only a few entities

pulsar jay
#

I will be watching the Boids Presentation again and see if this helps me decide which way to go: https://www.youtube.com/watch?v=p65Yt20pw0g&feature=youtu.be&t=1446

March 23, 1:00pm (San Francisco) - Mike Acton demonstrates best practices for component design to achieve a high degree of parallelism, minimum synchronization, and high performance. He focuses on data layout and uses common examples in games (e.g. spatial queries, logic updat...

โ–ถ Play video
dull copper
#

Unity staff reply on Virtual Texturing and hybrid v2: Hybrid renderer v2 should already work with 2020.2.a and we are backporting a fix to 2020.1 now.

zinc plinth
#

@ocean tundra for objects on grid : I have a buffer of my tile entities inside the grid object, and I translate 2d coords to 1d (requires known and finite size), and inside the tile entity I have a component thzt has the object entity

Nowhere in thzt I have shared component

Having shared components for tile pos would murder the chunks sydtem5

#

Grid entity *

pulsar jay
#

@zinc plinth yeah that works well for finite grids. In my case it is sparse though

zinc plinth
#

Yikes

pulsar jay
#

I guess a nativemultihashmap might work in my case in a similar way

zinc plinth
#

Why multi?

#

Just have a uint2 as key

pulsar jay
#

I have read somewhere that its faster than having a int2 as a key

#

I guess thats also why its used in the boids demo

zinc plinth
#

The only way to iterate values for a key in this is Next

#

Which is good if you do only sequencial

#

But if 'ot thzt' s horrible

pulsar jay
#

If I need a tile in an exact position I could fetch it from the multihashmap with x,y coodrinates

#

If I want to do sth sequentially I could just run a system over all cellPos components

#

But I am still unsure where the hashmap should be stored. I could either put it onto a separate entity (like the grid in your case) or store it in a system like proposed before

zinc plinth
#

Having it in a system would mean you can only have one, and isn't the best practice to put thzt kind of data there in my opinion

And if you don't use int2 as a key but int you'll have to Next through the whole values until you find what you want

#

You can benchmark it it's fairly easy to test, but I'm pretty sure what's going to win

pulsar jay
#

yeah I guess it would be easy enough to exchange one for the other

#

I am more concerned about where to put that data structure. The possibility of multiple grids seems to rule out storing it in a system as it would be limited to one hasmap as you mentioned

#

Having a component on the grid which stores the hashmap just felt like the 'classic' gameObject way of doing things

dull copper
#

I haven't noticed "Convert To Entity (Stop)" before

#

is this some thing to make conversion ignore certain GO's?

#

in which case it should be (Ignore) I guess

#

ah, this probably explains why I had issues with VT and hybrid v2 yesterday when I tried it: 9-preview will only work with 2020.1. We'll need to backport a fix first. It might take a few more weeks for everything to land in 2020.2.aX and hdrp 10 that allows you to use hybrid v2.

#

I have manually merged their fixes for HDRP 10.x but if it requires editor side fix, it totally explains why it failed for me

pulsar jay
#

If I want to 'select' certain objects (e.g Tiles or Units) to do some other stuff with them later. How would I handle that? I am thinking of having a system to select certain units in an area and then have other systems e.g. to move it or to attack sth. I would need a list to share between these systems. Should I communicate all of this via entites? I could imagine having an entity with a selectionrectangle component created when selecting with the mouse which triggers the selection system which in turn adds a selection component to the entity containing the resulting list of selected units

#

Another solution would be to add a tag component to the selected entities. But how would I tell the move system when or if to start moving the units. Having a MoveTag component?

deft stump
#

Another solution would be to add a tag component to the selected entities. But how would I tell the move system when or if to start moving the units. Having a MoveTag component?

#

yes. for me that's what i did. just add tags if I want a specific group of entities to be affected by a system

zinc plinth
#

@dull copper if you put convert to entity stop on a go that's a child of a go getting converted, it will make that go and all it's childrens not be converted

#

it's to "stop" the conversion chain

pulsar jay
#

thx will try the tags

dull copper
#

ah yes, that makes sense

#

I was thinking it as ignore but it does affect the child too

#

so I guess stop makes sense

stone osprey
#

Is it possible to get acess to the components of another entity inside a scheduled entities.foreach query ?

#

Entities.ForEach(() => EntityManager.GetComponentData<...>(id); }.Schedule(); ?

zinc plinth
#

unless you Run it I don't think no

#

EntityManager is main thread only

stone osprey
#

Damn... i need to set up a child-parent relation and the childs need to insert themselves into the parent :/ Hoped i could do it like this

stone osprey
#

Theres GetBufferFromEntity in case that anyone has similar problems

pulsar jay
#

Is there sth like GetComponentInParent for entities?

#

If I click on a tile the raycast will hit the child entities collider component so I will have to find the parent entity to change the whole tile

deft stump
#

there's a new update on burst.

dull copper
#

ah., preview.2

pulsar jay
#

@deft stump could it be that the update broke the GameObjectConversionUtility?

dull copper
#

1.4.0-preview.1 spammed a lot of errors for me

pulsar jay
#

I just added the physics package and it seems it also updated the burst compiler

deft stump
#

must be a hotfix

pulsar jay
#

and now I get this error: "No sharedMesh assigned to Unity.Physics.MeshCollider on Path_Pillar_Prefab"

proper silo
#

Hey, maybe a stupid question, but with SystemBase, Entity.ForEach and the ScheduleParallel, is the IJob interface still used or is it considered "legacy"? I am a bit confused with all the DOTS versions and I just want to be sure I am not misunderstanding something

opaque ledge
#

yeah its still used

#

but there is also Job.WithCode(), you can use that if you want to get advantage of local variables

proper silo
#

Damn ok thanks, I am having a tough time understanding the difference between an Entity.ForEach and an IJob that you schedule

pulsar jay
#

Installing the physics package really breaks my prefab conversion. Not sure if this is because of the physics package or the bust dependency

opaque ledge
#

Entity.ForEach creates IJobChunk in background, its a 'special' job that runs on chunks, Entity.ForEach is something you should do if you are doing ECS(Entity) stuff, such as reading a component on an entity or write to it etc, IJob is for.. everything else ๐Ÿ˜„ IJob is not related to ECS, you can use jobs(such as IJob and IJobParallelFor) in monobehaviours as well

#

in what kind of way Peaj ?