#archived-dots
1 messages ยท Page 171 of 1
That's what it choked on rendering.
My MMORPG is going to look like dooooog shit. Noice!
glad its building, it is kind of its own little hell when it doesnt ๐
what is it supposed to look like?
... just kidding
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.
could embrace the retro fad, like me, to avoid your light bake/need for good looking graphics ๐
That's the plan
Hmm I'm no expert on rendering but that looks like the rendering is fairly efficient
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
Hmm, found an interesting thing. Hybrid renderer appears to have some issues batching with my setup.
The keywords are the same. Weird. ๐คทโโ๏ธ
@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?
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
I hate that jobs and burst doesn't work with references
Wouldve been much more painless to make an octree
And basically everything else
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
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?
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
this guy has a linked list you can use in burst https://github.com/jacksondunstan/NativeCollections
This would have saved me so much time
Well good thing I have it now atleast
Only have to refactor close to everything
https://github.com/marijnz/NativeOctree This also exists, for anyone else who might need it
^This doesn't have a lot of functionality apparently
@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
I gave up on the naive surface nets with an octree thing
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
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
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
@solid flume https://github.com/fholm/unsafecollections here's the entire .net collection library as burst-compatible collections
all using native memory
I've never been happier to see something marked unsafe
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
https://blog.molecular-matters.com/2012/09/17/memory-allocation-strategies-a-pool-allocator/
@vagrant surge Kinda went over my head
I'm thinking of working on some ECS stuff in entitas. Try get used to the architecture
@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)
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
@solid flume just different implementations of ECS
unity targets high performance, entitas targets usability, svelto is overengineered (imo)
Why does entitas have a paid version on the asset store
Also thanks @toxic walrus
Makes sense
likely to support the developer
$90? Could've just made a patreon
there's a paypal link on the github too
Ah. Well I'm basically broke anyway
Dunno what I'd do without a student license getting me free stuff
@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)
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
they are already encoded in a special way
or are you using virtual memory tricks to put it allways in the same place
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.
has anyone had problem with their entities not being rendered in a build ?
have you done a development build to make sure you're not getting a bunch of exceptions @opaque ledge ?
which render pipeline? hybrid renderer v2 I assume?
i only get "Kernel CopyKerner not found" error, i posted in forums but no answer this far
yeah, v2
with urp 9 preview 55
mine works ok.. is it a shader issue?
its URP lit
think only support for a single directional light and a couple of shaders
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
I think so - though maybe try unlit just to be sure - urp is really barebones support atm
hmm yeah okay, i will try
what platform are you building for?
also does your material exist in a scene? wondering if it might be inadvertently stripped or smth
android
yeah it does, i put material in a monobehaviour, and my prefabs are in scene (they are converted to entity prefabs at runtime)
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?
even simply cylinder doesnt being rendered, they are being rendered if i dont convert them to entities
yeah i am
are you using SubScenes @opaque ledge ?
no
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
i actually get some errors that Lit and BakedLit arent srp compatible i think, let me check
I remember having some similar issue
i didnt mind them at first since it works in editor
you guys think thats the issue ? maybe i should try with unlit
can't hurt to quickly try.. not sure why you're getting those errors
@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
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.
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?
Gearless, I think there is an example of procedural mesh on the tiny examples
ooh, the tiny examples?
@tight blade it worked great, can only combine meshes on main threads but ehh
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
are these the tiny examples? https://github.com/Unity-Technologies/ProjectTinySamples
@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.
how do i turn off srp batching ?
Good question
i know right, i dont think there is an option for that, never saw it
ah alright, will check thanks
Dunno if it's still there, that may be old
doing the gpu instancing right now
@tight blade thats it, check out RuntimeGeometry3D
@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.
@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)
@opaque ledge lit has GPU instancing disabled by default. If you apply a copy with that checked off I bet you'll be good to go.
There's other ways to get around the floating point problem too. Like, having the physics operate in an offset realm
@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?
I wish you best of luck in Hybrid. I'm definitely shelving it for... indefinitely
yeah, it still didnt work
... shit.
yep
Damn, thought I just read a forum post about that yesterday
ADB log?
log of the cats?
doing srp batcher thingie now, thats the only hope i have rn
God speed
thanks
@violet cosmos can the physics operating it in another realm help the floating point display jitter or is that solution just for physics inaccuracies?
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
what floating origin? The one in HDRP?
That's for the camera IIRC
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.
https://www.dropbox.com/s/xpjs9s28uv0o05e/World Streamer Manual.pdf?dl=0 - it also might be useful to buy this and see how they handle it
""Floating Point Fix System" removes restrictions and errors caused by huge coordinates in the engine"
It seems like you could modify that to load SubScenes rather than their own custom tiles. Possibly
Just sounds like they're using 64 bit fixed point numbers
@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."
Using the new weird build pipeline asset thing?
Interesting
yeah already using it
the thing is, its like HybridRendererSystem is not being put into build, last 2 logs shows that i think
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
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
@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
That's what Unity should be doing behind the scenes when you use the SceneSystem to load
Yeah, it's weird that it didn't move correctly why other entities that were not subscenes of the identical shape did
Hybrid is kind of jank. Remember it's just megacity...
Yeah, megacity doesn't move though haha
They didn't anticipate moving the buildings
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
custom unlit material isnt being rendered either ๐คทโโ๏ธ
๐ค that's super weird
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?
what do you want to do
imma create a dummy project and try to render stuff, if it works, there is something going on with my project, if not, well..
for now, make a sinwave on a plane with collision
@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
Yeah they do have some info on it
Hmmm yeah good point about the ragdolls/kinematics
@zinc plinth so, just like how you'd do it in a shader, but on a mesh instead. position.y += sin(position.x)
My thinking is you just offset them by the movement of the world like everything else
question on AddHybridComponent on ECS,
can I use AddHybridComponent with monobehaviours?
with collision that's not possible I think, the physics collider is already baked
OR... don't use ragdolls or physics that break everything ๐ค lol
Dumb it down to 90's with death animations.
oh, thats fascinating
@deft stump AFAIK, yes
hrmmm
ahuh
it did work
wth
I've been hacking at this for 2 daaays XD
that's a waste of 2 days lol
Also, @deft stump if you figure out how to get MonoBehaviours that implement a custom namespace through deserialization, that would be a neat trick
@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?
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
sounds good - much easier if you can repro in editor
yeah, but now, i have no idea what i am doing
Does pro builder work with ECS/DOTS? lol
maybe i will try that define thingie
Just need to flip some normals
if your camera isn't modified too much I'd start with just recreating your camera and light
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
Is occlusion culling a thing with the Hybrid Renderer yet?
Doesn't seem to be unless I've done something wrong
I think not
... oookay.
Seems like it's half in there.
Or is that just for the frustum culling?
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
if you look at my screenshot that cylinder is the player's "fog" that is opaque at 200 meters out
if you use it to occlusion cull everything behind a little house it tends to end up costing more than it saves
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
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
Nah, psuedo fog
Well, basically, yeah imagine a hard visual stop at 200 meters or so out. Yeah. Hmm. Good point.
who was that gent a week ago asking about using animation perfect collision with ECS for a fighting game?
@hollow sorrel should you see the culling actually happening in the scene view with ECS?
I'd imagine so
I still can't find an ECS framework I can look at and go "right, that's what I want to learn"
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
Well, whatever, it works in game so ๐คทโโ๏ธ
I just figured with the "live game state" setting you'd see it culling
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
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
@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.
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
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
@amber flicker perhaps! Will have to see how many cycles are saved by reducing geometry considering I have no lighting or textures.
@stiff skiff so you've got a Test that you can run in testrunner, right? since you're talking bout performance testing package
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
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
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
https://gist.github.com/jeffvella/9420be274fc90945554b6b0cff4a5d8c maybe this might help with the profiling marker? sample by xzjv
Is there any solid ecs framework that does what it says on the tin and is free/os?
ah in that case not sure
@coarse turtle Does this work for jobs scheduled parallel ?
I'm not sure, I haven't tried it on parallel yet
๐ 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 ๐
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
"fog", haha.
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).
@coarse turtle Thanks. Also, is mixing and matching the standard workflow with ecs a bad idea?
With Unity's? It's a mixed bag of an authoring workflow.
Fits some needs, but not all needs with the conversion pipeline.
What about third party?
Depends on the framework I guess. Ik svelto can work w/ MonoBehaviours, I never tried Entitas
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
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
Entitas was nah since they themselves say pay $90 or your code breaks when you refactor it
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.
@spark glade just noticed your post about animation samples ๐ are you using the localization package with dots?
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?
@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
@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
@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
yeah its fair enough; the performance stats/graphs in the inspector are pretty cool in Entitas.
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?
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
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
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)
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
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
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
Yah, scheduling overhead is real
There's no way to test though, besides real data and good profiling and logging
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?
I haven't tested or looked for documentation, but isn't it just World.DefaultGameObjectInjectionWorld.SetTime()
anyone have a recent code example for blobassets? maybe something that shows creation from scriptableobject + usage in entities.foreach
sure, can paste something, 1 sec
code monkey has a tut on blob assets and how to create one
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;
}```
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
thanks, will probably help me too,
I think I want to turn a set of animation curves into blob assets
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.
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
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
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.
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 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.
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
I didn't read this all yet but @amber flicker want me to toss that code up on the wiki?
Super useful reference material ๐
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
you can also attach them to systems as well.
but I'm not convinced of it's safety
@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?
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
fyi what I mentioned earlier https://docs.unity3d.com/Packages/com.unity.entities@0.14/api/Unity.Entities.BlobAssetStore.html and related pages have a lot of useful stuff
I'll gladly use your library if that's what it's for, haha
https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki/Attach-BlobAsset-to-Entity btw let me know if it needs any mods or title change
It's not really for characters - tweening library with a timeline
I see! A DoTween type thing for entities?
yea exactly - though it'll do GameObjects & traditional workflow too
They honestly can't release an updated animations soon enough
unlike DOTween it's also asset based - you design an animation once and use it anywhere or within other animations etc
I don't even need the skinned mesh rendering, just give me something where I can read the transform buffers from
The GPU animation stuff from Joachim is crazy
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
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
Definitely start off with that technique in mind before making animations etc. Should be reasonably quick to get up and running.
Appreciate this doesn't look that impressive but this clip is actually applying one animation to every one of the spheres pictured here individually (though it scales to 100s of thousands). Hope I can get it working well with livelink builds at some point - that'd be cool. This is showing previewing at edit-time.
https://discordapp.com/channels/489222168727519232/497874303463850004/734528039047659581
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.
yea and be wary of blending layers and stuff too.
@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
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
Oh, right, gotcha
Nah I know a lot about that stuff, I only suck bad at programming. ๐
I'm headed off - happy hunting
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.
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.
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
well.. I was thinking if they were your zombies... ๐ .. it's pretty shabby tbh
tried once, don't remember the results, but may help on that: https://github.com/Unity-Technologies/Animation-Instancing
there is a blog post about that also https://blogs.unity3d.com/2018/04/16/animation-instancing-instancing-for-skinnedmeshrenderer/
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...
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.
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
never tried Joachim's one, will give it a try (sooner or later ๐ )
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
ok4reelthistime ๐ ๐ด
peaceeee
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
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
Though at that scale I don't think many people care for such complex animations
@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.
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?
@amber flicker interestingly this guy seems to be doing something along the vertex shader animation lines and demonstrates a fairly straightforward way to blend the animations as well
https://www.polyakkristof.com/index.php/posts/stress-testing-unitys-dots-and-lwrp-zombie-game-part-1
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
Yeah, well... baby steps. Let's just get something to animate AT ALL in entities first, haha.
@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 ๐
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.
yeah, next week i am going to start a new project for pc, and hopefully i will comeback to the game when its stable ๐
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.
oh man i would love it if dots made fluid sim zombies a reality
Yeah... I'll kinda find out... my goal is just to have "a lot" of zombies, really. ๐
The dream...
l4d did some cool things, like in 2, the zombies arent even normal mapped to save on memory
Mine aren't even lit or textured. ๐
looking at his test he could probably push simplygon even further
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.
The thing is my game is already in google store, which makes things awkward haha
Hmm... my game is likely 2-5 years from any store. Can't relate. ๐ค
i put it as beta test so hopefully no one will be able to find the game
What's wrong with it? Does it work? Haha
it does work, but entities arent being rendered
... sounds fun
maybe i should sell it as a feature ๐ค
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
"we made things invisible so you will have more fun trying to figure out stuff, only the best players can play this game!"
Hahaha man, you're gonna feel bad if a bunch of people buy it
nah its free to play ๐
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?
hahaha
I'll be like "yo, this game is SOOO good you gotta buy it man"
new platforms package ๐
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.
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
Or maybe they made Unity invisible so you will have more fun trying to figure out stuff?
@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"
always
Yeah, pretty sure I see that pop up
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
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
in editor yeah, not in build
Depending on batch settings I did have entities show up/not show up
for SRP batching anyway, which is weird
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
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.
Upcoming features... More like, our public to do list!
idk man ECS animation looks kinda scary ๐
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.
haha
I wonder if ConvertToEntity script picks up skinned mesh renderer GO component automatically... that'd be nice.
my "haha" kinda loses its point when you rework your 1 sentence to 5 ๐
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.
@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?
Also how on earth do I take input
for input, I used the new input system. lemme share the system for it
I'm guessing in entitas the idea is the same
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.
^ that's literally exactly what i do
This scales pretty well too, if you have 100 players, just increase the size of your buffer
Good morning, does hybrid renderer support multiple materials? I only ever tried with one so far
Again i have problem with dynamic array. I have system
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?
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
@last jasper tyvm. looks like its work
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
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'...
@stone osprey here's an example of something similar https://github.com/ElliotB256/ECSCombat/blob/master/Assets/Battle/Combat/ReloadCooldownsSystem.cs, and then my Cooldown just has an IsReady
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 ?
@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
ahh sorry I was confused for a moment - are you referring to the earlier comment about 'why not use the iterator'?
sorry, that confused me for a moment ๐
Was thinking you were talking about the actual C# foreach loop
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 ?
yea @last jasper 's code looks fine to me and will run fine with burst
@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
@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
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 ?
@stone osprey any system that calls CompleteDependency becomes one
Generally speaking the EntityCommandBuffer systems are hard sync points
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 ?
can components be shared between worlds...?
if you think about it, if they could be shared, the Worlds couldn't be independent.
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
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
the reason would be single player without a single player specific code path, or 'hosting' a multiplayer game rather than running a dedicated server
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)
right thanks for the thoughts I will think about a single world architecture
don't look at unitys 'dots netcode' as an example of how to do things properly
it's not well structured, at all
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
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
hmmm
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 ๐
lol, food for thought... the performance has been appealing...
@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.
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
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
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
Yeah @velvet sorrel is correct
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
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 ๐ .
@amber flicker Well that channel could be a locked channel, with one post in it with a giant red "NO", so :p
lol
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
it's way harder than that
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.
DOTS does cater to us maniacs in this channel (:
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?
Is there anyone using it in prod apart from like that one stickied post in the forum...
no.
lol
All the companies I had contact with that experimented with it quickly gave up on it
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
Between us we have a lot of industry contact i think @trail burrow so yeah you heard the same feedback as me.
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
Yeah very small scope
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.
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.
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
that's never going to happen
that's actually insane if anyone in our out of Unity would claim that
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
(๐โโ๏ธ I actually quite like dots)
so you basically think ecs is a waste of time for unity?
@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
Are you guys both here just to diss dots and put people off it? ๐คจ
They could have spend the time way better and help their actual clients with a better .net runtime for instance? ๐
@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
(Personally, I've shipped just as many games with dots as with monobehaviours ๐ )
well to be fair it is actually helpful for me at project start to hear these opinions ๐
Elliot, got some links?
I guess you didn't get it ๐
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
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
@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.
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?
But if you actually have a business and a game that needs to be financial success, stay away.
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 ๐คทโโ๏ธ
lol ๐
Oh, Overwatch was already mentioned
@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
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 ๐
That ECS as a pattern/architecture is unproven really
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
would never put something like that in ecs
ecs is for game logic/architecture, not for supporting datastructures around
I haven't used ECS though. Is it really necessary to convert everything in your project to ECS to make use of it?
nah
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?
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
Chucklefish use ECS in their 'Halley' engine. Used on Wargroove and their next title.
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
@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
Strong words, what's wrong with having your game logic in ecs and using standard rendering, particle systems and audio?
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?
@violet cosmos yeah you're wrong
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.
@minor sapphire depends on what you mean by good enough
not ridiculously difficult to implement ideas I guess lol
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
well you only need to do that once right? then you have your entity prefab to clone
@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
๐คฆโโ๏ธ
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
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
I guess maybe you are talking about a scene with a large hierarchy to start with
@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
hmm ok
Here's the picture that made me give up that train of thought
heh
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
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.
@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.
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.
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
@violet cosmos what's the range for super slow at runtime?
@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
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
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
How do non-pure ECS conversions go for subscenes?
Namely for audio and particile effects
Stores the Types, and IIRC the data for the MonoBehaviour in a BlobAssetStore
It's in SerializeUtility.cs
WriteSharedAndManagedComponents
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
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
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
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
I don't see why you can't use it with addressables right now
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
Subscenes are just binary blobs
You can't load just a thing. That thing needs to be in the SubScene
Which can be used as TextAssets in Addressables
Though thinking harder about it
What's stopping people from using Subscenes like they do prefabs
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
Interesting
Trust me, I went down this route haha
I have been working at a lower level for quite some time
Directly interfacing with SerializzeUtility
I thought it'd be simpler than that
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?
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
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
Does serialization include blobassets?
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
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
I've been trying to get something working with Hybrid
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
No success yet
@tardy spoke its a wasteland
@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
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
ECS would be mostly.... decorative, or much standalone input data and calculated results that are easy to query
@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.
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)
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
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
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.
@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
@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.
@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
it doesnt(if you mean inject) ๐
Then I'm not sure if ECS is the right solution without the right tooling
It's not, for me
Queries take a lot of time
Idk wtf they are doing, but it needs to be faster for smaller worlds
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
I am using ECS strictly for determinism and easy state snapshotting
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
Everything else is secondary
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
@tardy spoke you will need to convert it manually but it does work with monobehaviours if you are wondering about compatibility https://gfycat.com/pastadoredarmyant
@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
the latter with inject
ah k. Hmmm.
@safe lintel is that with the Unity DOTS Physics and a GameObject skinned mesh?
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)
How is there not a single tutorial on this, hahah that's crazy
@dusky wind yeah
Ok excellent
Are you reading the data back and forth via CopyTransformTo/FromGameObject?
That part isn't well documented
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
Since when was ecs deterministic?
https://youtu.be/yCYxMwiDyto this is the only tutorial I can find and unfortunately it's dated, but I think it'll still work
w/o burst its only deterministic on the same machine
/w burst its same architecture i think
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
the rest of unity is 100% not deterministic across machines, ever.
animation systems, phsysics, audio, etc.
navigation
or even core math functions on Mathf
Well that's unfortunate for now
Animation is the only thing I am missing from my full proof of concept
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.
I've yet to test that
Joachim claims it works across the same architecture consistently
I have yet to test whether that's true
@tardy spoke not sure if it will fit your needs but ill share the conversion code in a bit, gonna walk the dog
joachims claim is only in relating to burst
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
we're building our own animation system from scratch
I wish I had the manpower for that, haha
hardest part is finding people that know what they are doing
My project is FOSS, and I have no intention on monetising the project
So $12,000/year is infeasible for it
I tried creating an empty project with 2020.1.2f
But I don't see Hybrid Renderer package anywhere
For me to use Quantum (or most Asset Store assets)
yeah understandable
Is it built-in now?
@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.
I tried creating an empty project with 2020.1.2f
@dense storm they made it harder to get it.
@dense storm https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki/Installing-DOTS-Package-in-Unity-2020.1
lemme link you the way
@dense storm they intentionally hid it
Visually? I had a pretty good set of stages and characters before switching to ECS
yeah visually, im no artist just generally curious ๐
I haven't imported the assets yet so it's just capsules right now
ah ๐ good ol capsules
https://twitter.com/HouraiTeahouse?s=09
We aren't too active on social media, but here are some of the visuals we have dumped
ah, waifu game ๐
aha
i am very not, "in", on all the eastern stuff
have no clue about it other than the really famous stuff
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
why is reimu black though?
I find it oddly fitting for her
https://assetstore.unity.com/packages/tools/gui/aline-162772 there was this that @safe lintel showed me
but you wouldn't be able to redistribute it
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
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)
that's how I originally did this visualization
I actually just bought ALINE
wow
oh man
ever since uninstalling entities, my unity isn't eating too much ram now
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".
compile time you mean? @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
there there
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
ohh i read about this, that's easy
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?
Hmm... I'm missing something.
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.
How is your OneShotAnimationAuthoring?
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
With Convert&Destroy it will get destroyed for sure, what you are looking for is either AddHybridComponent or to use Convert & Inject instead
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
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" ๐
I would consider that a feature, liked the visual ๐
But hey it animates! Let's ship it
It's also 10000 times bigger than it's supposed to be
can't wait to play your horror game
kinda looks amazing
i'll take a vid it's bizarre
i had this bug before but it wasnt when using entities
lol it's probably something to do with the structure of the character, I'll reimport
its not "bizarre", its "indie" ๐
Weird, hahaha. It did it again... yeah it might be non ECS related
dont suppose you updated the editor?
wait
I did report this a while ago, and they mentioned resetting the avatar, so setting the rig to none and then back to what it was before should fix it? but it was to do with editor updating so not sure if its quite the same, but it looks very similar https://fogbugz.unity3d.com/default.asp?1123956_djelo00ksppic01g
ahh there it is https://gfycat.com/obeseickydeviltasmanian
That looks very similar
Something is broken in dots? Color me surprised
imo its vanilla broken unity
@safe lintel setting it to generic fixed it for me. Wtf unity.
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
SubScenes don't seem to like this kind of hierarchy
@tardy spoke anyway here are the main two files for manual skinnedmesh conversion via inject. the LegacyJointUtility should be able to copy paste it without problems, obviously the ragdollauthoring has a ton of game specific stuff that is hard to separate https://gist.github.com/thelebaron/9e8e8cb63f2cbea0426ef94839727ecb
@safe lintel thanks! Did you ever get any of em working in a Subscene?
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)?
no, i dont think it works with subscenes at all
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.
i think joachim's gpu thing did work with subscenes
i had issues getting shadows to work, and then sorting issues on the shader
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
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
@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?
Hmmm this branch is way ahead (last updated two months ago) , wonder if I should use it instead.
https://github.com/joeante/Unity.GPUAnimation/tree/transform-usage
oh cool hes updating it
@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
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.
Is there a way to use Burst on arbitrary functions outside of a job?
(assuming the function has no reference variables)
Hmm, I think it may almost be working, hahah. Missing these name spaces though, no idea why.
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
need to put that gpu animation package into your packages folder if you havent already
its separate from the gpu animation samples
Yeah, I'm pretty sure I did... hmm
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)
@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
Or SharedBuffer?
@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.
i would kill to see a working dots animation sample
"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?
hahaha
Unity didn't come up with the "jobs" terminology
There are other engines out there that uses the job terminology
such as the telescope engine
@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.
@violet cosmos look at the boids example in the samples repo
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.
Also pretty much every dots package is using jobs, there's a lot of examples right in the source code
The physics solver one is a great example
of a decently complex system and how it compartmentalizes into smaller jobs.
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?
The latter is usually achieved via EntityCommandBuffers
which are a generic "apply this structural change to my entities"
Lets say, pure Jobs, arbitrary things... Not in ECS
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
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
And then have a manual sync point to apply those changes on the main thread