#archived-dots

1 messages · Page 277 of 1

olive kite
#

I have this.RegisterPhysicsRuntimeSystemReadWrite(); but maybe its something else

rustic rain
#

Any idea why PhysicsVelocity on player is not changed in this triggereventjob?

#

It's supposed to make player jump on trigger, but...

#

it just doesn't nothing

#

trigger events do happen though

#

And entitiy indeed gets it's component removed

misty wedge
#

I think you are modifying the Linear copy on the struct, not the struct itself

rustic rain
#

hm

misty wedge
#

So you would need to do velocity.Linear = new float3(...)

rustic rain
#

I tried to check linear velocity after writing btw

#

will try it again

#

bruh, Unity crashed xD

misty wedge
#

You fell for my trap!

rustic rain
oak sapphire
#

I can understand that in the normal game development sense.
I just want as much VFX and animated characters, both networked in the game as possible, I just want to have some fun creating those systems and putting them together.
But if I would want to make money from the game this is indeed not the way to go.
Anyhow, thanks for the suggestion of the Texture2D.GetRawTextureData<Color32>() I will try to figure out how to make that work.

rustic rain
#

nope, seems like struct is modified correctly

misty wedge
#

Basically just modify it, then call Texture2D.Apply

misty wedge
rustic rain
#

nnnope xD

misty wedge
#

Cosmic radiation it is

rustic rain
#

I went through it again

#

literally all mentions of PhysicsVelocity

#

nothing is modifying it

#

Physics 2D is not it. I tried switching it off already

wet star
#

Hello everyone, I have a few questions, can anybody suggest a worthwhile approach?

  1. How do you control game states? Is it a some service with statemachine or full ecs way, want to know some deep details or links with articles)
  2. How do you use services like FileDownloader? Singleton or some static class with provided service or some other?)
rustic rain
#

really nice approach to obtain full power of SystemBase

#

and keep code clean within system

rustic rain
#

wait a second

#

if my job exists

#

during physics step stage

#

maybe that's the reason why modifying componentdata array makes no difference

#

how do I modify entity then?

#

🤔

misty wedge
#

Write the change to the EntityCommandBuffer?

#

Are your 1 million entities ghosts?

rustic rain
oak sapphire
rustic rain
#

ok

#

I figured it

#

I need to modify PhysicsWorld

#

modifying component data is useless

#

in EventTriggerJob

remote crater
#

So it turns out... 100% the reason I could not compile to standalone is a UNITY BUG. Unity Devs watch this: https://www.youtube.com/watch?v=r-NTbLDcl6U The UI glitches when I attach a standard component and when I try and build an editor build, its happy, but standalone not. This is disconcerting since I did spend 50 hours tracking this down + 30 hours of fret on top of that over 9 days, and was getting forum backlash by users and mods that I had no clue what I was talking about and UNITY doesn't have bugs like I'm trying to slander the product. No I love Unity and want you to make a better product, don't silence people helping your product get better, please?

An official Unity dev should watch this.

Unity Rules normally. I'd buy stock. I love using it. I love the experimental packages. But Unity sucked for me this past 9 days of over 50 hours of coding on top of 30 hours of fret. I been non stop compiling 2 minutes at a time for hundreds of times, looking up tech documents and stuff for things that...

▶ Play video
misty wedge
rustic rain
#

oh, maybe I can

#

welp

#

at least I figured an option to modify world

#

xD

misty wedge
misty wedge
#

Yeah, no idea why that doesn't work

#

I wrote manual authoring components for all my IBufferElementData

rustic rain
#

I can't

#

if I modify physicsVelocity in ECB

remote crater
rustic rain
#

it will overwrite value of physics

#

of dumping and gravity and etc

misty wedge
misty wedge
remote crater
remote crater
misty wedge
remote crater
#

Just add thrust and angular acceleration(verbage wrong)

rustic rain
#

or smth else?

remote crater
# misty wedge

Do I put this in the IBufferElementData file or in its own file and reference it from IBufferElementData?

misty wedge
#

Remove the GenerateAuthoringComponent from the IBufferElementData, then add the custom monobehaviour authoring component to the entities that need it

#

HandAuthoring in the above example

remote crater
# rustic rain you mean in physics world?

Think: A collision changes your velocity, angular rotation. So if you set those hard, you override the changes. You need to change acceleration to counter act em, and slowly regain yourself normally.

#

So hand authoring is monobehavior

misty wedge
#

Yes

remote crater
#

And ibufferElement references it

misty wedge
#

No

remote crater
#

You don't just slap it in ibufferElement

#

I should be able to google from here

misty wedge
#

It's the authoring component. You add it to a gameobject and the conversion system will convert it

remote crater
#

Whoa

#

so Just remove

#

[GenerateAuthoringComponent]

#

from IbufferElementdata

#

and your game object gets that monobehavior you wrote in that picture?

misty wedge
#

Yes

remote crater
#

Freaking weird man, why didn't they ever fix this yet?

#

Thank you a zillion tho

misty wedge
#

Removing GenerateAuthoringComponent will invalidate the auto-generated script, and your gameobjects will tell you the script doesn't exist

remote crater
#

if I end up being a kachillionaire, ask me for some ph@t L3vvt IRL

misty wedge
#

Took me a while to figure out too, I had to go backwards through commits and find one that worked, and then just try random things catjam

remote crater
rustic rain
#

hmm
I wonder how I can implement different (very simple) animations in pure ECS

#

in OOP I used async actions

#

which would modify transform for animation

#

any idea how can I implement similiar behaviour with ability to add a lot of different animations?

remote crater
# misty wedge

The line: DstEntityManager.AddBuffer<hand>(entity); What does that mean?

#

Is that supposed to be my ibufferelementdata?

#

Hand ?

misty wedge
#

DstEntityManager is a property of GameObjectConversionSystem

rustic rain
misty wedge
#

Hand should be your buffer type

rustic rain
#

it returns dynamic buffer added to entity

remote crater
#

kk

#

So I need one of these for every buffer type I have?

misty wedge
#

Yep

remote crater
#

tyty

misty wedge
#

Hope it fixes your issue

remote crater
#

So one final question

#

I actually give them item drop loot information in the scene

#

Is that not possible? Do I have to do it in game?

olive kite
#

is there anything unexpected with v.51 when dealing with terrains? Mine doesn't seem to working, no errors, just does the convert and destroy but no trace of terrain or its collider

misty wedge
remote crater
#

Do I need to add both HandAuthoring And ItemDropBufferElement?

#

Or just handauthoring

misty wedge
#

Can you post your buffer? I'll write you an example

remote crater
#

Sorry for shipwreck comments

#

mostly just a few ints/floats/bools

#

Thats what I have so far

#

You prolly want to copy/pasta the second file

#

I think I just add the data types public on the authoring

#

My question was more: When I attach to a (gameobject to be converted to) entity in scene, do I need both authoring and itembufferelement?

#

Or just one or the other

misty wedge
#

You then add the authoring component, set the data and it will be added to the converted entity

misty wedge
#

I just hope it's actually fixed in 0.51

rustic rain
#

hmmm

#

Burst function pointers...

#

maybe this is the way for custom animations...

covert lagoon
rustic rain
#

I mostly worry about implementation though

dense prawn
#

Just a quick Q, not worked with entities since the 0.17'ish days so I am a bit rusty.
My case is that I want to build a fairly complex set of interrelated entities, should I shoehorn it into a conversion workflow or use a monobehaviour that constructs my entities using the entitymanager instead? Are there other recommended ways to create entities now?

oak sapphire
# dense prawn Just a quick Q, not worked with entities since the 0.17'ish days so I am a bit r...

https://docs.unity3d.com/Packages/com.unity.entities@0.51/manual/conversion.html

The generation process that consumes GameObjects (authoring data) and generates entities and components (runtime data) is called conversion.
This process is the preferred way of authoring ECS data```
Read the whole thing, its useful. But Unity says this is the preferred way, so I guess that would be a good start for you.
rustic rain
#

SubScenes are perfect for this

#

if you want to spawn entities off prefabs - you can also use GO conversion

#

Unity has utility classes for prefab making

dense prawn
#

This one? GameObjectConversionUtility

rustic rain
#

but in some niche case you might want to create entities by yourself from scratch

#

which is also option

rustic rain
dense prawn
#

Alright, got it!
I'll give SubScenes a try, my main issue there lies with re-usability, but maybe I'm able to set up a few base converting gameobjects at the root of my SubScene that combine into the entities I want.

rustic rain
#

while authoring your scenes

dense prawn
#

Huh, then that might be my solution, I just assumed that they were sort of like regular Unity Scenes.
Where's the best place to learn about working with subscenes?
The docs and then the samples I guess?

rustic rain
#

never found them much use, except for physics

dense prawn
#

Got it, thanks mate!

rustic rain
#

@rotund token sir, I found your old forum post about tweening perfomance in ECS
Does it have a continuation?

rotund token
#

I have no idea what post you're talking about

#

Guessing this was from 2018 or 2019?

rustic rain
#

you posted some benchmarks on allocating a lot of memory for tweening

#

but I'm looking for either ready solution for tweening or for a way to make one myself

rotund token
#

There's a good chance I haven't used tweening since whatever that post was

robust scaffold
#

been a while since I popped into here. been in the graphics dungeons

#

anyone know if MaterialPropertyBlock can take native arrays?

#

Or if any of the Graphics.DrawMeshInstanced() methods can take a native array property block?

viral sonnet
#

hey o/ no idea, I just read it a bunch of times as feature request. guess it hasn't arrived yet if you are asking

robust scaffold
#

Yea. Im trying to find some hook but there just isnt any. I've been chipping away at my own 2d lighting engine.

#

Because unity's URP is hot garbage

viral sonnet
#

why's that?

robust scaffold
#

Doesnt use instanced lighting for one. So each and every light is rendered individually.

#

Well, it does batch the lighting if you set it up properly but if I go to that length, I might as well render them manually

viral sonnet
#

in deferred too?

robust scaffold
#

i dont think unity's URP 2D lighting supports deferred lighting. There was no option

viral sonnet
#

does 2d/3d urp differ? they added deferred rendering in unit 2021 for urp

robust scaffold
#

yea, it's a completely different renderer for 2d urp vs 3d urp

#

God im so rusty, I have no clue how these new partial system base things work

#

And i dont know if 0.51 on 2021 even works...

#

Wow, that's actually pretty good.

robust scaffold
#

Ya know, now that I actually see the lambda outputs for Entities.ForEach(), I trust it a hell of a lot more.

timber ivy
#

am I the only one that feels like scripting language with dots would be awesome?

#

also is there somewhere I can get a list of all engine api that can be safely used in dots

rotund token
#

List of engine API that can be used in dots

timber ivy
#

so nothing?

rotund token
#

if by dots you mean like jobs, then yeah pretty much nothing?

#

there are some wrappers like meshdata etc

#

but pretty much everything requires main thread sync with unityengine

timber ivy
#

aight

#

are they planning on changing this ever?

rotund token
#

what in particular are you looking for?

timber ivy
#

Just wondering if they are planning us to be able to use engine api calls in multithreaded ecs systems

robust scaffold
#

Job threads are completely isolated outside of the initial scheduling and completion.

#

There's no calling methods pulling additional data from inside a running job. Not intentionally in any rate.

#

You can do some funky things with raw native array pointers but that's pretty much it

timber ivy
#

Like if i Have some heavy math calculations will there ever be a day i can just pass the results to some engine api and do what I need to do directly instead of having to jump through hoops to use threads

#

is that the plan for ecs in the future or no?

robust scaffold
rotund token
#

you need to be a lot less abstract with your questions

robust scaffold
#

On the main thread, passing the data between method calls is very cheap so dont worry about that.

timber ivy
#

Ok for example, you know how you can now use the physics api in jobified systems? Are they planning to make this work with the entirety the unity api? Will there be a day I dont have to use oldschool componets etc.

rotund token
#

to be fair, aren't unity kind of phasing out the concept of property blocks with their srp batcher*?

robust scaffold
#

This is GPU instancing, not SRP batching.

rotund token
robust scaffold
#

And that's a black box of magic. Everything else is main-thread.

rotund token
#

oh yeah thats a good point i guess, they exposes raycasts

robust scaffold
rotund token
#

oh i'm aware

#

if you're using graphics.drawmeshinstanced

#

i just mean that their new 2022.X apis etc kind of go away from this so looking at adding support for things like NativeX is probably not high on their todo

robust scaffold
#

I dont even want to think about 2022. That's years from now

rotund token
#

sooner than you might think!

robust scaffold
#

if 0.50 is any indication, pretend as if it's late 2020

rotund token
#

surprise, it's already half way through 2022 😄

robust scaffold
#

Hrm, material property blocks can take compute buffers which accept native arrays... no native array access though

rustic rain
robust scaffold
#

Doing that now. It's fucked a lot of the data handing so hrm

rustic rain
#

yeah, indirect drawing is a bit of pain

#

but it's so much faster

#

you have total precise control over drawing

nocturne bear
#

Someone know something about NetCode? I try to sync VR Rig (3 objects).
My first idea:

  • All of these objects are different Predicted object.
  • For the all objects I can send separately input (by InputSystem)
    But there is a problem:
  • The CommandTargetComponent can link only to single Entity
  • This means that I can create only one ICommandData per client (right?)

The second solution is create parent with ICommandData for data (2x controllers + camera). Prediction for owner / server works correctly but it doesn't work for other client (ICommandData is not replicated?). Can I add GhostAuthoringComponent to childs (head and hands) too?

What is the best solution to solve the problem?

rotund token
#

not super familiar with VR these days (been ~3-4 years since I touched it)

#

but what is the reasoning for the player 3 separate ghosts? instead of being 1 ghost that controls all 3 parts

#

children of ghosts can be synced

late mural
#

is there any way to make entities have more proccessor power friendly collision (in rigid bodies), even if it is at the cost of some realism, i have some plans that are going to have 100s of entities colliding at once, and currently from testing that causes severe lag

nocturne bear
#

Now I can see that in GhostAuthoringComponent I can setup components. But I need to understand it better.

rotund token
#

i can have 100s collide fine

solemn hollow
#

hmm just when i went to vacation entites 0.51 releases. is it safe to update or should i wait?

late mural
rotund token
#

i usually run simulations up to 20-40k physic objects before really breaking down

late mural
#

woah

rotund token
#

it's really how close your collisions are though

late mural
#

just spheres nuzzling

rotund token
#

if all your collisions in a tiny area, it ain't going to work

late mural
#

perhaps it is my hardware just being bad though, ill quickly grab my gpu and cpu specs

#

this is my cpu

#

this is my gpu

late mural
late mural
#

just kinda nuzzling

late mural
nocturne bear
#

Turn off safety checks, leak detection, turn on burst

#

Or check build 😉

late mural
#

ill check the build later, but for now ill test the first things

#

nice, im getting about 10 fps higher, making it bearable

late mural
rotund token
#

thats very close

late mural
#

oh, unfortunate

rotund token
#

that's a lot of collisions/frame

#

(also make sure you turn off integrity checks for physics)

late mural
#

ah, so is there any way to make collisions less acurate then, cause if they clip through eachother it doesnt really matter too much

rotund token
#

personally i advise running your fixed update at 50% in editor vs buil

#

overhead makes it much easier to run into fixed update spiral of death

late mural
#

not really certain what that means, but the spiral thing sounds terrifying, and ye ill mess around with the physics fixed update thing

rotund token
#

by default updates at 60fps

#

by halve it i mean run it at 30fps

#

the problem with fixed update is, if your fps drops below 60fps

#

then you need to run more than 1 update/frame

#

which then makes your fps even lower

#

which means you need to update even more/frame

late mural
#

ah, my fps is almost always below 60fps so that makes sense

rotund token
#

and the death spiral begins

late mural
#

that explains a lot

rotund token
#

yeah run your fixed update < your fps

late mural
#

ok, which tab would i find that under btw

rotund token
#

just get a reference to FixedStepSimulationSystemGroup in OnCreate of a system and set the timestep to 1/30f or something

late mural
#

oh ok, i swear there is a way to do that in the editor, although perhaps im thinking of non-dots

rotund token
#

yes there is physics settings in project settings

#

for physx

late mural
#

guessing physx aint entities?

#

code pasting here is considered evil for some reason

#

you will have to screenshot it

rotund token
#

sec i figured it out last night

late mural
#

or paste bin

late mural
rotund token
#
public FixedStepSimulationSystemGroup()
{
    float defaultFixedTimestep = 1.0f / 60.0f;
    RateManager = new RateUtils.FixedRateCatchUpManager(defaultFixedTimestep);
}```
#

see

late mural
#

how?

rotund token
#

i outsmarted the bot

late mural
#

what witch craft do you know?

late mural
rotund token
#

you just can't have indents for some reason

late mural
#

weird

#

perhaps it interprets it as some ascii art spam or something?

rotund token
#

🤷‍♂️

late mural
#

lol

rotund token
#

super annoying but at least i know how to work with it now

late mural
#

good job!

rotund token
#

its funny but last i read on this discord

late mural
#

and thanks!

rotund token
#

screenshotting code is against the rules ^_^

late mural
rotund token
#

but they made it the easiest way to share...

late mural
#

good job unity discord bots

rotund token
#

i doubt it but who knows

late mural
#

and cause #archived-dots is a relatively small channel gussing it will probably take a while for them to get around to fixing it

rotund token
#

i literally read no other channel

late mural
rotund token
#

anyway i should get off my ass and go for a run on this cold evening

#

hopefully that helps

late mural
#

good job!

late mural
oak sapphire
rotund token
#

i forgot my comment about the code got deleted

#

i.e. its just hardcoded in the constructor instead of reading any setting

#

you just get the FixedStepSimulationSystemGroup via world.getexistingsystem

#

in OnCreate

#

and change the update to whatever you want

late mural
#

ok, im pretty sure i get that now then, thanks a bunch!

#

ooh also question, im very new to shadergraph and stuff, and i plan to mess around with it, does shader graph work with entities?

rustic rain
#

they are unrelated, and yeah, they work together

late mural
#

awesome yay!

muted star
#

Hello everyone, where can I find documentation on the BuildConfiguration asset which is required for DOTS projects?
I want to pass a launch argument but don't know how it's supposed to work.
It seems like Run Settings -> Extra Arguments aren't available in System.Environment.GetCommandLineArgs();

karmic basin
#

One interesting thing to note in this page is that these components are overrides of the main build and player settings

#

So maybe you can fallback to the legacy way of command line arguments ... ?

devout prairie
devout prairie
#

Are certain things currently a bit wonky in 0.51

#

Just testing with a fresh project in 2020.3.34f1 with latest Entities etc

#

But i'm getting some odd things, such as the Subscene not showing any options in the inspector

robust scaffold
devout prairie
#

Also previously ( before 0.5 ) objects added to subscenes were automatically set to 'Convert To Entity' in the inspector ( i think it said in brackets 'by scene' ).. this doesn't seem to be the case, i have to manually tick ConvertToEntity

solemn hollow
#

god i would actually love it if you could have gomeobjects in subscenes :S

devout prairie
#

Clicked on subscene in editor:

#

Blank inspector:

robust scaffold
solemn hollow
#

that subscene looks wrong anyways. there should be a checkbox to close it

robust scaffold
devout prairie
#

basically - i removed the subscene from my scene, and then manually dragged it in, now the inspector is blank

solemn hollow
devout prairie
#

Bunch of errors also, not seemingly related to my ( thus far very basic ) ecs code

#

Maybe some stupid package version problems

#

Was just curious if it was anything obvious that other people have experienced

robust scaffold
#

No issues with this set

devout prairie
#

maybe Burst, upgrading that

solemn hollow
#

did you restart unity after burst update?

#

i always have to do that

devout prairie
solemn hollow
#

first time i open the project its always broken

robust scaffold
devout prairie
#

i already had burst installed but no entities.. forgot it had prompted me for restart

devout prairie
#

@robust scaffold no issues with 2021 so far?

robust scaffold
#

Im mainly doing URP shader things but the small dip into entities is fully functional

devout prairie
robust scaffold
solemn hollow
#

oh i have a related question. i think one of my urp shaders now is broken because i convert the object to an entity (gameobject on a tilemap). the shader needs the world position of the entity. how do i pass that property ?

robust scaffold
#

Draw mesh instanced procedural is breaking everything

robust scaffold
#

Well, okay. There's the easy way, which i know works, and there's the performance way, which doesnt

solemn hollow
#

easy way costs too much cpu time?

#

im a shader noob so anything helps 😄

robust scaffold
#

are you making your own shader with manual drawing (draw mesh [instanced]) or is this a material?

solemn hollow
#

shadergraph material

robust scaffold
#

oh, then it's really easy. There should be a node directly called world space position. The shader already knows where it's at

devout prairie
solemn hollow
#

i do use the worldspace node. everything worked with gameobjects but not with entities. hmm maybe i have a diffrent problem alltogether then

robust scaffold
#

is it that the world space position is not accurate?

solemn hollow
#

thats good to hear. atleast im not going down the wrong debugging path then 🙂
Atm i cannot really tell what the problem really is. somehow the shader is either not drawn, drawn somewhere else or drawn below sth. (i havent had the chance to debug it yet. it just now occured). I just figured since its the only property that could cause problems it might be position. guess its not then.

solemn hollow
#

yes

robust scaffold
#

IIRC, hybrid render also uses draw mesh instanced procedural as its rendering system. Does that object have a scaling or even positional change to it? Does it render if you set the transform to 0 with 1 scaling?

solemn hollow
#

and this is how it should look

robust scaffold
solemn hollow
#

yes

#

im checking for scale now. sec

robust scaffold
#

alright, hrm. Tilemap rendering is custom implementation. It uses the texcoord0 data in the vertex to indicate what tile should be rendered. Hybrid renderer may not be able to recognize this and thus breaks the encoded data

solemn hollow
#

hmm but its gameobjects brushed onto the tilemap. its not tilemap internal sprites.

robust scaffold
solemn hollow
#

this is the object with the shader

#

i didnt see the warning before. might have sth to do with it.

robust scaffold
#

main tex? Shadergraph right?

#

It should have a main tex built in but if not, just add a texture2d property called "_MainTex", make sure the name and the compiled property is called that

solemn hollow
#

im not the one making those shaders so i dont know what exactly happened there. there is no maintex

robust scaffold
#

Make sure the reference is "_MainTex", exact spelling and capitalization

#

Then use that texture as the tex2d sampler source

#

or, screenshot the shadergraph please, just the inspector and properties list if the shader itself is copyrighted

solemn hollow
#

let me change branches to where the problem actually occurs

robust scaffold
solemn hollow
#

rofl. that graph is far too big and too chaotic to screenshot ^^ artist workflows 😄

robust scaffold
solemn hollow
#

So do i need to create a MainTex property anyways?

robust scaffold
solemn hollow
#

hmm still same problem though.

robust scaffold
solemn hollow
#

sry still waiting for the possible errors... first startup after branch change takes ages... iteration speed sucks right now.

robust scaffold
#

Yea, im on a bare bones project so all changes measure in 2 seconds or less compiling. It's so nice

#

Have you set up the assembly definition files so the entire project doesnt need to be recompiled if one part of it changes?

solemn hollow
solemn hollow
#

ill check the frame debugger if i find sth

robust scaffold
robust scaffold
robust scaffold
# solemn hollow no i didnt

It should be hooked onto something, is there anything inside the shader graph that is requesting a default texture?

robust scaffold
#

Like this, it's sampling a default.

solemn hollow
#

should i just rename the reference of that alpha texture to _MainTex?

solemn hollow
#

it only controls the alpha of the generated noise

robust scaffold
#

If that is what the sprite you placed into the sprite renderer is suppose to do, that is what you want

#

the sprite inside the sprite renderer will be placed into the texture you label as _MainTex in the reference name. So change the one that is intended for that.

#

If the sprite is an alpha map, thats the texture you want. If it's a normal map or color map, change the appropriate texture.

solemn hollow
#

im getting so confused now. my understanding would be that this is the maintex

#

but it is not used in the shader at all

#

still it somehow got drawn when it was a gameobject?

robust scaffold
solemn hollow
#

the framedebugger shows the shader:

#

but it doesnt render anything obviously

#

thats how it looks after the change of the alpha texture referenc

#

e

robust scaffold
solemn hollow
#

so its sth about that main tex attribute

solemn hollow
robust scaffold
#

Spitballing here, i dont exactly know what's going on here

solemn hollow
#

didnt change anything. thats supposed to be the shadow texture based on the name in the graph

solemn hollow
robust scaffold
#

What makes you think it's that?

solemn hollow
#

no now i think its a maintex thing

robust scaffold
#

short of going step by step through the shader, i dont know what to do

solemn hollow
#

i really dont understand the shader anymore. can i somehow render that noise pattern to the maintexture property first and then output it?

robust scaffold
#

how is the texture even being rendered? You mentioned tilemap earlier.

solemn hollow
#

grass_top is the object that is not rendering. IMO its just a gameobject pinned to a tilemap location. doesnt use tilemap renderer. it gets converted to an entity just like normal gameobjects

robust scaffold
solemn hollow
#

sry im not sure whether it is instanced or not. no post processing afaik

#

where do i check if it is instanced? frame debugger?

robust scaffold
#

yea, it can say instanced in the draw mesh area

#

or you can check the rendering features list

#

Is there a post processing feature that is doing something to that object?

solemn hollow
#

its not instanced. its batched. 3 draw calls for the whole screen atm.

robust scaffold
#

hrm, does just one tile render, disconnect anything that is handling duplicating it to fill the screen with it

solemn hollow
#

dont know if artist did hide some somewhere though

solemn hollow
#

there is worldgen comming so that wont be an issue in the long run.

robust scaffold
#

does it render a solid color

solemn hollow
#

ill try. but it most likely will work. since the shader rendered black on the right positions when i changed the AlphaTex to MainTex

#

changed the shader of that one tile.

robust scaffold
solemn hollow
#

yes i dont think the main texture is needed at all because the edge is already rendered by the grass_bottom

robust scaffold
#

hrm, then there's something broken inside the grass texture generation then

solemn hollow
#

so the main texture is actually just plain white and some noise on top

robust scaffold
#

try individually hooking up each part of the shader to the output. If it doesnt look right, you found the problem

#

holy shit, i just spent the past 4 hours debugging my own shader and finally fixed it

#

Forgot to indicate a keyword in the compiling of it. My god

#

it's my own shader made from scratch by my own sweat and blood and it still took 4 hours

solemn hollow
#

shader code looks so hard to me. ill probably never dive into it :S

robust scaffold
#

but you dont need to recompile if you change it, it hot reloads

solemn hollow
#

yes i can now somehow read it quite fine but writing it is sth diffrent

#

ECS really helped getting into the mindset

robust scaffold
#

it's like a IJobEntityBatch struct. vertex shader contains per chunk code and fragment is per entity

#

except now you do it per vertex and per pixel

#

And you pack everything into tex coords for data needed in pixel code

#

issue comes from matrix transformation. Real pain debugging that

solemn hollow
#

thats a really good explanation.

covert lagoon
#

v2f
SV_
Who comes up with those names?

rotund token
#

Vertex 2 fragment

covert lagoon
#

What does that mean

rotund token
#

It's the data you pass from the vertex stage to fragment stage

covert lagoon
#

What's a fragment

#

I forgot

#

Also isn't it called something else in GLSL?

robust scaffold
robust scaffold
covert lagoon
#

Isn't it called a pixel shader in GLSL?

#

I think I read something like that

robust scaffold
#

same as microsoft, they call it a pixel shader as well in the docs but fragment apparently due to ancient tradition

covert lagoon
#

Ok apparently a fragment may or may not be a pixel

rotund token
#

I think it's fragment in opengl and pixel nearly everywhere else

covert lagoon
robust scaffold
#

Unity uses HLSL variable declaration yet GLSL samplers and naming. I dont know anymore

rustic rain
#

and HLSL for actual code part

covert lagoon
#

Also, while we're talking of shaders:
Unity.Transforms.LocalToWorld.Value is a float4x4, yet it seems that it could be a float3x4 as I can't find any usage of the w component of any of its float4 columns.
Is it a float4x4 to make interoperability with rendering code easier as there seem to only be square matrix types in HLSL and probably also in everything else in the GPU world?

robust scaffold
#

It's float4x4 because of that transpose without needing a new variable type.

covert lagoon
#

But 4x3 is 3 columns and 4 rows

robust scaffold
#

It's row x column, im pretty sure...

#

wait yea

robust scaffold
#

3x4 then. Matches hlsl docs

#

Whatever the local to world TRS in C#, it's transposed to become the unity_LocalToWorld variable in shaders to obtain world position.

covert lagoon
#

All 4 columns are used

#

But I can't find usage of the w component of any column

robust scaffold
#

Not quite, the TRS has fillers for the W value.

#

That is identical to what I'm doing in that matrix generation (skipping rotation).

#

and in 2D, hence position is only a float2 instead of float3

covert lagoon
robust scaffold
#

it does something, setting it to 0 results in nothing getting rendered

covert lagoon
#

How

#

We do 3D graphics, not 4D graphics

robust scaffold
#

Well, you need to pack in translation into the matrix as well.

covert lagoon
#

Yeah it's the 4th column

#

But why is it a 4-dimensional vector

robust scaffold
#

vectors are float4s?

rotund token
covert lagoon
#

They're not a vector in 3D space

robust scaffold
covert lagoon
#

I read that they're 4 independent rotations

rotund token
#

It's 4x4 for matrix operations

robust scaffold
#

i think the question is why TRS matrix is a 4x4, and not a 3x4

solemn hollow
#

@robust scaffold thanks again for helping. i got it to render. it was indeed the maintex issue.

covert lagoon
#

I'm asking why LocalToWorld.Value is 4 columns and 4 lines and not 4 columns and 3 lines

robust scaffold
#

If vector was instead a float3, a 3x4 can be multiplied with vector to obtain world position

#

vertex

rotund token
#

You can't multiple a 3x4 matrix together

robust scaffold
#

oh yea, MVP and such

covert lagoon
#

Oh right

pastel field
#

I'm trying to port a project to Entities 0.51 under 2021.3.4f1.
Running into lots of 'Unity.Entities.Editor' errors/missing namespace.
Already try to downgrade a few dependencies and fix some of them, but can't find anything for Packages/com.unity.entities/Unity.Entities.Editor

#

I tried to clear the cache, but that doesn't work either

#

Does anyone know a solution?

robust scaffold
pastel field
robust scaffold
rotund token
#

oh upgrading from 0.17 to 0.50 (0.51) is a bit of a pain

#

have you checked out the upgrade guide at a bare minimum?

robust scaffold
rotund token
#

yeah its com.unity.dots.editor or something though and what he's highlighting seems to be regular entity package so bit confusing

#

maybe its a conflict? in which case yeah definitely remove the old editor package

pastel field
#

it's definitely a conflict with** com.unity.dots.editor**
I have modified the manifest.json and packages-lock.json while deleting the packages, but so far without success

rotund token
#

delete com.unity.dots.editor

#

it should nto exist anymore

pastel field
#

Is my approach the right one?
Search for namespaces in old APIs, downgrade some packages and cross my fingers.
I don't see any attention given to make sure that the dependencies work together.

robust scaffold
robust scaffold
#
{
  "dependencies": {
    "com.unity.2d.animation": "7.0.6",
    "com.unity.2d.common": "6.0.3",
    "com.unity.2d.psdimporter": "6.0.4",
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.2d.spriteshape": "7.0.4",
    "com.unity.2d.tilemap": "1.0.0",
    "com.unity.2d.tilemap.extras": "3.0.2",
    "com.unity.burst": "1.8.0-pre.1",
    "com.unity.entities": "0.51.0-preview.32",
    "com.unity.ide.rider": "3.0.14",
    "com.unity.render-pipelines.universal": "12.1.7",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0"
  }
}```
#

That's my manifest. 2021.3 LTS for a 2D

rotund token
#

"com.unity.burst": "1.8.0-pre.1",
highly recommend using 1.7.2 over this

robust scaffold
#

i love cutting myself

rotund token
#

1.8 has the burst invalid cache bug

#

they've only fixed it for me in 1.7.2 so far

pastel field
#

indeed I'm using "com.unity.burst": "1.8.0-pre.1"

robust scaffold
pastel field
#

will try with 1.7.2

rotund token
#

only by deleting your burst cache

robust scaffold
#

oh, oof

rotund token
#

burst thinks it's up to date but compiles old version

robust scaffold
#

i only got 1 burst job right now thats running so havent noticed anything wrong. Might as well downgrade then

rotund token
#

ever make a code change and it isn't reflected? or it throws an exception that shouldn't be possible

#

yeah thats the cache bug

#

took me like 8 hours to get a reliable repo and then unity 3 weeks to fix it

#

was a huge pain

robust scaffold
#

oh wow, you much better coder than me

rotund token
#

lets just say

#

our build machines were failing 10% of the time

#

switching branches and breaking our workflow really badly

pastel field
robust scaffold
rotund token
#

switching branches to run unit tests burst would not always detect a job has changed

#

and maybe a component changed sizes

#

anyway if you only have 1 job you probably won't run into issues

#

and 1.8 will be out before you probably do

#

but anyone else who has a lot of jobs and ever had funky burst things happen, yeah that's probably why

solemn hollow
#

was it in earlier versions too?

rotund token
#

yes

#

i believe ~1.6.5+

#

at least we didnt notice it in 1.6.4 but did in 1.6.6 (never tried 1.6.5)

solemn hollow
#

im on 1.6.6 and had some stupid stuff happening. had to clear caches a few times cause i couldnt locate the error

rotund token
#

yeah thats 99% the cache bug

solemn hollow
#

1 more reason to go to 2021 asap

rotund token
#

you can upgrade on 2020.3

robust scaffold
#

I believe 1.7.2 is available for 2019 and above

rotund token
#

Fixed a really convoluted bug that could manifest in Burst returning out of date cached libraries, which would manifest as random exceptions in Burst jobs/function-pointers (users deleting the BurstCache would workaround the bug).
it's this specific change log in 1.7.2 so look out for it in 1.8~

pastel field
#

Still got The type or namespace name 'DOTSEditorWindow' could not be found

rotund token
#

said it like 3 times!!!

#

delete dots.editor

pastel field
#

yeap

#

That's it

pastel field
#

I had missed the line with the solution, Discord is not really my cup of tea 😇

solemn hollow
#

@rotund token you did help me out with generic systems once. i still have a screenshot on how you make burst register the generic jobs 🙂 again thanks for that! however my need is such that i cannot know which Concrete Type is used in the implementation. It is defined in a graph in editor. So i cannot write a concrete instance of a generic system to register the job. and i also cannot register the job via assembly attribute because again i dont know which implementation will be chosen in the graph.
I have a working solution but it seems to block me from using IJobEntityBatch. I have to use IJobFor and do manual chunk iteration.

  1. question: is manual chunk iteration much worse? does unity do some neat stuff in IJobEntityBatch? (i dont need batching. chunk granularity is fine)
  2. question: is there some other way to get IJEB-jobs to register?
rotund token
#
  1. question: is manual chunk iteration much worse? does unity do some neat
    stuff in IJobEntityBatch? (i dont need batching. chunk granularity is fine)
    all IJobEntitybatch is doing is manual chunk iteration under the hood
#
  1. question: is there some other way to get IJEB-jobs to register?
    i don't really understand why IJobFor would work and IJEB wouldn't?
#

welcome to unity discord code deletion

#

remove all indents and it seems to work for me

solemn hollow
#

umm what 0.o

rotund token
#

anyway i did read it, i have no idea how/why that is burst compiling

solemn hollow
#

thats the thing that scares me. if id change it to IJobChunk it wouldnt work

#

burst would complain

rotund token
#

yeah i dont see why burst would compile that as a ijobfor either

#

what version of burst are you on?

#

is it still 1.6.x?

solemn hollow
#

1.6.6

rotund token
#

can you upgrade to 1.7.2

#

and test it

#

i suspect burst will tell you it's not compiled

solemn hollow
#

if it breaks im fucked

rotund token
#

i suspect it's editor only compiled which 1.7.x will no longer do

#

1.7 goes through same path for editor and builds now

solemn hollow
#

nono it works in builds

#

my whole AI does it like that

rotund token
#

oh that's extra interesting

#

makes no sense to me

solemn hollow
#

if it breaks id need to codegen everything...

#

atm i dont have to compile my graph into some code. i can just convert some scriptable objects which contain codegened Icomponentdata type references

#

Maybe thats why my iterationtimes are so atrocious

#

Cause burst somehow really scans whole assembly for generics

rotund token
#

im not a fan of codegen in general

#

hence why i avoided it completely for my ai/graph

solemn hollow
#

me neither. but i wouldnt know how to solve it without codegen if i couldnt make generic systems without knowing types beforehand

#
using Unity.Entities;
using UnityEngine;

[assembly: RegisterGenericComponentType(typeof(Consideration<#CLASSNAME#PointData>))]

[CreateAssetMenu(fileName = "#CLASSNAME#.asset", menuName = "UtilityAI/PointGenerator/#CLASSNAME#")]
public class #CLASSNAME# : PointGeneratorScrObj
{
    public override Type GetComponentType => typeof(Consideration<#CLASSNAME#PointData>);
}

public struct #CLASSNAME#PointData: IComponentData { }```
#

this is basically all im letting my designer generate. The Type is then used in MakeGeneric to create an instance of a Generic System

rotund token
#

no issues il2cpp?

solemn hollow
#

scripting backend is on mono in editor. Il2cpp builds did work if i remember correctly.

rotund token
#

well editor is always mono

#

just wondering about il2cpp builds - the only thing that seems to have more issues with generics than burst 😬

solemn hollow
#

ah i wasnt sure if entities changed that somehow

#

atm i cant build. my artist is still converting his stuff to subscenes conversion. when thats done it'll be the first time ill do sth with build configs.

#

since i heard you need to use build config asset if you use subscenes

rotund token
#

you do

solemn hollow
#

hmm how do you people handle the case with lineOfSight and lineOfFire. if the projectile to shoot has a width then a raycast to check LOS would not be enough to avoid the Projectile hitting corners. Collidercasting against all enemies seems expensive though. first check LOS then LOF?

rotund token
#

a lot of times projectiles just don't have width

#

when they do, i don't think a sphere cast is going to break the bank in most games

solemn hollow
#

in theory i could have some hundred spherecasts in a frame. probably fine but i wonder if i should first filter out the enemies i dont even hit with raycasts

rotund token
#

it really depends on the granularity you care about

#

you could just use 4 raycasts if you projectiles radius is less than the thinnest collider you have

solemn hollow
#

oh thats a nice trick to keep in mind (im in 2D Topdown so 2 is enough). but my current game has some bigger "projectiles"

devout prairie
#

Just noticed they've added SetName to command buffer, don't think it used to be possible

#

i think was only possible on EntityManager

#

Be nice if it auto-named all gameobjects and children when it converted to prefab inside an authoring component / subscene

#

just for debug purposes

robust scaffold
#

I believe set name uses burst discard?

drowsy pagoda
#

Taking a crack at singleton. Getting this error:
InvalidOperationException: SetSingleton<NumTacs.GameBoard.GameBoardData>() requires that exactly one NumTacs.GameBoard.GameBoardData exist that match this query, but there are 0.
I'm SetSingleton(boardData) on authoring during Convert call. And in OnStartRunning trying to cache GetSingletonEntity<GameBoardData>().
Error fires during Convert.

rotund token
#

I'm SetSingleton(boardData) on authoring during Convert call

#

is that actually doing anything?

#

And in OnStartRunning trying to cache GetSingletonEntity<GameBoardData>().
where are you loading your converted data from?

#

if it's a subscene they load async so there is no guarantee it'll be loaded first frame (it won't be)

devout prairie
rotund token
#

in better news

#

you can turn off this crap now with DOTS_DISABLE_DEBUG_NAMES

#

names are actually available in builds now

#

you have to turn them off

devout prairie
#

ahhhh

#

does it impact anything?

rotund token
#

[0.19.0] - 2021-03-15

  • Names assigned to entities are now available by default in all builds, not just within the Editor. To strip Entity debug names from builds, define DOTS_DISABLE_DEBUG_NAMES in your project's build configuration.
drowsy pagoda
#

Oh turns out if I just have one entity that runs in the conversion, the System GetSingleton will get it even if I never SetSingleton! Nice.

devout prairie
#

obviously strings are not great, i guess it adds overhead really

#

normally i use #if UNITY_EDITOR when using SetName, but that was previously, when using EntityManager

rotund token
#

i'm pretty alone in this but i think any use of setname leads you down a bad path

#

its an obvious sign you're not thinking about things as data, but as objects still

devout prairie
#

anyway, it'd be nice if it gave the option to auto-name gameobj hierarchies during conversion for debug

devout prairie
#

if you have a complex hierarchy, it's a thousand times quicker and easier to deal with at the early stages when names are visible

rotund token
#

i haven't used setname in over 2 years and not once have i thought this would be useful

devout prairie
#

one prefab i have for example is like 30 entities, all with the same name Entity(3:23) etc

#

not useful

devout prairie
rotund token
#

thats like the complete opposite of what I do

#

i spend most of time writing tools to reduce pain for development

devout prairie
#

well say for example, you have a complex hierarchy, with joints and various other components..

#

and you're trying to figure out, okay how did ecs handle the conversion..

#

how and what did it unparent, which entities are joints and which are meshes, which are connectors ( those additional entities that physics joints create ) etc

#

it's a mess, if all you have are a list of entities

#

So here's my prefab:

#

Here's the dots representation of that:

rotund token
#

which entities are joints and which are meshes
the components tell you that - not the name

#

anyway as I said, i'm somewhat alone in this opinion

devout prairie
viral sonnet
rotund token
#

you mean gameobject prefabs?

#

apart from that is in object world, i pretty much never lookup prefabs / config by name

#

we have 3,624 prefabs in the project

#

there's no way i can remember the name of them

#

especially if someone else named them

#

we have 10,244 scriptable objects

#

nearly always search via data t:X

#

search window is great for this

viral sonnet
#

hehe 😄 I get your point. I just don't see any downside of naming something so why even take a stance against it?

#

or that it leads down a bad path. i can't think of any negative effects really.

rotund token
#

It's perception - if I see SetName throughout someone's code I do not think someone has switched from thinking in object to a more data focused design focus yet.
Let's say I'm looking at a code sample from a resume for a potential candidate and throughout I see the use of SetName.
What I'm now thinking is there is a good chance we'll need to provide a few extra months of training to get them comfortable with data driven design.
Now would I not hire someone because of SetName? Of course not. It's a note I'll make and bring up in an interview. They don't know it but they're already on the backfoot 🙂
That and SetName is mostly used with runtime entity creation which is generally bad.

viral sonnet
#

i dunno man, that's really judgemental. like you can't know just from that if someone needs training. like my enemies and player have the same spellcaster entity. filtering that is impossible through components alone. am I better now because I use tags instead of a name? and AFAIK SetName is removed from builds so what does it matter if the editor has more meta data that someone can find useful?

molten flame
#

I tried SetName when trying to figure out the stupid collider baking stuff but SetName only works out of the box in like specific instances and its just a massive pain in the ass more than anything XD

rotund token
#

🤷‍♂️ everyone has biases, I just try to be aware of mine.

molten flame
#

You'd be better off adding tag components imo

rotund token
#

AFAIK SetName is removed from builds so what does it matter if the editor has more meta data that someone can find useful?
it's not

viral sonnet
#

fyi, I don't use setname 🙂 i just don't judge

viral sonnet
#

ok, that's really dumb. why would I need names in builds?

#

does the entity hierarchy inspector even work for builds? i never tested this

viral sonnet
#

superfluous tagging is even worse than setname because that can't be fixed with a simple compiler directive

molten flame
#

I have nothing against people using SetName.
I just find that its usually not worth the effort, at least for me.
When I'm looking for things that are more OO-like, e.g. Player entity is a big one, or singletons, then usually they have a tag anyway so they can be queried.
So I just search for that instead of giving them a name.
I'd prefer if there was an option to SetName automatically at runtime in playmode but I dunno how that'd work

covert lagoon
#

I use names to know which entity to click on in the DOTS Hierarchy window

rocky dove
#

Is it possible to add types (IComponentData and Systems) during runtime?

molten flame
rocky dove
#

Yeah, exactly

molten flame
#

Umm, I don't think so... It's definitely not something that's intentionally supported by Unity.
There is a package here that supports Roslyn https://assetstore.unity.com/packages/tools/integration/roslyn-c-runtime-compiler-142753#description if thats what you're after.
Has nothing to do with DOTS though and it has platform limitations.

Use the Roslyn C# - Runtime Compiler from Trivial Interactive on your next project. Find this integration tool & more on the Unity Asset Store.

rocky dove
#

Yeah, thats the package I'm using. I'm not worried about the compilation part, more like getting the types into the system update loop for example

#

It will be very silly if I can just do the normal .AddSystem() or whatever

molten flame
#

mmm, it should work that way, but I have no idea how if it'll work with burst.
This is more of a compiler specific question, I'd recommend asking the guys on the Burst forum, if anyone knows, they'll know.

#

But seems like you're in "try it and find out" territory with that one lol

rocky dove
#

Yeah for real. Good point about Burst I bet thats probably not possible with the asset you linked. Well I'll report back

solemn hollow
#

does calling a method through an interface hide the functions behind the interface from burst compiling?

#

I dont think it should but im not certain my funcions are burst compiled. cant find them in the inspector

rotund token
#

its all bursted or it's not

#

if whatever is calling it is burst compiled your method is burst compiled

#

otherwise it's not

#

unless you're talking about function pointer calls?

solemn hollow
#

no i am talking about a Processor struct with methods inside which i call from a burstcompiled job. i just cant find the job in the burstinspector.

#

rider tells me its burstcompiled though

#

(but it doest tell me that the functions inside the Processor are burstcompiled)

rotund token
#

anything you call from a burst compiled job will be burst compiled

#

you can't find the job in the burst inspector?

solemn hollow
rotund token
#

that would imply burst isn't compiling them =S

solemn hollow
#

but its shown as burstcompiled in profiler at runtime

rotund token
#

in editor or build?

#

did you try 1.7.2 yet? it has much better detection of this stuff

solemn hollow
#

both

#

no i didnt. ill upgrade in the next few days but have to merge together a few branches first. cant right now

rotund token
#

not suggesting you stick with it

#

just to install it to see if it pumps you any warnings

solemn hollow
#

true. guess ill try

solemn hollow
#

Compilation was requested for method ... but it is not a known Burst entry point. This may be because the [BurstCompile] method is defined in a generic class, and the generic class is not instantiated with concrete types anywhere in your code.

#

Thats the warning i get starting the game in editor now

#

My whole architecture is doomed... damn it

rotund token
rotund token
#

can't you just code gen the attribute for burst as well?

#

(i only saw your job code for like 3 seconds before discord deleted it so this is from memory of that)

solemn hollow
#

id need to codegen the attribute based on how the designer authored the graph

rotund token
#

just generate every combination then?

solemn hollow
#

oops sry no answer to your comment

robust scaffold
#

I have discovered I need the 2022 batch rendering group API. And I also need entities. Has anyone tried 0.17 with 2022.2 alpha?

#

Code gen in 0.50 is nice but I can write my own jobs manually. I could roll my own ECS with a pile of native arrays but I really need to refamilarlize myself with DOTS. Does 0.17 compile?

solemn hollow
#

The weirdest thing about this is that in burst 1.6.6. it worked. it was burst compiled and in 1.7.2 it isnt anymore

rotund token
#

i know you say it does

#

but i don't see why it would =S

rotund token
#

(with small changes)

#

but yeah other packages wont work (hybrid renderer in particular)

solemn hollow
#

im sure it did. i profiled it in a build

rotund token
#

but i dont think you care

#

but yeah the batch api is what i was talking about the other day for you - probably made no sense what i was saying if you weren't aware of it

rotund token
#

anytime you encounter a new one while playing in editor just generate it

solemn hollow
robust scaffold
#

Because currently small object meshes must me merged with a global shadow caster mesh and then that must be reuploaded to the GPU every frame since the positions of the vertices must change. If I can instead use the batch rendering group to instead do so, that will be revolutionary

rotund token
#

yeah it looks fantastic. i haven't played with it much except to understand how to utilize it due to being stuck on lower versions.
it's nice to feel like there's something to look forward to though when it comes to rendering because it seemed like unity was slipping a bit

#

no indents manarz 😄

solemn hollow
#

oh man even really short snippets are deleted. i though only for long ones i need to care

rotund token
#

copy into notepad, shift tab shift tab, a few times

solemn hollow
#

I generate needed instances of Systems in a Factory in Conversion. Basically this:

sysType = typeof(ConsiderationSys<,,,,,,,>);
constructedClass = sysType.MakeGenericType(considerationType, parentOutputType,
axis[0].componentTypeRef.GetComponentType,
axis[1].componentTypeRef.GetComponentType,
axis[2].componentTypeRef.GetComponentType,
axis[3].componentTypeRef.GetComponentType,
axis[4].componentTypeRef.GetComponentType,
axis[5].componentTypeRef.GetComponentType
);```
#

should be enough to codegen those systems right there

rotund token
#

there you go

solemn hollow
#

phew. way easier fix than i expected. thank you so much

#

there was a thread somewhere explaining why unity decided to not let burst resolve the generics itself. it was something about having to traverse the whole codebase and finding all possible concrete types. i dont know enough about compilers for it to make much of it. i wonder if that is what burst actually somehow did in 1.6.6 for me. I have (had?) reaaaaally slow compile times

devout prairie
#

is it possible to retrieve the entities created from joint components during conversion ( ie inside Convert )?

#

for example trying this returns the gameobject entity not the entity generated from the joint component:

Debug.Log("JOINT = " + conversionSystem.GetPrimaryEntity(t.GetComponent<Joint>()));
#

i guess i'll have to work around it

rotund token
#

can you just query it in destination world?

#

i guess it depends what you're trying to do with it

devout prairie
#

basically i'm just creating a component, which stores an array of each 'bone' entity, and the corresponding joint entity

#

so it's kindof easier to do that during prefab conversion

#

i can do it with some logic, for example for each bone, loop through all joint entities and find the one that references that bone entity inside it's Physics Body Constrained Pair component.. but it could be cleaner/easier to just directly grab the primary entity if that was possible

late mural
#

ive been messing around with the dof limit joints thing, and i cannot get it to work, no matter what i try, as such im wondering would it be ok if i just set the rotation and position to be whatever i want it to be

#

or will the physics engine not like that, or will it be bad for performance?

devout prairie
late mural
#

i dont know what that means im afraid

devout prairie
#

Regards just having a good conversion from joint to physics joint, it seems to work for me ok

late mural
#

what im attempting to do is recreate rigid body constraints, which according to the dots manual and samples, should be using a dof limit thing, that wont work for who knows why

devout prairie
late mural
#

dof limits used in the sample scene, someones custom designed dof limit, a mod of the sample scene, a mod of the mod of the sample scene one,

#

so far none work

#

either i get weird errors, or they just dont do anything, currently im gonna try just brute forcing the rotation and position every frame to be what i want, cause it seems to be the only option that has a chance of working

#

sorry if i sound a bit upset, i tend to get fustrated at the lack of info about dots stuff

devout prairie
#

the joints do work, maybe you need to do some testing with a really simple setup

devout prairie
late mural
#

my setup is a cube, that i want to rotate in the z axis, and cant move, and cant rotate any other ways, dont think i can get simpler

devout prairie
late mural
#

what?

devout prairie
#

( or building entirely from code )

late mural
#

neither

#

i didnt even know there was some place you can tick

devout prairie
#

could you do a simple step-by-step of what your game is doing when you hit Play

late mural
#

to do with the cube currently, nothing

devout prairie
#

ie 1 - Instantiate(myPrefab) etc etc

late mural
#

oh ok

#

it istantiates a bunch of spheres, which hit the cube eventually

#

the cube should rotate, in a similer fashion a gear would,

#

usually i would use rigidbody constraints, and while im converting to dots, im trying to get the same thing to happen basically, but constraints seem to be a whole lot harder to do and to get information about in dots

devout prairie
#

what method are you using to convert the spheres and cube to dots

late mural
#

the component

#

although the spheres get instantiated once the prefab is converted to dots

devout prairie
late mural
#

the entity component

#

i know there is some fancy method with subscenes, but only a few parts of my game need dots, so for now im just manually dragging on the component when it is required

devout prairie
#

could u show which entity component i'm not really sure what u mean tbh

late mural
#

this one

#

sorry for being vague

devout prairie
#

Ahh sorry ok

late mural
devout prairie
#

could you show what your cube looks like, the components that are on it

#

joints and whatever

late mural
#

well when i said cube, i didnt want it to seem to fancy, it is kinda 4 cubes combined to look like a gear, but hopefully that shouldnt affect it, and ye ill send the screenshot

devout prairie
late mural
#

here are the screenshots, and thank you i shall try that out

devout prairie
#

so what to do with your setup is:

late mural
#

oh ok

devout prairie
#

remove all the convert to entity components and the physics shapes

#

and physics bodies

late mural
#

ok

devout prairie
#

select all the spokes of the cog, and just apply BoxCollider to them all

#

the parent object, apply a Rigidbody component

late mural
#

ok

devout prairie
#

add a ConfigurableJoint to the parent

late mural
#

ok

devout prairie
#

Set it like this:

#

basically just zero out the Anchor values, and set those Locked/Free fields

late mural
#

oh ok thank you so much!

#

ill try that and report back!

devout prairie
#

wait

late mural
#

oh?

devout prairie
#

also click ConvertToEntity at the top of your parent:

late mural
#

oh ok, guessing that is like a simpler way of converting it without using the component?

devout prairie
#

that will auto add the ConvertToEntity component back on

#

yeah

late mural
#

ok thanks, ill try all that and report back!

devout prairie
#

alright

late mural
#

yas it works! i have gears now and they spin so nicely!!!!

#

and i even skipped one of your steps cause i had a feeling i could get away without it, and i was right i could, surprisingly

devout prairie
late mural
#

yup it looks exactly like that thanks so much!

devout prairie
#

probably change from Free to Fixed on the axis you don't want to spin, i figured you'd work that out

late mural
#

yup i did lol

solemn hollow
#

@robust scaffold I need to make a correction to the fix of yesterday. The main problem with the shader was the alpha channel. the UV coordinates of the alpha texture where fucked up because the texture was packed in a sprite atlas. thus everything got transparent. in my chaotic debugging it seems like i randomly changed the alpha texture to an unpacked one and thought it was the maintex making the diffrence.
This is a related Bugreport: https://issuetracker.unity3d.com/issues/shader-graph-uv-node-uses-whole-sprite-atlas-uvs-instead-of-individual-sprite-when-entering-the-play-mode
Weird design choice TBH

#

sry for ping but this seems good to know about

#

I still dont get why it worked for gameobjects though

robust scaffold
robust scaffold
solemn hollow
#

not sure what blocked me from using V2. maybe i should switch too

#

anyone encountered this error when updating to 2021 and entities 0.51? :
(0,0): Burst error BC1310: The pointer arguments may alias with each other where it was expected that they do not alias.

#

While compiling job:
Unity.Entities.JobEntityBatchExtensions+JobEntityBatchProducer`1[[Unity.Entities.Tests.EcsTestSetComponentValueTo10, Unity.Entities.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], Unity.Entities, Version=0.0.0.0, Culture=neutral,.....

robust scaffold
#

it shouldnt

solemn hollow
#

it does 😦

#

im using the apple silicon editor version so that might be why nobody else encountered it yet

#

no idea if that could lead to different aliasing logic than the normal Editor

robust scaffold
#

2022 has a new loading screen:

robust scaffold
solemn hollow
#

im on 1.7.2 since tertle said they fixed the burst cache error only on this version

#

why are you on 2022 now 😮 always one step ahead of compatability? 😄

robust scaffold
solemn hollow
#

ah i see. how much is broken in 2022?

robust scaffold
#

well, lets see

solemn hollow
#

ah first time opening it? good luck!

robust scaffold
#

i know the source generator definitely wont work so i'll need to toggle it off

#

come on bot

#

well, 0.51 doesnt work

solemn hollow
#

😦

robust scaffold
#

well it was a long shot, i guess i have to stick with 0.17 with a fixed job package

solemn hollow
#

i hope it wont take ages to get entites back to newest official releases... i fear its after 1.0

robust scaffold
#

Well fuck, guess no more entities. Gonna have to roll my own for now

misty wedge
#

0.51 seems kind of borked, pretty sure they said they pushed it out too early

misty wedge
#

I don't think so, it had a ton of issues. I guess it depends on the project

robust scaffold
#

I dont see anything wrong with it... i only had 1 system and 1 job.

solemn hollow
robust scaffold
misty wedge
#

Why do you need 2022 support?

robust scaffold
#

Huh, jobs at least compiles in 2022

#

fuck, no

#

yea, jobs uses some code gen internally and that is borked in 2022. Shame

misty wedge
robust scaffold
#

oh well, i guess i'll roll with IJob and IJP

robust scaffold
# misty wedge I thought I remembered reading something about it having some issues, is it safe...

https://forum.unity.com/threads/experimental-entities-0-51-for-unity-2021-is-available.1296198/
IL2CPP doesnt work and changes to code gen'ed scripts might require closing unity, deleting the code gen folder in the cache, and restarting

#

I've had the code gen issue myself occasionally. And I just toggled the project to use mono.

#

otherwise it works pretty well

misty wedge
#

Do mono builds works for ECS? I thought I remember reading ages ago it doesn't work

#

Never checked again

robust scaffold
#

it works, just not as "fast" as il2cpp. Mono will always be rock solid in terms of stability. Just not the fastest

misty wedge
#

I'm probably confusing it with something else then

devout prairie
#

stupid maths question:

#

how do i do Quaternion.Inverse, but in dots

#

lower case 'quaternion' doesn't have inverse

#

when i look up stuff i normally take for granted, like 'find the inverse of a quaternion':

robust scaffold
devout prairie
misty wedge
#

I don't think that part is open sourced

devout prairie
#

i just get a stub from metadata when i 'go to declaration' in VS

robust scaffold
#

hrmmmmmm, nothing is rendering for me in 2022 for a empty project with a single quad.

#

the camera though works, just not scene view

robust scaffold
#

Oof, guess not

#

Convert from lowercase quat to uppercase, use this method, then convert back to lowercase

devout prairie
robust scaffold
#

Depending on how they're packed in the struct

#

This is fun. I have to basically turn off urp, make any scene changes, then turn it back on and i have no clue why

devout prairie
robust scaffold
#

URP off

#

BRG doesnt seem to actually depend on a rendering system. So I might just stick with built in for now

#

Yea, no issue with building and running

#

The scene view camera is just fucked. Fun

devout prairie
#

It's the universes way of telling you to go back to 2021 and continue your journey fixing the dots thing 😛

robust scaffold
#

i refuse

devout prairie
#

between a rock and a hard place

misty wedge
#

Are your performance requirements that tough that you need the new API?

robust scaffold
#

well kinda, there's a current performance limit of 500 lights on a single view screen currently, which is sad.

#

The limit is 8000. 500 is not even anywhere close to it

misty wedge
#

That's why I only ever go for 499 lights in my design, so I have room for 1 more in case I need it

robust scaffold
#

i want at least 2000 while maintaining 60fps rendered at once to camera

misty wedge
#

That's a lot of lights

robust scaffold
#

there can be many more just not in view

#

i want a bullet hell like game with every single projectile is a light renderer

misty wedge
#

So a light hell game, I dig it

robust scaffold
#

this is with pixel perfect circles. If i reduce the rendering resolution to 1/10 the dimensions (so 100x less pixels rendered), i can maintain about 8,000 light sources on the screen at 350fps. But I want full screen resolution lighting

#

clearly, improvements are required

devout prairie
#

a shot in the dark here but i don't suppose using VFXGraph particles would circumvent the limit no?

robust scaffold
#

if there was no shadow blockers and it was just a direct application of a spherical light into the camera, 8000 lights can render at 350 fps as well no issue

#

none of those lights reach a shadow caster so it renders CPU limited

devout prairie
#

pain

robust scaffold
#

Found the issue for the urp renderer at least

#

Disable post processing. Seems to break the scene view

devout prairie
#

same with math.mul() for multiplying quaternions ( or float4x4 etc )

#

i had written this but not really sure if it was fully 'correct':

frosty siren
#

Has dots any workaround for using inherited authorings inside ConversionSystem? Say i have BaseAuthoring and two inheritors, so i want to write ConversionSystem which will work with any inheritor.

robust scaffold
#

@covert lagoon Shaders actually pull float3x4s for local to world and similar matrices that are populated into 4x4 slots on the GPU.

#

Im digging deep into the rendering engine

#

Local to world scalar matrices are converted first to float3x4s (equivalent packed structs) then sent to the GPU

#

At least SRP shaders do so.

devout prairie
frosty siren
solemn hollow
#

you can use generics in jobs

frosty siren
#

there is no jobs in use in conversion systems

#

i mean it can be, if you handle huge amount of data, but those system mostly works with gameobjects and theirs monos

rustic rain
#

with virtual Convert?

frosty siren
#

No. there is a need to work with query, not individual entities. All simple conversion i keep in IConvertGameObjectToEntity comps or just [GenerateAuthoringComponent]

rustic rain
#

other scary thing you could try: reflections xD

#

you do query through Transform component to get literally all convertable objects

frosty siren
#

Last thing i want to do, because there are tons of reflection use in my project lol 🙂

rustic rain
#

and then you grab all of them that have components that inherit what you want

#

and then you have GameObjects

#

with ability to get primary entity from them