#archived-dots

1 messages ยท Page 25 of 1

misty wedge
#

Is there something that can keep a Baker from running?

#

One of my bakers adds a buffer to the entity but it isn't showing up for some reason. Another component on it with a baker works fine ๐Ÿคท

rustic rain
#

hm

#

seems like map.GetValuesForKey() has been removed for hashmap

safe lintel
#

should still be there for NativeMultiHashMap

rustic rain
#

true

safe lintel
#

anyone know if you can have multiple bakers for a specific authoring class?

#

sort of knee deep in fixing errors so will be some time before I can actually test if this works or is a dumb idea

rustic rain
#

are there errors if you make one?

#

at very least can just make empty one

#

without implementation

haughty rampart
#

the today released unity 2023 version compatible?

safe lintel
#

well i cant even run the baking system with all the other errors currently so it will be a while before I can actually test it

rustic rain
#

how do you access ISystem struct these days?

safe lintel
#

i wouldnt put any bets on 2023 being compatible given a large part of the 2022 beta is the dots preview

rustic rain
#

looks like UnmanagedWorld is safe to be passed without ref now

#

similiar to Native containers

haughty rampart
#

hey DOTS team.
.net 7 now has abstract static interface members. since we talked about how burst only does static's and how it does some magic for IJob etc, do you think that will be game changing for DOTS once unity coreclr is available?

rustic rain
#

static interface

#

oh man

#

what a dream

wraith hinge
#

i'm not really a .net expert, so i don't really know, but let me re-emphasize that coreclr is probably over a year away for the player, and much longer for the editor, and even longer than that to become enough of a default that we can rely on specific features in it.

frosty siren
#

how conversion should happen in 0.51 if i need conversionSystem.AddHybridComponent? For now i see no alternative for AddHybridComponent.

rustic rain
#

they are simply managed components now

#

same as CompanionLink

frosty siren
rustic rain
#

that is a question yeah

#

back in 0.51 you could register component

frosty siren
rustic rain
#

not sure about now

frosty siren
#

same in 1.0 ?

rustic rain
#

well probably not

frosty siren
#

or bakers works fine in hybrid way?

rustic rain
#

since there aren't gocs anymore

haughty rampart
rustic rain
#

hybrid components will be stored somehow

#

and reinstantiated on demand

haughty rampart
wraith hinge
#

3.8.0 iirc, why?

rustic rain
#

hmmmm
internal unsafe partial struct WorldUnmanagedImpl

#

I wonder if it's safe to add fields to it

wraith hinge
#

i mean, maybe, but also what are you trying to do

rustic rain
#

My game relies on Ticks heavily
I want to store it in a similiar to Time fashion

haughty rampart
# wraith hinge 3.8.0 iirc, why?

cause i wanted to write an IIncrementalGenerator to test if i can do something equivalent to [GenerateAuthoringComponent]
unfortunately not possible with 3.8.0

wraith hinge
#

weeelll

#

i think we provide some later roslyn libraries for source generators to use, up to 4.2.0 maybe?

#

and if your source generator references those it'll load them or something. it was confusing. but i did see the later versions in the editor install

haughty rampart
#

hm, i'll try then. see what's possible.
you know. some R&D myself. imma also share the results for unity. if you wanna take a look at it, feel free to ๐Ÿคท

haughty rampart
proud jackal
haughty rampart
proud jackal
#

Maybe you can, I never did it that way, i let Unity generate the meta file and then I edit in the flag gpAkkoShrug

haughty rampart
#

last time it worked :)

#

God the latest discord alpha is buggy

#

Never really had issues, but the current one doesn't sent half of my messages. Do not recommend

rustic rain
#

I wonder if there will be any tutorial on how to implement your own SystemAPI

errant hawk
#

well this is new:

rustic rain
#

wow, so soon

proud jackal
rustic rain
#

which will add line to codegen

#

of smth like

#

this.World.Unmanaged.m_impl.Tick

errant hawk
haughty rampart
#

eh, really not needed. once global namespace support arrives, you'll hide all the relevant namespaces anyway

rustic rain
#

Inspector<T> hmmm

#

what was it replaced with?

#

tertle mentioned PropertyInspector<T>

#

but my IDE can't find it either

tropic venture
#

does 1.0 need a build script to build? or do i use the regular build window

tropic venture
#

awesome ๐Ÿ‘

#

any chance Rival character controller works out of the box? or not a chance - need to wait for update

#

guess i'll TIAS...

haughty rampart
#

not a chance

tropic venture
#

โ˜น๏ธ i see...

haughty rampart
#

previously i saved an entity 'prefab' with runtime conversion in a system itself. how can i do this now with the bakers?

tropic venture
#

if i use a regular GameObject-based character controller, am I losing all the benefits of ECS Graphics/renderer?
if yes - how can I make a minimal controllable fly-around camera just to try and test some ECS scenes
if not - is it only ECS Physics i'm losing out on, but not ECS graphics rendering?

safe lintel
#

@haughty rampart not really sure what you're asking, how to do runtime conversion now?

rustic rain
#

throw new InvalidOperationException($"Entity {entity} doesn't belong to the current authoring component.");

#

ahem

#

anyone knows what this exception means?

haughty rampart
haughty rampart
safe lintel
#

@haughty rampart can you not query for it like any other singleton entity?

haughty rampart
rustic rain
#

ahem

tropic venture
rustic rain
#

and how am I supposed to access Entity that is not converted

haughty rampart
tropic venture
#

ah, so i need a camera component object inside the subscene?

haughty rampart
haughty rampart
rustic rain
#

๐Ÿค”

haughty rampart
#

it says that in the docs

rustic rain
#

that sucks

tropic venture
haughty rampart
#

has nothing todo with where the camera is located. if you're looking at a GameObject it will render with the normal renderer. if you are looking at an Entity it will render using the HybridRenderer

tropic venture
#

ahh

#

ok so for now i'll use GO-based character controller, and the whole graphics scene i'm testing will be in a subscene, so it will use ECS graphics renderer - just not physics at the moment i guess

haughty rampart
#

yes

haughty rampart
#

which it should not

safe lintel
#

were you storing it in a different world prior? because if not it existed then as well(prefabs arent automatically included in queries)

haughty rampart
safe lintel
#

so the issue is that GameObjectConversion.ConvertFromHierarchy no longer exists(/slated for removal)? and what to do for its replacement?

haughty rampart
#

pretty much. or how i can bake an entity through a subscene without putting it in the world, but rather saving it <somewhere else>

#

think of it like a bullet casing. you don't want a bullet casing to exist in the world already, but you want to spawn one each time you fire a shot from a weapon

safe lintel
#

ehhh if you can bake it in a subscene you wouldnt need that GameObjectConversion.ConvertFromHierarchy so if you mean outside of a subscene you need to just do all the conversion manually, ie figure out your own runtime conversion with a monobehaviour

#

if you dont want the bullet casings to "exist" as like "live" entities, you could store them as entity fields on another entity's componentdata, ensuring they get converted and hang around as prefab entities but not processed by gameplay/physics systems

haughty rampart
safe lintel
#

presumably you could add a prefab component on the baker and just be done with it as another route

#

still converting all my crap so cant test it out

gloomy halo
#

Same as with conversion before

haughty rampart
gloomy halo
#

Why not? You could have one entity with many prefabs on it

safe lintel
#

Prefab

haughty rampart
haughty rampart
safe lintel
gloomy halo
haughty rampart
gloomy halo
haughty rampart
#

like i can add the Prefab as a component with the baker

#

but not sure what you're referring to

gloomy halo
#

results in an baked entity with the prefab comp (same as conversion with IDeclarePrefabs)

haughty rampart
#

yeah but that stores the entity in a component

#

which is still not something i want

errant hawk
rustic rain
#

Entities.ForEach uses ISharedComponentData type StarShared. This is only supported when using .WithoutBurst() and .Run().
Bruh

#

seriously

haughty rampart
#

? it's managed

#

what do you expect

rustic rain
#

no

#

it's not

#

Unmanaged shared components are here

#

ForEach doesn't about it, it seems

haughty rampart
#

you should migrate away from Entities.Foreach anyway

rustic rain
#

yeah

#

Query

gloomy halo
haughty rampart
rustic rain
#

it is Run

#

it's for baking

haughty rampart
tropic venture
#

something aint right... tried creating a SubScene by adding a single Plane object (shaded water) to new sub scene - now it's been processing like this for too long...

haughty rampart
rustic rain
#

ahem

#

why not?

haughty rampart
haughty rampart
haughty rampart
# rustic rain why not?

......since you can ONLY access the entity the baker runs on AND entities the baker creates

errant hawk
#

this is why entity prefabs need to exist

haughty rampart
errant hawk
#

stuffing a single prefab into a subscene doesn't make sense

rustic rain
#

judging by description

haughty rampart
pulsar jay
haughty rampart
rustic rain
#

hmm

#

can't find SystemAPI.Query

#

examples

#

any tip where are they?

errant hawk
haughty rampart
pulsar jay
rustic rain
#

Ah yes, RefRW

haughty rampart
tropic venture
haughty rampart
#

better restart unity

tropic venture
#

lol ok killing..

rustic rain
#

bruh, to hell with Query

#

it doesn't support anything but IComponentData

wraith hinge
#

@proud jackal i was sure you fixed that already, no? ^

haughty rampart
#

def doesn't support DynamicBuffer

#

says in the docs

wraith hinge
#

maybe you have to make an aspect, i forget

proud jackal
#

Dynamic buffers are supported :3

#

Don't trust the docs until 1.0 release

errant hawk
wraith hinge
#

shared components can be unmanaged now

rustic rain
#

and buffer

errant hawk
#

Example: Query<RefRW<LocalToWorld>, SomeManagedType>

rustic rain
#

I have a trouble with conversion though

tropic venture
#

are Terrains a thing in ECS yet?

wraith hinge
rustic rain
#

I have a GameObject reference in authoring component to other GameObject and during baking I need to add component to the references GO

proud jackal
haughty rampart
# wraith hinge shared components can be unmanaged now

you guys have any plans to ship an analyzer for DOTS btw? cause if not, i'm def gonna write one and contribute it to the MicrosoftAnalyzersForUnity github since it ships natively with unity now. (since, like we saw yesterday, what to annotate with what and what not and, ..... can be a bit confusing sometimes)

rustic rain
tropic venture
#

gah not even sure the regular character controller will work... ๐Ÿ˜ฌ

wraith hinge
haughty rampart
tropic venture
tropic venture
#

i thought Unity official starter assets FPS controller would be the way to go...

tropic venture
haughty rampart
haughty rampart
#

they will at least have a flying camera controller

tropic venture
haughty rampart
#

nah

whole gyro
#

I've got a baking question. Can I have one baker that adds a DynamicBuffer and another baker that appends to it?
It would appear that the baker API doesn't let you do this since the buffer was added by another baker. Perhaps I need to come at this problem another way

errant hawk
haughty rampart
haughty rampart
tropic venture
#

@errant hawk i went through this a bit earlier - from my understanding basically the character controller camera will still render ECS SubScene content using full advantage of the ECS graphics renderer, just the controller physics wont interact with the ECS physics.... or is this not accurate?

tropic venture
#

BTW how does that actually work - does untiy player go through 2 rendering processes? does one render-to-texture on the other or something?

#

how does unity "merge" graphics from GO-world and ECS-world

haughty rampart
tropic venture
#

ah

errant hawk
errant hawk
rustic rain
#

it's all basically shipped to the same rendering pipeline you have in your project

haughty rampart
#

just through different paths

tropic venture
#

except ECS graphics benefit from a bunch more awesome than GameObjects?

errant hawk
errant hawk
tropic venture
#

right, but also - there's ECS-specific optimizations and scene-graph-like calculations etc.?

whole gyro
# whole gyro I've got a baking question. Can I have one baker that adds a DynamicBuffer and a...

My use case is this. I have a buffer type that represents the different control prompts when hovering the object in game. Various authoring components (Interactable, Pickupable, etc.) all have their own control prompt that they want to add to this buffer. For example, the PickupableBaker would, ideally, set some flag to mark the object as able to be picked up and also append to the control prompt buffer that is used by some UI system.

I'm using RequireComponent on the different authoring scripts to ensure that the ControlPromptAuthoring component is present, but I can't figure out how to ensure the PickupableBaker runs after the ControlPromptBaker. It also doesn't like me appending to a buffer that was added by another baker.

whole gyro
#

I guess I could use a baking-only component like AddToControlPromptBuffer. Then in a baking system, find all of these and append them to the buffer. Seems kinda roundabout but I assume it would work.

tropic venture
errant hawk
haughty rampart
tropic venture
#

ok trying now...

haughty rampart
errant hawk
whole gyro
tropic venture
# haughty rampart enter safe mode and what errors do you get?

Library\PackageCache\com.unity.render-pipelines.core@14.0.3\Editor\Debugging\DebugUIDrawer.Builtins.cs(228,55): error CS1061: 'DebugUI.FloatField' does not contain a definition for 'GetValue' and no accessible extension method 'GetValue' accepting a first argument of type 'DebugUI.FloatField' could be found (are you missing a using directive or an assembly reference?)

haughty rampart
tropic venture
whole gyro
haughty rampart
tropic venture
#

ok trying..

errant hawk
rustic rain
#

sirs pls
Anyone solved how to get another GO's entity reference during Baking?

#

I am desperate

rustic rain
# whole gyro GetEntity()?

[Worker2] InvalidOperationException: Entity Entity(12:1) doesn't belong to the current authoring component.

#

if called in Baker

tropic venture
haughty rampart
tropic venture
#

ok i see just 1 file

whole gyro
rustic rain
haughty rampart
errant hawk
tropic venture
#

ah cool ok, i just copy that into my other working project? lemme see what i need to attach it to....

whole gyro
# rustic rain the latter

Hmm, well I'm still knee deep in my own baker errors so maybe that doesn't work? From what I read, that is how you're supposed to reference prefabs or other GO in the scene. I'd also like to know the right way to do this.

haughty rampart
#

i think that's to reference other GO, not their converted entities

safe lintel
#

i only briefly glanced at it but could you add temp baking components in your baker and then use a baking system to homogenize the results? @whole gyro

rustic rain
#

I have direct reference to other GO

#

and I need it's Entity

#

So that I can add component with reference to that entity

whole gyro
rustic rain
#

can't beleive smth so basic previously is now so unclear

whole gyro
whole gyro
errant hawk
rustic rain
#

during baking

#

is uuugh

#

and in this case

#

I have no idea how to solve it

haughty rampart
#

afaik there is no runtime conversion anymore

rustic rain
#

tbh

#

that's not the point

#

I'm just saying that if the only way to get entity reference in baking

whole gyro
#

@rustic rain I think the error you got is because you can only call AddComponent on the primary entity, not the referenced entity. So, I think you can call AddComponent(new ReferenceToOtherSceneEntity { Entity = GetEntity(SomeGameObject) });

rustic rain
#

is through entities runtime data

#

then this is hot garbage

errant hawk
haughty rampart
whole gyro
#

It's not runtime if its in a baking system. Those runtime systems just run during baking, but after the simple Bakers<T> run.

rustic rain
#

so

whole gyro
#

At least, I think that's how baking systems work. They are just the new GameObjectConversionSystem.

rustic rain
#

instead of simply getting entity reference and adding component to it
Now I have to create new component type which

#

which will reference that other entity

rustic rain
#

and add to it in separate BakingSystem

haughty rampart
errant hawk
#

A lot of this could have been solved with an entity-only baking/construction/whatever UI

#

In the end it's all getting converted

whole gyro
rustic rain
#

nnnah, previous approach was more convinient

#

that's all

haughty rampart
rustic rain
haughty rampart
rustic rain
#

I mean

#

previous tools

#

possibilities

whole gyro
rustic rain
#

that's what I meant

#

cause new approach forces me to have way more code

#

then I used to have

haughty rampart
#

but it's way more robust code

errant hawk
# whole gyro That last one. CheckValidAdditionalEntity(entity)

Ah yeah, but this is all it's doing:

        private unsafe void CheckValidAdditionalEntity (Entity entity) {
            for (int i = 0; i < _State.BakerState->Entities.Length; i++) {
                if (_State.BakerState->Entities[i] == entity) {
                    return;
                }
            }

            throw new InvalidOperationException($"Entity {entity} doesn't belong to the current authoring component.");
        }
#

So it makes me wonder why tf this is even a thing

proud jackal
rustic rain
whole gyro
errant hawk
rustic rain
haughty rampart
rustic rain
#
        public override void Bake(SpaceObjectAuthoring authoring)
        {
            AddComponent(new ShipComp()
            {
                movementSpeed = authoring.shipSpeed, rotationSpeed = authoring.maneuverability
            });

            var graphics = GetEntity(authoring.graphicsEntity);
            AddComponent(graphics,
                new Selectable() { type = authoring.selectableType, mainEntity = GetEntity(authoring) });
        }
#

here's what I want

#

but that won't work, because I can't attach components to other entities

whole gyro
rustic rain
#

that's the point though

haughty rampart
errant hawk
#

I think Bakers shouldn't be for just a specific entity(s), but more of a filter to what entity you want to modify

rustic rain
#

I can't have any authoring on graphics GO, otherwise it would be... so much pain to author

errant hawk
whole gyro
haughty rampart
errant hawk
#

after all, they are guidelines

haughty rampart
#

๐Ÿ–• fuck devs that give a fuck about robust guidelines

#

that's how bad code and spaghetty trash surfaces in a project

errant hawk
rustic rain
#

you know what

#

I'll try some hack

#
            _State.Ecb.AddComponent(graphics,
                new Selectable() { type = authoring.selectableType, mainEntity = GetEntity() });
haughty rampart
errant hawk
#

good idea

rustic rain
#

welp, now subscene doesn't even bake ๐Ÿ˜…

haughty rampart
#

๐Ÿ˜’ .....and now people wonder why unity doesn't distribute best practices

rustic rain
#

actually seems like it works, allthough gotta check

#

whether data is valid

errant hawk
# rustic rain welp, now subscene doesn't even bake ๐Ÿ˜…

Try this:

public void AddComponent<T> (Entity entity, in T component) where T : unmanaged, IComponentData {
            if (_State.PrimaryEntity == entity) {
                AddTrackingForComponent<T>();
            }        

            AddDebugTrackingForComponent<T>(entity);
            _State.Ecb.AddComponent(entity, component);
        }
rustic rain
#

I see

#

well anyways, hacks work xD

#

so we're fine

errant hawk
#

What did you change?

haughty rampart
#

eh, whatever guys. get your spaghetty fresh from the tap if you want

rustic rain
#

it does work

#

finished subscene entities references are valid

errant hawk
haughty rampart
#

They have

#

In a robust way

errant hawk
#

clearly not if @rustic rain is having a hard time finding a supported solution

#

that isnt a hack

rustic rain
#

guys, chill

haughty rampart
whole gyro
#

So as I understand it, Bakers are only for operating on the primary entity and any other entities the baker created, and only the components that were added by the baker (no appending to a buffer added by another baker). These restrictions allow all the bakers to run at the same time without stepping on each other, which helps with determinism. If you want to work around those restrictions, you create baking systems. With that comes the responsibility of ordering that system in the baking pipeline such that it works as expected and is deterministic. I guess I can get onboard with that even if it means more code for certain things.

haughty rampart
#

๐Ÿ‘Œ

errant hawk
#

You then have to maintain that code, ensure it works, test it, debug it, etc

haughty rampart
#

Im Fully on board with the new way.

#

It makes sense from a logic flow view

errant hawk
#

I'm assuming the baking system only runs once, or when a value is changed in the inspector

#

There could also be subscene-specific bakers as well

#

only entities in that sub scene can be modified

#

I think adding a per-sub scene baker is the way to go, because the likelihood of needing an entity outside the scene is incredibly low

#

(ignoring prefabs)

rustic rain
#

manual could use some explanation over internal structure of baking system

errant hawk
#

that too

whole gyro
#

Each subscene is converted in isolation, right? So it would spin up all the baking systems for each subscene separately

errant hawk
whole gyro
#

But a Baker<T> can only modify the primary or entities the baker created (this is different from entities in the game object's hierarchy).

#

I guess I'm not sure which you were talking about, but wanted to point out that when I was talking about a baking system, I mean a normal SystemBase or ISystem that is running in the baking group (there is some new attribute I forgot to specify this). Separately, there is the Baker<T> types that have the restrictions we were talking about above.

errant hawk
whole gyro
#

Example of a baking system:

[WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)]
partial class BakingOnlyEntityAuthoringBakingSystem : SystemBase
{
   protected override void OnUpdate()
   {
      // โ€ฆ Your code here โ€ฆ
   }
}
errant hawk
#

The baking system is just a system

#

ofc it can do anything, in theory

whole gyro
#

Yeah exactly, but it provides a per-subscene kind of baking thing you were looking for, no?

#

The syntax isn't quite as concise, but in terms of flexibility and features

errant hawk
#

using the Baker<T>

safe lintel
#

i mean you shouldnt be doing that because theres no way to guarentee what sort of outcome happens if you split them into different subscenes

rustic rain
#

ok, so
Here's what I assume is intended way

    public class SpaceObjectBaker : Baker<SpaceObjectAuthoring>
    {
        public struct GraphicsReference : IComponentData
        {
            public Entity value;
            public SelectableType type;
        }

        public override void Bake(SpaceObjectAuthoring authoring)
        {
            AddComponent(new ShipComp()
            {
                movementSpeed = authoring.shipSpeed, rotationSpeed = authoring.maneuverability
            });

            var graphics = GetEntity(authoring.graphicsEntity);
            AddComponent(new GraphicsReference { value = graphics, type = authoring.selectableType });
        }
    }

    [WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)]
    public partial class SpaceObjectBakerSystem : SystemBase
    {
        protected override void OnUpdate()
        {
            var em = EntityManager;
            var buffer = new EntityCommandBuffer(Allocator.Temp, PlaybackPolicy.SinglePlayback);
            Entities.WithAll<ShipComp>()
                .ForEach((Entity e,
                   in SpaceObjectBaker.GraphicsReference graphics) =>
                {

                    buffer.AddComponent(graphics.value, new Selectable { mainEntity = e, type = graphics.type });
                })
                .WithoutBurst()
                .Run();

            buffer.Playback(em);
            buffer.Dispose();
        }
    }
whole gyro
errant hawk
#

given the current limitations

#

as the "safe" way

whole gyro
#

Wait, you can mark the GraphicsReference as baking only though

rustic rain
#

๐Ÿค”

#

wdym

errant hawk
#

also @rustic rain I think you can remove the GraphicsReference during the Foreach

rustic rain
#

yeah

whole gyro
rustic rain
#

just remove through query

#

or this

whole gyro
#

I just can't remember the name of it haha

rustic rain
whole gyro
#

[TemporaryBakingType]

errant hawk
#

I don't do a whole lot of ECS rn so I don't do a whole lotta digging into features

whole gyro
rustic rain
#

so judging by this intended way

#

they also want ECS during authoring

#

which is sadge tbh

errant hawk
rustic rain
#

I liked OOP design of conversion workflow

#

it was very convinient

#

to implement

#

but I guess

safe lintel
#

why is that sad? you have oop for bakers, and then can use the burst path for pure ecs(and could still use class data in the baking systems too)

rustic rain
#

the benefits of this ECSy approach

#

is that it would be easier to extend as project scales

#

Baker adds temporary tags/components

errant hawk
rustic rain
#

BakingSystems work on it

errant hawk
devout prairie
#

Going to give this a quick whack..

whole gyro
rustic rain
#

all right, I'm getting a hang of it
Even if I don't like it, might as well minimise damage ๐Ÿ˜…

devout prairie
rustic rain
#

Could and should probably merge logic into components + baking systems that work on it

#

So in the end

#

Bakers only define what sets of temporary instructions to get

#

that will add all required component data in baking system

errant hawk
whole gyro
#

Haha yeah I think I like the new design now. But, as was mentioned above, I think the manual page on baking should outline the restrictions of the Baker more clearly.

devout prairie
#

Well i think the crucial thing is it's still experimental, so if there are major pushbacks from people about certain workflows i guess there's scope to change things still

#

so for example if certain things feel a bit wonky rather than getting salty about it let them know, seems like the sensible thing

#

just referring to the ongoing discussion

errant hawk
devout prairie
#

i'll be the one crying if/when i ever migrate ๐Ÿ˜›

rustic rain
#

yeah... every time they change smth

#

it's a pain

#

1 step a time at least

whole gyro
devout prairie
viral sonnet
#

ArgumentException: Cannot create an instance of ScriptableObjectConverter_Baker`3[TSOClass,TBlobStruct,TBlobReference] because Type.ContainsGenericParameters is true. whelp ๐Ÿ˜ฆ no generic bakers apparently

whole gyro
rustic rain
errant hawk
viral sonnet
#

previously it was a GOCS, ran fine. then i tried a systembase but I was warned here that building blobs in baking systems aren't tracked. so now i tried a generic baker. running out of options

devout prairie
errant hawk
devout prairie
# errant hawk cool, so 4 times down to 0.4 hehe

i guess you're damned if you do damned if you don't change stuff.. i think recent comments on here have the right of it, just do what's best and to hell with people complaining about it.. people will complain either way ๐Ÿคทโ€โ™‚๏ธ

errant hawk
#

so far my only complaint has been the rather frustrating limitations of GameObject-Entity positional tracking

#

and the hybrid workflow (which is actually subjectively better now with the baking system)

devout prairie
#

tbf the conversion system was the one thing that bugged the hell out of me and really hoped they'd simplify.. just hoping it's not more obfuscated than it was before ๐Ÿ˜› it does look simpler on paper but i can see people having issues

errant hawk
#

๐Ÿ˜›

rustic rain
#

๐Ÿ‘ด

devout prairie
#

hehe

rustic rain
#

let's say

#

Conversion used to be OOP

#

now it's ECS

#

that's it

errant hawk
#

Conversion == OOP
Baking == ECS

devout prairie
#

in the end i just use gameobjects with conversion mono's for everything, no subscenes etc i just had too many bugs etc, that was 2020 tho not sure if later versions were better

#

it loads quickly enough so no real love lost

karmic basin
#

2022.2.0b9 comes with a bunch of fixes for UI Toolkit, and I see a little fix for domain reload too, but other than that, nothing too much related to entities usage https://unity3d.com/beta/2022.2b

rotund token
#

I'm getting a bunch of random ui toolkit issue on inspecting so hopefully this helps

errant hawk
misty wedge
#

Something I'm still struggling with is how to get data used in scheduled jobs onto the main thread for some stuff like UI.

E.g. I read NetworkSnapshotAckComponent do get the last ping time, but netcode systems write to it...

pastel field
#

If you use Physics in your current project, does the Improved Transform System mean it's actually not possible to upgrade to 1.0.0 ?

safe lintel
#

i noticed if you have a subscene closed and an entity selected and exit playmode, it will spit out uitoolkit/element errors

rotund token
misty wedge
#

I guess the easiest way is write a job that depends on the component so the scheduler can figure out the order of operations, and then complete that job, since I don't have a h andle on the netcode system ๐Ÿคท

viral sonnet
#

hm, so i there's any trick to code a generic baker. i'm too dumb to find out ๐Ÿ˜„

rotund token
#

What's the use case

viral sonnet
#

to bake some scriptable objects into blobs

#

or i find a solution to bake blobs in a baking system. an idea was to instantiate an entity with a seperate blobAssetStore and simply manage the disposal.

rotund token
#

Yeah I'm missing the part where it needs to be generic though

#

What does the generic part provide

viral sonnet
#
    public class ZoneDropConversionSystem : ScriptableObjectConverter_Baker<ScriptableObjectConverter,SO_Zone, ZoneBlobAsset, ZoneBlobReference> { }```
#

i can implement this very easily for each SO

#

i mean isn't the point of generics always that you don't have to write the same code over and over again? ๐Ÿ™‚

#

i could make this non-generic of course

misty wedge
viral sonnet
#

to easily use them in systems. it's really nice to use

devout prairie
#

apparently the 1.0 physics package is compatible with 2019+, would that mean it works with 0.51?

misty wedge
#

I just put them in a native hashmap, pretty boring ๐Ÿ˜ฆ

#

Although I do inject them sneakily

#

That may not work on an ISystem though

viral sonnet
#

i'm not fully there yet because the 1.0 release interrupted me ๐Ÿ˜„ i have a hashmap now too but it should turn into just an array and ids for direct access

viral sonnet
misty wedge
#

The blobs

viral sonnet
#

so you're doing runtime baking of the blobs?

misty wedge
#

yeah

#

You can load mods between shutting the game down and starting a new session, and those mods are also converted to blobs

viral sonnet
#

makes sense, i did that also at one point but recently moved the process to the conversion stage

misty wedge
#

I just store all my config data in scriptable objects, and then convert those

#

And I have a struct reference type that stores the guid to the scriptable object which then lets me access the blob in jobs

devout prairie
#

when did unity add manual cache locations??

viral sonnet
#

i don't see my game having mods but maybe i should rethink the baking of blobs. it's really fast anyway and who knows when dots addressables are showing up

#

i just don't like being defeated by regressions ๐Ÿ˜„

#

seems DreamingImLatios has also brought up generic bakers in the forum

misty wedge
devout prairie
#

so there's no samples for ecs/physics as yet?

viral sonnet
#

ok, got the generic baker to work ๐Ÿ˜„

#

the important part is a generic baseType too public class ScriptableObjectConverter_Baker<TAuthoringType, TSOClass, TBlobStruct, TBlobReference> : Baker<TAuthoringType> where TAuthoringType : ScriptableObjectConverterBase where TSOClass : ScriptableObject, IConvertToBlob<TBlobStruct> where TBlobStruct : unmanaged where TBlobReference : unmanaged, IComponentData, IBlobAssetReference<TBlobStruct> is my definition

misty wedge
#

But you'd still need to define how the object gets converted somewhere right?

viral sonnet
#

previously I just used Baker<ScriptableObjectConverter> and that threw errors

#
    public class ZoneDropConversionSystem : ScriptableObjectConverter_Baker<ZoneConverter, SO_Zone, ZoneBlobAsset, ZoneBlobReference> { }``` this is such an implementation
viral sonnet
#

shouldn't this discard the main entity that will be converted? [TemporaryBakingType] public class ScriptableObjectConverterBase : MonoBehaviour

#

the main entity still gets converted but I would like to destroy it after conversion

frosty fern
#

would dots make it easier for open world maps?

rustic rain
#

but you can practically consider as different engine

viral sonnet
#

the V-Rising devs would agree I think ๐Ÿ™‚

rotund token
frosty fern
#

that is true, forgot about v rising. was debating between unity dots or ue5 since they have 64 bit floating precision

viral sonnet
#

yeah, the tag was a dumb guess. i actually have no idea how to get rid of the main entity ๐Ÿ˜„

rotund token
#

EntityManager.DestroyEntity ๐Ÿ˜„

viral sonnet
#

in a baker?

rotund token
#

in a post process bake system

#

add a component called
[TemporaryBakingType]
public struct DeleteEntity : IComponentData

#

to the parent

#

then just post process delete them

viral sonnet
#

hm, well then. i have this remove system anyway, just as might put a delete in there too ๐Ÿ˜„

rotund token
#

was that remove system working with linked entity group?

#

when i last saw it didnt think it'd work

#

because linked entity group is added i the phase after from what i saw (or did you update it)

whole gyro
#

That's how CreateAdditionalEntity(bakingOnlyEntity:true) is implemented internally

viral sonnet
#

i have only tested this for trans/rot/parent. i currently have just flat entities, need to test it

#

did it not work for you?

rotund token
#

ok well it took me a while

#

but i figured out how to remove LEG

viral sonnet
#

oh do tell ๐Ÿ™‚

rotund token
#

no component, just remove all LEG that are length 1

#

if you want to be more specific you can do something similar

#

TLDR just remove LinkedEntityGroupBakingData

viral sonnet
#

nice, good find

karmic basin
rotund token
#

one gotcha that screwed me for ages

#

EntityQueryOptions.IncludePrefab

viral sonnet
#

so the actual setup of LEG runs afterwards, huh?

rotund token
#

these are traditional systems now and prefab is added

#

so it won't return prefabs in the query!

#

(i think this is why staticoptimizeentity doesn't currently work on prefabs atm [there's a note in code this is known])

rotund token
misty wedge
#

Can you set values using reflection on an ISystem?

rotund token
#

but i like the idea of just not having to run the LEG system on things that don't need it

viral sonnet
#

yep, the LEG buffer sucks ๐Ÿ˜„

rotund token
#

my issue with LEG is it's added to every prefab

#

even if the prefab is flat

#

and there are new really cool ECB functionality with LEG

viral sonnet
#

with the new 128 cap, the LEG is less of an issue ๐Ÿง‚ ๐Ÿง‚ ๐Ÿง‚

viral sonnet
#

i agree of course ๐Ÿ˜„ i need to check about the flat prefab thing. i either have not witnessed this, always removed it or i dunno ๐Ÿ˜„

#

chunks have a limit of 128 entities

misty wedge
#

ah

viral sonnet
#

hm, i don't have LEG anywhere right now. just Parent for the most case in hierarchies

#

only on prefabs you say?

misty wedge
#

Is there a significant performance difference in removing it on flat hierarchies?

viral sonnet
#

LEG takes a significant amount of memory

rotund token
#

i could live with it being not in chunk so only 16bytes instead of 160

viral sonnet
#

that's quite the oversight

#

one does not simply put a buffer on an entity!

#

i'm confused though what triggers this as i don't have any

rotund token
#

GetEntity

#

on a prefab field

#
        {
            if (gameObject == null)
                return Entity.Null;

            var gameObjectId = gameObject.GetInstanceID();

            // If it already exists, just give back the reference
            if (!_GameObjectToEntity.TryGetValue(gameObjectId, out var entity))
            {
                if (gameObject.IsPrefab())
                {
                    // Okay, it doesn't exist so we need to create it
                    entity = CreateEntityForPrefab(gameObject); 
                }
            }

            return entity;
        }```
`entity = CreateEntityForPrefab(gameObject); `
viral sonnet
#

haha, i just realized in my game project the conversion is still missing. just checked my other projects, yep, there it is.

#

beautiful, length 2 and a reference to itself

#

the other prefab length 1. yeah. that needs some work

#

no idea how the entity itself ends up in the LEG buffer

rotund token
#

it's always self added

#

as first step

#

it's never a 0 length buffer

#

first element is always self

viral sonnet
#

you are right. hm, what sense does this make?

rotund token
#

i posted one of my favourite features here

#

and that would utilize that i think

viral sonnet
#

i see. well, i think the biggest problem is that we can't set where the LEG buffer lives. I wouldn't mind it so much otherwise

#

on the other hand, that kind of buffer behaviour could be utilised very easily without any auto-magic that does the wrong thing for most of the time

rotund token
#

well yeah, i'm a firm believer it should exist outside chunk

#

it's not something that is high performance and iterated every frame in a chunk

#

it's only really used during initialization/destruction

viral sonnet
#

yeah i agree

full epoch
rotund token
#

ooph, i'm onto my 1 library that uses GenerateAuthoringComponent

#

if someone had a lot of these that'd be painful

viral sonnet
#

maybe it's used in runtime for animation. i dunno. anyway, it's a weird core feature for sure.

#

rewriting comps is painful anyway ๐Ÿ˜„ i rewrote 64 bakers

rotund token
#

most of my authoring is just

#

1-2 mega scripts per library

#

so it's been pretty easy

viral sonnet
#

it is easy and tedious ๐Ÿ˜„

errant hawk
rotund token
#

As many as you write? ๐Ÿ˜„

errant hawk
#

well I had fields that were intended to be converted, but some other fields that were not (I don't remember why, but I never used the attribute from there forward)

rotund token
#

you could kind of trick this by using accessors or properties

#

but yeah i only have them in 1 library from a while ago

#

wasn't a huge fan of it except for like single field components

errant hawk
#

Oh I remember, I was lazy and didnt want to make an editor script so I had "toggle gizmos" "toggle handles" "toggle vectors" etc on the monobehaviour

#

found it easier to just write the conversion process

misty wedge
#

There is no way to get a singleton inside a job is there?

viral sonnet
#

no as it involves a query.

misty wedge
#

How can I "safely" get a singleton then that is written to by another job without getting a direct jobhandle from that system?

viral sonnet
#

can you not get it outside the job? you'd just need the entity. the comp itself is no problem

misty wedge
#

I guess? I was just wondering if there was a better way. So basically just get the entity and then read it using a ComponentLookup?

viral sonnet
#

basically

misty wedge
#

Hmm

#

What if I needed the singleton data on the main thread? I guess the only way is to then call Complete on my schedule job, forcing the job that is writing to the singleton (and then my job) to complete?

viral sonnet
#

if you write to the singleton from jobA and need the updated data in jobB there's not really a way around it unless you .Complete before scheduling jobB and get the updated data

misty wedge
#

I'm confused how this worked before, I guess netcode updated how they write the singleton somehow, maybe it was all mainthread before

viral sonnet
#

i don't know how they did it. maybe they just used a NativeReference and used the same ptr?

misty wedge
#

I feel like that is generally tricky with something like UI, since you would need to complete all the handles that contain the data you want to render to UI that frame, unless there is some way to do it inside a job

misty wedge
#

Are build configurations deprecated?

rotund token
#

yes

misty wedge
#

Can you still use custom build steps? Would be kind of odd if they get rid of the entire Unity.Build stuff

viral sonnet
#

of course it's internal ๐Ÿ˜„ [BakingType] internal struct LinkedEntityGroupBakingData : IBufferElementData

rotund token
#

internal public what's the difference ๐Ÿ˜„

#

I definitely would have made that internal as well though

viral sonnet
#

could be just hidden in an internal named namespace.

#

one doesn't stumble into unsafe namespace for example

#

for asmref, what's the most sensible thing to do? using guids or strings?

#

guid would define the version, right?

#

and tertle, how have you set this up when you need internals for more than 1 dll? i'm lazy and made different folders but i'd like to merge this into one which doesn't seem to work

misty wedge
viral sonnet
#

so it doesn't really make a difference? the nice thing about string is that i can actually read it as txt file

rotund token
#

So it's all in 1 place

#

If other libraries need access to something internal is just wrapped by core library

viral sonnet
#

have you managed to put them into 1 folder? i organized it that way now

rotund token
#

Oh no it's 1 folder per

viral sonnet
#

ok thanks

misty wedge
#

Where can you check if a package is compatible with a specific unity version?

#

I think unity 2022.2 broke input system 1.3.0

rotund token
#

That'd be a pain because 1.4 has a pretty bad bug

misty wedge
#

Yea...

#

tell me about it

#

I'm amazed it still isn't fixed

rotund token
#

I haven't got around to updating my input / control library yet so can't confirm

viral sonnet
#

what bug is it? i have been using 1.4.2

rotund token
#

From memory binding like wasd to a composite?

misty wedge
#

Yeah

viral sonnet
#

hm, was running 1.3 in 2021 too

misty wedge
#

iirc it only breaks the composite binding if you change control scheme

#

Something whacky is going on with the 2022.2 importer

rotund token
#

Whatever it was exactly it was pretty bad and input devs basically just said stick with 1.3

misty wedge
#
Asset import failed, "Assets/ScriptableObjects/Input/InputActions.inputactions" > InvalidOperationException: Failed to add object of type `InputActionReference`. Check that the definition is in a file of the same name and that it compiles properly.
UnityEngine.InputSystem.Editor.InputActionImporter.OnImportAsset (UnityEditor.AssetImporters.AssetImportContext ctx) (at Library/PackageCache/com.unity.inputsystem@1.3.0/InputSystem/Editor/AssetImporter/InputActionImporter.cs:130)
UnityEditor.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext ctx) (at <b12a1bad0ca64ab6a93de8c0b845ea64>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
#

It works on 1.4.2, so I'm guessing it's a unity version issue

misty wedge
viral sonnet
#

whoa, what the hell. my inputs suck, don't use composites yet

misty wedge
#

Like I said, iirc it works fine if you don't use control schemes, but I might be misremembering

rotund token
#

They just bumped to 1.4.4 on the github

#

Not sure if fixed though

misty wedge
#

Really? Latest version I see is 1.4.3

#

9 hours ago

rotund token
#

On github

#

It's not released

#

Just current work

misty wedge
#

Ah, I just checked the needle mirror repo

rotund token
#

But yeah they specifically say this on the 1.4 forum post

Dear Input System users!

Please hold upgrading, we're investigating the issues found below.

misty wedge
#

I feel like this issue has been around for quite a long time now

rotund token
#

It has

misty wedge
#

Must be serious then

#

Really annoying if 1.3.0 breaks in 2022.2...

viral sonnet
#

hehe, prompted me to look at their codegen. i found a really nice Writer struct that handles indents in InputActionCodeGenerator

errant hawk
gusty comet
#

hi... I haven't been updated on dots... is it fully supported now? is it ready to use?

errant hawk
errant hawk
#

๐Ÿ‘

misty wedge
#

Ok, it looks like InputSystem is completely unusable on 2022.2b9

#

The importer keeps breaking for some reason

#

If you have a generated C# file it should keep working but you can't make any changes to the asset

#

I think this is a general issue of the actual unity version though, my BuildConfigurations are also not importing, with a similar error

rotund token
#

have you tried b8?

misty wedge
#

Yeah, same issue

#

Very annoying

#

The build configuration importer breaks immediately

#

InputAction I can open and edit until I save it with a single action in an action map, then the same issue occurs

#

Very odd

#

iirc I read in the forum it works on b3, although I'm guessing 1.0.0-exp.8 won't work on that version

rotund token
#

(you dont need build configurations anymore)

misty wedge
#

Yeah I know, I was just remarking that it has the same issue

#

Is the old ClassicBuildPipelineCustomizer still applicable or did the entire system get deprecated?

#

I actually liked the build configurations ๐Ÿ˜ฆ

haughty rampart
#

i also liked the build configuration

#

tbh seemed like a more clean, modern version than the build system

viral sonnet
#

no idea why they abandon it

haughty rampart
#

yeah. is a shame though

viral sonnet
#

i had hopes it will be the default build system one day

haughty rampart
#

yes. same

#

maybe one of the team has some notes on this

viral sonnet
#

most in the dots forum were baffled as well

misty wedge
#

How do you add custom build steps now?

#

Do you just write some method you can trigger as a MenuItem and call your code one by one?

#

iirc there was an attribute you can hook but that was only for post-processing a build, not pre-processing...

rotund token
#

i actually liked it as well

haughty rampart
#

i really hope they will bring it back

#

can i get EndSimulationEntityCommandBufferSystem.Singleton in a system in OnCreate() ? i seem to get errors saying none exist

viral sonnet
#

isn't there a new option to delay OnCreate?

#

yeah, [CreateAfter]

misty wedge
#

Did something change with the physics system in 1.0? A lot of my old code isn't registering any collisions at all

#

for example, this used to work before

#

PhysicsDebugDisplayData also isn't showing any colliders, so I'm guessing that's the issue

#

Besides that I can't really see anything wrong on the baked entity

haughty rampart
# viral sonnet yeah, [CreateAfter]

ok. is that supposed to be this way or are you really supposed to get the singleton each time in update without caching it in the isystem ?

viral sonnet
#

the training samples got the ecb in update

#

saw no caching

haughty rampart
#

yeah that's why i'm asking

misty wedge
#

Well I'm stumped, time to sleep ๐Ÿคท

viral sonnet
rotund token
#

yeah i had a similar issue after adding a new baker it would just not run it until i cleared cache

viral sonnet
#

it certainly is odd that colliders are just missing. might be the best reason for baking to not have run

rotund token
#

oh actually it was worse

#

it would bake into the preview so when i checked entity in authoring view it appeared to have the components

#

but when i started game

#

they didn't have the components

viral sonnet
#

damn, there are 2 states? lol when in doubt clear cache

rotund token
#

this was from like 5 min of testing so take it as a grain of salt

#

but it looks like the preview state is only the Baker

#

not the Baker systems

#

i noticed my collision drawer fails in this state because the collider isn't built and it's null when inspecting the entity

safe lintel
#

where is live baking logging logged to?

#

oh the console ๐Ÿ™‚

#

was hoping to be able to use debug.log though, not sure why this baking system isnt working

#

ok i guess im an idiot, query isnt matching and debug does work..

haughty rampart
#

is there a way to compare 2 entries of the burst inspector?

rotund token
#

print screen ๐Ÿ˜„

#

i print screen 1 and put it next to the other

#

to see them side by side ๐Ÿ˜„

haughty rampart
#

but you can only ever open 1 burst inspector

rotund token
#

yeah so i open it, look at something

#

print screen the code, put it in paint

#

then open the second job etc

#

or store it for a recompile/code change

#

(or just copy/paste entire thing to notepad++ and do a diff)

#

but yeah it would be nice to have some proper tooling for this

haughty rampart
#

Absolutely

zenith stirrup
#

Is there any best practice for selectively creating systems depending on the scene?

for example, I might have a "Pong" scene which needs a BallMoveSystem.
I might have a "Tetris" scene which needs a BlockPlacementSystem.

I don't want all of them to run all the time.
only depending on the scene which was opened by the user.

haughty rampart
#

You could check for required components to run the system or enable it manually

zenith stirrup
#

note this is a simplified example.

the actual problem: for netcode, you may have different interest management.
spatial hashing, distance checks, raycast checks etc.

all need their own system.
but all should not exist at the same time. only one.

rotund token
#
  • Personally i only have 1 scene so this is never an issue for me (did this pre-dots as well)
  • In theory though, there shouldn't be a need to create different systems for difference scenes. in your pong scene the BlockPlacementSystem should never have data to run (though now you need to tell it not to run by default)
  • In practice it's somewhat nice to be clean system per scene for certain styles of games, I think dreaming's library has an implementation for this that you might want to look at for inspiration
zenith stirrup
#

hm ok, thanks for feedback

viral sonnet
#

systems don't have much overhead. that said, they are auto created by default and they can be created and destroyed as you wish. down to your own bootstrap and update groups

zenith stirrup
viral sonnet
#

hm, i don't feel that bootstrap should be reliant on any gameobjects

#

afaik it runs as one of the first things so probably before scene loading

#

you can create these systems at any point, it doesn't have to be in the bootstrap

dense storm
#

CopyTransformToGameObject authoring gone, how do I sync entity transform to GameObject in 1.0?

viral sonnet
#

there should still be the copy system around that's relying on a companion object

#

i can't give any info though how that's setup.

#

you can copy it and edit it to your liking

#

system is called CompanionGameObjectUpdateTransformSystem

#

the whole code path for setup seems inaccesible as AddHybridComponent is gone and the CompanionLink class is private

viral sonnet
#

are you aware that the dots hierarchy, even when not open is drastically reducing performance?

#

i just ran my game (finally) and it was stuttering like crazy! closed the dots hierarchy and all gone

#

can reproduce the effect when opening the dots hierachy again and hit play again

wraith hinge
#

That sounds like a bug to me; repro would be great if possible, else instructions hopefully? Like how many entities exist / are visible in hierarchy, what does window look like when itโ€™s visible

#

wait, first you say when not open, but then it goes away when you close it? Confused

viral sonnet
#

not open - as in, just docked to a tab and not visible

wraith hinge
#

ah. So if it exists itโ€™s expensive whether or not itโ€™s visible. Seems like it should be fixable?

viral sonnet
#

i never saw the GameObjectChangeTracker. must be something new. i spawn lots of gameobjects ๐Ÿ™‚

#

i wouldn't have caught this bug if i'd have already implemented proper pooling ๐Ÿ˜„

#

this bug was certainly not around in 0.51 - i have the dots hierarchy open all the time

wraith hinge
#

๐Ÿ‘forwarded

viral sonnet
#

very nice! thanks

wraith hinge
#

how many goโ€™s spawned per frame, ish?

viral sonnet
#

i spawn around 6-10 monsters/GOs per frame

wraith hinge
#

๐Ÿ‘

safe lintel
#

if I want to create an additional entity inside of a baking system do I just use EntityManager.Instantiate? or something else?

#

kind of not having success creating new entities(in baking systems)

viral sonnet
#

call CreateAdditionalEntity

#

and use TransformUsageFlags.None if you don't want any transform stuff on it

#

oh baking system... ๐Ÿ˜„

#

i use an ecb for this

#
...
ecb.Playback(state.EntityManager);```
tropic venture
#

๐Ÿคฉ testing now....

safe lintel
#

kinda looking like I shouldnt be making entities inside of baking systems and only bakers? DuplicateEntityGuidException: Found 6 EntityGuid components that are shared by more than one Entity

viral sonnet
#

hm, that's weird. not even sure what that means.

#

and that's just with ecb.CreateEntity?

tropic venture
viral sonnet
#

congrats!

zenith stirrup
honest plinth
tropic venture
# honest plinth Awesome! Are you seeing OK performance?

not yet... not for this medium-low-end device... trying to figure out what would be the next best way to optimize, either less geometry or maybe i should try more sub-scenes if the ECS graphics optimizer might do more optimizations with that, or something else...

#

i'm having another issue which is that this asset plugin Splatmap shader is not SRP batcher compatible, and altho i thought i fixed that for unity editor player - apparently it's not working on the device yet...

#

still super glad ECS 1.0 brings GLES 3.1 support so that it seems to be able to work at all on these older devices

#

just need to work around some of these issues and who knows maybe the results will be worthwhile

rustic rain
#

CPU or GPU

honest plinth
#

Right. Yeah it was a big push getting that working. But you might not see as good perf as you expect as we did not write a completely different data model for GLES. Loading things on a offset is slow on these kind of devices so don't expect super good GPU perf. You should be seeing some better CPU perf than game objects though (hopefully)

tropic venture
#

ah ok good to know

honest plinth
#

You might even be slightly slower on GPU than game objects, due to the way that per instance properties are loaded. But that's completely content dependent (For GLES/mobiles that is)

rustic rain
#

Last time I did stress test in build on windows I ran into gpu bottleneck

tropic venture
#

bit of a bummer... i was hoping ECS renderer will definitely do better on mobile than gameobjects, if only it supported GLES...

rustic rain
#

Is it worse?

#

Did you test it?

tropic venture
#

still testing & comparing to find that out...

honest plinth
#

Yeah, but we can't do magic. How some of these mobile GPUs want the data is pretty much that it needs to be able to preload everything into constants, so no way of reading per instance data or have a persistent GPU state, which is the foundation this tech was built on

#

I did test it, as I worked on it. And I know it can be slower, but it's highly device dependent. And it should not be that much slower in the general case

rustic rain
#

supporting 6 yo phones will be pain ๐Ÿ˜…

tropic venture
#

this LG G4 i'm testing with seems to have Qualcomm Adreno 418, 600 MHz

rustic rain
#

Especially that they will be at least 7 yo old by the time you finish game

honest plinth
#

We know that more modern devices are handling it better, and we have some potential ways to move forward and making the property loading slightly faster as well

rustic rain
#

Ngl, hard to see the reason to focus support on such old phones with a game that meant to be graphically intensive

honest plinth
#

That is my opinion as well. We have limited time, and focusing on this and creating new architecture and systems for it moves resources from somewhere else

tropic venture
#

๐Ÿค” hm

#

gonna sleep on that, will get back to this (2:20AM here ๐Ÿ˜ )

#

thanks for all the guidance & info ๐Ÿ‘

honest plinth
#

Good night, hope you get it working with reasonable perf ๐Ÿคž

severe lagoon
#

I've got a question about the unity jobs system.

#

Can I do this?

#
    struct TestJob : IJobParallelFor
    {
        public NativeArray<byte> type;

        public void Execute(int index)
        {

            if (type[index] == 1)
            {
                if (type[2] == 1) // CAN I DO THIS??
                {
                    // do something 
                }
        }

    }```
rotund token
#

only if you mark the type NativeArray [ReadOnly]

#

or turn off safety and promise what you are doing is not breaking threading safety

severe lagoon
#

ok thanks

dapper vine
#

I'm getting falling physics objects if I changed selections in editor

rotund token
#

this seems to be a common complaint

misty wedge
# rotund token they didn't have the components

This isn't the issue in my case, since if I log e.g. the collider size during runtime it is correct. However, the physics debug isn't showing any colliders and none of my queries are hitting. Are there any additional components you need to make the build physics world system "recognize" your objects now?

haughty rampart
#

anyone know why Unity.Burst.CompilerServices.Loop.[...] is not found anymore? i have the compiler directive enabled

rustic rain
#

ok, now I start to hate baking

#

since it relies on ECS runtime components

#

whole transform hierarchy is broken

#

๐Ÿ™ƒ

haughty rampart
#

what?
you can't rely on runtime things since you bake the entities at compile time

rustic rain
#

you can only query entities

#

no managed components during baking, unless it's Baker

haughty rampart
#

yeah. so?

#

what is the issue?

rustic rain
#

There is no way to add components to children precisely

#

you can't figure which entity belongs to what in linked entity group

haughty rampart
#

i don't get it

rustic rain
#

let's say you have transform hierarchy

#

in 3 layers

#

parent, children of parent, children of children

#

you want to add said component tags according to layer

#

you can't do that ๐Ÿฅฒ

haughty rampart
#

why not?

rustic rain
#

how would you do so

haughty rampart
#

get the relation from the Parent Component or Child Buffer respectively?

rustic rain
#

they don't exist during baking

haughty rampart
#

they should exist in a BakingSystem

rustic rain
#

well they aren't by default

#

and I haven't found a way to get them

haughty rampart
#

that's strange though. because they are also baked when you close the subscene

rustic rain
#

yeah, let me try smth

#

[UpdateAfter(typeof(TransformBakingSystemGroup))] nope

#

that didn't help

haughty rampart
#

maybe there's like a Parent baking group?

rustic rain
#

idk, I tried to look for any BakingSystem in IDE

#

so far that's the only thing I found

#

[UpdateInGroup(typeof(TransformBakingSystemGroup), OrderLast = true)]
That didn't work either

haughty rampart
#

๐Ÿค”

rustic rain
#

[UpdateInGroup(typeof(PostBakingSystemGroup), OrderLast = true)] that too

#

๐Ÿฅฒ

#

feels bad you can't even see the order of baking systems

haughty rampart
#

isn't there UpdateAfter?

rustic rain
#
static void PostprocessBake(World conversionWorld, BakingSettings settings, BakingSystem bakingSystem)
        {
            using (s_TransformBakingSystemGroup.Auto())
            {
                var transformBakingSystemGroup = conversionWorld.GetExistingSystemManaged<TransformBakingSystemGroup>();
                transformBakingSystemGroup.Update();
            }

            using (s_BakingSystemGroup.Auto())
            {
                var bakingSystemGroup = conversionWorld.GetExistingSystemManaged<BakingSystemGroup>();
                bakingSystemGroup.Update();
            }

            bakingSystem.UpdateReferencedEntities();

            using (s_LinkedEntityGroup.Auto())
            {
                var legSystem = conversionWorld.GetOrCreateSystemManaged<LinkedEntityGroupBaking>();
                legSystem.Update();
            }

Judging by this, transforms should be baked by default when baking system runs

misty wedge
#

Is there a way to check if a system ran its Update method?

#

I think something is borked in NetCode + Physics...

rotund token
rustic rain
rotund token
#

Are they prefabs?

#

The one thing I got tricked by was the prefab tag being added

#

So the Entities don't appear in default queries

#

You need to do query option include prefab

rustic rain
#

they are certain to be processed

#

as I get log message

#
        public static NativeArray<Entity> GetAllEntitiesInHierarchy(this EntityManager em, in Entity parent,
            Allocator allocator = Allocator.Temp)
        {
            var list = new NativeList<Entity>(1, allocator);
            list.Add(parent);
            if (!em.HasComponent<Child>(parent))
            {
                return list.AsArray();
            }

            var buffer = em.GetBuffer<Child>(parent);
            foreach (var child in buffer)
            {
                var children = GetAllEntitiesInHierarchy(em, child.Value);
                list.AddRange(children);
                children.Dispose();
            }

            return list.AsArray();
        }
#

I do this

#

and each time it returns lenght 1

#

meanwhile after baking is over

misty wedge
#

I feel like baking randomly breaks and doesn't convert some things

#

Even unity internal stuff

#

This is the game object:

#

and this is the baked data:

#

it seems to randomly work again sometimes after clearing cache

tropic venture
# honest plinth That will most certainly be slow. I tested mostly on an Adreno 612 and before we...

interestingly one of the main issues with one of the asset plugins i'm using is some shaders that were incompatible with SRP batcher due to variables not being declared in the CBUFFER. i thought i fixed that already though - i spent hours finding & moving all those properties from various cginc files into the CBUFFER_START section... it was working fine in the editor player, dunno why on the mobile device it's still rendering pink...

tropic venture
#

this is indeed more of a passion project to get more experience in unity etc. sort of aiming to make a kind of benchmark to test the farthest limits of what can be pushed, and i thought it would be a good exercise / proof of concept if I could demonstrate that it is possible to make scenes like these even on medium-low devices from several years back, with potential to maybe eventually make an actual game of this type using this "engine" (optimizations / solutions / techniques i come up with) which does not leave users with older devices in the dark...

i still think this would be an interesting target/goal/challenge to achieve. however - maybe i should open to be convinced to drop this goal... ๐Ÿ˜›

#

i was hoping ECS 1.0 graphics renderer with GLES 3.1 just might be the "performance by default" boost that will make it much more possible, however now you're telling me that for these GLES3.1 devices there might not even be that much performance improvement... bit of a bummer.. but ye i get that you guys can't do magic when it comes to all these older devices

#

i guess the options are 1) keep trying to implement the concept in regular game objects for lower devices (and maybe ECS for higher end devices) 2) keep trying to find good performance with ECS on older devices, but is there any hope for this really?...

misty wedge
#

Or I'm also missing something

rustic rain
#

at least in runtime

misty wedge
#

I thought BakingSystem ran after that?

rustic rain
#

and only on next frame

#

no idea, but I can't seem to make it work so...

misty wedge
#

Doesn't this kind of look like the ComponentSystemGroup is updating but none of the systems inside are?

#

Or is this normal behavior for the system inspector (not showing run duration on the right for some systems?)

#

Nevermind, the PhysicsSystemGroup showed 0.01 seconds runtime in one frame...

#

I'm so confused pensive

karmic basin
#

IIRC what I saw, there's an option to always display run duration whether it's zero or not

#

Anyway, regarding your collision query issue, did you see there are new physics groups ?

misty wedge
#

Yeah, I don't use the actual simulation part though. I just use queries and character controllers

#

For some reason (as you can see in the above video) the Build physics world system matches 131 queries, but the CollisionWorld has 0 for numbodies, numstaticbodies, and numdynamicbodies

karmic basin
misty wedge
#

MB?

karmic basin
#

from monobehaviour ?

#

Anyway syntax is the same apart from where you get the singleton from (and GetEntityQuery will be deprecated later but still supposed to work now I assume)

rustic rain
#

how do you get Entity with SystemAPI.Query?

misty wedge
#

Strangely the entity is the last value in the tuple, not the first one

rustic rain
#

'QueryEnumerableWithEntity<RefRO<StarIndexTemporary>>' does not contain a definition for 'Item2' and no accessible extension method 'Item2' accepting a first argument of type 'QueryEnumerableWithEntity<RefRO<StarIndexTemporary>>' could be found (are you missing a using directive or an assembly reference?)

#

great

#
            foreach (var aspect in SystemAPI.Query<RefRO<StarIndexTemporary>>().WithEntityAccess())
            {
misty wedge
#

Is StarIndexTemporary an aspect?

rustic rain
#

no

#

IComp

misty wedge
#

Is this in an ISystem or SystemBase?

rustic rain
#

SystemBase

misty wedge
#

It might be this limitation, but I'm not 100% sure since it has worked for me and I don't have any ISystem yet:

rustic rain
#

hmm

#

and what's the other way to iterate over it?

#

for?

misty wedge
#

I'm not sure if there is another way

#

Can you show your entire foreach block?

rustic rain
#

it's waaaay too large

misty wedge
#

Is this a runtime or compile error?

rustic rain
#

seems like compile

misty wedge
#

Ah, then it's probably because you need to do this:

#

foreach (var (starIndex, entity) in SystemAPI.Query<RefRO<StarIndexTemporary>>().WithEntityAccess())

rustic rain
#

hmm?

misty wedge
#

Deconstruct the iterated tuple

rustic rain
#

huh

#

yeah, that works

#

uh huh

#

really sadge ngl

#

that we can't query over game objects anymore

#

I don't see what's even the point

#

of doing it Baking way

misty wedge
rustic rain
#

considering

#

it's simply just adding additional layer

rustic rain
#

manual says

#

that baking systems must not touch managed objects

#

and instead iterate over entities data only

#

the way I see it

#

now I don't only need to create authoring components

#

I also need temporary components

#

๐Ÿ™ƒ

misty wedge
#

Why temporary components?

rustic rain
#

how else would you be able to create a conversion pipeline?

#

Baker does not allow other entities

misty wedge
#

Ah you meant to post process after the Baker step?

rustic rain
#

and BakingSystem has no access to game objects

#

so the only way to modify entities referenced by initial authoring component

#

is temporary component

misty wedge
#

Yeah, I think that is the intended approach. It's how TransformBaking does it

rustic rain
#

๐Ÿฅฒ I'll miss convenient conversion

misty wedge
#

I'm pretty sure they'll at least add something similar to [GenerateAuthoringComponent] back in. At that point it would only be the "post-process" system, and the generated authoring component would just be another authoring component

rustic rain
#

doubt

#

they will either totally rework baking