#archived-dots

1 messages · Page 40 of 1

rotund token
#

and i think it's a tool that needs some research into it

#

because i think there will be some cool patterns from it

solemn hollow
#

the only problem i see is that hierarchies are usually discouraged

rotund token
#

you dont need a hierarchy though

solemn hollow
#

but at some point there needs to be a good way of splitting up mega entities

rotund token
#

just LEG

#

it doesnt have to be a hierarchy at runtime

solemn hollow
#

ah true!

rotund token
#

static optimize would remove the hierarchy

solemn hollow
#

my abilities deparent themselves anyways because of physicsbody

#

what do i need to put into the entityquerymask parameter to not filter out anything?

rotund token
#

EntityManager.UniversalQuery.GetEntityQueryMask()

solemn hollow
#

thanks! i feel like that should be default

#

huh. every entity in the LEG needs to have the component else it throws an exeption. that means you need to have a querymask that contains the component at the very least.

rotund token
#

oh for a set

#

yes

#

thats what query mask is for

solemn hollow
#

hmm how and when are queries updated nowadays? everytime a system runs? would be quite a waste if it was always updated even if the system does not need to run

rotund token
#

Don't need the query

#

Just store the mask

solemn hollow
#

queryMask = new EntityQueryBuilder(Allocator.Temp).WithAll<AbilityHolderRef>().Build(this).GetEntityQueryMask();

#

doesnt the "this" register the query to the system?

rustic rain
#

might want to dispose query

solemn hollow
#

should i do it diffrently?

rustic rain
rotund token
#

yeah what issue said, dont use this, use entitymanager

solemn hollow
#

and that wouldnt store the query? i just need to get the mask and not have the query registered anywhere. do it via entityquerydesc?

rotund token
#

so the query isn't registered to the system

#

create query from EM, create mask, dispose query
win!

#

i assume at some point post 1.0 they'll probably add a nice SystemAPI get mask call

#

but for now what you got to do

solemn hollow
#

got it! thanks

rustic rain
#

what mask is useful for?

#

filter entiites manually?

solemn hollow
#

that and for the new ECB.SetComponentForLinkedEntityGroup(). as with setcomponentdata you need to make sure that all entities do have the component you want to set.

rustic rain
#

🤔

#

Pretty sure you can do it with just buffer lookup

#

without even an ecb

rotund token
#

How do you create an entity in a job

#

And set a child's component

rustic rain
#

SetComponentForLinkedEntityGroup()

#

I meant this

rotund token
#

No one really uses them but unity uses them a lot internally

rustic rain
#

so... it is filtering?

rotund token
#

it's a very efficient way to check if an entity has X components

#

instead of like hascomponent & hascomponent & hascomponent

rustic rain
#

that makes me wonder

#

whether there's max amount of tags/component

solemn hollow
#

interesting. it seems like SetComponentForLinkedEntityGroup() ignores the "mainentity".

#

@rotund token ecb.ReplaceComponentForLinkedEntityGroup(); is the actual thing i want. same as SetComponentForLEG but skips entities that dont have the component. so no mask needed

rotund token
#

Ah yes forgot about that one

#

They've thought about everything!

solemn hollow
#

im a little sad it doesnt work in parallel. i dont think youd need an ecb in every case.
thinking about it it would probably just lead to bad patterns

solemn hollow
#

is there a way to see the bakingworld in the systems window?

rotund token
#

Hmm if selecting show advanced worlds doesn't work then probably not

solemn hollow
#

i can only see loadingworlds with advanced worlds enabled

#

just wanted to see the actual order of baking systems.
are there any standart commandbuffersystems in the baking world or should i just play back my buffers myself

rotund token
#

play them back yourself

solemn hollow
#

how are bakingsystems actually updated? do they only run over entities that have changed or do they run over all entities whenever i change any entity?
I basically wanna know if i should generally use bakingsystems more than bakers since they can be bursted and run in parallel. it wouldnt make sense to run bakingsystems if they'd rebake all entities on every single change.

rotund token
#

i think you should do as much as possible in Bakers

muted star
#

Hello everyone, how can I set breakpoints in a .ForEach lambda?
I upgraded to burst 1.8.1 but the breakpoints aren't hit.

#

Using .WithoutBurst or disabling burst compilation entirely doesn't make a difference for me

#

Debug.Log statements work fine but it's time consuming

muted star
#

I use ECS 0.51 with 2021.3.10f1

rustic rain
#

then no

#

it's Unity 2022 feature

#

oh wait

#

if you do withoutburst

#

it should

solemn hollow
#

will it be removed from SystemBase too?

rustic rain
#

switch to IJobEntity

solemn hollow
#

not a big issue since i slowly want to migrate to ISystem anyways but its news to me

#

when i instantiate an entity is the disabled component removed like the prefab component? i cant find it in source.

#

nvm . problem was i didnt include prefabs in the query where i added the Disabled component. you didnt have to include prefabs in conversionsstems so i got confused there

robust scaffold
rotund token
#

Unity devs while not directly saying it seemed to make it pretty clear EFE is unlikely to be around forever

robust scaffold
#

Wait, how is this possible, burst compiled add managed component? Lets see if it works in playmode

#

Wait no, it didnt compile yet. There's the managed c# error

frigid crypt
#

So, a day or two ago I've updated my project to entities 1.0 in hopes to fix some shader incompatibility on my linux machine, which it did (for built executables), but now I've tried to open my project in unity editor on said machine and I see this:

#

Any idea if it could be fixable or do I have to wait for a fix in later version of unity and/or packages?

rustic rain
#

you need to modify archetype

#

and then simply change component data

#

which is int

#

index of managed component array

#

as long as managed component already exists in world

#

you can set it burst compiled

robust scaffold
rustic rain
#

also possible if you use extern methods

#

that don't rely on managed arguments

robust scaffold
#

ehhhhh, it's a system that runs on startup that creates entities. it's not that performance critical

rustic rain
#

just saying of possibilities, kek

frigid crypt
robust scaffold
#

then restart unity, is there any errors?

frigid crypt
#

Also just to be clear, I'll add that on windows everything works fine without graphical issues and I only have a warning that a shader doesn't support skinning

robust scaffold
frigid crypt
#

Also, I've tried to make a new project from URP template and I still have graphical issues, so at least that part is not related to DOTS

wanton apex
#

Hello !
Could someone explain me what is "nested containers" in Unity Job / Burst ? I have a issue with "nested containers are illegal", but don't understand how to fix it. Thanks !

wanton apex
#

That's what I thought, but it's strange because I don't have it anywhere... (I had it but I remove it, and the compiler continue to complain about this)

raw mica
#

The error should be specific to nested [NativeContainer]s which is an attribute applied to types that managed native memory and provide job safety checks. This is a bit subtle as it means there can be NativeContainers that don't necessarily start with Native in their name like NativeList does

#

For instance, ComponentLookup<T> is a NativeContainer, which can mean if you use a lookup to read a component that contains a NativeContainer like NativeList (in a job), then you can also see errors. We are currently working on improving the error message clarity as it's not as clear as we'd like it to be.
Longer term we are trying to better support these workflows without jeopardizing performance for all codepaths using containers but that won't be before 1.0

robust scaffold
wanton apex
#

Thanks all for the answers !

queen dome
#

Saw this just now. Not sure I can post all my code. If I can pinpoint the problem maybe I can post the offending code. The problem is that the erorr does not give me any hints as I am not using jobs.

#

How one would go about creating entity in monobehaviour?

#

I am trying this in Start()
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager; var playerInputEntity = entityManager.CreateEntity(); entityManager.SetComponentData<PlayerInputComponent>(playerInputEntity, new PlayerInputComponent());

but I get ArgumentException: A component with type:PlayerInputComponent has not been added to the entity. Entities Journaling may be able to help determine more information. Please enable Entities Journaling for a more helpful error message.

#

Nevermind, I had to add it first to set the data. I was missing entityManager.AddComponent<PlayerInputComponent>(playerInputEntity);

robust scaffold
robust scaffold
queen dome
#

@robust scaffold How do I persist changes to component in monobehaviour?

#

var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager; var eq = entityManager.CreateEntityQuery(typeof(PlayerInputComponent)); var playerInput = eq.GetSingleton<PlayerInputComponent>(); playerInput.MousePosition = _mousePos; playerInput.MoveInput = _inputVector; playerInput.Shoot = _shoot; playerInput.Frame = Time.frameCount;

#

This does not seem to do it

robust scaffold
queen dome
#

eq.SetSingleton(playerInput); ?

robust scaffold
queen dome
#

It seem it works! Thank you @robust scaffold

robust scaffold
queen dome
#

Yeah but I need to use SystemAPI which does not seem to work outside of a system. Correct?

robust scaffold
queen dome
#

Not sure what you mean by "code gen tag"

rustic rain
#

not actually ever gets called

#

instead used by compiler to generate correct code

queen dome
#

Still not sure what you mean.

#

What is empty method?

robust scaffold
# queen dome What is empty method?

A method that immediately throws an error if run normally. However, between the code and compilation, there's a step known as code generation that takes the code written as strings and then selectively replaces sections of code with other code. In this case, SystemAPI is replaced with actual code instead of the immediate throw new exception(). And then that is compiled into code. Which is why all Systems need the partial.

queen dome
#

Ok, I understand. So this code gen is not possible in other places but partial Systems?

#

If I do partial MonoBehaviour would it work?

robust scaffold
#

SystemBase can also use SystemAPI.

#

No, partial MBs are not detected by the code gen.

queen dome
#

thank you for your clarification

robust scaffold
#

@gusty comet I just want to add another bug if not already known, with play mode options disabled (as in pressing play will reload domain before entering playmode) entering play mode with multiplayer tools simulator disabled kicks the player out of play mode on the second frame. Simulator must be [ON] for playmode to work.

elfin spire
#

Entities v1 changed so much since last time i dipped toe!!

queen dome
#

I am creating a plane like that:

robust scaffold
queen dome
#

Then I am trying to raycast from scree mouse position to try to hit the hidden plane for input purposes:
`[UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]
[UpdateBefore(typeof(PhysicsSimulationGroup))]
public partial class PlayerMoveLookSystem : SystemBase
{
protected override void OnUpdate()
{
var camera = Cameratone.Instance;
var collisionWorld = GetSingleton<PhysicsWorldSingleton>().CollisionWorld;
var eq = EntityManager.CreateEntityQuery(typeof(PlayerInputComponent));

    var playerInput = eq.GetSingleton<PlayerInputComponent>();

    var mousePos = new UnityEngine.Vector3(playerInput.MousePosition.x, playerInput.MousePosition.y, 0);
    UnityEngine.Ray ray = camera.ScreenPointToRay(mousePos);

    UnityEngine.Debug.DrawLine(ray.origin, ray.direction * 100, UnityEngine.Color.green, 1 / 60f);


    RaycastInput input = new RaycastInput()
    {
        Start = ray.origin,
        End = ray.direction * 100,
        // Filter = new CollisionFilter()
        // {
        //     BelongsTo = 4,
        //     CollidesWith = 4, // all 1s, so all layers, collide with everything
        //     GroupIndex = 0
        // }
    };

    float3 lookAt = float3.zero;
    var hit = new RaycastHit();
    bool haveHit = collisionWorld.CastRay(input, out hit);
    if (haveHit)
    {
        lookAt = hit.Position;
        UnityEngine.Debug.Log("hit");
    }

    foreach (var transform in SystemAPI.Query<TransformAspect>().WithAll<PlayerComponent>())
    {
        if (haveHit)
            transform.LookAt(lookAt);
    }
}

}`

queen dome
robust scaffold
queen dome
#

Nope, the drawing looks pretty good also:

#

Mouse is not seen but its on top left corner of game view

robust scaffold
#

You cant just comment it out.

queen dome
#

Hmmm I am not sure how to use this filter

robust scaffold
#

set both belongs to and collides with to ~0u

queen dome
#

I understand that. I do not understand why raycast asks me for both "BelongsTo" and "CollidesWith"

#

What does it mean in context of raycasting?

robust scaffold
#

The raycast itself is a collider as well.

queen dome
#

Oh.. so it is the raycast "BelongsTo" ? Ok, that kinda make sense.

robust scaffold
#

So as it traverses the BVH tree, it checks all the colliders for IsCollisionEnabled() using the logic in that documentaion.

queen dome
#

HIT! YEAH! Thank you ❤️

robust scaffold
#

So if the raycast doesnt have a filter set, it defaults to 0, which means it wont collide with anything.

queen dome
#

Well, I would not have written an API that default state is basically not working but hey...

robust scaffold
#

It's the price to have 10x better-ish performance.

#

Just know you cant leave things unset because the defaults are hardcoded by C# themselves. Although in C#9 or 10, it'll change.,

queen dome
#

So, if I have the plane I want to hit in Category A

#

To hit it what do I need to put in raycast filter?

#

CollidesWith = Catergory A?

robust scaffold
queen dome
#

Ill put the plane "BelongsTo" and "CollidesWith" in the same category. Ill do the same to the raycast

#

yeap, works, thank you @robust scaffold

robust scaffold
#

Has anyone figured out how to do optional components in a SystemAPI.Query<> without aspects?

robust scaffold
#

Finally done it, a duplicate kinematic body that is overlaid on player entities to prevent them from being pushed.

#

It's 5% smaller so the dynamic rigidbody gets priority.

#

Unfortunately, it is still possible to player - object - player collide and very stuttery movement when doing so. But this is good enough.

robust scaffold
rustic rain
#

iterate chunks manually

#

and do query mask comparison only once per chunk

#

using type handle

#

to obtain optional array

robust scaffold
rustic rain
#

that's quick solution, but slow runtime though

robust scaffold
#

I wouldnt use .Query<> for performance critical work anyways

rustic rain
#

can be used though

#

for iterating event entities for example

#

that require structural changes

whole gyro
#

Anyone using the TransformAspect with transforms v1? Might be missing something but it seems like there is a bug in UpdateLocalToWorld():

        void UpdateLocalToWorld()
        {
            if (HasParent())
            {
                var newParentToLocal = float4x4.TRS(LocalPosition, LocalRotation, new float3(1, 1, 1));
                var newLocalToParent = math.fastinverse(newParentToLocal);
                var newLocalToWorld = math.mul(ParentToWorldMatrix, newLocalToParent);

                m_LocalToParent.ValueRW.Value = newLocalToParent;
                m_LocalToWorld.ValueRW.Value = newLocalToWorld;
            }
            else
            {
                m_LocalToWorld.ValueRW.Value = float4x4.TRS(LocalPosition, LocalRotation, new float3(1, 1, 1));
            }
        }

Isn't the line var newParentToLocal = float4x4.TRS(LocalPosition, LocalRotation, new float3(1, 1, 1)); calculating the LocalToParent, not the ParentToLocal?

rustic rain
#

allthough, I'm leaning towards using enabled component state instead

robust scaffold
whole gyro
#

No I mean when there is a parent. The first line of that branch calculates ParentToLocal using the local position and rotation. Isn't this backwards?

rustic rain
#

Translation

#

and Rotation

#

they are local space

#

So if you have Parent, then it'll be LocalToParent

whole gyro
#

I understand that part

rustic rain
#

🤔

#

then I don't understand you at all 😅

whole gyro
#

If an entity has a parent, doesn't float4x4.TRS(LocalPosition, LocalRotation, new float3(1, 1, 1)); describe the localToParent?

robust scaffold
#

Child has pos of (1, 1). Parent has pos of (2, 2). Local to Parent is still (1, 1) and the parent's local to world is (2, 2). Combined, local to world for the child used in rendering will be (3, 3).

rustic rain
#

that would describe LocalToParent without scale

whole gyro
robust scaffold
#

yea, no clue

whole gyro
#

Well the last line says the LTW is float4x4.TRS(LocalPosition, LocalRotation, new float3(1, 1, 1)) when there is no parent, so I'm assuming that LTP would be the same thing when there is a parent

robust scaffold
#

I think it's because of math magic

#

See, this is why you never have a hierarchy. Matrix math more than 1 level deep is pain

rustic rain
#

it simply gets LTP

#

and then multiplies it with LTW of parent

whole gyro
#

This part:

var newParentToLocal = float4x4.TRS(LocalPosition, LocalRotation, new float3(1, 1, 1));
var newLocalToParent = math.fastinverse(newParentToLocal);
rustic rain
#

oh

#

didn't notice it

whole gyro
#

Which makes me want to avoid TRS entirely.

#

The transform systems don't really use TRS, they manually multiply stuff. Like the TRSToLocalToParentSystem uses this to calculate LTP: math.mul(new float4x4(rotation, translation), scale)

naive eagle
#

I'm getting a crash on every build with 1.0, anyone else dealing with this? I submitted a bug report already. This is using the build configurations and multiplayer

#

I should add: this is happens AFTER the build successfully completes.

robust scaffold
rocky dove
#

What am I missing for creating a new world + system in Edit mode?

robust scaffold
rocky dove
#

I remember PlayerLoop stuff from years ago, surprised we still need to do low level stuff in 1.0

robust scaffold
winter depot
rocky dove
robust scaffold
robust scaffold
# rocky dove okay, i added the default system groups, and I've got an OnCreate() called, but ...
public World CreateLocalWorld(string defaultWorldName)
{
    // The default world must be created before generating the system list in order to have a valid TypeManager instance.
    // The TypeManage is initialised the first time we create a world.
    var world = new World(defaultWorldName, WorldFlags.Game);
    if (World.DefaultGameObjectInjectionWorld == null)
        World.DefaultGameObjectInjectionWorld = world;

    var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default);
    DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(world, systems);
#if !UNITY_DOTSRUNTIME
    ScriptBehaviourUpdateOrder.AppendWorldToCurrentPlayerLoop(world);
#endif
    return world;
}```
winter depot
rocky dove
rocky dove
robust scaffold
# winter depot

Ya know, i've downloaded HR myself and ya, i can reproduce that with my own rendering system. I think it's because HR skips directly to writing to camera texture and sidesteps a lot of the layering and filtering code.

#

It's annoying because this flat overlay breaks my own light renderer.

robust scaffold
#

Ya know, I wanted features back in 0.51. Now in 1.0, I want things to just work.

rotund token
#

i jumped into the netcode samples last night

#

to test my change filtering proof of concept if it still worked

#

any code change would invalidate my subscenes

#

and required an editor restart

#

was not a fun experience

#

i think subscene invalid header biggest issue in dots atm, kills workflow

solemn hollow
#

same experience. but why do subscene headers break when you dont change baking process?

rotund token
#

🤷‍♂️

robust scaffold
rotund token
#

i noticed something in 0.51 when i was doing some random testing

#

im not sure if it's still true but let me grab the code

robust scaffold
#

it has gotten to the point where i have to restart after every single minor code change

rotund token
#
            assemblies ??= UnityEditor.Compilation.CompilationPipeline.GetAssemblies().ToDictionary(r => r.name, r => r);```
#
        {
            if (!AssembliesMap.TryGetValue(asm.GetName().Name, out var uAssembly))
            {
                return false; // this happens in sub scene conversion process if a new assembly is added after loading unity...
            }```
naive eagle
#

I just spent 2 hours debugging jittery movement in multiplayer. Editor crashed and suddenly everything worked just fine. I guess I'll move "restart Unity" to the front of the to-try list when I'm not sure why things aren't working.

rotund token
#

creating an assembly in 0.51/2021.3 would not add it to the UnityEditor.Compilation.CompilationPipeline that the conversion system process had access to until an editor restart

#

it's like it had a cached domain at startup

#

no idea if it's still a 1.0 issue

#

was just something i randomly stumbled upon a while back

robust scaffold
rotund token
#

in editor the assembly would be found, in conversion process it would not

solemn hollow
rotund token
#

oh yeah open subscenes cause all sorts of issues

#

highly recommend keeping them closed before entering playmode

naive eagle
#

I'm no longer seeing the issue even with the subscene open/closed, but that's a good tip nonetheless

robust scaffold
#

Although parallel import turned off seems to have helped with async corruption.

rotund token
#

dont have that on 😦

#

seems like it only affects images/models

robust scaffold
#

huh, i had it everywhere

rotund token
robust scaffold
#

Jesus christ. I add a debug log and boom, subscenes no work

rotund token
#

didn't know this was a feature

#

but im curious why its a project setting not a preference

#

the number of workers i want on a 24 core machine is probably different to someone with 4...

rotund token
#
        {
            // These types cannot be instantiated
            if (type.IsAbstract || type.ContainsGenericParameters)
                return false;

            // Only derivatives of ComponentSystemBase and structs implementing ISystem are systems
            if (!type.IsSubclassOf(typeof(ComponentSystemBase)) && !typeof(ISystem).IsAssignableFrom(type))
                throw new System.ArgumentException($"{type} must already be filtered by ComponentSystemBase or ISystem");```
#

seems to throw in here

robust scaffold
rotund token
#
            {
                var systemType = s_SystemTypes[i];
                if (FilterSystemType(systemType, lookupFlags))```
somehow a system type isn't a system type
robust scaffold
#

I've seen IComponentData on there, IL temp code, sprites, random stuff.

rotund token
#

can you show me the full stack

#

does it come from the ConstructSystem path

#

or the InitializeAllSystemTypes

#

path

robust scaffold
rotund token
#

oh wait no

#

nah it wouldn't help its already added to the list by that point

robust scaffold
#

Definitely easy enough to cause, give me a sec

rotund token
#

looking at code there's only 1 path i could potentially see a bad system gets added to this list

#

without user mistake / malice

#

which is basically the CreateSystem(Type) path

#

but no even that is checked
if (!typeof(ComponentSystemBase).IsAssignableFrom(systemType))

#

hmm

robust scaffold
#

That error occurs on play, not during build.

#

I think, It appears when I enter playmode

rotund token
#

well that's when typemanager would be initialized

#

it's initialized in first EM initialization

robust scaffold
#

[Worker0] Exception thrown during SubScene import: System.ArgumentException: Multiplayer.Authoring.Systems.BakingKinematicToggle+Container_331747650_0+ResolvedChunk must already be filtered by ComponentSystemBase or ISystem Just random things

rotund token
#

i haven't seen anyone else report this specific one which is concerning for you 😅

robust scaffold
#

it's nearly reproducible by modifying a baking system. Ya know what, fuck baking systems. I'll just do this runtime.

#

Baking is just so broken. I cant use it.

rotund token
#

you know what's nice and pretty stable?! 0.51! on 2020.3

robust scaffold
#

im so tempted

#

but then my rendering stack relying on RT handles will just die

#

God, i was so spoiled on how stable the baking was in 0.51. It looked rock solid compared to this

hot basin
#

I think in 0.51 there was no baking 😄

rotund token
#

have you tried turning off live baking @robust scaffold ?

#

no idea if it'll help but anything is worth a try!

robust scaffold
#

Thats probably why it's error'ing out when I press play instead of when I make edits to the code

robust scaffold
rotund token
#

this new in b13?

#

or i just been blind

#

or is this my internal mode i didn't realize

robust scaffold
rotund token
#

ah ok i just turned it on for a second

#

first time opening b13

#

to check my live baking setting

#

thats a shame, that's a useful feature all the time!

robust scaffold
#

probably costs a lot of performance

#

it's basically profiler on constantly

#

Unity, I really really wish for [GenerateAuthoringComponent]

rotund token
#

True

robust scaffold
#

Jesus christ these bog standard empty MB and then a baker inside just to add one component is so pain

rotund token
#

Imagine mapping 1:1 🤣

hot basin
#

b13? is there new version? there was exp.14 for b11 why b13?

rotund token
#

2022.2.0b13

robust scaffold
light mason
#

Is moving up to B13 worth it if im on b8,

robust scaffold
#

At least B12 for the samples. Otherwise, no.

light mason
#

ok ty

rotund token
#

The alignment issue in builds was fixed b11 I think

#

So you'd want that at least

light mason
#

when we build now, do we have to add all the subscenes to the "Scenes in Build" list

rotund token
#

No

light mason
#

ok ty, so much have changed since 0.17

robust scaffold
#

I dont know what I've done wrong but the baker just never works anymore. Ugh.

rotund token
#

Time to start removing stuff until it works 🙃

#

Do you have these issues on the samples?

#

Maybe you just need a library wipe

robust scaffold
#

oof, it's big, 15GB

robust scaffold
rotund token
#

That one I believe is known and I've reported myself

#

I think it only happens if you have multiple subscenes

#

Which is very common

#

Though that's based off a sample size of like 3 projects

robust scaffold
robust scaffold
solemn hollow
#

you mean using AddComponentObject?

robust scaffold
#

No, just the built in sprite renderer baking

#
public class SpriteRendererAuthoring : Baker<SpriteRenderer>
{
    public override void Bake(SpriteRenderer authoring)
    {
        AddComponentObject(authoring);
    }
}```
solemn hollow
#

im not getting that error with my sprite renderers

robust scaffold
#

I dont know, I dont use any other managed component anywhere

#

This is the only managed component in the entire code

solemn hollow
#

The warning doesnt specify where it happens right?

#

TransformSys V2 is still not working with physics?

robust scaffold
#

Probably gonna wait until 1.0 pre for that

solemn hollow
#

Are SubScenes supposed to only be in once Scene?

#

i cannot add the same subscene to multiple different scenes

robust scaffold
robust scaffold
#

I cant. That's odd.

solemn hollow
#

if i try to add a subscene to a scene then it only gets added as a normal scene

#

i havent tried to do it in 0.51 so i cant say if that is expected behaviour

#

seems like a bug to me

robust scaffold
#

Then move the subscene asset into the box for "subscene"

#

It's incredibly annoying I know

solemn hollow
#

AAAH! thank you so much

robust scaffold
#

You have to literally duplicate the subscene asset in order to add it again, cant use the same asset

solemn hollow
#

but can you load the same scene twice at runtime at different locations?

robust scaffold
#

Otherwise yea, you kinda can use the subscene twice or more per scene, just gotta keep copy pasting the actual asset

robust scaffold
solemn hollow
#

hm. say i have a subscene thats a Setpiece i want to randomly spawn multiple times into my world. can i do that?

robust scaffold
#

It's a really roundabout way and annoying but it works, most of the time. Until the baker dies and you need to restart the editor again

solemn hollow
#

yes true. there is no real advantage in having a subscene compared to prefabs.

#

i always forget to include Prefabs in my BakingSystems.

hot basin
#

outside of ECS, is there a struct or something that encapsulates position and rotation? I need to have copy of GO transform values, and I wonder if I need to keep separate float3 and quaternion or is there something for this.

robust scaffold
#

Alternatively, you can just use the raw 4x4 L2W. Merged TRS.

hot basin
#

is UnityEngine.Plane Burstable?

robust scaffold
rotund token
#

well i'm not crashing (this is without editing entities package)

#

i'm more interesting in timings and the ability to edit meta data before initialization for the sake of modding than LEG in particular, just though it'd be an interesting test case due to current discussions here

rotund token
#

and works fine in a build, interesting

viral sonnet
#

cap 0?

rotund token
#

yeah

#

via code, no package changes

viral sonnet
#

how are you doing this?

rotund token
#

A magician never reveals his tricks!

viral sonnet
#

then this is clearly shopped!

rotund token
#

before and after magic

#

the actual code for this is really easy

#
    where T : struct, IBufferElementData
{
    TypeManager.Initialize();

    var typeInfoPointer = TypeManager.GetTypeInfoPointer();
    var index = TypeManager.GetTypeIndex<T>().Index;

    ref var typeInfo = ref typeInfoPointer[index];
    typeInfo = new TypeManager.TypeInfo(
        typeInfo.TypeIndex,
        typeInfo.Category,
        typeInfo.EntityOffsetCount,
        typeInfo.EntityOffsetStartIndex,
        typeInfo.MemoryOrdering,
        typeInfo.StableTypeHash,
        bufferCapacity, // bufferCapacity
        sizeof(BufferHeader) + (bufferCapacity * typeInfo.ElementSize), // sizeInChunk
        typeInfo.ElementSize,
        typeInfo.AlignmentInBytes,
        typeInfo.MaximumChunkCapacity,
        typeInfo.WriteGroupCount,
        typeInfo.WriteGroupStartIndex,
        hasBlobAssetReferences, // _HasBlobAssetRefs is private so we need to set this manually (TODO use reflection to not need to pass info in)
        typeInfo.BlobAssetRefOffsetCount,
        typeInfo.BlobAssetRefOffsetStartIndex,
        typeInfo.WeakAssetRefOffsetCount,
        typeInfo.WeakAssetRefOffsetStartIndex,
        typeInfo.FastEqualityIndex,
        typeInfo.TypeSize);
}```
#

the pain is figuring out how to get this to run before anything uses it

viral sonnet
#

good lord

rotund token
#

so I just put it everywhere 😄
[UnityEditor.InitializeOnLoad]

[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]

[UpdateInGroup(typeof(PreBakingSystemGroup), OrderFirst = true)]
[WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)]

#

turns out baking system domain runs before InitializeOnLoad and RuntimeInitializeOnLoadMethod only good for runtime

#

but there you have it

#

a way to change buffer capacities in other packages

#

and also i now know at what timing i need to inject new types! potentially from loading dlls for modding etc

robust scaffold
#

What wizardry is this

rotund token
#

use at own risk

#

i made a build and it ran fine, the extent of my testing

robust scaffold
rotund token
#

oops extra initialize in there, no harm

robust scaffold
rotund token
#

technically it's public so i wanted it in there

#

so if i called it from elsewhere

#

so the one in initialize

#

but yeah it doesn't really matter

#

typemanager.initialize is safe to call

#

it earlies out of already setup

#
        {
            if (s_Initialized)
                return;```
robust scaffold
#

Did you hammer that entire chunk of code out yourself or is what unity is doing?

rotund token
#

that's just the constructor for TypeManager.TypeInfo

#

fields are readonly

#

so i couldn't just update them i had to just clone it

#

all i'm doing is updating the TypeInfo stored for the buffer and changing the bufferCapacity and sizeInChunk fields

#

and doing this before anything accesses it =S

robust scaffold
rotund token
#

sure but honestly more effort

#

and if the signature changes in the future

#

it will break

#

this will give me a compile error instead

robust scaffold
#

I guess finding the proper offset for the buffer capacity to inject our own count would be difficult.

#

Oh yea, ugh

robust scaffold
#

So long as those variables dont get refactored out, a memcopy can support changes in the underlying structure signature.

rocky dove
#

@robust scaffold thanks for the help with hooking up the system into Update, its working now

robust scaffold
#

Ugh, UNITYYYYYYY

robust scaffold
rotund token
#

im asmref into a lot of things

robust scaffold
#

I cant get both physics and entities in the same script together

rotund token
#

what are you doing with your asmref?

robust scaffold
#

Can I add more than 1?

rotund token
#

all my asmref does is inject internal access

#

i just inject an assemblyinfo file which gives me internal access

robust scaffold
#

Oh wait, an actual assembly info script, that makes more sense

rotund token
#

so my core library (and core.editor) are the only things with internal access

#

and if any of my other libraries want it i just add a small wrapper for it

robust scaffold
#

If only unity made everything public, we wouldnt need to do this nonsense

rotund token
#

i'm pretty happy most of it is internal

#

i don't think a lot of it should be public

#

that's just asking for trouble

robust scaffold
#

But trouble is great! What's the use of all these neat tools if I cant shoot myself in the foot with it?

#

I guess I should be happy they aren't private and we'll be tearing these out by reflection

rotund token
#

exactly, being internal lets me access it while most normal uses don't shoot themselves in the foot

#

private would mean reflection or memory reinterpretation which is just slow or painful

robust scaffold
rotund token
#

mine has no issue

#

maybe just regenerate project files

robust scaffold
robust scaffold
#

Suck it unity, Wont make IBC 0? Fine, we'll do it ourselves.

#

@viral sonnet No need to wait for unity to set IBC to 0 anymore. We can do it ourselves.

#

Hrm, I should make some error checks for the one hardcoded section of that code.

#

Well, it works in play mode, no crashes, no errors.

#

Tertle's version is actually burstable. Although I dont think this section of code is performance critical. Mine uh, less copying?

rotund token
#

But has reflection

robust scaffold
#

Where's the get type?

rotund token
#

Yours

robust scaffold
#

Yea, mine does have reflection.

#

And thus is slower, but if you're running this every frame, something's wrong.

rotund token
#

just dont see the advantage of your implementation

#

except as an educational tool

robust scaffold
#

No need to specify blob asset ref?

rotund token
#

oh fair

robust scaffold
#

But yea, mine is just my flavor of it

rotund token
#

though that one itself is not that hard to fix up i just cbf

robust scaffold
#

Yea, yours is objectively superior. I just want to go do the slower way.

rotund token
#

i was wrong

#

typeInfo.HasBlobAssetRefs,

#
                typeInfo.TypeIndex,
                typeInfo.Category,
                typeInfo.EntityOffsetCount,
                typeInfo.EntityOffsetStartIndex,
                typeInfo.MemoryOrdering,
                typeInfo.StableTypeHash,
                bufferCapacity, // bufferCapacity
                sizeof(BufferHeader) + (bufferCapacity * typeInfo.ElementSize), // sizeInChunk
                typeInfo.ElementSize,
                typeInfo.AlignmentInBytes,
                typeInfo.MaximumChunkCapacity,
                typeInfo.WriteGroupCount,
                typeInfo.WriteGroupStartIndex,
                typeInfo.HasBlobAssetRefs,
                typeInfo.BlobAssetRefOffsetCount,
                typeInfo.BlobAssetRefOffsetStartIndex,
                typeInfo.WeakAssetRefOffsetCount,
                typeInfo.WeakAssetRefOffsetStartIndex,
                typeInfo.FastEqualityIndex,
                typeInfo.TypeSize);
        }```
robust scaffold
#

Ha

rotund token
#

i just realized there is a property for it

#

public bool HasBlobAssetRefs => _HasBlobAssetRefs != 0;

robust scaffold
#

Now literally superior, fuck...

#

nooooo

#

Nice educational tool then

rotund token
#

anyway i do not advocate this, it was a simply an experiment to see if i could do it

#

as i mentioned before, i'm more interested in seeing if i can inject new types from dynamically loaded dlls

raw mica
#

If the intention is to only patch the TypeInfo you can use the TypeInfoPtr and some unsafe casting to write to it directly to avoid the new constructor call:

TypeInfo* pTypeInfo = ((TypeInfo*)s_TypeInfos.GetUnsafePtr()) + index;
*(&pTypeInfo->SizeInChunk) += newValue;
rotund token
#

yeah but if you go make changes to the struct layout

#

and i update

#

oh wait hmm

#

no that would work actually

raw mica
#

My approach should work even if we change it, as long as we don't remove the field you use

rotund token
#

well there you go kornflaks, a better version of yours

robust scaffold
#

See, gotta let the professionals show us how it's done. Instead of stumbling around in the dark.

raw mica
#

This type of overwriting of the type system is fine as long as it's certain to run before EntityManager creation. If anyone has made chunks afterwards you're gonna have a bad day

rotund token
#

the biggest issue i had when testing this was

#
    [WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)]
    partial class LinkedEntityGroupBakingCleanUp : SystemBase
    {
        private EntityQuery query;

        protected override void OnCreate()
        {
            query = GetEntityQuery(typeof(LinkedEntityGroup));
        }

        protected override void OnUpdate()
        {
            EntityManager.RemoveComponent<LinkedEntityGroup>(query);
        }
    }```
#

i had to get my change in before this triggered when baking

#

and this triggers before
[UnityEditor.InitializeOnLoad]

#

i just realized @robust scaffold this should probably be
[CreateBefore(typeof(LinkedEntityGroupBakingCleanUp))]

#

not updatefirst

raw mica
#

Exactly. Archetypes rely on the type info to know how many elements forward to look when iterating over buffers in chunks. If you change that value after a chunk is made we'll barf. Worse, if you change it after baking has serialized data you'll crash at runtime

#

We do want to offer a bunch more configurability over a lot of these params currently done via attributes. It just requires work to provide a nice UX for such a config file, and a nice way of making such a config system behave as users make changes to it (since almost no one wants a system where you can only set it before boot)

rotund token
robust scaffold
#

You see, this is why I'm not a programmer. This stuff is wild.

raw mica
#

This is the result of C programmers working in C#. 🙂

raw mica
#

But, you're likely fine 😄

robust scaffold
#

Well, no errors, no crashes. Cant build because hybrid components are broken so dont know about that.

rotund token
#
#if UNITY_PHYSICS
[assembly:BufferCapacity(typeof(Unity.Physics.PhysicsColliderKeyEntityPair), 2)]
#endif
#

updated how mine works

#

can now just define an assembly level attribute now

#

to override the InternalBufferCapacity attribute

raw mica
#

If this is implemented by adding the overridden BufferCapacity in BuildComponentType() in the TypeManager, you'll have no problems in Editor or at Runtime and honestly if this ends up being a big enough concern it isn't unreasonable to fold in to the package proper

robust scaffold
#

Yes yes yes PLZ

rotund token
#

it's too painful to maintain

raw mica
#

Fair enough, makes perfect sense

robust scaffold
rotund token
#

yeah pretty much

#
        public static void Initialize()
        {
            foreach (var attr in ReflectionUtility.GetAllAssemblyAttributes<BufferCapacityAttribute>())
            {
                SetBufferCapacity(attr.Type, attr.Capacity);
            }
        }
robust scaffold
#

Neat. Yea, big feature to ya package if you're willing to test this out for any edge cases.

raw mica
#

I'll consider it and discuss it a bit more internally. I do hate having yet another global attribute for folks to sprinkle through their code. It's not nice to deal with, hard to gather who is doing what via attributes (hopefully you own all the code doing so) and ultimately it requires some reflection, or ilweaving to resolve both of which are not very speedy

rotund token
#

ideally this would be handled through some UI but i'm not putting the effort into that

robust scaffold
#

I have no clue what virgins they had to sacrifice to get it to work but it does and does so quite well.

robust scaffold
rotund token
#

oh i could make it work from UI, instead of iterating attributes i could just load the data from disk

robust scaffold
#

Or it could just be their inputs into their sync codegen'ed systems.

rotund token
#

and i'm sure if i actually edited package i could make it work a lot nicer

robust scaffold
#

Yea, setting IBC to 0 increased chunk capacity for my entities by at least 12 across the board. Over 50% increase over not using that system. I only have 12 entities though so no benchmarks.

#

I wonder if we can name archetypes. The auto-gen'ed alphanumerical soup is not helpful.

#

Noooooo, it's not burst-able. Curses.

rotund token
#

what's not burstable? this hack?

#

(why does it need to be)

robust scaffold
#

TypeManager.Initialize() cant be bursted but the stuff after can

rotund token
#

im pretty sure that'd probably be slower

#

than not bursting it

robust scaffold
#

Yea, the function pointer calling is probably costing more than actually writing... 2 values.

#

yeaaaaaaaaaa

#

One final wish into the void to any physics guys lurking around: please separate collider filter from the greater collider blob. I am forced to clone a bunch of blob asset refs because I need to designate unique collider indices per body. All of them share exact body composition except for the collider filter.

rotund token
#

left in ability to set capacity without attribute

robust scaffold
#

I've been using unmanaged everywhere for things I know can't be a managed component.

rotund token
#

good point but it doesn't matter

#

cant have a valid ibufferelement that isn't unmanaged

robust scaffold
#

Yea, who knows though.... yea. That's impossible for it to be managed.

solemn hollow
#

@rotund token is there some readme/thread in the forums to your core library? just an overview of what you got in there for people who dont fully understand the code?

#

im afraid im missing out on some great tools

rotund token
#

not really

#

i posted a random list of things in there on the forums

#

but its far from comprehensive

solemn hollow
#

haha okay then ill better not get it. no use in tools i dont even find ^^

rotund token
#

oh you'll just find a lot of random extension methods

#

people at work always are just using extensions they think are part of the core entities ^_^'

#

the point of core though is anyone can add it and it won't affect anything

#

(well except i've included the remove LEG stuff which i am considering separating because the library shouldn't do anything)

#

you should add it purely for assembly builder though

#

still the best tool i've ever built

solemn hollow
#

at some point you really need to list all features somewhere. even if you dont explain them. atleast i can then search for them if i know they exists ^^

rotund token
#

80% is just extensions

solemn hollow
#

whats the StateSystem?

rotund token
#

think bit array on a component

#

256 states for unique (8bits) or 256 flags (256 bits)

#

each bit maps to a component (usually tag)

solemn hollow
#

so it kinda falls in the same usecase as enable components?

rotund token
#

yeah sure

#

i was considering switching it from add/remove to enable/disable

#

but i decided to keep it add/remove

#

it's more for longer term states

#

i use it for UI states, game level states (menu, starting server, in game, etc)

#

but also for say, certain movement states

#

follow, flee, etc

#

works best when combined with K imo

solemn hollow
#

so you set a certain state and a system automatically adds/removes all components defined for the state?

rotund token
#

for UI/game states

#

yes

#

well it's 1 component

#

i only use it for tag components

#

any data component always exists

#

oh i guess my camera is a really good example

#

my cinemachine/camera system uses it

#

FollowCamera = 252
FreeCamera = 254
ThirdPersonCamera = 251

#

etc

#

its useful because you can set states

#

without knowing components

#

or have 3rd party libraries add new states

#

the main issues of states is removing old components etc, you have to check every state component and remove them

#

like if i have 256 states, and i want to go to start 9

solemn hollow
#

sounds great. ill keep it in the back of my mind for the next time im doing a statemachine. And K basically would take "FollowCam" and convert it to say 3 and thus you wouldnt need to know the numbers for the States in Editor?

rotund token
#

i have to check 247 states to remove

rotund token
#

it's still kind of hard coded

#

but "Follow" is easier to remember than 252

#

and you can always change your digits without breaking code

#

(K works in burst as well)

#

state used to be just a base class

#

but i rewrote it recently to be a helper struct

#

a little more effort to setup (not a lot)

#

but now works with ISystem

#
    [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)]
    public partial struct CameraStateSystem : ISystem
    {
        private StateSystemImpl impl;

        public void OnCreate(ref SystemState state)
        {
            this.impl = new StateSystemImpl(ref state, typeof(CameraState), typeof(CameraStatePrevious));
        }

        public void OnDestroy(ref SystemState state)
        {
            this.impl.Dispose();
        }

        [BurstCompile]
        public void OnUpdate(ref SystemState state)
        {
            var bufferSystem = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>();
            this.impl.Update(ref state, bufferSystem.CreateCommandBuffer(state.WorldUnmanaged).AsParallelWriter());
        }
    }```
#

the core system just looks like that

solemn hollow
#

i am thinking about usecases just now and realized that somehow with ECS i have less systems that use exclusive states than in oop

rotund token
#

oh yeah states are unnatural in ECS

#

and historically hard to implement

#
            {
                State = TypeManager.GetTypeIndex<CameraState>(),
                StateKey = this.StateKey,
                StateInstanceComponent = this.StateInstanceComponent,
            });```
#

and you just register a state by adding a system component now

#

removed all the generic code

#

and it uses dynamic type handles now

rotund token
#

state of game (client/server), UI, camera

#

are the main ones i use atm

rustic rain
#

hmmm

solemn hollow
rustic rain
#

I just had an idea of singleton with only purpose - state of specific hash

#

so, basically you create singleton tag, IEnableble

#

and every time you want to track specific state in System

#

you create query for that tag

#

check it's value (it's not actually tag, it stores hash)

#

for example String to hash

#

and if you got your entity you obtain entity and it's enabled state ptr

#

or simply enabled state ptr

#

oh also, it's not actually singleton

solemn hollow
#

what would be the diffrence to a enum stored on your singleton?

rustic rain
#

the whole point of it - reduce amount of singletons and store them in single chunk

#

😅

rotund token
#

conveniently my StateSystemInstance is the same between all cases

#

so it's same chunk

solemn hollow
#

hmm i remember someone doing something like that. mb it was dreamingimlatios. WorldBlackBoardEntities or sth like that

rotund token
#

that said i really don't get your idea issue or what it's used for

solemn hollow
rotund token
#

state.value = 5

#

or for my flag ones i store a bitarray as the state

#

so it's just like
state.value[123] = true

#

(but instead of magic numbers I use K or settings files/other config)

solemn hollow
#

btw very confusing to have SystemState and StateSystem^^

rotund token
#

i dont have statesystem anymore

#

(if you're looking at core look at the 0.9 branch not master)

#

(master will work but it's basically just, the state after 1.0 update)

solemn hollow
#

i was looking at your camera system

rotund token
#

oh

solemn hollow
rotund token
#

hmm maybe it won't 😄

#

maybe i branched 0.9 when 1.0 came out

#

thought i got it to work then branched but yeah you are probably right

solemn hollow
#

huh how do i actually get the right link from gitlab to get the 0.9 branch?

#

until now i did it in manifest manually

rustic rain
#

might as well just create NativeArray

rotund token
#

just click master drop down and switch it to 0.9

solemn hollow
rotund token
#

or are you pulling this via package manager

solemn hollow
#

yes package manager

#

i wonder how to get the right version in there right away

rustic rain
#

duuuuud

rotund token
#

ooo i haven't done git manifest pull in ages

rustic rain
#

I now get what we need

rotund token
#

there is a way though

solemn hollow
#

without editing manifest

rustic rain
#

we need a method in SystemState

#

smth like

#

RequireForUpdate(bool* boolPtr)

#

that would make thing so much easier and faster

rotund token
#

but just for you manarz

#

merging 0.9 to master

solemn hollow
#

haha i would have managed

rotund token
#

done

solemn hollow
#

was just wondering for the future

#

thx ❤️

rotund token
#

id do it more frequently but openupm doesn't support gitlab -_-

solemn hollow
#

well gitlab is changing / has changed its pricing anyways?

rotund token
#

anyway to answer your quest i believe you need to put

#

#revision

#

after giturl

solemn hollow
#

is there still a real reason to stay there^^

rotund token
rotund token
solemn hollow
#

yes. afaik the free repo size got much smaller now

rotund token
#

i don't know how anyone can use github with their 1GB LFS limit

rotund token
#

vs 1GB on github

solemn hollow
#

huh im pretty sure they went way down. or will soon

rotund token
#

well it's gone down to 5GB

#

according to their faq

#

my primary repo is above github storage limits

#

and it's tiny

#

like 8 models...

#

so yeah sure, i'll still take the 5x lfs limit over github ^_^'

solemn hollow
#

true. do they still have private repos with 5GB too?

rotund token
#

yes

#

90% of my repos are private

#

essentials was my 50th repo!

solemn hollow
#

hmm strange i really thought i read some changes that made me go wtf

rotund token
#

i will say that if you were paying for storage

#

github is much cheaper

#

their 50GB storage is only $5/month i think

#

$5 will only get you 10GB on gitlab

#

$5 for 50GB is pretty good...

light mason
#

are there any doc on how to build with entities 1.0

#

to android

solemn hollow
#

oh on the topic of packages i need some workflow advise:
right now in my main Project i got everything split up in small assemblies. i want to reuse parts in another project. So i thought ill make packages out of it. How would i have to set it up so that i can modify the package in my main project and get the changes in my other projects and vice versa? or is that generally a bad idea and i should only work on my packages in isolation?

solemn hollow
light mason
#

if you edit local package on disk it should just work

rotund token
#

i have a lot of projects i work on at same time that share packages

#

so if i want a change in another repo

#

i just pull

rustic rain
#

oh man, I really now want this feature
RequireForUpdate(bool* ptr)

#

it also seems like it's super easy to implement, assuming you modify package

#

daaamn

rotund token
#

you really don't like the default entities flow do you 😅

#

you don't even need RequireForUpdate(bool* ptr)

rustic rain
#

I feel bad for creating a whole archetype just for one boolean

rotund token
#

you can literally just Enable = false/true

#

to replicate the same behaviour

solemn hollow
#

@rotund token and i have to push changes in those submodules seperately from the project they are in?

rustic rain
#

because goal is not modification of System

#

it's modification of data

rotund token
#

Enable literally is just a bool ptr that stops system running

rotund token
rustic rain
#

yeah, but what if I want some system to run depending on 2 booleans

#

and another only on one?

#

yep, your solution is broken already

rotund token
#

but i only use submodules in my major project where all the libraries come together

#

individually i dont include unity in my library so i dont use submodules

#

i just have like 4 separate git repos

solemn hollow
brave field
#

If I have multiple IJobEntity inside ISystem. Will it auto update in order? Or I need to manually JobHandle?

rotund token
#

it will update in the order you schedule them

#

if you don't specify dependency by default it'll schedule linear

#

(within the system)

#

new Job1().Schedule();
new Job2().Schedule();
new Job3().Schedule();
codegens into
state.Depedency = new Job1().Schedule(state.Depedency);
state.Depedency = new Job2().Schedule(state.Depedency);
state.Depedency = new Job3().Schedule(state.Depedency);
*this is only true for IJobEntity, normal jobs that don't do codegen need to be dependency scheduled

brave field
rotund token
#

all these libraries depend on core so have at least a git repo for that included

#

some have multiple dependencies

#

and yeah i have my main game which is a full unity project with submodules on all my libraries

light mason
#

ooof I don't know what I'm missing here but I cant get my entity to render on android build. Any suggestion/common pitfalls 😦

rotund token
#

what render pipeline

light mason
#

URP

#

simple cube

#

one cube

gentle gyro
light mason
#

buid setting window

gentle gyro
#

0.51?

light mason
#

1.0

rotund token
#

cube in a subscene i assume?

gentle gyro
#

Ah, haven't done much with 1.0...

rotund token
#

i thought 1.0 brought much wider android support

#

though i don't do mobile dev anymore so haven't tested

light mason
#

mmm

gentle gyro
#

Could you screen capture your settings?

#

Maybe I can spot something similar to 0.51...

light mason
rotund token
#

oh quest 2?

light mason
#

yea

gentle gyro
#

Also, Player settings...

brave field
rotund token
#

ive seen other people compain about quest 2 not rendering

#

in fact david777 was one of them

light mason
rotund token
gentle gyro
light mason
#

graphic api ?

gentle gyro
rotund token
#

thats very different unfortunately

light mason
#

i had 51 working

#

not well

gentle gyro
#

You should set your symbols to 'Debug'.
might give you some info...

light mason
#

but rendering

gentle gyro
gentle gyro
light mason
#

ill try GLS3

gentle gyro
#

Do you have ENABLE_HYBRID_V2 set...

light mason
#

NO !!!

gentle gyro
#

Could be it....

light mason
#

is that still a thing

gentle gyro
#

Not sure...

rustic rain
#

everything but Vulkan is highly experimental

gentle gyro
#

Graphics api...

light mason
#

Vulkan

gentle gyro
#

Do you have the rest of your settings?

light mason
#

IL2CPP?

gentle gyro
rustic rain
#

yeah

gentle gyro
rustic rain
#

it's deprecated

gentle gyro
#

not sure if it would help...

light mason
#

bugger

gentle gyro
rustic rain
#

BUild package is

light mason
#

no the scriptble build thing

gentle gyro
light mason
#

so is ENABLE_HYBRID_V2 needed in 1.0?

#

or some other

rustic rain
#

doubt

#

try Mono

#

IL2CPP is troublesome

light mason
#

k

gentle gyro
#

Also, have you looked at your logcat?

rotund token
light mason
#

didnt see anything there

gentle gyro
light mason
#

yea, one sec it thinking hard

gentle gyro
#

🙂

light mason
#

its dong the mono build

#

doing

rustic rain
#

@rotund token do you happen to know whether there's a way to tie entity created in BakingSystem to a gameobject?

#

same as Scene reference

rotund token
#

do you want a reference to the gameobject on the entity?

#

or do you want to just tie an entity to the same game object authoring

rustic rain
#

yeah, I create a several entities

rotund token
#

just add a reference to it on a class icomopnentdata?

rustic rain
#

no, that's now what I meant

#

I meant

#

same way as conversion does it

#

whether it's main entity

#

or CreateAdditionalEntity in Baker

rotund token
#

i dont really get what you want

#

do you just want a unique hash of it?

rustic rain
#

I want to reimplement same behavior Baker does during Entity creation

rotund token
#

oh

#

i got you now

#

you want CreateAdditionalEntity

#

in bakingsystem

#

i believe just add it to the DynamicBuffer<AdditionalEntitiesBakingData>()

#

and set AdditionalEntityParent on the new entity

#

slightly unsure of a nice way to get the authoringInstanceId id though

rustic rain
#

🤔

#

eh

#

Don't think it's worth it then

#

too much boilerplate that might get invalid on next update

#

what is required for for simple entity creation btw?

#

what component name?

rotund token
#

just need scenesection

rustic rain
#

so I guess

#

I can copy it from main entity

#

assuming I use it

#

to create other

rotund token
#

yep

rustic rain
#

🤔🤔🤔🤔🤔🤔

#

scene section is just integer, right?

#

ah, no it's not

solemn hollow
#

@rotund token i imported your Core lib. had to throw out your old EventSystem. EventSystem does not exist anymore. whats the replacement now?

light mason
#

can i not use mono backend with OpenXR?

gentle gyro
#

Why?

light mason
#

it auto set me back to IL2CPP when I hit the "fix problems" button in openxr tab

gentle gyro
#

What was the problem it was fixing?

light mason
rotund token
#

i just moved the nativeeventstream into the core library

#

and my event system now depends on Core because of this

light mason
#

only option I have is

gentle gyro
#

You have to select the other ARMv7

#

You can use Mono...

solemn hollow
light mason
#

Only arm64 is supported on Android with OpenXR. Other architectures are not supported.

rotund token
#

I actually don't use my event system anymore

gentle gyro
#

Are you sure? I'm sure I used ARMv7... I'll check once I get my project open...

rotund token
#

My 2 libraries that used it now use custom singleton instead

#

(why I needed the event stream in core)

#

In still maintaining it though

light mason
rotund token
#

But at some point I'll probably make a generic singleton api alternative

gentle gyro
light mason
#

then hitting that set me back to IL2CPP

#

b13

#

2022.b13

gentle gyro
#

Maybe it's deprecated...

solemn hollow
light mason
#

2022.2.b13

#

holy molly

#

internal word were not that

#

words

#

what can I look for in log

gentle gyro
#

Wait

#

No, I don't get it...

light mason
#

in log no errors one war during play

#

2022/10/29 02:41:15.433 7680 7680 Warn UnityMain type=1400 audit(0.0:2556): avc: denied " {" read" } for " name="u:object_r:vendor_board_init_prop:s0" dev="tmpfs" ino=14955 scontext=u:r:untrusted_app:s0:c114,c256,c512,c768 tcontext=u:object_r:vendor_board_init_prop:s0 tclass=file permissive=0

gentle gyro
#

No idea...

light mason
#

and we are sure we dont add the subScene to the build scene list?

gentle gyro
#

Ah

#

Does yours show the subscene in the build list?

#

If not, add Open Scenes

solemn hollow
#

@rotund token

#

i cannot install 2.2.0

#

manifest file is correct but package manager always get me 2.1.0

gentle gyro
solemn hollow
#

it worked fine with #1.2.5

light mason
#

Got error

gentle gyro
#

What error?

light mason
#
  1. ArgumentException: Cannot find TypeIndex for type hash 7881543491081840453. Check in the debug file ExportedTypes.log of your project Logs folder (<projectName>/Logs) the corresponding Component type name for the type hash 7881543491081840453. And ensure your runtime depends on all assemblies defining the Component types your data uses.
#
  1. at Unity.Entities.Serialization.SerializeUtility.ReadTypeArray (Unity.Entities.Serialization.BinaryReader reader, Unity.Entities.Serialization.DotsSerializationReader dotsReader) [0x000c2] in E:\Work\RoughSpaghettiStudio\Projects\Occipital-Project\unity\occipital-ecs-build\Library\PackageCache\com.unity.entities@1.0.0-exp.8\Unity.Entities\Serialization\SerializeUtility.cs:520
#
  1. at Unity.Entities.Serialization.SerializeUtility.EndDeserializeWorld (Unity.Entities.ExclusiveEntityTransaction manager, Unity.Entities.Serialization.DotsSerializationReader dotsReader, Unity.Entities.Serialization.SerializeUtility+WorldDeserializationStatus& status, Unity.Entities.Serialization.Ser
#

something getting stripped ?

gentle gyro
#

Mine didn't work with subscene added...

solemn hollow
#

@rotund token package.json version is not updated

gentle gyro
#

Got a mess of FenceChecker errors:

light mason
#

no on device

#

during loading scene

#

the non subscene object load

#

as a control

#

can i do a build w no stripping

gentle gyro
#

Might as well try it...

#

I better get to bed soon, it's a bit late here...

light mason
#

ok appreciate the help

gentle gyro
#

No worries! If you figure it out I would Love to know what it is..

#

Have a good night @light mason!

light mason
#

GN !!

rotund token
#

I just quickly split off the 2.2 branch

#

It depends on core now which is very different to previous

#

And not sure what to do about this

#

Maybe I'll include native event stream in the package conditionally compile out if core exists

#

But yeah this is why it's a branch atm not merged to master

rustic rain
#

Jeeez. Why Dispose is still getting called on those? What else can I add to avoid disposed collections.
It causes Editor to flood with errors, until I restart

                ref var val = ref UnsafeUtility.As<NativeReferenceUntyped, NativeReference<int>>(ref copy.Value);

                if (val.IsCreated && val.m_AllocatorLabel.IsValid)
                {
                    val.Dispose();
                }
solemn hollow
rotund token
rustic rain
rotund token
rotund token
solemn hollow
rustic rain
rotund token
rotund token
#

it'll still be pulled into library

solemn hollow
#

oh you mean what i need to put into the manifest file. yes i did that

rotund token
#

well you're doing something really weird issue so it's hard to say

rustic rain
#

nvm

#

found where I disposed it

solemn hollow
rotund token
#

hmm

#

it'll appear as 2.1 but it should pull the 2.2.0 branch

#

versioning has nothing to do with git dependencies

solemn hollow
#

hmm ill try again

rotund token
#

no i see same issue

#

oh i renamed stuff in core

#

namespaces

#

and haven't pushed it to event

solemn hollow
#

ah okay that explains the errors im seeing

rotund token
#

ok should be fixed though i haven't updated my testing for 1.0 yet so i can't say for certain

rotund token
#

i wish package.json supported git repos

#

would make things so much easier for me

rustic rain
#

hm

#

if I Instantiate prefab, will it remove BakingOnly tag?

solemn hollow
#

seems like this is outdated now :
var writer = eventSystem.CreateEventWriter<DamageEvent>();
CreateEventWriter doesnt exist anymore?

#

i used the 1.2.5 version of eventsystem

rotund token
#

Oh

#

Yeah 2.0 is a huge rework

#

To work with isystem

#
public struct SampleSystem : ISystem
{
    private EventProducer<DamageEvent> producer;

    public void OnCreate(ref SystemState state)
    {
        this.producer = state.World.GetExistingSystemManaged<EventSystem>().RegisterProducer<DamageEvent>();
    }

    [BurstCompile]
    public void OnUpdate(ref SystemState state)
    {
        NativeEventStream.Writer writer = this.producer.CreateWriter();

        this.producer.AddJobHandle(state.Dependency);
    }```
solemn hollow
#

as i understood it from the forum thread you wont maintain version 1 for much longer so i though i might as well switch now.

rotund token
#

yeah i updated 1.X to 1.0

#

but i don't intend to update it again

#

i didn't want to break people who were updating

#

i don't expect it'll break anytime soon/ever

#

unless there's an unexpected API change

#

but yeah i think ISystem is the future and it doesn't work with that

brave field
#

Is that possible to GetSingleton / GetSingletonEntity inside IJobEntity?

rotund token
#

no

brave field
#

🥲

#

And also EntityQuery cannot exist inside IJobEntity?

rotund token
#

i dont believe so

#

though i havent tested in 1.0

#

but it doesn't make much sense?

#

just pass the data in