#archived-dots

1 messages Β· Page 130 of 1

naive parrot
#

i see. insightful

stone osprey
#

@mint iron Thanks ! Its already the latest version :/

vagrant surge
#

i was doing some fun shit tho

#

i was storing meshes

#

into textures

#

and then using bindless textures to load many different meshes, of different sizes, allocated separately... into a single drawcall

#

then i learnt that there are actually bindless buffers and i was just an idiot using bindless textures for that

stone osprey
#

Packages\com.unity.entities@0.8.0-preview.8\Unity.Entities.PerformanceTests\JobForEachPrefilteringPerformanceTests.cs(146,18): error CS1061: 'MethodMeasurement' does not contain a definition for 'Definition' and no accessible extension method 'Definition' accepting a first argument of type 'MethodMeasurement' could be found (are you missing a using directive or an assembly reference?)

#

Any idea where the hell this error comes from ?

#

This setup is a real pain, why dont they simply fix the dependencies ? :c

craggy orbit
#

i was somewhat correct in my earlier assumption that the Hybrid Renderer (v1) does not support Texture2DArrays. i updated my URP packages to 9.0 and it all works πŸŽ‰

bright sentinel
#

"does not contain a definition for 'Definition'" lmao

#

Definition of definition: See definition

opaque ledge
#

downgrade performance package to 1.3x

stone osprey
#

@opaque ledge You are a demi god...thanks a lot, that did the trick ^^

opaque ledge
#

Well i prefer God-Emperor, but demi god is good as well πŸ‘Ί

stone osprey
#

Ignore the demi, probably a real god πŸ˜‰

opaque ledge
#

@craggy orbit Thats probably Hybrid Renderer v2 πŸ€”

#

Hybrid Renderer v1 was long long time ago, then it came render mesh v2 and then newest and shinest hybrid renderer v2

craggy orbit
#

πŸ€” i must've misread then. i was using whichever one doesn't require the define symbol for Hybrid Renderer 0.4

glad condor
#

@thorny vault Thanks for the info, ill look into it!

#

Although, I have to ask, would dots netcode be currently suitable for starting development on an MMO?

opaque ledge
#

yeah that should be render mesh v2

wide fiber
#

How should Input be handled in DOTS?

I am using Input.GetKey(..) in the function OnUpdate (the class inherits from SystemBase) but it doesn't work sometimes

#

I was thinking about using the new Input System, I will search how to implement it with DOTS

opaque ledge
#

it still should, i am using new input system but old system should work as well

wide fiber
#

Sometimes it doesn't read the key correctly (when the key is pressed it returns false), it isn't a computer/keyboard problem.. Later I will send the code

opaque ledge
#

hmm it should πŸ€”

#

i mean i did the same, in OnUpdate method i check if button/key is pressed and if so i schedule a job

zenith wyvern
#

Sounds like maybe you're losing inputs if your system is not updating. If it's reading input your system should probably have the [AlwaysUpdateSystem] attribute

#

Otherwise it won't catch input if it has no matching queries

wide fiber
#

(It is rare, but it is annoying)

opaque ledge
#

what does AlwaysUpdateSystem do πŸ€”

zenith wyvern
#

It forces the system to call OnUpdate every frame, instead of only calling OnUpdate when it has a query match

wide fiber
#

The query should match every time, I am not deleting any component.. in a few minutes I will send the code of the input system

zenith wyvern
#

Rather than just assuming you can see for yourself, if you add [AlwaysUpdateSystem] to your input reading system do the input drops stop?

safe lintel
#

there shouldnt be a need for alwaysupdatesystem when using systembase

zenith wyvern
#

Sure there is, if you're trying to read input every frame inside OnUpdate and your system has any queries in it then you will fail to read input if the query doesn't match because OnUpdate would never be called for that frame

wide fiber
#

Thanks, it's working
But I think I will switch to the new input system

zenith wyvern
#

The new input system is much better in a lot of ways but it's not integrated with dots any more than the old system is fyi

safe lintel
#

oh my bad, confusing with alwayssynchronizesystem(hmm might have to look at some of my code)

zenith wyvern
#

You still have to read input on the main thread and pass it in, the same way as with the old system

bright sentinel
#

Do you know of any plans for DOTS input system?

safe lintel
zenith wyvern
#

Nope. I think there's a webinar thing coming up all about the new input system though, maybe we'll hear something there

opaque ledge
#

i think current input system works fine with DOTS πŸ€”

safe lintel
#

it does, but it also is quite limited compared to the new system

dense crypt
#

I have a situation I'm not sure how to deal with:

You have three jobs: JobA, JobB, JobC.
Now JobA does some calculations and comes to the result true or false.
If the result is true JobB should run, but if it's false JobC should run instead. How would you structure this?

In my head the only way is to output the result in a NativeArray<bool>, and start both JobB and JobC. Then each job checks the result and the one that shouldn't run will early out. (if this seems familiar I asked it in the GDL discord the other day.)

opaque ledge
#

i mean by current input system i meant new system πŸ˜„

#

old one called input manager, new one called input system so

#

exactly Peppe

#

tho you have to make sure JobB and JobC are depending on JobA

safe lintel
#

i do hate how more and more names are overlapping with all these new packages πŸ™‚

dense crypt
#

Yes the dependencies I left out to not make the message too long πŸ˜…

warped trail
#

merge JobB and JobC in 1 job and use if inside?πŸ€”

dense crypt
#

Yeah in my case the jobs are ForEach jobs working on completely different components so that would probably make it less readable, but it's an option for sure.

steep timber
#

what is dots?

warped trail
#

performance by defaultπŸ˜…

opaque ledge
#

@mint iron btw, do you have any brief example for the event system you created ? i am too scrub to figure out stuff on my own

bright sentinel
#

determinism by default

mint iron
#

sure, its not brief though, its complicated so that it can be brief later πŸ™‚

coarse turtle
#

looking forward to it - hoping I can use it to replace my current messaging system in the ui system haha πŸ‘€

opaque ledge
#

sure πŸ˜„

mint iron
#

kk, well i have a package sort of ready, lemme just check it still works

coarse turtle
#

haha no worries, take your time - I need to wrap up some preliminary stuff on my side before looking into it πŸ˜…

opaque ledge
#

it would be perfect for me because when ships explode i run an explosion effect

mint iron
#

oh wait, you're just talking about events in general

#

for some reason i thought u meant the InputAction mapping to ecs events

opaque ledge
#

right now i run in a weird method, i run trigger job without burst and 'register' the position to MB, and MB creates/retrieves from pool and run the effect in Update method, kinda weird

#

oh no, it was a question for your event system that you posted today

mint iron
#

it shows how to do UI stuff and spawn particle effects, scene loading etc

warped trail
#

InputAction mapping to ecs events this is very interesting πŸ‘€

opaque ledge
#

yeah but.. where is the main event system ?

mint iron
opaque ledge
#

alright thanks, well i will check it out, it looks complicated, bunch of scripts πŸ˜„

#

but hopefully i will figure it out

mint iron
#

nah its easy πŸ˜„

opaque ledge
#

πŸ‘

obtuse swallow
#

I get an error "Entities.ForEach Lambda expression writes to captured variable", while all I am doing is querying the Contains method of a nativearray. This should not count as a write. Anyone ever had the same problem?

bright sentinel
#

@obtuse swallow Can you show the code?

junior fjord
#

@mint iron oh cool, I'll also check you event system out

#

didn't know someone has coded a package already

coarse turtle
#

@mint iron ok - it's very easy to implement lol πŸ‘€

obtuse swallow
#

Sure:

var loadedPositionsComps = _loadedSectionsQuery.ToComponentDataArray<SectionPosition>(Allocator.Temp);
        var loadedSectionPositions = new NativeArray<int3>(loadedPositionsComps.Select(component => component.value).ToArray(), Allocator.TempJob);
        Entities.WithName("LoadSections").ForEach((in RequiredSectionPositions component) =>
        {
            foreach (var requiredSectionPosition in component.value.Where(requiredSectionPosition => !loadedSectionPositions.Contains(requiredSectionPosition)))
            {
                // TODO Create Entity for Section
            }
        }).ScheduleParallel();
mint iron
#

it might be because you're using foreach in a burst job - unless something has changed, you can only do that if its a ref struct enumerator. also using linq? definitely can't use that.

coarse turtle
#

loadedPositionsComps needs to be passed to your job code via WithReadOnly(...) or an equivalent. Also I think you might need to use a TempJob allocator instead of a Temp

opaque ledge
#

you cant do any managed(class) stuff in your jobs, if you want to, you have to do WithoutBurst().Run(), which means it will run on main thread and without burst

junior fjord
#

has anyone ever had a situation like this:
I have a system, when I set a breakpoint before the foreach, the breakpoint is hit. When I set it inside the foreach, the breakpoint is not hit. Nevertheless, the entity debugger shows that the system is run, takes time and matches the right entities against that system

zenith wyvern
#

I'm not sure what the situation is with burst and breakpoints, maybe you have to disable burst while doing that kind of debugging

#

Since it's doing codegen I'm not sure how that works either

obtuse swallow
#

Thanks guys, I'll try to rethink my code to get around all that.

junior fjord
#

burst is disabled

#

and normally breakpoints inside the foreach work like a charm in this case

#

even now, in other systems the breakpoint in the foreach works

#

ah ok, found the mistake

wide fiber
#

If I want to make a Follower script (an entity that follows another entity), how can I make a field in the inspector where I can put the entity to follow? As far as I know components can't store references

hollow sorrel
#

you can store entity id on a component and do a lookup in your system

wide fiber
#

Ok thanks, I will try this

warped trail
#

something like this will work in SystemBase```cs
struct MyComponent : IComponentData
{
public Entity Value;
}
Entities.ForEach((ref MyComponent component)=>
{
Translation translation = GetComponent<Translation>(component.Value);
}).ScheduleParallel();

bright sentinel
#

I think the problem is more how to populate Value of the MyComponent struct

#

That's generally the problem I had when starting out

wide fiber
#

I could do some tricks with authoring (I hope) to get the entity by the GameObject (I am using hybrid ECS)

fallow mason
#

Leader tag component. Query for it. ToEntityArray(). Get index 0. Profit?

bright sentinel
#

What you can do is, after your conversion system runs, have a query that gets the entity you want, and another query that gets the component that needs that entity. Then it's a simple matter of putting the entity into the component

naive parrot
#

how do i read entity debugger view? can somone provide some input what all the numbers scattered all around means?

#

i get the chunk and components aspect.

#

also wondering about orange line

opaque ledge
naive parrot
#

thanks!

#

does ECB work with IJobChunk ? to use it in parallel it requires jobIndex as one of its parameter , so is chunkIndex a valid input for that ?

mint iron
#

yes

winter depot
#

Does anyone have a good link for understanding how to work around not being able to call external methods in SystemBase Entites. lambda? For example I was previously using a ijobforeach where I had convenience methods in the struct, now I cannot .Schedule, I must do .WithoutBurst().Run()

coarse turtle
winter depot
#

Okay, thank you I will take a look

zenith wyvern
coarse turtle
#

oh cool πŸ‘

winter depot
#

thanks @zenith wyvern

loud matrix
#

Is there a easy way to reference entities created with convert to entity?
I have a camera created with convert, and a player created with pure ECS.
I have a IComponentData on the camera to reference the entity its following (player).
The only way I know to do this is to add more components just so i can search with them, which doesn't feel like the right solution.

glad solar
#

Alright, i searched but it seems to be a problem with the new preview version of the Entities package.

Does anyone is having the same issue as me with Entities package "Preview.8 - 0.8.0"?

Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\LiveLink\LiveLinkPlayerSystemGroup.cs(32,59): error CS0117: 'SceneSystem' does not contain a definition for 'GetBootStrapPath'

I'm seriously thinking in downgrading the version i'm using, however i went to some reference problems in my cs files.

My project focus is for android only.

glad solar
#

@hollow sorrel thank you. I saw this and i was hoping for a native solution.
I"ll try searching for a while, if i can't find any, i'll try modifying the files and then if still with erros, then i will downgrade (unfortunately).

glad solar
#

😒 oh well... downgrading...
Seems that everytime i reopen unity, it undo the changes i did described in the link. So it is futile to do it.

hollow sorrel
#

just make it a local package until its updated

gusty comet
#

Does anyone have any good learning resources they could share for the dots networking stack?

zenith wyvern
#

The best/most up to date resources are in the pinned messages in this channel

#

Oh sorry you said networking specifically. I don't think there's anything aside from the cube sample and the FPS sample right now

coarse turtle
#

Hmm - I'm not sure if anyone had an issue like this before right?

Library/PackageCache/com.unity.properties@0.10.4-preview/Runtime/Unity.Properties/Utility/TypeConversion.cs(51,25): error CS0234: The type or namespace name 'Unsafe' does not exist in the namespace 'System.Runtime.CompilerServices' (are you missing an assembly reference?)
#

Seems to only happen when I add in a custom package... πŸ€”

mint iron
#

hmmm, very odd.

coarse turtle
#

ah that was dumb - I guess my scoped registry was messed up πŸ˜…

glad solar
#

May someone help me out?
I'm runing into this message:

error DCICE001: Entities.ForEach Lambda expression uses something from its outer class. This is not supported. Seeing this error indicates a bug in the dots compiler. We'd appreciate a bug report (About->Report a Bug...). Thnx! ❀️

The system:

using Game.Data;
using Unity.Entities;

namespace Game.Generation.Systems {
    public class MapGeneratorTerrainSystem : SystemBase {
        private Entity _terrainEntity;

        protected override void OnStartRunning() {
            Entities.ForEach((in PrefabHolderData prefabHolder) => {
                _terrainEntity = prefabHolder.TerrainPrefab;
            }).Run();
        }

        protected override void OnUpdate() {
            if (_terrainEntity == null)
                return;
        }
    }
}```
*PrefabHolderData file:*
```cs
using Unity.Entities;

namespace Game.Data {
    [GenerateAuthoringComponent]
    public struct PrefabHolderData : IComponentData {
        public Entity TerrainPrefab;
    }
}```

Is it really a bug? I don't know what can i do from here to solve this.
If it is really a bug, i'll have to find another way around this problem.

*aahhh what a pain...*😞
gusty comet
#

@zenith wyvern thank you

low tangle
#

@glad solar its complaining about that ref to the _terrainEntity; you can't directly ref stuff outside of the local scope.
all you need to change is to make a local Entity _temp;
run the foreach
then assign the _terrainEntity = _temp; at the end

glad solar
#

@low tangle love you! 😘
The error message should be more straight. Thank you so much!

low tangle
wide fiber
#

Leader tag component. Query for it. ToEntityArray(). Get index 0. Profit?
@fallow mason (nope, I want multiple entities to follow multiple targets)

finite ibex
#

I'm using Unity UI Extensions in a regular project for their Polygons. Can I draw lines / Polygons using dots?

#

I only need to go up to 20 sided polygon, maybe I could just create a mesh for each? is that a thing?

wide fiber
#

What you can do is, after your conversion system runs, have a query that gets the entity you want, and another query that gets the component that needs that entity. Then it's a simple matter of putting the entity into the component
@bright sentinel How can I get the converted entity of a GameObject?
I have a Gameobject (the target to follow) field in an authoring component, how can I get the entity of the target?

opaque ledge
#

you have to implement IDeclaredPrefabReferences, in it's method you have to add your gameobject to the list(comes from method) and in Convert method you have to do conversionSystem.GetPrimaryEntity(YourGameObject) which gives you the entity of that gameobject

wide fiber
#

Thanks :D
Really helpful

warped trail
#

this will do the same thingπŸ€” cs [GenerateAuthoringComponent] public struct MyComponent : IComponentData { public Entity EntityToFollow; }

opaque ledge
#

i think Entity fields doesnt show in inspector, they are not serializable πŸ€”

warped trail
#

this will generate same code as yours πŸ˜…

opaque ledge
#

hoo it does πŸ‘€

amber flicker
#

With an IJobChunk what's the difference between Schedule & ScheduleParallel?

warped trail
#

no difference i guessπŸ€”

amber flicker
#

struggling to find an appropriate docs page about which I should be using

warped trail
#

i guess they will change it in the future to match foreach methods

amber flicker
warped trail
amber flicker
#

nice, good find thanks

wide fiber
#

this will do the same thingπŸ€” cs [GenerateAuthoringComponent] public struct MyComponent : IComponentData { public Entity EntityToFollow; }
@warped trail I think entities are not serializable, I am using a Gameobject field, not an Entity field

opaque ledge
#

i just tried it, it shows Gameobject field in inspector

#

so you are not actually putting Entity to inspector, you are putting Gameobject

warped trail
#

just try it πŸ˜…

opaque ledge
#

i guess it will automatically convert it to Entity and put the Entity to that component

wide fiber
#

Ok

#

How can I get the magnitude of a float3? A lot of mathematics things don't exist in float3

opaque ledge
#

length

#

Unity.Mathematics.math.Length

wide fiber
#

:D

fallow mason
#

Interesting. So you wouldn't need to put that GO in a subscene or add ConvertToEntity? It will just convert because it was assigned to a field that will convert?

warped trail
#

in your case you will get prefab entity

fallow mason
#

so not a reference to the GO->Entity I put in there, but a copy?

warped trail
#

you will get reference to another Entity if it exist in scene

fallow mason
#

You lost me. Probably because I have not delved into prefab entities just yet.

warped trail
#

prefab entity is just an entity with prefab component

#

if your GO don't exist in scene, then it will be converted to entity and marked as prefab

#

if GO is in scene then you will get reference to its entity

fallow mason
#

ah I didn't know that

#

thanks, @warped trail

warped trail
#

but it has to be in 1 scene, no cross scene references πŸ˜…

fallow mason
#

right, I've come across that error doing other things

warped trail
#

i guess this is the way to store prefabs for nowπŸ€”

#

make a buffer of prefabs in 1 entity

#

and this prefabs are saved in subscenes, so in the end you get 2 copies of 1 object πŸ˜…

fallow mason
#

huh, seems undesirable

warped trail
#

they say they will fix that in the future

fallow mason
#

do they get picked up by systems? do you need to filter out prefabs if so?

warped trail
#

you have to explicitly query for prefab component to see this entities

fallow mason
#

ah ok. so it filters itself out unless you ask for it specifically

warped trail
#

yes

opaque ledge
#

normally, systems doesnt include the entities that has disabled and prefab components, you have to explicity query for them

warped trail
#

and when you instantiate it, it automagically removes prefab component

fallow mason
#

yeah, I was just thinking that prefab sounds like it acts like disabled

#

alright, good to know

warped trail
#

they do something like this in Tinycs public struct PrefabStorage :IComponentData { public Entity RegularSmokePRefab; public Entity MagicSmokePrefab; }

#

and i guess you can get every entity which was intantiated with this prefab via LinkedEntityGroupπŸ€”

gusty comet
#

Re. hybrid renderer v2, is renderbounds in WS or local space?

#

I presume worldspace.

wide fiber
#

I am converting the camera to an entity (because I don't want to rewrite some components to work as MonoBehaviour).

I want in some systems to get a reference to the camera: should I put a camera tag and make a query in the systems where I need the camera or should I make a static/singleton class that holds the reference?

opaque ledge
#

there is no ECS camera so you have to make convert mode to convert and inject, then you will simply have the game object, i guess making a singleton class is much better

#

You should also make an authoring component on your camera object that will add "CopyTransformToGameObject" component which is under Unity.Transform namespace, you can add CameraTag component to make queries on ECS side

warped trail
#

you can convert cameraπŸ˜…

#

i guess it is converted to hybrid component or somethingπŸ€”

opaque ledge
#

You cant convert camera, hence you do convert and inject πŸ€”

warped trail
#

if you place camera in subscene it is not destroyed πŸ€”

opaque ledge
#

last time i tried it did πŸ€”

#

which was in entities 0.5

warped trail
#

i guess this is how thing will be. If object can be converted you get normal entity, if not then you get hybrid entityπŸ€”

opaque ledge
#

i mean i do remember taking my camera out of subscene because it was destroyed

warped trail
#

oh, i liedπŸ˜‹

#

it is not destroyed when you keep subscene openπŸ˜•

#

i hate this thing

opaque ledge
#

i should probably get used to do some subscene thingie, it sounds useful for pure entities

warped trail
#

they kinda cool, when they work πŸ˜…

wide fiber
#

I have put the ConvertToEntity script to the camera GameObject, it gets converted to an entity

#

I don't know what are hybrid entities

warped trail
#

forget what i said, i was wrongπŸ˜•

stiff skiff
#

Is there a simple of ConvertAndInject ?

#

I've been going through the ECSScamples, but can only find ConvertAndDestroy used

fallow mason
#

Yeah weird things happen when you run with subscene open. Things move in the game view, but not scene view.

opaque ledge
#

you mean sample ?

stiff skiff
#

Sorry, *sample

bright sentinel
#

@stiff skiff Just means you will also have the gameobject available

fallow mason
#

I think I understand a little why, but still an odd halfway thing

opaque ledge
#

well so.. basically Unity converts your gameobject to entity then instead of destroying your gameobject it simply doesnt destroy it

stiff skiff
#

But the GameObject is linked the entity right?

opaque ledge
#

yes it is

zenith wyvern
#

The monobehaviours that are attached to the gameobject will also be attached to the entity, specifically

#

So you can query for them

stiff skiff
#

So with the normal flow, you can spawn a "prefab" by converting it in advance, and then spawning it using the pre-converted prefab entity as a source

opaque ledge
#

you can use CopyTransformFromGameObject, if you want to control the game object and want to have entity part of it sync with gameobject, or CopyTransformToGameObject if you want to do the opposite

stiff skiff
#

Is this also possible with the flow where I keep the gameobject?

#

Context: I want to spawn prefabs that are partially converted to ECS, some things are still monobehaviour and I dont want to move everything over in 1 go

opaque ledge
#

ah, for that i think you need to use HybridComponents

#

when you convert a gameobject with hybrid component to an entity it will have CompanionLink which is responsible for creating gameobject side when you instantiate that entity

#

however i couldnt make it work, so πŸ˜„

#

maybe you will have more luck

stiff skiff
#

Yeah that will be fun to try

#

I currently have a system where I already have ECS entities, but want to have GameObject spawned for some of them, and link the object

#

currently not to bad, but I'm trying to get it working the unity's "Transform" system

#

so that my ecs entity does not need the managed Transform component

#

The goal is to close the gap between ECS and Monobehaviours a bit more. Without enforcing either flow

zenith wyvern
#

That seems to be what they want from HybridComponent. But like Curly said I don't think it's there yet

opaque ledge
#

You can always do the system data way, when you instantiate your entity you put "WaitForGameobjectProcess" then have a system that queries for those entities and runs with WithoutBurst().Run(), in that system you can instantiate gameobjects and do AddComponentObject to entity. Then you can do another WithoutBurst().Run() with querying that Monobehaviour and your entity and do your processing. Once your entity is destroyed system state will stay so you can query it to detect that and destroy your Monobehaviours(or pool them)

#

I am using this for World UI for my entities

#

I can later on share my code on how i do my UI

#

does anyone have link to srp github ? for some weird reason i cant find it

warped trail
#

they moved it

opaque ledge
#

oh thanks

loud matrix
#

Is there a easy way to reference entities created with convert to entity?
I have a camera created with convert, and a player created with pure ECS.
I have a IComponentData on the camera to reference the entity its following (player).
The only way I know to do this is to add more components just so i can search with them, which doesn't feel like the right solution.

glad solar
#

May someone help me out?

With my struct MapGeneratorData:

using Unity.Entities;
using Game.Utils;
using Unity.Collections.LowLevel.Unsafe;

namespace Game.Generation.Data
{
    [GenerateAuthoringComponent]
    public struct MapGeneratorData : IComponentData {
        public int MapSize; 
        public int GenerationSeed;
        //public int Phase;
        public MapGenerationPhase Phase;
        //public int Map;
        public UnsafeHashMap<UPosition, Entity> Map;
    }
}```
I'm getting this message:
> *ArgumentException: Game.Generation.Data.MapGeneratorData contains a field of Unity.Collections.LowLevel.Unsafe.DisposeSentinel, which is neither primitive nor blittable.*

I tried to switch my enum `MapGenerationPhase` to an int and the `UnsafeHashMap` to int as well, but i'm still getting the error.

*For information about `UPosition`*:
```cs
using System;

namespace Game.Utils {
    [Serializable]
    public struct UPosition: IEquatable<UPosition> {
        public int X;
        public int Y;

        public UPosition(int x, int y) {
            X = x;
            Y = y;
        }

        public bool Equals(UPosition other) {
            return other.X == X && other.Y == Y;
        }
    }
}```
> *float2 from mathematics didn't work either if wondering to use it.*
opaque ledge
#

you cant put native arrays to component datas, they are not blittable

eternal ice
glad solar
#

What about only with int types? As i said above:

I tried to switch my enum MapGenerationPhase to an int and the UnsafeHashMap to int as well, but i'm still getting the error.

opaque ledge
#

that does sound like a bug then, int is blittable

#

i have never encountered it tbh

foggy garden
#

could a feature be built into Discord Boost to add a turbo to a server via SMS?

warped trail
#

i don't get any errors with thisπŸ€·β€β™‚οΈ cs [GenerateAuthoringComponent] public struct MapGeneratorData : IComponentData { public int MapSize; public int GenerationSeed; public int Phase; public int Map; }

glad solar
#

hmm.... i'll try to restart unity then.
Few months ago i had a problem using namespace with dots. Without any namespace back at the time i could work without any issues. maybe this could be the issue. I'll try some tests here. thanks guys!

viral sonnet
#

The UnsafeHashMap should work in a SharedComponentData but TBH I'd put it elsewhere. UPosition and then the map could be turned into an IComponentData with an entity buffer

sour ravine
#

this sounds like a job for BlobAsset

dull copper
#

SRP 9.0.0-preview.14 landed earlier this week. I would however recommend waiting until the next DOTS packages land (including hybrid renderer 0.4.2) to get latest bugfixes. This version also has working HybridHDRPSamples and HybridURPSamples projects in the DOTS repository for testing Hybrid Renderer V2.

warped trail
#

where is this DOTS repository?πŸ˜…

dull copper
#

I'm guessing he things it's public repo πŸ˜„

#

or he just refers to ecs samples repo

#

also lol for the too bright lighting on hybrid renderer v2: This is fixed now. But I am afraid it just missed the branch off for the next package release.

#

so, will be broken on next release too

warped trail
#

oh, and b5 is outπŸ˜…

dull copper
#

yup

#

been testing it as it has improvements on DX12 compute shaders

#

hybrid rendering v2 is now "only" 0.7ms slower in actual build for me when using DX12

#

DX12 used to run like 30-40 fps in editor with hybrid v2

#

now I get 180fps

#

that 0.7ms is still quite a lot, considering the total cpu time on built project is 3.3ms on DX11 and 4.0ms on DX12

#

but at least it's not the quarter of the perf on DX12 anymore

warped trail
#

but lighting it totally broken in urpπŸ˜’

dull copper
#

heh, it goes away after I moved directional light and plane mesh out of dots subscene

#

oh well

warped trail
#

wait, does this auto deletion system work in build?πŸ€”

dull copper
#

what auto deletion?

warped trail
#

deleting an allocation that ....

#

this is for Allocator.TempJob

#

or is it just some safety system which works only in editor?

dull copper
#

I don't know actually, but it shouldn't happen in the first place πŸ˜„

#

anyway, I try to force myself to not touch dots subscenes again

#

they've never been anything but trouble for me

#

I have another project on backburner that could benefit from them

#

but I'm simply waiting for DOTS to mature before I even go there

#

basically would want to use it for streaming bigger world in chunks

warped trail
#

i update simulation group at low rate, so i get this warnings from physics DebugStream systemπŸ˜…

stiff skiff
#

@opaque ledge Bit late, thanks for helping out πŸ˜‰ Your idea is similar to my current approach

warped trail
#

it allocates some TempJob things and deallocates it on the next update, but there is more than 5 frames between updates πŸ˜…

opaque ledge
#

i have no idea how people make their job to work on multiple frames πŸ€”

warped trail
#

so now i'm wondering, what if i will need information in this TempJob and it will be deallocatedπŸ€”

dull copper
#

hmmm

#

it's not the dots subscene, it started it again when I opened the project again

#

for some reason it didn't spam that after I deleted dots subscene tho

warped trail
#

maybe because your framerate dropped? πŸ˜…

dull copper
#

210fps in the editor πŸ€”

#

oh

#

let me try the different physics update

#

ok, it is the physics update πŸ˜„

warped trail
#

probably from debugstream

dull copper
#

I had 50Hz physics setup for testing

#

I'm normally at 100Hz or 200Hz

amber flicker
#

woo new packages.. lets see

wide fiber
#

Is there a easy way to reference entities created with convert to entity?
I have a camera created with convert, and a player created with pure ECS.
I have a IComponentData on the camera to reference the entity its following (player).
The only way I know to do this is to add more components just so i can search with them, which doesn't feel like the right solution.
@loud matrix you can put a public variable of type Entity. A new field in the inspector will be available, you can drop in the GameObject that you want to follow, when the GameObject will be converted, the reference will be updated to his entity

amber flicker
#

* Added the ability to reimport a SubScene via an inspector button, which forces reconversion.πŸ₯³

coarse turtle
#

o 0.9.0 came out?

amber flicker
#

yupppp

opaque ledge
#

hooo πŸ‘€

amber flicker
#

not hdrp though

opaque ledge
#

@dull copper where the notes at πŸ‘€

amber flicker
coarse turtle
#

wow bursted ecb playbacks

amber flicker
#

ya... pretty sweet

coarse turtle
#

GetSingleton<T> supposedly received perf improvements

formal scaffold
#

Hmmm, so if my Systems work in a specific order πŸ€”, which is the default order without touching them, will they work in any other order by default?

opaque ledge
#

@formal scaffold its simply out of your hands, you can use UpdateAfter, UpdateBefore, UpdateInGroup attributes to set that order explicitly

dull copper
#

@opaque ledge I don't paste HDRP notes here as they are not related to this channel πŸ™‚

amber flicker
#

* Improved performance of access to singletons through SetSingletonandGetSingleton in SystemBase (peformance is also improved through these methods on EntityQuery). as it was mentioned the other day

dull copper
#

oh, the new dots packages got out?

opaque ledge
#

umm, i didnt mean HDRP, i meant all DOTS packages πŸ˜„

dull copper
#

yeah I see it now

#

I just checked these 30 minutes ago πŸ˜„

opaque ledge
#

What have you done to real Olento, who are you imposter πŸ‘€

coarse turtle
#

hmm time to see if things break between the package versions πŸ€”

amber flicker
#

darn.. getting a bunch Library\PackageCache\com.unity.dots.editor@0.4.0-preview\Editor\GUI\Legacy\Controls\RuntimeComponents\RuntimeComponentsDrawer.cs(26,44): error CS0246: The type or namespace name 'EntityContainer' could not be found (are you missing a using directive or an assembly reference?) guess dots editor may not be compatible

coarse turtle
#

yeah same here ):

opaque ledge
#

oh god, should i downgrade πŸ˜„

amber flicker
#

it's weird... you'd have thought at some point somebody would test a released combination of packages (esp given all the trouble).. *sigh

dull copper
#
## [Entities 0.9.0] - 2020-04-08

### Added

* `public void GetCreatedAndDestroyedEntitiesAsync(NativeList<int> state, NativeList<Entity> createdEntities, NativeList<Entity> destroyedEntities)` detects which entities were created and destroyed since the last call to this method.
* Added the ability to reimport a SubScene via an inspector button, which forces reconversion.
* Added `GameObjectConversionSystem.DeclareAssetDependency` which expresses that the conversion result of a GameObject depends on an Asset
* Added `void EntityManager.Instantiate(NativeArray<Entity> srcEntities, NativeArray<Entity> dstEntities)`. It gives explicit control over the set of entities that are instantiated as a set. Entity references on components that are cloned to entities inside the set are remapped to the instantiated entities.
* Added `void EntityManager.CopyEntitiesFrom(EntityManager srcEntityManager, NativeArray<Entity> srcEntities, NativeArray<Entity> outputEntities = default)`. It lets you copy a specific set of entities from one World to another. Entity references on components that are cloned to entities inside the set are remapped to the instantiated entities.
* Added assembly for Mesh Deformation data structures.
#
### Changed

* Systems are now constructed in two phases. First, ECS creates a new instance of all systems and invokes the constructor. Then, it invokes all `OnCreate` methods. This way, you can now use `World.GetExistingSystem<OtherSystem>()` from inside `OnCreate()`.
* Systems are now destroyed in three phases. First, ECS stops all running systems (i.e. OnStopRunning() is invoked). Then it invokes all `OnDestroy` methods. Finally, ECS destroys all systems. This means you can perform safe and predictable cleanup of systems with cross-references to other systems.
* EntityCommandBuffer Playback now Bursted through function pointers. When there's a mix of unmanaged and managed commands in a single buffer, unmanaged commands will be Bursted. When there are no managed commands, each chain's Playback is fully Bursted.
* `Entities.ForEach` in a `GameObjectConversionSystem` no longer logs a warning if there are multiples of a queried authoring component on a matching GameObject. It now returns the first component instance of the desired type, so conversion systems can optionally call `GetComponents<T>()` in order to handle multiples if desired.
* Declaring a non-Prefab object as a referenced Prefab during conversion now emits a warning
* Improved performance of access to singletons through `SetSingleton` and `GetSingleton` in SystemBase (peformance is also improved through these methods on EntityQuery).
* Updated package `com.unity.properties` to version `1.1.0-preview`.
* Updated package `com.unity.serialization` to version `1.1.0-preview`.
* Updated package `com.unity.platforms` to version `0.2.2-preview.7`.```
#
### Deprecated

* Deprecated `public T World.CreateSystem<T>(params object[] constructorArguments)`. Please use `World.AddSystem(new MySystem(myParams));` instead.
* Deprecated `LiveLinkBuildImport.GetHash/GetDependencies/GetBundlePath`.

### Removed

* Removed expired API `TypeManager.CreateTypeIndexForComponent<T>()`
* Removed expired API `TypeManager.CreateTypeIndexForSharedComponent<T>()`
* Removed expired API `TypeManager.CreateTypeIndexForBufferElement<T>()`
* Removed expired API `DynamicBuffer.Reserve(int)`
* Removed expired API `World.Active`
#
### Fixed

* Fix BlobAssetSafetyVerifier to generate a better error message when `readonly` is used with BlobAsset references.
* Fixed incorrect comparison in `EntityChunk.CompareTo()`.
* `SceneManager.IsSceneLoaded` now works for converted entity Scenes and returns whether all sections of an entity Scene have loaded.
* Fixed Exception in conversion code when trying to delete entities that are part of a Prefab.
* Fixed Hybrid Component conversion failing when multiple components were added for the same GameObject.
* Fixed use of component access methods (GetComponent/SetComponent/HasComponent) inside Entities.ForEach with nested captures.
* Fix compilation issue when `ENABLE_SIMPLE_SYSTEM_DEPENDENCIES` is enabled.

### Security

### Known Issues
* System groups do not currently apply to systems running as part of `EntitySceneOptimizations`
#

such spam

wide fiber
#

The Entity field doesn't show up in the inspector in a MonoBehaviour script, help

coarse turtle
#

I dont think Entities are serialized by default

dull copper
#
## [Collections 0.7.1] - 2020-04-08

### Deprecated

 * Deprecated `Length` property from `NativeHashMap`, `UnsafeHashMap`, `NativeMultiHashMap`,
   `UnsafeMultiHashMap`, `NativeQueue`, and replaced it with `Count()` to reflect that there
   is computation being done.

### Fixed

 * Fixed an issue where `FixedListDebugView<T>` only existed for IComparable types, which lead to a crash while debugging other types.
 * Removed code that made NativeStream incompatible with Burst.```
amber flicker
#

alright removing Dots editor for now and at least it compiles.. not going to miss editor much atm anyway

coarse turtle
#

I forget does DOTS Editor allow usage of Subscenes?

dull copper
#
## [Burst 1.3.0-preview.9] - 2020-03-30

### Changed
- Improved the compile time performance when doing `UnsafeUtility.ReadArrayElement` or `UnsafeUtility.WriteArrayElement` with large structs.
- Made some compile-time improvements when indirect arguments (those whose types are too big that they have to be passed by reference) that reduced our compile time by 3.61% on average.

### Fixed
- Fixed a bug where storing a `default` to a pointer that was generic would cause an LLVM verifier error.
- Fixed an obscure bug in how struct layouts that had dependencies on each other were resolved.
- Fixed a bug as found by [@iamarugin](https://forum.unity.com/members/iamarugin.737579/) where LLVM would introduce ldexp/ldexpf during optimizations that LLD would not be able to resolve.
- Fixed a bug where the compiler would not promote sub-integer types to integers when doing scalar-by-vector math (like multiplies).```
coarse turtle
#

Or is that entirely part of Entities base package?

opaque ledge
#

What do you guys think of "public void GetCreatedAndDestroyedEntitiesAsync(NativeList<int> state, NativeList<Entity> createdEntities, NativeList<Entity> destroyedEntities)", can we jobify these, especially for registering children to parents since ecb doesnt give us valid id

amber flicker
#

oh but now nothing renders haha.. guess you need hdrp 0.9

dull copper
#
## [Hybrid Rendering 0.4.1] - 2020-04-08

### Added (Hybrid V2)

* DisableRendering tag component for disabling rendering of entities

### Changed

* Improved hybrid.renderer landing document. Lots of new information.

### Fixed

* Fixed shadow mapping issues, especially when using the built-in renderer.

### Misc

* Highlighting additional changes introduced in `0.3.4-preview.24` which were not part of the previous changelogs, see below.
amber flicker
#

think dots editor is pretty much only the live conversion preview at the bottom of the gameobject? I still have access to livelink etc

coarse turtle
#

oh ok

wide fiber
#

I dont think Entities are serialized by default
@coarse turtle what do you mean? They are serializable inside IComponentData script, but they aren't inside MonoBehaviour :(

dull copper
#

dots editor is the dots subscene entity conversion preview + lets you add convert to entity through checkbox on top of property inspector

#

talking of which

#

they didn't update dots editor on this package dump

#

and it's broken with new entities package

mint iron
#

EntityCommandBuffer Playback now Bursted through function pointers πŸ”₯

zenith wyvern
#

* Added assembly for Mesh Deformation data structures. What does this mean

amber flicker
#

no dots editor and nothing rendering unless you get the packages off github (at least I assume that'll fix it).. another great well tested release 😏 ... hoping hdrp .9 shortly follows

coarse turtle
#

@wide fiber well I'm not sure if the Entity struct is serializable...? At least I'm not seeing that in the decompiled assembly

opaque ledge
#

yeah its not serializable, you can serialize the world thru serialization namespace most likely, something something entityremapper, never tried

coarse turtle
#

cool thanks @dull copper

warped trail
#

@amber flicker what do you mean, hdrp 9.0 is in package manager?πŸ€”

amber flicker
#

oh.. refreshed again and now it is... sweet

#

thanks πŸ‘

wide fiber
warped trail
#

this is not entity this is gameobject πŸ˜…

wide fiber
#

It only works inside IComponentData, not inside MonoBehaviour

opaque ledge
#

its not serialized, that happens because Unity creates the authoring automatically, and puts game object instead of entity

zenith wyvern
#

Did you take a picture of your monitor

wide fiber
#

this is not entity this is gameobject πŸ˜…
@warped trail ok sorry, I am stupid.. I was talking about GameObjects that get converted into entities sorry

opaque ledge
#

put Entity field on somewhere, you wont be able to see it on inspector

wide fiber
#

Yeah

#

put Entity field on somewhere, you wont be able to see it on inspector
@opaque ledge that's the problem

warped trail
#

why do you need Entity field in MB anyway?πŸ€”

opaque ledge
#

Dont you dare to bring logic to this πŸ‘€

#

I just wanted to say, you dont put Entity directly on inspector, you put gameobject and convert it πŸ™‚

fallow mason
opaque ledge
#

lmao

wide fiber
#

I was trying to put a reference to the camera inside a Singleton, but I think I will make the query in the systems where I need the camera (with a tag..)

opaque ledge
#

use singleton for MB access, use camera tag for ECS access

wide fiber
#

Okok

warped trail
#

what about creating special system which will provide camera's data to entities?πŸ€”

amber flicker
#

why everyting bloooooooom hdrp πŸ˜… - oh.. nope, new camera has helped.. still unbelievably buggy

wide fiber
#

what about creating special system which will provide camera's data to entities?πŸ€”
@warped trail I was thinking about performances, in that way I could make only a query for frame

#

Should I use SystemBase for every system?

zenith wyvern
#

Yes, other systems will be deprecated

warped trail
#

and what do you mean by query for frame?πŸ€”

wide fiber
#

Some Systems need a reference to the camera each frame, so I need to execute a query each frame (I don't want to cache the entity, it could change)

zenith wyvern
#

Hmm, is URP 9 not available yet?

#

In UPM I mean

coarse turtle
#

yea

bright sentinel
#

It wasn't yesterday

warped trail
#

it is available in package manager

coarse turtle
#

preview.14

opaque ledge
#

Library\PackageCache\com.unity.entities@0.9.0-preview.6\Unity.Scenes.Editor\BuildStepCreateResourceCatalog.cs(18,51): error CS0619: 'BuildStep' is obsolete: 'Replace with BuildStepBase. (RemovedAfter 2020-07-01)'

#

:/

zenith wyvern
#

Oh I see it shows up if you click the "see all version" arrow

#

I guess since it's preview

warped trail
#

@wide fiber i mean that you can create component like NeedCameraPosition and create system which will take camera position and copy it to every entity with NeedCameraPosition component

wide fiber
#

Well I don't need the camera, but the camera component (in some of the components where I need a reference to the camera)
But I don't think it will be a problem, or at least I hope

zenith wyvern
#

I don't think you should be using WithDeallocateOnJobCompletion if you're using Run. It doesn't really make sense since there's no job being scheduled

#

It looks like the error is related to that so try removing it

warped trail
#

you can use .Dispose(JobHandle)

zenith wyvern
#

There's no job. Just use Dispose

warped trail
#

and you there is .CalculateEntityCount() method in EntityQuery πŸ˜…

opaque ledge
#

@zenith wyvern is HDRP/URP 9.0 in preview ?

#

(since you said something like that)

zenith wyvern
#

Yeah, but you can still get it directly from UPM

#

Just click the little arrow beside it's name in the package list

opaque ledge
#

ah okay i will try to upgrade then

wide fiber
#

Ok

formal scaffold
#

Do I have this correct? ```cs
// Reset collision from prev. Frame
Entities.ForEach((ref ColAngle colAngle) => {
colAngle.Value = -1;
}).Schedule();

    // This ensures above is done first?
    Dependency.Complete();

    // Check for collision again.
    var collisionJob = new CollisionJob() {
        normals = normals,
        colAngles = colAngles,
        ltw = ltw
    }.Schedule(stepPhysicsWorld.Simulation, ref buildPhysicsWorld.PhysicsWorld, Dependency);

    collisionJob.Complete();
The first query is done before the second one starts?
coarse turtle
#

yeah since you're forcing the threads to complete before you schedule the second job on the main thread

zenith wyvern
#

You should just use Run instead of scheduling a job. Same result but you avoid the overhead

opaque ledge
#

uhh, why not just chain them ?

formal scaffold
#

What do you mean by chain? Anywhere I can read up on Schedule() and ScheduleParallell() and Run()? I have some questions like:
SystemA -> Uses ScheduleParallel()
SystemB -> Uses Run()

Will A run parallel next to B if I don't use complete()?

zenith wyvern
#

Whether it will run parallel depends on if there are dependencies between them, and what else the scheduler happens to be doing when System B runs

#

By chain he means just don't call complete.

#

Schedule the jobs one after another and let the jobs system do what it was designed to do

warped trail
#

from docsWhen you call Entities.ForEach.Run() the job scheduler completes all scheduled jobs that the system depends on before starting the ForEach iteration.

zenith wyvern
#

The whole point of the job system is that you shouldn't be worrying about what the scheduler is doing. You only need to worry about your dependencies

formal scaffold
#

By dependencies you mean which system updates which set of components and reducing overlap there, right?

zenith wyvern
#

Yes, properly declare your read/writes on your components and the framework will do most of the work for you

vagrant surge
#

@zenith wyvern i confirmed that checking the other day

#

its also why launching ecs systems is crazy hyperslow

#

couse it needs to check if all the inputs (component types) are safe to use

zenith wyvern
#

Hopefully they can improve some of the crazy overhead from systems managing dependencies internally, but I suppose there's always going to be a price to pay for having all these safety checks in place

#

Hybrid Renderer v2 seems promising, 250k dynamic entities takes a few ms to render in the editor, that was more than enough to bring it to it's knees before

#

Still not great but certainly better

vagrant surge
#

250k dynamic entities are no joke

#

on my own experiments, where i only render instanced cubes, it takes about 2 ms to render 300.000 cubes

zenith wyvern
#

I'm going to try adding instanced color data next and see how that goes

viral sonnet
#

entities 0.9 has appeared in the package manager ... still "offline" and unreachable so no changelogs

vagrant surge
#

wonder what they added

#

@zenith wyvern shouldnt be too much of a perf hit, given the design

#

the design, as i see it (from the comments and the likes) essentially memcopies the chunk data straight to gpu memory

#

and then uses it when rendering

vagrant surge
#
  • Improved performance of access to singletons through SetSingleton and GetSingleton in SystemBase (peformance is also improved through these methods on EntityQuery).
#

this is something i found on the Tiny racing demo that was much slower than what made sense to be

zenith wyvern
viral sonnet
#

@dull copper Thanks! Where did you get those?

dull copper
#

@viral sonnet each package has changelog.md at the root of the package

#

you can find all packages you've installed on your projects library/packagecache

#

same with local docs

warped trail
#

@zenith wyvern you want to change it via components?

viral sonnet
#

oh, so it's downloadable? didn't want to try, hehe

zenith wyvern
#

Yeah I found it in the shader graph, the checkbox is on custom properties now

viral sonnet
#

good to know

warped trail
#

there is special default components components

#

URP material property ....

zenith wyvern
#

Oh I see

#

@warped trail Thanks!

dull copper
#

btw

#

there's also a new platforms package but it's not compatible with the rest of the new dots packages

#
## [Platforms 0.3.0] - 2020-04-09

Build pipeline major overhaul: build pipelines are no longer asset based, and instead must be implemented in code by deriving from `BuildPipelineBase` class. Build steps are no longer mandatory but can still be used by deriving from `BuildStepBase`.

### Added
- New class `BuildPipelineBase` which is a class based replacement for `BuildPipeline` assets. Build steps can be used to organize build code, but is not mandatory anymore.
- New class `BuildStepBase` which is an optional replacement for now obsolete `BuildStep`.
- New class `BuildStepCollection` which represent a list of build steps that can be enumerated and executed.
- New class `BuildResult` and `RunResult` that derives from new base class `ResultBase`.
- New class `BuildProcess` which describe the state of an incremental build process.
- New class `RunContext` which holds the context when a pipeline is ran.
- Methods for querying build component values have been added to `ContextBase`.
- Methods for setting build component values are now available on `ContextBase`. Note that those values are only stored in memory; the build configuration asset is unchanged.
- New method `GetComponentOrDefault` on `BuildConfiguration` which returns the component value if found, otherwise a default instance of the component type without modifying the configuration.
- New method `GetComponentTypes` on `BuildConfiguration` which returns the flatten list of all component types from the configuration and its dependencies.
- New method `SetComponent` on `BuildConfiguration` that only takes a type and sets the component value to a default instance of the component type.
- New method `BuildIncremental` on `BuildPipelineBase` which can be used to implement build pipelines that run in background.
#
### Changed
- Class `BuildContext` now derives from new base class `ContextBase`.
- The `RequiredComponents` and `OptionalComponents` lists previously available on `BuildStep` have been replaced with the merged list `UsedComponents` on `BuildStepBase`.
- Methods `CanBuild` and `CanRun` on `BuildConfiguration` no longer expect an out string parameter, and instead return a `BoolResult` that contains the result and the reason.

### Deprecated
- Class `BuildPipeline` is now obsolete. It has been replaced by `BuildPipelineBase` which is no longer asset based. All build pipeline assets must be converted into a corresponding build pipeline class that derives from `BuildPipelineBase`.
- Class `BuildPipelineResult` is now obsolete. It has been replaced by `BuildResult`.
- Class `BuildStep` and `RunStep` are now obsolete. Class based build pipelines no longer enforce the use of build/run steps. Most interfaces and attributes related to `BuildStep` and `RunStep` are also obsolete.
- Class `BuildStepResult` and `RunStepResult` are now obsolete. They have been replaced by `BuildResult` and `RunResult` respectively.
- Property `BuildPipelineStatus` on `BuildContext` is now obsolete. `BuildPipelineResult` and `BuildStepResult` have been combined into `BuildResult`, removing the need for this intermediate status.

### Removed
- Removed optional mutator parameter on `BuildContext` class.```
#

I kinda liked the asset based setup myself

zenith wyvern
#

What the heck, the asset method was so much better

#

More inline with how SRP works now too

dull copper
#

yeah, it's a weird move

#

they must have had their reasons

hollow sorrel
#

wonder what reason they could have to replace it with code based

amber flicker
#

Weird...

opaque ledge
#

so platforms 0.3 is not supported for entities 0.9 right ?

#

i guess thats the error i was getting

hollow sorrel
#

you're on 0.9 already?

opaque ledge
#

yeah, but platforms 0.3 doesnt work

#

i gotta downgrade to 0.2.2

dull copper
#

0.2.2 works

zenith wyvern
#

Hybrid Renderer still doesn't do great with actual moving entities it seems. When I make my entities rotate the rendering system goes from ~3 ms to ~20ms from having to update renderbounds

coarse turtle
#

Hmmm - damn - I liked those build assets ):

zenith wyvern
#

Still with 250k entities

opaque ledge
#

i mean does it really mean anything tho, in reality you would have a culling and wont update out of camera stuff, i mean thats what happened to me at least

coarse turtle
#

Maybe they made the change from an asset to a script to better support CI/CD? πŸ€”

#

I was curious how to do CI/CD with the asset based one at one point in time - but just speculating

zenith wyvern
#

Doesn't seem like it does any automatic culling either, unless I'm missing something. Nothing changes if I turn off the camera

opaque ledge
#

yeah it doesnt, you gotta do manually, in changelog it says disablerender component works properly for v2 now

zenith wyvern
#

Ahh okay

opaque ledge
#

it helps a lot πŸ˜„

#

so ecb playback being burstable means sync point will take much less time then ? πŸ€”

vagrant surge
#

@zenith wyvern thats def not too good

#

updating render bounds should be faster than that

#

but still, try moving 250k objects in unreal XD

zenith wyvern
#

It's not that bad actually, I was misreading it. It forces the transform system to complete first so it counts that in the overall system timing. The actual render system jobs take around ~8 ms total for this case

#

And this is still in the editor

#

I tried a standalone build and I guess livelink broke it

vagrant surge
#

whats the sync overhead in standalone builds?

#

as you saw on the pics i sent, 90% of system time is job system checks

#

is it still that bad on standalone

zenith wyvern
#

I'm not sure, I can't profile standalone since it just gives an error about livelink as soon as the player starts and nothing happens

slim nebula
#

how do I cancel this. do I just terminate the process?

coarse turtle
#

that's what I do πŸ‘€

slim nebula
#

seems to have worked okay

#

entered play mode just fine the second time

glad solar
#

Funny... all the erros i got, solved by restarting unity.
It's the 5th time i restart unity and the erros is gone. The project runs fine without any change from before restarting it. πŸ˜…

fallow mason
#

anyone know what version of dots editor works with the latest entities and hybrid renderer?

#

getting 99 errors for dots editor

glad solar
#

@fallow mason check the dependecies.
I had a problem in the past that some packages dependecies conflicts with other packages dependecies. May not be this but check, just in case, y'know.

fallow mason
#

ah i see Timboc message earlier about removing. I'll try that

#

like a charm

mint iron
#

so we have hybrid renderer v2 now yes? with full URP support!?!?!

warped trail
#

i don't know about full URP supportπŸ˜•

zenith wyvern
#

Seems to be working as far as I can see

#

From reading the thread it seems like the lighting is still messed up

warped trail
#

am i the only one with broken light?πŸ€”

zenith wyvern
#

No, they are aware of it. Fix is coming in next entities version apparently

dull copper
#

full... no

#

but we have the packages now

warped trail
#

😒 Hybrid Renderer V2 will have URP lights support before end of the year

zenith wyvern
#

rip

dull copper
#

lights, who needs them πŸ€”

zenith wyvern
#

Ah the fixed lighting issue is for HDRP only, I see

#

Bummer

dull copper
#

they fixed the lighting issue on HDRP but it's not in this release

opaque ledge
#

i am getting EntityContainer error on 0.2.2 πŸ˜’

dull copper
#

DOTS editor isn't compatible

warped trail
#

which version of 0.2.2 are you using?πŸ˜…

opaque ledge
#

.7

#

is DOTS editor entity debugger ?

warped trail
#

Dots editor is a tool that show you what components your entity will get after conversion

opaque ledge
#

.. sounds useless then πŸ€”

mint iron
#

so the plan then would be to use HDRP until the end of the year then revert everything to URP?

dull copper
#

well, even HDRP support is iffy atm

#

altho I dunno if there are other major issues atm than the lighting intensity being off

loud matrix
#

@wide fiber Thanks for the reply, Unfortunately every other entity is pure ECS, only reason my camera is being converted is I can't find a way to make a pure ECS camera.

naive parrot
#

is it necessary to set [ReadyOnly]/[WriteOnly] attributes for ArchetypeChunkComponentType in a Job when the method GetArchetypeChunkComponentType<>( isReadyOnly ) already does it in function ?

slim nebula
#

anyone have ideas on how to fix buildstep related errors after updating to entities 0.9.0?

opaque ledge
#

are you using platforms 0.3 ?

naive parrot
#

how do u get 0.9? πŸ€”

#

is it out?

#

cant see docs

opaque ledge
#

yeah its out

slim nebula
#

yes. should I not be using platforms 0.3?

#

tried downgrading to 0.2.2 but ended up with even more errors

opaque ledge
#

yeah i had to downgrade to 0.2.2-7 and remove dots editor package

slim nebula
#

ok

#

is dots editor not needed?????

#

is that JUST the entity conversion preview?

opaque ledge
#

apperantly something about.. yeah

slim nebula
#

so I still get the entitiy debugger without dots editor?

opaque ledge
#

which i dont need so

#

yeah, you get entity debugger

mint iron
#

look at everyon salivating at the bit

opaque ledge
#

dots editor is just for live conversation helper i think

slim nebula
#

kk

#

thanks!!!

#

0.2.2-9 seems to work too. just had to remove dots editor

opaque ledge
#

πŸ‘

#

0.3 still doesnt work tho, i think

#

because it was giving error for entities 0.9

slim nebula
#

I can confirm that. tried it and 0.3 still broke even without dots editor

formal scaffold
#

Hmm so I find myself adding more and more components to my Player, like Speed, JumpHeight, a bunch of Attributes later on. I get the feeling that as my project is growing, so does the count of components. Is that just the normal way of doing it?

vagrant surge
#

yes

mint iron
#

I think thats the way it goes, you want lots of small components so that when you selectively use them, they're not bringing lots of baggage with them that isnt used

vagrant surge
#

but for individual attributes like that, its most common to have them bundled a bit more

#

like, if you allways use speed and jump height, and there arent cases where you have one but not the other, then have them together

#

biggest lunacy ive seen was one guy on the Entitas github commenting he had 3000 components

#

but common games go from few dozen to maybe a hundred or two

formal scaffold
#

Cool thanks for the Input, nice to hear that I'm on the right track, thanks

winter depot
#

Just trying to confirm, using .WithBurst() is not necessary unless you are modifying burst options, otherwise this is automatically implied correct?

finite ibex
#

has anyone come across or created polygons by code in ECS? I don't know which elements to use. Mesh? Mesh filter? All I want to do is draw a square by code

#

not sure what to google to get me help

naive parrot
#

if you are just starting with ECS , better to just get hang of basic principles first. if you have done procedural meshes before then , there are native Mesh APIs now afaik to use in Jobs from ECS or even non ECS code.

#

GetNative*()

#

are the ones you should be looking at

#

@finite ibex

#

this is not something DOTS specific but for complex procedural meshes obviously you can gain lots of speedup

eternal ice
#

Is there a way to add the MeshRenderer group as hybrid components also tell them to make a static mesh?

finite ibex
#

ty @naive parrot! I'm sure something there will guide me

naive parrot
#

where did EndPresentationEntityCommandBufferSystem go ?! πŸ€”

#

doesnt seem to be present in 0.8

zenith wyvern
#

They removed it. I guess you can use BeginInit instead

naive parrot
#

thats what i have been using. just noticed that. has been gone since 0.3 apparently but docs manual still dont reflect

#

docs team really not doing a decent job keep the stuff in sync with all the changes.

mint iron
#

@winter depot correct, it uses burst by default if you don't specify something that would prevent it (StructuralChanges, WithoutBurst etc)

winter depot
#

Thank you @mint iron

naive parrot
#

why does entity debugger shows weird values for chunk components?

#

calculations turn out all fine but debugger is definitely not showing those values

opaque escarp
#

has anyone successfully used WithNativeDisableContainerSafetyRestriction on a DynamicBuffer, gotten through GetBufferFromEntity?
I've tried the exact same stuff but with components instead of dynamic buffers, and it works fine, but as soon as I start using DynamicBuffers I get the traditional same type error

lusty otter
#

I have an array of objects that I want entities to process on main thread, I can either do

  1. a simple foreach loop through the array, and for each object in the array I do Entities.ForEach
  2. an EntityQuery to get all the entities, then Job.WithCode and loop through the array and entities inside
    Which one is better or there is no real difference?
zenith wyvern
#

Hard to say without more context. Can you give a little more detail about what you're doing? @lusty otter

lusty otter
#

So I'm making a scriptable rhythm game and entities with TouchComponent want to process touches.

#

The array of objects here being the touches.

#

Because I want to loop these touches in a certain order (order of their time) so it has to be the outer loop, so I can't do Entities.ForEach then loop touches inside.

zenith wyvern
#

So your array of touches is being processed by every entity then? Can you do ToComponentDataArray<Touch>(), sort that, then pass it it into a single ForEach of your TouchComponents?

lusty otter
#

Ah I didn't make it clear enough, I want to have it that way (touches being the outer loop, entities being the inner loop, and everything not in parallel) for logical reasons.

#

Things like an entity processing the 2nd touch will know that 1st touch has been processed by all entities already, and it can ask them about results of it.

zenith wyvern
#

Well, if everything is on the main thread anyways then I guess there's no scheduling overhead to worry about so it shouldn't matter if you're doing a bunch of ForEachs. I would go with whatever is more readable, which it sounds like maybe the first option is

wide fiber
#

Can I make a System that runs every 100ms (for example) like InvokeRepeating?
I want it to be "Frame rate indipendent", if a frame takes 200 ms, I want it to be called 2 times (like InvokeRepeating)

warped trail
#

@wide fiber yes you can do this

#

but you have to use system group for thatπŸ€”

wide fiber
#

Ah ok

zenith wyvern
#

Isn't that basically what FixedRateUtils does?

wide fiber
#

Without system groups would be better

warped trail
#

yes, but it is for systemgroup

lusty otter
#

Thanks Sark.

wide fiber
#

So I have to make a different group for every system that has a different timestep

zenith wyvern
#

Or just [DisableAutoCreation] on your systems and have a system that runs every frame and manually updates them as needed

wide fiber
#

I want it to be "Frame rate indipendent", if a frame takes 200ms and the system needs to update every 100ms, I want it to be called 2 times (like InvokeRepeating)

zenith wyvern
#

Then yeah it sounds like you want to use FixedRateUtils. It has "EnabledFixedRateWithCatchup" which does exactly that

wide fiber
#

I could make a system that runs every 2ms and that has a list of all the systems (and their time step) and it updates the correct one based on the time

#

Then yeah it sounds like you want to use FixedRateUtils. It has "EnabledFixedRateWithCatchup" which does exactly that
@zenith wyvern yeah

lusty otter
#

Actually, shouldn't the second solution be better?

#

For first solution, each ForEach would need to query a list of entities and get their components for every outer loop

#

But second solution just does it once at the start and that's all.

zenith wyvern
#

I was assuming there would not be a ton of these touches to process, so I was more worried about readability with my suggestion

#

If you're worried about performance then yeah option two would definitely scale better

lusty otter
#

Okay I'll go with that then

#

I can stomach a bit of not so nice looking code, I guess.

#

πŸ˜‚

opaque ledge
#

@opaque escarp You cant have same type in both ComponentDataFromEntity/BufferFromEntity and ForEach query, you have to remove from ForEach query and query for Entity, and access entity's component/buffer like that

zenith wyvern
#

Has anyone actually tried using FixedRateUtils? I was just trying it out and It doesn't seem to work for me at all.

#

EnableFixedRateSimple seems to do nothing, EnableFixedRateWithCatchUp just causes the editor to lock up as soon as I press play

opaque escarp
#

@opaque ledge You are able to do it with ComponentData provided you use the disable safety restrictions and for restrictions. The patch notes also said that the ability to use them on collections was added at one point, so I assume it not working was a bug and submitted a report

opaque ledge
#

Yeah Sark, Druid tried it on but he said it wasnt working properly, or he was doing something wrong πŸ˜„

#

@opaque escarp can you post the error ?

opaque escarp
#

It's the error you'd expect, can't do stuff to arrays of the same type, that you'd use the restriction disabling for normally

opaque ledge
#

well when i encoutered that error i always 'convert' to what i said, so i dont know

zenith wyvern
#

It looks like EnableFixedRateSimple does affect the Time.ElapsedTime (and probably dt by extension) that gets reported to that system, but the system still gets updated every frame regardless. Bah

opaque escarp
#

well see, pretty sure it's a bug. As you say though, there are ways around it, Thank you

wide fiber
#

It looks like EnableFixedRateSimple does affect the Time.ElapsedTime (and probably dt by extension) that gets reported to that system, but the system still gets updated every frame regardless. Bah
@zenith wyvern Sorry if the question may be stupid, but at line 10 it gives me the error: https://pastebin.com/W89S5ZCH

zenith wyvern
#

Yeah it wants the actual SystemGroup, not the type. So you would have to do something like World.GetOrCreateSystem<Group2MSFixedUpdate>() instead of passing the type

wide fiber
#

Ok

zenith wyvern
wide fiber
#

Ok

#

Yeah, the Unity Editor is freezed when I hit the play button

warped trail
#

because EnableFixedRateWithCatchup is bugged πŸ˜…

#

this thing is hilarious, as if they don't test things at all

lusty otter
#

About editor freezing, I have a script interpreter inside bursted jobs and it freezes all the time.

#

But it runs fine on an actual build.

#

Luckily I can just comment out a bunch of unused interpreted functions during development, which reduces the size and somehow that prevents editor from freezing.

#

I guess it's early development so these are to be expected, but I really didn't expect these many issues πŸ˜…

warped trail
junior fjord
#

does there exist something for nativearray serialization?

wide fiber
#

Ok ty
@warped trail

scarlet inlet
#

Hello, does this code make sense to you to compute the innerloopBatchCount of a parallel job schedule or I got it wrong?

vagrant surge
#

nope

#

gotta round up

#

couse int division doesnt have remainder

#

check it out, per-batch is 3, 3*4 is 12

#

total work 13

scarlet inlet
#

I am not sure how the innerloopBatchCount is used internally

#

my assumption is that it shoudl work with any value > 0 regardless the total number of iterations

#

the code should work out the optimal number of threads to use anyway?

#

in fact I don't even understand why unity doesn't compute the optimal value itself

junior fjord
#

I think because of the rounding in your case you could get processorCount + 1 Batches instead of processorCount many

#

that is what vblanco means

#

if I understand it correctly

scarlet inlet
#

why should it matter anyway

#

?

#

let's put the question in another way. if I have a total number of iterations < 16, but I return as iterationsPerBatch 16, this should not matter right? Iteration per batch is just a hint isn't it?

formal scaffold
#

Been looking into slopes for my character controller. When transitioning from walking up a slope to walking down there will always be an error in which the movement of the player is faster than the gravity pushing him down. I researched a few solutions and what it comes down to is a simple cs croll(right, slopeNormal)

But there is still the initial error in which the player lifts off the ground. My solution would be to account for that and alter the players Position accordingly, I could also increase the gravity until I am grounded again.

I read here a while ago that setting the position directly will cause the Physics System to redraw all colliders. I wonder where I can do some reading on that? How would you tackle the problem?

scarlet inlet
#

because if it's not I don't understand it

junior fjord
#

well if they all take approximately the same time and start at the same time, then that would double your full time it takes

#

it seems that dynamicbuffer can actually allocate outside of the internal capacity in case you use .Add

            var adjustedCount = Math.Max(kMinimumCapacity, Math.Max(2 * header->Capacity, count)); // stop pathological performance of ++Capacity allocating every time, tiny Capacities

They always double the capacity when you call add and there is not enough space, this is normal for these kind of data structures, but in this case they don't recheck if they are overshooting the internalcapacity with this

#

just thought this is interesting to know since I used Add up to know pretty often, but if you want to stay inside the internal capacity you probably need to resize and treat it as an array

stone osprey
#

What is the easiest way to spawn in cubes with the entity component system ?

junior fjord
#

@stone osprey

stone osprey
#

Thanks ! Is there a easy way to instantiate and convert a gamobject in code ?

#

I only saw examples where you need to attach monos to those prefabs...

#

And those are required in scene already

junior fjord
#

let's put the question in another way. if I have a total number of iterations < 16, but I return as iterationsPerBatch 16, this should not matter right? Iteration per batch is just a hint isn't it?
@scarlet inlet it only returns 16 if the total iteration per batch is less then 16, not if the total number of iterations is < 16. If the total number if iterations is < 16 it would also return 16

stone osprey
#

Is there a way to spawn in prefabs and than convert them into entites ?

junior fjord
#

yes there is a easy command but I don't know it since I never use it

scarlet inlet
#

@scarlet inlet it only returns 16 if the total iteration per batch is less then 16, not if the total number of iterations is < 16. If the total number if iterations is < 16 it would also return 16
@junior fjord I know, the question is, does it matter for the parallel schedule?

junior fjord
#

sorry I don't understand that question

stone osprey
#

@junior fjord Any idea how to find that class/method for spawning in prefabs as entites easily ?

scarlet inlet
#

sorry I don't understand that question
@junior fjord never mind I'll do some experiments. I am still trying to understand why I should suggest the innterbatchcount since Unity should be able to figure out itself

junior fjord
#

it seems like you instantiate your first entity from a prefab and then just clone that

stone osprey
#

@junior fjord Hmm.... and how do i instantiate a entity from a prefab in a easy way from code ? I dont want to use any monos etc.

warped trail
#

convert your prefab to entity and store this entity somewhere

junior fjord
#

you only need to create one gameobject and add the convert to entity script or not? But I am really not the expert on that, I haven't done it in ages

warped trail
#

you can create entity which will store every prefab in some component

#

something like thiscs public struct PrefabReferences : IComponentData { public Entity SmokePrefab; public Entity BulletPrefab; }

vagrant surge
#

@scarlet inlet 16 per batch can be low

#

generally wheh batching a parallel for you want both caps on the low end and the high end

#

to not launch a thousand tasks

stone osprey
#

Yeah but what if i want to instantiate that prefab from a script ? How do i convert it to a entity without attaching that convert mono ?

warped trail
#

you use DeclareReferencedPrefabs

#

put this on you Entity storagecs [GenerateAuthoringComponent] public struct PrefabReferences : IComponentData { public Entity SmokePrefab; public Entity BulletPrefab; }

#

and put your prefabs there

junior fjord
#

oh, if you clear a dynamicbuffer, it does not revert to its internal storage if it was pointing outside before?

#

that thing is full of surprises for me πŸ˜„

stone osprey
#

Thanks ! What if i have about 100 different prefabs ? Isnt there a way to do something like this ? "GameObject test = Instantiate(reference); Entity entity = Conversion(test); )

#

So i instantiate that damn prefab from code and convert it via code ?

junior fjord
#

if you want the dynamicbuffer to move back to its internal storage in case it was to large before you have to call clear and trimexcess

stone osprey
#

So how do i spawn in a prefab from code and convert it into a entity within the same line ?

warped trail
#

@stone osprey i don't think that this is recommended wayπŸ€”

#

i think they plan to remove runtime conversion πŸ€”

#

you can use DynamicBuffer instead of component

stone osprey
#

Ok well... so i have the following problem... each "Monster" in my game... ( 100 prefabs ) each one having one mesh, material, animations and a healthbar above... all i want is to convert this shit into a entity... that cant be that hard right ? Pure ecs is not possible i guess due to the animations and the healthbar

mint iron
#

Before i would have directed you to runtime conversion but they've said unofficially (one devs comment in this channel) that runtime conversion is not supported. That leaves three options, 1) do it anyway and risk it all breaking later. 2) Come up with your own system to make the entities and then slap a Prefab component on them. 3) Add them in a subscene with a converter that attaches a prefab tag, then they'll show up as prefabs when the subscene is loaded. If you want then, you can index them in a hashmap or whatever so that systems can find the one they need.

stone osprey
#

Thanks ! πŸ™‚ So i could either use prefabs for visuals and use the ecs for the data oriented part... the entities would just have a component with a reference to the spawned prefab... or i could write my own implementation ?

mint iron
#

do be clear there's no interop between entity prefabs and MB world in this scenario. You setup your MBs like normal as prefabs, but the subscene converts them into pure ECS and the MBs dont exist anymore. (ignoring livelink since it won't work in an instantiated prefab situation)

#

But you're right in that the normal MB/Mesh/Material/Prefab setup can be configured in the editor to define what things look like.

stone osprey
#

Alright... is there a other way ? The only reason i choosed prefabs is the attachment of animations and the healthbar... but im not sure if i could draw a healthbar with ecs

mint iron
#

not that im ware of, maybe someone else has tried more in that area and can chime in.

stiff skiff
#

We use gameobjects backed by ECS (keeping the gameobjects)

#

Its not great, but it works

stone osprey
#

@stiff skiff So ecs for the data structure and gameobjects for visuals like healthbars ?

stiff skiff
#

That, and monobehaviours, yes

naive parrot
#

ecs for simulation , gameobjects for presentation.

#

the only sane combo.

#

atm

stiff skiff
#

Not really, you can use monobehaviours for "simulation" just fine

naive parrot
#

i mean if you really have to use ECS

#

in contrast to 'pure' ECS

stiff skiff
#

Just wont be as fast, but often thats not an issue

naive parrot
#

mono/go work just fine for most thing. unity is all about that for most part.

#

i personally am using unity's ecs for its architectural benefits rather than performance speedups.

stiff skiff
#

Same

#

We've used it to get a clearer "loop" by using the playerloop stuff that ECS uses

stone osprey
#

Alright thanks ! I guess we are going with a mix between ecs and gameobjects πŸ™‚

naive parrot
#

decoupling logic from data is no brainer in complex projects. ecs does it nicely.

stiff skiff
#

Things are almost all written in monobehaviours, but if we see a performance issue in part of that, we move only that bit over to ECS

stone osprey
#

Btw... does anyone knows how the hell i set the rotation of a entity ? I wanna set a entity mesh to a rotation of 90 dregrees x axis

stiff skiff
#

Its much easier to work this way without the developers suddenly having to learn a new way of working

#

Sadly not all of this is smooth, due to the ECS closing off quite a bit of their API. Making it a little hard to bend to my needs

naive parrot
#

yep , having only performance critical sims part of codebase is the clear candidate for ecs atm , even down the line when DOTS all round has matured more

safe lintel
#

RotationEulerXyz or similar components @stone osprey

naive parrot
#

@stone osprey whats the issue? access Rotation component and set value calculated using math lib

stone osprey
#

we tried value = queternion.RotateX(90); that didnt worked... but we didnt used that math lib either

dull copper
#

I'm still bit puzzled about Unitys design on the dots safety checks + unity physics

naive parrot
dull copper
#

like, right now if you run physics 50Hz and render 200+ fps, you get warnings that things took too long and it deallocated your tempjobs

#

running physics at fixed timesteps is how this is designed to run even

#

so it feels just so... shortsighted

naive parrot
#

tempjobs are 4 frames long arent they..

dull copper
#

apparently yes

#

because I see this happen πŸ˜„

#

I'm rendering ~200fps in editor

#

and see this only when fixed timestep is 0.02 (50Hz)

warped trail
#

and if you run physics at 50 hz but your game runs at 300 fps it is kinda problematicπŸ˜…

dull copper
#

basically you'd need to lock the max framerate based on your physics stepping value

#

never let it go past 4x your physics speed

warped trail
#

does it deallocate stuff at runtime?πŸ€”

dull copper
#

I don't really have an issue with this myself as I want to run physics at least 100Hz, so soft locking the frames to 400fps is not likely going to cause any issues, especially with HDRP where you don't even reach such framerates until you got 2080Ti and empty scene πŸ˜„

#

I dunno about that either

#

if it works at build, then it's not a huge issue

#

but it's not nice that it does that in the editor still

naive parrot
#

wouldnt 4x of 50hz be 200fps locked ?πŸ€”

dull copper
#

yes

warped trail
#

i update mine at 48hzπŸ˜…

dull copper
#

technically you should always update at lowest speed things still behave well

naive parrot
#

masterrace aside , whats the end user advantage having that high of frame rate ?

warped trail
#

at 24 while testing thingsπŸ€”

naive parrot
#

other of course having reference benchmark for how fast your simulation can go

#

you gotta draw the line somewhere anyway

warped trail
#

there is monitors with 300+ refresh ratesπŸ€”

dull copper
#

yup

#

360Hz

naive parrot
#

are there games that can do 360 ?! no the 2D ones i mean

#

doom eternal i know of

dull copper
#

those monitors are 1080p

#

so it helps a bit

#

pretty sure doing 360 on CSS is nonisssue with current hardware

#

and those monitors are made for CSS

warped trail
#

i guess main idea is to decouple physics from framerate

#

things should work no matter the framerateπŸ€”

naive parrot
#

doubt its that straightforward or practical

dull copper
#

yeah, that would be the idea case

#

well, it should be

#

if your simulation code is decoupled from rendering, you can render at any speed monitor supports

#

or just how fast the gpu can handle it

naive parrot
#

is the physics deallocation issues valid for havoc as well?

warped trail
#

if it is not, then welcome to jitterlandπŸ˜‚

dull copper
#

I don't really know if it's a real issue

#

but we do get the warning spam in the editor

warped trail
#

havok is just simulation part

#

they have they own world πŸ€”

dull copper
#

these slides don't really tell how the queries work though

#

if the queries work on direct ECS data, then it'll mean a lot of potential gains will be wasted on Havok

#

but I don't really know how this is structured

#

(there are gains to be had if you have cache on physics engine even for queries (raycasts, sweeps)

warped trail
#

raycasts and queries are not part of havok

dull copper
#

then again, Unity specifically said that even Unity Physics is really performant on queries specifically

vagrant surge
#

this sort of design can be pretty good on queries

dull copper
#

I have not done brute force testing on it yet

#

so can't really talk from experience

vagrant surge
#

for unreal i had to create my own physics for some types of queries

#

as having colliders would be too slow

dull copper
#

I know physx can do sh*tloads of short queries and you don't even notice

vagrant surge
#

the problem in places like unreal, is that all the memory for the queries will be cold in cache

#

vs doing queries from ecs

#

in ECS, you generally are calculating X amount of objects at once, and having a loop that does little more than spam a fuckton of queries

#

so all the inner structures are hot in cache, getting massive gains

dull copper
#

For any physics features that do not cache state, e.g. raw collision queries, we expect the performance of Unity Physics to be on par with, or outperform, similar functionality from commercially available physics engines.

vagrant surge
#

in oop arch (monobehaviors/unreal), beetween ray and ray, you are doing a ton of other random stuff, on many random objects, so by the time you raycast again, it will be cold in cache

#

@dull copper unity has a big advantage for something like this. It can keep the acceleration structure for the static entities built

#

and only build octree/bvh/grid for dynamic entities

#

and only per-chunk

#

so you can get some crazy fast rays like that

opaque ledge
#

4k raycast is taking around 8-10 ms for me, that good ? πŸ‘€

vagrant surge
#

no

#

not at all

dull copper
#

I guess it depends on the raycasts too

vagrant surge
#

would need to be some worst case scenario rays

dull copper
#

if they are short distance, it's not great

stone osprey
#

I wanted to create a component which stores a reference to a gameobject which acts as the visual representation for a entity... any idea if i missed something ? public struct GameObjectComponent : ISharedComponentData { public GameObject representation; }

opaque ledge
#

distance is 300 i think, and with proper filters as well

mint iron
#

thought u were talking about coronavirus for a second there

fallow mason
#

Distance is 6 with N95 filters

#

Well, Unity's units are meters aren't they? So maybe just 2.

vagrant surge
#

well 300 meters of rays is a bit too much xD

#

and 4k

#

if they go across the map thats fairly worst-case

opaque ledge
#

why would length of the ray affect the performance ? i mean.. isnt ray just a line, so behind the scenes Unity would just run some basic geometery functions for lines and AABB checks ?

#

But yeah i will try to lower to 50-100 later on, right now i am not working on it however

vagrant surge
#

because the longer the ray is, the more stuff it has to traverse

#

on unreal engine RTX ambient occlusion implementation, it becomes straight up a slider of how fast the effect is

#

there is a 3x-4x delta depending on how long the AO rays are

#

on short rays (basically like SSAO but higher quality), its pretty cheap, barely more than SSAO, but if you have several meter-long rays, it becomes 2x,3x slower than ssao

opaque ledge
#

hmm πŸ€”

dull copper
#

most of my queries are like under 1m in world

#

as a side note, I was wondering (again) why the physics perf is so much worse in the editor (even with all safety checks off)

#

it was the bloody physics debugger script.. I should have known this as I've stumbled to this few times already in past

#

it just doesn't scale at all

#

with 30 dots based vehicles, my game cost like 70ms / frame for cpu in the editor

#

on actual build it's ~4.5ms

#

it does make sense, just wish some day we get more performant dots debug draws

warped trail
#

it uses OnDrawGizmos

dull copper
#

I'm also limiting workers to 1 on my testing atm

#

but that doesn't affect the physics debugging as it can only run on main thread anyway

#

hmmm, debug draws themselves can run on jobs on 2020.1 tho

#

just not bursted

warped trail
#

im using their DebugStream to draw my stuff too πŸ˜…

dull copper
#

I know the custom solutions, like the one @mint iron made

warped trail
#

they use native stream

dull copper
#

it's just, it's enough pain to maintain your own code right now

warped trail
#

and draw everything in 1 gameobject

dull copper
#

then maintain custom physics debugger on top

#

using havok visual debugger didn't make things any simpler, it practically froze the rendering on the editor fully even on simpler scene

#

I must use it wrong as it can't be that bad

#

or maybe it should be used only in actual build etc

#

actually, I'll just try that now

stone osprey
#

Entities.ForEach not possible with SharedComponents ? Created a custom SharedComponent and it tells me that this operation is not possible with my component

warped trail
#

they allocate nativestreams and then deallocate them in next frame, from here you get your warnings πŸ˜…

#

you can use sharedComponents with Run

stone osprey
#

When i remove ref, it works... any idea why my shared data component is not acceptable by reference ?

#

Run ?

warped trail
#

.Run() on main thread

#

instead of .Schedule()

stone osprey
#

You mean on the system that processes those components ?

warped trail
#

Entities.ForEach().Run()

stone osprey
#

Are you sure ? I cant attach that method call after foreach

dull copper
#

the havok visual debugger itself seems to have smooth physics

#

but rendering stalls to 2fps on build when it's attached πŸ˜„

#

I must do something very wrong with this

#

(just tested with IL2CPP build)

#

they allocate nativestreams and then deallocate them in next frame, from here you get your warnings πŸ˜…
@warped trail oh wow, now I feel stupid again πŸ˜„

#

well, at least it gives more confidence on the actual physics sim

stone osprey
#

Is there anyway how i can multithread SharedComponentsData ?

mint iron
#

yeah thats why i rotate and re-used NativeStream instead of allocating a new one every frame, but to do that the clear method i wrote still has to do far too much work. I should probably re-write it and make it a package.

warped trail
#

so you can't reuse nativestream by default?πŸ€”

mint iron
#

correct

low oasis
#

What the crap does the DOTS Editor package for? The description is infuriatingly vague about what it actually does

warped trail
#

it will hold new entity debugger in the future πŸ˜‚

stone osprey
#

Lets say each entity has a gameobject ( visual representation ), how would you make that gameobject follow a entity translation ?

low oasis
#

DOTS Editor causes compile errors with Platform and Entities updates. So I can remove DOTS Editor, but I don't know what the crap it actually did in the first place

zenith wyvern
#

Is there anyway how i can multithread SharedComponentsData ?
@stone osprey

Nope. SharedComponentData is main thread only.

#

You can change them using command buffers though. Just be aware that every time you change a SCD it's a structural change

stone osprey
#

Thanks ! Im doing a hybdrid between gameobject and dots, because each of our monster prefabs comes along with stuff like healthbars etc... :/ hoped theres a way to move gameobjects using jobs

zenith wyvern
#

I think that's what HybridComponents will do....I don't know if they're recommended to use yet though

#

Read about hybrid components in that article, should give you a better idea of how to approach it

stone osprey
#

Thanks ! πŸ˜„ Not sure if im able to convert my prefabs properly... but im gonna take a look at that

safe lintel
#

AFAIK shows the live entity conversion stuff @low oasis

dull copper
#

@low oasis DOTS editor hasn't been updated for the new dots packages, hence the errors

#

you don't need it

#

it provides entites live conversion preview if you use DOTS subscene

#

and has checkbox on top of property inspector so that you can add convert to entity script to them with a single click (or remove it )

#

official description is: Provides data analysis and visualization tools that are built on top of the ECS architecture.

low oasis
#

so convenience functionality for stuff you can do manually (add the script)?

stone osprey
#

No idea what component couldnt get converted

dull copper
#

@low oasis it's mainly about visualizing the entity conversion

#

the script adding is just extra convenience tool, yes

low oasis
#

good to know. Don't need it then. That description is pretty much useless. Maybe if they added some screenshots of what it actually does right now. 🀷

mint iron
dull copper
#

@low oasis it's not useless, it would actually be aweseome if we could use it more

stone osprey
#

Thanks ! πŸ™‚ Im gonna take a look at this

dull copper
#

basically you can see the entity conversion and componentdata in real time there

#

without having to use the clunky entity debugger

#

it's just.. it only works in dots subscenes

mint iron
#

Unexpected exception Burst.Compiler.IL.Aot.AotLinkerException: The native link step failed Error while executing command: C:\...PackageCache\com.unity.burst@1.3.0-preview.7\.Runtime\hostwin\lld -flavor link getting this after upgrading, anyone seen it before?

loud matrix
#

Ok, I've spent a few days headbutting a brick wall with this issue and I can't find an elegant solution.
I have a camera that's being converted to an entity and it has a component that handles what entity it should follow.
Every other entity is being made with pure ECS when the games bootstrap script runs.
I can't find a good way to link these together without adding extra components just to "name" my entities or running through every single shop / camera to find one with a certain variable set. that just feels very wrong on both cases.
The best idea I currently have is to maybe setup events, fire off an event for change camera target to X entity on X camera, but that will still require me to ID the cameras somehow.
Does anyone have any suggestions for how to do this in a half decent way?

dull copper
#

@mint iron that is bit old burst already, maybe worth bumping it to preview.9?

mint iron
#

hmmm i just added preview9, must be using old package, ill restart. Some sort of warning about what is required to make the upgrade function, would make this process easier you'd think.

dull copper
#

they released .9 along with the other new dots packages

#

yeah, burst requires restart afaik

low oasis
#

I usually have to turn off burst, restart and turn it back on to get the cache to not error

#

otherwise it complains about files in the windows tmp directory

dull copper
#

you mean when you upgrade it?

low oasis
#

but unclear on how to manually wipe the cache

dull copper
#

it should sort itself out on editor restart when you upgrade it

#

I often just bump the burst version to new directly from the manifest.json so it can load the new package right on startup

low oasis
#

upgrading the burst package has, so far, always generated errors about files in the Windows tmp directory, I'm guessing cache

mint iron
#

yeah im just grumping that its a bad user experience, if they know it requires a restart, then tell the user about it. I'm sure its hidden in some document somewhere but it needs to be prominent or every single person is going to hit this, wtf is going on stage.

zenith wyvern
#

Yeah when you upgrade burst you need to restart the editor, it's a known issue

dull copper
#

yeah, I agree it should have some warning

low oasis
#

it sometimes works to just restart, but I've found it just works better to turn it off, restart, turn it on 🀷

#

or it did anyway, maybe that has been resolved

#

one of those processes that you get used to because it works

#

but may no longer be necessary

mint iron
zenith wyvern
#

@loud matrix You're trying to have a camera follow an entity that you've created at runtime, is that right?

loud matrix
#

Yes

#

The following is easy, but assigning it and being able to change it, not so much

zenith wyvern
#

Still trying to parse the problem, you have multiple cameras so you can't figure out how to get a reference to the right one?

loud matrix
#

At the moment I have a single main camera that's a game object being converted to an entity (as far as I'm aware I can;t make camera with pure ECS)
I need to assign the currently active ship (player controlled) to the cameras follow component at the start of the game, in such a way that it can be easily changed.
The only way i can see to do this is to add a system that loops ships and if it has the "player controlled" variable set to true change the cameras target entity. which wouldn;t be great as it would need to run through every frame on every ship.
The only other way I was thinking to handle it would be with events but I've not fully wrapped my head around them in ECS yet.
I'm thinking I'm probably missing something up by having a variable be what dictates the player controlled ship but as it needs to change I can;t see another way.

zenith wyvern
#

So you have something like

struct Ship : IComponentData
{
  public bool _playerControlled;
}

Is that right? You definitely want to just have a Player component that marks which entity is your player so you can easily query for that

#

Then you could do something like

class PlayerFollowSystem : SystemBase
{
  var playerEntity = GetSingletonEntity<Player>();
  var posFromEntity = GetComponentDataFromEntity<Translation>(true);
  // Can't use burst or jobs since it's referencing a monobehaviour
  Entities.WithoutBurst().ForEach((Camera cam, ref Rotation rot)=>
  {
    var playerPos = posFromEntity[playerEntity];
    // Go from here
  }).Run();
}
#

Just one way to do it

#

That will easily handle the case where the player changes at runtime

loud matrix
#

Ahh right, I have currently been adding the player controll to all entities

#

so I'd have had to iterate through them to find the one set to active

zenith wyvern
#

Yeah you definitely want to just have a player component so you can easily build your player-related systems around that component

loud matrix
#

The main issue I'm having I think is how to tell a camera when to change entity. I currently have

struct CameraFollowEntity : IComponentData
{
    public Entity Value;
}

For deciding what Entity needs to be the target, and when set currently camera just sets its self to their position and rotation with an offset.

mint iron
#

So you want to be able to detect when the active ship changes, and update the camera target then, rather than checking it every frame somewhere.

loud matrix
#

Ideally yeah, as I'm thinking of having multiple cameras trailing multiple ships eventually.

mint iron
#

honestly it seems to be a gap in ECS i dont fully understand, the obvious solution to me is some form of event that triggers other logic. I'd love to know what the real recommended DOD mindset solution is. Because to me, just do everything every frame because its super fast anyway is not good enough.

loud matrix
#

Events were my recent idea, but I only just started looking into them, and I'm so sued to ultra simple JavaScript evets that doing them in Unity is a bit of a mind twister. So I was hoping to find out if it was a viable solution before diving deep.

zenith wyvern
#

An event sounds like the right solution

formal scaffold
#

So >_> I'm too dumb to understand this. The "Start" and "End" in RaycastInput refer to a "Start Position" and an "End Position", meaning the "End Position" is NOT relative and an actual Position in World Space. Right?

zenith wyvern
#
struct CameraChangeEvent : IComponentData
{
  public Entity oldTarget;
  public Entity newTarget;
  public Entity cameraEntity;
}

Then create a ForEach to handle that component and destroy it after handling

warped trail
#

if your entity does not need to know that it is being selected, maybe you can store that information somewhere else?πŸ€”

loud matrix
#

Thanks, I'll have a dive into events further. I remember seeing a code monkey video on the topic a while back.

zenith wyvern
#

Just try to keep it simple, it's already a lot of boilerplate as is. You don't even need a new system to handle it, you can just add the foreach to your camera follow system

warped trail
#

like special entity with component like this, and you can get its current position via cdfe and you don't have to move real entity from chunk to chunkπŸ€” cs struct ThisIsSelectedRighNow : IComponentData { public Entity entity; }

stone osprey
#

One quick question... why does my IDE tells me that "entityQuery.ToComponentDataArray<Translation>();" is not allowed because it must be a reference type ?

north bay
#

Because you have to pass an allocator as it's parameter

stone osprey
#

Thanks ! That worked ! Is there a similar way for sharedComponentData ?

#

Tried the same for a sharedComponentData component but thats not allowed

coarse turtle
#

not that I know of - ISCD are stored as indices, so you grab the ISCD as an index and then access that index to grab the data

stone osprey
#

Any documentation on this ? Couldnt find anything about this :/

coarse turtle
dull copper
#

I'd love a blog like that but so that it would get immediately to the point

#

I can appreciate the time he takes to write those but I really struggle to read them through

coarse turtle
#

ah yea I can relate, I had some trouble reading through entirely for a few his blogs

mint iron
coarse turtle
#

oh interesting he did a study between switch vs burst function pointers

mint iron
#

my project is just flat out crashing the editor on compile 😦

stiff skiff
#

@mint iron Oh boy.. now I have to read all of these hahaha

#

Thanks for the share

mint iron
#

that virtual functions thing is really interesting, i hit a blocker with something similar because of FunctionPointer<T> being managed but his workaround is nice.

stiff skiff
#

I've not dug into any of the burst stuff yet, still much work to be done before I even get to moving stuff to jobs

#

But its nice to read this before hand

fast grotto
#

Hi, I just found out about Unity ECS, and I have a simple question. Do I need to inherit from MonoBehaviour?

opaque ledge
#

For your datas, you have to make a struct inherited from IComponentData, for your behaviours make a class that inherits from SystemBase

#

i highly suggest following CodeMonkey's tutorials

#

@formal scaffold yes, its not relative, its a position in world space

#

@stone osprey if you are new to ECS, stay away from shared components πŸ˜„

wide fiber
#

I am building a weapon system, I want the firepoint of the weapon to be a Gameobject (that will be converted to an entity when the game starts)
Which variable type should I use to get the transform of the firepoint and use it in a system?

stone osprey
#

@wide fiber I have a similar problem... but in my case i wanna attach a armor piece to the player

opaque ledge
#

use an authoring component and put a Transform field in it, in convert method add a component to entity with float3 that has that transform's position.

safe lintel
#

could also add a CopyTransformFromGameObject to your gameobject on conversion, then you can use its Translation inside of jobs

wide fiber
#

use an authoring component and put a Transform field in it, in convert method add a component to entity with float3 that has that transform's position.
@opaque ledge The weapon (and the firepoint) can be rotated, so I can't use a float3 (with some math I could solve this problem but yeah)

bright sentinel
#

Well then you can use a float3 and a quaternion and then calculate the right position/rotation

opaque ledge
#

yep

#

this is what i do for my shooting points and raycast points

wide fiber
#

could also add a CopyTransformFromGameObject to your gameobject on conversion, then you can use its Translation inside of jobs
@safe lintel the firepoint is child of the weapon that is a child of the player, the player is converted to an entity. The FirePoint will also be converted to an entity (because his parent will become an entity) so I can't add the CopyTransform... component

safe lintel
#

use conversionSystem.CreateAdditionalEntity(YourConvertedRootGameObject) to make custom entities for gameobjects you are injecting, and then you can add the child transform via dstManager.AddComponentObject(childTransform) + dstManager.AddComponentData(new CopyTransformFromGameObject())

stone osprey
#

Another question from my side... Im using URP for my materials and shaders... when i instantiate a prefab on my own it shows up the way it should... if i convert my prefab into the ecs, its completly black... any idea why this may happen ?

bright sentinel
#

@stone osprey Don't think URP is supported by Hybrid Renderer V1

zenith wyvern
#

Even with v2 lighting isn't working in URP

warped trail
#

welcome to the club😏

zenith wyvern
#

Apparently it will be in "before the end of the year"

mint iron
#

its like people want to use unity for mobile games or something πŸ˜‰

safe lintel
#

v1 doesnt support ambient light, or lightmapping(it may or may not be completely busted on mobile?) for myself it works but I think its just a coincidence that it does according to what I see on the forums, v2 in its current state doesnt appear to support anything other than 1 directional light 😩

stone osprey
#

Oh damn... thanks :/ Guess i need to use my prefabs then...

warped trail
#

you can have ambient light in v1 if you disable srp batcherπŸ˜…

safe lintel
#

does that actually work? last time I tried it didnt but it was a while ago and have gotten used to basically shit lighting πŸ˜„

warped trail
#

i guess there is some issues there, but at least it works in v1

#

in v2 they fixed this, by properly disabling this featuresπŸ˜‚

safe lintel
#

lol

wide fiber
warped trail
#

you need .WIthStructuralChange() if you use EntityManager

safe lintel
#

whats the problem?

warped trail
#

or use entity command buffer

wide fiber
#

@warped trail ok ty

#

whats the problem?
@safe lintel the error is at the end, after the code

warped trail
#

i guess it is better to use ecb now, when it is bursted πŸ€”

safe lintel
#

oh πŸ™‚

warped trail
#

we need more tests 😏

bright sentinel
#

Does SetComponentData also need ECB? πŸ€”