#archived-dots

1 messages ยท Page 48 of 1

rotund token
#

you need to build up around them

misty wedge
#

Yep

#

I don't really have crazy performance requirements so it's not a big issue for me

#

Was this that booleans were sometimes "skipped" by the server in commands?

hot basin
#

nvm it's just bones and all

#

everything just packed in ECS

covert lagoon
#

What do you recommend for shooter character and gun animations around Entities 0.51?

misty wedge
rotund token
misty wedge
#

Maybe this is related my issue where the InputEvent state doesn't match the other sent data in the command

hot basin
#

is anyone using new skinning from Entities.Graphics?

#

or GO with animator is still preferred way?

late mural
#

whoops that was too long, let me put that in pastebin instead

#

im feeling so lost right now, this job works perfectly as long as the number of cells (how many times the for loop runs) is under 32, but if it ever goes above it starts completely messing up everything, with triangles getting mixed up and joining in ways they shouldn't, have i accidentally created a race condition????
https://hastebin.com/somapoqozu.cs

misty wedge
#

What is BetterTriTable

#

Also you are writing to NumTris[0] in parallel, making the result undefined

#

Also I'm assuming you are using 32 for your innerloop batch count, meaning your job was never thread safe in the first place

#

(which explains why it breaks if you go higher)

late mural
#

fascinating, better tri table is just a simple marching cube tri table, and also NumTris[0] isnt undefined for some reason, the number stays correct somehow,

I dont quite get how having the innerloop batch count being 32 makes my job thread unsafe, im a bit of a noob, sorry lol

misty wedge
#

Your job just isn't thread safe. Since your inner loop batch count is set to 32, when your job is scheduled, it is picked up by threads in batches of 32, meaning value less than that makes the job single threaded

#

Set your inner loop batch count to 1, and schedule it with 2, it will also break

#

(at least I am assuming it will)

late mural
#

oh fascinating, ill try that quickly and report back

misty wedge
#

NumTris[0] isnt undefined for some reason, the number stays correct somehow

#

The number stays correct because anything less than 32 is single threaded

#

Above that the result will be undefined

late mural
#

ok yup you are definitely correct, now how do i make it threadsafe then?

misty wedge
#

It depends on what you are doing, the code you posted doesn't actually show how you use the result. All you are doing is writing vertex positions to a NativeList

#

How are you calculating the triangles?

#

i.e. which vertices belong to which triangle

late mural
#

ah ill add the rest of the code then quickly, it will be a bit of a mess though as most of it is copied from my old marching cube fluid renderer that i adapted to work with perlin noise, brb

remote crater
misty wedge
late mural
misty wedge
#

The easiest way is to write how many triangles each thread created separately, and then add them together afterwards

late mural
#

ah ok, that makes sense, thanks a ton!

misty wedge
#

The maximum amount of threads that can work on the job in parallel is defined by JobsUtility.JobWorkerMaximumCount

#

You can get the currently running thread index in your job by adding an int field with the [NativeSetThreadIndex] attribute

late mural
#

ok fascinating, im not quite sure how that would help, but ill keep that in mind!

misty wedge
#

Create a NativeArray[JobsUtility.JobWorkerMaximumCount], and then in your job do CountArray[ThreadIndex]++

#

That way each thread is counting up its own counter

late mural
#

ok cool, that sounds useful in someway, ill think about it and try writing down the logic with a pencil and paper and see if i can get something working, thanks so much!

misty wedge
#

Floating point based calculations will stop being very accurate around 100000, unity even gives you a warning related to it

#

You will need to write your own transform system that use 64 bit values

remote crater
#

incorrect

#

Schnozzle, it works fine for GameObjects

misty wedge
#

What works fine?

remote crater
#

Watch the video

#

I have game objects rendered like 100000000000000000000+ away

misty wedge
#

Physics calculations will stop working

#

And pretty much everything else will also not work correctly

remote crater
#

That's not the point

#

I'm talking about a specific bug.

#

GameObjects can handle a very large negative

#

ECS cannot it appears

#

Has anyone discussed this before, is there a bug report, etc?

misty wedge
#

Probably not, but even if it would render, you cannot work with numbers this large

#

There's a bunch of other games that have dealt with this issue in very different ways

remote crater
#

It works fine with Gameobjects, I'm looking for more efficiency with ECS

misty wedge
#

I'd take a look at those

remote crater
#

No one's done what I'm about to do

#

๐Ÿ˜‰

misty wedge
#

I guarantee you it's certainly not possible with 32 bit floating point precision

remote crater
#

So it's just a bug in ECS,fine, I'll move my center into somewhere in giga +

misty wedge
#

...

#

Why do you think unity prints that warning for game objects far from the center?

remote crater
#

I don't need collision and alot of stuff

hot basin
#

even if it works it does not mean it wont break ๐Ÿ˜„

remote crater
#

You're changing the subject from a clear cut bug.

#

It works fine in Gameobject land

balmy thistle
balmy thistle
#

I'm not sure if I'd characterize it as a bug, because I'm not sure that's a supported use case, but I'd be interested in seeing it

remote crater
#

My game objects populate all around me,but as they convert to Entities, they are either not rendered or rendered in the + range

#

I'm doing a warp effect, using the true stars as particles, not just goofy made up ones like Nomanssky's hack

hot basin
#

so any negative value is not rendering?

remote crater
#

Watch the video in link

#

here's raw video:

hot basin
#

and it look like one side is dark, and if you are in (0,0,0)ish position with your camera

#

that means all negative values from at least one axis are broken

#

not just big numbers

remote crater
#

all negative values are broken on every axis

#

One cube out of what 25ish?

misty wedge
#

Have you tried with smaller numbers?

remote crater
#

We all know negative entity numbers works

misty wedge
#

You can try and find the limit where the issue appears

remote crater
#

You're right its the 32 bit thing, but it is still a bug because GameObjects allow it

hot basin
#

but yours do not work

remote crater
#

I would assume it's 32

misty wedge
#

It's not 32 ๐Ÿ˜…

remote crater
#

I could do a lot of things to track this down. All my bug reports get tossed out like a dilbert comic, so why waste time.

misty wedge
#

see if -3.40282347E+37 works

#

I can't see how large your number is from the screenshot

remote crater
#

So the community literarly didn't know this

misty wedge
#

It's probably not a supported use case

balmy thistle
#

I can't say I've run into that one yet, no

#

and I have saved at least one dilbert cartoon

hot basin
#

your conclusion is plainly wrong, so what should community know in this case?

remote crater
misty wedge
#

SpaaAAAaaaaAaace

#

is the conclusion

remote crater
balmy thistle
#

the undiscovered country

misty wedge
#

Back to trying to figure out input events :[

remote crater
#

I'll go back to space I guess

#

I should make a sector dedicated to outsoruced officer workers

balmy thistle
#

if you do happen to file a bug please lmk

remote crater
#

File bug, officer worker stamps it as not important, files away. Ez job.

misty wedge
#

I think that reduces the chances of it being fixed

balmy thistle
#

I understand, that does sound frustrating. Even if you did file this one I can't promise it would be fixed, as I'm not sure I'd characterize it as a supported use case. But I would be interested to see why there's a discrepancy just the same. Anyway, no worries.

misty wedge
balmy thistle
#

big oof

remote crater
hot basin
misty wedge
remote crater
#

but only one cube of how many cubes in 3d are there, rendered

#

9 above, 9 below

#

how many on sides?

#

8

#

9+9+8 and only one rendered, its clearly saying its negative, but not rendering: Could be not showing or scurried over into positive

hot basin
#

Only one cube of stars is rendered, like it is +x,+y,+z it means all negative numbers are not rendered not only the big ones

remote crater
#

I can check that fast by forcing it negative

#

Could be a weird camera thing?

remote crater
#

so what looks like only a little to the left

hot basin
#

are those stars billboards?

remote crater
#

is space distances

#

They're spheres

#

So that's a deceptive take you got Krajca

balmy thistle
#

My guess is degenerate bounding volume generation, but it's tough to say absent a working sample

remote crater
#

If a star was close by, I'd be rendered IN IT

#

I can give a sample, quite easy:

#

Just generate spheres with randompositions -Very far, to 0

#

I'll give you the code you need

#

sec

hot basin
#

I understand what you mean by "space distances" but the bug is "only +x,+y,+z spheres are rendering" and you should look for bug with that in mind

hot basin
viral sonnet
#

i think its safe to say, something in entities.graphics, probably culling is breaking down

remote crater
#

I'm making sure this is a completely encompassing easy to import package

viral sonnet
#

i vaguely remember some constraints for this

balmy thistle
#

Similar thoughts

viral sonnet
#

the question is, why not render a cubemap with scaled down values? are players able to reach those far away stars?

hot basin
#

also you can render scaled down versions closer, and scale them up as you get closer

remote crater
#

looks like I repoduced it very minimally

#

I'll export the package as a runnable Unity thingamabob asset type thing

edgy fulcrum
#

how do you Debug.Log a Hash128 in a bursted job?

remote crater
#

Upload it, where, bug reporto?

misty wedge
remote crater
#

Scratch that, new weirdness showed

edgy fulcrum
#

the problem happens when the job is bursted, thus I need to closely look at the value ๐Ÿ˜ฆ

misty wedge
#

You could log the hash's uint4, since what the hash is made of

robust scaffold
#

Ah, long time no see old friend.

remote crater
#

I just realized something stupid... All this time I wanted to give people my DOTS ECS system tutorials, but couldn't because I couldn't start from scratch... I could have just copied my project and deleted everything but the guts.

misty wedge
#

A lot has also changed since 0.51

remote crater
#

yup

#

thats why I wanted to get everyone hoked on my systesm

#

๐Ÿ˜‰

#

If you get everyone using your system as the proprietary standard, its harder to remove key features that it depends on.

#

I know the chess match all too well

#

I just forgot how to move a knight...

misty wedge
#

I don't follow, unity mentioned 0.51 wasn't production ready

remote crater
#

.51 was not production ready, and I knew it would change a lot

remote crater
#

so my desire was to do a cool youtube video(my DOTS/ECS videos do get views), and give free source code on the systems I especially did not want changed.

rotund token
#

but burst default precision is medium

remote crater
#

ty tertle, I'm still reducing my project for UNITY to review

rotund token
#
    FloatPrecision.High: Provides an accuracy of 1.0 ulp.
    FloatPrecision.Medium: Provides an accuracy of 3.5 ulp.
    FloatPrecision.Low: Has an accuracy defined per function, and functions might specify a restricted range of valid inputs.```
remote crater
#

Project is 40 GB so backing up before the surgery starts takes like 10minutes, almost done

#

Again I was making no conclusion, heck maybe a rogue system in my code is going bonkers, but seems less plausible.

rotund token
#

but yeah even at full precision anything above 1.4mill with floats

#

is very inaccurate

#

well it's relative

remote crater
#

my objects are 10000000000 m big

#

don't need accuracy ๐Ÿ™‚

#

it could waver 10000000 units, no one notices even the slightest jitter

#

Just doing a no collision fly by

rotund token
#

that's about the accuracy you'd have ^_^'

remote crater
#

exactly and no one notices!

#

Funny how stuff that people think shouldn't work does

#

I predicted the electric car in 96

#

My fellow Physics students and profs at Carnegie Mellon all disagreed or stayed silent

misty wedge
remote crater
#

I have lots of stuff I fought hive mind and won, just cuz no one thinks things through as they should, all go with the flow types

misty wedge
#

The easier approach is to do what KSP did, move the world instead of the player

remote crater
#

Angband's autosquelch the hive fought me for months on usenet, Angband vs Nethack is like Kirk vs Picard, its deep nerd lore... Well I designed the autosquelch despite protests, Andrew White coded it, and now its a must have or don't play design.

#

you gotta, you gotta be trying stuff that seems peculiar, do the calculations and such, don't just conform to meta. If you come at life on off meta, then if it doesn't work, do what everyone else is doing.

#

In fact I had so many successful multibillion ideas my friends make fun of me for always predicting the next big things in tech saying I should get a site: I thought of it first dot com, lol

#

On the right track, not moving, get run over, ok, enough useless platitudes, copy over, time to load up the new forked project and cut out all the assets.

late mural
#

i think noise.cnoise is perlin noise, but im not certain, is this what perlin noise i supposed to look like when using marching cubes?

robust scaffold
#

Stray triangles shouldnt happen with marching cubes

misty wedge
#

I think cnoise is correct though, at least that's also what I use for perlin ๐Ÿคท

viral sonnet
misty wedge
#

It also says it in the comment thonk

late mural
late mural
remote crater
#

Its funny, big guys, you'd think they'd be happy with their normal revenue, but ripping off indies is a side hustle I spose. Hoping Valve is cool.

#

Spend a few thousand hours here, a few thousand there in games, and contracts only are enforceable by the party with more money.

late mural
# misty wedge

im calculating my perlin noise for my marching cubes using something similar to this, anything obviously wrong with it?```cs
UpdatedCell.Vert0 = noise.cnoise((Cells[i].Pos + (VertexPosTable[0] * HalfLength)) * NoiseScale);
UpdatedCell.Vert1 = noise.cnoise((Cells[i].Pos + (VertexPosTable[1] * HalfLength)) * NoiseScale);
UpdatedCell.Vert2 = noise.cnoise((Cells[i].Pos + (VertexPosTable[2] * HalfLength)) * NoiseScale);
UpdatedCell.Vert3 = noise.cnoise((Cells[i].Pos + (VertexPosTable[3] * HalfLength)) * NoiseScale);
UpdatedCell.Vert4 = noise.cnoise((Cells[i].Pos + (VertexPosTable[4] * HalfLength)) * NoiseScale);
UpdatedCell.Vert5 = noise.cnoise((Cells[i].Pos + (VertexPosTable[5] * HalfLength)) * NoiseScale);
UpdatedCell.Vert6 = noise.cnoise((Cells[i].Pos + (VertexPosTable[6] * HalfLength)) * NoiseScale);
UpdatedCell.Vert7 = noise.cnoise((Cells[i].Pos + (VertexPosTable[7] * HalfLength)) * NoiseScale);

misty wedge
late mural
misty wedge
#

I have no idea, it's ages ago I wrote these extensions

#

Try it ๐Ÿคทโ€โ™€๏ธ

late mural
#

ok thanks!

#

aha, turns out that by multiplying it by a small number like 0.1 it makes it small enough that it does perlin stuff properly

remote crater
late mural
misty wedge
#

I just remember my world map looked wonky with high seeds

late mural
remote crater
#

Can someone help me get hdrp back on its feet for the kind unity devs to review this bug?

#

*(possible bug)

#

Oh there's an hdrp wizrobe, cool

#

What's funny is... the artifacts of shaking mean some of the stars twinkle

#

Do you think God coded the universe in 32 bit to save on video card rendering?

#

yah its not my scripts, totally reduced, its a Unity issue, No shame in it, most people not doing this

#

I'm just glad DOTS works!

#

Man Dots is a lifesaver, I was gonna code parallel processing from the ground up

late mural
# misty wedge

wondering how does this perlin noise pick its seed, as it seems to change seed every frame, anyway to force it to have a certain seed?

misty wedge
#

It should always be the same

#

That's why I use the z coordinate as a seed

rotund token
late mural
#

it isnt though

#

im giving it the same xyz, and getting different results depending on the frame

misty wedge
#

That's odd

rotund token
#

you're overlooking something

misty wedge
#

I think so too

late mural
#

probably lol

late mural
#

is multiplication deterministic? As aside from that i really cant see how im overlooking anything else, as i only have 3 variables that affect how the noise is generated...

robust scaffold
late mural
late mural
robust scaffold
late mural
#

yes

robust scaffold
#

Then you're using burst.

late mural
#

what

robust scaffold
#

That is all you need to do, to start using burst at least.

viral sonnet
#

why do i only see burst 1.8.0-pre.2 in package manager when there's burst 1.8.2?

late mural
#

im so confused then, as im doing the noise on 1 frame with a position multiplied by 0.1, then on another frame i do the exact same thing, but get a different result

robust scaffold
robust scaffold
late mural
viral sonnet
#

yeah but 1.8 is now out of pre. lol, i dunno ๐Ÿ˜„ manual editing it is then

robust scaffold
late mural
robust scaffold
late mural
#

im quite a noob, how do i do that?

#

also im on 0.5something, the 2021 lts version, btw

robust scaffold
late mural
robust scaffold
late mural
#

ah im an idiot, too hard to explain how im an idiot, but trust me i am one, there was a secret 4th variable i didnt realise, welp thanks so much!

robust scaffold
#

Ha

#

This small set of UI took me over 16 hours in total to get working. Ya think 0.17 DOTS was undocumented, UIElements is just as undocumented and source is not available. So I'm blindly stumbling around to get this working.

#

And there's no intellicomplete on CSS documents so I'm just typing in anything and seeing if it works. And invalid CSS doesnt even throw a compiler error, it just doesnt work.

#

And I cant tell if it doesnt work because it might just be hidden

viral sonnet
#

stellar work! uielements is indeed quite hard to start with. it gets easier after a while

robust scaffold
#

My goal is the combine the best (IMO) features of the numerous DOTS 1.0 windows with the compact readability and usability of 0.17 Entity Debugger.

robust scaffold
#

I love assembly refs.

rotund token
#

i wish i didn't need them

#

i dislike how it generates the project for the target and adds it to your ide

#

requiring code analysis to run on it

#

and then just randomly getting errors like this

robust scaffold
#

Surprisingly, getting system list wasnt the hardest part.

#

The hardest part is the continual editor crashes.

#

Something in the scenes (dont know if full scene or subscene) doesnt like what im doing

remote crater
#

Yo, where do I post this 11 mb project so official unity devs can fix it

#

100% a Unity bug. I don't think I need entities to simulate a warp effect

#

Easiest way is just to leave em GameObjects for now, see if it looks good.

#

When it starts to lag in a few months I'll do it right

#

Off chance its fixed and I upgraded my dots

rustic rain
#

that's practically, the only way to see properly what you do

#

also it hot loads code from custom visual elements

#

Unity really could use some codegen with UI toolkit

robust scaffold
rustic rain
#

you're just using it wrong ๐Ÿ˜…

robust scaffold
rustic rain
#

allthough, I really hope to see a way to add some "example" elements to collections in UI builder

#

so far it's only possible if you create custom VE

#

and quite literally add them from here

rustic rain
#

and then in code I would grab all CSS from this element

#

and attach it to actual template

#

this is one way you can achieve behaviour of seeing what you editing in Lists

#

also, just checked and turns out elements inherit CSS from Lists

mortal knot
#

hey, im currently using unity 2021 and dont want to upgrade to 2022 for DOTS. what would be my options to run multithreaded code? im kinda confused with the options. there is ECS, C# Job System, Dots, C# threading, some options use parts of the others.

rotund token
rotund token
#

that's a really old version but yes

#

jobs is the multi threading

#

burst is a extremely performant compiler that works on jobs but has restrictions on what you can do (code must be unmanaged)

#

outside of this, the classic c# approach is just to use tasks

mortal knot
#

i see. thank you

late mural
#

trying to check if a float3 is equal to 0,0,0, i would assume to do it like this:

if (WhateverFloat3 == float3.zero)
{

}

except this mysteriously gives me the error " cannot implicitly convert type 'Unity.Mathematics.bool3' to 'bool' ", guessing im doing something wrong?

rotund token
#

i assume you figured it out but yes

#

== will return a bool3

#

what you want is just WhateverFloat3.Equals(float3.zero)

#

or math.all(WhateverFloat3 == float3.zero)

late mural
#

ah, i got none of those, and the one i found on the forum didnt even work, so i shall try those 2, thanks a ton!

ocean portal
#

I'm having problems with 1.0-pre15 trying to schedule IJobEntity from an ISystem.
There is no boxing conversion from FooJob to 'Unity.Entities.InternalCompilerInterface.IIsFullyUnmanaged'. I don't see any difference to the examples in the docs, what am I missing?

#

The job itself

[BurstCompile]
public partial struct DriftJob : IJobEntity
{
    public float deltaTime;

    [BurstCompile]
    void Execute(
        ref LocalTransform localTransform,
        in DriftData driftData
    )
    {
        localTransform.Position += new float3(0, 0, -deltaTime * driftData.Speed);
    }
}

proud jackal
rotund token
#

what is DriftData

ocean portal
#
public struct DriftData : IComponentData {
    public float Speed;
}
rotund token
#

oh wait your error is just on the job schedule

#

does this error happen in unity

#

or just in your ide?

ocean portal
#

I haven't refactored all my transforms to the pre15 format yet, I'll try to find the specific error in the sea if unity reports it as well

rotund token
#

i believe this usually happens if the source generators haven't run or your ide / project isn't linking to them for some reason

#

if this is the case, it would not be an error in unity and it'd run fine

#

if you have other compile errors i would try solve those first

#

and then confirm if it's actually an error or not

ocean portal
#

That would be great, I'll complete the update and see if it fixes itself

rotund token
#

outside of just, project completely uncompiling the only thing i know that breaks this atm is if you add <AdditionalFiles> to the csproj in rider which is basically just a super obscure edge case that affects me and i haven't seen anyone else report it

#

(you'd have to be doing csproj post processing so it's unlikely the cause)

rotund token
ocean portal
#

I think it worked, the error is gone and no errors when running in editor. The systems don't work yet like before, but it compiles successfully

ocean portal
misty wedge
#

If you use the IJobEntityChunkBeginEnd interface and return false from the OnChunkBegin method, I'm assuming the change version is untouched even if you requested write permission inside the Execute body?

misty wedge
#

This seems like an oversight. It's requesting the native arrays / buffer accessors before checking if the chunk should be executed, bumping the change version regardless

#

(Unless I'm missing something)

edgy fulcrum
#

@proud jackal I'm seeing the same problem in my code from time to time too with the IIsFullyUnmanaged thingy ๐Ÿ˜ฆ

#

clearing out the Library and restarting the editor typically fixes the problem tho

viral sonnet
#

shouldn't work like that

misty wedge
#

It's the same with an IComponentData

#

It calls chunk.GetNativeArray before checking if the chunk is actually executed

viral sonnet
#

i thought comp uses GetComponentDataRO?

misty wedge
#

Not if it has write permission

viral sonnet
#

hm, what do you expect with write permissions?

misty wedge
#

For it to call chunk.GetNativeArray after checking if the job is actually going to be executed

viral sonnet
#

oh i see, yeah!

misty wedge
#

My example was bad since I used a buffer

#

Here it is with an IComponentData

#

It gets a RW pointer to the component type, bumping the version, even if shouldExecuteChunk below it is false

#

Pretty cool though, makes IJE more usable for optimization scenarios

#

Especially if you need to pre-calculate some data based on a shared or chunk component for that chunk. I guess it is kind of weird still since you'd need to write that data to the executing job struct...

edgy fulcrum
#

anyone else seeing this? The delegate type Unity.Entities.FastEquality+TypeInfo+GetHashCodeDelegate should be decorated with [UnmanagedFunctionPointer(CallingConvention.Cdecl)] to ensure runtime interoperabilty between managed code and Burst-compiled code.

pulsar jay
edgy fulcrum
#

mmm interesting, dont think thats my problem tho ๐Ÿ˜ฆ

edgy fulcrum
#

im trying to figure out addressable loading of entities via subscenes, is there a good doc for 1.0?

#

as of now I'm getting subsceneGUID of 0000 after loading the scene which contains the subscene gameobject

pulsar jay
#

I am eagerly waiting for addressable entities

robust scaffold
pulsar jay
safe lintel
#

I too was left a little disappointed it doesnt really deal with entities. i was hoping for something where id mark a prefab as dots addressable, and it would automatically put it into a subscene that would get baked, and thus could access the entity prefab in a system. given we have the SystemAPI for handling caching of certain things, maybe it could even handle getting the singleton entity and we just use it in a job without any extra setup

rustic rain
pulsar jay
rustic rain
#

why subscene is not an option?

pulsar jay
#

Subscene is desgined around static content

#

Does not work for tilemaps, user generated content, level editors or modding

rustic rain
#

ahem

pulsar jay
#

This Runtime Data != Editing Data paradigm breaks down pretty much with any user or runtime generated content

rustic rain
#

it's definetely not meant for level editors (runtime)

#

no idea about tilemaps

#

but I could argue about user generated content and modding

pulsar jay
rustic rain
#

you don't have to recreate all tools yourself ๐Ÿ˜…

#

that's what I aim towards for my project

coarse turtle
#

ah - anyone have any issues with scene catalog not being initialized? ๐Ÿค”

rustic rain
#

so far the only trouble around it - burst bug where loading additional assemblies doesn't work

safe lintel
#

and then if you want runtime user gen content to also work in a similar way, you obviously cant rely on physx

pulsar jay
#

And I know thats definitely not intended behaviour and sometimes painful ๐Ÿ˜…

rustic rain
#

if your world is procedural you are kind of stuck with runtime

#

in my case I just develop all tools for world generation for runtime

#

not even wasting time for serialization of it

#

instead using seeds

misty wedge
#

I'm lazy and just use an intermediary format like JSON jamcat

robust scaffold
pulsar jay
misty wedge
#

I just serialize scriptable objects to JSON which are then converted to blobs at runtime

pulsar jay
safe lintel
#

@pulsar jay i assume you have to serialize manually then?

pulsar jay
misty wedge
pulsar jay
misty wedge
#

A lot of my stuff is procedural, so they usually just reference a single prefab and set values

#

But that probably won't work if you want to do something funky with a mod

#

The other issue is netcode, since iirc netcode checks type hashes to see if the client and server have the same ghosts. I might be misremembering though

drowsy pagoda
#

As much as I appreciate the help of the parent/child tree view in the Entities Hierarchy, is there a way to use the <= 0.50 view? In some cases, I need to know if the parent and child were actually decoupled from an authoring go that had a hierarchy.

robust scaffold
drowsy pagoda
misty wedge
#

Is there a way to get the currently inspected entity in the inspector?

rotund token
#

it's called

#

EntitySelectionProxy

#

you need internal access though

misty wedge
#

Is it a static class or how do you use it?

rotund token
#

one sec it's changed a bit in 1.0

#

there might be a nicer way to do this i can't remember

rotund token
misty wedge
#

Like an editor singleton?

rotund token
#
    {
        public static bool IsSelected => Selection.activeObject is EntitySelectionProxy;
        public static World World => ((EntitySelectionProxy)Selection.activeObject).World;
        public static Entity Entity => ((EntitySelectionProxy)Selection.activeObject).Entity;
    }```
#

seems to be a little helper static i have in my library

#

(no idea when i wrote this, i don't seem to use it)

misty wedge
#

Ah, it's a scriptable object internally

#

Awesome, thanks

#

Now tell me where to store my ability state pensive

rotund token
#

in the cloud

misty wedge
#

very modern

rotund token
#

having random 'infinite loops' from this AssetDatabaseExperimental.ProduceArtifact(ArtifactKey artifactKey) method occasionally

#

bit annoying

#

never returns from the native call

misty wedge
#

Why is FixedBytes getting removed in the future?

rotund token
#

didn't know they were

#

i don't see obsolete on them, where did you see this?

misty wedge
rotund torrent
#

That comment has been there since March of 2021; I'll follow up with the dev who added it

rotund token
#

i'm surprised you have a use case for this anyway

#

well that's not true

#

16 is pretty useful, but i think you're better off just replicating your own since apart from 16, the rest of the sizes are really awkward

misty wedge
#

I initially saw it here, which is definitely somewhat misleading

#

Is it not possible to have a static function return a ref to a ref struct that was passed in?

rotund token
#

show code what you're trying to do?

misty wedge
#

nevermind im an idiot

#

I need to put ref in front

#

always gets me

rotund token
#

love this method, so lazy ๐Ÿ˜„

misty wedge
#

yep

#

I don't know how better to store small information across frames from a node that is executing

#

Well there's definitely better ways but I'm lazy

#

So I'm going with the "small memory block that can be anything" approach, and I will probably regret it in the future when I accidentally cast it to something that is larger and my computer explodes

rotund token
#

oh i just mean, you're wrapping a single line method with another single line method

misty wedge
#

I know right, pretty epic

#

So many generic arguments, I can't type that every time

#

my fingers will break off

rotund token
#

can someone sanity check me

#
    {
        /// <inheritdoc/>
        [BurstCompile]
        public void OnUpdate(ref SystemState state)
        {
            var drawer = SystemAPI.GetSingleton<DrawSystem.Singleton>().CreateDrawer<ORCADrawSystem>();
            var obstacles = SystemAPI.GetSingleton<ORCASystem.Obstacles>().Value;
            new DrawObstacleJob { Drawer = drawer, Obstacles = obstacles }.Schedule();
        }
    public partial class ORCASystem : SystemBase
    {
        /// <inheritdoc/>
        protected override void OnDestroy()
        {
            SystemAPI.GetSingletonRW<AgentStates>().ValueRW.Value.Dispose();
            SystemAPI.GetSingletonRW<Obstacles>().ValueRW.Value.Dispose();
        }
    }```
#

InvalidOperationException: The previously scheduled job ORCADrawSystem:DrawObstacleJob reads from the Unity.Collections.NativeList`1[BovineLabs.ORCA.Data.ORCAObstacle] DrawObstacleJob.Obstacles. You must call JobHandle.Complete() on the job

#

i have like 3 uses of this singleton, but only this one is having issues OnDestroy

misty wedge
#

Try calling CompleteDependencies before the OnDestroy, I had a similar issue when writing to a singletonRW

#

I would expect it not to be an issue when systems are in the process of being destroyed...

rotund token
#

how does physics get away with this

#
        public void OnDestroy(ref SystemState state)
        {
            ref var buildPhysicsData = ref state.EntityManager.GetComponentDataRW<BuildPhysicsWorldData>(state.SystemHandle).ValueRW;
            buildPhysicsData.PhysicsData.Dispose();```
misty wedge
#

They do?

#

But that's not a singleton is it? It's a system component

rotund token
#

aw they're using EM to do the dependency

#
                new PhysicsWorldSingleton
                {
                    PhysicsWorld = physicsData.PhysicsWorld,
                    PhysicsWorldIndex = worldFilter
                });```
#

it is stored on a singleton, they are just disposing it that way

#

ok yeah that's fine

#

thats what i missed, thanks

#

hmm nno

#

that didn't help

#
        {
            this.EntityManager.GetComponentDataRW<AgentStates>(this.SystemHandle).ValueRW.Value.Dispose();
            this.EntityManager.GetComponentDataRW<Obstacles>(this.SystemHandle).ValueRW.Value.Dispose();```
misty wedge
#

How often are you destroying this system that this is an issue? Or do you just want to understand why it's throwing the error

rotund token
#

every time i leave play mode

misty wedge
#

But it should only stall for one frametime shouldn't it?

#

Not even, since you are only completing the dependencies of the preceding systems

uncut rover
#

Is there any reasong ORCASystem is a SysteBase ?

rotund token
#

im doing that atm

rotund token
#

this.EntityManager.GetComponentDataRW

#

should be completing the dependency

#

DependencyManager->CompleteWriteDependency(typeIndex);

misty wedge
#

I just meant if you wanted to know why this happens or if adding the line to complete dependencies was like a performance bottleneck or something ๐Ÿ˜…

uncut rover
#

can you also check the order the systems updates ?

rotund token
#

i know order systems update

#

all my drawers are in a debug system group in presentation

#

where my ORCA simulation is in simulation

#

i don't actually know ondestroy order though

#

ah shit i see issue

#
    {
        /// <inheritdoc/>
        [BurstCompile]
        public void OnUpdate(ref SystemState state)
        {
            var drawer = SystemAPI.GetSingleton<DrawSystem.Singleton>().CreateDrawer<ORCADrawSystem>();
            var obstacles = SystemAPI.GetSingleton<ORCASystem.Obstacles>().Value;
            new DrawObstacleJob { Drawer = drawer, Obstacles = obstacles }.Schedule();
        }```
#

i changed DrawObstacleJob from IJobEntity to IJob

#

needs to pass dependencies

#

and then everything works fine, even the original getsingleton stuff

#

i've been replacing a deferredbuffer implementation i used to have

#

(so hacky, but so cool)

#

with just singletons with nativelists on them now

#

TLDR: buffer/list needs to be chain passed through a few jobs, calling GetBuffer is a sync so I made a way to return a deferred NativeArray from a dynamicbuffer to solve this

#

But with Native containers on components i can remove this hack and just use NativeList stored in system + on singletons for dependencies

misty wedge
#

Do you still need to disable safety when writing to a native container inside a component?

rotund token
#

no

#

you just have to pass container / component into job

#

and not query it from the job

misty wedge
#

Ah ok, that's what I meant

rotund token
#

native containers on components are only good for singletons

misty wedge
#

Yeah it'd be cool if you could put them on components though

rotund token
#

nah

#

bad pattern

misty wedge
#

Alternatively more variations of DynamicBuffer that mimic those implementations

rotund token
#

even if it was possible i would never do it, managing the memory is a pain

rotund token
#

so yeah i agree with you on that

misty wedge
#

When the leak detection works again, the entire detection is based off of the allocator, right?

rotund token
#

i tested this 2 days ago

#

in f1 tempjob was working for me with Enabled

#

but not with Enabled with stack trace

misty wedge
#

f1?

rotund token
#

yeah 2022.2.0f1

misty wedge
#

Ah

#

Really? I thought I tested it on f1

#

I just get this message
To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations.

uncut rover
#

how did you get 2022.2.0f1 ?

misty wedge
#

KornFlaks sent me a secret link

rotund token
rotund token
#
unityhub://2022.2.0f1/1c1f8590be28```
#

no idea how sionzee found it seconds after it was out

misty wedge
# rotund token

I also get this, but that's not very useful without a stacktrace of any kind ๐Ÿ˜…

rotund token
misty wedge
#

The reason I was asking, if the detection is bound to the allocator, it should then also detect leaking blob assets, right?

rotund token
#

(i look forward to having a dozen leaks when we get this back)

misty wedge
#

I don't think I have any leaks there, but it'd be nice to have the peace of mind

edgy fulcrum
#

@pulsar jay so you convert prefabs via baking then serialize them somehow?

misty wedge
#

@rotund token you laughed, but look at me now

rotund token
#

safety ๐Ÿ˜

misty wedge
#

When is UNITY_ASSERTIONS actually true? Is it true even in a development build? Or are all builds stripped of it automatically

rotund token
#

i dont believe debug builds have it

#

but i could be wrong

misty wedge
#

I couldn't find anything online for some reason

rotund token
#

All method calls will be conditionally included only in a development build, unless specified explicitly. See BuildOptions.ForceEnableAssertions. The inclusion of an assertion is controlled by the UNITY_ASSERTIONS define.

#

you didn't look hard enough ^_^'

#

first result

#

BuildOptions.ForceEnableAssertions

Include assertions in the build. By default, the assertions are only included in development builds.```
#

so i was wrong, they are included in development builds

misty wedge
#

Anyone gotten this? Pops up randomly sometimes

NullReferenceException: Object reference not set to an instance of an object
Unity.Entities.Editor.SystemScheduleWindow.UpdatePreferences () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities.Editor/SystemSchedule/SystemScheduleWindow.cs:284)
rotund token
#

haven't seen that one

#

seems to be calling SystemScheduleWindow before OnEnable is called

#

which seems improbable since UpdatePreferences is called from OnUpdate

misty wedge
#

๐Ÿคทโ€โ™€๏ธ

#

happens sometimes after compiling, and it will then log the error once per second until I compile again

rotund token
#

i don't usually have the system window focused/in view

#

so probably just stealthily avoiding the timing issue

misty wedge
#

There's no way to return a void function using the switch pattern matching syntax is there?

rotund token
#

what do you mean

misty wedge
#

For example something like this, but the Execute function returns void instead

rotund token
#

oh

#

not in burst

misty wedge
#

How do you even write it? No matter what I try it complains

#

(even outside burst)

rotund token
#

there's a gross workaround

#

(stringValue switch
{
"Add" => (Action) Add,
"Subtract" => Subtract,
_ => throw new ArgumentOutOfRangeException()
})();

#

return a delegate invoke straight away

#

again, gross ^_^'

misty wedge
#

I see

#

I think at that point I'd rather just use a regular switch case statement ๐Ÿ˜…

#

But good to know ๐Ÿ‘

rotund token
#

i believe this requirement is being relaxed

#

in the future

#

(or maybe it has been already? not keeping that up to date with c#11)

misty wedge
#

That'd be nice, since I think it's cleaner than a normal switch statement

#

Still undecided if I should make the context struct that is passed to abilities huge, or use an ECB to signal changes

robust scaffold
#

Hours of work and I have finally recreated the system list.

misty wedge
#

Now recreate the rest of the editor

robust scaffold
paper spindle
#

Iโ€™m having some trouble wrapping my head around the dots concept. Letโ€™s say you need to change a material property or update a renderer state. How would you do it?

misty wedge
#

I guess it kind of depends on if you are using mono rendering or dots rendering. Assuming you have the data on a component, just query that component and modify it

paper spindle
#

Not sure what's the deal with these two. Let me see if I can find anything

#

I'm fairly new to the implementation of this, been on my to-do list for a while but now with 1.0 decided to give it a try

#

Is mono renderer the hybrid renderer?

robust scaffold
#

anything prefaced with "mono-" means the usual monobehavior GameObject way. In this case, it's the regular mesh or whatever renderers

#

Hybrid renderer or now renamed Entities Renderer is the DOTS rendering pathway.

misty wedge
#

Can you not use an ArchetypeChunk to set the state of a zero-sized IEnableableComponent?

paper spindle
#

I do not know ๐Ÿ˜… I'm researching the topic but can only find old forum threads

misty wedge
robust scaffold
misty wedge
#

This is the error:

System.ArgumentException: ArchetypeChunk.GetDynamicComponentDataArrayReinterpret<{0}> cannot be called on zero-sized IComponentData
robust scaffold
misty wedge
#

It is an IJobChunk

robust scaffold
#

Yea, dont do that. For one, chunkEnabledMask is the combined & of all required components.

#

So what you're doing there in chunk.SetComponentEnabled is basically setting enabled components to enabled.

misty wedge
#

That's... what I want to do

#

๐Ÿ˜…

#

Oh

#

I see what you mean

#

But the query has the option to use disabled components

robust scaffold
#

As in already enabled components. Not IEnableableComponent

misty wedge
#

So it should be fine right?

#

Or do I then just iterate over everything

robust scaffold
#

The enumerator filters for only enabled indexes

misty wedge
#

Without using the enumerator

#

I see, I thought it took the query into account

#

I assume I will still get the exception even with that change

robust scaffold
#

Alright, the query using .WithNone<>() might flip the bitmask.

misty wedge
#

I meant .WithOptions(EntityQueryOptions.IgnoreComponentEnabledState)

robust scaffold
#

Is the error at enumerator.NextEntityIndex or at SetComponentEnabled

#

Try chunk.GetEnabledMask(ref tagComp)

#

And then set by mask[index] = true

misty wedge
#

Nevermind, the issue is netcode

#

I think it can't sync the enabled bit of a zero-sized component

robust scaffold
#

Oh, it can

misty wedge
robust scaffold
#

you need to add an attribute

misty wedge
#

I did

robust scaffold
#

Wait, it just came to me, yea. netcode cant

misty wedge
#

[GhostEnabledBit]

robust scaffold
#

I remember now, you must have some field inside the component to sync them

#

they recommend having a single byte field to sync enabled status

#

Sorry, I just remembered looking at the netcode docs

rotund token
#

that's shit!

#

i just added enabled saving to 0 zero components in my library

#

wasn't that hard

misty wedge
#

I think the issue is the auto-generated serialization part

rotund token
#

you just check elementsize = 0 and skip the get/set data parts

misty wedge
#

Yep, I'm guessing this is a temporary workaround

#

(hoping)

#

Like this, right?

robust scaffold
coarse turtle
#
NullReferenceException: Object reference not set to an instance of an object
  at Unity.Entities.BlobAssetReference`1[T].get_IsCreated () [0x00001] in C:\Users\porri\Documents\Projects\Unity\cartediem\Packages\com.unity.entities@1.0.0-exp.8\Unity.Entities\Blobs.cs:349 
  at Unity.Scenes.SceneSystem.GetScenePath (Unity.Entities.SystemState& state, Unity.Entities.Hash128 sceneGUID) [0x0000d] in C:\Projects\Unity\cartediem\Packages\com.unity.entities@1.0.0-exp.8\Unity.Scenes\SceneSystem.cs:155 

Wondering if anyone else got this when trying to load a subscene (after the initial subscene loads) or if I messed something up ๐Ÿ˜…

coarse turtle
#

I havent updated to pre.15 yet too

robust scaffold
#

The experimental bakers are very much broken. So it might be your fault, might not.

coarse turtle
#

hmm alright ๐Ÿค”

misty wedge
#

@robust scaffold have you use the new netcode input system? I can't figure out how to correctly send a payload with an input event...

robust scaffold
misty wedge
#

For some reason the payload sometimes isn't present in a frame on the server where the IsSet value is true

#

Even if I always set it on the same frame on the client

robust scaffold
misty wedge
#

There's a special tag?

robust scaffold
misty wedge
#

Yeah, that's what I'm using

#

The question is how to send additional data with that event

#

It sometimes doesn't line up on the server

robust scaffold
#

if you want additional data, you're better off using an RPC which takes a while to get to the server but it guaranteed to get there eventually

misty wedge
#

The issue with that is that you can't predict RPC calls afaik

robust scaffold
#

What do you mean?

misty wedge
#

For the prediction loop you need to get the correct input data at a specific tick

#

IInputCommanData handles that automatically for you

robust scaffold
#

What are you trying to synchronize?

misty wedge
#

Ability usage on the client

robust scaffold
#

Hrm, I see.

misty wedge
#

It also seems like an oversight that you can't include additional data in the InputEvent. I can think of a lot of scenarios where that would be useful

robust scaffold
#

Might be better off as a [GhostComponent]

misty wedge
#

And then just setting a boolean?

robust scaffold
#

Yea, a bit flag for the specific ability.

#

If it's on a timer, hrm.

misty wedge
#

I send a guid which the client and server can interpret

robust scaffold
#

Have a: csharp [GhostComponent] public struct Abilities : IComponentData { [GhostField] public int Flags; }

#

Cant really see how abilities that run off timers would work with prediction though

misty wedge
#

Something I've been wondering, since I haven't done a lot of prediction stuff, what is even the point of it? Since the data needs to be set as a GhostField so that the client can actually roll back the data correctly, why re-simulate it? Is it just the timing of it?

rotund token
#

imagine using prediction

#

delayed input for days ๐Ÿ˜„

misty wedge
#

Basically, is it just the client taking the latest tick and simulating again to "catch up" to the server?

robust scaffold
#

not 75, 7 ticks

misty wedge
#

"now" being the (hopefully) same time as the server?

robust scaffold
#

Same time yes. Hence "prediction"

misty wedge
#

Ok, then I think I get it. But that means any side effects from the prediction need to be sent by the server, since otherwise you will apply state changes incorrectly

#

(since that data wouldn't be "rolled back")

robust scaffold
#

for timers, you might have a: csharp [GhostComponent] [InternalBufferCapacity(0)] public struct TimedAbilities : IBufferElement { [GhostField] public half DurationLeft; }

misty wedge
#

Wouldn't the DurationLeft also need to be a GhostField?

#

Also, assuming I am using a counter here, is SystemAPI.Time.DeltaTime the "correct" value to use for deltatime? Since I know netcode scales it in weird ways and the prediction loop can run multiple times

robust scaffold
#

Rollback only happens clientside, when they receive a new packet from the server. I dont know what triggers rollback and resimulation, probably some large difference between predicted value and "actual" server sent value

robust scaffold
misty wedge
#

I guess I'll look into that

#

Something else, is it correct that it can happen that a ghost field boolean can be "true" on two prediction loops even if it was only true on a single frame for the client?

#

Because I think the docs mention that in regards to predicted spawning

#
In the prediction system code the NetworkTime.IsFirstTimeFullyPredictingTick value needs to be checked in order to prevent the spawned object from being spawned multiple times as data is rolled back and redeployed as part of the prediction loop.
robust scaffold
#

I dont know about predicted spawning either. I need to look into that myself.

misty wedge
#

It looked simpler than earlier versions though. afaik all you need to do is spawn the entity inside the prediction loop

viral sonnet
#

pretty much all optimized unity jobs use GetComponentDataPtrRO/RW. time to fully ditch chunk.GetNativeArray ๐Ÿ˜„

robust scaffold
viral sonnet
#

GetNativeArray has quite a bit of overhead from what i saw in profiling. if you replace it in the whole project chances are you save a few 0.x milliseconds

#

some really low hanging fruit optimizations in here ```public readonly NativeArray<T> GetNativeArray<T>(ref ComponentTypeHandle<T> typeHandle)
where T : unmanaged, IComponentData
{
CheckZeroSizedComponentData(typeHandle);
#if ENABLE_UNITY_COLLECTIONS_CHECKS
AtomicSafetyHandle.CheckReadAndThrow(typeHandle.m_Safety);
#endif
// TODO(DOTS-5748): use type handle's LookupCache here
var typeIndexInArchetype = ChunkDataUtility.GetIndexInTypeArray(m_Chunk->Archetype, typeHandle.m_TypeIndex);
if (typeIndexInArchetype == -1)
{
var emptyResult =
NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<T>(null, 0, 0);
#if ENABLE_UNITY_COLLECTIONS_CHECKS
NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref emptyResult, typeHandle.m_Safety);
#endif
return emptyResult;
}

        var archetype = m_Chunk->Archetype;
        var typeSize = archetype->SizeOfs[typeIndexInArchetype];

        byte* ptr = (typeHandle.IsReadOnly)
            ? ChunkDataUtility.GetComponentDataRO(m_Chunk, 0, typeIndexInArchetype)
            : ChunkDataUtility.GetComponentDataRW(m_Chunk, 0, typeIndexInArchetype, typeHandle.GlobalSystemVersion);

        var result = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<T>(ptr, Count, Allocator.None);

#if ENABLE_UNITY_COLLECTIONS_CHECKS
NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref result, typeHandle.m_Safety);
#endif

#if (UNITY_EDITOR || DEVELOPMENT_BUILD) && !DISABLE_ENTITIES_JOURNALING
if (Hint.Unlikely(m_EntityComponentStore->m_RecordToJournal != 0) && !typeHandle.IsReadOnly)
JournalAddRecordGetComponentDataRW(ref typeHandle, ptr, typeSize * Count);
#endif

        return result;
    }``` 
  • typeIndex is already in the componentTypeHandle
  • typeSize is only required with entities journaling
#

that alone gets rid most of the code in it

#

and i see this line so much // TODO(DOTS-5748): use type handle's LookupCache here i mean, great, at least this got a todo comment ๐Ÿ˜„

#

i think i started reporting this in 0.17

#

it's not that hard to implement -.-

#

and i think the biggest problem with using chunk.GetNativeArray is that you can't get a ref to the element easily.

misty wedge
#

To the element in the array?

viral sonnet
#

yeah

misty wedge
#

UnsafeUtility has a method for it

viral sonnet
#

it's possible but not very convenient

#

compared to ptrs ref var aiController = ref aiControllers[i];

misty wedge
#

Yep

viral sonnet
#

funny enough, many unity jobs are getting the ptrs now but they don't use ref. so, hm, what's the point? ๐Ÿ˜„

#

this guy fixed the exact problem you were mentioning today schnozzle

misty wedge
#

What problem was that?

viral sonnet
#

bumping the version when nothing is executed. that case checks for chunk.Has

misty wedge
#

So your telling me he is stealing my spotlight!?

robust scaffold
#

At bare minimum, the system list at least is fully functional. Including clicking to open the inspector although I am debating on retaining this feature. Does anyone use the click system to see the queries? I think I'm gonna port over Entity Debugger's thing.

viral sonnet
misty wedge
robust scaffold
misty wedge
#

It was a joke, referring to earlier when I told you to rebuild the entire UI catHeyHello

viral sonnet
#

well your problem was with IJE which is much more widespread than just a mistake in LocalToWorldSystem

misty wedge
viral sonnet
#

you can HAZ bigger light!

misty wedge
#

I'm pretty sure they know already

viral sonnet
#

if you pinged dani, 100% chance

misty wedge
#

I didn't ๐Ÿ˜ฆ

#

So only a 50% chance

#

Either they know or they don't

viral sonnet
#

a fine connoisseur of statistics

misty wedge
#

Still pretty good odds I reckon

viral sonnet
#

did anyone stress test transform v1 against v2?

rotund token
robust scaffold
viral sonnet
#

is that v1 against v2? ok, missed that

robust scaffold
#

it drops to 0.5ms when it's fixed

rotund token
#

yeah theyve fixed it

viral sonnet
#

it's still higher

robust scaffold
#

yea

viral sonnet
#

so now my comps have LTW and LocalTransform. which is the same but 1 float for scale additonaly

#

and jobs run slower

#

big meh ๐Ÿ˜„

#

overall it should be faster though. some tests would be great

#

hm, so if i just rotate i trigger a change for everything that involves the position.

#

who thought this through??

coarse turtle
#

hmm i guess pre.15 doesn't solve my SceneSystem BlobAssetStore catalogData getting invalidated ๐Ÿค”

rotund token
viral sonnet
#

well, i'm not really grasping the reason of merging pos/rot/scale. seems anti dod to me

#

is LocalTransform even simd friendly? i remember having bit of trouble with structs

stone osprey
#

Why are entity command buffers actually so "fast" and efficient compared to regular entity creation and operations ?

rotund token
#

they aren't? ๐Ÿ˜†

stone osprey
#

They are not ? Last time i checked in everyone said they are the way to go ๐Ÿ˜ฆ

misty wedge
#

I guess it depends on the context. They can be faster if they otherwise force you to have sync points

remote crater
#

The goal was to make it so when you enter warp drive, you aim at the stars you want to go to, and spatially aware of the galaxy you can see them whip past you.

They said it wasn't possible & were absurdly rude and mean to me for no reason: https://old.reddit.com/r/Unity3D/comments/z6hyel/can_someone_take_a_look_at_this_weirdness_im/

www.sta...

โ–ถ Play video
misty wedge
#

But if you need to create a lot of entities it's faster to just create those pre-emptively

rotund token
#

so you group them all together in command buffers to only have 1

#

but the actual operation shouldn't be any faster

viral sonnet
low hazel
#

We don't need to humour this.

@orchid ginkgo , there's no memes here.

remote crater
#

I try and be nice to all, but people bring it to me. I don't get it.

viral sonnet
#

no hate man, i was there yesterday and all i read was, working as intended. so i wondered what i've missed.

remote crater
#

I'm here to help the community, you seem to approve of the hate I got in that thread.

#

Why do you not like me?

#

If you cannot answer it, stop bothering me.

#

Cuz as far as I know, I have done nothing but help the community and Unity./

#

You can pm me, stop making your beef in the open

#

I don't need this nor do they

low hazel
#

I said we're not humouring this, take it to DMs.

remote crater
#

thank you

#

That's the first nice thing you've done for me Osteel.Props

viral sonnet
#

i've no beef with you. i said that thread is hilarious (the responses), not you are. geez

robust scaffold
#

One feature I really missed from Entity Debugger is the "All Entities" selection. Problem is, that row didnt have any useful data on it so I decided to fix that:

viral sonnet
#

this is getting better and better by the hour

robust scaffold
# viral sonnet this is getting better and better by the hour

There's just so much empty space in the current dispersed entity inspectors. Sure, I think the main complaint that Unity received about the old debugger is how dense and unreadable it was but for someone coding in DOTS for hours, days, weeks on end. Compact and dense is how inspectors should be.

viral sonnet
#

yeah it's really spread out and not interconnected which is my biggest problem with it. like i want to know what entities an archetype has and vice versa

coarse turtle
robust scaffold
#

Maybe both? As a toggle? There's plenty of space in the toolbar for both buttons...

viral sonnet
#

is the archetype construction list what we have now in the archetype debug panel?

robust scaffold
#

Yea. This one... ugh. Unity crashed again.

viral sonnet
#

this is cool info. what's also great is how much bytes an archetype has allocated and how much is unused. what i don't like about it is the wall of ids and that you can't filter by components

robust scaffold
#

yea. What i will do is by selecting an entity, it'll show the archetype of that entity as well.

viral sonnet
#

pretty much every filter is useless

robust scaffold
#

That way you dont need to find the specific archetype of the entity from a list of randomly generated names.

viral sonnet
#

who filters by any of this? seriously.

robust scaffold
#

Yea, the filters except maybe the hierarchy one (debatable) are completely useless.

robust scaffold
viral sonnet
#

yeah, the feature i miss the most

robust scaffold
#

I mean it was interesting as an overview but the archetype construction tells that in a far easier to generate way.

#

Hrm, alright

#

I'll try to recreate it. Any suggestions on how to improve it?

#

I know for one it was incredibly difficult to understand.

viral sonnet
#

i've not used it excessively. from what i read on the forum the most useful thing about it was to see chunk fragmentation

robust scaffold
#

And for archetypes with a lot of components, it the archetype construction gets so long.

#

I'll probably have 2 tabs. This visualization on the far right and the construction list next to it. Both non-resizable though. Getting 1 resizable panel was painful enough.

viral sonnet
#

what about they style of the new one (above image) with chunk utilization stats?

robust scaffold
#

huh... huuuuuh.

#

That's a great idea

#

And just have the components list be initially foldered

viral sonnet
#

yes!

robust scaffold
#

Do people care about the name though?

viral sonnet
#

hm, the id? i don't ๐Ÿ˜„

rotund token
#

inconsistently you just type the component name in

#

without any c=

viral sonnet
robust scaffold
#

I know you can but most of the time I just go down the list clicking one by one until I find the archetype I'm looking for...

viral sonnet
#

haha didn't expect that. man that's really inconsistent. the comp auto complete is so nice

#

such a control is surely reusable

robust scaffold
#

But yea, 83 archetypes in a production setting. I guess in cases like that, one should switch to the actual DOTS inspectors as there's less white space.

rotund token
robust scaffold
#

The old entity debugger would keel over and die with those amounts

rotund token
#

hmm

#

it doesn't do too badly actually

#

we still have devs who use it

#

only use it*

robust scaffold
#

Even in 0.51?

viral sonnet
#

hm, if i have a root entity is LocalTransform just pure overhead? i mean i could use LocalToWorld as well which is mandatory anyway then, right?

robust scaffold
#

Netcode and physics requires the existence of WorldTransform, L2W, and PostTransformScale regardless of if they're needed. Meaning about 150 bytes of wasted floats.

viral sonnet
#

entities with just LocalToWorld are not a thing anymore then?

#

i'm confused. will read some docs then.

robust scaffold
#

Nope, replaced with just LocalTransform

#

You can generate a LTW from a LT

#

I have a giant chunk of empty space in my planning. What can I put here?

viral sonnet
#

oh it's been replaced. where's the matrix stored then?

robust scaffold
viral sonnet
#

put a picture there of our lord and saviour, joachim ante

robust scaffold
#

Yes

#

I just realized there's one more window. I've never used the component list myself:

viral sonnet
robust scaffold
#

It's a bit too dense though. I'm all for density but the component list just doesnt seem to fit. Maybe it should be an option like chunk info.

robust scaffold
#

If you're only needing to pull the L2W once using a custom renderer, that's the same cost as generating a new L2W and caching it. Except now with the cache, you waste 16 floats or 64 bytes.

#

Ya know, the components as an additional window to the left of chunk info makes sense. Especially if one can click on a component and filter the entities and archetype list with it...

#

Filtering by selection priority will go first by system, then component, then archetype.

#

And maybe a easter egg button where there's Joachim Ante's face as a window...

#

If I ever complete this and publish it, I'm gonna put a donation link for commissioning an artist to paint Ante's face like those old saint images:

viral sonnet
#

sipping that burst juice

#

well, i'm not too sure about the performance implications yet. need to rewrite the rest of my codebase and then profile.

#

just have a feeling it will run a bit worse

robust scaffold
#

good luck, using netcode + physics means I have no choice in that matter anyways

rotund torrent
robust scaffold
rotund torrent
#

definitely not, but I know somebody's working on it.

robust scaffold
#

Okay, good.

rotund torrent
#

Moving away from chunk.GetNativeArray() is the correct opinion, so long as you promise not to access out of bounds indices. Most of the extra safety checks of a full NativeArray vs. a raw ptr don't make sense in the context of working within a single chunk.

robust scaffold
rotund torrent
#

I fixed the LocalToWorldSystem change-version issue as well, but that's worth applying locally in the meantime. It was a great spot.

#

It turns out this is a perfect window in our development cycle for behind-the-scenes optimizations.

robust scaffold
#

Chunk.GetSpan<T>() and Chunk.GetReadonlySpan<T>()? Maybe?? I mean, I dont use spans outside of hunting down memory leaks and then reverting back to pointers when Im done but maybe?

rotund torrent
#

ISTR there's some Good Reason(tm) why we're not using Span<T> more than we are. Or maybe there used to be a good reason, but there isn't any more and news travels slowly.

robust scaffold
#

Eh, just an idea. Pointers and wildly assuming that index access doesnt go out of bounds is good enough. Unity crashing constantly is a good way to find if there's any issue anyways.

viral sonnet
#

thanks for all the info. appreciate it!

robust scaffold
#

Meanwhile, as unity crashes constantly for me right now in UI development. Hrmmmm

#

@rotund torrent If you're not gone already, I just want to check if this error is something you recognize:

#

I've been getting this hardcrash nearly constantly domain reloading following a code change in my DOTS editor development.

#

It's saying segmentation fault except I'm not actually using pointers anywhere in my editor code and I'm 99% sure I'm within bounds with my game code (which isnt running anyways).

rotund torrent
#

no, I'm afraid it's not something I'm familiar with; sorry

robust scaffold
#

damn, i'll see if I can get a reproduceable error done. It's off and on.

rotund torrent
#

searching our slack for some of the stack trace entries didn't turn up anything either

robust scaffold
#

I've disabled rider plugin automatic refresh on save as it seems to always require a domain reload on window focus switch into editor anyways. And i havent gotten a crash yet.

rotund token
#

Reduced random crashes by like 80%

#

No one at work uses auto refresh

#

It's suicide

oblique cosmos
#

How does one typically deal with child objects? For instance, I have an object made up of a bunch of random cubes and spheres and things, as you do, and I'm trying to access certain children's transforms in order to rotate them around and whatnot. Think a tank/turret, perhaps. So I made a component that's on the parent which stores the children as entities, because I assume that's the only way to actually get something resembling a reference, yes? Surely I can't store the transforms directly, as everything is a struct and would just pointlessly copy stuff around, correct? Either way, I've been bashing my head against a wall trying to figure out how to run this in a job. I have my component/aspect with my child-entities, but can't figure out how to actually get access to their transforms without being greeted by particularly unhelpful errors. This approach struck me as fairly logical and straightforward, but I'm starting to think I'm on a completely wrong track here? Any insights?

rotund torrent
#

The parent already has a DynamicBuffer<Child> that contains a list of all the child entities, so you don't need to manage that yourself.

#

As for accessing the child transforms from a job, since you're accessing data on an entity other than the one being iterated over (the parent), you don't really have a choice other than ComponentLookup (or ComponentDataFromEntity, pre-1.0). And if you're writing to those transforms, you'll need to use something like [NativeDisableParallelForRestriction] on the ComponentLookup job field to suppress the safety warning it would usually give you about random-access component writes in parallel (since that is, technically, a race condition).

oblique cosmos
#

Hm. I've had to read that several times to parse that, still very much in the learning phase of things. But I think I've done something like that before, guess I just got tripped up by the fact that we're talking about children here, not random, other objects. But, in ECS, I suppose that's not really that much of a difference, really. Old way of thinking creeping in, I guess. Anyway, so the generally idea would be to throw tags on them and then look through that buffer, yea? Hm. Might be time for another template ๐Ÿค”

celest raptor
#

Hi all mates devs! I want to create functionality for screen image recognition, just in a flat screen, nothing related to AR or VR, and I only find info on the web and this forum related to AR, but the purpose is just to detect an image when it appears on the screen, any help?

#

The idea is to manually introduce a sprite in a program, and when this sprite appears on the screen, do something

pulsar jay
frosty siren
celest raptor
muted star
#

Did you try b9?

frosty siren
#

Guys, where you think I should post a thread about my sprite rendering package? DOTS general section or DOTS Graphics? Asking because it seems like DOTS Graphics is only for unity's dots-graphics packages like Graphics (Hybrid Renderer), etc.

coarse turtle
frosty siren
edgy fulcrum
#

@pulsar jay yeah seems like I will have to wait for addressable subscene entities to solve my problem as I cannot convert during runtime without massive stalls - trying to load building prefabs from KitBash3D, which is hundreds of megs big ๐Ÿ˜ฆ

pulsar jay
coarse turtle
edgy fulcrum
#

yeah, I was hoping the new Baker workflow would help but it seems like the baked entity is getting nowhere when building the addressable subscene ๐Ÿ˜ฆ

rustic rain
edgy fulcrum
#

yes, as of now I'm testing via 2 projects (A and B), baking the subscene in A with KB3D prefab then loading the catalog in B then asyncSceneLoad the scene containing the subscene

#

after loading the scene I'm getting subsceneGUID of 0 and all I see is regular gameobject loaded with no entities anywhere

rustic rain
#

How are you storing subscene in addressables?

#

You need several assets as far as I know

#

GameObject and serialized data file

edgy fulcrum
#

yeah I have a multiple asset workflow but it still doesnt work

#

KB3D prefab gameobject asset, instantiated in scene, then separate scene containing subscene pointing to the other scene, then yet another gameobject prefab containing the GUIDs of everything and marking all of the above assets addressable

#

after building the addressable assets I see huge 600meg files dumped in the destination dir but none of them contain any entities (all are regular GOs)

rustic rain
#

Hold on

#

Any of this includes actual Unity scene?

edgy fulcrum
#

yes regular unity scenes with nothing else except the subscene in the master and the prefab in the subscene scene

rustic rain
#

Hmm

edgy fulcrum
#

I can enter play mode and see the GO serialized into entity via baking

rustic rain
#

I need to check it when I get home

edgy fulcrum
#

yeah that would be helpful!

rustic rain
#

But rn it seems like you are saving wrong asset ๐Ÿ˜…

#

Although could be wrong. I still don't get what exactly you are saving

edgy fulcrum
#

I just want to load the building prefab at runtime via addressable without doing conversion so I thought I could bake it in the editor and save the baked entity then load that

rustic rain
#

There is actual subscene asset that gets created somewhere

#

This is what you need to save and pass between projects

edgy fulcrum
#

yeah I think I saw in some unity forum that I have to go through the normal build process to generate the baked scene file

#

instead of going through the addressable build process

#

then somehow get that baked scene file and pass that to the addressable system... seems like a hack

rustic rain
#

Although it's also possible it's not supported at all

#

Hmmm

#

Actually

#

Try to build game

#

And see what gets generated

edgy fulcrum
#

so maybe it's worthwhile for me to just wait for Unity to figure it out and give me a cleaner workflow ๐Ÿ™‚

rustic rain
#

Maybe build can deserialize it with hardcoded path

rustic rain
#

So it's not like it's some tainted workflow

edgy fulcrum
#

yeah good idea! trying to build the KB3D master scene now

calm edge
#

Is there an equivalent of Mesh.CombineMeshes for ECS?

edgy fulcrum
#

as far as I know there's no "official" way of doing Mesh.CombineMeshes and Mesh.Optimize via jobs

blissful bobcat
#

Whats the minimum unity version to use full dots environment ? (Jobs, ECS, Burst) Cuz im trying on 2021.3.5f1, and 2022.2.0b8, and even enabling the preview packages it stills doesnt shows up neither ECS or Jobs for installing.

mystic mountain
pulsar jay
#

Do you guys use Assembly Definition Files in your projects? It just occurred to me that asmdefs should be setup differently because ecs assemblies are different

balmy thistle
blissful bobcat
mystic mountain
blissful bobcat
covert lagoon
#

What?

#

Just click "Add package from git URL" in the package manager window and type com.unity.entities. Then repeat for other packages.

viral sonnet
#

lol, one of my jobs has gone to total shit with transformV2 - usually a 3.5ms job, now up to 20ms. first thing i found is the chunk capacity has gone down a lot because v2 wants to put everything it possibly can on the entity -.-

rustic rain
#

๐Ÿฅฒ

#

I think it's pretty clear, enablable components must go ๐Ÿ˜…

blissful bobcat
covert lagoon
#

What are you saying.

#

You just click a button, type com.unity.entities, then press Enter.

#

Repeat for com.unity.entities.graphics/com.unity.rendering.hybrid and whatever else you want from com.unity.physics and com.unity.netcode.

blissful bobcat
#

I guess the same will work with jobs right?

blissful bobcat
covert lagoon
#

So if you have that installed, you don't need to manually install com.unity.jobs too.

#

com.unity.entities also depends on com.unity.burst, com.unity.mathematics and more.

blissful bobcat
rustic rain
#

hybrid for 2021

#

graphics fro 2022

viral sonnet
#

i've no idea what's going on yet. it's not even the chunk capacity makes a big difference

#

profiling with superluminal looks the same. the relations to what takes long is the same. no apparent code that would lead to transformV2. yet the job and only this job takes 5.7 times longer

#

and i restarted unity and the job is again at 20ms. whaaat? ๐Ÿ˜„

#

oh wait, i updated to burst 1.8.2 (reverting to 1.7.4 didn't change anything) back to 20ms ... haha

blissful bobcat
#

JobComponentSystem is now renamed or doesnt exists anymore?

viral sonnet
#

for a very long time. there's SystemBase and ISystem now

blissful bobcat
viral sonnet
blissful bobcat
#

But I'll download this too, I guess it will be better for learning purposes indeed.

viral sonnet
edgy fulcrum
viral sonnet
#

reverted to my exp-8 entities state and it runs normal

blissful bobcat
blissful bobcat
viral sonnet
#

entities.graphics, for when you want to render entities, needs urp or hdrp. entities alone works with builtin as well

blissful bobcat
# viral sonnet entities.graphics, for when you want to render entities, needs urp or hdrp. enti...

I see! Well this template from unity is not making it easy idk what to delet to make it run, dik which templates are using those ressources, aperently deleting the hdrp, urp and physics folders wrent enough, since it shows even more errors, which means the examples withing ecs samples may use some of those too, or maybe are the materials who knows. I'll keep trying it here, anyway i really appreciate the help, thank you.

viral sonnet
#

samples mostly use URP. you can't just delete a folder from the assets folder to get rid of urp as it is a package. manage those in package manager. samples can be just imported as new project. worked fine the last time i tested.

blissful bobcat
viral sonnet
#

no

blissful bobcat
viral sonnet
#

how are you importing the samples? the process is to go to unity hub, add project from disk and point to ECSSamples that contains the Assets folder

#

otherwise you miss a lot of packages that are required

#

(those listed in manifest.json)

blissful bobcat
rustic rain
#

whole repo from root?
That's probably not gonna work

blissful bobcat
#

What the right way tho? in this case for entities

rustic rain
#

just download the folder of sample

#

and use it as unity project

#

one sample at a time

blissful bobcat
#

isnt that what i've already done tho?

rustic rain
#

what is your root folder name?

blissful bobcat
#

Assets/EntityComponentSystemSamples

rustic rain
#

eh, that's not it

blissful bobcat
#

guess it has a master in the name too, but guess its not it either

rustic rain
#

download this exact folder

#

and open this exact folder as unity project

#

you can donwload whole repo, just open as project this folder

blissful bobcat
#

oh got it but i want the jobs samples too

rustic rain
#

any sample of your choice

#

just make sure Assets and Packages folder are present here, they are key for Unity Project and contain all data

#

along with ProjectSettings I guess

blissful bobcat
#

guess the other packages werent being found cuz they werent on the root