#archived-dots

1 messages ยท Page 168 of 1

hollow sorrel
#

would still avoid it because garbage tho

deft stump
#

kek I can't make my subscene appear in my scene view

glossy summit
#

This is on 2020.1

deft stump
glossy summit
#

Oh...

#

Strange, but okay Unity sure

#

Thanks

toxic mural
#

You can use com.unity.entities if you dont want the hybrid rendering stuff

deft stump
#

oh okay, remaking the subscene is what make it appear in the scene view

#

nice

sick agate
#

hello guys, I have a system that has two jobs inside it. both jobs writes to rotation component but their query are completely different. When I combine both jobhandles, ecs says "the job1 writes to the same component(rotation) as job2, it is not allowed.". As far as I know, they can write to their rotation components and there is no race condition. What should I do? Would seperating the system into two different systems work?

amber flicker
#

If you are sure then you can use something like โ€˜.WithDisableParallelForRestriction(typeof(Rotation))โ€™ in your lambda @sick agate

minor sluice
#

I think you make the jobhandles be dependent of each other when scheduling? passing the dependencies of the first job to the second etc?

#

you could probably use 2 separate system too yeah

wheat stump
#

The ScreenMainTag component is defined in the Assembly-CSharp assembly, but that assembly is not referenced by the current build configuration. Either add it as a reference, or ensure that the conversion process that is adding that component does not run..

#

Guys I have used [GenerateAuthoringComponent] to create ScreenMainTag.
Does anyone know what assembly reference I am missing

random marlin
#

Hey,
Not exactly dots, but unity job system...
Any idea how to sort TransformAccessArray in a job and have result available in the main thread after the job is done?
I tried Array.Sort but TransformAccessArray is not a subclass of System.Array...

minor sluice
#

isn't the idea that the transform access handles the application of the transform changes for you?

#

not sure if that's correct, but if so, maybe you can pass something else to get the results and order them? like additionally passing a float3 native array that you use to store result positions etc?

opaque ledge
#

What are you trying to do ?

random marlin
#

@minor sluice I can pass in floats and order those I guess, but then I need mapping to get original transforms back.
@opaque ledge I have list of colliders (could be in thousands) and I need <8 "closest" transforms as a result. I had sort + slice on main thread but it's becoming an issue. So I wanted to put at least sorting into a job for a start.

Also "closest" is not really closest, but some kind of a score I calculate.

sick agate
#

@minor sluice I combine both jobs dependencies and then pass it to Dependency

minor sluice
#

but if you have the transforms already in order at the start of the operation, and you want to do something with an output, wouldn't that mean that you just apply the same index on the same index?
and maybe instead of sorting colliders it would be possible to sort the indices?

although not really sure tbh

#

or sort on all the arrays you need at once perhaps, applying the same steps in the same job?

random marlin
#

hmmm

minor sluice
#

and not sure how you'd do it if you operate on regular transforms, it would be easier if that operation was on Translation/Rotation componentData etc

random marlin
#

I'll try to pass in NativeArray<KeyValuePair<float, int>> and sort it... Is KeyValuePair blittable?

minor sluice
#

any struct that consists only of blittable types should be blittable itself

#

so not sure, but I'd assume it

opaque ledge
#

TransformAccessArray is not for that tho, why do you need it ?

random marlin
#

I answered @opaque ledge a bit higher

mint iron
#

@dusky wind some perf thoughts.

  • try not allocating new temp/tempJob each update, instead use a list as a field and ResizeUnitialized in case it changed.
  • check the ASM in burst inspector to see if its vectorizing, you may need to remove that HasComponent branch
  • you're making a value copy of the component rather than calculating the hash in place, that will be slowing it down.
dusky wind
#

@mint iron check the latest commit to the repo

#

Already addressed a lot of these

#

It's slower due to using NativeMultiHashMap

#

But due to not being padded with either zeros or uninitialized memory

#

It's consistent now

mint iron
#

oh, yeah that looks a lot better!

deft stump
#

is the Parent component a shared component?

dusky wind
#

@deft stump it shouldn't be

#

There'd likely be heavy chunk fragmentation if it was

wheat stump
#

The ScreenMainTag component is defined in the Assembly-CSharp assembly, but that assembly is not referenced by the current build configuration. Either add it as a reference, or ensure that the conversion process that is adding that component does not run..
Guys I have used [GenerateAuthoringComponent] to create ScreenMainTag.
Does anyone know what assembly reference I am missing

violet cosmos
#

@random marlin I wonder if you're looking at the problem too directly

What would happen if you say, tagged each of the colliders with a tag component, then ran a likely guess radius sphere collision check again, but with a smaller radius and just looking for that tag

If that tag doesn't come up in the collection, enlarge it and try again

Then have a system that cleans up the tag later

#

Also, I'm thinking there might be some way to access the AABB volumes that you could leverage

deft stump
#

@deft stump it shouldn't be
@dusky wind I'm just making sure. since Unity doesn't define if their out of the box components are shared or not

dusky wind
#

Pretty sure you can just check the interfaces a struct implements

#

To see where it can be used

solid flume
#

Why does burst not like it when I access a static readonly field in another class from inside a job

violet cosmos
#

@solid flume because you can't access "reference data" from Burst

If you want to burst the whole thing, you need to copy the reference data in before

solid flume
#

Ugh

#

Each job needs to have its own instance?

deft stump
#

yep

solid flume
#

because static nativearrays are supremely annoying to dispose of

violet cosmos
#

If it's in a system, the easy way is just declare a variable that's local, and set it. Not that difficult

solid flume
#

Its not really memory efficient though

violet cosmos
#

Depends on what you consider efficiency to be...

deft stump
#

well, I think what they're going for is cache efficiency

#

not ram efficiency.

solid flume
#

Fair enough

random marlin
#

@violet cosmos not sure exactly what you mean, but this algo with enlarging the collider might work and it will be easier to maintain than the job parallelism

#

I'll give it a try

violet cosmos
#

@random marlin That's the easy hack, (you're just indirectly reading into AABB) but my intuition says reading directly from the the AABB system is going to yield the largest gains

random marlin
#

yeah, the list with thousands of items could be drastically reduced

violet cosmos
#

So last night tried importing MegaCity into 2020.1. Errors abound. Freed space again and trying into 2019.4LTS

amber flicker
#

I don't believe you'll be able to straight up import it unless you go back many editor & package versions - I think there's quite a lot of fixing required.

violet cosmos
#

MegaCity is Unity Companion license. So, theoretically we could take this project on to update it to 0.14 ECS best practices, latest packages and publicly share/work on it

deft stump
#

Isnt there a community build that aims to bring it upto date?

violet cosmos
#

@deft stump If you know of such a thing, I would love to have a link

deft stump
#

Hrmmm i was just passing through the interwebs, might be wrong or im drunk.
I'll search for it

violet cosmos
#

I'm really only interested in how they did the prefab/scene streaming, and any workflow tools, after watching a talk

#

I really despise the cop-out that "texture and asset streaming for ECS, well... It's out of the scope of this talk". That's like.... The whole damn thing any video game that isn't a single scene game, don't just ignore it!

deft stump
#

well I can't find it (probably was drunk)

#

let's make it a community project.
keep megacity upto date with the latest packages

#

XD

amber flicker
#

might be worth tagging Topher on Monday as I know this was previously discussed and Unity might be working on it

violet cosmos
#

@deft stump Really depends on the utility I see, and if it's really something usable

It's a huge project, it's a 7gb compressed archive, that expands to 22gb

#

It takes over a half an hour to import on my laptop's 6 core i7 and a really fast SSD

deft stump
#

and I'm pretty sure it's in LFS too

#

oh wait

#

it's a zip file

#

not in github

#

lel

violet cosmos
#

yah, took me a few minutes to find it, not just videos of it

#

@amber flicker I really think Unity needs to pick at least one sample repo, and update it in line with ECS/DOTS releases. Just one. Then, they know the pain points and conversion processes, and can document those and breaking changes as well with the release. I'd wait a week extra between releases for that

amber flicker
#

I agree. I think Unity agree. I think there's been a lot of good intention but not much delivered. Some of the simple samples have been kept well up-to-date - I think the DOTS shooter is supposed to be the one that shows networking, physics etc and maintained.. but all those things are still so much in flux. Still a bit early I think.

violet cosmos
#

Even if it's just a toy project... It doesn't matter but you can see the diffs between branches

#

And be like "Ohhh! This is how they migrated A to A.2"

deft stump
#

it's also funny that before, every unity guy says that they should look at the angry bots demo for proper code implementations of x,y,z.

violet cosmos
#

If they can't do that, how can they expect the community to do it? Without any information

#

Especially those of us working to build real things, not just more toys

amber flicker
#

Have you checked out the pinned samples? I think they're alright. They don't show what 'a really nice conversion workflow' looks like for instance.. but it doesn't really exist yet. I think they quite well illustrate what does exists and is reasonably settled.

violet cosmos
#

After watching the talk, I think MegaCity's conversion/streaming/pipeline is the closest to what I need

#

That's what I need right now.... that workflow and in-Unity pipeline

#

Once I get some reference code from MegaCity, I'm going to work on a pipeline that organizes GameObject prefabs into something that is serialized into ECS in editor. Per prefab would be cool, and there's hints MegaCity is doing that, but I can hack around with per-scene.

Then, I'm going to be making a PrefabWorld, where pre-converted entity prefabs are streamed into and automatically marked up, and is the single source of instancing, and are ref checked (and tagged) for disposal. Kind of like a lightweight version of Addressables.

#

The stream-direct-to-world, like how we have tools for the current GO workflow, is just not going to happen. Proved that out yesterday

amber flicker
#

I dunno. To me it just sounds like a subscene containing all the Prefabs.

deft stump
#

^ i second this idea. that's what it feels like to me too

violet cosmos
#

If you have a game that's a well organized list, and all hand made beforehand... There's not much problem. I'm working on proc gen, and many things are combinations of others in a prefab hierarchy

#

Like, lets say you're making Crash Bandicoot ECS. Sure, just author the scene, break it into chunks, load on the fly and dispose. But... What about prefabs referenced in SubScene1 vs SubScene22? MegaCity has some handling for that.

amber flicker
#

From my understanding you want either a) a way of loading serialized content from disc and instantiating fast (i.e. MegaCity - although everything's static there, they don't instantiate prefabs really afaik), b) same as a) but some runtime combinatoric use of prefabs or c) runtime mesh generation - not much can be serialized. Which approach are you going for?

violet cosmos
#

But, what if you're me? Scenes don't exist, they're proc generated at runtime? I could organize them into "BuildingBlocksDesert" and "BuildingBlocksValley" and load those. But, what do I do when I don't need them, or I have multiple different environments and need to stream out the resources for Valley when i transition into Desert? That needs to be managed, because right now there's zero of that

#

They instantiate prefabs in megacity. Each building is a scene, made of a number of prefabs. They also manage shared prefabs across sub-scenes.

amber flicker
#

I'm not really following. You have many many Prefabs. These are pre-authored and serialized? You have so many that you don't want them to be loaded all the time. Presumably then these prefabs should be grouped and placed in subscenes which are loaded depending what area you're in or something?

violet cosmos
#

Yes, exactly.

#

The issue is: pre-authored and serialized, there's no way to reference to pre-serialized version without custom tooling or if they're stored in a saved subscene

amber flicker
#

So... in my head.. you make your prefab traditionally (gameobjects). You have a 'Valley' subscene, you drag the prefab in. You load the Valley prefab subscene when in the Valley. Profit?

violet cosmos
#

Yes, and when I don't need Valley?

#

Those need to be managed a tagged. What does that?

#

Where does Valley go before I need it?

#

Where do I get "new" Valley instances if I need them at runtime?

amber flicker
#

well if they are geographical, then I'd say look at the LOD stuff (I haven't looked into it) and that may do it automatically for you. If they're conceptual categories rather than spatial then you need your own logic I assume.

violet cosmos
#

LOD isn't automatic either, another thing I think again, covered in MegaCity. They did separate scenes per LOD, IIRC

#

From the talk, MegaCity is structured as a few hundred buildings, with a SubScene per building. Each building has LOD sub-scenes. Those are laid out in the master scene as a collection of SubScenes, at very specific positions known ahead of time, then just magically automatically serialized: An advantage I don't have (set positions)

amber flicker
#

I don't see why you can't do that.

violet cosmos
#

It's proc gen, I don't know where things are

amber flicker
#

are 'Valley' prefabs spatially associated with the Valley or not?

violet cosmos
#

No

amber flicker
#

so yes, you will need to write your own logic

#

have you watched the tutorial codemonkey did about subscene streaming? It's fairly simple?

violet cosmos
#

yes, for him. He quite literally just copied and pasted in the editor ๐Ÿ˜›

#

Everything was laid out beforehand, and he didn't have to worry about loading from disk, serialization, etc

#

Just an instance of the prefab, pre-serialized laid out and tagged with metadata. Then, the proc gen goes through and starts placing instances of those into the runtime scene

amber flicker
#

sounds fairly straight-forward? ๐Ÿ˜…

violet cosmos
#

haha, PrefabWorld is my current line of thinking. It's honestly not that hard, I just want to see what Unity did in MegaCity, especially about organizing prefabs, and how they did the background file streaming over many frames. There's also assistance code in there for tagging and management of instances

deft stump
#

@violet cosmos btw, is there a license in that megacity zip file?

violet cosmos
deft stump
#

oooh

#

then it's legal to upload it on github then

violet cosmos
#

You can't, it's too big. But! We can update the scripts and upload those

deft stump
#

hrmmmm

violet cosmos
#

Also, @amber flicker Check out that MegaCity video I linked. Even though MegaCity, everything was statically placed, they still did something similar to my line of thinking. It takes them 45 minutes to explain just asset streaming in MegaCity, which just proves that for ECS it's a bit more.... complicated hehe

#

What's nice about this though, is when I make it... If I do it right, it's a generalized resource I can use across all of my current and future projects. It's work flow

This thing I'm building.... I'll have so many in-house tools when it's done

#

I already have a few, and am thinking about how to convert my in-house VR rig into ECS and Unity.Physics

amber flicker
#

Yea, watched the video. The complicated part is referencing unloaded entities in other subscenes. I don't think you need to worry about that? You probably want to do your procgen in a World, start it when the subscenes are loaded and copy the entities back to the default World when it's done? I'm not sure there's much workflow stuff to be built but I could well be wrong.

violet cosmos
#

Yes, I need to worry about that. The Valley to Desert transition I mentioned. Why am I holding on to junk I don't need?

#

Level to Boss. Doors closed, player can't exit. Why do I still have flowers and rocks and whatever else in memory?

amber flicker
#

If you don't need it then call valley_prefab_subscene.Unload()? I don't really follow your issue but anyway... best of luck, it sounds fun to work on

violet cosmos
#

Yes, that's the straightforward way. Again, something needs to manage that, streaming it in and gracefully out, and make sure no references exist.

amber flicker
#

yea... I guess I see that as the day-job... custom logic... part of making a specific game/thing and not workflow stuff but perhaps if you plan to make many procgen games all using the same logic then sure ๐Ÿ‘

deft stump
#

okay. so I just discovered this now.
but I think GO components can be used as a query in Entities.ForEach

amber flicker
#

they can ๐Ÿ‘

deft stump
#

huh

mint iron
#

downside is that its slow, but probably still faster than working with MBs though

violet cosmos
deft stump
#

so it's probably under the hybrid workflow

amber flicker
#

sure - same caveats as usual - no burst, main thread etc

#

similar to an ICD class

violet cosmos
#

You can also have IComponentData that is a type class to reference reference data, but again.... comes with caveats

#

Still importing MegaCity. This entire time we've been chatting about streaming ๐Ÿ˜†

deft stump
#

Im downloading megacity

#

And i'll probably push this on github

#

XD

violet cosmos
#

Hmmm. Same error. The type or namespace name 'PlayerLoop' does not exist in the namespace 'UnityEngine.Experimental'

#

I couldn't find that package

deft stump
#

tried removing the Expremintal part?

violet cosmos
#

haha, ๐Ÿคฆโ€โ™‚๏ธ now I feel dumb

#

Oh, that's in the packages, need to update those

deft stump
#

so which namespace is the CompanionLink ICD a part of?

#

oh

#

great

#

it's private

#

wth unity

#

btw, it's under the Entities namespace but its internal and not public. and I wanted to get into the GO part of the companion link

coarse turtle
#

You can just do GameObject in the ForEach statement as an arg, if you added the GameObject specifically as a Hybrid component

deft stump
#

as a query?

violet cosmos
#

Okay, back to 2020.1 for MegaCity and trying to update the packages. Hybrid Renderer 0.0.1 is what's in MegaCity haha

coarse turtle
#

Yea - let me bring up a sample

violet cosmos
#

@coarse turtle That's pretty cool actually

#

Any Component will work like that? Even custom ones?

deft stump
#

@coarse turtle that's the GO component, right?

coarse turtle
#

all hybrid components need to inherit UnityEngine.Object @violet cosmos and yes SpriteRenderer is a MonoBehaviour component @deft stump

violet cosmos
#

Ahhh, you know... now AddHybridComponent as part of the GO conversion lifecycle is making sense! It's not just for things that aren't in ECS yet, but for.... anything

coarse turtle
violet cosmos
#

That should really be added to Recipes on the wiki

#

I didn't know that, I thought it was just for some built in types. At least, that's only how I've seen it being used

deft stump
#

well it is Hybrid ECS. (the naming makes sense now)
And I guess, unity also expects us to use as much as Pure ECS components as possible

coarse turtle
#

yeah for somethings that just don't have the tooling or complete conversion yet, using a companion link is helpful to keep a decent high level workflow

deft stump
#

and I was really prepping on making an sprite-animation system using ECS

violet cosmos
#

Looking at old ECS.... The new patterns are so much better with so much less boilerplate

coarse turtle
#

you still can, it's pretty much a linear animation table with timings (I'm just tinkering with ik rigging atm)

deft stump
#

@violet cosmos are you going to update it to the new packages?

violet cosmos
#

Not sure I want to take that on just yet

#

I'm so behind where I want to be because I've been struggling with hybrid ECS workflow to accomplish my goals

deft stump
#

tfw, your game could have been halfway, or even decently finished, if you didn't try to learn ecs.

#

XD

violet cosmos
#

But, I might ahve to do something because I can't see their SO's and prefabs correctly

#

haha, this game I'm working on? Nooo. It's a beast

#

I really think once I build in some tooling, I'll be able to leverage ECS better

deft stump
#

my game is only just an anime gacha game ffs! why do I want to leverage it with ECS!?

violet cosmos
#

I have technical requirements.... Really, what I'm hoping for is to reduce the player loop to as minimal as possible so I can cram in a custom lighting solution

#

Stupid, but this whole thing stems from: Can I find a way to not use light maps?

deft stump
#

whats wrong with lightmaps?

violet cosmos
#

They work if you have a game where everything has a place known ahead of time

#

https://youtu.be/KbxiGH6igBk - Look at all the work they did, just to get hand made tile sets working on mobile with Unity, light maps and light probes

Now, if I can free up the CPU, I'm 90% positive I can come up with a custom lighting solution that doesn't rely on light maps

coarse turtle
#

some thoughts on that, it's possible (also depends on the platform you're running on) - what I did was a lot of optimization on the vertices loaded to the GPU, chunk based rendering, lods when necessary, deferred some stuff to the CPU like culling because I was GPU bound (eod it's balancing between GPU load and CPU load)

deft stump
#

@violet cosmos 7GB turned into 17GB hahaha

violet cosmos
#

@coarse turtle What about... when you rotate it? Then you have to have a lightmap for every possible angle. Or what if you want to position it someplace "low" with a lot of overhang? Then it needs to have a dark/light and 4 angles.

And that's assuming that everything only rotates on Y, and by 90.

coarse turtle
#

oh forgot to mention - i wasn't using lightmaps - just realtime lighting

violet cosmos
#

Ahh, yah that's what I'm trying to get to: Where I can do more realtime lighting on the Quest

#

I need to open up more CPU budget to try out things though

coarse turtle
#

quest can get GPU bound very quickly depending on the # of vertices and draw calls per eye (so even if the CPU finishes quickly, the GPU can take a longer time to finish processing everything)

violet cosmos
#

Yah, I'm trying to avoid pixel lighting

tardy spoke
#

@coarse turtle we for sure need to add that AddHybridCompnent thing to the wiki, super interesting

violet cosmos
#

But also, the more time I can give the GPU, the better. If I reduce CPU time, I can start the draw earlier

#

See, MegaCity has this folder called /StreamingData/EntityCache, with a bunch of files called guid_0.entity. I can assume these are serialized entities as prefabs

I need to figure out how they did that

tardy spoke
#

@coarse turtle if you post up the full code for that addHybridComponent , the managed ICD and they System I'll paste it in a wiki article right now

coarse turtle
#

there's no managed ICD for the hybrid component (those 2 images are pretty much the minimum you need)

tardy spoke
#

oh, sorry, I meant the IConvertGameEntity

#

I'm just being lazy and didn't want to retype it all hahah

coarse turtle
#

sure let me just add it to the wiki

tardy spoke
#

kk thanks!

#

@violet cosmos let me know your findings on how they streamed the subscenes on a separate thread over multiple frames on MegaCity if you come across anything.

This video is talking about how they did it with two async functions "Load Shared Components" and "Load Entities" then deserializing...

violet cosmos
#

Yah, and some of that is hidden magic in ECS

tardy spoke
#

Hmmm

violet cosmos
#

I'm trying to figure out what is actually happening

deft stump
#

alright, I'll try pushing the megacity demo on a private repo one-by-one, file-by-file

tardy spoke
#

Apparently that all happens in a "staging" world... is that a world they created specifically or is that nomenclature for like the "conversion world"? More like a utility world that always exists?

#

@violet cosmos yeah I looked at some of the megacity code to try to figure out my issue with subscene loading by proximity, because they targeted the proximity of the subscene directly somehow, which seems impossible now (because they always extend their "bounds" to include the origin instead of just the geometry in the subscene).

hollow sorrel
#

aren't subscenes already loaded in a seperate world by default

violet cosmos
#

Yes, some of what they're talking about is in ECS now. I'm looking through the serialization

tardy spoke
#

Yeah this vid is from 2 years ago so I'm just trying to figure out if they're referring to an existing utility world or explicitly if they mean they created a seperate world

hollow sorrel
#

btw the reason subscenes are so fast is because they are in an already memory ready format, 'deserializing' here means literally copying the entire component buffer to memory, don't need to parse or convert anything

amber flicker
#

The basic premise is that all those structural changes that cause a main thread sync (e.g. entityManager.X) can happen on a background thread if you create a completely self-contained world. So by creating a new World, you can do a bunch of stuff without interrupting any of the currently running entities & systems. Once the entities are loaded and processed (remapped ids etc) you can then memcpy them straight back into the main World. Which is how subscenes are loaded by default.

tardy spoke
#

Interesting

violet cosmos
#

Exactly, it's an interesting concept

deft stump
#

gamertorrahod also suggested such a method instead of using ECB

tardy spoke
#

I noticed the subscene loading function is called "LoadSubsceneAsync" - would it ideal to run that on a "schedule" so it's not on the main thread?

#

Is that the point of that? haha

amber flicker
#

I'd assume the point was you could call that directly. The nice thing about DOD is your systems won't try and process the entities until they exist which works really nice for this kind of async load.

#

Systems only run in the World they've been added to. So your 'MoveToEnemySystem' or whatever you have won't be running in the loading Worlds.

tardy spoke
#

Yeah I haven't experimented with creating extra worlds and stuff yet, I probably should just because it'd be good for learning

violet cosmos
#

I think for right now... I'm going to work with entity scenes as groups of data to stream into a PrefabWorld. But... I really think there's a way to reference serialized hybrid prefab instances directly, so then I can maybe assign them to Addressables and load them more specifically

#

Some of the logic is captured in SerializeUtilityHybrid and EditorEntityScenes

hollow sorrel
#

you've got such a weird setup ๐Ÿ˜…

#

sounds like you're doing everything possible to avoid doing it the unity way

violet cosmos
#

@hollow sorrel If I told you that you can't load one texture in Unity to draw... You have to make a new Scene, put the texture on a quad in that scene, and then add some Components to the quad.... Then, either for each texture you need to hand make a new Scene or you can group a bunch of textures in a scene....

You'd be like: WTF, I just need the pixels for my menu!

#

Oh, and you can assign it by reference. You have to load the scene, to extract the texture, then you can do the thing

hollow sorrel
#

making a new scene for one texture sounds crazy

violet cosmos
#

Yes! Why does making a new scene for a prefab that I want to load single seem sane?

#

I don't want 5 prefabs, or 100. I just need the one.

hollow sorrel
#

you don't need a scene to load one prefab

violet cosmos
#

How do I load one serialized hybrid entity prefab? Just one.

#

(at runtime)

hollow sorrel
#

but it sounds like a lot of your issues are coming from hybrid components
i'd stop trying to shoehorn those into a mold that doesn't fit and just seperate them
have your simulation run fully ecs and use hybrid for rendering only (i assume that's why you're using hybrid)
as in your subscene loads simulation entities, your simulation entity might have a mesh id on it, then you load your mesh prefab and instantiate it in the world with a copygameobjectwhateverthename component to make it follow your entity's position

violet cosmos
#

Then I'm writing systems and linking components, as well as custom scripts and setup and initialization

That's what Hybrid does

mint iron
#

that seems like it woudl work well (scorr's solutino), then your legacy assets can just be loaded/unloaded as needed with the existing addressables setup.

violet cosmos
#

So, either way I'm writing a ton of tooling

#

The benefit of Hybrid in my mind is that Unity is going to keep extending it, where if I write my own Hybrid I'll have to maintain every part

coarse turtle
mint iron
#

if i had a dollar every time i expected unity to not completely change something in ECS ๐Ÿ˜„

violet cosmos
#

Yes, and I do expect them to change it... But I imagine the general workflow to be similar: You author prefabs, convert those to entities at editor time, and load those in at runtime

If I write my own Hybrid system, not only do I need to make ECS changes to systems and structure and whatnot, I also need to maintain a full hybrid system. It's a much larger surface area than managing importing and instantiating

hollow sorrel
#

Then I'm writing systems and linking components, as well as custom scripts and setup and initialization
yes but i feel like you're coming up with overcomplicated tooling that ends up being just as much work if not more (like with the whole interface reflection thing)
i feel like you're a smart person who's coming up with solutions that are very complicated but then you end up with other issues because they're not really compatible with the rest of unity's tooling ๐Ÿ˜›

violet cosmos
#

That's what I'm working on, really: streaming in, linking, cleanup. It's not that difficult, it's just the tooling isn't present the same as we expect with the MB/Prefab workflow, but.... there's no reason it can't be

#

@hollow sorrel I'm trying to make it compatible! that's the point haha

glossy summit
#

Hmmm, is the CPU choking at 1 million entities normal? UpdateDynamicRenderBatches is taking the most time (44 ms)

amber flicker
#

rendering 1mil dynamic entities? yes..

glossy summit
#

static

amber flicker
#

Ah if they're static I think you should be able to improve that. I haven't messed with it and they've been changing it a bit I believe. Are they marked as static and in a subscene?

glossy summit
#

Yeah, they're marked as static

#

Not in a subscene though, how would I go about adding them to a subscene?

amber flicker
#

If at the moment you're adding the 'Convert To Entity' component, you basically want to remove those, select your gameobjects, rick-click and choose 'create subscene from selection'. It may be a bit more involved depending on how far down the rabbit hole you've gone of trying to use convert and inject etc.

glossy summit
#

I'm using GameObjectConversionUtility.ConvertGameObjectHierarchy(gameobjectPrefab, settings);

#

everything is getting spawned in

violet cosmos
#

I tried that path at runtime. takes 2 seconds to load the prefab (which is a particlesystem and sphere as a child) and convert

#

When I load a scene that has that converted to an entity, at least the whole process drops to 50ms, which is the same as loading the prefab using Addressables in a pure Monobheaviour setup

#

What I'm working on, and need to just stop chatting about, is managing that

amber flicker
#

@glossy summit I think you can try adding the 'Static Optimize Entity' monobehaviour to your prefab. I can't guarantee it will help but it's worth a go.

violet cosmos
#

@glossy summit If you right click on the scene, you can add a new subscene. Pick it's location. Then, it's kind of scene loading as normal

mint iron
#

if you have hybrid components, they create game objects so its doing the same work + additional work for ECS, so it makes sense it would be slower.

violet cosmos
#

For you guys not using Hybrid, how are you authoring your things in game? Like, how do you make a car with moving wheels, all the config, creating versions of that car...

mint iron
#

putting a prefab in a subscene, and configuring it. Note HybridRenderer was a terrible name, because its not hybrid at all. I think when people say Hybrid theyre generally referring to setups with interop with old GO/MB rendering system.

violet cosmos
#

So you have one subscene per car?

#

Yah, sticky points there. Little things like audio, particles

amber flicker
#

the car has audio & particles now? ๐Ÿ˜… How about fluid physics for the oil level

mint iron
#

you could put heaps of cars into a subscene, wheels, spoilers. But they dont currently have a nice way for it to be converted into an EntityPrefab. They just get converted into instantiated entities when the subscene loads because right now they assume that everything you put into a sub-scene is like, environment or unique objects not a template you wanna instantiate.

violet cosmos
#

Exactly

vagrant surge
#

pretty great workflow for something more than 2 years being worked on

mint iron
#

right, but you can hide them and add a prefab component ๐Ÿ˜„

deft stump
#

trying to circumvent the github 100MB push limit is hard

amber flicker
#

if Benjamin's simply complaining the current workflow isn't ideal I think we'd all agree?

deft stump
#

git add individual files and then commit and push, man megacity is mega

violet cosmos
#

That's my complaint, yes. I've used the word "workflow" dozens of times in this conversation. It's just the tools lacking, so... Going to make those, because I need them

mint iron
#

whats super annoying is that they have all that LiveLink junk, so if you add a PrefabComponent, then move the isntantiated entities around with the source game object int he subscene, it also moves every single copy haha

amber flicker
#

Feel free. Just do it knowing Unity has a team of people working on the same thing.

violet cosmos
#

That's why I'm working on the "managing" side of it

deft stump
#

Feel free. Just do it knowing Unity has a team of people working on the same thing.
@amber flicker i know haha. but hey, we might need to dissect it for dspgraph ๐Ÿ˜‰

violet cosmos
#

Unity can change the underlying implementation, but it just get plugged into generic management

#

Surface area there is much smaller

vagrant surge
#

its honestly impressive stuff is still like this after all this time

glossy summit
#

Wait, so how would I go about Instantiating an entity in a subscene?

amber flicker
#

My belief is that ecs workflow is a priority for Unity yet we haven't seen much in that regard for the past couple of years likely because it is actually quite complicated to deliver an equivalent workflow we'd expect. It's also probably hard to ship without all the pieces (like editor code) coming together. A lot of stuff (like live editing components) seems to mostly just be waiting to be enabled. A lot is also probably being rewritten given the new .enabled states etc. By all means go for it, it's just my opinion that you might not want to spend too much of your life on it (especially in the timeframe of the next few months). I also think to make it really nice you want the editor to support an entity prefab natively. If you're just talking about making things work for your game, of course - that's what we're all doing.

vagrant surge
#

entitas was able to create a hybrid system that did work. Code is public, it isnt even hard

#

i just think that its not a focus whatsoever

tardy spoke
vagrant surge
#

either that, or unity codebase is a clusterfuck truly beyond any measure and doing anything is super hard

amber flicker
#

I expect to see progress in the next 6 months.. I'll be disappointed if I don't ยฏ_(ใƒ„)_/ยฏ

vagrant surge
#

ive been checking the evolution since the start, calling it a dissapointment is selling it short

violet cosmos
#

@amber flicker Yes, that's why I elected this path rather than writing a whole other linking path. Every game has some sort of custom way to manage streaming in resources, how they're referenced, allocated, deallocated, etc anyways, correct?

tardy spoke
#

Well, if you read books like the mythical man month, the more complex your software becomes the slower it becomes to work on, and adding more people doesn't necessarily help (and can even slow things down).

I think Unity's huge shift towards "packages" etc indicates that they're well aware of this issue and trying to create smaller discrete systems so progress doesn't basically grind to a halt

vagrant surge
#

editor support is not much ahead of what it was on day 1

#

in fact, its regressed

#

unity tiny version 2 actually did have a working ecs editor, but that got completely scrapped

#

in favor of conversion workflow... which is a huge hack and barly works

tardy spoke
#

Does Tiny's editor not exist anymore at all?

vagrant surge
#

@tardy spoke i consider packages a truly spectacular failure

#

because they are incompatible with each other on tiny versions

#

so its a nightmare to keep track of exactly the exact version for each thing

#

you can try to compile unity ECS samples to check

#

at this point, i expect unreal to actually have a workable ECS before unity does

tardy spoke
#

I've noticed some problems with the package system in the form of "This package works, and this package works, but they don't seem to work together".

vagrant surge
#

there are a few leaks around that point into an ECS editor

#

and well

#

my own badly implemented hacked ECS on top of unreal actually works better than what unity has right now

tardy spoke
#

With the package manager you almost still want a turn-key versioning system like, instead of installing all the ECS stuff seperately, just be like "give me every ECS package that is KNOWN to work together and is the most recent"

vagrant surge
#

so if i want ecs, i can run unreal and write the ECS myself, and it would work better

violet cosmos
#

There's lots of ECS systems that are more complete. We're here for the Burst and Jobs and cache streaming ๐Ÿ˜‰

vagrant surge
#

unreal already has job system (taskgraph), they dont have Burst, but they have ISPC which is somewhat equivalent

#

tho i havent tried the ISPC thing just yet

#

biggest problem they have is the huge bottleneck on actually updating unreal engine side stuff

#

from a job system (inspired by unity ecs) i wrote myself, in unreal

#

notice the "Copy Transform To Actor" taking literally half of the frame

amber flicker
#

@tardy spoke that's how it works. The issue is when you install entities 0.14 that requires platforms 0.8, then install 'experimental build package 0.9' or something that requires platforms 0.9. Since 2020.1 I think they introduced a better resolution handler for when that situation occurs, makes sure the latest required is installed. It still wouldn't fix compile errors existing between e.g. entities 0.14 and platforms 0.9 but it helped with the overall mess that was before I think. It's also why they're trying to hide some of the packages - so you don't see entities 0.14 requires platforms package and install platforms package 0.10 first for example. I'm turning into a Unity apologist ๐Ÿฅด

mint iron
#

they don't need burst, everything is already compiled to skip the IL middle-man which is what gives the perf increase. The asm from C++ is just as good. Maybe burst is easy for some SIMD stuff not sure im not a C++ guy.

vagrant surge
#

@mint iron not quite, Burst is faster than cpp

#

Burst is more equivalent to the ISPC thing

#

tho much better integrated/smoother to use

#

the reason is that Cpp is... bullshit

#

aliasing rules and other undefined behavior crap prevents the compiler from properly optimizing stuff. In burst, they use the knowledge they have from the native container rules for better optimization

mint iron
#

ahh okay, i read the perf comparison thread on the forum and it seemed to be pretty much within the same zone. +/- like 5-10%

vagrant surge
#

for example, NativeArray is faster than nativelist, because native array is guaranteed to never move (it wont resize), so you can cache some stuff and go ham with the memcopys and vectorization

tardy spoke
#

@amber flicker I'm on your side, I'm under no illusion that with software as big as Unity there is any free lunch anywhere to be found. Packages have drawbacks, and not using packages has drawbacks, haha. Implementing ECS smoothly in a big OOP system is probably immensely difficult, considering they have to keep all the OOP workflow stuff intact.

I'm in no position to judge 'em. I can't even figure out how to make a custom editor work like the default inspector. ๐Ÿคทโ€โ™‚๏ธ

vagrant surge
#

@mint iron main thing burst (and ispc) have, is that they are a lot more reliable than cpp compilers. Its a bit more... known, what they will optimize

amber flicker
#

Use UI Builder if you can. So much nicer to work with.

vagrant surge
#

in cpp is very easy to change some minor thing and then the compiler flips its shit and no longer vectorizes anything

#

or does all vector accesses through vector operator[] instead of direct pointer

mint iron
#

that sounds like a nightmare

vagrant surge
#

yes. It absolutely is

#

vectorization in cpp compilers is a total crapshoot

tardy spoke
#

@amber flicker thanks, I'll look into it... I definitely don't want to spend this much time just on how the inspector displays.

I find it on the custom editor by default seems to be as such a low level, as I think people would mostly want to change how the info is displayed rather than the actual functionality. You should be able to change the appearance of how an array is displayed without having to reprogram how the array is ACTUALLY displayed, haha.

Maybe that's why they made UI builder... I shall go find out!

vagrant surge
#

the most minor things can make the compiler stop vectorizing anything

#

specially msvc

#

i have some projects where i made a rasterizer (cpu renderer), and it was impossible to convince the compiler to vectorize any of my inner loops

amber flicker
#

@tardy spoke my guess is you'll be instantly more comfy with the uss (css-like) separation of style and content in UIToolkit

tardy spoke
#

Perfect! Yeah, I'm a killer on CSS. That's exactly what I was hoping for - an approach along those lines would be more modern.

vagrant surge
#

let me give you an example @mint iron

#

NOT VECTORIZED

#

and this is about as dumbass of a loop as you can get

amber flicker
vagrant surge
mint iron
#

lol, yeah thats pretty atrocious if it cant do basic loops

vagrant surge
#

but it does unroll the loop a few times

tardy spoke
#

Thanks! Watching now. Haha I just need some pretty easy stuff, just trying to make a couple fields read only and stuff like that and don't want to spend a zillion hours figuring out the tradition customer editor until I need something a little more elaborate

#

and yeah could use propertyDrawers, etc

amber flicker
#

one other approach is Odin (asset store) - it makes some things like that, adding a button etc super easy.

mint iron
#

Odin is really great, i would use it for closed source projects

amber flicker
#

wish Unity had bought that instead of Bolt myself

tardy spoke
#

Wow no shit

violet cosmos
#

Did you know, if you load a subscene, it attempts to get every SceneSystem in every World to feed the entities into that?

tardy spoke
#

I assume Odin works with ScriptableObjects, etc? Does it tend to break anything or is just all positives? Hahah

violet cosmos
#
            {
                var sceneSystem = world.GetExistingSystem<SceneSystem>();
                if (sceneSystem != null)
                {
                    var sceneEntity = sceneSystem.LoadSceneAsync(_SceneGUID, loadParams);
                    sceneSystem.EntityManager.AddComponentObject(sceneEntity, this);
                    _AddedSceneGUID = _SceneGUID;
                }
            }```
amber flicker
#

@tardy spoke imo hands-down best written asset out there. Very actively maintained, very fast and very considered. Main downside is making a nice editor that you can only share with others who have a license.

violet cosmos
#

I've decided to integrate Odin Inspector into any in-house components. It's just too useful

tardy spoke
#

Right. unless they're on your collaborate team or something hahah

violet cosmos
#

If you're paying someone to collab, you can pay a few bucks for another license

tardy spoke
#

Then I think they get access to all the project's licensed stuff

amber flicker
#

most asset store stuff is per seat (including Odin)

tardy spoke
#

Except that Unity Collaborate... doesn't work...

deft stump
#

^

tardy spoke
#

@amber flicker I think it bypasses per seat restrictions?

amber flicker
#

there's no enforcement of Unity assets in general

tardy spoke
#

Unless they coded their own security

#

Yeah, right

amber flicker
#

it'll work, it's just not legal ๐Ÿ™‚

deft stump
#

you can share the assets you bought from the assetstore.
most studios would make a generic account, and use that to buy stuff.
and git push it to everyone.

tardy spoke
#

lol

deft stump
#

pretty useful tho ๐Ÿ‘Œ

tardy spoke
#

A smart move for Unity would probably be to take the highest rated store assets with most purchases and buy them and stuff them into Unity.

#

You reduce your asset store profit but probably just get more game devs in general on your platform.

amber flicker
#

they've done it a few times... to mixed results... latest bolt incident for example

deft stump
#

bolt was the only good purchase imo

tardy spoke
#

I think that was more a keeping up with the Jones' thing. Unreal has visual scripting, and that really appeals to "new" game devs to hook them on a platform, potentially.

amber flicker
#

probably not the place for this discussion - my fault for bringing it up ๐Ÿ˜„

deft stump
#

so the only thing i need to push is the vehicles, environments, and the prefabs.

violet cosmos
#

So, SceneSystem is just a fancy wrapper around SceneManager.LoadSceneAsync, and SubScene is just a way to identify and cram SubScenes into every world, along with the editor tools for interactive editing

#

So, Unity themselves just deferred unique hybrid entity serialization into Scene

#

There's other things in there like the metadata for the scene and whatnot, I'm not saying that it's just a dumb class, but.... It's not really geared towards single components. It's geared towards mimicking what we would use additive scene loading in the traditional sense

#

The scene reference tracker and the code to stream from the loading world into the target world is interesting stuff though

tardy spoke
#

Easy to implement?

#

@violet cosmos are you just checking out megacity or is the plan still to do the project to update it to modern ECS?

deft stump
#

I'm planning on updating it to modern ecs.

#

I'm currently pushing it 1 file at a time

tardy spoke
#

Yusss

violet cosmos
#

@tardy spoke So, what I learned about MegaCity is much of the talk, was implemented in ECS as SubScene

#

I'm looking through the entity scene loading code now and I can hear the presenter's voice in my head for the talking points I was curious about as I see this or that method ๐Ÿ˜†

deft stump
#

oh man the entities cache from all the subscenes is huge

#

1.5GB

#

but the textures takes the cake, 15GB

violet cosmos
#

Unfortunately.... In MegaCity, they're using SceneData components to load scenes, but that was deprecated in 0.1x? and I'm not seeing how scenes are loaded now

tardy spoke
#
``` maybe some clues there
violet cosmos
#

Ahhh, gotcha. So in that case, the sceneEntity is the "parent" scene

tardy spoke
#

That's just from my stuff, that's not official Unity stuff or anything so take it with a grain of salt, may not be done correctly haha

hollow sorrel
#

wasn't megacity built with entities 0.0 or something

tardy spoke
#

My game streams the loading of subscenes but I dunno if it's doing it "correctly".

hollow sorrel
#

i'll applaud if you manage to get it up to 0.14 ๐Ÿ˜…

tardy spoke
#

Lol, there may be a reason they haven't updated it. Could be a big task.

violet cosmos
#

the issue is... Where you do get the sub scene guid?

deft stump
#

I'll invite you guys to so we could make it to 0.14 together

tardy spoke
#

@violet cosmos entities.ForEach(Subscene subscene) ?

violet cosmos
#

I'm actually curiuos where the start point is. Where do you call LoadScene("sceneName")

tardy spoke
#

Oh wait, that's a ref type isn't it

#

@violet cosmos I'll screenshot whole script

north bay
#
        [Serializable]
        public class SubSceneReference
        {
            public static implicit operator Hash128( SubSceneReference reference ) => reference.SceneReference;

#if UNITY_EDITOR
            [SerializeField] SceneAsset sceneAsset;
            public void AssignReference( )
            {
                this.SceneReference =
                    new GUID( AssetDatabase.AssetPathToGUID( AssetDatabase.GetAssetPath( sceneAsset ) ) );
            }
#endif


            public Hash128 SceneReference;
        }
#

That's what i use to reference subscenes

tardy spoke
north bay
#

SceneAsset just references an object with a property drawer that only takes scenes

violet cosmos
#

@north bay I'm looking through ECS 0.14 and SubSceneReference doesn't exist. There's SceneLoadRequest

#

Oh, derp sorry

#

I derped out, my bad

#

But, I'm still curious... What's the ingress point to load a subscene?

#

Got it, it is SceneSystem.LoadSceneAsync

#

with the scene guid

north bay
#

Ye the whole think is kinda confusing

violet cosmos
#

Yah, calling directly into the system is a bit quirky

#

So is cramming that subscene into all worlds

tardy spoke
#

One interesting issue with world streaming that maybe you guys will have some insight on -

If you do a grid based Subscene system (each Subscene is a "tile") and the character stands at the corner of any of the grid, they're loading 4X as many "subscenes" as they may be at other parts of the game.

Any optimizations around that? The only one I can see is to make the subscenes as small as possible, but that's not super easy when it comes to constructing the world, etc.

violet cosmos
#

Make choke points that are closer to the center of the edge

#

Make the corners not so useful to move

tardy spoke
#

Ah, so circumvent it in the design of the level

#

I have my world map in blender and I can cut it up with a script into any size I want, I'm just not sure what initial size to start with and it'll be painful to change later haha

#

and by painful I mean potentially insurmountably difficult to change.

hollow sorrel
#

i think it's fine to just accept that, it is a possible scenario in the game to stand at corners so you don't wanna cut corners and not show certain tiles

tardy spoke
#

Well, it's wide open terrain, 20km squared, and to have a big rock or castle at all intersections may be suspicious... also they would be huge because you can see 100m in any direction (or whatever I set the fog at), so they'd have to be huge rocks haha

violet cosmos
#

One thing to do is possibly just... don't cut it up just now. Work on the huge world, and cut it up as part of a pre-build process

#

Make GameObjects that contain where you think sections might cut

hollow sorrel
#

i think it's probably fine, your bottleneck here will likely be gpu not cpu and things outside your view will be frustum culled anyway

#

however you should optimize your game for the worst case scenario
if your game can have 9 tiles loaded at the same time, run your local testing with 9 tiles loaded at all times and ensure it is fast enough

violet cosmos
#

You can disable those sections and move and combine them easily

#

Another option might be to use a world streaming library, and let that do the in-editor work, but you override the export into SubScene

tardy spoke
#

Interesting, but the world is so big one of the appeal of having it pre-cut into subscenes is literally just to work on sections of it at a time.

For example if I add JUST trees to the world, I'm probably looking at 100,000+ objects. It's likely it'll become impossible to work on a world that large at some point with so many objects.

amber flicker
#

fwiw I'd be assuming you have e.g. 30+ tiles loaded at once (rather than 9) - tiles/subscenes should be roughly at the scale you want to LOD (ala buildings in MegaCity) and you want to stream in and out relatively manageable slices rather than half of your visible world (so this also depends on how fast your player can move for example)

tardy spoke
#

@hollow sorrel luckily my terrain is low poly so I'm thinking frustum culling may be my friend here, since i have an opaque fog as a set distance. Not sure how entity's frustum culling works yet though? Is it implemented/automatic or is that a manual process? I was looking in the stats gizmo on play and it looked like frustum culling was working because I noticed the rendered triangles changing as I rotated the character, but that could just be me not understanding something as well, haha.

hollow sorrel
#

yes frustum culling is automatic

#

tho i think hybrid renderer intentionally bypasses the automatic one so they can do their own culling in a system so that's a possibility too

tardy spoke
#

Excellent, then it might just be "ok" anyway with the low poly terrain. Plus I have no lighting or textures (all vertex colors) so that terrain is fairly cheaply rendered I believe.

#

I'm on URP

#

so... hopefully it supports the culling and everything works lol

hollow sorrel
#

ye

safe lintel
#

@tardy spoke not sure how big your streaming tiles are or how fast your character moves but they cover a little bit on this in one of the spiderman postmortems
https://youtu.be/KDhKyIZd3O8?t=1001

tardy spoke
#

Awesome! Perfect!

hollow sorrel
#

ooo

safe lintel
#

its a really good talk

#

well worth watching the whole thing

#

also considering mike acton came from insomniac and was their lead guy afaik, theres obvious overlap and you can see some of what I assume he was steering the company towards with data orientated design in their own engine work

tardy spoke
#

I'm just lucky I have a set fog distance that is completely opaque, haha. makes it waaaaay easier

#

Then the plan is to jsut use z-rendering depths for things like far away mountains, but not sure how that's going to work (because I can't use camera stacking, etc... VR hates that stuff).

deft stump
#

crap made a mistake

#

I git reset --hard

#

now I need to reextract

hollow sorrel
#

ohyea forgot you're doing vr, in which case you'll def be gpu bottlenecked, worry about cpu later ๐Ÿ˜›

tardy spoke
#

Hence no lights or textures. ๐Ÿ˜‰

#

On my initials tests I realized Oculus Quest has zero balls and can barely process anything, let alone at 72 fps

violet cosmos
#

OK, I'm starting to understand why they used Scenes....

The writer serializes the whole current EntityManager, writing all the archetypes and everything into the header of the scene. So, instead of allowing the archetypes to be implicit and auto generated, they're declaring them as part of the internal file. So, right now ECS only operates serialization on the World level

#

It's just dumping the archetypes and data, not one entity and it's components

#

In that case, a Scene is the only logical way to structure it, and treat it as a distinct group. An entity and it's assigned components is just coming along for the ride with the ArchetypeChunk serialization/deserialization

#

That's also why it's necessitating an import world, and you'd need one per SubScene being loaded at the moment, otherwise things will get hairy until the process is complete and moved

deft stump
#

maybe it would have been faster if I uploaded this on gitlab instead of github

violet cosmos
#

I think you should have just uploaded the source code changes

#

Let Unity host the binary, and then someone downloads the GitHub which is just source and text file changes to merge in with copy and paste

#

(including package reference version updates in the project config)

#

Also.... Wow, if you load two different SubScenes at the same time I think there will be bugs

#

public static unsafe void DeserializeWorld()

which sets member properties as part of it's process

#

So. I can't do SubScene loading unless I'm very careful to only load one at a time (or it forces serial), which means I will have to group things

tardy spoke
#

Some kind of weird queue system?

violet cosmos
#

That's also why in the talk they mentioned it's on the main thread

#

ArgumentException( $"DeserializeWorld can only be used on completely empty EntityManager.

#

Yah, definitely all of this is MegaCity, code snippets from a prototype moved in, rather than API built to work with

#

That's why we don't have per-hybrid prefabs. It wasn't built for normal workflows, it was built to work on one specific class of problem for one specific prototype

solid flume
#

Does a nativearray of classes play well with jobs/burst?

#

I wanna implement an octree that plays well with jobs

amber flicker
#

not with classes, no - they're 'managed'

opaque ledge
#

there is one already i think, tho i couldnt make it work because i have no idea how octree works

solid flume
#

I know there exist octrees, but I wanna make my own

#

Don't learn anything from copying code

violet cosmos
#

@solid flume Once you put in any reference data, it's not going to play well with burst. Even one.

solid flume
#

Annoying

#

Guess I'll just make it with structs and add a property for everything so its mutable

violet cosmos
#

Burst is about optimizing instructions for data that is ready for cache, and taking your code and replacing it with best guesses for optimized instructions on the target chipset

#

Once you throw reference data in there, it really does gunk up that works

#

I really wish Unity would give us a roadmap for DOTS, like... what's coming up. Considering they have releases every month or two, it can't be that hard to share it publicly, right?

amber flicker
#

there's one scheduled soon

violet cosmos
#

ECS 0.14 just came out this week

#

But, what's coming out in 0.15?

amber flicker
#

don't think they have any intention of making those kinds of promises / intentions transparent

opaque ledge
#

bursted systems \o/

#

(hopefully)

deft stump
#

^ yes please

amber flicker
#

there's a larger 'general direction of DOTS' roadmap/post expected soon - hoping that clears some things up

deft stump
#

or maybe enable/disable components. hopefully its in the next release

prisma anchor
#

Has anyone got hybrid renderer v2 to work? im using 2020.1.0f1, but I can't find RenderMesh or update the GhostAuthringComponent to include/remove these from the server

violet cosmos
#

@prisma anchor Are you using an SRP?

prisma anchor
#

HDRP

violet cosmos
#

when you convert the entity, it doesn't have those components?

#

And what version of ECS/Hybrid are you on?

prisma anchor
#

Right?

tardy spoke
#

@deft stump I would like an "enable/disable" systems toggle like how you can toggle a game object on/off in the inspector (before hitting play). Would be nice.

#

I know you can do it in ent debugger in runtime

#

but I often try a couple approaches with a system and i have to comment the whole first system out to try the rewrite

violet cosmos
#

@prisma anchor I would say first... make a copy of the project, and try to update Hybrid to the latest. IIRC they did fix some rendering issues in newer versions

prisma anchor
#

@violet cosmos kk, its on source control. thanks

whole bronze
#

Does anyone know of a highly performant mechanism for saving "snapshots" of individual frames, that could be rolled back to and resumed? Assuming full determinism elsewhere.

violet cosmos
#

I think if you're going down the Hybrid path, it's worthwhile to always spot check latest. It's in super flux, but that also means lots and lots of bug fixes and improvements. And you'll have to pay that penalty bit by bit or in a huge annoying chunk

#

@whole bronze Copy the World into a new one. I think someone here was doing that for physics rollback

#

I forget who though

whole bronze
#

Any code snippets or blog posts you could provide? I'm kinda new to DOTS. (Then again, who isn't, since it's in preview.)

#

Hadn't considered using worlds for that purpose though. I'll definitely check it out.

violet cosmos
#

Don't have that, but maybe the person working on that physics thing can chime in if they see it

dusky wind
#

@whole bronze make a new World

#

Then use EntityManager.CopyAndReplaceEntitiesFrom

#

To copy your world into that one

whole bronze
#

Neat. Wasn't aware that function existed.

dusky wind
#

Assuming the world does not have automatically running systems

#

It can be kept as a snapshot long term

#

Just use the same method to copy from the snapshot into the original world when you need to restore it

whole bronze
#

Yeah that works perfectly for my use case. Thanks.

violet cosmos
#

Worlds are really cheap, right?

zinc plinth
#

to make no

violet cosmos
#

Especially Worlds with zero or few systems

zinc plinth
#

ho with 0 systems yes

violet cosmos
#

What about with a few systems?

zinc plinth
#

but we talkin about conversion worlds sweatymeow

violet cosmos
#

the SceneSystem's companion SceneSectionStreamingSystem create 5 worlds. If I was to use those in a separate World, to have it's own scene loading, it would make 5 additional ones too. But, I think those are mostly empty staging worlds, and purposefully empty because the SubScene loading demands the EntityManager be empty in the staging world

#

I guess creating 5 more nearly empty worlds isn't so bad if people are out there making a World per physics step for rewind

#

Unity assumes you'd only want one scene loader, but they give you no affordance to target which World a loaded scene will go into

mint iron
#

i saw a forum thread somewhere about how to load subscenes into a specific world :S i don't have the link sadly, but its apparently possible.

violet cosmos
#

That may have existed before, but not now. The SceneSystem loads it into the current World it's attached to

#

Maybe you could trick it by putting a system on the staging world, but then you'd have to try and filter

#

There's a few minor changes that would have made multiple much easier...

  1. Separating out the Editor logic
  2. Adding LoadParameters.TargetWorld
  3. Making SceneSectionStreamingSystem public ๐Ÿ˜›
  4. Using GetOrCreate<SceneSectionStreamingSystem> in SceneSystem rather than assuming (then it's fine it's not public)
  5. Allowing you to name and control SceneSectionStreamingSystem settings so there's not duplicate conversion/staging worlds all over

But really.... This does a lot of great stuff, just not so well put together as an API to use. It's very square in what it does

#

Interesting....

public enum SceneLoadFlags
        ...stuff
        /// <summary>
        /// Temporary flag to indicate that the scene is a GameObject based scene.  Once addressables are in place, this information will be stored there.
        /// </summary>
        LoadAsGOScene = 512,
zinc plinth
#

you can always put Entities in Assets and fix it yourself for the timebeing while it's bstill trash GWaobloChildPepeShrug

violet cosmos
#

Oh, I'm working off a local package, because it's easier to dig through. It's super tempting to modify it but I'm trying to avoid it as much as I can

#

But, I'm still having trouble where to get that GUID for the subscene now that SceneData is deprecated

#

Oh, well even more dumb. The "way to get it" is to add a SubScene MonoBehaviour to some GO in your current scene. Then drag a .scene file into the SubScene property. So, then it just exists as a normal sub scene in the editor. Still doesn't help me load things on the fly, unless I save that as a prefab with a SubScene, and then load that, which then can get the GUID to load the Scene

Who designed this?

#

Also, FYI SubScene is unique per GO

#

Well, I do get that it's useful for a full in editor game though

#

I'm actually not upset at it, I'm just upset it doesn't do what I need because it was so narrow focused and small changes could have been made to extend the functionality

wheat stump
#

I am at intermediate level in unity oops flow but just starting out in project tiny

Can you please say what things should I know

Thanks in advance

zinc plinth
#

the one stupid modification that I want is ecb stopping to throw on components with entity

#

just cause MuH BaD PrAcTiCe

tardy spoke
violet cosmos
#

The wiki on that GitHub ๐Ÿ˜‰

tardy spoke
#

woops.

#

@violet cosmos yeah in my workflow the subscenes are GO's, that's how I get the GUID. I would have no clue how to get it if the subscenes were generated in code, haha.

#

Also Odin rules hard

violet cosmos
#

No, I get it now why it's just the GUID.... It's about authoring in place and breaking down big levels into small ones. MegaCity use case

#

It's not like regular scenes where you can just load that. Without SubScene pointing to it in your MainScene, it's almost useless

#

With SubScene, it's actually a piece of cake

tardy spoke
violet cosmos
#

See, now you're on the path ๐Ÿ˜„

tardy spoke
#

Yeah, I just anticipated authoring the editor windows would be a lot harder than it was, hahah.

violet cosmos
#

My recommendation is to make a bunch of test versions that are easy to instantiate, make sure it works

#

If you have Odin Inspector you can make it a snap

tardy spoke
#

Yeah, it looks more complex than it is. I'm sticking to just show dialog and go to location pretty much for now. Gotta see how I'm going to be able to store all the progress for the quests as well.

Yeah test quests for sure.

Also I might be able to make a quest "tester" that kind of just "plays" the quest back in the editor so you can make sure the instructions flow and makes sense.

#

Yeah I bought Odin. It's already paid for itself. I had this pretty much done with custom editors but it took way, way, longer, so I already know this is going to save ... literally probably DAYS of time.

violet cosmos
#

Odin is great, you won't regret it. They also have a Discord

tardy spoke
#

I will harass them brutally.

#

Jk, after trying to learn DOTS it's a cakewalk.

hollow sorrel
#

ecb stopping to throw on components with entity
@zinc plinth
this sounds like something i had to deal with last night
or maybe i misunderstood, what's your problem?

zinc plinth
#

If you SetComponent from ecb with a component that has a Entity field, it will throw just out of bad practice cuz the entity could be already deleted

#

Which is the fucking stupidest thing ever

hollow sorrel
#

oh yee i ran into this same thing last night

wheat stump
#

Thanks @tardy spoke

zinc plinth
#

I really want to edit Entities in assets just for this

hollow sorrel
#

mine actually crashed entire unity every time instead of just throwing an error, dunno if that's what you meant

#

which is absurd

#

but

#

it's sorta by design (not the crashing part)

violet cosmos
#

Is there a way to query another EntityManager?

amber flicker
#

@violet cosmos yes - keep a reference to it or its world

#

@hollow sorrel editor shouldnโ€™t crash if you have jobs debugger on I think. It might if youโ€™re on an alpha but generally if that happens is because burst and debugger off I think

violet cosmos
#

@amber flicker I just don't see how to form the query ... I have a reference to the World and EM

amber flicker
#

@zinc plinth is this if you try to do eg โ€˜ecb.SetComponentData(entity, new MyICD(){ value = someEntity}โ€™?

zinc plinth
#

any type that has a Entity field

amber flicker
#

@violet cosmos donโ€™t understand the issue - just entityManager.CreateEntityQuery etc as usual?

zinc plinth
#
     public static void SetComponent<T>(this EntityCommandBuffer ecb, Entity e, T component) where T : class, IComponentData
        {
            ecb.EnforceSingleThreadOwnership();
            ecb.AssertDidNotPlayback();
            ecb.m_Data->m_MainThreadChain.m_CanBurstPlayback = false;
            AddEntityComponentCommandFromMainThread(ecb.m_Data, ecb.MainThreadSortKey, ECBCommand.SetManagedComponentData, e, component);
        }

        internal static void AddEntityComponentCommandFromMainThread<T>(EntityCommandBufferData* ecbd, int sortKey, ECBCommand op, Entity e, T component) where T : class, IComponentData
        {
            var typeIndex = TypeManager.GetTypeIndex<T>();
            var sizeNeeded = EntityCommandBufferData.Align(sizeof(EntityManagedComponentCommand), 8);

#if ENABLE_UNITY_COLLECTIONS_CHECKS
            if (TypeManager.GetTypeInfo<T>().HasEntities)
                throw new System.ArgumentException("EntityCommandBuffer.AddComponentData does not support managed components with Entity fields.");
#endif
violet cosmos
#

@amber flicker Thanks!

hollow sorrel
#

i was typing up a very detailed explanation but come to think of it mine only crashed in a very specific situation that i doubt you had the same, what were you doing that made setcomponentdata throw an error?

zinc plinth
#

just set a component with an entity field ? that's what I just said

hollow sorrel
#

that shouldn't throw by itself

#

i'm doing that

zinc plinth
#

yo

hollow sorrel
#

it's not bad practice

zinc plinth
#

read the code

hollow sorrel
#

what line are you referring to

zinc plinth
#

there is one throw in this code snippet

hollow sorrel
#

EntityCommandBuffer.AddComponentData does not support managed components with Entity fields.

#

oh

#

you're using managed components

zinc plinth
#

1/4

#
internal void AddEntitySharedComponentCommand<T>(EntityCommandBufferChain* chain, int sortKey, ECBCommand op, Entity e, int hashCode, object boxedObject)
            where T : struct
        {
            var typeIndex = TypeManager.GetTypeIndex<T>();
            var sizeNeeded = Align(sizeof(EntitySharedComponentCommand), 8);

#if ENABLE_UNITY_COLLECTIONS_CHECKS
            if (TypeManager.GetTypeInfo<T>().HasEntities)
                throw new System.ArgumentException("EntityCommandBuffer.AddSharedComponentData does not support shared components with Entity fields.");
#endif```

ho right it was for a shared component
hollow sorrel
#

yea that makes sense

zinc plinth
#

it doesn't, you can make that command still from the EntityManager

#

either give us the option or don't

hollow sorrel
#

ecb remaps entity fields so that you can reference an entity in an ecb before it playbacks
when you do ecb.createentity the entity will have id -1, -2, etc, but you can still reference that -1 and unity will check your ecb component fields and turn that -1 into a real entity id when it playbacks
so i'm not entirely sure why that doesn't work with managed components but maybe they can't guarantee that you don't change the entity id while it hasn't played back yet

zinc plinth
#

but it should work on already created entities

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

            dstManager.AddComponentData(entity, new PrefabToEntity { PrefabReference = entity });
        }

So, while I see the PrefabToEntity component on my entity in the editor world, when it's saved to a subscene and then deserialized, I'm not seeing that come through. What would be the reason for this? (PrefabToEntity is marked as Serializable)

#

In fact, in this case none of the hybrid things are coming through when the scene is loaded ๐Ÿ˜ฆ

#

The parent, child and mesh and things are coming through. Just not anything "hybrid"

#

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

#

If the MonoBehaviour that implements IConvertGameObjectToEntity is in a namespace, the serialization or deserialization just ignores it ๐Ÿ˜›

#

The IComponentData can be in a namespace, just not the MonoBehaviour

tardy spoke
#

With the mods to start simple and then explore certain aspects/concepts.

prisma anchor
#

@violet cosmos I added HDRP and Hybrid renderer v2, now I get a ton of errors in unity i.e : 'ShaderConfig' does not contain a definition for 's_ProbeVolumesEvaluationMode'

violet cosmos
#

did you also configure the project to use Hybrid V2?

#

I thought you had those already

prisma anchor
#

Yea, I installed hybrid renderer package 0.8.0-preview...

#

Then HDRP, then added the #define

#

(I'm doing something wrong) lol

violet cosmos
#

Don't worry man, we're all up to our ears in "wtf are we doing?" and drowning in it. Someone needs to open the documentation drain

prisma anchor
#

I'm just going to switch to URP until this is working

hollow sorrel
#

speaking of "wtf are we doing" i have no idea what i'm doing
i've seperated simulation from rendering but i'm not sure wether to make simulation entities reference rendering entities, so when copying positions/data, iterate sim entities
or make rendering entities reference sim entities, so when copying positions, iterate rendering entities

#

@dusky wind you were using gameobjects for rendering right, how are you passing data between them?

zinc plinth
#

btw do worlds get processed sequentially or in parallel ?

hollow sorrel
#

sequentially but their jobs get processed parallel

zinc plinth
#

what's the point of the simulation/rendering separation then ?

hollow sorrel
#

unless you mean in my case in which case it's all fully sequential, sim always completes before render

#

sorry misunderstood

#

it's so that i can have deterministic simulation

dusky wind
#

Is there a way to check if the Initialization group has run or not?

zinc plinth
#

how is it not deterministic with a RenderMesh in your entities and a PresentationGroup?..

wheat stump
#

Is there any document containing all of preview package urls

dusky wind
#

@zinc plinth you only include specific components for checking determinism

tardy spoke
hollow sorrel
#

this way i can run simulation at a 60hz fixed rate but rendering can still be done at 240hz or whatever player wants
i also want rollback so should be able to run simulation 8 times in 1 frame but rendering should still only render 1 times

wheat stump
#

Thanks @tardy spoke

tardy spoke
#

๐Ÿ‘ ๐Ÿ˜Ž

zinc plinth
#

ah deterministic on hz

dusky wind
#

@hollow sorrel I haven't set it up but I will have a hard sync point to push data out in the presentation group

violet cosmos
#

Welp, CopyEntities, CopyEntitiesFrom don't copy the full structure of parent/child. Also, you can't just instantiate an Entity reference from another Manager

dusky wind
#

Wait it should

violet cosmos
#

It's not, but I'm moving Hybrid data with it too. It's only copying the top

dusky wind
#

Ohhh

violet cosmos
#

So the top has hybrid data, and the child is just a dumb sphere, but it's only copying the top with hybrid data and ignoring the child

dusky wind
#

As in the child is a managed object?

violet cosmos
#

I don't think so. The child is just a sphere

hollow sorrel
#

hmm i guess my main issues with either approach is
sim has reference to render = can't use Entities.ForEach because i'm iterating a different world
render has reference to sim = would need to check if their references still exist before copying their data

#

maybe i should just do both?

#

circular reference?

#

has college vietnam flashbacks

violet cosmos
#

                    NativeArray<Entity> ents = new NativeArray<Entity>(results.Length, Allocator.Temp);
                    NativeArray<Entity> copies = new NativeArray<Entity>(results.Length, Allocator.Temp);

                    for (int iE = 0; iE < results.Length; iE++)
                        ents[iE] = results[iE].PrefabReference;

                    //EntityManager.CopyEntities(ents, copies);
                    EntityManager.CopyEntitiesFrom(prefabManager, ents);

@dusky wind As you can see, I tried a few things

dusky wind
#

Yeah instantiating entities I don't think copies the hierarchy

#

Correct me if I am wrong

violet cosmos
#

Well, that was a last hope haha I tried CopyEntitiesFrom first

#

"CopyEntitiesFrom(EntityManager, NativeArray<Entity>, NativeArray<Entity>)
Instantiates / Copies all entities from srcEntityManager and copies them into this EntityManager. Entity references on components that are being cloned to entities inside the srcEntities set are remapped to the instantiated entities"

amber flicker
#

Fyi Instantiate will copy hierarchies if you use the dual nativearray version

#

But yea, not sure how/where hybrid breaks that pattern

violet cosmos
#

How do I initialize that? The same length as the source entity array?

amber flicker
#

I think it might make some sense that the hybrid stuff is expected to be on the lowest branches? Otherwise I donโ€™t know what happens with transforms and stuff.. unsure

#

I think it might even take a list as second param? Would need to check but on phone

#

@violet cosmos just checked - it is two arrays - I gather all entities in a hierarchy (sometimes you can just use LinkedEntityGroup if you already have one) and then yea, initialize the dest array to the same length

#

all inter-entity relationships within the group are remapped as you'd expect

violet cosmos
#

But, in this case I just have the reference to the parent. Do I have to go through a recursion/select for Parent where Value = parentID?

amber flicker
#

or iterate through the child buffer recursively, yup

#

afaik there's no nice built-in GetComponentsInChildren equivalent

violet cosmos
#

๐Ÿ˜›

#

I really wish I was making a game that was just a million cubes rotating in a circle and changing colors

#

I'm going to see if Instantiate + Move + Query helps

amber flicker
#

the interesting thing is I think suddenly we'll be back to the days of 'having a library of code' actually being really valuable. So many systems are broadly applicable.

violet cosmos
#

This is the kind of things I'd think that ECS should provide, but anything with Hybrid isn't an API

#

Before I get too far into this.... What's the interface I use to have reference types in my entity queries?

#

I'm thinking of putting a reference to the GameObject and seeing if that finds/copies it better

#

doubtful that'll live through serialization but...

amber flicker
#

Don't follow again sorry ๐Ÿ˜ฌ

violet cosmos
#
                    Entity clone = prefabManager.Instantiate(results[0].PrefabReference);
                    prefabManager.AddComponentData(clone, new ClonedReadyToMove());
                    EntityQuery qClone = prefabManager.CreateEntityQuery(ComponentType.ReadOnly<ClonedReadyToMove>());

                    EntityManager.MoveEntitiesFrom(prefabManager, qClone);

Nope ๐Ÿ˜ฆ

violet cosmos
#

I'm starting to see why Conversion Worlds exist. ECS has API to copy the whole structure. But only when you totally void out one EntityManager and move it into another

#

Considering Copy/Instantiate/Move don't consider the hierarchy of an Entity, will Destroy() ?

#

The answer is no. No it doesn't

#

OK, so I have a decision to make right now, because this is getting out of hand

  1. Forget everything ECS. See you guys in another year for my annual DOTS revisit
  2. Build all the real-world tools that have been completely ignored on the path to "millions of things!" tech demos
  3. Rescope my entire game and goals fit into the limited scope tooling of ECS
wheat stump
#

How to disable gameobjects in dots

#

I want to enable and disable the entities in dots what is the solution

#

please help

violet cosmos
#

There isn't, afaik

#

Another real world problem Unity ignored, which could have been as simple as DisableTag and updating their systems to filter it out

wheat stump
#

so how to make the cube disappear after a press

#

of button

violet cosmos
#

You just don't want to draw it?

wheat stump
#

Yeah

violet cosmos
#

Then make a IComponentData that is an identical copy to RenderMesh. Copy RenderMesh into RenderMeshShhhh. Add RenderMeshShhhh and delete RenderMesh

#

Maybe, haven't tried it. But might work

wheat stump
#

thanks @violet cosmos

violet cosmos
#

Might just throw a bunch of whacky errors haha

wheat stump
#

Lol, I will try it out and update๐Ÿ˜

violet cosmos
#

You might be able to just do that with Translation too

#

Try Translation first, it's easier

wheat stump
#

Yeah i am actaully doing it with translation right now

violet cosmos
#

Let me know if that works

wheat stump
#

I wanted to find if there is any other way

#

translation worked fine.

violet cosmos
#

Nope. Many people have brought up there's no Disable

wheat stump
#

Yeah i will let you know if it works

#

thanks

wheat stump
#

is this a better way

manic aurora
#

there's a disabled component, works for me in pure ecs

wheat stump
#

Thanks for helping me @frosty plume @manic aurora

wheat stump
#

How to solve it if you got it

#

Build Win-Dotnet failed after 31.07s.
F:\Demos\Tiny2\ProjectTinySamples-master\Tiny3D\Assets\Scripts\Components\KeyCodeValues.cs(9,12): error CS0246: The type or namespace name 'KeyCode' could not be found (are you missing a using directive or an assembly reference?)
F:\Demos\Tiny2\ProjectTinySamples-master\Tiny3D\Assets\Scripts\Components\KeyCodeValues.cs(10,12): error CS0246: The type or namespace name 'KeyCode' could not be found (are you missing a using directive or an assembly reference?)
F:\Demos\Tiny2\ProjectTinySamples-master\Tiny3D\Assets\Scripts\Components\KeyCodeValues.cs(11,12): error CS0246: The type or namespace name 'KeyCode' could not be found (are you missing a using directive or an assembly reference?)
*** Bee build failed (30.20 seconds), 299 items updated

Does anyone know fix for this

#

I amm working on projectTiny and trying to get input from keyboard

#

while I am trying to make.

manic aurora
#

might have something to do with new/old input. either you have new input installed and it expects old, or the other way around

#

dunno anything about tiny specifically tho

dusky wind
#

Is there a way to tell if the InitializationSystemGroup has run or not?

manic aurora
#

in code, or just while your game is running?

dusky wind
#

@manic aurora in code

#

I have a external piece of code that should only run when the world is done initializing.

solid flume
#

Ugh making stuff work with dots is such a headache

opaque ledge
#

its worth it \o/

#

it took me like 3-4 months until i figured out stuff, and now its like a puzzle

#

at least about gameplay, not really sure if you want to implement very specific things like octree or pathfinding etc.

solid flume
#

I need an octree

deft stump
#

man, I should have uploaded the megacity demo on gitlab

#

waaay easier

solid flume
#

I just realised how fast octree sizes grow

#

Octree with n depth is (pow(8, n)-1)/7 nodes

#

Okay I think I have an idea

manic aurora
#

@dusky wind there's no like...property. might be simplest to call it from a system that's annotated [UpdateAfter(typeof(InitializationSystemGroup))]

solid flume
#

Can job structs inherit from other non job structs?

tardy spoke
#

@wheat stump @violet cosmos there is a "utility" component to disable rendering called "DisableRendering". No one knows about it. It is a secret apparently. entityCommandBuffer.AddComponent<DisableRendering>(EntityNameHere);

deft stump
#

it's been around

tardy spoke
#

@deft stump just noticed @wheat stump was asking for something like that, I think.

#

@manic aurora is there some sort of "true" disabled component tag? What's it "do" exactly? haha

deft stump
#

it's exactly as it says.
when you disable a component, the query will just think that it doesn't exist at all.
you'll still get fast-cache-friendly code.
great thing about it, is there's no achitectural changes.

tardy spoke
#

@opaque ledge I'm on your side about ECS being the bees knees. Probably because I'm learning ECS patterns as well as OOP patterns at the same time and I'm looking at OOP patterns like observer patterns and state patterns and interfaces, abstracts, protected, etc, and so far the ECS stuff is a loooooot easier to understand. It's just far more objective in how it's architected in general, which makes figuring it out a lot easier.

Constructors/field classes and getters/setters are total wtf in my mind. They're not that complicated, but I think you have to work with them a while to understand why they're so useful or have became very prominent patterns in the language compared to a more functional approach.

#

@deft stump I guess my main question is, if I disable a component, is it skipped entirely by renderer, in my case URP?

#

If it is, hallelujah. If not... f***.

deft stump
#

@tardy spoke are you asking the about DisableRendering tag which disables the rendering of an entity? or the disable components feature that hasn't probably arrived yet?
either way, I'll answer both scenarios:
if it's the former: yes, the renderer skips it.

if it's the latter: nani? what you mean renderer? it's done through the Unity's ECS itself. the renderer doesn't need to touch it.

tardy spoke
#

when you disable a component, the query will just think that it doesn't exist at all. <-- whatever disable a component means

#

Torsina was saying at least in HDRP disableRendering doesn't truly disable rendering (computationally) I believe, but I have yet to check in URP and I maybe misunderstood

deft stump
#

Torsina was saying at least in HDRP disableRendering doesn't truly disable rendering (computationally) I believe, but I have yet to check in URP and I maybe misunderstood
@tardy spoke I tested in URP before. (2 weeks ago). and yeah they do get disabled.
I dunno what Torsina's setup though.

#

also, can you make me a part of the wiki-organization? I want to transfer the bullethell game's ownership to the org, still making it private since I haven't had the time to see if it still works or not

tardy spoke
#

Sure

#

whats your github user ID or whatnot

deft stump
tardy spoke
#

Invitation sent

opaque ledge
#

@tardy spoke Yeah thats true, i can understand OOP can be seem complicated at first especially compared to ECS, but OOP is very popular for a reason, i tried to create a quest/mission system using ECS, it worked alright but it was getting overly complicated especially since i tried to do it modular, then i moved my mission system to OOP and its FAR FAR simpler and easier to make missions now, it simply made my workflow faster and i can create missions very easily, so i decided to stick with OOP when it comes to mission/quest system.

Data oriented design and Object Oriented Programming is kinda opposite, DOD is for machine to understand easily and human readibility is hard, while OOP is for humans to understand while machiene will have hard time understanding it

#

I think both have a place in game development

#

its just.. don't try to implement everything ECS way (imo)

#

also my game is on google store now but its not properly being rendered QQ i have to figure out if its my phone or hybrid renderer stuff or shader stuff

deft stump
#

its just.. don't try to implement everything ECS way (imo)
@opaque ledge Yeah. I guess for mission critical parts, just ecs it, if the concern is performance.

opaque ledge
#

my mission system are using Events to check if mission is a success or failure or continuing, so it doesn't have Update method, and there wont be hundreds of mission that will be run, so i have literally 0 reason to make it ECS (in my case)

tardy spoke
#

@opaque ledge what's the tech behind your mission thingy? Using "graph" type objects?

I'm currently working on the first quest system I've ever made, and it's "ECS" based using scriptable objects for the quests/quest step data, and it doesn't seem tooooo bad, but I'll have to see what it's scalability is like down the line.

I made a vid for it I was showing to my bro here, but it's not very detailed or anything. Might get the idea across. https://www.loom.com/share/6e63441b5d824c01a6f1d8ff911436c3

Also @manic aurora will notice I'm wearing my sweet Horsin' Around shirt, haha.

Click "open original" on video or whatever.

solid flume
#

Is there any nice container for precisely 8 float4 that plays well with jobs

#

I don't want native arrays

#

WhyIsntFloat4x8AThing

tardy spoke
#

The idea of that quest System is it'll do something like delegate all (eventually) of those quest/interaction steps out to separate systems that do an ECS "callback" with a tag on the Quest System (which I call the Interaction system because it also just handles any sort of interaction, not just "Quest Givers") when the "step" is complete.

I'm not sure what that will end up looking like, but that's the idea.

I also have to figure out how to cram that into a global state, which I already have a pattern for, but not sure if it's a good pattern... haha... will also figure that out later I'm sure.

opaque ledge
#

ooh thats pretty cool ๐Ÿ˜„ But mine isnt like that, its all hardcoded right now, i didnt bother with modularity because i am making it to mobile

deft stump
#

@tardy spoke did you turn those SO's into blobs?

tardy spoke
#

@deft stump Ha, my friend, I stopped giving a shit about performance optimizations a long time ago! Ho ho ho.

deft stump
#

my disappointment in you is immeasurable

tardy spoke
#

They're straight reference for now. Down the line I'll look into it when I'm better at this, hahah.

deft stump
#

๐Ÿ”ช

tardy spoke
#

Yeah, I've given up on optimizing until later till my understanding is better because I know I'm going to end up redoing a loooooot of these Systems.

#

I'm not even super confident in my state pattern atm, and it's running through quite a number of Systems

#

BlobAssets are cool though, I do dig them.

#

And realistically if my game is intending to have like 10,000 zombies roaming the landscape, the biggest optimization reward is definitely going to be on any systems that affect them, haha.

That said, as I'm developing for oculus quest sooner or later nearly everything will have to be optimized ... and even then it may not have enough power to run this shit. It's pretty lame in the power department.

opaque ledge
#

when i tried to implement ECS mission system, i made "objective mapping" component, each objective (i guess that would be the "step" in your implementation) would hold their own mapping, and when an objective finish with a state it would add "ObjectiveOver" component to Mission Entity with state data in it (it was a byte in my case) then mission Entity would look at current objective's mapping and look at what entity should be the next objective and put "ActiveObjective" tag on it and remove that tag from the current objective, thats how i made my ECS mission system, so this way would allow an objective to end with different states instead of just "success" or "fail", this can include optional objectives inside an objective

tardy spoke
#

That sounds similar, but I think probably more flexible in my solution

opaque ledge
#

but it was early implementation, so i am not sure if thats the best way to do ti

#

oh your system also have that ? great the haha

#

i didnt see any branching inside a mission

tardy spoke
#

No, it has no branching. I intentionally left that out.

#

Due to potentially added complexity in authoring and debugging, haha.

#

And really I've never played a game that had branching logic and be like "wow the way that quest branched was so FUN!!!", but I love good linear stories so I may be biased, haha.

#

I believe yours works similar to mine but you have branching logic.

Mine hold's a component on the "Interaction Giver" (quest giver) that holds the progress through the quest as an int.

opaque ledge
#

haha ๐Ÿ˜„

#

but i am sure you encountered those kind of missions, like a npc would give you "save my daughter" and if you are able to save npc's daughter then next objective would be "Bring the daughter to npc", if you couldnt then "Bring the bad news to npc" etc.

tardy spoke
#

Nice and simple. Everything must be a linear progression, but that to me allows more potential complexity in the linear progression itself as steps can be added that may not play nice in parallel without too many concerns - POSSIBLY, that's just a hunch.

opaque ledge
#

but i gave up on the idea later on at least for my case because there wont be any branching in my missions haha

tardy spoke
#

@opaque ledge oh absoloutely. If I could have the advantage of having branching logic with no drawbacks I'd definitely take it, but you'll notice a trend with my game that it the specs seem to oddly reflect the things I can figure out how to do in short order... ๐Ÿ˜‰

deft stump
#

okay

#

great

tardy spoke
#

One of my favourite memories is playing NeverWinter Nights: Hordes of the Underdark with my brother which went absolutely insane on the branching conditionals on the quests. Some NPC is like "hey please do this quest!" and I just out of curiosity attacked the NPC and killed him and apparently that was a valid way to complete the quest... they thought of everything. We laughed so hard, it was so unexpected... usually you can't kill important NPC's. ๐Ÿคทโ€โ™‚๏ธ

deft stump
#

nice

#

can't put it in gitlab

#

and also can't put it in github

#

azuredevops (I doubt anyone uses them) then

#

megacity... more like mega headache

tardy spoke
#

The upload limits seem weird considering the point of the services is to... upload.

vagrant surge
#

modern games allways tend to have quests be too atomic

amber flicker
#

Morning! A quick note on the โ€˜disabledโ€™ discussion. If youโ€™re using Hybrid Renderer V2 there is a โ€˜DisableRenderingโ€™ tag which disables most of the associated render work. More generally you can add a โ€˜Disabledโ€™ tag to any entity at any point. The aim is similar to disabling a GameObject. The entity will be ignored by all systems except for systems that explicitly require the disabled component. Lastly, in the future every ICD will have its own .enabled state. I would guess that would replace eg the disablerendering tag eventually by doing rendermesh.enabled= false or something.

vagrant surge
#

with a quest being its own little world and very little cross-quest interaction

tardy spoke
#

Morning? It's 2 am here ๐Ÿค”

vagrant surge
#

if you look at much older RPGs, you can often see them having quests that then have sub-quests, and subquests with multiple possible ways of solving them, some of them when interacting with other quests

#

Gothic 2 was a master-class in this

tardy spoke
#

@vagrant surge I agree. To me the depth of story telling is far more "fun" than branching logic/decision making, that's a preference

vagrant surge
#

in that game, the first main quest is "go talk to the king to warn him about dragons"

tardy spoke
#

But my favourite games are half life and uncharted, etc, linear stories, haha.

vagrant surge
#

but to reach the king you gotta enter the city, and the guards dont let you so easily (first subquest)

#

then the guards in the nobles-quarter of the city wont let you enter if you arent a citizien, so second subquest there

#

and the king will only speak with someone if he has a very strong excuse, so gotta find it (third subquest)

#

and each of them having more subquests, and general flexibility on how do you solve it

#

btw, sneaking up and climbing the walls is considered a good way of solving the "get into the city" part

#

but the thing is that quests are interconnected in general, so it feels far more organic

opaque ledge
#

thats sounds like a gameplay branching tho, not really quest branching

vagrant surge
#

its also significant level of quest branching, as to become a citizien, you need to join one of 4 masters and become apprentice

#

which each has its own quests to do so

opaque ledge
#

ah okay nvm then ๐Ÿ˜„

vagrant surge
#

and to speak to the king, you need to join one of 3 mayor factions, which is a serious subquest chain

opaque ledge
#

i was about to give dishonored example, quest branching would be frame, and gameplay branching would be sneak your way in, kill your way in, use your magical powers etc.

vagrant surge
#

for example, if you want to join the magues faction, you need to spend some time as a novice in the monastery doing quests for the older magues, and then do a full-map trial

#

(its by far the hardest path)

opaque ledge
#

imagine dragon will come by the time you become a citizen ๐Ÿ˜„

vagrant surge
#

if you become a mercenary, you have to convince the other mercenaries in their zone. On every mercenary, you have the option of doing a quest

#

or beating them in 1v1 duel

tardy spoke
#

That sounds awesome, but since I'm making an MMORPG keeping the quest states "similar" is a huge advantage in terms of complexity.... an MMORPG with branching logic would be ... hard.

vagrant surge
#

some of the mercenaries actually give you completely bullshit quests

#

like killing an endgame-level enemy

tardy spoke
#

I hate saying I'm making an MMORPG since it's not yet. That's just the idea. I may be making a "nothing" since making an MMORPG is hard. ๐Ÿ™‚

vagrant surge
#

but you can actually cheese the game to do the quest, and then they go "wait, you actually did it?"

tardy spoke
#

One thing I liked about fallout 1 and 2 is that you could kill the merchants and you actually got access to the store gear they had on hand. That was interesting.

vagrant surge
#

for me i quite dislike the modern action-rpg type games, assassins creed is such an extreme example

tardy spoke
#

Of course guards would come and kill you or whatever, but it was an interesting mechanic.

vagrant surge
#

its quests are all MMO tier quests

#

not only completely linear, but also stupidly simple

#

its allways "go into this enemy camp, and either capture it, rescue someone, or kill the leader"

#

witcher 3 did it much better, but its quests were still completely atomic in themselves. No quest really interacted with other quests

#

its interesting that games from the early 2000s are still completely unmatched. Gamedev has regressed in this front

tardy spoke
#

I agree "traditional" questing system are over applied to genres that would be more interesting or have more depth without 'em.

Also when people try to tell stories with quest systems when it's a single player game I always think... just make it a linear story. You're making a story anyway, why not use the best mechanisms to tell it?

To me that's like breaking a movie up into little chunks that work in a linear fashion that kinda tell an okay story vs all the advantages you have if you do a true montage of footage. IE you can run forward through time or back through time or use false narrators etc, all the tricks film uses to tell stories are hard to apply to quest systems effectively

vagrant surge
#

i think for questing in a game like this, the best way is to not hardcode things too much

tardy spoke
#

And that was part of my decision to not allow branching logic - I can tell a better "narrated" story if the quest system is "atomic".

vagrant surge
#

an example is something like a quest in gothic 2 where the blacksmith acts you to bring him an orc weapon. Any orc weapon

#

you have to find one in the map

tardy spoke
#

And the technical challenge there is if two people do the same quest at once it's difficult if they make any sort of different decision to keep track of that state, it would make the game worlds they experience totally discrete

vagrant surge
#

but the thing is. There are many ways of doing it. You can actually kill an orc (high level enemy), or find a way to steal a weapon or loot it from a dead one

tardy spoke
#

That's an interesting concept. It's very "D&D".

vagrant surge
#

indeed it is

#

the gothic series was inspired by Ultima, and Ultima was very D&D-y

tardy spoke
#

I think why a lot of games don't do "D&D" is ... it's hard haha

vagrant surge
#

yeah, it is

#

specially due to testing

#

atomic quests are very easy to test

#

there are no external variables

#

but a lot of this more open ended and interactuable quests are... much worse to test

tardy spoke
#

I think linear story is extremely difficult (making a curated 10+ hour experience is a TON of work) and totally open world is also an absolute ton of work, but a "questing" system kinda falls into a safe, easy spot comparatively. It's more finite in scope. I can copy paste new quests, make ones similar to old ones, etc. Make grindy repeated stuff.

vagrant surge
#

Divinity Original Sin also does this sort of open ended quests a lot

#

they have a great level of flexibility on stuff

#

the thing is, i believe that high choice high interconnection quests are better for games

#

it needs a smaller world, which means less budget

#

and it adds replayability, because players might want to try other paths

#

their downside is that they need more work on the quest design part

#

but the actual "asset" part is actually diminished, as you can do more with less world and less enemies and similar

tardy spoke
#

The way I'm planning to get around needing to make a zillion quests or a super long curated experience in my game is to have real player death, where if your character dies you literally restart the whole game.

People are going to fucking hate it.

But some of the roguelike players might like it. ๐Ÿคทโ€โ™‚๏ธ

vagrant surge
#

Gothic 1 and 2 had very small budget and were made by a team of like 20 people

tardy spoke
#

And I think it's kinda funny so...

vagrant surge
#

ive thought of something like that

#

an actual permadeath designed rpg

tardy spoke
#

I'm literally on the fence about allowing unpenalized PK-ing.

vagrant surge
#

but for something like that, high degree of branching in quests is needed

tardy spoke
#

Because it's... interesting.

vagrant surge
#

so that people can try other paths

tardy spoke
#

Like it's something different. I'm not going to make the best MMORPG... but if I can even manage to make one, I can at least make it one of the most interesting.

vagrant surge
#

the issue with mmos really is the content

tardy spoke
#

@vagrant surge the way I achieve the branching of quests would just be in the "number" or quest lines

vagrant surge
#

something ive tought about a lot is to do something more... sandboxy

#

for example, taking clues from survival games

#

not having 1000 players

#

having 60

tardy spoke
#

So not true branching, just because the scope would just get too out of hand for me at the moment

vagrant surge
#

on a relatively big world

#

and have the mechanics be more sandboxy, maybe with autogenerated quests

tardy spoke
#

@vagrant surge that's a really, really good idea.

#

The fun of MMORPGS isn't really the amount of people IN the world

vagrant surge
#

look at the popularity of stuff like Ark and Conan

tardy spoke
#

It's mostly just the fun of playing with other people, mainly of which are the people IN your guild

vagrant surge
#

i think something of that style, but more mmorpg + sandboxy style could work well

tardy spoke
#

and the experience would be far more engrossing and stuff if a lot of those other people were not even there at all

#

For me it never made sense that EVERYONE in an MMO is a hero. Like... how does that make any sense hahaha

#

There's more heroes than townsfolk.

vagrant surge
#

issue with a project of that kind, is that you need a lot of assets

#

you need to be able to create a legit fantasy world, which even if you spam the hell out of the store and megascans, you still need the level designers

#

the tech itself is doable, but for a single programmer.... you would need to essentially be god

tardy spoke
#

That's the stuff I'm good at.

#

I suck as a programmer.

vagrant surge
#

i know some guys who are making an open source version of WoW

#

mostly for fun

#

and research

#

they are using ECS and dots-style techniques

#

they can render the entire world of world of warcraft

#

at once

#

just from pure bruteforce

#

and put like 2000 players in the same zone

#

its quite impressive how this sort of techniques scale

#

the guys literally have a much faster terrain renderer than blizzard does and its hilarious

tardy spoke
#

I'm under no illusion that skill makes a project such as creating content for an MMORPG any sort of "realistic" task for one person though. As I said, you'll notice the specs of my projects change to what I actually think I can actually accomplish in a span of 2-5 years, haha.

I do have my buddy helping me though who's also a modeller.

But here's the real secret -

I'm just likely to use Synty assets. For literally almost everything. To make it easier, the specs now call for an electic game world that interesting matches the Synty store assets... there's a typical kingdom, a feudal japanese kingdom, a wild west kingdom, a futuristic sci-fi floating city, a modern city kingdom... ๐Ÿ˜‰

I've actually tied it all together with a bizarre story that there was a nuclear meltdown in a modern city and basically civilization split with different leadership philosophies about the best way to live, but then zombies started coming out of the radioactive city so they're all at war with it trying to get in and shut down the "reactor" or something like that. I care more the visuals are interesting and different than they make sense. Why would there be a "wild west" kingdom? Because it's cool. That's why.

vagrant surge
#

horrible idea

#

sinty assets suck

#

and they are too known

#

i know for a fact because i tried to do almost exactly the same

tardy spoke
#

They're known to people that make video games

#

Lol dude, 90% of hits on the radio use the same drum samples, I can hear that all day long, but does someone who's not a professional audio engineer care about that, or do they care if the song is good?

vagrant surge
#

the problem is that sinty assets suck much more than you think

#

going with a realistic graphics by spamming the absolute hell of megascans is a much better path

#

the problem is that sinty assets are horrible optimized AND they cant be LOD-ed

#

you also need super good lighting to make the flat stuff pop

#

and for non gamers, it looks like shit

#

realistic graphics are much more sellable

#

there is also the issue of making new assets in similar style. Due to the strong art style, you need to match it, and thats a problem

#

specially because you can only use sinty assets

#

if you go with a more realistic style, you can use a massive amount of assets, as half the store is realistic assets

#

i consider attempting to go with sinty for this project a pretty bad idea and a huge mistake

tardy spoke
#

Dude that combat system is AWESOME, hahahah

vagrant surge
#

it is

#

the core combat i got there is the best vr combat system of all

#

specially stuff like 1v1 duel bossfights

tardy spoke
#

@vagrant surge I'm developing for Oculus Quest so... mega scans... lol not happening

vagrant surge
#

sinty is harder to render than megascans

#

you cant make lightmaps on sinty assets

#

you can make lightmaps on megascans

#

this prototype was for PS4

#

i was struggling on perf given that i needed dynamic light and SSAO

#

and having dynamic light + ssao in a PSVR title is about as HELL NO as you can get

tardy spoke
#

Are you "selling" the combat system working? What happens if you were to just stab through an enemy and just "jiggle" the sword?

vagrant surge
#

ssao takes 2 miliseconds out of 8 miliseconds of budget

#

enemies go back. You also cant damage them again until you remove the sword from their body

tardy spoke
#

Still, what if you were to just kinda "wiggle" the sword, could you do unrealistic damage or is there something preventing that?

vagrant surge
#

if you hit their shield, they become invulnerable even if you keep the sword inside them

tardy spoke
#

Interesting, that is very cool

vagrant surge
#

its a very arcadey system

#

but its done like that for maximum playability

#

i experimented a lot with physics based systems. I made blade and sorcery and boneworks before those 2 existed

#

but i considered those systems to be absolute shit

#

they look great in gifs but are horribly janky when used

#

boneworks is the best example

#

its basically unplayable due to the level of clunkyness it has

#

you cant be accurate with any weapon due to their inertia, and its super hard to use even a simple hammer to bonk a zombie

#

but it looks great in gifs

#

easy money

tardy spoke
#

Well wouldn't a representation of a sword being unattached from where your hand is in real life cause discomfort?

#

My thought for something like a great sword is a game shows where your true hand is in real life but if you swing say a huge great-sword "too fast" it cancels the swing.

vagrant surge
#

it does. Thats why boneworks and blade and sorecy suck

#

they have absolutely huge detachment

tardy spoke
#

So you have to "learn" to swing different swords at the correct pace and depending on your level.

vagrant surge
#

in this game i have thats not the case. The sword is allways full speed directly tracked to your hand

#

its more like a beat saber sword than a physics sword

tardy spoke
#

Same with guns. You can use a level 99 rifle at level one but it takes you 20 seconds to chamber a round.

Takes you 10 seconds to swing a level 99 sword that a level 99 could swing in 0.5 seconds.

#

That's just an IDEA, don't know if I'd actually end up doing anything like that.

vagrant surge
#

i did try to do stuff like clamping maximum speed on heavy weapons

#

but at the end i just dont think it feels right

#

i think having direct connection from hand to sword feels much better

#

and the higher level of speed lets you do fun things

#

thats also how that viking RPG works

tardy spoke
#

Yeah, that was my thought too, just not sure how to do the different "types" of swords

vagrant surge
#

thats the closest thing to my system

tardy spoke
#

Like if it's directly attached to the hand, how to do a dirk vs two handed great sword?

vagrant surge
#

btw, the magic system in the video i showed, that uses ECS

#

but in unreal

#

and it was pretty damn awesome

#

you could create a ridiculous amount of spells by changing the components

#

specially as i had stuff like "spawn other entities on hit/timer"

#

so you could create absolutely ridiculous stuff

tardy spoke
#

I would love to do a gesture based spell casting system just because I love the idea of people memorizing ridiculous hand motions to cast fireballs and healing spells haha

vagrant surge
#

i experimented with it

#

its neat, but i mostly used it to switch spells

#

so to switch what spell you have "equipped", you do the gesture

#

the game above did have that system at one point

#

then you just use the trigger to control the spell like if it was a sort of gun, which is what kinda feels most logical

#

in the spell ECS system, it all worked through components

#

each spell, when you press trigger, would create an entity

tardy spoke
#

How long did it take you to make that demo game?

vagrant surge
#

bout 2-3 months

#

but it was a project ive been prototyping stuff foryears little by little. But that specific demo took about 2 months

#

full recode, i just put togther some of the older prototypes into it, and hired someone to make the dungeons

tardy spoke
#

Very cool. So that's in Unreal?

vagrant surge
#

btw, its procedural dungeon

#

yes

#

runs on PSVR too

#

tho its harder to play it there due to the shit controls...

tardy spoke
#

The Oculus Quest has the processing power of a Google Pixel 2 phone... so imagine that, with no lighting or textures... and it may run. ๐Ÿ™‚

#

That's my starting point, haha. I may be able to get away with some sort of outline shader or effect to add visual interest, or I may have to get a bunch of artists to hand paint the entire world beautifully in vertex colors and do blob shadows... no idea.

solid flume
#

If I have a nativearray of structs and each struct also contains a nativearray, how exactly do I go about disposing it?

#

Any references I found for octrees used ECS. I just want something that works with jobs and burst doesn't throw up all over

vagrant surge
#

@tardy spoke the spell was pretty fun, i thought of actually having procedural spells or spell editor