#archived-dots

1 messages ยท Page 2 of 1

rustic rain
#

as long as you rely on 3D transform system

#

I will probably try to do it

#

at some point

robust scaffold
#

Ya know, the documentation on this converted sprite rendering system is actually really good

rustic rain
#

using UnityEngine.Experimental.U2D;

#

hmmm

#

seems like it's removed in older versions

#

so you can't use native unity sprite renderer API

#

hmm

#

the only thing that bothers me atm is Culling

robust scaffold
rustic rain
#

It's not in a manual though

robust scaffold
#

Internal native code attachments.

#

Basically hardcode rooted inside the engine. No use rolling our own sprite renderer short of SRPing it manually.

#

So if we want to use a converted sprite renderer, it's this package or custom srp.

rustic rain
#

not reall

#

nothing stopping you to just draw stuff manually, kek

#

I mean

robust scaffold
#

thats custom srp

rustic rain
#

HybridRenderer is written in C#

#

using URP and HDRP

robust scaffold
#

organize your own draw calls. Uses the same API. Graphics class. Doesnt matter what RP you're using, it wont go through them.

rustic rain
#

ahem

robust scaffold
#

Thats what I'm doing with my lighting system. A render pass / command buffer with my own drawmeshinstancedprocedual / indirect

rustic rain
#

if you use Graphics api it won't work?

robust scaffold
#

why not?

rustic rain
#

no I mean

#

it won't use rendering features?

robust scaffold
#

features? Like ScriptableRendererFeature?

rustic rain
#

yeah, renderer features

robust scaffold
#

That is essentially an API to Graphics class. Well they both point to the same driver C++ API.

rustic rain
#

I always assumed that if I draw meshses with Graphics API it will be processed the same way

robust scaffold
rustic rain
#

with URP options

robust scaffold
#

There are no URP or HDRP specific rendering feature options.

#

You can use the same code in URP as in HDRP and even built in. All that is changing is the attachment point for the command buffer to the camera rendering loop in the engine.

rustic rain
#

lights

#

shadows

#

antialiasing

#

post processing

#

hdr

#

and etc

robust scaffold
#

Im assuming you have to implement those manually.

rustic rain
#

ahem

#

I gotta check

robust scaffold
#

I havent tried. Hell, I need to manually implement my own objectToWorld matrix because procedural calls doesnt set it.

rustic rain
#

I already have it setup

#

I just need to figure what can I use

#

in order to see whether it's affected

#

here's my quad

robust scaffold
#

I think for the RP to affect Graphics calls, you need to use RenderPrimitive or RenderMesh.

rustic rain
#

here with x8 msaa

robust scaffold
#

So yes?

#

MSAA is a graphics driver level implementation though

#

Vulkan has their own MSAA, same as DX

#

The [Graphics.DrawMeshNow] mesh will be just drawn once, it won't be per-pixel lit and will not cast or receive real-time shadows. If you want full integration with lighting and shadowing, use Graphics.DrawMesh instead.

#

Use RenderMesh to control Mesh rendering programmatically without the need to create and manage GameObjects. RenderMesh submits the Mesh for rendering, which means it does not render the Mesh immediately. Unity renders the Mesh as part of normal rendering process. If you want to render a mesh immediately, use Graphics.DrawMeshNow.

rustic rain
#

it is indeed affected

#
            Entities.WithNone<DisableRendering>()
                .ForEach((in RenderTargetLine line, in GetToPoint gtp, in LocalToWorld ltw) =>
                {
                    if (gtp.target.Equals(float2.zero))
                    {
                        return;
                    }

                    float2 position = ltw.Position.xy;
                    var delta = gtp.target - position;
                    quaternion rotation = quaternion.LookRotation(Up, delta.ToFloat3());
                    float3 scale = new float3(line.thickness, delta.Magnitude(), 1f);
                    var matrix = float4x4.TRS(new float3(position + 0.5f * delta, 0f), rotation, scale);

                    Graphics.DrawMesh(MeshDatabase.Quad, matrix, MaterialDatabase.PlanetTrail, 0, null);
                })
                .WithoutBurst()
                .Run();

this is how I draw movement lines

#

so yep

#

nothing to worry about

#

can simply write SpriteRenderer with C#

#

and draw instanced through Graphics API

robust scaffold
#

hrm, .withoutBurst() and .run(). Basically a fancy foreach loop?

rustic rain
#

this is so fun

rustic rain
#

I can do instanced

#

ez

#

just was too lazy

robust scaffold
#

Graphics calls have to be mainthread?

rustic rain
#

since it's very minor

#

yes

#

oh man

robust scaffold
#

Im 99% sure commandbuffers can be threaded / jobbed.

rustic rain
#

with this rendering features you can actually test stuff

robust scaffold
#

And then frame-end you can complete and Graphics.ExecuteCommandBufferAsync

rustic rain
#

mmm

#

maybe

#

or maybe not

#

why worry about it

robust scaffold
#

99.999999% sure. I'm basing this off vulkan API though.

#

but burst and jobs

rustic rain
#

as all you need is just to batch entities

#

just do IJobEntityBatch

robust scaffold
#

but but, bursted jobs

rustic rain
#

collect all entities with same materials

#

it's bursted

robust scaffold
#

everything needs to be burst compiled

rustic rain
#

sir

#

it is indeed burst compiled

robust scaffold
#

even the rendering calls

rustic rain
#

no, this won't

#

in the end you'll just do

#

Graphics.DrawMeshInstanced(mat, ltws.ToArray(), Mtb);

#

smth like that

#

foreach loop

#

I never heard of graphics APi being bursted

#

ever

robust scaffold
#

well, im gonna try

rustic rain
#

and I don't care way too much about it

#

since instanced rendering is already fast enough

#

faster can only be indirect

robust scaffold
#

Well, first mesh are classes and thus can not be bursted

rustic rain
#

well yeah

robust scaffold
#

so that goes out. How about jobbed...

rustic rain
#

that's why you batch them

#

as shared components

#

so you know all same meshes by sharedcomp id

#

wait

robust scaffold
#

Does Graphics DrawX respect render targets?

rustic rain
#

same materials

#

mesh for 2D is same = quad

#

DrawX?

#

never heard of it

robust scaffold
#

DrawMesh and the bunch

rustic rain
#

hm

#

not sure

#

I'd assume

#

if RenderTexture is null

#

it'll draw for monitor

#

if not - it'll draw for selected render texture

#

at least that's how CMD worked

robust scaffold
#

yea. that's why im using rendering features right now

rustic rain
#

uuugh

#

smth way too low level

robust scaffold
#

If i can instead shift this into a systembase using instead Graphics class, that might be better

rustic rain
#

but you can

#

and simply use URP

#

kek

#

I just showed you - rendering features affect DrawMesh calls

robust scaffold
#

urp bad though. Maybe I should go built in?

rustic rain
#

meaning everything else will too

#

bad?

#

why?

robust scaffold
#

URP has slight overhead. fractions of a ms but still

rustic rain
#

it's literally faster than built in

robust scaffold
#

hrm, yea. thats what people are saying on the forums as well

rustic rain
#

I mean, built in is called legacy for a reason

#

kek

robust scaffold
#

But if I'm rolling my own lighting, my own physics, and possibly my own sprite renderer, why am I using URP?

rustic rain
#

I'd say

#

why are you using Unity?

robust scaffold
#

because UI tooling

#

Despite everything, i admit UIElements is pretty good. And Burst. I cant use C# without burst anymore.

#

Either that or I go back into the hellhole that is C++

rustic rain
#

kek

#

I personally avoid going down the path of creating everything from scratch

#

I would spend more time creating engine

#

than game

#

this is sad part about Entities

#

most of things you indeed have to recreate

robust scaffold
#

Control and custom features. You aint gonna get this lighting using provided systems

rustic rain
#

ugh

#

URP 2d lighting can do

robust scaffold
rustic rain
#

maybe that too, I haven't used it too much

robust scaffold
#

500 lights simultaneously though? URP 2D lighting uses geometry shaders, at most.

#

And a draw call per light which is a travesty.

rustic rain
#

no idea about capabilities

#

in perfomance regard

robust scaffold
#

Nah, it's shit. I have no regrets rolling my own lighting.

rustic rain
#

I only just barely touched it

#

Don't think I'll even use lighting in my game

robust scaffold
#

I guess it really depends on the type of game then. I'm making a top down 2D. Sidescroller probably doesnt need lighting.

#

Or if it does, the built in functions well. In fact, URP 2D lighting was probably designed with side scrolling 2D in mind.

rustic rain
#

mine is top down 2D too

#

it's just that it's space kek

robust scaffold
#

it would look nice to have planets cast shadows, kinda.

#

properly scaled planetary systems would have a literal pixel width shadow cast beyond the planet compared to the size of the star

rustic rain
#

eh

#

it's 2D

#

ships are flying over planets, kek

#

and I use 3D planets

#

so planet satellites indeed will leave a shadow

#

at least I hope I will be able to implement it

robust scaffold
#

2D shadows are important. I have prototypes for real time 2D global illumination. Makes things look amazing but slaughters the FPS

rustic rain
#

smth like this, with an angle offset for light rotation

#

I have no goals to make it realistic, just want it to be fancy

robust scaffold
#

I guess that is the good part of unity, it's a 3D engine that can do 2D.

rustic rain
#

tbh

#

if I use Lit sprites

#

all will be affected by lights

#

but point is same

#

I don't see goal in it with this kind of game

#

you just want everything to be visible good enough

robust scaffold
#

If you're not planning on any complex or a lot of lighting sources, yea using the provided lit shader works perfectly I admit.

rustic rain
#

player supposed to be way more focused on numbers

#

than visuals

#

kek

robust scaffold
#

HDRP using built in lit shader.

rustic rain
#

hehe

robust scaffold
rustic rain
#

and that's what I'd avoid

#

focusing on player's game story is way more important in RPG

#

gotta make unique experience

#

also interesting

#

that's why burst and jobs come so in handy

#

ppl love when everything is simulated precisely

robust scaffold
#

Huh. Dots 0.60 is already on 2022.2

rustic rain
#

April fools long gone

robust scaffold
#

And they're using IAspect<>'s. Hrm. Dont know if I like what im seeing

#

Not the code itself, but how IAspects are structured. Seems like a manually implemented [GenerateAuthoringComponent]

rustic rain
#

IAspect?

#

any tl dr what is it?

robust scaffold
#

I thought it would be replacing IComponents authored from Editor but in that codebase, they still have to manually code in the IComponentData as well. And then also code in IAspect.

#

Hrm, I must misunderstanding what an Aspect is.

#

It's a replacement for Archetypes, not IComponents

#

This is so incredibly odd

viral sonnet
#

not for archetypes, it's like a high level abstraction. nice in theory but I think it leads to some very bad habits

robust scaffold
#

But that's an example of a bursted ISystem in possibly DOTS 1.0

#

tile.Scale.ValueRW.Value like why.

robust scaffold
viral sonnet
#

why do you think it's an archetype? it's just another way to look at an archetype and make it easier to build references and custom accessors

robust scaffold
#

It defines a collection of components that compose a single entity. Sure it also defines the accessibility of the properties of an entity but otherwise, it functions exactly as the current script based Archetype does.

viral sonnet
#

notice in the bee sample that no aspects are used for authoring, only components. the whole thing could be built without aspects and the low level data would stay the same. the aspects are built on top of the data and give a high level access for components and entities. what i don't like about it is that aspects stink of oop

robust scaffold
viral sonnet
#

using aspects won't change anything in the archetype is my point i guess

#

i'm honestly not too sure what's up with the aspects. the only thing it does is making it not as obvious that random memory access is used via pointers. so, a whole system to enable pointer access without using pointers really and staying in non-unsafe space.

robust scaffold
viral sonnet
#

what would be the difference to an authored prefab?

solemn hollow
#

is 0.60 ready for use? or just the examples?

robust scaffold
#

good point, no clue. hrmmmmmm

robust scaffold
#

There are no Entities.ForEach()

robust scaffold
solemn hollow
#

ah sad.

robust scaffold
#

foreach (var tile in SystemAPI.Query<TileAspect>().WithAll<Combustable>()) This is how they're getting lambdas into bursted struct based systems.

viral sonnet
#

hm, well, to not be all negative about aspects. i think querying with them is a lot better defined

robust scaffold
#

I now think that Aspects are replacing the lambda queries.

viral sonnet
#

not totally related. they are changing it because codegen was slow

solemn hollow
robust scaffold
#

Like how currently we have:

Entities
    .WithName("FovCollectionJob")
    .WithStoreEntityQueryInField(ref _fovQuery)
    .ForEach((Entity entity, in GoTrs trs, in FovProp fovProp) =>

The .ForEach() will be replaced.

#

This is all codegen replacements so I dont know about performance.

viral sonnet
#

newer is much better ๐Ÿ™‚ fk Entities.ForEach

#

i mean, performance of the actual code-gen. it takes quite long and causes a bunch of problems in VS

robust scaffold
#

c# foreach and using aspects for queries will help with intellisense at bare minimum

#

true, this might help with that. I have 2 jobs so Im not running into any performance issues with code gen so far

#

I dont know how debugging features like naming jobs will function

viral sonnet
#

but, as this code-gen'd foreach query stuff is too dumb anyway for anything more complex than a basic prototype i'll still stick to good ol' jobs

#

as long as they can't figure out how to handle conditional component type version changes it's not usable

robust scaffold
#

havent touched component versioning, everything on my system runs every frame so i havent run into any issues on that front but yea, i can see how it might be difficult

viral sonnet
#

and they will never allow getting a RO pointer access from a write handle and manually bumping version, so, goodbye change filtering

#

i've just rewritten my last Entities.ForEach because there was a ref touching a TargetEntity comp.

#

and having the peace of mind of proper version filtering is golden ๐Ÿ˜„

rustic rain
#

oh, ForEach lamba is so terrible

#

even Rider has problems with that, kek

#

IDE just gets stuck if when it opens argument list for it

robust scaffold
rustic rain
#

would love to have some better API

robust scaffold
#

Wait no, these are entity relationship modifiers. So component handles are all rolled into an IAspect but these are basically ComponentDataFromEntity I think.

#

It is odd but I'm getting the impression that Unity will be shifting entirely to bursted ISystems. Which is good.

rustic rain
robust scaffold
#

But huh, where's the scheduling?

#

are these all mainthreaded? If so, ewww

viral sonnet
#

i have never seen a simd implementation in their training samples ๐Ÿ˜…

#

why have a fancy SoA and then not use it ...

robust scaffold
#

Burst is magical enough that even the most newbie of coders can just slap a [BurstCompile] on their job and it'll work

#

hrmmmm

#

It seems like if you want any sort of threading done to the job, it must be done though a lambda ForEach

#

Mainthread .WithBurst() and .Run() can be done though built in C# foreach and SystemAPI.Query<Aspect>

rustic rain
#

not for high level code

viral sonnet
#

that ToComponentDataArray usage is pretty gross

robust scaffold
#

It's probably just a bursted access to ComponentDataFromEntity, I think... actually probably not

rustic rain
#

didn't someone mention that Burst creates it's own simd?

viral sonnet
#

well, great. that high level code runs worse because of it ๐Ÿ˜„ AoS would be much better then

rustic rain
#

in compatibles loops

robust scaffold
#

You can use the assembly calls or let burst do it for you?

viral sonnet
#

that kind of code and data access is never compatible for simd

robust scaffold
#

i mean, that's what burst is

rustic rain
#

I don't talk about whatever code you are mentioning, kek

#

just in general

robust scaffold
#

the ToComponentDataArray is probably better for burst as it aligns data from a query of discontinuous entities into a single array to iterate though

#

there's probably a cross over point from using ComponentDataFromEntity to creating and populating a component data array depending on how many being queried

viral sonnet
#

ToComponentDataArray builds a collection of structs. they turn int* to type T, as they are not using ref i think it initiates a copy

robust scaffold
#

That's returning a managed array. Is there one that returns a NativeArray?

#

Because that code was in a bursted OnUpdate()

viral sonnet
#

ah yes, give me a sec

#

can't post the whole thing

#

i have no idea why anyone would do that.

robust scaffold
#

hrm, readonly copy. Well, if you want that

viral sonnet
#

maybe it's better for non-linear access?

robust scaffold
#

Merging chunks maybe?

#

You can not run simd commands over pointers, this pulls the data out of the pointer and aligns them into one native array

viral sonnet
#

kind of interesting which would be faster. i mean, copying all comps is pretty huge. i don't think it's worth it in the end

#

random access is slow but not that slow to compensate with a write

robust scaffold
#

Possibly over many many entities and if you're running a lot of simd commands over the same data set

#

because you also need to mem copy it back if you want that data to be applied

viral sonnet
#

when you are having non-linear access simd won't work

robust scaffold
#

if you know how the access is patterned, you can sort it so the access is linear?

#

and then unsort it, and then mem-copy it back

#

yea, it's very roundabout but there is possibly a very small niche where it's faster than direct pointer access

viral sonnet
#

i have tried these kind of things. sorting is really slow. the code you posted, i don't see any random access.

robust scaffold
#

these are also training samples, not hyper optimized for burst simd

viral sonnet
#

so it seems to revolve around this bucket. makes sense with that implementation to not have it run parallel.

#

and it runs on these buckets. not on actual chunks

#

i dunno, i'm not investing too much brain power into this problem. i'm just pretty sure that this is not a good solution

#

doesn't use ecs or jobs

#

ecs data would be better off in a simple nativeList

#

instead of this whole copying per frame ...

robust scaffold
#

It's an implementation of a GO project in DOTS. Not the most efficient, just that it's possible.

#

and im sure even with this non-optimal project format, it provides better performance

#

which is why they use these projects instead of rotating 1000 cubes

viral sonnet
#

i'd bet the go project without copying a massive of data around is faster. there's really not much burst can do here

#

it can't magically make a chain of conditions faster

robust scaffold
viral sonnet
#

you are leaving out il2cpp :)

#

when i have learned one thing. writing data in memory is baaad

#

and per frame allocating is even worse

#

you'd have to make up alot for it with burst to compensate that

robust scaffold
#

@rustic rain Yea, 2D Entities (the sprite renderer converter) works out of the box. Kinda. Gotta edit the assembly definition files to whatever the editor complains about but otherwise works.

#

The conversion must be done in a subscene though, not through the convert and destroy script sadly

rustic rain
#

since DOts by itself sprite renderer conversion is just doing GO clones

robust scaffold
#

com.unity.2d.entities

rustic rain
#

Interesting

#

I wouldn't think that experimental sprite renderer static cache is valid

#

kek

robust scaffold
#

still exists in 2021. Also 2022. So gotta love codebase bloat and debt.

#

yea, all the functions work

#

Translation applies, color applies, dont use masks so no clue on that

rustic rain
#

masks are pog

#

good for creating some kind of roof thingy

robust scaffold
#

Ya know, I dont get why we have 4 separate components for the same matrix

viral sonnet
#

it's for hierarchy. if you don't use one. remove translation, rotation, etc...

#

LTW has accessors for all these

rustic rain
#

translation is like local position

#

you don't always want to work in absolute one

robust scaffold
#

Local to world isnt the absolute position though? Translation is the bottom 3 values of a L2W matrix

rustic rain
#

what I don't understand - why have 3 different types of scale

robust scaffold
#

it's copied direct to it.

rustic rain
#

LTW is absolute

robust scaffold
#

Ah, parenting and inheritance

#

forgot, i have no hierarchy so that doesnt come into play

robust scaffold
rustic rain
#

yeah, but sometimes...

robust scaffold
#

and what's the third scaling?

rustic rain
#

and then you sit for hour figuring out why it's not working

rustic rain
#

this one applies automatically with physics

#

no idea why

robust scaffold
#

what is that, oh.

rustic rain
#

no idea what for

#

but it exists

#

and I hate it

#

would rather just have non uniform one

robust scaffold
#

I've only seen the default authoring use Non Uniform Scale. Even with uniform scaling. So I just shrug.

#

Well no, if scaling is 1, 1, 1, then scaling doesnt exist

rustic rain
#

yeah

robust scaffold
#
if (transform.localScale != Vector3.one)
    DstEntityManager.AddComponentData(entity, new NonUniformScale { Value = transform.localScale });```
Doesnt even check if it is uniform
rustic rain
#

that's good to know

#

that Scale is explicit

robust scaffold
#

hasNonUniformScale ? float4x4.Scale(chunkNonUniformScales[i].Value) : (hasScale ? float4x4.Scale(new float3(chunkScales[i].Value))
Well scale just translates into a float3 anyways

#

you're just saving 8 bytes by using scale over non uniform scale

rustic rain
#

yeah, it is kind of important, hehe

#

more entities to put into chunk - more CPU cache utilisation

#

doesn't matter what happens on execution stack

#

what matters is amount of entities in chunk

robust scaffold
#

If you're worried about chunk utilization and packing, you wouldnt use any of these interfaces anyways. Just write straight to the L2W

rustic rain
#

nope

#

that makes quite a lot of things... single threaded

#

due to way too many dependencies on l2w

viral sonnet
#

huh?

robust scaffold
#

implement your own L2W and pass it to shaders via compute buffer manually

rustic rain
#

let's say you have 10 systems that depend on l2w

#

all will be chained in dependency

#

and only read access will be parallel

robust scaffold
#

turn off safety, manually dependency

#

true performance comes with sacrifices in sanity

rustic rain
#

lul

#

nah, Translation is fine

solemn hollow
#

@rustic rain that makes no sense. if you need to write 10 times to localtoworld you also need to write 10 times to transform if youd use that. you would chain it exactly the same way

robust scaffold
robust scaffold
#

Manually implemented L2W

rustic rain
#

you might need to write to scale, to rotation and translation in l2w

#

meanwhile doing it seprately can be paralle

robust scaffold
#

I get why rotation is an interface though. Separating it from scale and then re-applying it is pain.

viral sonnet
#

when 10 systems write to the same ltws you have a problem anyway. i'm also not understanding how t/r/s would make anything different really

rustic rain
#

because this way

#

you will write to separate components

#

and then TRS system will combine it into LTW in one go

viral sonnet
#

why not write to the actual data instead?

solemn hollow
#

you will have lower cache utilisation overall if you only used l2w cause if you write to position youd also get the rotation data to cache

robust scaffold
#

If you have 1 system writing to the translation element and 9 systems modifying the rotation, that 1 system can be done in parallel with the 9

rustic rain
#

because if you only need to change rotation in ltw, you are blocking whole ltw

#

while scale/translation systems wait

robust scaffold
#

And yea, cache utilization inside the CPU as well. L2W is beefy.

viral sonnet
#

well, that's true but it's reeeeeally weird

rustic rain
#

that's just sacrifice for better good

solemn hollow
#

data duplication for faster access pattern is not weird

#

its even mentioned in the best practice guide for dots IIRC

rustic rain
#

yeah, I want to make my UI interface with it

robust scaffold
#

Denormalization. Always a tricky thing to balance

viral sonnet
#

this is not just data duplication. it's the premise that x systems write to one comp. that's just bad

robust scaffold
rustic rain
#

for every UI elements visual element create entity with set of components

#

and let's say you have label

#

in which you need to write float

#

you'll have component with float field

#

every time you write to it

solemn hollow
robust scaffold
#

UI Elements really need a native array and job access. But I'm pretty sure it's near entirely a compute shader

rustic rain
#

it triggers other system that will write to managed text field

#

kind of like ECB

#

kek

viral sonnet
rustic rain
#

this way you can change UI in bursted systems

viral sonnet
#

i can't even think of a proper use case tbh

solemn hollow
viral sonnet
#

then you have a clear sequence of dependencies

solemn hollow
#

i wrote whole character controllers with additive movement for modularity

viral sonnet
#

so in this rotation example, you could use ltw instead

solemn hollow
#

yes order might matter. not in all cases. you could always use l2w instead of the other 3 components. makes it slower and more complicated though

rustic rain
#
            _selectionQuery = GetEntityQuery(typeof(SelectedTag));
            _selectionQuery.SetChangedVersionFilter(ComponentType.ReadOnly<SelectedTag>());
            RequireForUpdate(_selectionQuery);

Any idea if that is achievable?

solemn hollow
#

yes why not?

rustic rain
#

so far it's not working

#

it updates every frame

#

no matter whether there were any changes to selectedTag

#

(it's not actually tag)

solemn hollow
#

hmm i guess the problem is that the query has to be checked at that point in time where the system has to run. so the system starts running , the filter is checked and the system continues running.

#

i really hope that will be improved in the future

rustic rain
#

if (!_selectionQuery.IsEmpty)

#

I'll try this

#

that works

#

well

#

yeah, I guess that UI entity idea should be good

#

having burstable interface for UI

#

should be pog

robust scaffold
#

UI Elements is suppose to interface with DOTS

#

was suppose to at least

#

But then development hell happened and that was striked off the roadmap for the forseeable future

rustic rain
#

welp, as for now it doesn't at all

#

so I don't see any reason why not

#

kek

robust scaffold
#

UI Elements is really really good. 1 draw call for static elements and 1 more draw call for dynamic elements. Absolutely amazing.

rustic rain
#

that should not even be that hard to implement

robust scaffold
#

yea, i dont know why, just give us pointer access to the compute buffers used to feed the ui rendering system

#

we'll make it work from there

rustic rain
#

uugh

#

I wouldn't want that

#

I just want to have unmanaged interfaces

robust scaffold
#

yea, you're implementation will probably be along the lines of UGUI. Which is ewww but I doubt any actual development is going into that anymore.

rustic rain
#

uugh?

#

how is ugui related?

robust scaffold
#

UGUI is element based. You can attach events to every specific element of the UI interface that trigger if only that specific element is interacted with

#

The downside is that each element requires a draw call per, IIRC. And data is uploaded to the GPU per element as well.

rustic rain
#

I don't really see any of that is relevant to UI elements

robust scaffold
#

UIElements is flattened. Data is uploaded to the GPU all at once in a single buffer. It uses a single shader for every single element. It renders in a single indirect draw call.

rustic rain
#

and unmanaged interface I want for it

robust scaffold
#

The point is, I dont think it's formatted the way you want for systems to be triggered if a specific UI box or text input is interacted with.

rustic rain
#

but that's how it is?
If you want to change label text, you change this label's text, kek

#

ooh

#

nothing about events

#

just

#

just interface to change values in VEs

#

in unmanaged world

#

you change struct's field, this field is then copied to Text's value property

#

events can be made unmanaged too btw

#

but that requires structural changes

robust scaffold
#

They'll need to expose the compute buffer data used and the relationship values to connect indices of that buffer to UI elements.

rustic rain
#

you simply create entities during callbacks with some settings for event component

#

or assign data to precreated entities

#

I have a list of static entities that are created on world creation

rustic rain
#

I'd say it's already fast enough

robust scaffold
rustic rain
#

so you don't really want to struggle with compute buffers just to make 0.01ms overhead lower

#

xD

robust scaffold
#

Compute buffers arent hard to understand. It's a native array.

rustic rain
#

They are simply not convinient to work with

#

going that way, binary is also not hard to understand if you know what I mean xD

robust scaffold
#

If you want unmanaged access in a job and bursted, you must work with compute buffers. There's even a write as nativearray method to it for modification in a bursted job

rustic rain
#

yeah, but this is unsafe access

#

unless they actually implement some dependencies along

#

duplicated data components is the way, imo

#

you can even do queries this way

robust scaffold
#

Im sure they were planning that until DOTS stumbled

rustic rain
#

I also favour component interface idea

#

because you can simply do language change with it, kek

#

just query over all entities

#

and switch all strings from one language to another

robust scaffold
#

Did they skip 2022.3 LTS?

coarse turtle
#

i think they're sticking to a bi yearly stable release

robust scaffold
rustic rain
#

Does Unity support any sort of foldering for hierarchy debugger besides SubScene and Parenting?

robust scaffold
rustic rain
#

๐Ÿ‘ด

robust scaffold
#

There are both paid and free assets that do that. But nothing built in

rustic rain
#

oh?

#

any names?

robust scaffold
#

works well enough

rustic rain
#

I meant for entities

robust scaffold
#

Oh, yea no. I dont even think there are paid versions

rustic rain
#

sadge

#

would be weird to add LTP components just for sanity during debugging xD

robust scaffold
#

simply due to how subscene conversion works. It'll need to slip in before editor conversion and delete itself

rustic rain
#

but here we go

robust scaffold
#

How about multiple subscenes then? Nested subscenes?

rustic rain
#

I need to create entities during runtime

robust scaffold
#

oh, no clue then.

#

Would be nice if we had access to that foldering option

rustic rain
#

#if UNITY_EDITOR
EntityManager.SetFolder("PlayerScene");
#endif

#

tbh

#

considering Editor's UI is UI elements, kek

#

I think it's possible to just modify it

#

to work with it

#
            var parentUIEntity = EntityManager.CreateEntity(typeof(LocalToWorld));
            EntityManager.SetName(parentUIEntity, "UI");

            var uiFolder = new Parent { Value = parentUIEntity };

            foreach (var system in systems)
            {
                var systemFolder = EntityManager.CreateEntity(typeof(LocalToWorld), typeof(Parent));

                EntityManager.SetName(systemFolder, system.Root.name);
                EntityManager.SetComponentData(systemFolder, uiFolder);

                var localFolder = new Parent { Value = systemFolder };

                foreach (var ve in GetAllRecursively(system.Root))
                {
                    if (!string.IsNullOrEmpty(ve.name))
                    {
                        var uiEntity = EntityManager.CreateEntity(typeof(Parent),
                            typeof(LocalToParent),
                            typeof(LocalToWorld));
                        EntityManager.SetName(uiEntity, ve.name);
                        EntityManager.SetComponentData(uiEntity, localFolder);
                    }
                }
            }

With this disgusting code you can achieve this

robust scaffold
rustic rain
#

during runtime none of this is required

robust scaffold
#

but performance profiling in editor?

#

i will die if I had to build every time I tried profiling a small change

rustic rain
#

it's not really the kind of application for profiling

robust scaffold
#

but big fps gooder

rustic rain
#

the whole point is that you interface for bursted code

#

but that's still singletons mostly

#

which will probably be accessed by EntityManager

#

not chunk iteration

robust scaffold
#

After using subscenes for a while now, it's actually not that bad

rustic rain
#

they are great

#

just serialized part of world

hot basin
#

is anyone using Latios framework?

rotund token
hot basin
#

so 1.0 is due around may next year??

rotund token
#

Last I heard a preview end of this year, full release sometime after lts (~may)

hot basin
#

so there will be a preview

#

didn't get that reading forum

hot basin
robust scaffold
robust scaffold
#

Dont use it myself. 2d game

hot basin
#

yeah seems like it, and that's why i'm looking for more info about

#

with the recent animation addition it seems like a must

robust scaffold
#

The docs are fairly robust. and it's open source

viral sonnet
#

if i'd build an actual game I'd use it

#

audio and animation is nice. rest is, i dunno

hot basin
#

physics seems nice, especially when you don't want any actual physics simulation

#

like i.e. collisions and raycasts only

rotund token
#

Personally I'd never use it, I think it's going to cause some nightmares in 1.0

#

Unless you have no plans of updating anytime soon

viral sonnet
#

yep, that could turn out somewhat annoying

hot basin
#

as every custom package tbh

viral sonnet
#

man, what i'd give for a dark skin in unity forum

rotund token
#

And I expect hr to be vastly different in 2022

hot basin
rotund token
robust scaffold
#

@rustic rain Wow, hybrid sprite renderer performance is hot garbage

viral sonnet
rustic rain
rotund token
#

I believe it's actually true, less strain to read though don't quote me

rustic rain
#

even collecting of data is not bursted

hot basin
viral sonnet
rotund token
#

So what part of latios appeals to you then?

robust scaffold
viral sonnet
#

ouch ๐Ÿ˜ฆ

#

is this in urp?

robust scaffold
#

Regular GO rendering handles that in 1/50th the time. Literally 0.03ms

#

yea, urp

hot basin
#

I think I would like to delegate this task ๐Ÿ˜„ and make actual game

viral sonnet
#

i'm interested what makes it take so long.

#

just use GOs for animations and keep your sanity

safe lintel
#

@hot basin have you tried if animations from latios works inside of subscenes? because audio doesnt unfortunately

rustic rain
rotund token
hot basin
robust scaffold
#

hybrid renderer, uses shared components which is why it's not bursted and mainthreaded

rotund token
#

Not in 1.0!

robust scaffold
#

Yea, which will be amazing.

#

ive tried it, played around with it. Works as advertised

hot basin
rotund token
#

You might if you can't update to 1.0 because of it?

hot basin
#

yeah, that's why I'm doing the research

#

to assess if it's worth it

rotund token
#

I'm sure dreaming will update the library he's been good at maintaining

#

But I think it's going to be a lot of work

robust scaffold
hot basin
rustic rain
#

yeah, that's the point

#

but instead of using actual HR

#

hold on

#

that is actually pretty interesting approach

#

hehe

hot basin
rustic rain
#

this way all you do - create unique quad

#

per sprite

robust scaffold
#

you go to the API, construct a DrawMeshInstancedProcedural shader with it. Dont quite know how to structure the texture lookups though

hot basin
#

it would be similiar

rustic rain
#

which is actually good ngl

hot basin
#

but you will need to manually update Buffer in the material with correct UVs

robust scaffold
rustic rain
#

lul

robust scaffold
#

I will do this manually, to get it done properly

rustic rain
#

HR does it properly

robust scaffold
#

I wonder if anyone actually falls for those <@&502884371011731486> ^^

robust scaffold
hot basin
#

it's same as my animation rebnderer but I have static buffers with animation data and update current frame ๐Ÿ˜„

rustic rain
#

I had no issue with it

robust scaffold
rustic rain
#

I never implemented sprite converter

#

let's do test though

robust scaffold
#

I do a quad plaster screenside for my light rendering. So it's not difficult to retool it again for sprite rendering and then sample a texture for the sprite (i think)

rustic rain
#

this is thousand of capsules + spheres

#

meanwhile each has it's own personal draw call for movement line

#

(my bad with it, kek)

#

turned it off

robust scaffold
rustic rain
#

this is HR sir

robust scaffold
#

oof, 5ms. thats bad. You can probably get it down to 0.05ms if you do it in one draw call

rustic rain
#

that's why Kraja's suggestion is actually great

#

it's 5ms with all game logic

#

not just drawing

#

kek

robust scaffold
#

no no, the difference between the two with movement lines on each

rustic rain
#

here HR profiled

robust scaffold
#

yea, that seems... reasonable.

rustic rain
#

rn I'm just lazy

#

and have other things to attend to

robust scaffold
#

but sprite renderer is a completely different API from 3d. Does it still work? Or does a form of it need to be implemented through HR?

rustic rain
#

you don't get it, sir

#

you literally just convert sprite renderer into RenderMesh

#

you do it by creating special Quad for unique sprites

robust scaffold
#

but you dont need a special quad per sprite. 1 should be enough for everything

rustic rain
#

you just rewrite uv for vertices and that's it

rustic rain
#

the whole point is to just pass all the work to HR

#

so you don't have to care about culling and etc

#

all done by HR

#

it doesn't necessarily means unique quad per sprite

#

though

#

it just means that every unique uv will be unique quad

hot basin
#

if all you need is 500 sprites I'd say F the culling ๐Ÿ˜„

robust scaffold
#

Graphics Draw calls are fulcrum culled though. I believe that's GPU side.

rustic rain
#

you still calculate draw data

#

you still do CPU bound work

#

while HR culling system does a quick bursted check for that

robust scaffold
#

ideally 1 call for all sprites, no matter the number, 5 or 50,000 sprites all in 1 call.

rustic rain
#

1 call per atlas

robust scaffold
#

i was thinking maybe a Texture2DArray so all atlases are uploaded. Or a compute shader filtering used atlases

rustic rain
#

but tbh, you'd need either batcher (1024 limit)

#

or do indirect one

robust scaffold
#

Nah, Graphics procedural or indirect are not bound by batch number

#

I know that for certain, spent a few long hours converting it from instanced to procedural.

gusty comet
#

wait does the hybrid renderer finally support sprites?

robust scaffold
rustic rain
#

ofc not

robust scaffold
#

probably will with 1.0, maybe

rustic rain
#

we just discuss how we can fix it manually

gusty comet
#

I was looking into that so I nudge into this conversation if you don't mind.

robust scaffold
#

still, I think a manual draw procedural will be better than using hybrid renderer if it splits draw calls per atlas

gusty comet
#

Here it specifically mentions sprites

#

Or the sprite renderer in particular

robust scaffold
rustic rain
#

currently

#

which... sucks

gusty comet
#

Whelp

#

My thing is I mostly want ECS because I prefer the way to structure code.

robust scaffold
#

There's the sorta conversion that hooks into old Tiny API that im using. But performance is very very very bad.

gusty comet
#

I was pondering to use gameobjects or a tile renderer to just render the stuff and do all logic on the ECS side

robust scaffold
#

I mean, it works, but it's bad. I might just stick with it as a temporary solution until 1.0 comes out

robust scaffold
gusty comet
#

Given the pace we had I do not expect it before mid next year at the earliest

#

I do 2d turn based stuff so tilemaps make sense

#

Think turn based rimworld and you have my usecase

robust scaffold
gusty comet
#

I mean the 2021 LTS was when march this year or so?

robust scaffold
gusty comet
#

As said my main reason for wanting dots is less the performance side of things and more of not having to deal with the messy way unity handles references

#

Data oriented design clicks far better with me.

robust scaffold
gusty comet
#

define "very bad"

rustic rain
#

ok for small amount of entities

robust scaffold
#

Regular GO renders 500 circle sprites in 0.03 ms. That renders in 1.0 ms. So about 50x slower ish.

safe lintel
#

tiny was only ever meant for running mainthread code

gusty comet
#

On the note of dots or unity in general I read that a major reason why dots had such a rocky development was that internally they were pushing and pulling in different directions.

#

Explains a lot of the half baked features we got in recent years.

robust scaffold
#

they were too optimistic with the timeline. 0.50 cut a lot from the promised feature list to get shipped and even then, it barely functions.

#

The key feature, the entities debugging UI is bugged in 2021. Selected entities arent highlighted.

#

The other half, code-gen works well enough. Need to hard restart the editor (deleting cache between restarts) if too many changes are done between code compiles and it dies.

#

0.50 is rough but im glad it's here and dots isnt completely dead, just scaled back a fuck ton

rustic rain
#

this is fixed with it

#

kek

robust scaffold
#

there's also that burst issue as well but it's fixed in 1.7.3 at leastr

gusty comet
#

Wait so an interop issue between the c# and the c++ side of it?

robust scaffold
#

nah, code gen is the same as the wider C# .NET code generation.

rustic rain
#

there are no issues besides too much waiting, kek

robust scaffold
#

Just unity's implementation is not quite robust enough for wider production use. Hence preview packages

#

And with a lot of it, it gets pretty slow. I think the 1.0 IAspect is suppose to help on that front

safe lintel
#

I think aspects are for usability not speed

robust scaffold
#

Maybe both?

safe lintel
#

would love it if there were some speedup but not getting my hopes up

robust scaffold
#

Checking the current usage of them in the unity training branch shows that it looks to allow for the simplification of foreach on main thread to use c#'s built in foreach() while also burst capable.

#

Job'ed for each aspects still had to go through lambdas though which is hrm.

rotund token
#

Isn't that just the new entities foreach?

robust scaffold
#

The usage was foreach(var entity in SystemAPI.Query<Aspect>()){} on the main thread. Burst the entire OnUpdate() to burst execute the foreach.

rotund token
#

Hmm yeah that's the be entities foreach syntax

#

Not sure how it integrates with aspects

robust scaffold
#

Aspects define the query and component access to whatever entity is matched.

rotund token
#

I noticed they have a new bakers api for conversion

robust scaffold
#

Just looks like a rename of IConvertGameObjectToEntity (which is pretty long)

rotund token
#

I don't think so

#

I think it's a replacement for conversion system

#

Or a mix

#

Because you notice the bakers point to an underlying monobehaviour authoring script

#
// Bakers convert authoring MonoBehaviours into entities and components. class CannonBallBaker : Baker<CannonBallAuthoring> { public override void Bake(CannonBallAuthoring authoring) { AddComponent<CannonBall>(); } } ```
#

Ok code doesn't copy on my phone

robust scaffold
#

It seems to bring in SystemBase's implicit methods that map to entity manager API

rotund token
#

So yeah I guess it's kind of an interface replacement but needing an extra class

#

I guess separation of data and logic

robust scaffold
#

I really hope they retain [GenerateAuthoringComponent] because writing a bake and a monobehavior for every component type that will be converted will be absolute pain

#

I dont see any of these training samples using it though which gives me a bit of concern

rotund token
#

They seem to have got rid of the old conversion system

#

So maybe component system is finally gone

#

Need to see system group

#

You just use ISystem etc for conversion now

#

[WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)]

gusty comet
#

the funny thing is that Unreal in UE5 has an experimental version of an ECS as well.

#

It uses a different nomenclature but its for all intents and purposes a fully features ECS

#

Which I hope lights a fire under Unitys butt.

robust scaffold
#

I will eat my hat if unreal ships this to production faster than unity

balmy thistle
#

how are we qualifying "ships"

gusty comet
#

Do you want salt, sugar or a condiment?

#

Unreals turnaround time from experimental to production is generally less then a year.

#

So there is a decently high chance of that happening.

rotund token
#
var ecb = ecbSingleton.CreateCommandBuffer(state.WorldUnmanaged);```
#

missed this, new singleton API and how command buffers may work in ISystem

robust scaffold
rotund token
#
            .WithAll<Turret>()
            .ForEach((TransformAspect transform, in Turret turret) =>
            {```
old api still seems to exist
#

and seems to handle TransformAspects as well

#

(also good to confirm TransformAspect exists as I was under the impression transform operations was one of the primary uses of aspects)

robust scaffold
rotund token
#

from what i understand this should not be the case come actual release

#

but yeah looks that way atm

robust scaffold
#

hopefully but I have no clue how they're gonna do that

rotund token
#

for 1.0 we've developed an alternative to EFE that requires several times less work from the sourcegenerators (which are both what slows down VS and also one of the many sources of bad iteration time in the unity editor). It unfortunately does require y'all (and also us) to convert manually, though. :/
Is it the Query syntax that was shown off at GDC for ISystem?
It's that plus some variations to use Aspects, plus some other improvements to SystemAPI, ish. I'm probably forgetting some, er, aspect.
was discussion about it i had on forum

#

i assume you probably just call ScheduleParallel() or something in the SystemAPI

#

its all code gen anyway

robust scaffold
#

Noooooooooooooooooooooooooooo, manual conversion

rotund token
#

good thing I have like no EFE

robust scaffold
#

efe?

rotund token
#

entities foreach

balmy thistle
#

or yeet it over to IJE

robust scaffold
#

ah, not the GO to Entity conversion, but converting the lambdas

#

that's fine. I can live with that. I can not live with writing out the monobehavior and the baker for every single component

rotund token
#

i actually have no issue with that

#

i use generate authoring pretty rarely

#

most of my authoring handles half a dozen+ components at once

#

otherwise i end up with 12345 components per gameobject

robust scaffold
#

yea, but im lazy

rotund token
#

and it becomes unmanageable

#

you could probably setup a template in your ide to generate this nearly as fast

#

i made a template for ISystem recently, holy hell saves me so much time

#

generates the job, 2 type handles with updates, schedules everything, starts iterating in the job, sets up change filtering etc

robust scaffold
#

I should be converting everything to ISystem shouldnt I....

rotund token
#

writes a good 90 lines of code for me

robust scaffold
viral sonnet
#

hope it's a healthy hat

robust scaffold
#

a nice, flavorful hat.

#

unity has been waffling about with dots for nearly 6 years now. 2016 was when we first heard of it right?

viral sonnet
#

i think 2018. 2019 was the first release.

rotund token
#

unreals data layout looks very similar

viral sonnet
#

news might have been much sooner

robust scaffold
viral sonnet
#

bevvy might have a v too much

rotund token
#

oh boy looking at some really really old repos of mine (19 Jul 2018)

#

[Inject] private ReactiveUpdateBarrier _barrier;

#

back in the days of injecting

#

i dont even know what i was trying to do here

viral sonnet
#

yeah mid 2018 must be it

gusty comet
viral sonnet
#

that's kind of a given with SoA layout

#

everything else has just as many cache misses

rotund token
#

it's interesting because as far as i can tell it infringes unitys archetype style storage of chunks patent

gusty comet
#

How would they patent something that existed already since 1965?

#

ECS is not new, its just new in games.

viral sonnet
#

what exists since 1965?

gusty comet
#

ecs as a way of structuring code was first popularized in 1965

rotund token
#

Some random redditors summary of the patent if you cbf reading it

    10-18 are related to archetype-style storage of chunks as allocated in memory as [ A1 A2 A3 B1 B2 B3 C1 C2 C3 ]
    19-20 are related to non-transitory storage of instructions that facilitate 1-18. I interpret this to be "the software program".```
#

Bevy ECS does not store memory in chunks using either of those two memory layouts.

#

(there was a big concern at the time this would affect bevy)

viral sonnet
#

that patent is pretty ass tbh

gusty comet
#

Ok I am semi confused with the whole sprite thing and entity conversion. When I use convert to entity it does create an entity with a sprite component but still has a gameobject clone?

rotund token
#

what was your expectation?

gusty comet
#

Its less about my expectation and more me being interested why its doing it this way.

rotund token
#

because it's one of the supported Companion Components

#

that's about the extent of support in hbv2

gusty comet
#

I was thinking of trying to fudge it using quads

#

Also my expectation fyi was to it simply not work at all which was the case in 0.17

#

It would just omit things it could not convert

gusty comet
#

I am semi confused I am doing EntityManager entityManager = new EntityManager(); Entity entity = entityManager.CreateEntity(); Which returns me a null reference error which I do no get what the heck is happening there since its literally just supposed to create an empty entity.

rotund token
#
   EntityManager entityManager = new EntityManager();

ah you should never do this

gusty comet
#

How else should I access entities. Is there now one global entity manager or something like that?

rotund token
#

each world has an entitymanager

gusty comet
#

Sheesh the documentation is still totally sparse.

#

A lot of stuff for conversion but nothing of what you just mentioned.

balmy thistle
#

served with a side of sparsely

gusty comet
#

And it does not help that tutorials are totally fractured and also mostly focused on conversaion bs that I do not care about.

rotund token
#

that's weird, i always thought the documentation for conversion was basically non-existent

gusty comet
#

And no API documentation it seems?

rotund token
#

yeah

#

you've already skipped the entire documentation

#

you're like at the end of the tutorial

#

there's a lot to cover before you get to conversion

safe lintel
#

stop ignoring conversion and you will save yourself a lot of headache adjusting

rotund token
#

(that to)

gusty comet
#

huh?

rotund token
#

i feel like everyone who starts on entities for some reason just hates on conversion and then has hell for months

gusty comet
#

I do not care about conversion because my game is literally only data and a bit of frontend displaying.

#

I am making a roguelike which is bascally 95% dynamic data and 5% ui

rotund token
#

so what?

#

everything should still go through conversion

gusty comet
#

Why?

safe lintel
#

just going around in circles but just learn up about it, and then selectively ignore it where it makes sense, but it sounds like you are trying to run before you can walk

gusty comet
#

I have worked with .17 but nowhere in that documentation is there any mention of specific changes so where the heck should I have known that this is no longer the case?

rotund token
#

nearly anywhere in your code that has
entityManager.CreateEntity()
should be done via setting up prefabs in conversion

gusty comet
#

Again prefabs are useless if I dynamically compose

#

I am not making some platformer with a neat player character.

#

The whole reason I want ECS is that I can dynamically compose

safe lintel
#

nowhere in 0.17 or previous versions was EntityManager entityManager = new EntityManager(); ever a thing, so really just take the time to read the docs. anyway changes can be found in the changelog

gusty comet
#

in that changelog the only time entitymanager is mentioned is in 0.16 nothing there indicates a change on how entitymanger is supposed to be acessed at all.

viral sonnet
#

it was always accessed via world. wdym?

gusty comet
#

The syntax for that has at least changed thrice now if its something new again.

viral sonnet
#

uhm, no

rotund token
robust scaffold
#

World.Default(something).EntityManager for the default world

robust scaffold
rustic rain
#

what the

#

even full reimport didn't help

#

ok, full library removeal helped

#

some internal bug I guess

rotund token
#

what version of burst and did your unity crash/incorrectly close recently?

rustic rain
#

Is there any way to have bursted OnUpdate in managed System?

rustic rain
rotund token
#

just clearing that should fix it

rotund token
rustic rain
#

uugh

#

I guess I'll try that

#

if amount of work will be big enough

#

it's mostly EntityManager calls

#

getdata, writedata

#

hasComponent

#

and etc

rotund token
#

sounds like it should be an ISystem

#

๐Ÿ˜„

rustic rain
#

I really tried

#

but it's really hard to have async init for ISystem

rotund token
#

what do you mean by that?

rustic rain
#

for ISystem to run, I need async assets loaded

#

but they loaded only after OnCreate is called

rotund token
#

isn't that what RequireForUpdate is for?

rustic rain
#

it is, but I still need to grab data

#

Like entitiy

#

and I end up with inability to assign it

#

since there is no OnStartRunning that can be managed

rotund token
#

there is on start running

#

for ISystem

rustic rain
#

how can I get one?

rotund token
#

implement ISystemStartStop

#
    /// Optional interface for start/stop notifications on systems.
    /// </summary>
    internal interface ISystemStartStop
    {
        void OnStartRunning(ref SystemState state);
        void OnStopRunning(ref SystemState state);
    }```
rustic rain
#

huh

#

cool

rotund token
#

public struct MySystem : ISystem, ISystemStartStop

rustic rain
#

ah, too bad I scrapped it all already

#

I might reimplement it later, for now I have another task on my head

#

I want to make a selection tool

#

similiar to Editor's inspector

#

that will show all relevant data in text fields

#

and I'm not sure how can I grab that data without hardcoding anything

#

I kind of consider having special interface for components that will enforce to implement ToString override

#

but maybe there's a better way?

rustic rain
#

Is comparing FixedString fast?

#

if it's like 4096 bytes

#

comparing with null I mean

rotund token
#

if you were just comparing to null should be pretty fast

#

would terminate first iteration

rustic rain
#

what is assembly for these attributes?

#

Unity.Burst didn't work

#

Collections -_-

rustic rain
#

bbbruuuuuh

#

I swear

#

Entities really need a special phase

#

PostCreate

#

where all systems can get a chance to get static references

rotund token
#

kind of goes against the whole ecs philosophy

rustic rain
#

is there a way I can do it manually?

rustic rain
#

this is 100% ECS

#

I just want to call GetSingletonEntity in some kind of PostCreate

rotund token
#

you said the word static therefore i'm doubtful

#

oh singleton entity

#

ok now i'm confused what you're trying to do

rustic rain
#

yeah, per world

#

in short

#

I decided to apply full Data approach

#

and now implementing simple input

#

mouse click

#

every time mouse is clicked on UI screen

#

before SimulationGroup data of click position is written to component

#

on same InputEntity

#

which gets created by that system

#

so I jsut want my other ISystem to get that Entity

#

because it'll last until World is destroyed

rotund token
#

can't you just use onstart running

#

or just not care and use getsingletonentity?

rustic rain
#

I use RequireForUpdate

#

for triggering

rustic rain
#
        public void OnCreate(ref SystemState state)
        {
            state.RequireSingletonForUpdate<GalaxyLoaded>();
            state.RequireSingletonForUpdate<PlayerTag>();
            state.RequireSingletonForUpdate<MouseEvent<Space, Up>>();
        }
#

it looks like this

rotund token
#

though you can use query.GetSingleton

#

to basically do the same thing

rustic rain
#

MouseEvent<Space,Up> will get removed in Presentation phase

rustic rain
#

is there a way

#

I can manually do a call?

#

with ref SystemState?

#

I already have similiar implementation

#

with managed systems

#

but ISystems is smth I can't easily access it seems

#

or can I?

#

maybe I can

#

But I don't want that just for one

#

I want to have for example an inferface

#

Can I somehow query over all?

rotund token
#

a little confused what you're asking

rustic rain
#

I want World.Systems for ISystems

rotund token
#
            for (int i = 0; i < allUnmanaged.Length; ++i)
            {
                list.Add((SystemState*)allUnmanaged[i]);
            }```
are you wanting to iterate over all unmanaged systems? if so i literally wrote this code 15min ago
#

(you need internal access)

rustic rain
#

It's fine I have it

#

hmmm

rotund token
#

i'm writing a system to automatically detect bad change filters i.e. they are being triggered much more frequently than you expect

#

so i need to record every systems version hence i needed to iterate them all

#

somewhat of a coincidence since i just dug into code to figure this out

rustic rain
#

I'm not very familiar with casting pointers
Could you tip me how can I do interface check?

#

smth like

rotund token
#

allUnmanaged[i] is just an IntPtr

rustic rain
#

allUnmanaged[i] is IPostCreateCallback callback

rotund token
#

oh yeah you can't do that

#

this isn't the actual system

#

hmm

#

so yeah not exactly what you want

rustic rain
#

even reflection will be ok

#

this is one time action

#

per World

rotund token
#

i believe UnmanagedWorld._unmanagedSlotByTypeHash

#

contains all the systems

#

but it's stored as ulong, ushort ^_^'

rustic rain
#
        internal SystemRef<T> GetExistingUnmanagedSystem<T>() where T : unmanaged, ISystem
        {
            if (_unmanagedSlotByTypeHash.TryGetFirstValue(BurstRuntime.GetHashCode64<T>(), out ushort handle, out _))
            {
                var block = _stateMemory.GetBlock(handle, out var subIndex);
                var sysHandle = new SystemHandle<T>(handle, block->Version[subIndex], (uint) SequenceNumber);
                void* ptr = (void*)(IntPtr)block->SystemPointer[subIndex];
                return new SystemRef<T>(ptr, sysHandle);
            }
            FailBecauseSystemDoesNotExist();
            return default;
        }
rotund token
#

yeah was about to say

#

you need to do something like that using that

#
        void ISystem.OnUpdate(ref SystemState state)
        {
            var entity = this.query.GetSingletonEntity();
            Debug.Log($"{entity.ToFixedString()}");
        }```
also this seems to work fine in burst?