#archived-dots

1 messages Β· Page 123 of 1

fallow mason
#

but at .5 you are also at the beginning. dont forget πŸ˜†

pliant pike
#

I know its confusing, it calculates it so its in a single curve

#

in a spline of 24 I think there's about 60 odd curves I think

warped trail
#

so, where are you tracking your curve number?

pliant pike
#

var Curvecount = (booked.Bezzypoint.Length - 1) / 3;

#

using that from a blobasset with all the curves in it

warped trail
#

this is local variable it is same at every frame

#

it does not change at all

pliant pike
#

I hope so Blobs aren't supposed to change

warped trail
#

so the only way you can calculate your position on spline is through floatVal ?

pliant pike
#

yeah if I want to use it for each individual entity

warped trail
#

you are linearly incrementing floatVal ?πŸ˜…

#

so if your floatVal = 0.5 next value should be floatVal + timedeelta

pliant pike
#

yeah, don't worry about it, I've got to stop before I fry my brains completely πŸ˜†

warped trail
#

but in 1 frame you went from 0.5 to 0

pliant pike
#

of course leahYTHO

#

I think I've got it now dammit your right

warped trail
#
floatVal = math.saturate(0.5) * 24; //curve number 12
floatVal = math.saturate(0) * 24; //curve number 0```
pliant pike
#

I need another fricking variable

opaque ledge
#

πŸ˜„

pliant pike
#

I'm such an idiot leahYTHO

opaque ledge
#

you probably should pay to Druid πŸ€”

pliant pike
#

you can have all the moneys πŸ˜†

warped trail
#

omg im richπŸ€‘

pliant pike
#

it works leahYAY

#

only took me several months, thanks a lot for that @warped trail

pliant pike
junior fjord
#

very cool, did you also make the editor tool for the curve yourself?

pliant pike
#

no I co-opted it from Catlike codes tutorial

junior fjord
#

ah yeah, his tutorials are nice

pliant pike
#

it converts all the needed data into entities form though

junior fjord
#

yeah looks really good

junior fjord
#

oh cool, if you want dots to manage the job dependencies for you when writing to nativearrays you can just pass in tag components with read/write access to them

#

never thought of that

#

ah no ok it does not seem to work

coarse turtle
#

@pliant pike looks good πŸ‘

gusty comet
#

anyone on 2020.1.02b with the newest dots packages? Editor is crashing like every 5 min

#

rolling back to 2019.3 now

dull copper
#

I am

#

regular DOTS use seems pretty solid, there's been occasional crashes but I've grown used to them on preview techs

#

but nothing like crash every 5 or even 30 minutes for me

#

that being said, you can't even use latest dots packages in combination atm :p

#

but you can use latest entities, physics and hybrid renderer together

digital kestrel
#

ecs + hybrid renderer + hdrp = 30 fps

#

all im doing is spawning 1 entity per second

dull copper
#

I'd really encourage testing that on actual build

#

editor has huge overhead in DOTS

digital kestrel
#

yeah i plan to do that

#

makes development a bitch

#

long ass compile times too

dull copper
#

their DOTS shooter sample ran like sub 30fps on my high end rig in editor before I disabled every debugging thing there

#

it's fine on actual build

digital kestrel
#

which one

#

the multiplayer one?

dull copper
#

yeah, the "DotsSample"

digital kestrel
#

ok

dull copper
#

the one they presented at Unite CPH

digital kestrel
#

there was another one too

dull copper
#

yeah, not talking about fps sample now

digital kestrel
#

where the guy did a spreadshot and shot snakes

dull copper
#

no idea what that means πŸ˜„

#

also if you want to speed up builds, use mono backend

#

il2cpp adds quite a lot to the build time

#

initial build can also be quite a lot slower

#

iterative builds should be a lot faster

#

more cpu cores does help on the build tho, especially with HDRP

digital kestrel
dull copper
#

my 12-core rig still maxes 100% while compiling HDRP shaders

digital kestrel
#

thats the one i'm talking about

#

i have an 8 core rig

dull copper
#

it shouldn't be that slow then

digital kestrel
#

ryzen 2700x

#

it takes like 20-30s per saved change

#

and i only have like 5 scripts

dull copper
#

but if you compare to old stock unity builds..

#

having used other engines, I don't really think these build times are bad at all πŸ˜„

digital kestrel
#

i'm talking about compilation in Unity editor not build

dull copper
#

oh

#

well it definitely shouldn't take that long

#

it's like few seconds at most for me

digital kestrel
#

i have no idea why

dull copper
#

there's a really long entry time for play mode though unless you've disabled the domain reload and stuff

digital kestrel
#

how do i disable that

dull copper
#

and even then it's stalling on the first run

digital kestrel
#

what's domain reload?

dull copper
#

as another note, I don't get why they didn't "fix" this on the new build system:
UnityException: Build path contains project built with Mono scripting backend, while current project is using IL2CPP scripting backend. Consider building your project into an empty directory.

#

it autogenerates the build path, would have been trivial for them to add suffix for mono and il2cpp builds to separate them

#

it's not a big thing, just annoying that you have to manually clear folders now if you want to test different backends

#

re: framerate with dots + hdrp in the editor... I get this in the editor with postcard size game view:

digital kestrel
#

which gpu do u use

#

i get 30-60

#

do u use hybrid renderer

dull copper
#

yes, hybrid rendering v2

#

I'm on rtx 2070 super

#

it's a relatively simple scene

digital kestrel
#

version 2?

dull copper
#

if I run same without HDRP, I get like 1300fps

#

but it's kinda pointless to compare built-in to hdrp like that as there's obvious overhead on hdrp that you pay up front

digital kestrel
#

im getting weird flashes

#

when i walk near a sphere

dull copper
#

?

digital kestrel
#

after downloading hybrid renderer

#

my screen goes starts flashing with a closeup of a sphere then turns black

dull copper
#

hybrid rendering has always been bit sketchy

digital kestrel
#

then renders normally before flashing again

dull copper
#

v2 is supposed to make it better

#

you also very much need 2020.1 for it

digital kestrel
#

how do i get v2

#

i only see 0.4.0

dull copper
#

it's included in 0.4.0

#

you have to manually enable it and use HDRP from github though

#

they've said you also need 2020.1.0b3 but it seems to work on b2 already

#

b1 was completely broken with it

digital kestrel
#

im only 2019.3

#

lol

#

the moment i start spawning entities

dull copper
#

yeah, you can't get this there, it won't be backported

digital kestrel
#

the frame flashes and blackouts start happening

#

ugh

#

why are ppl bothering with dots

#

too many breaking changes

#

you can't build anything with it

dull copper
#

everything you try is in preview, besides burst + jobs

#

and yeah, DOTS has been pretty rough so far

#

it shows great promise but it's not for people who enjoy smooth ride πŸ˜„

digital kestrel
#

yeah i mean u can't build a major game around it

#

with how many changes there are every month

dull copper
#

you are not forced to update to latest all the time :p

digital kestrel
#

I think it's easier to incrementally change

dull copper
#

that being said, I wouldn't even consider "old" hybrid rendering at this point

digital kestrel
#

than to overhaul when u realize u hit the limit of your current version

dull copper
#

pretty sure they'll just slowly deprecate it now

digital kestrel
#

old hybrid is what i'm using right?

#

on 2019.3?

dull copper
#

yes

#

you could just do rendering on gameobject side and have nicer experience

digital kestrel
#

it took me like 1-2 hours

#

to realize that i even needed hybrid rendering package

#

wdym rendering on gameobject side

dull copper
#

it's what I'll probably do unless they really get things sorted on hybrid rendering v2

#

well, I already did it before they said there will be better version of hybrid rendering :p

digital kestrel
#

oh right, hybrid ecs

dull copper
#

yeah, just sync your entities transforms to gameobjects, do rendering the old way

#

no need for hybrid rendering package at all

#

and get rid of most rendering issues

#

the old hybrid rendering wasn't even all that fast on most cases

#

it just made it more convenient to use with dots

#

hybrid rendering v2 should be something else, even on perf side

digital kestrel
#

my game idea requires good rendering perf on large number of entities

#

10-20k ideally

dull copper
#

then 2020.1 it is

digital kestrel
#

ok

#

thanks for letting me know

#

I was getting pretty frustrated lol

dull copper
#

do note that the hybrid rendering v2 is now on first public preview and we still miss the first official HDRP package that supports it

#

so it's super early

#

can really judge it better during spring while it matures

digital kestrel
#

that forum link u posted said the packages were not released

#

do i have to build SRP from scratch

dull copper
#

like mentioned here + on the forum thread, you can use it from github master branch right now

#

if you need everything through package manager, you have to wait for HDRP package that supports it

#

I think they are working on 9.0.0 release so should arrive in few weeks

#

9.x still works on 2020.1 but I can imagine they move to 2020.2 at some point as that's the end target for this years cycle

#

I've been using HDRP directly from github for years now myself so it's not a big deal for me, I'm totally used to testing their wip stuff there

digital kestrel
#

I'll wait for official release then and use Universal Pipeline in the meantime

dull copper
#

URP on current (old) hybrid is kinda subpar too

digital kestrel
#

i see

#

do u know when dots gets released officially

#

i dont mind dealing with source

dull copper
#

entities package is supposed to release this year

#

but for the rest of the DOTS packages... who knows

digital kestrel
#

i just feel like my time would be better spent on other things while they release newer versions

dull copper
#

they originally said they plan for surrounding DOTS systems to be "ready" by 2022

digital kestrel
#

wow that's a long time horizon

dull copper
#

but looking at the time they've taken for these so far, I wouldn't expect that to hold

#

so expect more like 2024 πŸ˜„

digital kestrel
#

i'll be old by then

#

i mine as well write a custom engine

dull copper
#

or... use more of the things that actually work already

#

and only use ecs for the parts that are fully functional

digital kestrel
#

that's my plan as of now lol

dull copper
#

that only covers the core of ecs though

#

and none of the rendering, audio, physics etc packages

#

also that was from Unite CPH roadmap, which was presented last september

digital kestrel
#

I'll survive i guess

#

my timeline is just as long as their dots timeline

#

πŸ˜›

dull copper
#

we'll get new roadmap next weeks wednesday when they do roadmap stream

#

would have gotten it on GDC otherwise but we all know what happened to GDC

digital kestrel
#

lol

#

rip in peace

#

i wonder if siggraph will get canceled

dull copper
#

rest in peace in peace πŸ€”

digital kestrel
#

it's a meme

dull copper
#

anyway : ```md
You can learn more about this in the two roadmap sessions that we have planned for the coming weeks. Subscribe to the Unity YouTube channel, so you don’t miss them.

  • Wednesday, March 25 – Core technology and workflows
  • Wednesday, April 1 – Cloud services for operating games
#

that 25th stream should cover dots too

digital kestrel
#

nice

#

sounds good, I'll try to watch it

#

anyway, gtg bed, thanks for the info dude πŸ™‚

dull copper
#

kinda weird that they didn't give any time of day for the streams yet

#

np

opaque ledge
#

i am kinda curious about visual scripting, iirc they said 7th experimental drop will be in end of this month

#

perhaps they will show something about it on upcoming stream

dull copper
#

I keep forgetting that thing exists

#

not a huge fan

#

but if they do it right, at least there will be unified workflow there that's unaffected by underlying api changes

#

that's one of the big benefits of most node graphing tools, you noodle the graph once and it's super simple to update to future versions and the graph api rarely changes (usually you just get additions to it)

#

on code API, things evolve a lot more

#

this applies to all graphs I've used, including shaders and regular code

opaque ledge
#

i dont think its much of a problem when underlying API changes (but perhaps i am saying this because i dont have any projects going on anyway) the reason why Entities changes so much is because its preview right ? shouldnt be much of a change once its out of preview

dull copper
#

nah, that has nothing to do with entities now

#

it happens on ALL code that have node graph abstractions

#

code api always changes more

warped trail
#

after reading a lot of complains on forums a have a feeling that out of preview does not mean anything πŸ˜…

dull copper
#

you can't change how the graphs work fundamentally on each realease

#

also, fully expect Entities 1.0 and 2.0 code API too look totally different

#

as an example, if you've used shader graphs, maintaining a SG between say, 4.x HDRP and 8.x HDRP is trivial, it mostly loads on 8.x and just works when you resave it there

#

but if you wanted to upgrade 4.x HDRP shader manually to 8.x HDRP... that's pain for days and no guarantee of success

#

basically everything has changed under the hood

opaque ledge
#

ah i see, yeah i understand

dull copper
#

if you look at unreals blueprints, they have been pretty much unchanged throughout the years (if you forget about the big change on ue 4.7 when they added scene and actor components to it), they just keep adding functionality to it

#

their c++ api does change on each release still

#

despite the engine framework being "stable" for years

#

so if you have a c++ code project there, you are likely to need to modify things on each major version but if you use their blueprints, you usually just open the project and it runs

#

@warped trail tbh lately seen "out of previews" have almost all been rushed

#

I dunno why they do it for packages but still delay engine releases if they are too bugged

#

well, they do delay the packages sometimes too but usually that happens on earlier stage of the development, not when they are still polishing it and can't get it polished enough

#

like for example, HDRP went through a major restructure between 2019.2 and 2019.3 when you'd expect them to just stabilize it on that point (just before full release)

#

you don't have to be a genious to know that things will inevitably break when you do such move and now they've been patching it up on these following 7.x releases

#

I do love the HDRP and their team tho, huge respect to them, just feel they had to push to release too early because it was on the roadmap

vagrant surge
junior fjord
#

If my ground looks a bit like this (from catlikecoding tutorial), how would I make player colision with the ground work? Do I estimate it right, that the easiest thing would be not to have the ground in the physics system at all, but just use my heightmap I have somewhere to check that nobody drops through the ground?

opaque ledge
#

do they actually collide or do you just want to check stuff ?

#

if latter you can use trigger

#

if former than i think you should make your ground static

junior fjord
#

@opaque ledge well I just want the things to not drop through the floor basically

opaque ledge
#

go with trigger then and set the collision filters properly, they both need to want to collide with each other

junior fjord
#

what do mean with want to collide with each other? I am pretty new to physics stuff, I normally start off with writing some simulations and never come to the actual gameplay πŸ˜„

#

but the quarantine seems to have some positive sides too πŸ˜„

#

ok so I make the ground static since it does not move. Can I use the mesh I calculated for visibility also for collision?

opaque ledge
#

or just go with "everything" if in doubt πŸ˜„

#

there is a collision filter in phsycis shape, you will see belongs to and collides with, you have to set them properly

#

sorry, discord is acting up 😦

#

yeah perhaps, i dont know, i never used it for 'complex' scenarios

junior fjord
#

hmm somehow I think just saving the height somewhere and checking height < position may be cheaper?

#

since I would have all these gigantic physic colliders which are quite complicated oterhwise?

opaque ledge
#

sure, i suppose so, but idk trigger seems easier

#

imo, just make it work, you can worry about performance later πŸ˜„

junior fjord
#

yeah probably thats the right way πŸ˜„

sour ravine
#

@vagrant surge yeah that's parallelism 101 /shrug

#

Remove Kebab Contention of Shared Resources

vagrant surge
#

not exactly lol. look at both unity and unreal

sour ravine
#

I never said they made a good call

vagrant surge
#

they both have game thread, render thread, and then helper workers

sour ravine
#

just that it's an obvious application of shared resource contention best practices

#

granted you can blame OpenGL for some of that

#

(i.e. needing a 'main' or 'render' thread)

#

using statics or thread-local variables are whackable offenses imo

vagrant surge
#

vulkan doesnt need that

#

on vulkan you can push stuff to gpu from any thread

safe lintel
#

Thought it was interesting they got rid of megatexture completely too

vagrant surge
#

less need with bindless texture

#

one big point with megatextures, is that you dont need to bind textures per drawcall

#

and can go crazy aggresive on the batching

#

but if you are doing bindless textures, you can do that same super-aggresive batching without megatextures, which is what i believe they do

dull copper
#

are we talking about virtual texturing now?

bright sentinel
dull copper
#

kinda curious what's the plan of the VT with DOTS in general, I haven't even asked the staff as I just expect: not going to be supported this year, like for everything else πŸ™‚

#

that sparse texture thing is old thing in Unity, I don't think it even works for anything but terrain in practise

#

there will be virtual texturing support for terrain too

#

what's more interesting is how they plan to integrate all these things

#

so far the take has been: "we dev these all in isolation, no support with other in-development techs"

#

so, nothing functional on mixing new fancy techs for following years now

#

I just feel it's really bad way to dev for techs that need to play together eventually

#

like, they first design the thing taking old systems constraints into account and when it's done, they start to wonder how they and integrate it with a thing that's already been in development for years before this new thing was a thing

#

it feels just... very shortsighted

#

this happened already with addressables for example, and input follows but it's not as bad in practise

#

and now with all rendering techs like virtual texturing and raytracing + hybrid rendering on dots

#

well, I don't really know the state of VT with hybrid rendering though for sure, haven't tested it

#

DXR for sure doesn't work properly with either VT or hybrid renderer v1 or v2

vagrant surge
#

VTs with raytracing are a massive issue

dull copper
#

people doing visualizations would want both

#

but it's not on the table this year (already asked)

vagrant surge
#

sure, but raytracing just doesnt mesh well with VT as a technique

#

needs the core algos of VT to change quite a bit

dusty scarab
#

Would diep.io be a good first project to make in dots?

dull copper
#

no idea what that means

dusty scarab
vagrant surge
#

if you mean in singleplayer, then yes

gusty comet
#

no

#

my first one was cubes

#

just cubes

dusty scarab
#

Yep! Single player with some just npc bots basic things

gusty comet
#

and then cubes with physics

#

then i stopped cuz i was just wanting to test what this dots stuff means all this time

vagrant surge
#

physics in DOTS is advanced lmao

#

due to the physics stuff being kinda tricky

gusty comet
#

idk i just added physics for dots package

vagrant surge
#

there is a unity tiny sample for a space shooter

gusty comet
#

then slammed some physics related stuff on those cubes

vagrant surge
#

you can use that as base and add other ships with some basic AI and extras

gusty comet
#

and it worked ℒ️

opaque ledge
#

Has anyone encountered an issue with Get/SetComponent ? for some weird reason, i do GetComponent to get the value of an entity, i process and write to it and do SetComponent to write it back but it gives me error that i should declaret it ReadOnly

#

it works with normal GetComponentFromEntity, but not otherwise

#

oh well 🀷

stark pulsar
#

I'm trying to wrap my head around the ECS concepts... Im following the PONG tutorial but without using the Physics system.

#

Now in my "Ball" code i would need to check for collisions with either paddle...

#

But i can't just pass in the left and right paddle like this because they both use the same component data

#
Entities.ForEach((ref Translation t, ref BallMovementData data, in PaddleInputData leftPaddle, in PaddleInputData rightPaddle) => { ... }.Run();
vagrant surge
#

you need one foreach inside another foreach

#

your outer foreach is the "ball" foreach, taking Translation and BallMovement, this iterates the balls in your game (if you have muleiple)

#

your inner foreach iterates the paddles, you dont need to separate left and right, just grab PaddleInputData + Translation

stark pulsar
#

@vagrant surge thank you I will try that

vagrant surge
#

you are trying to access the paddles in the same foreach as the ball, thats a big mistake

#

the foreach loops over entities that have those components

#

one at a time

#

if you want to access multiple entities you gotta need the nested foreaches or other ways

zenith wyvern
#

@opaque ledge Were you doing Schedule (not ScheduleParallel) in both cases? You cant write to a cdfe from a parallel job unless you disable safety

stark pulsar
#

@vagrant surge what if i need access to both at the same time ,say i have to compare values between left and right paddle, could i get an array of them insteed of having to use a second ForEach()?

opaque ledge
#

yeah its parallel, but i thought it would disable it automatically

#

so i am stuck with GetComponentFromEntity ?

zenith wyvern
#

Since the Get/Set functions give you no container to disable safety on then yeah

opaque ledge
#

i thought codegen could have just detected that and handle things for me 😦

zenith wyvern
#

I think it's better to force you to be very clear if you are disabling safety checks

opaque ledge
#

yeah, thats a fair point

#

i am just too pro to think of that 😎

slim nebula
#

a new weekend, a new set of horrible package update errors

#

anyone by chance have some quick solution before I spend half the day digging again? 😦

warped trail
#

try delete Library folder?πŸ€”

stark pulsar
#

also Entities.ForEach() doesn't seem to support nesting... E:\Projects\unity\PongECS\Assets\BallMovementSystem.cs(39,13): error DC0029: Entities.ForEach Lambda expression has a nested Entities.ForEach Lambda expression. Only a single Entities.ForEach Lambda expression is currently supported.

opaque ledge
#

yep, it doesnt

vagrant surge
#

there is some nesting on unity tiny projects

#

is it a different foreach?

opaque ledge
#

you can create entity query and do ToEntityArray, and access stuff using that entities in your 2nd job

stark pulsar
#

that seems kinda overkill if you have exactly two of one kind. but I will try it. Maybe there is some sort of tagging that people would use?

opaque ledge
#

ComponentSystem supports nested for each but ComponentSystem runs on main thread, and supports no parallelism so its used for debugging purposes, and its also getting depracated if itsnt already

vagrant surge
#

run 2 foreachs then @stark pulsar

#

first foreach copies the bounds of the paddles to an array

#

second foreach calculates bounce

opaque ledge
#

yep

stark pulsar
#

then i would have to allocate memory each frame?

slim nebula
#

I seem to be past that error now drUiD thanks

#

^is this kind of thing normal with package upgrades?

#

just unlinking all my shit?

#

as my project gets bigger this will become very annoying....

vagrant surge
#

yes, its quite common

slim nebula
#

jesus.....

vagrant surge
#

upgrading anything in unity is.... dangerous

slim nebula
#

that's kinda rediculous

opaque ledge
#

thats why you take a backup before upgrading

slim nebula
#

i mean it's in git, yea but

#

what do I do, manually write an upgrade application to deal with theses issues?

#

or do it manually every time?

opaque ledge
#

tbh i never had that problem when i upgraded to 2020 from 2019.3

slim nebula
#

ok this new version of 2020 seems to just crash every 5 seconds

#

😩

#

got all muh errors fixed at least

opaque ledge
#

it was opposite for me, it gave me a not-existant error so i had to downgrade

slim nebula
#

so I just looked at the prefabs

#

it like deleted the references for no reason

#

the .prefab file is identical now that I hooked it up again

#

rofl

#

whatever......

amber flicker
#

@slim nebula pretty common issue to e.g. upgrade and find all references lost - be sure to not save anything and restart the editor. If that doesn't work, try selecting all prefabs and reimporting. That usually fixes anything for me but of course if you're really unlucky you'll get problems even after doing that.

slim nebula
#

ok. I can try those for next time thanks

#

also I can jsut git revert the .prefab files

amber flicker
#

99/100 restarting editor works for me

slim nebula
#

cool.

#

ok

#

πŸ˜„

slim nebula
#

ok. new episode of mr simoyd's stupid problems

#

tryna get VR workin with dots lol

#

so

#

I"m not sure if this is the right place to ask but

#

we'll see

#

the camera is a gameobject and.... it looks like this "Tracked Pose Driver" is updating the position and rotation on the gameobject's "Transform"

#

the rotation is coming through, but the Position is not

#

I'm guessing I have to somehow get that data into DOTS? or something?

#

or am I wildly confused

#

something something hybrid renderer

#

ignore eveything I said. the position is working fine now.. not sure what I did

#

reeeeee

dull copper
#

hmmm

#

this was supposedly the biggest perf gain to get when running DOTS Sample in the editors play mode

#

(to disable that)

mint iron
#

doesnt that mean you cant debug from visual studio though

dull copper
#

you'd think yes, but the option sure is gone now πŸ˜„

#

The most impactful is to disable editor attaching (the ability to attach a debugger to the editor). You can do that in Editor > Preferences > External Tools.

#

I just tried it on 2020.1. When trying to attach debugger from VS to Unity 2020.1 editor, I get this popup:

#

I don't remember that being a thing before

#

so I guess they try to disable it by default and only enable it on demand?

#

that being said, when I said switch to debug mode and tried to run the project, editor just silently crashed to desktop πŸ˜„

low tangle
#

classic unity

dull copper
#

it did work on the next try

#

so it's not completely broken

#

I guess stuff like this is what people meant by 2020.1 crashing all the time :p

#

I can't remember seeing these before either

opaque ledge
#

yeah its 2020.1 stuff

dull copper
#

other icons are for: cache server, lighting tab and background tasks

#

well, this explains why the editor attaching option was removed

#

it's also more obvious what the gain is now

digital kestrel
#

ok so the visual buts

#

bugs* were because i was using dx12

#

does anyone know how to enable fullstrack trace?

A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.
safe lintel
#

Jobs>LeakDetection> FullStackTraces

digital kestrel
#

nice thanks

spring hare
#

Anyone know of a place (discord or otherwise) where people talk about non-Unity-specific data oriented stuff? I'm looking into how archetype ECS do component array mapping during system iteration of each normalized set of arrays (looking at flecs source code at the moment)

#

Each chunk or set of arrays has the component arrays in some order. We know how entities map to components by offset within a chunk, but out of a set of component arrays in a chunk a system will often want to iterate some subset

#

So there's got to be some mapping, on a per chunk basis, to the actual offset of each component array

#

Trying to get a sense of if there's a common approach to that, and I'm not sure if this is the best place to ask since this channel is generally Unity DOTS related but I haven't found a ton of other places on the internet where people discuss this kind of stuff.

digital kestrel
#

I convert my Player and Ground gameobjects to entities, but my instantiated entities only collide with ground

#

any thoughts?

digital kestrel
#

got it, when you inject gameobject entities, you need to build the system to sync the go and entity together

frail seal
#

Is it possible to run ComponentSystem outside of main thread?

#

I need to update it OnAudioFilterRead

#

But when I do that by calling a new function specified within my ComponentSystem, I get an error

#
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.```
hollow sorrel
#

not sure if you can run componentsystem.update out of main thread but that exception looks like you're trying to schedule a job from it which won't work regardless

#

jobs can only be scheduled from main thread

frail seal
#

Oh right, I do run Entities.ForEach after all

#

Hm, I guess then I will need to store data I need to pass and then transfer it when filter read is called

#

Welp, thanks

vagrant surge
#

@spring hare you can look at how my own ECS does it https://github.com/vblanco20-1/decs/blob/master/src/decs.h#L407 . I hold an array on the archetype that contains the offsets, so i just linear search that one to find the comp i want. Could be improved through hashmap, but its really not so easy

#

and btw, Flecs has its own discord, so you can ask the creator there

gusty comet
#

Hi there! I'm having some performance issues with ECS rendering, specifically UpdateDynamicRenderBatches and adding new batches. Am I missing a component or something on my rendermeshes? (Using legacy pipeline)

opaque ledge
#

basically, render mesh v2 sucks xD

#

hybrid renderer v2 comes with 2020.1b3 if you want to upgrade to beta, but it also requires URP and HDRP 9 which hasnt been released yet, beta hasnt been released yet either

#

and it only works with SRP(so URP and HDRP), it isnt supported on built-in renderer

dusty scarab
#

In the Unity Pong tut,
I'm doing

but I get the following errors:
ArgumentNullException: A valid BlobAssetStore must be passed to construct a BlobAssetComputationContext
NullReferenceException: Object reference not set to an instance of an object

I'm pretty sure it has something to do with me passing null into BlobAssetStoreType. What should I be using instead?

#

Some weird behaviour then begins to happen to my ball which was working fine before I instantiate it via script

lusty otter
#

What to do about the 0.8.0 compile error?

#

Upgraded just now, thought it would've already been fixed.

#

I don't use subscene or live link, whatever that thing is.

warped trail
#

what kind of errors do you have?πŸ€”

lusty otter
#
Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\LiveLink\LiveLinkPlayerSystemGroup.cs(32,59): error CS0117: 'SceneSystem' does not contain a definition for 'GetBootStrapPath'
Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\LiveLink\LiveLinkPlayerSystemGroup.cs(53,48): error CS0103: The name 'bootstrapFilePath' does not exist in the current context
warped trail
#

have you tried to delete library package and reimport everything? πŸ˜…

opaque ledge
#

yep, please do that πŸ˜„

lusty otter
#

Oh okay

#

Do I need to delete the package then install again, or just reimport all?

warped trail
#

just delete Library folder and restart editor

lusty otter
#

Holy, that folder is 1.5 GB big.

opaque ledge
#

Unity will basically re-create your project

frail seal
#

How do I improve foreach iteration speed when I need to run foreach loop over 307'200 times per second?

coarse turtle
#

@lusty otter you need to modify two classes to get it working

opaque ledge
#

do ScheduleParallel

frail seal
#

Currently it is laggy even at level of 2-3 entities.

coarse turtle
opaque ledge
#

are you using ComponentSystem ?

frail seal
#

Yeah

#

Parallel iteration won't do anything for me, it lags even with few entities.

opaque ledge
#

dont, that only runs on mainthread, you wont be able to use jobs at all, and no parallelism

#

just change it to SystemBase

frail seal
#

Why SystemBase?

opaque ledge
#

thats the newest system, and it will be supported, other types wont be supported and will be depracated

#

ComponentSystem was used at... 0.1, 0.2 perhaps ?

frail seal
#

I believe I am on 0.1 or something

opaque ledge
#

its at 0.8 now πŸ˜„

frail seal
#

I tried to install DOTS into my new project, but for some reason packages had conflicts between each other

#

So I looked into my another working DOTS project and used package versions from there

warped trail
#

just update collections to latest versionπŸ˜…

frail seal
#

If after upgrading my project starts spewing errors, then that's on you

#

Lol

warped trail
#

πŸ˜•

opaque ledge
#

oh it will πŸ˜„

#

just create a new project on 2019.3 and install DOTS packages

#

and upgrade everything except platforms

#

not sure if that is fixed yet

frail seal
#

Is it okay if I use 2019.3.2f1 instead?

#

Not sure how important version number is

opaque ledge
#

sure, it works fine for me for all versions i think

frail seal
#

Anyway, SystemBase has better performance than ComponentSystem when doing many single-threaded foreach loop per second? Or not?

opaque ledge
#

should be fine as long as you use 2019.3, tho i guess its always better to use latest version.

#

Yep, tbh, your ForEach probably doesnt use burst

frail seal
#

Right

opaque ledge
#

are you using any classes in your for each ?

frail seal
#

I thought Burst is for parallel tasks only

#

I only use structs

warped trail
#

burst is for jobsπŸ€”

frail seal
#

^

#

Meanwhile I have problems with simple 2-entity loop

opaque ledge
#

perhaps do .WithBurst() after ForEach, maybe that can help

#

but like i said, upgrade to SystemBase later on

warped trail
#

job does not mean parallelπŸ˜…

frail seal
#

Wait

#

Huh

#

Daaaaamn

#

I thought Job System exists simply for parallel computation

#

It says so practically everywhere

dusty scarab
#

In the Unity Pong tut,
I'm doing

but I get the following errors:
ArgumentNullException: A valid BlobAssetStore must be passed to construct a BlobAssetComputationContext
NullReferenceException: Object reference not set to an instance of an object

I'm pretty sure it has something to do with me passing null into BlobAssetStoreType. What should I be using instead?
Would appreciate any help on this, thank you

warped trail
#

@frail seal you can run job on main thread if you want to

opaque ledge
#

job is something that runs on a worker thread, but if your main thread waits for that job, its good as its running on main thread

#

you cant use null anymore @dusty scarab

#

you have to do "new BlobAssetStore()",

#

and dispose it on your monobehaviour's OnDestroy method

dusty scarab
#

I'll try it, thank you!

frail seal
#

Okay, I am updating Entities package from 0.1.1 to 0.8.0-8

#

Fingers crossed

#

If anything breaks, I'll cry

opaque ledge
#

it... it will break πŸ˜„

frail seal
#

Yup, everything is now broken

#

I am crying

opaque ledge
#

awww, dont cry 😦

#

try deleting your library folder

dusty scarab
#

@opaque ledge It works now, thank you!!

opaque ledge
#

gl^^

lusty otter
#

The forum post fix did it, thanks!

frail seal
#

Oh, actually, I tried updating all of my dependencies and it now works

#

Only my component system is now errorish

#

Now I have a stupid question

#

How do I iterate through entities on SystemBase?

#

It doesn't have Entities in it

warped trail
#
  Entities
  .ForEach((ref Translation translation) =>
  {

  }).ScheduleParallel();```
frail seal
#

Ack

#

I confused ComponentSystemBase with SystemBase

#

Thanks for your code

#

CSB doesn't have Entities

warped trail
#

just read documentationπŸ˜…

mystic scaffold
#

Hi everyone, just a quick ask for anyone who's used or is currently using D.O.T.S, I'm needing to conduct a quick email interview in relation to my final year university dissertation on "Is Unity D.O.T.S worth using from a developer perspective?", the quick email interview will only be five questions long. Kinda stressing out as the deadline approaches haha

#

Drop me a DM if you fancy

hollow sorrel
#

does it need to be an email
can't you just get answers in here

frail seal
#

I have read documentation couple times

#

But it's awfully written

pliant pike
#

@mystic scaffold short answer no

frail seal
#

And the fact that it's all in foreign to me language doesn't help either

#

English texts hurt my eyes

mystic scaffold
#

@hollow sorrel sadly yes due to having to keep things inline with the my university's research policy /: apologies

#

@pliant pike no worries

hollow sorrel
#

damn boomer teachers

mystic scaffold
#

@hollow sorrel ikr, it sucks

amber flicker
#

@frail seal blinded by english text? πŸ˜… - I feel sorry for anyone who isn't a native english speaker.. I hope the docs will get translated at some point... but I do think they're quite well written

hollow sorrel
#

@frail seal are you french

frail seal
#

I am russian

hollow sorrel
#

oh nvm

frail seal
#

Why you thought so?

hollow sorrel
#

because french tell everyone else to speak french even if they know english

frail seal
#

But I don't?..

#

Well, whatever

hollow sorrel
#

i know it was a joke

frail seal
#

On a related note

#

How do I access a dynamic buffer from within a job?

coarse turtle
#

Depends on how you structure your jobs really

warped trail
#

@frail seal зСмляк πŸ˜…

frail seal
#

Π›ΠΎΠ»

#

Π—Π°Π±Π°Π²Π½ΠΎ Π²Ρ‹ΡˆΠ»ΠΎ

coarse turtle
#
public struct ChunkJob : IJobChunk 
{
  public ArchetypeChunkBufferType<SomeBufferType> BufferType;

  public void Execute(ArchetypeChunk chunk, int index, int first) 
  {
    var buffers = chunk.GetBufferAccessor(BufferType);
    for (int i = 0; i < chunk.Count; i++) 
    {
      var currentBuffer = buffers[i];
    }
  }
}
#

if you do it in a job chunk otherwise if its a Lambda ForEach

Entities.ForEach((DynamicBuffer<T> buffer) => {})
frail seal
#

Ooh, thanks a lot

#

It makes everything so much easier

#

I may be able to finish my sound synthesizer today

vagrant surge
#

@mystic scaffold short answer is NO (for a real project). But it is super cool and worth watching it being developed

mystic scaffold
#

Thanks @vagrant surge πŸ™‚

#

also thanks @pliant pike

pliant pike
#

yeah that's what I was trying to say

mystic scaffold
#

yeah, apologies XD was still waking up when i wrote that

pliant pike
#

its fun to play around with but I wouldn't try to make a full game with it currently

vagrant surge
#

its just far too underdeveloped atm

#

almost no editor support, and almost no "anything" support. Even rendering meshes with it is tricky

mint iron
#

and if the past is anything to go by, parts of the project will frequently break with new package and editor versions, so its possible to get into situations where you need a bug fix that exists in newer packages, but that means you're forced to upgrade other packages or the editor, which introduces more compatibility issues / forced refactoring.

vagrant surge
#

upgrading projects in unity has allways been horrible

#

but due to the current early state of DOTS, you have to upgrade

#

except on this its even worse because the api is on constant flux

spring hare
#

@vagrant surge thank you!

pliant pike
#

yeah I've been way behind on the updates and didn't even know they went from jobcomponentsystem to systembase

#

that's my own fault

vagrant surge
#

stuff is improving so much tho

#

the new foreach stuff is great

pliant pike
#

yeah they seem to be cutting down alot of the bloat

opaque ledge
#

i kinda was surprised when i saw that topic in forums about being upset over this

#

i used to like IJobForEach as well, but ForEach is much better, much less code

pliant pike
#

people don't like change and to know that what they learned is now obsolete

zenith wyvern
#

I guess some people feel like the lambda syntax is ugly compared to a nicely separated struct. Also if I had like 150 ijfe to rewrite I would probably be annoyed too

opaque ledge
#

yeah but people should have expected that, i mean same happened with entity query right ? it was the first way to do ECS, now that is not used at all, so i guess same happens now

zenith wyvern
#

You can still separate functions though so not really sure about that first complaint

amber flicker
#

Has anyone worked much with the conversion workflow? Any idea how I made force a subscene or specific gameobject to be converted again?

#

(via editor script)

opaque ledge
#

only complaint i have for ForEach lambda is intellisense derps when you are dealing with dynamic buffer that you use in query

zenith wyvern
#

Intellisense actually seems way worse in visual studio 2019. I feel like it was less buggy in 2017

opaque ledge
#

you can use authoring components for converting gameobjects to entities Timboc

#

and they dont need to be in subscene

amber flicker
#

sorry @opaque ledge not really what I'm talking about - specficially live link - similar to the way that if you change the position you somehow dirty the object and it gets re-converted

frail seal
#

Anyone knows why this code throws error DCICE007: Could not find field for local captured variable for argument of WithReadOnly. Seeing this error indicates a bug in the dots compiler. We'd appreciate a bug report (About->Report a Bug...). Thnx! <3?

#

(It persists even with GetComponentDatFromEntity<NodeMain>(true);)

hollow sorrel
#

@amber flicker you have to add [ConverterVersion(string username, int version)] to your authoring class and whenever either of those params change unity will reconvert those (not sure if it's only the components that changed, entire gameobjects, or entire subscene)

#

i don't know if you can do it any other way atm anymore

#

they removed the button

#

which is really poopy because sometimes you just want to reconvert because you changed something in editor

amber flicker
#

yea I can't use that attribute - I'm pretty sure there's some livelink api somewhere... I guess I just need to trawl through all the source until I find how they update on component change in inspector

hollow sorrel
#

ah

#

lemme know if you manage to find it i'm interested too

amber flicker
#

cool, will do πŸ‘

zenith wyvern
#

@Blinded I dont think that error relates to the code you posted. It says you're trying to capture a local variable using WithReadOnly but that it's not finding that variable inside the lambda body

#

Oh never mind I didnt see the withreadonly at the end

#

Yeah the problem is you're not using Allnodes inside the lambda

opaque ledge
#

nah, he is using it πŸ˜„

remote coyote
#

Hoping to hear about DOTS Terrain Engine on Wednesday. Anything else we can expect/hope to learn more about?

opaque ledge
#

maybe do get allNodex[newValue.Donor] first to a local field and access Output field ?

zenith wyvern
#

Oh he is...sorry I just woke up

warped trail
#

new entity debugger ?πŸ€”

gusty comet
#

How should I go about rendering a 2d mesh of quads using DOTS?

#

I'm making a 1000x1000 tile map and my idea is to make a mesh for 8x8 tiles to be a part of an entity per chunk

#

My question is, how should i implement the texture to fit inside dots

frail seal
#

Okay, I'll try it, Curly

zenith wyvern
#

@gusty comet You don't, textures and meshes are not a part of dots yet. You can use hybrid renderer but it's horribly slow for what you're trying to do

#

v2 might work but we don't know yet since we can't use it properly until 2020.3 is released

gusty comet
#

Hmm.. using unity's Tilemap then?

#

I would love for it to work on mobile

#

Guess I could use a simple monobehaviour to render and work on logic in dots

zenith wyvern
#

In my roguelike I just build all my tiles into one big mesh. Even with a huge mesh (100+x100+) it performs fine, but the mesh doesn't display properly at much larger than that. I'm also doing a voxel game right now where I separate my terrain entities similar to what you described - when it comes time to turn them into meshes I just create a gameobject, pass the relevant mesh data to a newly created mesh, and let them render the old way

#

Once Hybrid v2 is out I will probably switch to using that

hollow sorrel
#

you can if you don't mind either writing your own renderer or trusting a random dude on the internet's code

frail seal
#

It kinda worked @opaque ledge
But now I have InvalidOperationException: The writable NativeArray <>c__DisplayClass_CalculateSignal_LambdaJob0.JobData._lambdaParameterValueProviders.forParameter_node._type is the same NativeArray as <>c__DisplayClass_CalculateSignal_LambdaJob0.JobData.allNodes, two NativeArrays may not be the same (aliasing).

zenith wyvern
#

@frail seal You can't have NodeMain type as an argument and pass in a CDFE of that type as well

hollow sorrel
frail seal
#

CDFE?

opaque ledge
#

you cant get the same component type with both GetComponentDataFromEntity and in your ForEach lambda

zenith wyvern
#

If you're using ComponentDataFromEntity you would need to not pass that type as an argument and access your component through that

gusty comet
#

So fastest solution right now would be to use gameobject to create and render my tilemap mesh and do the rest in dots?

zenith wyvern
#

Fastest solution is GPU Instancing which is what we do in that 200k sprites thread that Scorr linked to, but there a re compatibility issues with that especially on mobile. So yeah, my recommendation is to use gameobjects or Graphics.DrawMesh until Hybrid v2 is out

gusty comet
#

I mean, fastest to implement πŸ˜›

frail seal
#

You mean I can't have both GetComponentDataFromEntity<NodeMain> and ref NodeMain?

gusty comet
#

Okay, thanks a bunch!

zenith wyvern
#

Fastest to implement if you're already using dots is Hybrid Renderer...but like I said performance is truly horrible right now. Supposedly v2 is MUCH better, but who knows until we have access to it

hollow sorrel
#

you can still make your tilemap meshes using DOTS, but yea gameobjects for rendering is easiest way to get going atm

zenith wyvern
#

You mean I can't have both GetComponentDataFromEntity<NodeMain> and ref NodeMain?
@frail seal

Correct

hollow sorrel
#

i'd prob make tilemap meshes using job system and then upload that mesh into a gameobject+meshrenderer

frail seal
#

Uuugh, such a stupid restriction

#

And what do I do?

#

How do I even work around this?

opaque ledge
#

@frail seal yeah, you have to do do Entity entity in your lambda, and get your node from GetComponentFromEntity

gusty comet
#

Hmm.. Hybrid renderer wouldnt allow me to set each tile in the mesh, would it?

frail seal
#

Oh right

#

Thanks

#

I hope now nothing will break

gusty comet
#

I wouldnt mind going with that if it means an update later

frail seal
#

I had another error pop up each time I solve the previous one

#

Like 5 times

hollow sorrel
#

hybrid renderer only takes care of the rendering portion, the creating mesh with correct textures + uv all needs to be done yourself

#

and instancing prob wouldn't help you much here if you're making 8x8 tile chunks

gusty comet
#

I mean, i can only set the RenderMesh to on single entity, so it would need to be a sprite atlas of its own

hollow sorrel
#

since all your rendermeshes would be different

zenith wyvern
#

That's true even if you go with gameobjects though

hollow sorrel
#

yea

frail seal
#

Oh, actually, I can't do that

gusty comet
#

I see

zenith wyvern
#

@frail seal Pass your Entity as an argument to your lambda

frail seal
#

I can't access DynamicBuffer from parallelfor if it isn't readonly

opaque ledge
#

basically, Entities.ForEach((Entity entity, ref DynamicBuffer<DonorElementData> acc)=>{});

frail seal
#

And if it is readonly, I can't change my component

zenith wyvern
#

Basically @gusty comet if you're not using Unity's TileMap or Sprites then you need to write your own shader

frail seal
#

Can I?

gusty comet
#

Would it take much from the performance if I did use it? It has so many features I don't need

zenith wyvern
#

No, TileMap is very fast

frail seal
#

I would have to destroy and create a new node component in it's place most likely

zenith wyvern
#

I personally don't use it because I can't stand the asset workflow and like you said it has a lot of crap I don't need. But yeah it is definitely very fast

gusty comet
#

Alrighty! Thanks everyone

zenith wyvern
#

@frail seal No, if you want to make changes to any kind of array you either use Schedule instead of ScheduleParallel or use WithNativeDisableSafetyParallelRestrictions if you know what you're doing

amber flicker
#

@hollow sorrel I'm not 100% sure but I think GameObjectConversionUtility.ConvertIncremental(.. is working - bit fuzz on how I'm supposed to know the correct flags but it's kinda working πŸ‘

frail seal
#

@zenith wyvern What could go wrong if I use WithNativeDisableSafetyParallelRestrictions?

#

I don't know if I know what I am doing rn

zenith wyvern
#

A race condition

#

Basically don't do it if you don't know.

frail seal
#

So, if I write into one element at a time I won't have my PC explode?

zenith wyvern
#

It's perfectly reasonable to use Schedule to run it on a single thread if that's what your logic requires

frail seal
#

I need it to be as efficient as possible

zenith wyvern
#

Then I guess you better do some research on race conditions

frail seal
#

Since my current ECS implementation has much much much lower performance than my MonoBehaviour one

#

About 200x

amber flicker
#

If you keep at it, you might be able to invert that ratio. Also if you're looking at performance at all, make sure all the safety checks are disabled and you're using burst.

hollow sorrel
#

@amber flicker oo nice ty πŸ‘

pliant pike
#

so do we not used EntityQuery anymore?

opaque ledge
#

We do, but not mainly, you cant even use buffers with EntityQuery

pliant pike
#

ok yeah, because I'm trying to figure out how I'm supposed to access Blobassets , multiple of the same type

zenith wyvern
#

We do, but not mainly, you cant even use buffers with EntityQuery
@opaque ledge

Sure you can, what do you mean?

opaque ledge
#

You cant do ToBufferArray right ?

zenith wyvern
#

No, but if you include your buffer type in the query that query will still properly match entities with your buffer attached to them

opaque ledge
#

yeah i know, but you cant do any process on dynamic buffer right ?

#

you can just retrieve components or to entity

zenith wyvern
#

If you wanted to access the buffers directly from the query then yeah you'd have to convert it to an entity array then access your buffers through each entity

#

@pliant pike You access blob assets through a BlobAssetReference

pliant pike
#

so how would I access several Blobs I need to get them by ref

#

var baked = BezierGraph_Query.GetSingleton<BezierGraphSpawner>();

#

I'm currently using that except I have multiple now not its not a singleton

zenith wyvern
#

Each one has a BlobAssetReference attached?

pliant pike
#

yep

#
{
    public BlobAssetReference<Beziernode> BezzyGraphcomp;
}```
zenith wyvern
#

Then just do query.ToEntityArray() and access your components through entity manager, or through a CDFE in a job

pliant pike
#

ok thanks a lot

zenith wyvern
#

No worries, I just started working with BlobAssets recently. They are very confusing at first

pliant pike
#

awesome, I have multiple splines now

vagrant surge
#

blobassets are great, such a massively underrated feature of dots

coarse turtle
#

does unity throw a compilation error if you dont reference the blob asset by reference in job code now? πŸ€” I think I remember them saying something like that

opaque ledge
#

i still have no idea where to use blob assets tbh

#

sure its read only stuff but.. i still dont get it why would i use it over a component or a shared static

coarse turtle
#

well blob assets have data compacted so - it's one large section of memory with the data closely aligned

zenith wyvern
#

It's the best way to embed shared data in a component from what I can tell

coarse turtle
#

especially large volumes of it - so you can likely extend it to animation clips

opaque ledge
#

so its like a shared component but instead its a component its a field that you can store to component ?

warped trail
#

you can look at physics collider πŸ˜…

opaque ledge
#

idk, its just too abstract for me

#

i am a peasant, i only know component datas

mint iron
#

it takes a big slab of memory, and puts all your stuff in it, back to back.

zenith wyvern
#

so its like a shared component but instead its a component its a field that you can store to component ?
@opaque ledge

You can't access shared components inside a job. You can access BlobAssetReference anywhere

digital kestrel
#

hdrp vs urp with DOTS? any thoughts

warped trail
#

hdrp is getting a lot of love from devsπŸ˜•

zenith wyvern
#

Dots shouldn't be a factor in your decision. If you're targeting high end, HDRP. Otherwise URP

warped trail
#

you can't make cool looking tech demos with urpπŸ˜…

low tangle
#

yeah but the shader limitations are a real pain in the ass

hollow sorrel
#

what are the shader limitations

#

i assume you mean of hdrp

low tangle
#

creating custom master nodes

#

for non built in shading modes

#

like a custom skin or hair shader

hollow sorrel
#

ah

sour ravine
#

that isn't really a DOTS limitation, that's just Dumb By Design

stiff skiff
#

A curiosity question. There is an EntityManager.HasComponent to check if a single component is present on an entity. But is there a way to check multiple in 1 go?

warped trail
#

i guess you can check whole chunk if it has some component or not in IJobChunkπŸ€”

#

or are you asking multiple components in 1 entity? πŸ˜…

digital kestrel
#

how do u modify entity physics collision layer

#

so certain entities dont check collisions with each other

warped trail
#

@digital kestrel there is examples of that in physics samples

digital kestrel
#

ok

#

didn't know if it was a configuration thing

stiff skiff
#

@warped trail This would require me to make a query, which I want to avoid

mint iron
#

would you need all to be present?

stiff skiff
#

Yes

#

I was thinking if compairing my list to the list of components on the entity

#

And while the EntityManager has a way to get the pre-sorted list of componenttypes from a given entity

#

there is no method of sorting my own list of component types, that I want to check overlap with

mint iron
#

and needs to run within burst i assume?

#

do you have access to the ArchetypeChunk?

safe lintel
#

anyone know what the math equiv for Vector3.Angle is?

sour ravine
#

acos(dot(lhs, rhs))

#

consider not calling acos since it's slow af

#

work with cosine directly

#

(that's also in radians FWIW, so you also need to convert)

safe lintel
#

thanks, terribly bad at maths so will have to just go with acos for now πŸ™‚

digital kestrel
#

what's the difference between havok physics and unity physics

safe lintel
#

unity physics: stateless, source available, free
havok: cost depends on unity license, stateful(higher perf), better debug tools, closed source

zenith wyvern
#

Not being stateless also has other benefits like stable stacking

opaque ledge
#

what is stable stacking πŸ‘€

safe lintel
#

@sour ravine is this correct?
a = Vector3.Angle(vectorA, vectorB); b = math.radians(math.acos(math.dot(vectorA, vectorB))); as they give wildly different results

opaque ledge
#

When they announced Havok physics, all of their examples were hey Havoc is better than Unity's solution on this situation

sour ravine
#

@safe lintel I think it should be math.degrees instead of math.radians but searching docs is being uncooperative

digital kestrel
#

are veca and vecb normalized?

sour ravine
#

also good to know ^^

digital kestrel
#

math.dot gives u |mag| * cos(theta)

zenith wyvern
safe lintel
#

@sour ravine thanks, changed to degrees and also normalized(unsure if necessary) the vectors and its close enough for my uses

sour ravine
#

@safe lintel yep, it's math.degrees not radians

#

you don't need to normalize if you know absolutely 100% the inputs are normalized already

#

but that should be a nice perf bonus, if skipped

safe lintel
#

hmm it doesnt work without normalizing

digital kestrel
#

@warped trail so I discovered there's a physics shape script and physics step script with "categories" that function the same as layers

#

so i can just adjust the layers to how i want

fallow mason
digital kestrel
#

if im setting up a follow system

#

should i get a TargetToFollow component with its entity ID

#

a system that queries for this component

#

and sorts the entities by the target they want to follow

#

then set up a paralleljob that calculates a set of positions to move to, updated per frame

#

and finally a system to actually move the entities

zenith wyvern
digital kestrel
#

how are you generating the terrain

#

greedy meshing? baking ao, flood fill occlusion culling?

zenith wyvern
#

Occlusion culling but only within each chunk. There's no culling on adjacent chunks yet, still thinking about the best way to handle it

#

I'm thinking of generating shared edge data between chunks, with bit shifting I should be able to fit all edges for a single 16x16 side into four ulongs

#

So I could easily reference edge data inside jobs without having to reach into adjacent chunks

digital kestrel
#

16x16 is pretty small

#

you'll get a lot of draw calls

zenith wyvern
#

16*16*16

digital kestrel
#

16^3?

#

yeah, still small

zenith wyvern
#

Currently getting 6 draw calls with a huge region

#

They're all using the same shader/texture/material

digital kestrel
#

how many chunks are you rendering

zenith wyvern
#

Looks like rendering is taking ~10ms in the editor for 40x40 regions. Each region is a stack of 1-3 chunks

#

So yeah, not great

#

I suppose I should try to merge the chunks into bigger meshes during mesh generation, I can still keep the actual block chunks small

digital kestrel
#

how come I can't do float4 * quaternion?

#

how do I apply rotation to a float4

zenith wyvern
#

math.rotate

digital kestrel
#

ty

gusty comet
#

hi guys,
i'm using latest Hybrid Renderer / DOTS with URP on 2020.1 ...
does it load / unload subscenes based on camera view automatically or needs to attach some script to camera or something like that?

dull copper
#

it doesn't automatically do things like that

#

basically if you want to stream things, you need to come up with your own logic to stream dots subscenes

#

could always look how they did it on megacity too but it's using quite "old" ECS version

warped trail
dull copper
#

I was about to link that πŸ˜„

#

but yeah, that's super trivial case on that video, you don't usually stream like 2D view πŸ˜„

gusty comet
#

ok ... thanks ...
but i wish for some premade scripts like as convert to entity!! [easy peasy !!]

dull copper
#

it's been ages since I've watched these unite la talks

#

yeah, that's not there

#

wait for few years and ask again

#

that being said, I think it was mentioned that there will be a culling system for hybrid renderer v2

gusty comet
#

well ... hybrid renderer 2 is just working on 2020.1.0b3 and URP 9.x ... that does not exists anyway :]

dull copper
#

it does seem to run on b2 and latest github master

#

I dunno if there's some oddities still with that combo but at least it seems functional

#

but that doesn't mean it would have the full planned functionality yet

#

it's literally first preview

gusty comet
dull copper
#

yes, I did test it

#

and I'm aware that docs state you need b3

#

I've tried it on b1 and b2

#

on b1 it was completely broken

#

b2 seems to work fine on my brief tests

#

I also only tested on HDRP from github master, no idea about URP

gusty comet
#

and this culling is automatically or need shit setup?? 😭

dull copper
#

no idea if the culling is in yet

#

I'd doubt it

#

all in, there is a roadmap stream in 2 days

#

you'd think they'd say at least something about dots systems there

zenith wyvern
#

Kinda bummed about that, it seems like it's just going to be about general unity stuff. Much rather have some focused talks like they had planned originally

dull copper
#

sure, I was hoping for at least separate dots talk

warped trail
#

#ReleaseMikeActonTalk

zenith wyvern
#

Anyone have experience adding physics bodies to runtime entities?

gusty comet
#

and what about megacity demo subscene loader?? does exists separate script / method of that??

warped trail
#

they deprecated some things that they used there

zenith wyvern
#

From what I remember that code monkey video does exactly what you want, he shows how to load subscenes based on camera position

dull copper
#

it's not always that trivial in 3D though

#

if you have a top down game, sure it works

warped trail
#

but it is that trivial in megacity πŸ˜…

dull copper
#

nope πŸ˜„

warped trail
#

yes

zenith wyvern
#

What do you mean?

dull copper
#

but at this point, I'd just wait a bit

#

I mean, if you can see long distance, your streaming strategy will be different and you need to get LODs and culling involved

safe lintel
#

@zenith wyvern you mean create the body some time later after the game started instead of setting up the conversion at the start?

warped trail
#

this is the whole code for streaming in Mega city cs var distanceSq = sceneData.BoundingVolume.DistanceSq(CameraPosition); if (distanceSq < MaxDistanceSquared) AddRequestList.Add(entity);πŸ˜…

dull copper
#

you can't just stream subscenes in naive grid formation (unless your level design makes it possible)

zenith wyvern
#

@safe lintel Yeah, like is it just as simple as adding a physics body/rigidbody component or something?

warped trail
#

@zenith wyvern yes

zenith wyvern
#

Sweet

safe lintel
#

well.. ideally you would want to have the collider blobs setup beforehand wouldnt you? not sure what the penalty of creating that stuff is during runtime vs doing it at the initial start

zenith wyvern
#

All my meshes will be unique in this case, so that's not an option

warped trail
#

you will use mesh colliders?

#

or convex?

zenith wyvern
#

Mesh collider

warped trail
#

ohπŸ€”

zenith wyvern
#

I'll have to do some testing to see how simple it is

warped trail
#

it is not cheap to make meshcollider at runtimeπŸ€”

zenith wyvern
#

I know, unfortunately it's required. The terrain is dynamically generated and deformable. And I'm not smart enough to write my own physics engine

safe lintel
#

post the problem in the forums, the havok physics guys are pretty responsive. give em some new use cases to work on πŸ™‚

zenith wyvern
#

Yeah I might do that, this is my first time even touching the physics package so we'll see how that goes first

warped trail
#

just precalculate every possible combination of meshes πŸ˜‚

zenith wyvern
#

Galaxy brain solution

low tangle
#

just render every frame your game will need before hand and play them back as a video

#

ez

bright sentinel
#

I wonder how many frames that would actually be for simple games

#

Something like Tetris for example, how many combinations of frames πŸ€”

warped trail
#

predict user's input and prerender nearest and most possible future? πŸ˜…

frail seal
#

Here's a thing I don't understand about jobs
If I use jobHandle as a dependency, will that make my next jobs run after all my previous jobs were completed
Or will each job instance wait until previous job instance is completed?

low tangle
#

wait until the jobhandle passed into them is marked as complete

frail seal
#

Then first case?

low tangle
#

second case

frail seal
#

That sucks.

low tangle
#

think of it as the thing while looping waiting on that job to be marked as .Complete()

frail seal
#

Well, thanks

#

But wait, .Complete() makes main thread wait for all jobs to complete

low tangle
#

this is why you want to make you jobs small, fast, and use the paralell versions so it can slice by number of cores

#

no, just the job chain you are calling it on

frail seal
#

Well, duh

low tangle
#

a sync point is where it calls CompleteAllJobs which is what calling most stuff delete/add in entitymanager does

frail seal
#

In my case I need to wait until all entities are updated with first job, and then apply second job after that

#

How do I do that then?

low tangle
#

thats what it does

#

joba = do stuff to entities
jobb = do stuff to more entities, maybe even the same as a .schedule(joba)

#

joba will be fully done before b starts running

frail seal
#

Oh, then that's cool

#

And I thought waiting for all JobA's to complete is what is called a sync point

low tangle
#

job chains are what you end up in more complex systems, where it might be somthing like
getsomedata
hashsomepoints.schedule(getsomedata)
finaljob.schedule(hashsomepoints)

#

no, forcing all jobs in the entire unity job system to come to a screeching halt is a sync point

#

not just your joba in that system, its all systems everywhere plus unity internal

frail seal
#

Ooooh

#

Now that makes much more sense

#

I wish they said so right in the manual

#

Thanks for your explanations

low tangle
#

np

frail seal
#

Can I even run two jobs one after another a thousand times per frame?

bright sentinel
#

So you want to schedule jobA then jobB, jobA, jobB, jobA etc etc?

frail seal
#

Ye

#

And they all write to a buffer, which essentially is a NativeArray

#

Actually, I finally found an article page on that, so I may be figure that on my own

#

Btw, seems like I've previously spent half of my time learning ECS in manual for 0.1. Why the hell does it still pop up in Google as a first result for ECS manual? So mad at myself

#

0.8 manual is 10x better and easier than that

bright sentinel
#

Always go to the version you're using

#

But yeah, I heard that they're going to roll out a new docs system for packages, so that might change it

#

As for scheduling your jobs, you can always do it in a for loop.

#

Although it might be better to combine those two jobs into one job if they're doing the same thing

frail seal
#

Right now I have a node tree, made out of 2 entities. First node has a component OutputCD, and a second one also has a 1-element buffer, which grabs a value from first node. I have a ForEach loop, that goes through all those buffers and updates them. It is scheduled 1024 times per frame via a for loop. Currently system with this loop runs at 700 ms.
So, how do I improve performance at least 1000x fold? Can anyone please help?
In screenshot bellow I get allOutputs from outside of for-loop and then pass it into a function I call, as you've guessed it, 1024 times.

#

My non-ECS implementation would do this within 2 ms at most, so I'm puzzled with what I am doing wrong.

frail seal
#

UPD: Looks like practically all this delay comes from simply creating Entities.ForEach loop.

#

1024 times per frame translates to 120 ms delay

bright sentinel
#

Oh, you're calling the function that many times? But yeah, generally there's a performance problem with a lot of queries atm

#

The same happens if you have a lot of systems in your game (500+)

frail seal
#

Well, I do need to fill up an array, which I then feed into audio thread

#

And I fill it up using output of a final node in my node system

#

Thus I need to update my node tree 1024 times per array

#

I am not sure if I can use DOTS for this purpose now if Enitites.ForEach is so expensive by itself

amber flicker
#

have you looked into NativeStream at all? It might help with this kind of task

dusty scarab
#

Any insights on what may be causing these warnings? My project just includes an input system, and a movement system

frail seal
#

@amber flicker You mean, for passing data between threads?

#

@dusty scarab Usually these are caused by a native collection, that you forgot to dispose of

dusty scarab
#

I'm not using any native collections. Just 3 ComponentData's and 2 JobComponentSys, 1 which takes input and the other which moves a cube

frail seal
#

Hard to tell without seeing code

#

Maybe you're not aware, that you are creating them

#

Idk

dusty scarab
amber flicker
#

@frail seal it's A deterministic data streaming supporting parallel reading and parallel writing. Allows you to write different types or arrays into a single stream. - but actually I've just read some of the previous conversation and I'm quite confused about what you want to achieve. If you want to run jobA->jobB->jobA 1000x/second I would personally choose a different architecture. No matter how efficient the API, scheduling those tasks will be costly.

#

Perhaps instead of each node having its own job, you could have another dynamic buffer of node types that is iterated within a single job. Then depending on job type (enum switch maybe), a different static method is called. I don't know your problem well enough - just throwing out some ideas

gentle osprey
#

@dusty scarab I've sometimes gotten that issue as a false positive, and also having it linger around between unity session (not sure if they've fixed that). If you restart Unity, does it reappear?

dusty scarab
#

I'll check and get back to you @gentle osprey

gentle osprey
#

Alternatively, I've also gotten it in situasjones where I've had jobs that have been running for a long time. These long running jobs would block other Unity jobs causing it to appear as if they had leaked memory, because they were allocating their memory with JobTempAlloc.

frail seal
#

@amber flicker I run job over all nodes over and over 1024 times. They comprise their own "simulated world", output of which I feed into array I then send over to audio thread.
But I figured out how do I solve this problem while I was showering. I will just run ForEach once per node tree, where each node runs 1024 times their for loops. They use prerecorded inputs, and record outputs into a buffer, which will be used in next iteration.
This will introduce a delay though (each node separating a current node from the final one will make it late by ~20 ms)

#

So, yup, now I have a trade-off, where complexity of node tree increases delay of my audio feedback.

#

Coding is fun.

dull copper
#

hmmmm

fallow mason
#

still making new demos with JobComponentSystem? why?

wary anchor
#

can I ask how you guys go about updating your entities package? Every time I try to update, I end up in dependency hell with stuff like this and I don't know where to look to work out which package versions are meant to be installed with which version of Entities.

#

I'm sure this is my fault, just looking for advice on how not to end up here πŸ™‚

vagrant surge
#

@dull copper whats it about?

zenith wyvern
#

Right now I have a node tree, made out of 2 entities. First node has a component OutputCD, and a second one also has a 1-element buffer, which grabs a value from first node. I have a ForEach loop, that goes through all those buffers and updates them. It is scheduled 1024 times per frame via a for loop. Currently system with this loop runs at 700 ms.
So, how do I improve performance at least 1000x fold? Can anyone please help?
In screenshot bellow I get allOutputs from outside of for-loop and then pass it into a function I call, as you've guessed it, 1024 times.
@frail seal

If you want to benefit at all from jobs and burst you really need to restructure your data. The goal is to have your data laid out linearly in memory. Running 1024 different jobs that use ComponentDataFromEntity is bound to be horribly slow

frail seal
#

I am already doing that

#

And ComponentDataFromEntity is smallest of my troubles

#

But thanks for your concern

#

(i'm not trying to sound like a dick, honestly)

zenith wyvern
#

If you were already doing that you wouldn't need to schedule 1024 separate jobs in a single frame

frail seal
#

I will just run ForEach once per node tree, where each node runs 1024 times their for loops

#

In other words, I'll simply delay data transfer between nodes until the next frame. This will increase delay 1024x, but improve performance.

wary anchor
#

any advice on resolving missing directive errors when updating Unity.Entities?

frail seal
#

@wary anchor Are all Entities' dependencies up to date?

wary anchor
#

yeah I posted the pic above

#

57 mins ago

frail seal
#

Missed it

#

Hm

zenith wyvern
#

Did you try deleting your library folder and restarting?

wary anchor
#

yeah just did that, no dice

zenith wyvern
#

What's the first exception you're getting?

frail seal
#

Try checking if each dependency has it's dependencies up to date

wary anchor
#

Yeah I'd better double check that ^^

#

thought they were but I can't be sure I didn't miss any!

#

more pertinent, is how do you guys update normally, because I always seem to end up with huge chains of errors like this when switching package versions

frail seal
#

Welp, I just checked dependencies and dependencies of dependencies

#

And was ready to go

#

Probably also checked dependencies of dependencies of dependencies

#

Not sure

zenith wyvern
#

Seems like UPM has gotten pretty bad at actually resolving dependencies lately, not sure why. But yeah just try to discern which package is causing the error from the exceptions and update it

amber flicker
#

I usually just click update for any that have an update sign next to them... and it works. Occasional Unity restart required. I realise there are many who are not so lucky. I think in particular if you're using Physics or netcode it can be more of a mess.

wary anchor
#

yeah, not using physics or the netcode, and my dependencies are all up to date, and those dependencies of dependencies. I think it could be that I'm missing an ASMDEF entry perhaps?

#

or maybe I have one that is now redundant or somethinglike that

zenith wyvern
#

Can you show us the entire message of your top error?

wary anchor
#

I tried adding properties and serialization but they didn't help

#

when I go into that script, or any of the several that populate those 199 messages, it appears that it's not picking up interfaces like this one:

zenith wyvern
#

I think that's from an out of date collections package

amber flicker
#

I think this is obvious but (general, not aimed at you RooBubba).. for the love of... don't have compile errors in your own code before upgrading πŸ˜„

wary anchor
#

(agree Timboc, yes it was a fully functional project!)

zenith wyvern
#

What version does your collections package say in UPM?

wary anchor
#

using collections preview.2-0.7.0

#

doesn't appear to be a newer version, but shouldn't that be a version 8 to match unity.entities?

zenith wyvern
#

Yeah that shoudl be right. What version of Unity?

amber flicker
#

I also find their versioning very confusing... like why write preview.8 before 0.5.2... but anyway

wary anchor
#

it's 2020.1.0b2

zenith wyvern
#

Oh actually I'm using entities 0.7. So yeah maybe try downgrading entities

wary anchor
#

I'll give that a shot

#

!

#

lol

amber flicker
#

Interesting.. I have similar dependencies to you but Properties 0.10.4-preview

wary anchor
#

I'll give that a shot too

amber flicker
#

weird.. you have later serialization, properties and one or two others I think...

#

do you update by editing the manifest? or do they just not appear as options for me?

wary anchor
#

I didn't edit the manifest.json

#

ooo we're down to just 9 errors and I'm not quite finished checking the same list as you posted

amber flicker
#

I think one of the things you have must require newer versions of packages and that's what's causing the issues? What is Properties UI? πŸ‘€ And your Newtonsoft Json is 2.0 vs my 1.1.2 🀨

dusty scarab
#

@gentle osprey It seems this was a Unity session warning, went away after restarting

gentle osprey
#

Good to hear :)

wary anchor
#

down to only buildpipeline errors now

amber flicker
#

ooh are you on osx?

wary anchor
#

no

#

it has an error for each build target by the look of it