#archived-dots

1 messages ยท Page 171 of 1

tardy spoke
#

and they're all an identical mesh lolol

safe lintel
#

glad its building, it is kind of its own little hell when it doesnt ๐Ÿ˜…
what is it supposed to look like?

tardy spoke
#

No, it's going to look bad, I just figured my sacrifices of ALL lighting and ALL textures would be enough to at least get me enough geometry to do something interesting with... or at least not be so bottlenecked there as well, haha.

#

And I could make do with 180k tris, but the 180k tris ran at 40 fps and Oculus requires at least 72FPS, which means I'm probably looking at maybe 100k max.

I'm hoping there's some simple optimizations or switches I'm missing to boost it up a bit. Would love to write/modify my own render pipeline to get rid of some of that unnecessary overhead but it looks a bit painful.

safe lintel
#

could embrace the retro fad, like me, to avoid your light bake/need for good looking graphics ๐Ÿ˜Ž

tardy spoke
#

That's the plan

#

In theory it should be only 1 draw call so there's probably some optimizations to be done. Hmm.

#

I think it's because it can't static batch because in my game the world moves so nothing is static, though I don't know if entities static batch? They probably normally do

tardy spoke
#

The keywords are the same. Weird. ๐Ÿคทโ€โ™‚๏ธ

winter onyx
#

@tardy spoke i'm not sure, but i think you need to do things pretty differently for the scene i'm looking at. did you consider using a texture or vertex colors to choose the color, instead of distinct saturation / brightness / contrast uniforms?

#

i don't know if shader graph is up to snuff for emitting perfect stuff for batching

#

so what i'm saying is, it's usually as simple as using the same material with dynamic batching turned on?

dusky wind
#

Does anyone know if anything odd happens when you remove objects during GameObject conversion?

#

I want to use AnimatorUtility.OptimizeGameObjects after I've read bone information and want to make sure things don't break if I remove virtually the entire hierarchy mid conversion

solid flume
#

I hate that jobs and burst doesn't work with references

#

Wouldve been much more painless to make an octree

#

And basically everything else

opaque ledge
#

thats why OOP exists, so it would be painless to do stuff, but thats not machiene friendly, hence why ECS is so performant, its machiene friendly while not really human friendly

solid flume
#

Its the simple things like having lists and being able to dynamically add things, have trees implemented through linked lists

#

I can't have linked lists in jobs can I?

opaque ledge
#

There is native list, you can use it

#

technically speaking, you can create your own native containers

#

i think there was a page about it somewhere, or maybe in ecs sample ? not sure

mint iron
solid flume
#

This would have saved me so much time

#

Well good thing I have it now atleast

#

Only have to refactor close to everything

#

^This doesn't have a lot of functionality apparently

vagrant surge
#

@solid flume linked lists are generally a very bad idea these days

#

with 64 bit pointers, you are wasting a pretty huge amount of perf

#

what people do in Dots is to have a linked list, but done on top of an arrays

solid flume
#

I gave up on the naive surface nets with an octree thing

vagrant surge
#

and instead of using pointers, you use int handles, like 16 bit integers

#

space saved is pretty big, and it lets you iterate it flat by just running through the array

solid flume
#

My octree was an array

#

Somehow could only get it to work for chunk sizes that were a power of 2

#

So it was basically impossible to expand, and couldn't remove seams between chunks

vagrant surge
#

the trick is on realizing that the backing array really is just an arena-pool allocator for the nodes

#

and everything else is the same as usual in octrees, except with int handles instead of pointers

#

holds the same for any type of graph

trail burrow
#

all using native memory

solid flume
#

I've never been happier to see something marked unsafe

trail burrow
#

Array, BitSet, Dictionary, Set, Binary Min Heap, Binary Max Heap, List, Stack, Queue, Sorted Dictionary, Sorted Set

#

i suppose it's missing linked list, lol

#

in the burst compiler? wut

#

i think its in the default engine core

solid flume
#

I'm thinking of working on some ECS stuff in entitas. Try get used to the architecture

trail burrow
#

@vagrant surge i find these memory pools always so underwhelming in the end, you're 99% better to do a custom allocator (not complaining, just something i noted over the years)

solid flume
#

I don't understand the difference between different ECS packages. Unity ECS versus entitas versus svelto.ecs. What purposes does one serve that the other does not

toxic walrus
#

@solid flume just different implementations of ECS
unity targets high performance, entitas targets usability, svelto is overengineered (imo)

solid flume
#

Why does entitas have a paid version on the asset store

#

Also thanks @toxic walrus

#

Makes sense

coarse turtle
#

likely to support the developer

solid flume
#

$90? Could've just made a patreon

coarse turtle
#

there's a paypal link on the github too

solid flume
#

Ah. Well I'm basically broke anyway

#

Dunno what I'd do without a student license getting me free stuff

vagrant surge
#

@trail burrow i like them a lot

#

but mostly because it "centralizes" thing

#

for example if i have a NavZones object

#

and all of the navnodes and stuff are allocated in arrays inside it

#

it makes it very easily to destroy the thing, or serialize the thing

#

can basically binary-dump the node arrays into a file and then load them back up (kinda what unity is also trying to do)

trail burrow
#

i made our memory layout identical on all platforms, so i can just dump the heap to disk as is from our custom allocator ๐Ÿ˜„

#

to save the entire game

vagrant surge
#

nicee

#

tho if you dump the heap, what happens with the pointers?

trail burrow
#

they are already encoded in a special way

vagrant surge
#

or are you using virtual memory tricks to put it allways in the same place

trail burrow
#

we have our own safe pointer internally

#

that deals with that

#

so it can all just be blit:ed to disk, or to a packet to send over the wire, etc.

opaque ledge
#

has anyone had problem with their entities not being rendered in a build ?

amber flicker
#

have you done a development build to make sure you're not getting a bunch of exceptions @opaque ledge ?

opaque ledge
#

yep

#

The thing is.. i cant see Hybrid Renderer System working in a build

amber flicker
#

which render pipeline? hybrid renderer v2 I assume?

opaque ledge
#

i only get "Kernel CopyKerner not found" error, i posted in forums but no answer this far

#

yeah, v2

#

with urp 9 preview 55

amber flicker
#

mine works ok.. is it a shader issue?

opaque ledge
#

its URP lit

amber flicker
#

think only support for a single directional light and a couple of shaders

opaque ledge
#

i mean URP lit should work without any issues right ?

#

i mean it works in editor, so not entirely sure why it wouldnt work in build as well

amber flicker
#

I think so - though maybe try unlit just to be sure - urp is really barebones support atm

opaque ledge
#

hmm yeah okay, i will try

last jasper
#

what platform are you building for?

amber flicker
#

also does your material exist in a scene? wondering if it might be inadvertently stripped or smth

opaque ledge
#

android

#

yeah it does, i put material in a monobehaviour, and my prefabs are in scene (they are converted to entity prefabs at runtime)

amber flicker
#

hmm not sure on android sorry - I know Alex was having a bunch of issues that resolved when upgrading to 0.14 I think - assuming you're on the latest?

opaque ledge
#

even simply cylinder doesnt being rendered, they are being rendered if i dont convert them to entities

#

yeah i am

rancid geode
#

are you using SubScenes @opaque ledge ?

opaque ledge
#

no

amber flicker
#

oh, one thing to be aware of is if you're converting your prefabs at runtime I don't think it will be adding all the necessary components

#

though I might be wrong about that but it's worth checking

opaque ledge
#

i actually get some errors that Lit and BakedLit arent srp compatible i think, let me check

amber flicker
#

I remember having some similar issue

opaque ledge
#

i didnt mind them at first since it works in editor

#

you guys think thats the issue ? maybe i should try with unlit

amber flicker
#

can't hurt to quickly try.. not sure why you're getting those errors

rancid geode
#

@opaque ledge if you are using the default material, I think that it has instancing turned off, I believe that HRv2 requires it on, just create you own "default material" with lit shader and turn instancing on

#

if you are already using your own materials, just ensure that instancing is on

amber flicker
#

Other thoughts - if you've had various versions of URP installed you might have some legacy stuff interfering. I think I had to re-add cameras and lights after doing some combinations of adding and removing pipelines.

opaque ledge
#

hmm okay

#

will try it soon

tight blade
#

does anybody have anything with rendermesh structs and runtime mesh manipulation they could throw onto the wiki?

#

@zinc plinth did that route end up working for you?

last jasper
#

Gearless, I think there is an example of procedural mesh on the tiny examples

tight blade
#

ooh, the tiny examples?

zinc plinth
#

@tight blade it worked great, can only combine meshes on main threads but ehh

tight blade
#

huh, gotcha

#

@last jasper where are the tiny examples?

#

(sorry)

solid flume
#

I checked out entitas and it looks useful... if I'm willing to shell out the $90 to buy it on the asset store

#

Not gonna happen

tight blade
tardy spoke
#

@opaque ledge I saw a forum post about someone turning off SRP batching and then those materials showed up.

I think you may have to make a copy of the standard lit material and make sure batching is checked off or something, but you'd think it would be by default.

opaque ledge
#

how do i turn off srp batching ?

tardy spoke
#

Good question

opaque ledge
#

i know right, i dont think there is an option for that, never saw it

tardy spoke
#

SRP asset

opaque ledge
#

ah alright, will check thanks

tardy spoke
#

Dunno if it's still there, that may be old

opaque ledge
#

doing the gpu instancing right now

last jasper
#

@tight blade thats it, check out RuntimeGeometry3D

tardy spoke
#

@winter onyx thanks for the help! It's currently using a shadergraph shader I made that simply uses vertex colors w/ a bit of other basic processing.

All the colours in the scene are vertex - except I made a couple extra materials just for test things like "water", and I just tinted those with an emission style override in the material.

However something to also note is the world moves instead of the player, but I'm not sure if that would affect batching/performance like that.

violet cosmos
#

@tardy spoke Could I suggest you move the player, but when they cross a boundary, reset them and the world in bulk?

So, there's always a "world position" offset for the SubScene, but they're nearly always operating in the origin of the that subscene, rather than on a treadmill (that will break things)

tardy spoke
violet cosmos
#

There's other ways to get around the floating point problem too. Like, having the physics operate in an offset realm

tardy spoke
#

@violet cosmos I tested doing that and for some reason the subscenes straight up didn't go to the right positions. It was weird.

#

Yeah I'm definitely open to better/easier solutions hahaha

#

How does the physics operating in another realm fix the display floating point errors?

violet cosmos
#

I wish you best of luck in Hybrid. I'm definitely shelving it for... indefinitely

opaque ledge
#

yeah, it still didnt work

tardy spoke
#

... shit.

opaque ledge
#

yep

tardy spoke
#

Damn, thought I just read a forum post about that yesterday

#

ADB log?

#

log of the cats?

opaque ledge
#

doing srp batcher thingie now, thats the only hope i have rn

tardy spoke
#

God speed

opaque ledge
#

thanks

tardy spoke
#

@violet cosmos can the physics operating it in another realm help the floating point display jitter or is that solution just for physics inaccuracies?

violet cosmos
#

Just for physics. But, I'd really try with the floating origin, or offsetting in bulk first. Moving the world is going to cause bad things to happen

tardy spoke
#

what floating origin? The one in HDRP?

violet cosmos
#

That's for the camera IIRC

tardy spoke
#

How do you float the origin another way?

#

I tried offsetting in bulk - actually I remember now the issue with that is I couldn't figure out how to tell the subscene to move after it's loaded (need some kind of callback after async load, not sure if there is one), so they'd move to weird spots kinda half way between where they should've been for some reason.

violet cosmos
#

It seems like you could modify that to load SubScenes rather than their own custom tiles. Possibly

dusky wind
#

Just sounds like they're using 64 bit fixed point numbers

violet cosmos
#

@dusky wind No:
"World_Mover:
This object is used in floating point fix system to restart world position and it also holds connection between real and local restarted world position. This connection is useful for spawned objects or server communication."

opaque ledge
#

didnt work either @tardy spoke ๐Ÿ˜ฆ

#

this is the logcat

tardy spoke
#

Using the new weird build pipeline asset thing?

dusky wind
#

Interesting

opaque ledge
#

yeah already using it

#

the thing is, its like HybridRendererSystem is not being put into build, last 2 logs shows that i think

violet cosmos
#

Honestly, 7/8ths of the time I don't buy an asset to use it directly, but to get reference code snippets/systems worked out over many years of iteration and users, that I tear apart and make work for me

opaque ledge
#

i thought maybe its about CopyKernel thing, i wrote to forums about it but no answers so far, i dont know what to do really

#

oh well, maybe it will magically go away one day

tardy spoke
#

@violet cosmos yeah that's not a bad plan

#

I'd still have to figure out that async subscene load movement thing though

#

If you loaded it in another world or something then moved it in after it was definitely loaded you could make it work

violet cosmos
#

That's what Unity should be doing behind the scenes when you use the SceneSystem to load

tardy spoke
#

Yeah, it's weird that it didn't move correctly why other entities that were not subscenes of the identical shape did

violet cosmos
#

Hybrid is kind of jank. Remember it's just megacity...

tardy spoke
#

Yeah, megacity doesn't move though haha

violet cosmos
#

They didn't anticipate moving the buildings

tardy spoke
#

exactly

#

What do you figure the issues with moving the whole world would be? Mostly with moving the physics colliders or what? Remember I have no lighting, hahah

opaque ledge
#

custom unlit material isnt being rendered either ๐Ÿคทโ€โ™‚๏ธ

tardy spoke
#

๐Ÿค” that's super weird

tight blade
#

so with renderMeshes, is the idea that I get a reference to them in the main thread and then copy all of the renderMesh.mesh.Vertices into a jobstruct and then copy the vertex data back into the renderMesh.mesh once thats all done?

zinc plinth
#

what do you want to do

opaque ledge
#

imma create a dummy project and try to render stuff, if it works, there is something going on with my project, if not, well..

tight blade
#

for now, make a sinwave on a plane with collision

violet cosmos
#

@tardy spoke Anything that uses the previous world position to calculate something would be affected. Make a particle system, set it's space to World.

Any rigidbodies that are kinematic. Any projectile motion you hand code. Any motion vector system. Any velocity tracking system

#

Not sure how World Streamer gets around that, but they likely have documentation on that regard

tardy spoke
#

Yeah they do have some info on it

#

Hmmm yeah good point about the ragdolls/kinematics

tight blade
#

@zinc plinth so, just like how you'd do it in a shader, but on a mesh instead. position.y += sin(position.x)

tardy spoke
#

My thinking is you just offset them by the movement of the world like everything else

deft stump
#

question on AddHybridComponent on ECS,
can I use AddHybridComponent with monobehaviours?

zinc plinth
#

with collision that's not possible I think, the physics collider is already baked

tardy spoke
#

OR... don't use ragdolls or physics that break everything ๐Ÿค” lol

#

Dumb it down to 90's with death animations.

tight blade
#

oh, thats fascinating

violet cosmos
#

@deft stump AFAIK, yes

deft stump
#

hrmmm

#

ahuh

#

it did work

#

wth

#

I've been hacking at this for 2 daaays XD

#

that's a waste of 2 days lol

violet cosmos
#

Also, @deft stump if you figure out how to get MonoBehaviours that implement a custom namespace through deserialization, that would be a neat trick

amber flicker
#

@opaque ledge how about if you remove the HYBRID_RENDERER_V2 define (i.e. so it doesn't use hybrid renderer) does it render then?

opaque ledge
#

yeah will try, i actually did something to camera, now even in editor entities arent being rendered, even tho v2 is active and they are being used by hybridrenderersystem

amber flicker
#

sounds good - much easier if you can repro in editor

opaque ledge
#

yeah, but now, i have no idea what i am doing

tardy spoke
#

Does pro builder work with ECS/DOTS? lol

opaque ledge
#

maybe i will try that define thingie

tardy spoke
#

Just need to flip some normals

amber flicker
#

if your camera isn't modified too much I'd start with just recreating your camera and light

tardy spoke
#

You're not doing a VR project are ya?

#

Because often the VR scripts replace the camera entirely with their own instance which causes all sorts of weird issues

opaque ledge
#

nah, just android phone

#

never did any VR or XR in my life

tardy spoke
#

Is occlusion culling a thing with the Hybrid Renderer yet?

deft stump
#

I think not

tardy spoke
#

Seems like it's half in there.

#

Or is that just for the frustum culling?

hollow sorrel
#

that's for frustum culling

#

i don't think occlusion culling is gonna help you much in an open world game

#

it's more useful for indoors where there's a lot of corridors

tardy spoke
#

if you look at my screenshot that cylinder is the player's "fog" that is opaque at 200 meters out

hollow sorrel
#

if you use it to occlusion cull everything behind a little house it tends to end up costing more than it saves

tardy spoke
#

so everything behind that should be culled for performance

#

I have plans to use a lot of weird z-depth trickery and whatnot to make it seems like you're seeing a lot further than you are, but it's all low CPU/GPU hacks because it's an oculus quest game

#

lots of faux distant objects and shit

hollow sorrel
#

not sure if i understand right but if you're just talking about fog from the player's camera

#

that's not occlusion culling

#

you just limit draw distance and yer done

tardy spoke
#

Nah, psuedo fog

#

Well, basically, yeah imagine a hard visual stop at 200 meters or so out. Yeah. Hmm. Good point.

tight blade
#

who was that gent a week ago asking about using animation perfect collision with ECS for a fighting game?

tardy spoke
#

@hollow sorrel should you see the culling actually happening in the scene view with ECS?

coarse turtle
#

I'd imagine so

solid flume
#

I still can't find an ECS framework I can look at and go "right, that's what I want to learn"

hollow sorrel
#

i dunno what hybrid renderer does, but default (non-dots) behaviour is that scene camera is treated as just another camera and so will prevent frustum culling / draw distance

#

because it's just another thing that renders your scene as an in-game thing

tardy spoke
#

Well, whatever, it works in game so ๐Ÿคทโ€โ™‚๏ธ

#

I just figured with the "live game state" setting you'd see it culling

solid flume
#

Unity ECS is too in development, entitas has that weird code generation thing that screws up when you refactor, and I can't find any decent tutorial or documentation on svelto.ecs

hollow sorrel
#

it's a real problem because if your game is heavy you end up rendering it twice so common thing there is to always either fullscreen game window or scene window when you test in editor hah

#

@tight blade dunno if they asked but i think @dusky wind was doing something like that

amber flicker
#

@tardy spoke draw distance is obviously fine for now and perhaps some zdepth trickery will do the job. Ultimately though you might want to just set up the LODing correctly and use imposters for everything >200m.. perhaps.

tight blade
#

yes thats who I was thinking of. but now that Im thinking about it, I dont think they were manipulating the collision mesh at runtime, they were just changing the bounds or something. But... they did say something about the collision hitbox matching the animation

stiff skiff
#

Hey all, does anyone here use the PerformanceTesting package with jobs?

#

I've recently moving some login from a main thread loop, to a nice Job. But I'm not sure how I'd profile this with ProfileMarker's

tardy spoke
#

@amber flicker perhaps! Will have to see how many cycles are saved by reducing geometry considering I have no lighting or textures.

hollow sorrel
#

@stiff skiff so you've got a Test that you can run in testrunner, right? since you're talking bout performance testing package

stiff skiff
#

Yes

#

In the test we build a world, create the systems, do a data change that will be reacted on, then profile a frame, and clean up

hollow sorrel
#

aight in that case, you could schedule the jobs, capture their jobhandle and before your test ends, .Complete() your jobhandles

#

alternatively you could .Run the job instead of schedule but that be less reflective of how it'd be in-game since you skip scheduling overhead

stiff skiff
#

This doesn't help with using the actual ProfileMarker however

#

I'd have to use Begin in 1 system, and End in the system that waits on the job to complete

#

I was hoping that Unity's profiling was a little smarter then that

#

Especially seeing as the jobs do show up in the profiler with names

#

but those names do not seem to be valid sampler names

coarse turtle
solid flume
#

Is there any solid ecs framework that does what it says on the tin and is free/os?

hollow sorrel
#

ah in that case not sure

stiff skiff
#

@coarse turtle Does this work for jobs scheduled parallel ?

coarse turtle
#

I'm not sure, I haven't tried it on parallel yet

stiff skiff
#

๐Ÿ‘ I'll have to give it a shot then

#

I'm using the Entities.ForEach API from the SystemBase here

#

Was hoping that WithName would automatically add the profilemarker, but alas ๐Ÿ˜›

coarse turtle
#

Is there any solid ecs framework that does what it says on the tin and is free/os?
@solid flumehttps://github.com/Leopotam/ecs maybe leo ecs. Might need to look at the blog associated with the repo to see if there are some more details

tardy spoke
#

90's throwback. My game is gonna look like VRML ๐Ÿค”

#

@amber flicker the plan is simply to use fog like that and hopefully some z-depth trickery for far away mountains and whatnot (otherwise it's suuuuper hard to orientate your direction on a huge map. I discovered, haha).

solid flume
#

@coarse turtle Thanks. Also, is mixing and matching the standard workflow with ecs a bad idea?

coarse turtle
#

With Unity's? It's a mixed bag of an authoring workflow.

#

Fits some needs, but not all needs with the conversion pipeline.

solid flume
#

What about third party?

coarse turtle
#

Depends on the framework I guess. Ik svelto can work w/ MonoBehaviours, I never tried Entitas

solid flume
#

Also, what if a monobehaviour contains a reference to its data in a nativearray of structs, and never modifies but just acts on the values in the data. Then, I can have separate scripts that do bulk operations on the data using jobs

#

EnTT works with unity?

#

Also, what if a monobehaviour contains a reference to its data in a nativearray of structs, and never modifies but just acts on the values in the data. Then, I can have separate scripts that do bulk operations on the data using jobs
@solid flume Reference meaning an array index its interested in

#

I couldn't find any decent place to learn svelto

coarse turtle
#

sorry I mixed up the frameworks with Entitias and EnTT.

#

Yeah svelto's docs are lacking - you really only have the blogs and the sample projects

solid flume
#

Entitas was nah since they themselves say pay $90 or your code breaks when you refactor it

coarse turtle
#

and to the index idea, yeah that would work if you just access a nativearray's index per monobehaviour for the data you're interested in.

safe lintel
#

@spark glade just noticed your post about animation samples ๐Ÿ˜… are you using the localization package with dots?

winter depot
#

I am looking to refactor my code and break some of my larger components down into smaller components in my pure ECS project. Previously I was breaking components down into large groups (Offensive/defensive/movement/etc). This allowed me to create native arrays were I referenced the preconfigured component I wanted by index alone, so spawning units was instantaneous and required no sync points. Now I am not sure what approach I would take to keep this functionality. I am considering keeping a "Configuration" type component of each group type, then break them down in probably switches during the spawn job. Any thoughts or recommendations?

vagrant surge
#

@solid flume Entt is C++ so absolutely no

#

it doesnt even work on ue4 lol

#

too modern, it requires Cpp17 and ue4 doesnt support it well

mint iron
#

@solid flume yeah i wasn't a fan of the code-gen, i wrote an addon makes it all work with generics, there's really no need for the code-gen part - but hey makes them money i guess. https://github.com/jeffvella/EntitasGenerics

#

@solid flume Svelto.ECS is pretty good, i haven't used it a lot, but its fast and actually tested in production on the authors games, which really helps steer it in the right direction. @scarlet inlet

vagrant surge
#

@mint iron its pretty fine for them to use the codegen as a sort of soft-paywall

#

after all entitas editor support is very well mantained and its a serious effort

mint iron
#

yeah its fair enough; the performance stats/graphs in the inspector are pretty cool in Entitas.

winter depot
#

Is it viable to preload every entity possible on load of the game to a 2nd world and index them, then reference the entity and replicate it for spawning?

violet cosmos
#

Yes, having staging worlds is the recommended approach. But, be aware that it's better to move all entities rather than try to move one by one

#

I tried making a PrefabWorld for Hybrid entities, but got stuck on the "moving just one" part

#

Using any of the copies, it wasn't a deep copy of all children, and I pretty much thew in the towel once I realized Instantiate and Destroy don't take into account children for Hybrid entities

winter depot
#

I see, I don't know that I would have that same issue as mine is pure ECS, and I am not using child/parent links at the moment. Although I probably will in the future. Maybe not the right solution, thank you @violet cosmos

violet cosmos
#

If you're using Pure ECS, and want to copy just one entity, that actually seemed to work fine

#

Just make a new World. Add your Systems to that world (you can mark them not to auto-bootstrap). Setup there as needed. I recommend the copy system is in the regular world, and you give that system a reference to the prefab world entity manager. (because you're scheduling structural updates)

winter depot
#

Yeah, I will have to do a little more research, but it seems viable. I just am not sure it feels like a great solution to have to copy every component. At that point, I might as well keep my component values separate and reference by index anyway.

#

The biggest thing for me, is I made a very robust and complex dynamic DB with hundreds of tables. I have the power to change every aspect of a level in a matter of seconds from the DB. Right now I have it so that I am only doing 1 sync and build on game load and then everything thereafter is pure ecs. I was building the components out and indexing them, then referencing that index and dynamically spawning things on the fly. I want to really keep that functionality, but my components were too big, and they contain too many bool values that I would rather have as flags to prevent systems from running altogether

violet cosmos
#

An easier way, if you have everything as moderately homogenous archtypes is just to have a IsPrefabTag (there's already one built into hybrid, I think), and all your systems filter that out

#

Hmm. Don't know. I'd suggest checking the impact of not having them, vs tagging them first. If it's negligible, then the decision is obvious

winter depot
#

Yeah, I am thinking there will be very little impact either way, but I still want to adjust for readability and maintenance. Some of my systems are doing way more than they should, and I would rather break it down to a more micro systems approach. I am also concerned with the impact of scheduling more jobs this creates. Its tough when it feels like unity doesn't always have the answers themselves other than "Sometimes the impact of scheduling a job is worse than just single thread" I guess its all a part of the proccess

violet cosmos
#

Yah, scheduling overhead is real

#

There's no way to test though, besides real data and good profiling and logging

near copper
#

Hi, is there anyway to reset the elapsed time of a World so that fixed step systems don't catch up when initializing a new world?

winter depot
#

I haven't tested or looked for documentation, but isn't it just World.DefaultGameObjectInjectionWorld.SetTime()

near copper
#

omg, how did I miss that?

#

thanks, will give it a try

hollow sorrel
#

anyone have a recent code example for blobassets? maybe something that shows creation from scriptableobject + usage in entities.foreach

amber flicker
#

sure, can paste something, 1 sec

minor sluice
#

code monkey has a tut on blob assets and how to create one

amber flicker
#

A little rough but tried to make it condensed. One way to use them anyway - don't need to use BlobArray

public struct MyBlobAsset {
  public BlobArray<Unity.Entities.Hash128> hashes;
}```
```cs
public struct BlobICD : IComponentData {
  public BlobAssetReference<MyBlobAsset> Blob;
}```
```cs
BlobAssetReference<MyBlobAsset> blobAssetReference = default;
using (BlobBuilder blobBuilder = new BlobBuilder(Allocator.Temp))
{
  ref BTaggedBlobAsset blobAsset = ref blobBuilder.ConstructRoot<MyBlobAsset>();
  BlobBuilderArray<Hash128> hashArray = blobBuilder.Allocate(ref blobAsset.hashes, 1);
  hashArray[0] = new Hash128();
  blobAssetReference = blobBuilder.CreateBlobAssetReference<MyBlobAsset>(Allocator.Persistent);
}
dstManager.AddComponentData(entity, new BlobICD() { Blob = blobAssetReference });
Entities.ForEach((in BlobICD blobData) => {
  ref var entityHashes = ref blobData.Blob.Value.hashes;
}```
hollow sorrel
#

thanks! this helps a lot โœŒ๏ธ
saw a couple videos on them at one point which is nice for understanding the concept but it's a hassle to scroll through videos to find code examples

#

they should copypaste what you just posted and make it part of the docs

minor sluice
#

thanks, will probably help me too,
I think I want to turn a set of animation curves into blob assets

amber flicker
#

feel free @tardy spoke et al - there's also a thing called something like BlobAssetStore you can use to make blobs that are associated with subscenes or smth... don't remember off the top of my head

#

@minor sluice you should probably dl the timeline.dots package - they do that in there.

minor sluice
#

they already do that? good to know, thanks!
far in the past, I think I had an attempt where I had a blittable array with the pointers to the same location as component data or something

#

worked, but probably not a great idea

amber flicker
#

yea they do it.. It's useful if you have a lot of keyframes (like the way some packages output every frame as a keyframe) but in my tests and for my anim library I just evaluate the bezier (even finding the cubic roots) at runtime and it's even faster than accessing a blob due to burst being so good - ymmv of course

minor sluice
#

I kinda had it like the regular animation curves did I think, so there were a couple of manually set keyframes but the inbetween positions were evaluated with a bezier curve calculation, yeah.

amber flicker
#

yea it just becomes a pain if you want to support weighted bezier curves - took me a long time to get that right and match Unity. Just as I did they exposed their secret sauce in dots timeline.

spark glade
#

@spark glade just noticed your post about animation samples ๐Ÿ˜… are you using the localization package with dots?
@safe lintel not with dots much, just the generic Unity.UI stuff.

safe lintel
#

end of september feels far away given these things tend to slip later too. is localization shaping up nicely? hard to gage packages on unity's versioning

tardy spoke
#

I didn't read this all yet but @amber flicker want me to toss that code up on the wiki?

Super useful reference material ๐Ÿ˜Ž

amber flicker
#

Yea plz if you don't mind popping it on there - needs more fleshed out content to do with blob assets but it's a start I guess

deft stump
#

you can also attach them to systems as well.
but I'm not convinced of it's safety

tardy spoke
#

@amber flicker it's a zillion times better than nothing haha

#

Also - if DOTS animation isn't ready for prime time yet... what's the current "best" solution for characters/animations with DOTS?

amber flicker
#

my library when it's out? ๐Ÿ˜… - but all in seriousness, if you're thousands of zombie land you definitely want to do gpu texture animation as per joachims github

tardy spoke
#

I'll gladly use your library if that's what it's for, haha

dusky wind
#

@tardy spoke until September

#

Probably Hybrid

amber flicker
#

It's not really for characters - tweening library with a timeline

tardy spoke
#

I see! A DoTween type thing for entities?

amber flicker
#

yea exactly - though it'll do GameObjects & traditional workflow too

dusky wind
#

They honestly can't release an updated animations soon enough

amber flicker
#

unlike DOTween it's also asset based - you design an animation once and use it anywhere or within other animations etc

dusky wind
#

I don't even need the skinned mesh rendering, just give me something where I can read the transform buffers from

tardy spoke
#

The GPU animation stuff from Joachim is crazy

amber flicker
#

yea, though it was fast becoming a common technique due to the terrible animator/animation perf with the traditional workflow. Has some major limitations but 100% worth it for e.g. many zombies

tardy spoke
#

My main concern is documentation/figuring out how to implement it properly. Will have to check out the github to see, reading some blogs on it now

amber flicker
#

Definitely start off with that technique in mind before making animations etc. Should be reasonably quick to get up and running.

tardy spoke
amber flicker
tardy spoke
#

Hmm big disadvantages for me would probably be

A special shader must be used to render the character

The special shader I would have to convert to vertex color which would be tricky as it wasn't made in shadergraph looks like

#

and attachments not being separate is fine for enemies, but probably not for player characters down the line. Tricky stuff.

amber flicker
#

yea and be wary of blending layers and stuff too.

tardy spoke
#

like rendering Z-depth stuff?

#

I have no post or camera stacks, etc.

rancid geode
#

@tardy spoke for skinned meshes for now I am just using the standard Unity Animator, I am finding pretty easy to use non-ecs stuff within ECS world to be honest

amber flicker
#

no sorry - animation blending - it's a technique an animator may expect to be supported and is used heavily in traditional workflow - also things like IK get complicated but I don't think you need to worry about that

tardy spoke
#

Oh, right, gotcha

#

Nah I know a lot about that stuff, I only suck bad at programming. ๐Ÿ™‚

amber flicker
#

I'm headed off - happy hunting

tardy spoke
#

Thanks for the help! And sweet, sweet blob asset code.

#

@rancid geode that's awesome. I'm just tossing a few test NPCs in and was just figuring some workflows to explore.

amber flicker
#

For perspective, on quest using traditional animators I'd estimate you can run up to about 20-50 characters for 10-20% of your cpu budget.

tardy spoke
#

Hmm, that's not toooo shabby. ๐Ÿ™‚

#

All I have to do is hope I never get more than 20-50 people playing the game and I should be good to go

#

God forbid people want to play it

amber flicker
#

well.. I was thinking if they were your zombies... ๐Ÿ˜„ .. it's pretty shabby tbh

rancid geode
#
Unity Technologies Blog

As developers, weโ€™re always aware of performance, both in terms of CPU and GPU. Maintaining good performance gets more challenging as scenes get larger and more complex, especially as we add more and more characters. Me and my colleague in Shanghai come across this problem oft...

tardy spoke
#

Haha yeah, totally. It definitely won't be suitable for the player characters because you want to translate their VR movements across, but I'll give it a shot for enemies... actually, and probably NPC's as well.

amber flicker
#

yea @rancid geode I think that's the same texture based technique, just that Joachim's is dots-ified

#

or wait, maybe that's the baked mesh one

rancid geode
#

never tried Joachim's one, will give it a try (sooner or later ๐Ÿ‘€ )

tardy spoke
#

It'd be cool if Unity had some way to open the projects faster for learning... like if they hosted a cloud server hosting the projects you could log into and look at them somehow hahaha

#

Or I could be less lazy

amber flicker
#

ok4reelthistime ๐Ÿ‘‹ ๐Ÿ˜ด

tardy spoke
#

peaceeee

dusky wind
#

That's just one simple animation though yes?

#

Re: Joachim's GPU animation

#

I wonder what would be required for full state machines worth of animation

deft stump
#

It'd be cool if Unity had some way to open the projects faster for learning... like if they hosted a cloud server hosting the projects you could log into and look at them somehow hahaha
@tardy spoke host unity in the web?
yes please

dusky wind
#

Though at that scale I don't think many people care for such complex animations

tardy spoke
#
``` ... hmmmm
tardy spoke
#

@opaque ledge I just had entities render / not render randomly by turning SRP batcher on and off

#

It wasnt showing any entities so I turned SRP on and they're back... and when I turn it off they're still back... for now at least, haha.

tardy spoke
#

Of course it couldn't be this easy... just trying to do a test to get something to move. Looks like I have to grab this component as a reference from a System and tell it to play or something? Is that... correct?

tardy spoke
violet cosmos
#

It's really tempting to do everything on the GPU. Until you get GPU bound, OR your on a mobile tile renderer. Then it's no fun, and you're looking for ways to move that to CPU on different threads

tardy spoke
#

Yeah, well... baby steps. Let's just get something to animate AT ALL in entities first, haha.

opaque ledge
#

@tardy spoke i actually tried to make URP sample scene to entitites, in editor its fine (except for static objects but thats a different subject) but when i build it to android nothing is rendering

#

i wonder if its because of my android phone or smth

#

i raelly hope that it will randomly start working for me one day ๐Ÿ˜„

tardy spoke
#

lol I may be in the same boat, I can't remember if my last build rendered or not and then both my Quest controller's batteries ran out at the same time - and I don't have any more, so I can't open any more builds on it. I took that as a sign to just ignore it for a year and continue just developing on the computer. I'll come back when it's remotely stable, haha.

opaque ledge
#

yeah, next week i am going to start a new project for pc, and hopefully i will comeback to the game when its stable ๐Ÿ˜„

tardy spoke
#

Haha yeeep. I wouldn't be surprised if by the time my game is nearly at all playable if it's migrated from a VR game to a PC game.

safe lintel
#

oh man i would love it if dots made fluid sim zombies a reality

tardy spoke
#

Yeah... I'll kinda find out... my goal is just to have "a lot" of zombies, really. ๐Ÿ™‚

#

The dream...

safe lintel
#

l4d did some cool things, like in 2, the zombies arent even normal mapped to save on memory

tardy spoke
#

Mine aren't even lit or textured. ๐Ÿ˜

safe lintel
#

looking at his test he could probably push simplygon even further

tardy spoke
#

Just vertex colors..

#

Fo'real. Literally just converting Synty assets to vertex colors for my entire game. Shader just takes the vertex color values, no lighting. It's weird to buy cool assets, and then spend time making them look worse... but that's the crazy things we do for VR w/ a lot of zombies... if it works... haha.

opaque ledge
#

The thing is my game is already in google store, which makes things awkward haha

tardy spoke
#

Hmm... my game is likely 2-5 years from any store. Can't relate. ๐Ÿค”

opaque ledge
#

i put it as beta test so hopefully no one will be able to find the game

tardy spoke
#

What's wrong with it? Does it work? Haha

opaque ledge
#

it does work, but entities arent being rendered

tardy spoke
#

... sounds fun

opaque ledge
#

maybe i should sell it as a feature ๐Ÿค”

tardy spoke
#

Ohh, I thought you meant you had a release that DID work and you updated it and now it doesn't work, haha. Hmm.

#

Yeah, that's not ideal

opaque ledge
#

"we made things invisible so you will have more fun trying to figure out stuff, only the best players can play this game!"

tardy spoke
#

Hahaha man, you're gonna feel bad if a bunch of people buy it

opaque ledge
#

nah its free to play ๐Ÿ˜„

tardy spoke
#

I can't wait to read the reviews, they're gonna be so good

#

Aww can you make it $10 and I'll convince my friend to buy it?

opaque ledge
#

hahaha

tardy spoke
#

I'll be like "yo, this game is SOOO good you gotta buy it man"

opaque ledge
#

new platforms package ๐Ÿ‘€

tardy spoke
#

The platforms packages are mysterious creatures. I feel like I'm just collecting them, like pokemon. I assume my SBP uses them... but I really have no way to be sure.

opaque ledge
#

yeah, at some point, there was a new platform package released everyday

#

and there is nothing on manual to say what they are changing

#

okay unity crashed when i tried to upgrade platforms, not exactly the best sign

tardy spoke
#

Or maybe they made Unity invisible so you will have more fun trying to figure out stuff?

opaque ledge
#

@tardy spoke do you see this log when you run and profile your game or in logcat
"Hybrid Renderer V2 active, MaterialProperty component type count 53 / 128"

safe lintel
#

always

tardy spoke
#

Yeah, pretty sure I see that pop up

opaque ledge
#

so you both seeing it on build ?

#

i dont see that, like thats the problem

#

so its not about gpu instancing or srp batching i think, its just hybrid renderer system v2 isnt active

#

or isnt being put into build, idk

#

imma try to use v1

tardy spoke
#

Do you see it in your console saying it's active/

#

In Unity?

#

It pops up on mine on project open and I think OnPlay

#

well I guess if they render in Unity

#

then it must be in there haha

#

are you using any code stripping stuff or anything

opaque ledge
#

in editor yeah, not in build

tardy spoke
#

Depending on batch settings I did have entities show up/not show up

#

for SRP batching anyway, which is weird

opaque ledge
#

yeah i am, since i am using il2cpp i need to use at least low

#

yeah, i changed SRP batching as well, it stops rendering in editor if i set it off

tardy spoke
#

Yeah, I think that's the same thing I'm experiencing. It works intermittently with SRP batching off.

I'm not looking forward to trying to figure out animation in ECS tomorrow. I know there's virtually no tutorials out there on that subject.

#

I think everyone is waiting for DOTS animation to come out to make tutorials because they said it was coming out a while back, haha.

deft stump
#

Upcoming features... More like, our public to do list!

opaque ledge
#

idk man ECS animation looks kinda scary ๐Ÿ˜„

tardy spoke
#

Yeah, I dunno, I think I'm going to just try to connect it to Animator for now, haha. There's no tutorials on that but I'm hoping that it's as simple as holding a reference to an Animator "component" on a GO and there's some command to play an animation... that may be a dream though.

I probably have to tell the Entity it needs some kind of special mesh and bones somehow and stuff. I bet it's going to be a nightmare.

opaque ledge
#

haha

tardy spoke
#

I wonder if ConvertToEntity script picks up skinned mesh renderer GO component automatically... that'd be nice.

opaque ledge
#

my "haha" kinda loses its point when you rework your 1 sentence to 5 ๐Ÿ˜„

tardy spoke
#

I am a time traveller.

#

That's why I never laugh at things - just in case someone else may also be a time traveller and make me look silly.

#

Time for sleep. Gotta get some rest for another brutal day of trying to develop a game in DOTS.

opaque ledge
#

thats pretty tough world view ๐Ÿ˜„

#

gn^^

solid flume
#

@solid flume yeah i wasn't a fan of the code-gen, i wrote an addon makes it all work with generics, there's really no need for the code-gen part - but hey makes them money i guess. https://github.com/jeffvella/EntitasGenerics
I want to learn entitas + this, but I have zero idea how to start

#

How do ecs packages interact with standard unity components?

#

How do I render anything? Or add physics?

#

How does any of the UI work out?

solid flume
#

Also how on earth do I take input

deft stump
#

for input, I used the new input system. lemme share the system for it

#

I'm guessing in entitas the idea is the same

dusky wind
#

For me, I allocate a buffer of X player input structs

#

The use Entities.ForEach to assign it to the player's using a custom player ID as the index into the buffer

#

And add a public method to inject input externally

#

This decouples the system from directly reading inputs from the input system

#

So you can save the input structs in any way and inject them through the buffer

#

Useful for things like rollback, replays, etc.

manic aurora
#

^ that's literally exactly what i do

dusky wind
#

This scales pretty well too, if you have 100 players, just increase the size of your buffer

last jasper
#

Good morning, does hybrid renderer support multiple materials? I only ever tried with one so far

half jay
#

and getting error

#

So i should separate jobs? I need get children from children of main parent . And solution again will be separate jobs one get children of main parent and pass it to another job and then get children of passed children from first job?

last jasper
#

Just out of interest Ylly, how come you move everything to NativeArray for iterating through the child buffer?

#

It implements IEnumerable

#

@half jay you can also replace the ForEach(Entity a, ref DynamicBuffer<Child> child) with .WithAll<DynamicBuffer<Child>>().ForEach(Entity a) and then set child = bufferData[a]; at the start

#

so reference both through the GetBufferFromEntity

half jay
#

@last jasper tyvm. looks like its work

stone osprey
#

So i need an advice... Lets say i wanna implement a progress system which simply iterates over progresses to increase them ( for example chopping a tree spawns a progress with a duration of 5 seconds )... Can we run this in its own job ? Not sure, because we would need to increase it by the delta time

minor sapphire
#

I would probably just have a 'progress' have a start time, and a duration, so all you are doing to 'update them' is updating the visuals by comparing start time, duration and current game time, and finishing when complete. But yes, you can have a job to loop over 'progresses'...

last jasper
stone osprey
#

Thanks ! I think i understand that now ๐Ÿ˜„ so you store the deltatime and pass it simply to the job later on... that makes sense ^^

#

One more question... does it make sense to fire events once the progress started or finished ? Lets say we wanna destroy the tree once the progress finished... it fires a event-entity, we listen to that in order to destroy the tree ?

dusky wind
#

@last jasper Burst does not support foreach

#

Because it cannot compile try/catch/finally

#

Which is what foreach compiles down into underneath the syntactic sugar

last jasper
#

ahh sorry I was confused for a moment - are you referring to the earlier comment about 'why not use the iterator'?

dusky wind
#

Oh I completely misread

#

Yeah

last jasper
#

sorry, that confused me for a moment ๐Ÿ˜„

dusky wind
#

Was thinking you were talking about the actual C# foreach loop

stone osprey
#

Oh quick question... do jobs have some sort of synchronisation point ? Or could we also let a job run parallel to the mainthread "forever" ? Aka... endless loop ?

amber flicker
#

yea @last jasper 's code looks fine to me and will run fine with burst

last jasper
#

@stone osprey that does work, my method might be out dated but I did the same for attacks - see eg https://github.com/ElliotB256/ECSCombat/blob/master/Assets/Battle/Combat/Attack/ApplyInstantEffectsSystem.cs for the 'tool' which creates an effect (eg, a laser gun creating an attack entity once the cooldown is ready) and https://github.com/ElliotB256/ECSCombat/blob/master/Assets/Battle/Combat/DealAttackDamageSystem.cs for the actual damage dealt

dusky wind
#

@stone osprey usually the parallel jobs have an additional inputs

#

That limit their scope

#

IJobParallelFor is limited by the indexes it covers

#

IJobChunk is limited by the chunks in the query provided

#

Jobs tend to run sequentially and are scheduled sequentially based on the component read/write dependencies

#

There are several hard sync points and it's generally advised to avoid adding more

stone osprey
#

Thanks @last jasper @dusky wind ๐Ÿ™‚ im using unity & dots for my client... im trying to reconstruct the job system for my serverside java ecs... thats why im asking those questions ^^ what are those "hard sync points" ? Does the ecs wait for the jobs to finish at the end of the frame ?

dusky wind
#

@stone osprey any system that calls CompleteDependency becomes one

#

Generally speaking the EntityCommandBuffer systems are hard sync points

stone osprey
#

Ah alright... so basically jobs are running on multiple threads for a short duration of the frame in order to balance workload... every command buffer forces them to join which basically finishes the jobs till they are getting started again during the next frame ?

minor sapphire
#

can components be shared between worlds...?

zinc plinth
#

no

#

each world has their own store

minor sapphire
#

damn

#

I probably should have said entities, but you got what I meant I think ๐Ÿ™‚

amber flicker
#

if you think about it, if they could be shared, the Worlds couldn't be independent.

minor sapphire
#

yes true. I'm just trying to figure out how to solve my problems lol

#

The netcode sample has a server world and client world, and it has many advantages

#

but what if you want to run both server and client on the same process, as host, or a single player kind of experience, but avoid duplicating work that both the server and client would need ๐Ÿ˜

#

e.g. procedurally generating a world

#

would rather do it once and share the results in components in both worlds... perhaps the answer would be to have the client be aware that the server is running locally and go copy stuff from server world rather than generate it itself

trail burrow
#

there is no reason to run server and client in same process as different insances of the world other than testing/debugging

#

and for testing/debugging you can live with the perf penalty

minor sapphire
#

the reason would be single player without a single player specific code path, or 'hosting' a multiplayer game rather than running a dedicated server

trail burrow
#

that would not be designed that way

#

you just run server+client systems at once (which is a stupid split, server/client... it should be something like simulation/simulation prediction/rendering split, on the same world)

minor sapphire
#

right thanks for the thoughts I will think about a single world architecture

trail burrow
#

don't look at unitys 'dots netcode' as an example of how to do things properly

#

it's not well structured, at all

minor sapphire
#

fair call, I'm right at the start of this project and considering the architecture options. It did seem convenient how they did it, but obviously I have not seen the full picture

trail burrow
#

i mean unless you are building something which REQUIRES ecs/dots levels of performance

#

I'd just stay clear of the entire dots ecosystem, it's buggy, incomplete, moving slowly forward and API gets reworked at least once per year

minor sapphire
#

hmmm

trail burrow
#

let me frame it like this: If you need to actually finish a game, stay clear of ecs/dots.

#

if you're just playing around for fun, do w/e you want ๐Ÿ˜„

minor sapphire
#

lol, food for thought... the performance has been appealing...

trail burrow
#

@minor sapphire why is it appealing? honest question... are you building a game which needs the level of performance dots offer? because if you're not then you're just wasting time creating a game that is more optimized than it needs to be, when you should focus on making a fun game instead.

#

performance only matters until 60fps (for most games, competitive shooters and such are different ofc), after that it doesn't.

minor sapphire
#

can of course still use burst and jobs, but I'd really like a lot of things on screen in very large battles

#

really I want a large simulation

#

I did some experiments last year with a very large space battle that was promising

velvet sorrel
#

The question is what you really want to build, and do you use the right tools for it

#

You could invest a giant ammount of hours and do it on dots which will be quite an achievment

#

or you could reign in your goals a bit and make something you can actually finish

#

Besides you don't need the magic of dots or jobs to make a high quality performing game

#

From your questions I have the feeling you want to make something with multiplayer/networking. Dots/Ecs won't help you here at all, more likely hinder you

#

Being able to draw half a milion characters on screen is cool and all because all they do is walk forward, since any complexity screws itself, but you won't be able to sync them anyway

minor sapphire
#

hmm

#

lots to consider...

velvet sorrel
#

I have seen a mid size studio loose 2 years of their development because they wanted to ride the DOTS/ECS train for there whole game, but the changing API, instability and the complexity and limiting factors made them literally dump it and start over in monobehaviours and they now have a working game in 6 months.

#

Because half of the unity engine can't be operated with from job threads, or from DOTS.

#

it's just.. maybe it will be finished in a year or 3 from now

trail burrow
#

Yeah @velvet sorrel is correct

velvet sorrel
#

but don't use it for any serious project

#

I start to think the whole DOTS thing was a thing for PR, and to ride the ICO train for investors.

#

It is not an actual product anyone can actually use

#

or should use

amber flicker
#

There is a sorta meta point here re making a game. It's really tough to stand-out. Right now dots tantalisingly offers 'wow, millions of things, much detail'. I think as an indie, having that as a crux could be a recipe for disaster. I personally don't think this channel should become a 'should you dots' channel though ๐Ÿ˜„ .

trail burrow
#

@amber flicker Well that channel could be a locked channel, with one post in it with a giant red "NO", so :p

minor sapphire
#

lol

velvet sorrel
#

Recently i saw on the dots forum some guy writing he was using DOTS in his game and even the Unity Director of DOTS came out and asked YOU ARE USING IT IN PRODUCTION WOW

#

๐Ÿ˜„

#

Standing out with your game is not with using some obscure way to create high performance in edge cases

trail burrow
#

it's way harder than that

velvet sorrel
#

no its by using innovative ideas and concepts and creating a fun game

#

Dots doesn't cater at all to indy devs, too complex and limiting

#

dots doesn't cater to the professionals either, because they want something that actually works.

north bay
#

DOTS does cater to us maniacs in this channel (:

velvet sorrel
#

so lets ask the basic questions: Are you an industry professional? If yes, you use it throughout your project or only on specific points, if not Do you want to make an actual game or just making experiments for fun?

minor sapphire
#

Is there anyone using it in prod apart from like that one stickied post in the forum...

velvet sorrel
#

no.

minor sapphire
#

lol

velvet sorrel
#

All the companies I had contact with that experimented with it quickly gave up on it

trail burrow
#

ditto, nobody using it

#

it's buggy, incomplete, moving slow, etc.

#

all while the existing working parts of the engine

#

are left on the wayside

#

to rust away

velvet sorrel
#

Between us we have a lot of industry contact i think @trail burrow so yeah you heard the same feedback as me.

trail burrow
#

Yup, nobody using it as far as I know.

#

There's SOME limited examples i know about of studios doing like mesh deformations and such with it that I know... but that's just jobs+burst and very small math stuff, which yeah... it works for that

velvet sorrel
#

Yeah very small scope

trail burrow
#

But building entire game on dots? nah... i mean Unity ECS isnt even proven as an architectural pattern yes... nobody knows if it scales up to a large team in terms of workflows, etc.

#

Ignore all the technical issues

#

The platform itself isn't even proven

#

Who in their right mind will jump on that ship if you have to invest years of work and tons of money into a passion project?

#

Risk it on unproven tech?

#

In general ECS isn't even proven as an architectural pattern for games yes - yeah there are SOME examples out there like Overwatch, etc. but 99% of all games are still OOP - and have been for a long time. Yes OOP has its flaws, but they are KNOWN flaws which you can work around.

#

ECS as a pattern has ton of flaws also most likely, they are just 'unknowns' atm.

velvet sorrel
#

You can apply knowledge of how a computer works in key area's not to make pitfalls with OOP and make any specific code performant if you know what you are doing, you dont need ECS for that.

#

as example I found that in a project bullet hitdetection was using too much processing power (for 10k bullets about 9 ms) all being mono behaviours, after spending a few days now they are still mono but run 50.000 in 2 miliseconds.

minor sapphire
#

I admit I've been away from unity for quite a while lately, but last time I was active it seems dots was on it's way to replace MB workflows lol

velvet sorrel
#

that's never going to happen

trail burrow
#

@minor sapphire that is never happening lol

#

ever. ever.

velvet sorrel
#

that's actually insane if anyone in our out of Unity would claim that

trail burrow
#

They even publicly said the inverse

#

They have NO plans to ever remove GO/MB system

#

And will keep improving it

#

this is from their latest Q&A which is just like a week old

last jasper
#

(๐Ÿ™‹โ€โ™‚๏ธ I actually quite like dots)

minor sapphire
#

so you basically think ecs is a waste of time for unity?

trail burrow
#

@minor sapphire yes, 100%

#

jobs+burst is nice for math acceleration tho

#

like you need to do some expensive math operation can put that on a thread, fine yeah sure

#

it's good at that

amber flicker
#

Are you guys both here just to diss dots and put people off it? ๐Ÿคจ

velvet sorrel
#

They could have spend the time way better and help their actual clients with a better .net runtime for instance? ๐Ÿ™‚

trail burrow
#

@amber flicker I usually have a lot of technical conversations about optimization with people in here ๐Ÿ™‚

#

This just happened to be about whats wrong with DOTS

#

nothing wrong with that

last jasper
#

(Personally, I've shipped just as many games with dots as with monobehaviours ๐Ÿ˜„ )

minor sapphire
#

well to be fair it is actually helpful for me at project start to hear these opinions ๐Ÿ˜„

#

Elliot, got some links?

last jasper
#

I guess you didn't get it ๐Ÿ˜„

minor sapphire
#

or is it... 0

#

ah fair enough

#

lol

#

a bit slow I am

velvet sorrel
#

I think you hobby guys here are all Guinea pigs... If your projects fail no money is lost

#

the chance to fail is quite high

last jasper
#

Yeah, in fairness it's easy for me to try dots out when I just do it in my evenings and it isn't my main bread and butter. I do like what I've seen though, and I'm really excited for when it is ready

trail burrow
#

@last jasper Yes, please don't missunderstand me/us (cant speak for fse_vincenzo) here - if you're just playing around, learning, do whatever you want.

rocky basin
#

Didn't Overwatch implement some kind of custom ECS architecture? I'm late to the discussion, but are we talking about whether ECS architecture is practical for games or not?

trail burrow
#

But if you actually have a business and a game that needs to be financial success, stay away.

last jasper
#

I have ported some of the ideas over to my main job (physics), and got some really nice ECS simulations that run orders of magnitude faster than other codes out there (using the rust specs library)

#

but that might be a comment on academic programming standards rather than anything else ๐Ÿคทโ€โ™‚๏ธ

trail burrow
#

lol ๐Ÿ˜„

rocky basin
#

Oh, Overwatch was already mentioned

trail burrow
#

@rocky basin Yes there are a few examples of finished games using ECS, but ECS as a whole is still fairly unproven as an architecture for games.

#

But that was more a side track vs the main conversation

#

We are using ECS for our stuff also (not unity ecs tho)

#

But it's good to be aware of

velvet sorrel
#

And it was build by industry professionals on a custom for the game framework etc etc.. and very specific to their use case, they def were not using Unity ๐Ÿ˜„

trail burrow
#

That ECS as a pattern/architecture is unproven really

rocky basin
#

I see it more like something that's good for specific systems, not necessarily everything in your game.

#

Like right now I'm implementing my own light probe system and I can imagine it would run a lot faster with ECS

trail burrow
#

would never put something like that in ecs

#

ecs is for game logic/architecture, not for supporting datastructures around

rocky basin
#

I haven't used ECS though. Is it really necessary to convert everything in your project to ECS to make use of it?

last jasper
#

nah

rocky basin
#

It's just another tool in the toolbox in my mind. Like VFX Graph is great, but I'm not going to replace every game object with a VFX particle.

#

@trail burrow I need to update a bunch of renderers with new light probe data if they've moved. Is that not something that would be faster in an ECS system where memory order has been optimized and whatnot?

minor sluice
#

a lot of people seem to be thinking of - either functional or oop programming - either monobehaviours or ecs,
when you could just use whatever you want to use as a tool to solve an issue where this tool is a better fit than others, instead of going on the extreme to only utilize one of them

glad jetty
#

Chucklefish use ECS in their 'Halley' engine. Used on Wargroove and their next title.

minor sapphire
#

I agree with right tool for the right job in general, but it does seem that when you use ECS, you're using unity physics, your data is sitting in components, and it's not exactly easy to have a half/half project

trail burrow
#

@minor sapphire correct

#

you can use GO/MB + Jobs/Burst

#

but using GO/MB + ECS in one is a mess

#

and called 'hybrid'

#

and it's useless

north bay
#

Strong words, what's wrong with having your game logic in ecs and using standard rendering, particle systems and audio?

violet cosmos
#

I thought Unity Physics could be easily added to GameObjects without the Hybrid conversation... That the components just injects the Entities they need to run the sim

Was I wrong?

trail burrow
#

@violet cosmos yeah you're wrong

violet cosmos
#

Unity.Physicw doesn't have any dependencies on Hybrid

#

In the package manager

minor sapphire
#

so basically you're talking about GO/MB for presentation only (hybrid)
this would assume that ECS is good enough for the simulation so far.
but then I would expect to see more people using it in prod above hobby projects.

trail burrow
#

@minor sapphire depends on what you mean by good enough

minor sapphire
#

not ridiculously difficult to implement ideas I guess lol

violet cosmos
#

So, experimenting with Unity Physics... It looks like it does require using the "Convert to Entity" component, which does bring with it all of the lag issues with runtime conversion when initializing a plain old GameObject at runtime

#

So while you don't need hybrid, you may lose out on some things

minor sapphire
#

well you only need to do that once right? then you have your entity prefab to clone

violet cosmos
#

@minor sapphire It's super slow. Unimaginably slow at runtime

#

So, you need to load pre-converted entities, which is what Hybrid does in it's poorly designed way through SubScene

#

๐Ÿคฆโ€โ™‚๏ธ

minor sapphire
#

I made a demo with 10k ships, spawning many per frame, I converted one to get the archetype prefab thing, then all subsequent instantiations were via the system

minor sluice
#

at least it requires entities to have a PhysicsCollider component to be marked as static colliders and additionally a PhysicsVelocity to be marked as dynamic I think

minor sapphire
#

I guess maybe you are talking about a scene with a large hierarchy to start with

violet cosmos
#

@minor sapphire The issue I had was that when I called Convert, it would take a long time for even one simple prefab that was loaded with Addressables

minor sapphire
#

hmm ok

violet cosmos
minor sapphire
#

heh

violet cosmos
#

Now, there's definitely the possibility I was doing something incorrectly, but.... I wasn't seeing thousands of entities. It was really just one, loaded by path

#

Entities (core) really just needs a way to flag Prefabs to be converted in editor and saved to disk, so you can load that prefab by Addressables.

But, the only way to get a pre-serialized/converted entity is to use Hybrid and SubScene, which brings with it, it's own shit show

amber flicker
#

I suspect that's because you have a lot of MonoBehaviours.. in which case it comes with all the traditional issues (Instantiation being slow, albeit not quite that slow but not sure if the above is attached to a build). If it were me (though I understand you're not pursuing this root any more) I'd try and separate the MBs & entities out more and pool the GameObjects. You won't ever be able to serialize and instantiate a prefab with a bunch of monobehaviours in, in the same way & speed you can with entities.

violet cosmos
#

@amber flicker No, it only had one really basic one that was used to add the Particles/Renderer, and one or two IComponentData with GenerateAuthoringComponent

#
    {
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            conversionSystem.AddHybridComponent(GetComponent<ParticleSystem>());
            conversionSystem.AddHybridComponent(GetComponent<ParticleSystemRenderer>());

            dstManager.AddComponentData(entity, new PrefabToEntity { PrefabReference = entity });
        }
    }```
This was it. Seriously.
amber flicker
#

I'm surprised it took that long - I don't think it would in a build. That aside, like I say, I'd create a pool of particles (traditional style) and then have them update their transforms from their entity representations for example.

#

I don't think a hybrid prefab would ever be what you want it to be. A serialized pure prefab can be loaded basically straight into ram directly. A hybrid one has to be deserialized and on the main thread etc - it can't just be a binary blob loaded in.

north bay
#

I wrote a CommandBuffer which can queue commands like playing/stopping. Which than do get played back in a system which handles the pooling and positioning. Did the same for audio works pretty well

dusky wind
#

@violet cosmos what's the range for super slow at runtime?

violet cosmos
#

@amber flicker That's the thing, that's what SubScene does... it stores pre-converted entities into the Scene, discarding what's not needed and is much more efficient to load one

The thing is: Because it's just MegaCity, they never considered that people would want an atomic unit, just one Prefab, because MegaCity used SubScene for each building and building LOD

dusky wind
#

I have had sub second conversion for my simple scenes

#

Then again the only things I am converting are 4 player characters and some colliders for scene interaction

violet cosmos
#

I assume it only goes up, considering how simple my prefab was. Using SubScene did help, but still was a lot heavier than I thought it would be

dusky wind
#

How do non-pure ECS conversions go for subscenes?

#

Namely for audio and particile effects

violet cosmos
#

Stores the Types, and IIRC the data for the MonoBehaviour in a BlobAssetStore

#

It's in SerializeUtility.cs

#

WriteSharedAndManagedComponents

dusky wind
#

Ah ran into that earlier when researching rollback

#

Interesting

violet cosmos
#

In the Unity editor, release mode, experimenting with Physics.... Converting three cubes and a plane with the minimum Physics components to entities takes 200-500ms, depending on... Don't know. Seems to fluctuate

#

Part of that might be creating the worlds and systems first go though. The first conversion takes hundreds of ms. Converting subsequent entities takes 32ms

#

Still.... Not sure why that takes so long. If I'm making a VR game, I don't know when I can acceptably wait 200-500ms without drawing a frame. Maybe if the screen is all black?

#

Creating the conversion world is... slow

#

I can't imagine how that would run on a mobile chipset

#

Also, it looks like the Conversion world isn't pre-loaded, only when first called

Hot tip: load some entity to be converted, even if it's just an empty GO with Convert to Entity when you can deal with up to a second of no frame. It'll initialize the Conversion World and Systems, and subsequent conversions will be faster

#

Not fast fast, but faster

safe lintel
#

afaik conversion outside of the very start of the game isnt really supported or encouraged at all, not really sure what youre trying to do? i do wish topher still posted here

violet cosmos
#

Was chatting with @dusky wind about converting at runtime, and why I found out it was a bad idea ๐Ÿ˜„

#

Before, and validated again, but with a new nugget of info

#

The thing about conversion is that if you can't convert at runtime, you need use SubScene, which isn't ideal for many use cases

#

You also can't just "build up" something at runtime either, everything needs to be authored beforehand

#

.AddComponent at runtime isn't encouraged either, but sometimes it's useful in certain limited scopes

safe lintel
#

you should take this issue to the forums and let them know because so far ive seen zero indications they have any plans to do otherwise

#

just a note they do plan to have an entities equivalent of addressables sometime soonish but how soon in their timeframe is anyones guess

dusky wind
#

I don't see why you can't use it with addressables right now

violet cosmos
#

I can't imagine Unity doesn't know that SubScene is untenable and being able to load one thing via Addressables is clearly not present, and makes the workflow.... annoying

dusky wind
#

Subscenes are just binary blobs

violet cosmos
#

You can't load just a thing. That thing needs to be in the SubScene

dusky wind
#

Which can be used as TextAssets in Addressables

#

Though thinking harder about it

#

What's stopping people from using Subscenes like they do prefabs

violet cosmos
#

You load SubScene by their ID, which you need to get by the SubScene component. It's not addressable that I've found. There's maybe a backwards way of linking the SubScene to an SO, because you don't load it with Addressables, you load it with SceneSystem

#

You CAN load it with addressables, but there's not really an affordance to slip that into SceneSystem without reloading it again IIRC

#

It's designed so that SubScene exists as an instance within another GO scene. It doesn't have to be loaded, but you use SceneSystem to load it by it's ID in the scene. It's semi-static, not just a resource like a texture you can just load and do what you want

#

You could maybe hijack that with authoring tools, as I said, but... It's not the way it's designed right now

dusky wind
#

Interesting

violet cosmos
#

Trust me, I went down this route haha

dusky wind
#

I have been working at a lower level for quite some time

#

Directly interfacing with SerializzeUtility

#

I thought it'd be simpler than that

violet cosmos
#

Yah, I thought about doing that. Do you have a util that serializes prefabs into some file, and then load that file via Addressables to deserialize again?

dusky wind
#

Pretty sure you can essentially make a prefab like workflow with it though

#

Not yet no

#

But the idea is relatively simple

#

Create a dummy world, convert the prefabs into it, serialize it to a file

#

Load that file via Addressables, deserialize it into a loading world and copy into the main active world

violet cosmos
#

Yah, you can, kind of. There's still other downstream restrictions though. Right now, the only real way to copy an entire hierarchy is to move it to an empty world, and then use Move from that empty world's EntityManager to the target

Otherwise, you have to write your own archtype/chunking mapper

dusky wind
#

Does serialization include blobassets?

violet cosmos
#

You can't copy full hierarchies. It just clones the top level for some reason

#

You might be able to by referencing the original GameObject though

tardy spoke
#

Anyone have any resources they've come across on ECS and animation that are remotely recent? Trying to round some up. I've seen the Joachim GPU texture animation github thing... anything else? Hahaha

dusky wind
#

I've been trying to get something working with Hybrid

violet cosmos
#

Also, Instantiate and Destroy in EntityManager only deal with the top level, not children, so you need to have separate code paths to deal with GO made entities vs system made entities, and be able to tell the difference

dusky wind
#

No success yet

safe lintel
#

@tardy spoke its a wasteland

violet cosmos
#

@dusky wind Honestly, I'm now currently thinking of using DOTS for just Jobs, and maybe Pure ECS for systems (via custom Worlds and Systems) that can run independent, it's just a calculation system to copy into the GameObject world

safe lintel
#

if you search snacktime's posts you can glean some info as he is working with it but besides him I havent really seen anyone else do anything with it or claim to have done anything

violet cosmos
#

ECS would be mostly.... decorative, or much standalone input data and calculated results that are easy to query

tardy spoke
#

@safe lintel yeah, I just mean connecting ECS to ANY kind of animation. Not even DOTS animation. Even just holding a reference to Animator, etc.

safe lintel
#

supposedly in late september there will be a samples update (assuming alongside a package update). someone else jokingly asked a different unity dev and got a more straightforward answer than what the animation team has given out)

violet cosmos
#

Hybrid is a bit of a mess, too many layers of hacks on not a well thought out system. I would rather it had less things it did that worked well and were documented, then a spaghetti mess of half baked things to make a few demos

safe lintel
#

if you want a reference to a UnityEngine.Animator just add it via AddComponentObject?

#

its what i do all the time, im kneecapped by animator's less than dazzling performance but it does mean dots ragdolls with skinnedmeshrenderers

tardy spoke
#

Lol the thing that I find interesting is if instead of Megacity they did "Small Moving transforming city" their ECS implementation would be entirely different.

dusky wind
#

@violet cosmos probably the most stable way to do it right now

#

It doesn't afford you the performance benefits

#

But if you don't need massively scaled worlds

#

It's a viable solution

tardy spoke
#

@safe lintel yeah thanks, that's what I'm talking about. I just haven't used animator in Unity yet at all so I wanted to make sure that would work with entities. Didn't know if convert to entity would bring the bones and all that across.

violet cosmos
#

@dusky wind I'm not going for "draw all teh zillion thingz!! zomg!!" .... I'm going for the absolute tightest lowest latency game loop I can

safe lintel
#

it doesnt(if you mean inject) ๐Ÿ˜„

dusky wind
#

Then I'm not sure if ECS is the right solution without the right tooling

violet cosmos
#

It's not, for me

dusky wind
#

Queries take a lot of time

#

Idk wtf they are doing, but it needs to be faster for smaller worlds

violet cosmos
#

Agreed, I feel there's a lot of stuff in place that's structured around the default bootstrap worlds that doesn't need to be in place for smaller system worlds

dusky wind
#

I am using ECS strictly for determinism and easy state snapshotting

amber flicker
#

burst/optimized systems/jobs are something a lot of us are hyped for - single entity systems take way too long atm - I'm hoping before the end of the year

dusky wind
#

Everything else is secondary

violet cosmos
#

But... I need to get back to actually making a game. These last few weeks, I've just proved to myself that Hybrid is a mess and I won't be able to use it for awhile

safe lintel
tardy spoke
#

@safe lintel wait, so is this a "if you have animator on the GO at authoring and convert to entities script, it'll set it up properly" or a "it won't move half the crap you need, so you gotta add the components yourself to get it working"?

#

Right

safe lintel
#

the latter with inject

tardy spoke
#

ah k. Hmmm.

dusky wind
#

@safe lintel is that with the Unity DOTS Physics and a GameObject skinned mesh?

safe lintel
#

i can share my setup if you want, probably need to adjust it(its basically based on the joint conversion code that resides in unity.physics.hybrid)

tardy spoke
#

How is there not a single tutorial on this, hahah that's crazy

safe lintel
#

@dusky wind yeah

dusky wind
#

Ok excellent

#

Are you reading the data back and forth via CopyTransformTo/FromGameObject?

#

That part isn't well documented

safe lintel
#

more or less, i have some simple systems that do it but the builtin ones use localtoworld and you need to copy to/from translation and rotation for physics

dusky wind
#

I simply need entities for bones to be in the right place

#

This is encouraging

trail burrow
#

Since when was ecs deterministic?

tardy spoke
dusky wind
#

@trail burrow it is on the same platform

#

And that's good enough for me right now

trail burrow
#

w/o burst its only deterministic on the same machine

#

/w burst its same architecture i think

dusky wind
#

I mean assuming with Burst or otherwise Strict compliance with IEEE 754

#

which I'm not sure if Mecanim/Playables is compiled with, but I'll find out soon enough

trail burrow
#

the rest of unity is 100% not deterministic across machines, ever.

#

animation systems, phsysics, audio, etc.

#

navigation

#

or even core math functions on Mathf

dusky wind
#

Well that's unfortunate for now

#

Animation is the only thing I am missing from my full proof of concept

trail burrow
#

but yes if you put everything into burst, AFAIK it is deterministic across one architecture

#

but it could be arch + platform combined

#

i.e. x86-64 + windows

#

etc.

dusky wind
#

I've yet to test that

#

Joachim claims it works across the same architecture consistently

trail burrow
#

in burst yes

#

not the rest of the runtime

dusky wind
#

I have yet to test whether that's true

safe lintel
#

@tardy spoke not sure if it will fit your needs but ill share the conversion code in a bit, gonna walk the dog

trail burrow
#

joachims claim is only in relating to burst

dusky wind
#

That's fine, my simulation is strictly in Burst right now

#

And come September, maybe Animations will too

#

I haven't tested Windows - Mac over the network on this simple setup just yet so I can't verify Joachim's current claims that Burst is architecture wise deterministic

#

But I have workarounds in the case deterministic animations are not going to be available in the near future

trail burrow
#

we're building our own animation system from scratch

dusky wind
#

I wish I had the manpower for that, haha

trail burrow
#

hardest part is finding people that know what they are doing

dusky wind
#

My project is FOSS, and I have no intention on monetising the project

#

So $12,000/year is infeasible for it

dense storm
#

I tried creating an empty project with 2020.1.2f

#

But I don't see Hybrid Renderer package anywhere

dusky wind
#

For me to use Quantum (or most Asset Store assets)

trail burrow
#

yeah understandable

dense storm
#

Is it built-in now?

tardy spoke
#

@safe lintel awesome, thanks. I'm going to try to follow this tutorial even though the code is older, I think I can convert it fairly simply. I'll let you know how it goes, haha.

deft stump
#

I tried creating an empty project with 2020.1.2f
@dense storm they made it harder to get it.

violet cosmos
deft stump
#

lemme link you the way

dense storm
#

What why?

#

LOL

dusky wind
#

@dense storm they intentionally hid it

deft stump
#

oh there it is

#

What why?
@dense storm coz madlads like us exist

trail burrow
#

@dusky wind how does the game look?

#

it was a smashbroos

#

thing

#

right?

dusky wind
#

Visually? I had a pretty good set of stages and characters before switching to ECS

trail burrow
#

yeah visually, im no artist just generally curious ๐Ÿ˜„

dusky wind
#

I haven't imported the assets yet so it's just capsules right now

trail burrow
#

ah ๐Ÿ˜„ good ol capsules

dusky wind
trail burrow
#

ah, waifu game ๐Ÿ˜„

dusky wind
#

Haha

#

Yeah

#

It's a fangame for what it's worth

#

Also why I'm not monetising

trail burrow
#

aha

#

i am very not, "in", on all the eastern stuff

#

have no clue about it other than the really famous stuff

dusky wind
#

The original creator of the franchise is very lax with copyright and trademark

#

So you'll find even fangames of the series for sale on Steam

deft stump
#

why is reimu black though?

dusky wind
#

I don't think we had the textures on her in those shots

#

Mostly just rig tests

deft stump
#

I find it oddly fitting for her

dusky wind
#

Just had material colors, haha

#

Are there any good ways of drawing gizmos of entities

coarse turtle
#

but you wouldn't be able to redistribute it

dusky wind
#

It's really rough trying to figure out the locations of colliders without it

#

I'm half tempted just to add a Graphics.RenderMeshInstanced call in system somewhere

coarse turtle
#

another way is to just push it to a buffer and access it in a Monobehaviour and draw everything in OnDrawGizmos() as an editor only tool (probably not ideal)

violet cosmos
#

I actually just bought ALINE

deft stump
#

wow

#

oh man

#

ever since uninstalling entities, my unity isn't eating too much ram now

manic aurora
#

i couldn't imagine working on a large project...my current project is toy scale, and i still spend a depressing amount of time on "refresh asset database" and "enter play mode".

amber flicker
#

compile time you mean? @manic aurora

manic aurora
#

i don't like...rightfully know. i haven't invested anything in trying to narrow down what it's actually doing. i assume that's part of it. i assume code generation is part of it, too. i don't know what gets cached

amber flicker
#

Project Settings -> Editor

manic aurora
#

oh my god it's instant

#

i'm gonna cry

deft stump
#

there there

amber flicker
#

feels good knowing how much that's going to improve your life

#

just a word of warning though - it's experimental because any statics won't get re-initialized - so you may have to fix up some of your code

manic aurora
#

ohh i read about this, that's easy

deft stump
#

now that I'm back coding in oop, I need to structure my code (hello onenote!)
also, non-dots question, can you download the custom assemblies off the web?
like, can I make them addressable?

tardy spoke
#

Well there's your problem... ๐Ÿค”

Is there a smart way to keep the animator alive while converting the rest to an Entity? Maybe a different conversion workflow.

I need to store the animated characters in the subscenes themselves which may be interesting... hahah.

rancid geode
#

How is your OneShotAnimationAuthoring?

tardy spoke
#

generateAuthoringComponent, it's just a tag

#

I've been doing some experiments with holding the ref to the animator in another component to try to figure out where it is/where it's going, and that's what indicated it was destroyed... Not sure how to lay this out so that the Animator won't be destroyed but it'll still have access to it, particularly from a Subscene

rancid geode
#

With Convert&Destroy it will get destroyed for sure, what you are looking for is either AddHybridComponent or to use Convert & Inject instead

tardy spoke
#

Right, never messed with hybridComponents. Probably what I'm looking for. I'll try an experiment with convertAndInject to see what happens there as well

rancid geode
#

AddHybridComponent basically copies the Component into the Entity, but with a "companion GameObject" (which is created just to hold the UnityEngine.Component for that entity and should never be accessed directly)

#

so it behaves most like a "Convert & Inject into Hidden GameObject" ๐Ÿ‘€

tardy spoke
#

wtf

rancid geode
#

I would consider that a feature, liked the visual ๐Ÿ˜‚

tardy spoke
#

But hey it animates! Let's ship it

#

It's also 10000 times bigger than it's supposed to be

manic aurora
#

can't wait to play your horror game

safe lintel
#

kinda looks amazing

tardy spoke
#

i'll take a vid it's bizarre

safe lintel
#

i had this bug before but it wasnt when using entities

tardy spoke
#

lol it's probably something to do with the structure of the character, I'll reimport

safe lintel
#

its not "bizarre", its "indie" ๐Ÿ˜‰

tardy spoke
#

Weird, hahaha. It did it again... yeah it might be non ECS related

safe lintel
#

dont suppose you updated the editor?

#

wait

tardy spoke
#

That looks very similar

trail burrow
#

Something is broken in dots? Color me surprised

safe lintel
#

imo its vanilla broken unity

tardy spoke
#

I'm glad I was just trying random stuff... that was lucky

#

Welp, putting him into a SubScene pretty much stops the entire SubScene from running... was fun while it lasted ๐Ÿคทโ€โ™‚๏ธ

#

I'll do a test with the entity just holding a reference to a GO outside the Subscene that has the animator... if that's possible, haha. I think it is

safe lintel
tardy spoke
#

@safe lintel thanks! Did you ever get any of em working in a Subscene?

harsh owl
#

Let's say I have a system that handles if my crops are properly watered. The logic is mostly the same for Temperature, PH and Mana (magic herbs, etc).
The system uses about 6 data types, like SoilNutriendDataWater, PlantWaterMinNeed, PlantWaterMaxNeed, PlantNeedWater, PlantWaterBuffer, PlantWaterBufferMax
Is there a way to quickly declare the same types as above but for Temperature, PH and Mana (without a massive amount of ctrl+c ctrl+v)?

safe lintel
#

no, i dont think it works with subscenes at all

tardy spoke
#

Yeah... hmm... I'm not really sure if any of the animation solutions will really work with Subscenes. Might explain why there are no people walking around in Megacity, hahaha.

safe lintel
#

i think joachim's gpu thing did work with subscenes

tardy spoke
#

The GPU texture animations are probably the most likely to work

#

yeah hmm

safe lintel
#

i had issues getting shadows to work, and then sorting issues on the shader

tardy spoke
#

Luckily I don't have shadows ๐Ÿค”

#

Is it painful to get that stuff working or fairly easy? Like is there any tooling built at all for the GPU stuff or is it like an entirely manual process

#

GameObjectConversion pipeline is provided to bake existing Unity Character Rigs & AnimationClips into GPU Skin renderers. hmmm

safe lintel
#

it was fairly simple to get it working, i think my main issues were: no rootmotion, no attachments, no possibility to use as ragdoll physics, shader stuff

#

with the gpu repo

amber flicker
#

@harsh owl I don't know how much this helps but if you have a lot of shared logic and data, perhaps the components could be simplified to their principle data. E.g. 'MaxNeed', 'MinNeed' of even Min & Max etc? Then just tag your entities with 'Need', 'Plant' or something where needed?

tardy spoke
safe lintel
#

oh cool hes updating it

harsh owl
#

@harsh owl I don't know how much this helps but if you have a lot of shared logic and data, perhaps the components could be simplified to their principle data. E.g. 'MaxNeed', 'MinNeed' of even Min & Max etc? Then just tag your entities with 'Need', 'Plant' or something where needed?
@amber flicker That would require me to have multiple entities for a single plant

amber flicker
#

ah, I see. You could put add them as buffer elements instead. If your data and processing is really similar I'd likely do that. If not then you could look at using generics but I found in the past that can be a little fussy to get working in builds.

violet cosmos
#

Is there a way to use Burst on arbitrary functions outside of a job?

#

(assuming the function has no reference variables)

tardy spoke
violet cosmos
#

Hybrid may have a problem using AddHybridComponent to MonoBehaviours that are in a namespace... I wasn't able to fully validate if it was that, or a serialization/deserialization refresh issue

#

But, not sure if that's your issue

safe lintel
#

need to put that gpu animation package into your packages folder if you havent already

#

its separate from the gpu animation samples

tardy spoke
#

Yeah, I'm pretty sure I did... hmm

frosty siren
#

Can we manually change filters for systems? I'm in case when i use GetSingleton/SetSingleton and it causes additional queries and system calls OnUpdate every frame cause there is always singleton exists

#

(one another reason to not use Singletons :D)

dusky wind
#

@tardy spoke is this pure Entities? With DOTS Animation?

#

@frosty siren a hack is to put the state directly in the System itself if the state is not changing

#

If it changes once or twice a game, just have a NativeArray owned by the System itself

#

If it's constantly changing, it might be a good idea for singletons

violet cosmos
#

Or SharedBuffer?

tardy spoke
#

@dusky wind nah I'm just trying to get Joachim's GitHub GPU animation stuff to work, haha. As in literally just trying to open the old example project on GitHub.

mint iron
#

i would kill to see a working dots animation sample

violet cosmos
#

"jobs" was likely one of the worst names Unity could have picked

Search results come up with crap like "how to get a job in the game industry" and the like

#

Does anyone have a good overview how to break down large systems into Jobs?

opaque ledge
#

hahaha

violet cosmos
#

These are the first search results for "unity large systems jobs"

#

:P

odd bay
#

Unity didn't come up with the "jobs" terminology

deft stump
#

There are other engines out there that uses the job terminology

#

such as the telescope engine

dusky wind
#

@violet cosmos that's... a big topic. Distributed/multi-threaded computing are good points to start.

#

Only reason why I'm well adjusted to it is a bachelors in computer science and a day job in big data, orz.

#

Good luck, it's a huge rabbit hole.

#

Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without unintended interaction. There a...

#

Unity's approach mostly uses atomic operations and block based mutual exclusion.

#

Unity's systems are generally set up so that, unless you intentionally disable safety features, you should never do something inherently unsafe.

#

at least in the editor.

#

Perhaps by the normal nature of my day job, I tend to use the MapReduce paradigm a lot in my C# jobs

#

and it works out very well.

#

Map -> Transform input X to Y in a 1:1 way.

#

Reduce -> Consume Y and reduce it down to a smaller set of Z results.

safe lintel
#

@violet cosmos look at the boids example in the samples repo

dusky wind
#

Since Map is 1:1, most jobs are entirely threadsafe and can go wide easily.

#

Reduce tends to be easy to do so long as the map results are readonly.

#

For this, Native(Multi)HashMap is very very useful.

safe lintel
#

Also pretty much every dots package is using jobs, there's a lot of examples right in the source code

dusky wind
#

The physics solver one is a great example

#

of a decently complex system and how it compartmentalizes into smaller jobs.

violet cosmos
#

OK, another question to help me wrap my head around something... Since Jobs can't access reference data, lets say a series of Jobs results in things like "Add Physics Force Here" or "Add this Struct to this MyClass.AddModifier()"

Is there an example of an ultra-efficient way to do that kind of queue in a generalized way?

dusky wind
#

The latter is usually achieved via EntityCommandBuffers

#

which are a generic "apply this structural change to my entities"

violet cosmos
#

Lets say, pure Jobs, arbitrary things... Not in ECS

dusky wind
#

I would structure it like ECBs then

#

The commands in ECB are just structs

#

they're effectively equivalent to C's unions.

#

I'd then make a Native(Multi)Queue

#

and queue them up in there

violet cosmos
#

That's what I was thinking too. Just trying to figure out how to make something complex, a little more manageable with the reference safety boundary in Jobs

dusky wind
#

And then have a manual sync point to apply those changes on the main thread