#archived-dots
1 messages ยท Page 166 of 1
If the data output from compute shader can be directly used in rendering that might just be faster than doing the task on CPU then pass a huge data to GPU afterwards.
I get a list of vertices/triangles from the shader, put that in a mesh and then put the mesh at the right position
I can't say.
Though last time I read some talks here about job system multithreading can take up to 1ms just the scheduling itself, not sure if that's true or true anymore.
I'd say it's probably not worth redoing everything though if your current solution is already pretty performant.
it's still true
job system doesn't make sense if you have like... 1 or 2 stuff that you need to move.
If it's the only way to use burst you still might get it to be faster.
Right now it's not worth. Maybe for something else
I'm not having good experience with GPU stuffs though, but maybe that's because I'm targeting mobile and especially low end mobile.
I did a GPU based particle system, which program just needs to pass in some vertex data and the shader takes care of transforming positions based on animation and all that jazz, so that there's only one transfer from CPU to GPU on particle spawning and despawning (comparing to a CPU based particle system, which needs to update vertex positions every frame and pass to GPU)
On low end mobile devices even a few hundred vertices are too much for them, so now I'm working on converting it to CPU based instead.
I feel like for small projects like mine, bursted job on main thread is more than enough for most use cases.
I really enjoy using Burst and Job system even not in the context of ECS.
Does anyone know if it's possible to clone a NativeHashSet?
currently writing a page on the wiki titled "Dispelling misconception on DOTS", should I make it its own page OR should I put it in the FAQ?
I'd click on that title if I saw it, so separate sounds good.
@lusty otter yep mobile has severe GPU restrictions. I have a shader graph that simulates 2D water, and all it does is basically read from a couple textures and scroll with time, yet it's the slowest thing in the game
I can do anything on the CPU and my FPS will not go above 60 because of the shader, but then again I'm fine with 60
Yeah mobile GPU are pretty limited, I'm moving computationally heavy stuffs to CPU, and leave GPU as an option for high end phones.
Hey guys, can anyone help me with this?? DOTS instancing should be turned on in the shader..
go to Projects Settings -> Player -> scroll down to scripting define symbols -> add ENABLE_HYBRID_RENDERER_V2
I already have it enabled ๐ฆ
lets say we have system A and system B... both use jobs to multithread their work... but system b's jobs should run after system a's job... how do we do that ?
lets say we have system A and system B... both use jobs to multithread their work... but system b's jobs should run after system a's job... how do we do that ?
@stone osprey add [UpdateAfter(typeof(SystemA))] on the SystemB to ensure that the OnUpdate of SystemB is getting called after SystemA, and expose SystemA dependency so that you can combine it into SystemB dependency.
class SystemA : SystemBase
{
public JobHandle GetDependency()
{
return Dependency;
}
// OnUpdate and other stuff
}
[UpdateAfter(typeof(SystemA))]
class SystemB : SystemBase
{
protected override void OnUpdate()
{
Dependency = JobHandle.CombineDependencies(Dependency, World.GetExistingSystem<SystemA>().GetDependency());
// schedule your job and do your stuff
}
}
maybe with a flag (an entity)? or maybe avoid separating systems and enqueue jobs in order
Or you can stack the 2 Entities.ForEach in one System.
It will magically know that Entities.ForEachB wont run before Entities.ForEachA finishes
@rancid geode Thanks a lot ^^
Thanks everyone... guess its working now ๐
One last question... do jobs get executed at the end of the frame or once i call them ? Or once the whole dependency graph was build ?
afaik jobs get scheduled after each system's update
^
and to add to that, ajaik, once scheduled, you leave the executing of the job to the job system. So it can either gets processed this frame or the next.
Is there any way I can get a job to iterate over all integral coordinates from (0, 0, 0) to (x, y, z)
@deft stump Aha ! So jobs are getting scheduled and executed once the job system wants to process them ? Propably this frame... could also be next frame ?
yep.
the Job System will "hold" onto the instructions but wont process them.
you leave it up to the job system when they want to do the work. Sometimes it will process it this frame, sometimes it will process them in the next 2 frames.
even in code, RNGeesus blesses us
@deft stump hybrid renderer does a Complete in the presentation group; won't be exec on next frame if it's before that point
@solid flume you can't have nested jobs
Is there any way I can get a job to iterate over all integral coordinates from (0, 0, 0) to (x, y, z)
@solid flume
Ideally without passing in a nativearray of the coordinates
Ugh I can map coordinate to an array index but can't find a way to reverse it
Which is logical
But annoying
There exists a 1-1 mapping from N to NxNxN, just need to find it and it's inverse
you absolutly can go from flatenned to Nd if you know the size of each dim
I know I can, just realised the math, but need to figure out how
Each dimension is the same size
Hi guys, like a year ago I made a comparison of the flocking implementation made by Unity in DOTS, translating the same algorithm to OOP in single thread and multithread, and also to compute shaders. I decided to "beautify" a bit the presentation and share it, perhaps someone finds it useful, to see what really dots was capable of +1 year ago https://github.com/CristianQiu/FYP-Flocking It was the very first time I used compute shaders so treat it with caution XD
wat is flocking ?
ahhhhh
i wanted to find the strength to update it since dots performance may have improved, but since in another year or so it'll be probably outdated again i'm just too lazy
okay done writing another page.
https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki/Dispelling-Misconceptions-on-DOTS
you can edit the page if I'm wrong, the purpose is just to blow away some mindsets that people tend think about Unity's ECS. I partly blame marketing for it
It's good to call out the issues with the Hybrid workflow. I'm definitely struggling there, but I think that's because of the lack of tooling
There needs to be more tools to fill in the gaps. But, it's not complex stuff, just needs to be implemented
Really, once I get my head around Hybrid, I'm going to write some best practices for 0.13
@deft stump thanks for writing that, all this stuff really helps me out. ๐
If anyone needs "visuals" whipped up for the articles just let me know. Send me a sketch and I'll make it somewhat pretty and throw it up.
we should probably number these pages we make
sort them from introductory to implementation
Yeah, would be good to get some sort of nav system in there but it adds some friction during the "ideation" phase, so not sure when a good time to add it would be
People have done a great job contributing so far so if that keeps up I have no qualms spending a day doing the nav and categorizing stuff a bit down the line
People
there's only 3 of us that's contributing lol
we should actually add more rules in our contributions page.
like explain stuff that a 3-year old would understand or something
GREAT idea
I was afraid to propose that because I suck so bad I thought it would be "self-serving", hahaha
I'm all for reading code, but man a page of nothing BUT code hurts my eyes.
A good rule would be "no additional code than is necessary to portray the functionality you are trying to demonstrate" to avoid people slapping entire systems in there (with functionality beyond what is being demonstrated since it's from an existing project) trying to be helpful but just adding confusion haha.
Or "keep it Python-esque". No super fancy code if unecessary.
or maybe explain what the code does.
what does the variables mean?
why does this function exist?
does github wiki not let you add subcategories in the sidebar
@hollow sorrel it doesn't seem to have any sort of intelligence categorization or nav systems at all... like you can't even internally link pages, have to use full url lol
With an add on or something maybe? Seems like it's extendable
@tight blade seems to have a good handle on it's capabilities, and wants it to parse to an actual webpage at some point
My issue with it is there doesn't seem to be a way to display EVERY page in the wiki, so you could literally "lose" pages
There must be a way
maybe we SHOULD just build a webpage for it.
The scope/feature creep is real
like how MS does with their documentation
It went from my shitty google page, to a github wiki, now a webpage... it's expanding at an alarming rate hahah
we're gonna overthrow unity's documentation
Is there a service that hosts a REAL wiki? I couldn't find one that seemed any good...
That's all we need, is just a full featured actual wiki
@violet cosmos was mentioning a Wikimedia site or something?
That's a concern of mine too... I don't know if GitHub wiki has a way to view all pages
Could make a github page for the repo since you're using Github already
@violet cosmos yea I was worried about literally losing pages while creating the nav (I didn't make a nav, just when I was looking at how it would be done)
It's a very un-wiki-ish wiki lol
Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
hrmmm
yeah. maybe we should use this service
the Home page could also be a Table of Contents
I like GitHub because I couldn't imagine someone at the technical capability to use DOTS doesn't have a GitHub account. There's a lot to be desired about the functionality though
Yeah, I mean technically if were starting to think about growth, we could set up a commit hook on the git wiki that added all the pages into a nav bar automatically
how do you parse the wiki pages with a navigation onto a github page? How do you "tell" the page what the nav is going to be?
Yeah it wouldn't be hard to add ALL the pages, but how do you do a hierarchy?
[some text here](link to page)
For Github wiki
[learn more about some feature here](Feature)
Instead of doing
[learn more about some feature here](Feature.md)
Yeah. I mean my thought would be to have an unsorted section, and anyone can manually move the stuff from there
Once it's on the nav bar, copy pasting into a hierarchy spot isnt hard
If GitHub Pages has a way to A: View all pages, even if they're orphaned and B: Uses the same markup so we can copy and paste, and C: Is still freely open for user contributions... Then, I say we go for it. But, imho those three are required
What is item b?
GitHub wiki has a markup format. I don't want to reformat every article
Ohhh gotcha
That'd be nice
You can use a parser like Jekyll or Hugo to read md and generate html
But, is it user editable without making forks and contribs?
You'd probably still need to fork if you want different users to contribute
It is not. Which is why we went with the wiki
To me it seems like a true wiki hosted somewhere is probably the best approach?
Hrmmmmm
I mean I'd imagine if there was some wiki that had a superset of github functionality no one would be against a simple migrate
I say we figure out how to view all pages in GitHub wiki before we do anything else....
lol
No, if we add a custom sidebar, then.... How do we view all pages?
I think some people will add pages and not link them, then it's orphaned
Right the custom sidebar for hierarchy. Yeah and I mean I think that's part of the reason that custom sidebar exists. Intentionally to filter
Yes, but even as an admin I don't see the option to view all
in the github repo you can directly edit stuff without forking and/or cloning it
Can clone the wiki locally as a workaround but that is dumb
OK, cool
We can still. When we add a custom sidebar, the Pages tab just automatically gets collapsed.... But you can expand it
@deft stump ... can you??
yeah
Just tested ๐
Great haha
That's called terrible UX/UI
When it takes 5 devs to figure out how to view the pages in a wiki you got a problem
Oh shit. Well it works so I'm good with that
The same person that made that now works at Uber Eats ๐
It works well... it should be the DEFAULT.
Hahaha @Benjamin
oh nice
OK, status quo. We'll have to keep an eye out for orphaned pages now and again, but that's NBD
So i want to bring the JobSystem to "Artemis ODB"... a ecs in java im using for my serverside code... Components for Job Entity: Job, JobDependency, JobState... heres where i cant decide how to proceed... once a job-entity was created, we could either... Queue the Jobs and their dependencys instant... or we wait till the next frame and process the job-entities... the only difference is the point. Any help on this ? Queing the jobs instantly, is probably faster... but not that flexible... waiting till next frame is much more flexible, we can basically restructure dependencys during the rest of the frame... or extend the job entity itself.
@stone osprey Maybe this is useful... They're talking about how to integrate Job timings with the player loop https://www.grizzly-machine.com/entries/maximizing-the-benefit-of-c-jobs-using-unitys-new-playerloop-api
So what did we land on? Keeping the wiki as is? hahah
Yah, I vote be lazy ๐
We're fighting feature/scope creep. We're good devs.
Lol yeeep
I can probably do it tonight or something
sometime soon
organize it a bit now that we're not afraid of losing pages
Unless the sidebar has a collapse function, I say we keep it "top level" pages
Yeah, I won't make it cluttered bullshit, no worries
hahah I dont want to do that HAAHAHAHA
I'm overdue on a task I need to stop writing Visualizing DOTS part 2
Actually, what I'm most interested in for the wiki and I think would be helpful for a lot of people is "visualizations" of the systems and what they do.
IE I'd like pictures of "GameObjectConversionSystem" and how it connects to other systems, etc.
@stone osprey you're talking about implementing your own job system in java, right?
unity's job system queues instantly, dependencies are up to the dev to ensure it's scheduled in order (with seperate automatic dependency scheduling for ecs, but this still happens outside the job system)
always making it wait until next frame sounds less flexible to me because then you don't have the choice to schedule right away, whereas if you handle dependencies outside of job system then you can still decide to schedule the job next frame if you want
IE I'd like pictures of "GameObjectConversionSystem" and how it connects to other systems, etc.
I'll probably do that in the future.
right now I want to get basics visualized @tardy spoke
Yeah, that was just an example. Literally if people just send me sketches on napkins I will draw them out "pretty-ish" and throw them up on the wiki. I would do it myself but I don't understand them well enough, haha.
I will buy people beers for these sketches. 1 beer per system sketch. That's how bad I want these sketches.
@hollow sorrel Thanks a lot for your fast reply ! My problem is the building of dependencys... each of my artemis system launch "job-entities" into the world... building dependencys in one system is no problem, because we have a reference to it... but i have no clue how System B's Jobs could obtain a reference to the jobs of System A ( in a clean ecs way )... thats why i thought waiting till the next frame is a good thing, because we can simply construct the dependency later on ^^ any idea how i could solve this ?
maybe I should make this visualizing dots/ecs a multipart series?
Yes โค๏ธ
i planned for it to be 2 parter because I wanted to cover the basics.
but yeah, visualizing every aspect of dots might be better
I think my productivity has just gone 10x with the Dark Theme being free.
2019.4.8f1
nani!/
HALLELUJAH!
Same for latest 2020.1 (whatever version exactly that is)

๐คฏ
THey even made it the default ๐ช
currently downloading!
Ohhhh shit
Makes me wonder if there is a bigger reason behind this. Feels weird to just have this happen out of nowhere.
God it took them what? how many years to make it free
All the years haha
Maybe it's all leading up to the grand finale of finally updating the com.unity.animation samples ๐ค (hahaha bad joke ๐ข )
Is the dark theme part of the DOTS package and once you install it it'll just keep crashing? Is this a trick?
hahaha
The editor has been surprisingly stable the last 2-3 months probably (except right after package updates maybe).
looks legit ๐คฃ
lol I actually for real can't figure out how to enable it. Is it a package on the package manager or just an option somewhere?
@stone osprey if you're doing it manually, the way unity handles that is to have a public JobHandle for each system so when you're creating a dependency you just getsystem<somesystem> and combine its jobhandle with the one that's depending on it
basically this means systems are order dependent
but yea waiting until next frame might be easier, that way your systems don't need to be order dependent, i don't have experience with implementing a job system so all i can say is how unity does it
@hollow sorrel Thanks ! Well the part where im stuck is the following... i heard unitys jobs are getting queued "instant"... Lets say system A schedules its job... the job system takes care of it... now System B is ready, schedules its jobs with the dependency of System A... why is this working ? The Jobs from System A are already in queue or executed... How is this possible ? Or do i miss something here ? ^^
@tardy spoke
oof the menu bar not being dark mode hurts me, i thought windows would handle it somehow
I made a forum post about that @manic aurora
@stone osprey yes, basically you only get a JobHandle when you schedule a job, it's like your ticket in line at the post office
so when system B schedules with a dependency on A's JobHandle, the job system knows it's the one in line after A
Go ahead and necro that, seems timely ๐
@spark glade thanks! I was staring pretty much right at it but didn't see it for some reason, haha
I hate it
I have a big bright display and it totally throws off the contrast when I'm doing color sensitive work for clients
@hollow sorrel That makes sense... but how is this implemented ? System A scheduling its Jobs, those are getting processed... System B comes in place, depending on System A, System B's Jobs are getting queued if System A is not finished yet... once System A is finished, it executes the queued jobs ?
@stone osprey In ECS or in pure Jobs?
ECS ^^ i wanna copy this mechanism for a java ecs
Maybe we should chek systembase' code
not sure how they implemented it
my guess is when the job system decides to schedule new systems it checks which ones are able to go (by checking if their dependencies are done), but that's just speculation on my part
^^
this isn't really ECS specific tho
There's an [UpdateBefore] and [UpdateAfter] attribute you can use for SystemBase classes. There's also the ability to add your own System Group types, to group systems together and slot them into one of the existing groups
Here's a clear example, illustrating both: https://github.com/WAYNGROUP/MGM-Ability/blob/master/Runtime/Systems/AbilitySystemGroup.cs
@violet cosmos what he's asking is stacking of entities.foreach
Oh, AFAIK that order is implicit, top to bottom, unless you make JobHandles
@violet cosmos The internal logic of job scheduling along multiple systems... ^^
I could be wrong there though
I honestly don't know if Entities.ForEach within a single system does internal reshuffling based on what it thinks dependencies are.
Here's another class in the same codebase that seems to do some internal dependency management. That might be a clue that ECS isn't doing much (or correct) inside the system: https://github.com/WAYNGROUP/MGM-Ability/blob/master/Runtime/Systems/AbilityEffectConsumerSystems.cs
Note that the system Dependency property does not track the dependencies that a job might have on data passed through NativeArrays or other similar containers.
So then its only going to work with read/write of components
Im gonna try the following approach now : System A schedules Jobs, provides reference to all of them... System B takes that reference to them and simply depends on them... i guess thats the simplest way of replecating this mechanic... this is probably 1:1 how unity does it...
and only works if you're scheduling jobs rather than Run() and have no sync points - don't use entity manager or WithStructuralChanges cause they will wait for all jobs to complete
yea i think that's the simplest as well, you can always add automatic dependency management later if you want to
Can a blob asset reference be assigned via an ICD authoring component?
Or does it have to be done in GameObjectConversionSystem type thing
I've done it before, when BlobAssets were initially introduced in the Entities package.
iirc - all I did was construct a blob asset and stored it in an ICD (I was using the Convert method in the IConvertGameObjectToEntity back then - not sure what the process is like now)
@coarse turtle yeah I have field for a blob asset reference, just curious if I can assign the actual reference to the blob asset in the editing environment easily or if it basically has to be done with an initialization script of some sort for that component
Yeah I'm sure you still can
Well, here's really what I'm trying to figure out. Let's say I have 100 characters that can give you a quest, and they're converted out of GO's in the editor with that script.
What's the "best" way to assign that blob asset reference since I can't assign it from the "editor" (at least I don't think there's a way I can)?
will each character have different waypoint data ? or their quest rather
Well without knowing much about the quest - let's say you author them in a scriptable object for workflow. You would read the scriptable object data, construct your blob asset structure - copy the data from the scriptalbe object -> blob. Assign the blobassetreference to your ICD.
Did any of you manage to make a linux build with the new build platform packages? I can't even get the menu item to show up
@opaque ledge yeah, it's just "waypoint data" for now because I'm following the codemonkey tutorial, hah.
But yes, I think they will technically be "separate" waypoints that become quests. That's another thing I have to look into is what exactly I can cram into a blobasset as blittable data that I can easily human edit. Was thinking of converting text assets of JSON if I could, then in the system parsing them into an object.
Figured I'd better start getting it working at all before I started tinkering. Some of the tutorials syntax is a bit older.
But, really how often do you read from those?
The idea being that all quest "steps" are held in the text assets basically, and the component just holds the progress through the "steps".
Yes, but how often do you read from the waypoints?
except those text assets need to become blittable somehow
Or use them in game
Oh, the waypoints is red herring
I'm just following a tutorial, but those will be "quest text files" eventually. Not waypoints.
i mean blobasset is something a components shares so you wont have to duplicate your data, i dont think in your case, using blob asset is a good idea, but then again, i never did any blob asset stuff
@tardy spoke just wanted to quickly say (as Psuong mentioned) definitely I know you're relatively new to Unity so definitely get comfy with ScriptableObjects - they're very handy for this kind of editor config-data
If a scriptableObject can be brought into a system as readOnly it may very well be a better solution
Otherwise it will only be another one of my systems running .withoutBurst() and .run(). Shameful. ๐คฆโโ๏ธ
I don't know if I'm understanding your goal though, in actual game mechanics not code mechanics
Oh, ok. The GO "Quest Giver" gives quests.
I have a system that if you're close to a quest giver, they "start" the quest basically. They have some components on them, is the quest active, whats your progress, etc, but then I figured I need a way to store the actual "steps" of the quest - which I think is kind of a difficult thing to solve in ECS in a non-confusing way.
Why not just a HasQuest component, that has an int QuestID?
Then you can look up the quest, and take it from them
So the idea for the steps is I make a JSON object or something that can be edited by me that looks like something like this, I have no idea what it'll actually be yet (a multi hash map may actually be better for this):
{
1: Quest name,
2: Dialogue: "Whatevs",
3: Go to: x 50 y 500,
}
@violet cosmos I think that's what I'm doing
Yup, and I'd store that outside of ECS
yeah exactly
I was just storing it as a blob asset so it can be run as parallel, seems like there may be an easier way to do it?
Don't, actually just don't store it in memory at all haha
Have a way to retrieve it from storage when needed, parse and apply that data. For example, the dialogue isn't needed all the time, Only when the person is looking at the quest details. The GoTo.Position is only needed when you're drawing a waypoint, or checking if the player is near, so might be part of ActiveWayPoints
I may have just confused myself because I tied the system doing the distance check to the system doing some work on the quests - basically I have a system like "if the person is within 5 feet load the quest", which actually doesn't make much sense, it should just tag them for another system to load the quest via reference so it can do the distance checks in parallel.
That's cool because I pretty much already have a basic system working with TextAssets, I would just need to split the Systems apart haha. The textAsset quests are nice because they are A) easy to edit and B) Can be attached via ICD right in the editor.
Yeah, hmm... I think I can actually solve this with a smarter System implementation and just pull the data from TextAssets assigned in authoring via reference ICD to the GO's, like I had before.
I have another question.
Another thing: I have successfully implemented a simple global state system, but now I'm thinking that global state system isn't really required for too much in ECS since theoretically if you "load" your gamestate from a save you could just write everything back to the components on initialization? Not sure I'm gaining anything except additional complexity with it, haha.
Is having a globalState an ECS anti-pattern, basically?
def no
@vagrant surge would the advantage be using it for an "acceleration structure" or similar or are there patterns that emerge later that essentially require it?
look at the overwatch ecs talk
they use global singletons a lot of times
for a whole lot of stuff
๐ will do
So... Right now, as a total noob at this, I view there's multiple states going on. ECS has it's own internal state, represented by ICD sets on Entity. Differrent Worlds have their own unique state, one per. Your game current scene also has a state, that exists outside... Whether it's separate, influences the ECS through reads/writes/both is distinct to the logic. You can also have a wider state for the game progress as a whole, that exists on disk and is only relevant when updating or calculating logic for the scene state (which in turn may then influence an ECS state)
That's a lotta state
Inside that, where and how you store that is up to you, but since that's the general pattern for most games, and yah... It's a lot of state - do it wisely
Yeah that's why I ask these fundamental idiotic questions. It's painful enough creating things in ECS once... imagine doing it twice because your patterns suck. ๐
Realistically I'll probably end up doing this over like 8 times while learning but ... still better than 9 times. ๐
Do you need to store in ECS than the player picked the golden carrot 4 levels ago? Maybe not, but maybe you do because he's approaching the farmer that owns the golden carrot field. In that case, the wise move is to store that golden carrot state on disk in level 4, and only load it on the level with the farmer. The farmer just has a slightly tweaked state: KnowsYouHaveCarrot
That's just one way, maybe not the best but for example
imagine doing it twice because your patterns suck.
imagine doing it four times, because your patterns sucked, then the api changed, then your patterns sucked with the new api, then the api changed again ๐
I feel it's almost a heuristics problem where a perfect answer is rarely achieved
Imagine programming for 3 months and coming to ECS because you're so bad ass you won't settle for anything less
๐
And then imagine you wrote two entries demonstrating Systems in the wiki to teach other people how to use it, because that's the current state of how bad ECS' documentation is.
MY WORLD IS PAIN SON
anything permanent i ever tried to write about ecs got slapped by it changing
I feel ya, i've been lucky that it seems most the big structural changes have finished at this point, but they could surprise us! But on the flip side all the old official documentation is super dated now and there is barely any new documentation with the new patterns/syntax
Also bojack horseman is best show ever
when you are designing for ecs whats the mindset usually works best for you? I have found that thinking first about the systems, then the components usually works best, but sometimes I get surprises, any tips to improve how to think or design with ECS in mind?
I am continuously iterating on 'but what data does this really need?' and 'what are the minimum combinations of transformations of the data required?' - what components and systems I need always fall out of that process. Don't know if that's helpful ๐
Everything is helpful, I find people thrown around the word "its like legos" a lot, but ECS it seems to be truth, you are building from bottom to top it's sort of weird, OOP is more like top to bottom. I have been using it the whole week just trying to wrap my head around the paradigm shift hahaha
i tend to just isolate by function, like, 'stuff needs to move' here's a move system. Stuff needs to be destroyed: here's a destroys stuff system.
The ComponentTypeHandle<QuestGiver> QuestGiverProximityJob.JobData.QuestGiverTypeHandle must be marked [ReadOnly] in the job SystemQuestGiverProximityActivate:QuestGiverProximityJob, because the container itself is marked read only.
... is it not? ๐ค
wrt the above, I think a big trick when new to DOD is being able to go from 'my character needs to move with arrow presses' to e.g. 'i need a position (float3) to move by a delta (float3 * time?)' and 'i need to capture key input and modify a direction' - about the data first and making the problem more general. Not always the right thing to do but I think usually a great start when coming from oop
Also I THINK what I'm doing is super cool. I'm just going to split the quest thing into two systems, the first checking proximity and adding a component to the QuestGiver for the second system to process. The second system will just run on main-thread since it will be referencing a textAsset directly, which is fine because there will only be one entity at a time doing that - the "quest giver" you are near.
-
Does even querying a managed ICD class cause issues in jobs, or is that fine?
-
Is it cool to process components on an entity while it also has a managed ICD class on it as well? In this case I'm not changing any values, but I will be changing the archetype by adding/removing a component.
@amber flicker that float3 is the recorded location of the character in the world
remember the character always sits at 0,0,0
@tardy spoke at a quick glance a) you're working with IJobChunks - nice!, b) I can't see your system update where you make a new job - it could be where you assign the ComponentTypeHandle possibly?
More like iBlowChunks
They're defeating me so far, but I will prevail
Yeah it's an experiment to see if I can get this to work.
Also pulling player location from state is an experiment because it allows me to run a LOT of systems on separate threads that otherwise need to reference that component directly, so I want to see the performance tradeoffs there.
it might be line 45? not too sure tbh
as for your questions - I think any use of managed ICDs means you can't use burst and I think must be main thread too. 2) Not really sure. Sorry late and logging off - hopefully someone here will actually be useful ๐ - laters
Yeah, I got that, but my question is can I even do something like
HasComponent(TextAsset) in a job
or does even that mean it has to run on main thread
To me that seems like it shouldn't force it to run w/out burst, if you're not actually USING the reference contained in the component?
It's a good question - I've never tried. I would assume that it wouldn't work but it should be easy to try.
Also oddly enough I took off the readOnly stuff and I get the exact same error... I must be have something in the wrong access scope or something
missing a public or something is private. Or it just hates that managed ICD
It basically looks fine to me but I'm half asleep so don't trust me. It might be that there's some other issue and the safety system is confused - definitely start by stripping it right back (which sounds like what you're doing already)
Good luck ๐ช ๐
Eh no worries! I got it not erroring out anymore, so I'm probably close. Whether or not it's actually running now remains the mystery...
Have a good... sleep.
when you are designing for ecs whats the mindset usually works best for you? I have found that thinking first about the systems, then the components usually works best, but sometimes I get surprises, any tips to improve how to think or design with ECS in mind?
@vestal sorrel i tend to think in sql databse.
anyone know if you can use Entities.ForEach targeting a different world/entitymanager than the system it's called from?
can use IJobChunk but that'd be easier
does anyone think the renaming of ComponentDataFromEntity from cdfe.Exists(entity) to cdfe.HasComponent(entity) is a bit awkward? in the way you kinda read it right to left instead of left to right
Anyone used this before?
EntityTypeHandle = GetEntityTypeHandle(), in an iJobChunk?
I get this error QuestGiverProximityJob.JobData.QuestGiverTypeHandle must be marked [ReadOnly] in the job SystemQuestGiverProximityActivate:QuestGiverProximityJob, because the container itself is marked read only.
... but it is...
they in the job formation make sure GetChunkComponentTypeHandle(true)
or whatever the specific api name is(true)
tis 'weird.
I had it working before adding that entity handle and trying to add the component.
@amber flicker would've been proud. Ish. I got it working w/out the read/write, but not at all with the getEntityTypeHandle, it seems to deliver that readOnly error no matter what.
@safe lintel yeah they are lol
looks correct, id restart the editor because I have no other ideas ๐
maybe the query needs to be marked as readonly?
there's another one from different namespace
Unity.Collections.ReadOnlyAttribute is the one you want
ya it's easy to miss
btw you can just do using unity.collections and remove the using systemcomponentmodel or whatever it was using before
Yeah, now that I know that's the issue I definitely will, hahah
Now I'm battling with that command buffer I didn't initialize hahah
Apparently in entities.forEach through magic you get this entityInQueryIndex thing, but how do you get that in an IJobChunk? Is that special or does it just need to be a unique int?
All I can tell you is it must be meant to be referencing some kind of method or something in the code but NOT a totally random int, hahah.
This has no errors, but doesn't apply the component to the entity... it must be something internal
it must actually be "related" to the entity directly
You can pass the index in the chunk when iterating
that's used for concurrency in ecb correct?
That's what I thought
Oddly enough that isn't causing any errors either but also not adding the component
must be something weird with my code
oh wait
I might be an idiot and checking wrong entity
Yes, was just my stupidity. Is working!
BUT!
Which of those solutions is correct? Is it an index of the entity, or a random number for the concurrency of the multi threading?
judging from the name, since I used it all the time in my bullet hell game,
it's an index of the resulting query
So it should be the entity index*?
Hmmm
Also I should really change this adding/removing the tag component to switching the boolean of a component otherwise I'm preeeeetty sure this solution is less performant than my old one hahaha
struct JobChunkEx : IJobChunk
{
public EntityCommandBuffer.ParallelWriter CmdBuffer;
[ReadOnly]
public EntityTypeHandle TypeHandle;
public void Execute(ArchetypeChunk chunk, int chunkIndex, int first)
{
var entities = chunk.GetNativeArray(TypeHandle);
for (int i = 0; i < chunk.Count; i++)
{
CmdBuffer.SetComponentData(i + first, entities[i], some_component_data);
}
}
}
Here's an example
imo, the bool solution is also (kinda) less performant too.
since cpu's like to cache in future instructions,
if a bool says no, then it will recache instructions again.
I just figure modifying data instead of changing archetypes is the way to go. Doesn't matter if it's a true bool or an int, I can make anything work
@coarse turtle awesome, I was wondering what "first" was for exactly
imho, I'll take the performance hit of moving entities to and from chunks.
just to maintain predictability
Well, there's only 100 of these entities and it's adding a tag that you're within 5 feet of one of them, or not.
so it's not a huge CPU load either way
I would love to see some real data about chunks and cost
โค๏ธ
The important thing to not lose sight of here is that today I created my first IJobChunk system.
Boy --> Man.
the thing is, in the system I'm working on right now there's a lot of archetypes.... so there may be a lot of moving around archetypes based on tags, and I'm just concerned it negates the benefit of ECS
What's a "tag" and what's a "mark" in this sense?
tag is the tag component solution.
mark is the bool solution
I think I've seen that page... Tag is adding a ICD that's a tag. "Mark" is adding a flag on an existing component to preserve archetype
you can find the article here.
https://gametorrahod.com/tag-component/
do you check for a flag each system run, or filter by tags, IIRC
Also I noticed "CommandBuffer.AddComponent()" method didn't add the component 60 times even though the system ran 60 times. Is it alright to not do a check for the component first before adding / removing, or are you supposed to do that when you use it? Not sure if it does the check itself, but it looks like it does?
where did you hook the CommandBuffer?
EndSimulation?
@deft stump wow that example is super explicit to exactly what we were talking about haha
BeginPresentationEntityCommandBufferSystem because I had no idea and just started typing stuff.
It's probably the wrong one and I was going to ask about that. Figured I had a 33% chance of getting that right.
Switched ๐
ugh my brain hurts jsut from trying to visualize dynamic buffers
sanity check, from my understanding.
unity will allocate more of the 16KB chunk as the dynamic buffer gets bigger and bigger.
if it's full, it will "shard" the dynamic buffer to another chunk, right?
did you set the initialcapacity to something really high?
what if there's no internal capacity explicitly written?
never tried, maybe there are some builtin defaults or maybe it just is the same as writing zero
btw, for context, @safe lintel this is for the community github wiki.
writing it for new people to understand DOTS better.
anyway if the buffer grows beyond its initial capacity it just gets stored in the heap
anyway if the buffer grows beyond its initial capacity it just gets stored in the heap
@safe lintel Oh really?
yeah
A DynamicBuffer is a type of component data that allows a variable-sized, "stretchy" buffer to be associated with an entity. It behaves as a component type that carries an internal capacity of a certain number of elements, but can allocate a heap memory block if the internal capacity is exhausted.
but can allocate a heap memory block if the internal capacity is exhausted.
WOW...
hrmmm I need to review what I'm writing
the advance parts had me scratching my head
in the wiki can you have discussions like on wikipedia or just make edits
I was under the impression that ECS "mini-chunks" entities that have different sharedcomponent values.
but no, it actually moves them to a whole new chunk
XD
lol best way to figure out what you know is to teach it. Exposes any knowledge gaps!
^^ true true.
I guess you can have discussions in the issue tracker ๐ค
Yea makes sense ๐
@coarse turtle where are all your sweet recipes on the Wiki!? I know you're cooking up a storm over there. ๐
I haven't really been touching dots lately ๐ค
But I can contribute time to time to the wiki - just been occupied with other work and there are times when I dont want to think about programming ๐
@tardy spoke what our policy on a full game tutorial?
put the documentation on the wiki? or in the repo?
@deft stump I have no idea but the more content on the wiki the merrier right now, haha.
If you need access to the repo for files or anything lemme know I think I can add
I'll probably fork it and make a pull request
sure, I can make you admin also if you want, whatever is easiest for ya
It would only make learning DOTS just that much harder haha
@violet cosmos guess you'll have to get a Mac for the dark finder bar thing.
@safe lintel thanks for adding stuff to my write up!
I'm having issues with JobHandle.ScheduleBatchedJobs() causing huge stalls on android phones - this case its 5.25ms but i've seen as high as 20ms+
The profiled section thats highlighted is just
Profiler.BeginSample("JobHandle.ScheduleBatchedJobs");
JobHandle.ScheduleBatchedJobs();
Profiler.EndSample();
https://forum.unity.com/threads/jobhandle-schedulebatchedjobs-causing-huge-stalls-2019-4-lts.950888/
What im doing wrong? I have this code working with dynamic buffer and getting error
InvalidOperationException: The NativeArray has been deallocated, it is not allowed to access it
on 124 line
anyone know where I can get a simple dots fps character controller from?
nothing fancy. run around, jump.
dots sample?
good point, I haven't actually looked at that yet
@half jay that might be the safety system being overly cautious - what happens if you comment out line 128?
According to my tests, if you have a Subscene in a scene and in Update or LateUpdate check if IsLoaded == true, it is true on the first frame both if the subscene is open or closed. Yet if you use the entityManager to retrieve an entity or look in the debugger, entities only seem to exist if the subscene is open. This seems like a clear bug but wanted to check if anyone else could verify.
@half jay Adding the component at 110 will cause an archetype change, which means that the buffer is moved as well and no longer valid
oh, I missed that - exactly what @stiff skiff said
Instead use an entity command buffer to queue the component add, and play it back after the iteration is done.
@stiff skiff and how should i add element to buffer then?
You can keep that the same, adding an element to a buffer does not change structure
You need to change adding the RayHitComponent
To be added via an ECB
but im working on main thread
That makes no difference
if i want add component to an entity which has buffer and add new element to buffer at same time i should use ECB or separate systems?
in one system ill add component and after in another ill add element buffer
aaaah.
you can do that in the same system.
has anyone used a buffer within a buffer, is that a good idea?
I think not? I haven't done it myself though
it could be, havent tried either
yeah I cant think how else I would solve my problem, I want a family list and then the list of families
why not 2 Dynamic buffers then?
that's what I've got
its basically a struct within a buffer, within another buffer
You guys ever program stuff and then when you're about to go to sleep you think about it and realize you approached it wrong and could've done everything a way simpler way? ๐ค
yep
Yeah, I just wasted the entirety of yesterday. At least I learned stuff. ๐คทโโ๏ธ
Yah, giving yourself distance from the code is important. You can get so boxed into the problem while focusing on it, you can't see the bigger picture until you quite literally take a step back
I wake up almost immidiately upon realization
haha yeah, glad to know it's not just me
I have programmer immsomnia
Like wake up from realizations or trouble sleeping because overthinking an algorithm, I actually had to learn to meditate because it got sort of excessive while I was in college, doing my thesis I was like sleeping at 4 am everyday.
I feel you polo
mine is worst. I jsut dont sleep HAAHAHAHA.
stuck in a problem? drink your hourly dose of caffeine!
I been there hahaha, but once I did that for like 3 days straight and started to get paranoid and I think a bit crazy, so yeah, get good rest, it will be worth it, your head is less clouded. In fact, you can notice the difference in tired-code vs wellrested-code
Definitely agreed, and on top of that, try to eliminate distractions when you're working on a complex problem
it's a good thing I discovered discord AFTER college
hooo boy, I would still be doing my thesis! 
Instead of making that entire IJobChunk yesterday which selects by this same entity query and then doesn't process the QuestGiverTextAsset (which is a reference type to a text asset), I could've just simply removed it from the query in a normal ForEach. For some reason I was thinking it needed all the components to select the correct entities, but then I was like... that's not how that works. ๐คฆโโ๏ธ
For some reason my brain was like "entity query must match components exactly" instead of "entities must contain at least these components"
@deft stump what was your thesis on?
Oh thesis time was fun, you literally have to embrace becoming a cave-man
@violet cosmos totally, eliminating distractions is key. It can take forever to get back into a flow state and one distraction can take you right out of it. It blows my mind co-working spaces are so popular... I don't think I could get any work done like that, hahah.
@violet cosmos totally, eliminating distractions is key. It can take forever to get back into a flow state and one distraction can take you right out of it. It blows my mind co-working spaces are so popular... I don't think I could get any work done like that, hahah.
@tardy spoke They should have a crash-course for managers and others alike called "Realizing when a programmer is in the zone and 1000 reasons why you should leave him alone"
Haha, our company went remote and adopted pretty strict agile (with the scrummaster single point of contact to defend the programmers from distractions) to stop the sales team/managers from bugging the devs
@tardy spoke
uuuuuuh. I think the proper terms was capstone.
and I forgot the actual title but we made an app where you can track service shuttles via gps around our city and also has the ability to display how many passengers are inside so users can make smarter decisions.
it was originally for trains though. But lel, the train company say no
lol that's a bummer
It sucks when you can't improve the world because someone is just like ... "nah".
the title was approved by our dean, but then when we talked to the train company afterwards, they say no. We had to scramble to find a different subject, but we can't change the title. It was a freakin nightmare hAHAHAHA
I never wanted to associate my thesis with a company, or develop it for a company. For that exact reason, you depend on their decision, I wasn't willing to spend so much time so a corporate head would say, "uhmmm maybe not"
I had friends that had to change their whole subject at the last minute and I was just like, nope, not repeating their mistake. I want to graduate.
to convince the shuttle company, I pulled out my best sales talk. slides, necktie and blazers, graphs, the whole shebang! we wasted ... 7 weeks? to get them to say yes.
so we only have 3 weeks to deploy, test, patch, and write our results! 
I have an art degree from some unknown University that I took just to party ๐คทโโ๏ธ
In hindsight I regret not taking something like comp sci... but it was fun.
Is there a way to convert a GameObject hierarchy non destructively and have transforms that move entities?
I have a rigged character that I'd like to import the bone positions of into ECS
Alternatively is there a way to pull bone matrixes out of DOTS animation?
I've never seen anyone even try to use DOTS animation yet haha, so I would have no idea
I'm in the middle of trying to port an existing project to ECS and I have so many questions.
Ask away!
Got most of the major game logic in, but the integrations with existing unity systems is making my head spin.
Have you seen this video of DOTS-BOTS? https://youtu.be/JkiJoAufH9A
Yeah I have
Yeah, I just mentioned because he integrates with a lot of GO's and reference ICD's etc
Is there a way to do Overlap/Cast queries on the fly without constucting a new collider every time I change the parameters?
I'm working on a fighting game, and one of the big requirements is animation driven hitboxes
I used to just do Physics.OverlapSphere
Or Physics.SphereCast
But that seems like it's not trivial to do without allocating a BlobAssetReference to some collider
Then cleaning up afterwards
Hmm, @tight blade was doing some stuff with physics so he might have some insight. Some of the other guys here are much better than I am and may have answers for ya. I haven't even touched the physics system yet!
That sounds painful though to have to do a blob asset per each collider made
I remember reading they use blobAssets internally but figured they'd make it easier for us haha
it should possible :S seems like a major use case they'd want to support.
i've used the physics authoring components on a project to generate new colliders and use them outside of the physics system but it required some hacks to the package to expose the collision methods.
.
Since I'm assuming DOTS audio isn't fully ready yet, even for a test, what's the best way to do Entities -> Pooled GOs?
A system that checks for a set of entities with a given "prefab ID", pulls a pooled GO to it's position, then destroys the Entity?
I need something to play momentary SFX/VFX
Using audiosources/particle systems
.
!warn 410448987577909248 Do not spam learning channels
BarbieBearMC#6372 has been warned.
I believe that if you convert that prefab with audiosource and particle system attached to it.
it will hold a referrence to it even in entity mode.
Does copying the entity also make a copy of the GO?
no.
@dusky wind I may or may not have useful insight. I haven't done manual collision query yet, but I have done a lot with the physics components. What do you mean by constructing a new collider when parameters change?
@dusky wind I don't know if it's doing it automatically, but you may need to use AddHybridComponent for the audio source, particle system, and particle system renderer
if you just need to spawn a specific go for sounds/effects and it doesn't need any link back to ECS you can setup it up like normal with an MB, have your parameters and prefabs on that. Then a system that finds a request to spawn an effect/sound, refers the message to your MB, which spawns it. Then all you need to do from ECS is create an entity with a component on with instructions for what needs to be spawned.
@tight blade the hitbox's shape changes based on animation
I have a BlobAsset that I sample every frame that sets up the size, position, and shape of the hitboxes in a given attack
That is all working, but I need something that actually turns it into a spherecast
And collects the hits from it
and just to straighten me out, what is the distinction between using a spherecast and using generated collision events?
(Im basically wondering if a system that changes the shape and responds to events would suffice)
In Unity Physics, I'm not entirely sure
But the idea is that it's instantaneous
And gives all of the hits associated with a movement instead of firing off individual events after the fact
You can convert a skinned character non destructively using manual conversion, its what I do for my characters + colliders for ragdoll/hitbox stuff. Need to look into manual creation for entities, transforms, colliders and joints to get it all working. Its not trivial, though more just a lot of busy work than any singularly hard part
Originally we chose this way since we didn't need to have a component attached to trigger this
And gives all of the hits associated with a movement instead of firing off individual events after the fact
@dusky wind just to drill in more to make sure I understand, this is 2 individual requirements, right?
- collisions are not responded to "after the fact"
- you get a list of all collisions, because you want to operate on them as a group rather than iterating over each one?
Yes
because some aggregate metric might be valuable, like "how many collisions total" or something?
I need to look at all of them in aggregate, sort based on the other components attached to the entities, then forward to downstream consumers for further processing
I'm not challenging that approach, but just having done work from the other side, an approach you could use is to have the collision system run at the beginning of the frame, have each event update a flag on a component that marks it for processing in a system that occurs later in the frame. It sounds like it might accomplish that objective without actually getting a list.
That said, back to figuring out the cast based approach
Sorry, I don't think I was clear, it's sorted based on the seen collisions
So a O(n^2) matches
ah, I see. so they have a priority. right. its a fighting game.
King K Rool's Belly beats everything, and all that.
Haha, yeah basically that
One potential way I was thinking of doing this was making a temporary NativeHashMap<BlobAssetRefernce<Collider>> for every unique radius
In the main thread
Running the job
And then collecting the results and disposing the colliders
But I'm not sure about the performance implications of such an approach
you mean NativeHashMap<BlobAssetRefernce, Collider> ? or NativeHashMap<int, BlobAssetRefernce<Collider>> ?
Latter, but with a float key
without further analysis I'll say the performance of that approach is pretty okay. Ive been doing it in one of my systems for a while. I create a NativeArray for the lifetime of a system and then schedule it to be disposed when its done
how many unique radii are we talking?
Potentially upwards of 64 x the number of active players
That's what I've allotted for right now
https://docs.unity3d.com/Packages/com.unity.physics@0.0/manual/collision_queries.html
"Note: We also provide direct access to all underlying query algorithms, e.g. ray sphere intersection, so you can use these algorithms directly if desired without allocating memory for the collision world / colliders."
I would be very surprised if SphereCast wasn't implemented, it's a common tool
But, that package is so new...
Unfortunately only Raycast doesn't have a collider input requirement
At least what I can see
so, firstly, that number probably wouldnt hurt you too bad, but I think we can optimize. For instance, you could respond to a collision event and cast a small sphere around the impact point
as far as i know you can only do queries against colliders that are setup within the physics system/BVH, attached to bodies etc, you cant just have a collider or bunch of colliders and test against them.
Ah, I didn't see the big blue "Use Latest Version".... For some reason this package page is different than ECS where there's a drop down
You could always do https://docs.unity3d.com/Packages/com.unity.physics@latest/ to go to the latest public version.
@mint iron oh as in it needs to be in the PhysicsWorld to be considered usable for queries?
yeah
Oh no, so there are hurtboxes that will be baked into the physics world
does that affect your solution at all though? I'm assuming you're setting the bounds of some primitives from animation data at the beginning of each frame
It's only the hitboxes that are dynamic
Yes that's the assumption
The hurtboxes are only moved around by the animation rig
The shape and scale are static
okay, and then the hitboxes are some invisible, scaled primitive shapes that cover the motion of the animation?
Yep
Oh man, I didn't realize that Hybrid Render V1 couldn't do dynamic meshes at all.
Switching to HDRP helped a bit though.
Yah, that's quite a gotcha between V1 and V2, you need to be on an SRP in V2 for things to work
I wonder how well V2 works with a custom SRP....
right now I'm looking through some of the types of Jobs that might be able to perform this use case. for instance:
Does that have continuous collision detection?
Or is just based on instantaneous location
I'm looking for evidence to confirm my understanding that it is continuous, because this is hooking directly into the physics simulation
It's getting late, I'll spend more time looking into this later.
Thanks for the help!
Let us know what you find?
well. back to my own battle with physics.
gonna precompute draft.
@dusky wind If you figure out an efficient way to do SphereCast.... I'm definitely interested, and is a good topic for the DOTS-Discord wiki
There's a wiki?
Community wiki
we're making one to clear up alot of stuff and hopefully bring new comers into dots
and also for our sanity, especially our sanity
here's the link if you want to contribute
@violet cosmos collider casting is covered in the physics docs https://docs.unity3d.com/Packages/com.unity.physics@0.4/manual/collision_queries.html#collider-casts
@violet cosmos maybe we should add a rule on what to actually write in the wiki? Instead of arbritary contributions?
@safe lintel odd since that is causing safety checks to fire off for me
Or outright segfault
whats the error
Editor crash 
When it's a safety check error, something about containers allocated in BuildPhysicsWorld not being disposed of properly
post the code?
so, that particular error is unrelated. I have no idea what its related to but it happens pretty frequently on ending play mode
public static unsafe void SphereCast(in PhysicsWorld world, float3 from, float3 to, float radius,
ref NativeList<ColliderCastHit> hits) {
BlobAssetReference<Collider> collider = SphereCollider.Create(new SphereGeometry {
Center = float3.zero,
Radius = radius
});
world.CastCollider(new ColliderCastInput {
Collider = (Collider*)collider.GetUnsafePtr(),
Start = from,
End = to,
Orientation = float4.zero
}, ref hits);
collider.Dispose();
}
oddly enough, the example posted above does not dispose of the collider afterwards
i would cache the collider, and store it in icomponentdata or the system itself. id assume thats why its getting a disposed error, but the example itself is a little odd in that regard
That's the problem as I mentioned before
the state of the collider is really transient
It's meant to be used once and disposed of
well if you look at the latest samples repo https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/UnityPhysicsSamples/Assets/Demos/3. Query/Scripts/QueryTester.cs they dont immediately dispose of colliders either.
im not sure if it fits in with best practises to be immediately creating / disposing of colliders every frame, afaik instead they should be cached and reused but its something that you could ask the devs in the dots physics subforum, theyre pretty responsive
What version are you on? (Physics)
0.4.1
Since entityManager is a reference type and can't be used in jobs, and commandBuffer's dont have a hasComponent method, what's the way to do this in a SystemBase class?
so it turns out that works, just not efficiently, at all
@tardy spoke HasComponent<T> should be a property of systembase that gets codegen'ed into ComponentDataFromEntity when used with a job lambda
though I think that might be the number of NativeLists I'm allocating there
@safe lintel yeah, just found it in the manual
and the DisposeSentinels that are being included
I got a bit confused because there are other way more verbose ways to do it inside of jobs.withcode in a system base and I was thinking there must be a nice simple way haha
Thanks! ๐
I usually do!
also you can also use ComponentDataFromEntity's HasComponent function
It would be nice if Unity de-listed older manual results from being google indexed actually
i added a list of all packages and docs to the wiki last night ๐ https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki/Current-Packages
It's beautiful! I should throw a link to that page in getting started
I added a CC BY-SA license to the footer just now
timeline dots has template manual btw haha
didnt know timeline dots exist, when that came out
@dusky wind That's disappointing performance on sphere cast.... I wonder if someone has implemented that, and I'm honestly surprised it doesn't exist in the core package. It's super useful
I need sphereCast :\
I'm dumb
I need it too, if that doesn't work efficiently, then I can't even think about moving this ability system to ECS
Or whichever one is the one that fires the radiused sphere from your origin, I always get that and overlap cast confused. I may need overlapcast or whatever they call it haha
I had a Debug Log for everyone one of those I was running
haha, OK, lets see numbers with those out, and in Release mode
oooh... that'd do it
@tardy spoke Nice job on the formatting for external links! So much cleaner
it's much better now that's removed
@opaque ledge says the first release was [0.0.1-preview.1] - 2019-05-06 but i only found it like a month ago
@safe lintel I linked to them here on the main getting started page, otherwise they're just orphaned and people probably wouldn't see their awesomenss.
coolio
We really need to focus on more recipes soon. That's really going to be the main draw, I'm sure ๐ค
I'll add my quest system when I can. You guys can make fun of it if it's architecturally insane.
That's cool, i'll add them to my package notifier right away lol
I like recipes and snippets, they're so much more useful to see than a few lines of disparate code that assumes you know the containing structure
Totally agree, especially when the containing structure has changed 3 or 4 times in the last 2 years
currently I'm packing up my old bullet hell game.
thinking there's good nuggets in there.
I'll also make an entire README to explain my thought process
๐
@deft stump I think that might be better for the actual GitHub project... We can add folders for example projects?
I dont know if I should make it into a written tutorial OR write it more of an article
@violet cosmos yeah I was thinking that too.
the root of the repo should be folders of individual projects
@dusky wind May I ask why you used the "unsafe" keyword in the SphereCast declaration?
he used a pointer access directly earlier
Collider = (Collider*)collider.GetUnsafePtr(),
Ick, that actually goes by geo rather than using mathemagics?
Maybe it's for compatibility reasons? I wonder how Havok is handling it
Actually, I made an assumption there, but...
Ok, I got the quest System at least doing the basic stuff it's supposed to correctly...
What do you guys figure would be the best format for these "Quest scripts"?
an int that references the quest text string. Then you have a factory that gets it, which later can be extended to support localization
I could write them as JSON and parse them in as objects I believe, or write a weird pseudo language...
Or possibly write them as a multiHashMap if I can parse that in somehow.
The goal of this is kind of to be able to have other people be able to write quests and not just me.
@violet cosmos the textQuest is added per GO via authoring ICD in the actual world, so every NPC that has a quest can hold their own script
There's a System for when you're close to them that adds a "Proximity" tag, and another system that looks for that and goes "load their script if they have Proximity tag"
I'd still keep that text out of ECS land, and off of the GameObject, and also do some sort of lookup. You want a reference to something that has the data, not the data. Otherwise you're carrying around that string everywhere, and it's not needed until you're displaying it to the user, and only briefly then
Hmm, yeah. That makes it difficult for my friend to author quests though as he doesn't code hahah
If it's a toy project, then... cool. I'd keep it in a MonoBehaviour then, since strings seem better off there than ECS. You're not going to operate on the string itself, just display it, correct?
Yeah they're readOnly
Then, I'd make a MonoBehavior that has that. Even better, a ScriptableObject type that has the strings, and you assign the reference to the GO. Even better, none of that and use SQLite and look up by ID, and have a lightweight authoring tool
But, for toy projects, I get what's quick is often best ๐
For a production commercial project, then you'd want something more robust/generalized
ScriptableObject type that has the strings that's a possibility for sure
That's "good practice" in Unity, then you can define those and make editor panels and if you get something like Odin in your workflow open it up even more
SQLite would be cool but I'm not super familiar with it's implementation so it'd take me a while. I can always revamp this Sytem down the road if not too much is built on top. Which I think is a benefit of ECS, the Systems are nice and decoupled which makes improvements later on a lot easier than with some other systems.
Just so I'm clear, what makes that more robust than linking to the actual TextAssets?
I get how it could be more performant
hey, dumb question but I've been working in jobstructs for so long I can't remember: is Entities.ForEach burst optimized by default?
@tight blade yes
kewl
Hence you have to tag it with .withoutBurst() to disable burst
Finally knew the answer to a question. I'm on fire today. ๐
@tardy spoke Storing them as TextAsset, then using Resources.Load just when it's needed, and destroying it when it's not might be better than a pure SO, but you also lose the option of custom editor panels
Hmm, interesting. Will look into the SO option to try to keep things away from raw data.
Depends on what you need, but get it done is better than nothing. Something I need to start telling myself on my system haha
Well, worse comes to worst I can switch it to SO's when I'm more competent in a few months, haha.
But if I can do it now in short order I'll give it a shot
Oh, but as for the other question -
Any ideas on the "type" of data to hold and parse in? JSON? Some kind of multiHashMap if it's possible to do that
I can see this idea getting so complicated so quickly hahaha
If you use SO's, you don't have to worry about that. If you use SO's that point to individual text files, then you don't have to worry about that.
Nah I just mean as to the content of the actual text files
they hold quest instructions... but what format should I store quest instructions in basically
I mean, there's likely no correct answer usually to that type of thing
but if anyone's done it before and knows what to avoid haha
Could do an SO holding a NativeMultiHashMap but it would make it difficult for others to work on for now, until those editor panels are made or whatnot
if that's something editor panels are even capable of doing. I assume so, but no idea how long it would take me to figure out how to do it if they could.
private const string QUEST_TEXT_PATH = "/Assets/Quests/Text"
string QuestTextFile;
string QuestTitle; //Small enough, and useful to see
Vector3 WorldEndPosition;
int ID; //useful if you have some sort of factory and tooling, but not required
string LoadQuestText() { //loader code }
}```
Basic super hacky but gives you some way to separate and build on
Also not so difficult to add and edit quests
Ah, that's interesting
There's lots of code snippets for creating SO instances in the editor, pick your poison. Most add them under "Create > My Game > Quest Descriptor" or something like that
Yeah I'm sure the documentation is likely a lot better for those, haha.
Thanks! I'll play around with it and see if I can get switched over to the SOs.
๐
Also, FYI TextMeshPro supports a restricted HTML-like structure. But if you wanted say... to have "step by step" that is displayed to the user, then maybe it's better to generalize. Still can be done in a similar way, just maybe a structure like JSON or even line by line haha
Yeah, I'm not sure whether JSON or a more "custom" line by line solution is going to end up better. It's hard to know what this is going to look like in the end, haha
Bang something out, it's not like doing a batch convert of a few dozen text files is difficult, or drinking a beer and going through them sometime on the couch
It's going to definitely be one of the more fun and interesting systems to build for sure.
Definitely, and something like that is bread and butter Unity that's it's currently well structured and documented for in the GameObject side
does anyone use instricts ?
https://blogs.unity3d.com/2020/08/13/the-road-to-2021/
Doesn't mention much specifics about DOTs except that is going to be worked on as part of netcode and better integration with GameObject for networking
"We are also continuing our efforts for our Data-Oriented Technology Stack (DOTS) to lay the foundation for the future of Unity and the architecture that delivers multithreaded performance by default. More on that in future blog posts."
waiting for future dots info: ๐ด ๐
Multiple systems creating an ECB from a ecb system only creates on sync point, right?
In order to get multiple sync points you have to be creating ECBs from multiple types of ECB systems?
Can anyone suggest UI tutorial of project tiny
Let's say I have a lot of raycasting to do each frame...
Is there evidence which is faster, including management overhead?
- Jobs and using raycast jobs on built in physics
- Unity.Physics and using raycasts on the usual entity topology/systems
- Havock, in either
would be nice to have some hard data on that, no clue really, but i have to think you can't go wrong with Unity.Physics + RaycastInput + Jobs as described here https://docs.unity3d.com/Packages/com.unity.physics@0.0/manual/collision_queries.html#ray-casts
might be a fun thing to benchmark, and, really, benchmarking might be the only way to get a good answer for your particular use case
Yah, was just curious if anyone out there knew of someone who had done the work ๐
Is there a way to procedurally decide to run a ForEach with Schedule or ScheduleParallel?
I feel like there is, in some C# setting I'm not aware of
The idea here is to count how many times ForEach has run, and if it's above N, run as ScheduleParallel, and below N, run as Schedule
Not with the lamdas, no. I requested it (search forums for auto schedule) but it doesnโt look likely.
I don't think so though, becuse that's just scheduled to run later
I think you might be able to pre-query the number of Entities with said components though beforehand...
Sorry you can do it, itโs just very verbose
If youโre going to Iโd use chunk count rather than entity count
https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki/ECS:-Run-vs.-Schedule-vs.-ScheduleParallel
Thoughts on this? I'm cool leaving it orphaned, and I'm not sure I want to leave in that bottom part, because it is a bit whacky
Use entityQuery.GetChunkCount() or similar but I wouldnโt include that in docs myself
Yah, nixxing it
I need a better example, and I can understand why Unity didn't introduce it since they're likely diligently working to make the overhead of ScheduleParallel indistinguishable from Schedule
I appreciate their optimism ๐คฃ
prob more because it wouldn't be free (performance wise) to check before every job wether to schedule parallel or not
and because most of the time it's a conscious decision
most the time you already know if your job is meant to process 1000+ entities or not
Yes, but this is also for people getting into it (like me). I wrote this mostly as a result of my research into this topic
https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki/Best-Practices - I wrote this list of "tasks" of topics to fill out, for me. I'm documenting that piece by piece
oh you're talking about docs sorry i read it as "why unity didn't introduce auto schedule"
ignore me
hehe, sorry. No worries
i like those doc pages btw, looks well written and seems like it would help a lot of ppl with "why" other than just "how"
keep it up ๐
Helps keep me sane that I know someone else might benefit, and that someone else might come along and add to it with their experience
That seems like a good place for an article about loading ECS code from a DLL and how to get it into the TypeManager
Build Win-Il2cpp failed after 2.30s.
error: Value cannot be null.
Parameter name: executableStringFor (System.ArgumentNullException)
at Bee.Core.Backend.AddAction
at Unity.BuildSystem.NativeProgramSupport.CLikeCompiler.SetupInvocation
at Unity.BuildSystem.NativeProgramSupport.NativeProgram.SetupObjectFilesAndSetupBuiltNativeProgram
at Unity.BuildSystem.NativeProgramSupport.NativeProgram.SetupSpecificConfigurationImpl
at Unity.BuildSystem.NativeProgramSupport.NativeProgram.SetupSpecificConfiguration
at WebPBuild.SetupWebPAlias
at BuildProgram.Main
at System.RuntimeMethodHandle.InvokeMethod
at Bee.StandaloneBeeDriver+<>c.<CreateBuildGraph>b__42_0
at Bee.StandaloneBeeDriver.RunBuildProgramInBeeEnvironment
at Bee.StandaloneBeeDriver.CreateBuildGraph
at Bee.StandaloneBeeDriver.BuildMain
at Bee.StandaloneBeeDriver.Main
*** Tundra build failed to setup error (1.93 seconds), 0 items updated
[E] DAG generator driver failed: "F:\Demos\ProjectTinySamples-master\RuntimeGeometry3D\Library\PackageCache\com.unity.dots.runtime@0.28.0-preview.40\bee~\bee.exe" build --beemode=ToCreateBuildGraph --commandlinerequest=runtimegeometry3d-win-il2cpp --root-artifacts-path=artifacts --bee-driver-buildprogramroot=.
UnityEngine.Debug:LogError(Object, Object)
Unity.Build.ResultBase:LogResult() (at Library/PackageCache/com.unity.platforms@0.6.0-preview.5/Editor/Unity.Build/ResultBase.cs:60)
Unity.Build.Editor.<>c:<.cctor>b__41_1(BuildConfiguration) (at Library/PackageCache/com.unity.platforms@0.6.0-preview.5/Editor/Unity.Build.Editor/BuildConfigurationScriptedImporterEditor.cs:68)
Unity.Build.Editor.BuildConfigurationScriptedImporterEditor:ExecuteCurrentBuildAction() (at Library/PackageCache/com.unity.platforms@0.6.0-preview.5/Editor/Unity.Build.Editor/BuildConfigurationScriptedImporterEditor.cs:127)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
I have downloaded project tiny and and trying to run runtimeGeometry Package can anyone tell the fix
Of this error
holy error message batman
@wheat stump did you install C++ build tools for visual studio
"RunBuildProgramInBeeEnvironment" I wish developers would not name their stuff like "Tundra" and "Bee"
@hollow sorrel No
Thanks I will install it now
@toxic mural I will try to run It Thanks
@wheat stump No sorry I am not suggesting a solution, just complaining about their naming
@toxic mural Lmao okay My bad๐
Guys i have a question
How diffrent coding in dots and coding in normal system ?
If you make a reply pls ping me thanks ๐
Its still C# of course but I think its 75% different, thinking in components, and behaviour happening in parallel batches
Or like, losing access to reference types
But its a spectrum, you can use hybrid style and only dip your toes a little into the ECS side, still have reference types, but if you dive into .ScheduleParallel() its a big shock
Thanks @hollow sorrel It worked out
https://www.youtube.com/watch?v=n_5RGdF7Doo - Good intro video on Physics and DOTS
and recent
How do I check if an entity has the "Child" buffer component?
I can get the buffer with:
DynamicBuffer<Child> children = GetBuffer<Child>(entity);
but this will throw an error if the entity doesnt have Child
HasComponent<Child>(entity) does not work
Does anyone have a resource that talks about handling complex input and states in ECS?
I think fighting games are a good example, there's multiple key presses and sometimes chained commands based on timings
It's not always 1:1 too... Press a key, change a value. Sometimes there's dwell, wait, modify, block flags, etc
How do I check if an entity has the "Child" buffer component?
@upper tiger In a system you can useGetBufferFromEntity<IBufferElementData>()and use theExistfunction
ah, it should be HasComponent(Entity) now
GetBufferFromEntity<T>() doesnt take entity as a parameter?
that seems weird
BufferFromEntity<Child> cb = GetBufferFromEntity<Child>();
if (cb.HasComponent(entity))
{
}
the wording is strange. If BufferFromEntity has component, entity... seems backwards.
Yeah I'm not used to the new apis yet too
while im on the topic, is there a better way to get all children of a parent entity other thant re-entrant functions
Yes
in a ForEach statement, you can create an argument to accept a DynamicBuffer<T> so ForEach((DynamicBuffer<T> b0) => {}). In an IJobChunk you can grab a BufferAccessor from the ArchetypeChunk
will that work for n depth
im sure this is some common datastructure problem, but I dont know what its called
i guess in your scenario, for each buffer I would need to check that the parent entity is the entity I actually want the change to apply to. It would iterate over every object with hierarchy in my game.
as long as the entity archetype matches your query (in this case if an entity has a DynamicBuffer<Child>) the ForEach statement will iterate over it - if you want a particular entity, you can probably tag the said entity or store it somewhere to access (but you'll likely use BufferFromEntity<Child> with the latter)
i thought about tagging, I could tag the parent entity, but that wouldnt tag the children as well. The only way to tag all the children is to traverse to them and tag them at which point i've defeated the purpose of traversal because I already did it.
say I have 1 million parent entities each with 3 depth of children. I dont want to iterate over 3 * 1 million buffer entities just to change the one entitiy hierarchy.
If I have a system with a number of Entities.ForEach, and each ForEach I am very confident won't overlap on working on components... Is there a way to schedule each ForEach to be on individual threads?
Or, do I have to go make them jobs?
@violet cosmos if you pass a JobHandle to the Schedule/ScheduleParallel, Unity leaves the Dependency management for you, so yes, that is possible:
JobHandle dep1 = Entities.ForEach(...).Schedule(Dependency);
JobHandle dep2 = Entities.ForEach(...).Schedule(Dependency);
JobHandle dep3 = Entities.ForEach(...).Schedule(Dependency);
say I have 1 million parent entities each with 3 depth of children. I dont want to iterate over 3 * 1 million buffer entities just to change the one entitiy hierarchy.
@upper tiger in a case like this - it's probably much more worth storing an entity that you know needs to have its entire hierarchy updated ๐ค
hi guys, I created a small blog post of a simple way to create runtime debug tools over ecs https://blog.gemserk.com/2020/08/13/using-custom-editors-to-interact-with-ecs/ if anyone interested, thanks!
IntroductionBy default, the Unityโs Editor comes with tools like the Inspector window to help you visualize and modify GameObjectsโs values while editing or ...
@tawdry lotus nice. we'll link it to our community wiki
Hybrid Renderer 0.8 is out, though i can't find the release notes ๐ค
ah wait. they're local ๐
oh and Entities 0.14!
nothing that i'm aware of. this is a small project though and doesn't get down into the depths of DOTS. Burst compiler is still broken for me though, so im waiting for that package update desperately :/
Hey folks, has anyone had much luck with per-entity or per-instance materials? Trying to spawn a grid of biomes and change their colours based on their designated biome. I have everything from the biome data side of things working, just not able to update the visuals without using something like SetSharedComponent which isn't suitable for my scenario. Not using any HDRP or URP stuff, just the built-in rendering pipeline.
Been messing around with properties on both the RenderMesh and the MaterialColor components and only updating the RenderMesh with SetSharedComponent has applied color properly so far :/
last i checked, DOTS didn't properly support the old pipeline
seems v1 of the Hybrid Renderer kinda does, but v2 will not
Will button work in DOTS or should I use Raycast and create entities to make it work
Please help
It is my second day shiting from OOPs to DOTs
UI button ? ofc
I don't think it would be worth it to shift from the built in ui components to a pure dots based approach, probably takes a lot of overhead code that you have to do,
and UI really doesn't need a dots approach,
however, I'm not sure, but maybe the UI builder (new way to make unity UI, similar to css and html markup) does offer something like that - integration with dots/systems or whatnot, but I haven't used that yet
last i checked, DOTS didn't properly support the old pipeline
seems v1 of the Hybrid Renderer kinda does, but v2 will not
Makes sense - I did see a way to make per-instance materials work with URP or HDRP or something on the forums so I guess I'll try out a RP instead of sticking to the old built-in pipeline. Thankyou!
Thanks @opaque ledge and @minor sluice
Is there a way to get the entities of child objects during gameobject conversion?
I need to add a backreference to the parent entity to all children objects with a specific component.
I think an Entity field in ICD will automatically author into a gameobject field in the inspector.
You should be able to put your parent into it directly.
The relationship is implicit and I would rather not expose this to designer error.
@slow vault Are you using the Hybrid Renderer?
If you are using V2, you need to use an SRP. Material Property Blocks for entities have been replaced by "material property overrides"
Using Hybrid Renderer but no specific RP since their feature/compatibility lists didn't look so hot. Looks like URP on Hybrid Renderer V2 should let me do what I'm trying to do now though, thankfully.
Yah, it's a bynote on V2 it's not compatible with the built-in renderer, only SRP's
V1 is still compatible, but doesn't have material overrides
@dusky wind I'm very curious how you work that out. I'm working on tooling for the hybrid workflow right now
@violet cosmos for my bullet hell game explanation in our wiki, should I put it in the repo (since people can read them there)? OR make a wiki page on them?
I'd say, if it's a self contained project, put it in the git repo. Then people can fork it and make contribs. Something like /Examples/ECS-BulletHell (or something descriptive about what the person will learn)
I think adding an "Example Projects" top level page in the side bar is then in order, if you inaugurate that Git ๐
Also... Please in the README add what version of ECS right at the top ๐
so my explanations is going to be in the wiki
got it
what about licenses though? MIT? we need that lel. Dont want illegal stuff
Yah, it works better for us and for people in the long run. Imagine if someone made a YouTube video. They could add the git, then the YouTube video, then the link to all of that on the Wiki
I'm cool with just saying everyone must use MIT if they wan to contribute to the repo. If they wanted to contribute something to the community with another license, they can use their own GitHub repo and link to it in the wiki
I'm excited to see your project, you've mentioned it a few times. I really feel example projects, full API "kits", and recipes help more than anything. For me personally, it lets me get started and experimenting quicker
i feel the same way Benjamin. I was pretty disappointed that the official ECS samples didn't really illustrate best practices. Looked thrown together with poorly performing shortcuts and duct tape.
One thing that really threw me off learning, starting off with ECS 0.13 is how many "examples" were out of date, even if they were a few months old. I couldn't even load them in without errors and tons of deprecation warnings
I think Unity should have a GitHub repo of ECS best practices on real world challenges, that's always up to date. They should dogfood their own recommendations there before pushing an update to package manager, and update it in sync
Older ECS versions exist as branches
the real world part is important, im so sick of 'hey look i can spawn 1 million cubes and have them spin'
Yah, that makes me annoyed too. I posted on the Unity slack something like "If I see another bazillion spinning cubes demo telling me this is "real world" ECS I'm going to throw in the towel"
Real world means: It's code that solves common challenges, is maintainable, clear to read and declarative, robust and boilerplate free
like, what are the things people actually need>?
- setup using addressables.
- boot/ dynamic sceneloading
- driving menus and game flow transitions - start/end level, rewards, menus, updating scores from ECS.
- character animation, environemnt animation
- interop with legacy - triggering effects/playing sounds from ECS
- modifying shadergraph properties from ECS with hybrid rendering (e.g. selection effects on world objects)
- how to use BlobAsset
- how to use Authoring
- all the gotchas from the last year like trying to destroy an object with children.
I actually call that out in a wiki article I wrote.... "The only way to really know is to run against actual game data and situations, and profile. Not hypothetical data just to prove you can put big numbers on the screen, but actual realistic data that represents gameplay in a variety of situations."
@mint iron Good suggestions, I'm going to add those to the "task list"
@violet cosmos where is the task list?
Both Recipes and Best Practices have one
question.
What does this line mean?
Recipes how to accomplish common (and uncommon) but necessary tasks within Unity using the ECS and Jobs system.
Kind of an idea list for contributions. There's a lot of smart and experienced people here. It's also my list of things to research haha
also, can we put the task list in the Projects tab as a To-Write list?
Drawing a million cubes on the screen in a cube grid just to show ECS/Jobs can draw big numbers isn't a "necessary task"
Real world challenges come out of the way ECS is structured, either challenge through learning to shift the way of thinking or a challenge introduced in the framework
maybe we could word it better as "real-world scenarios' instead of necessary tasks.
yeah very much, there is heavy need of actual game type projects
thats why TinyRacer is a pretty great example
hopefully my bullet hellgame will scratch that itch
XD
Reading the latest blogpost
It feels like 2021 is not the year of dots
Welp 2022 then
I haven't watched all the Unite Now vids, but if anyone knows the best ones for DOTS stuff I'll toss 'em on the wiki
Just looked at the playlist and that seems to be the ONLY DOTS related video lol
lemme send some
dots? never heard of it. Wasn't that some Unity 2018 feature? ๐
Unity DOTS (Data-Oriented Technology Stack) overview
https://www.youtube.com/watch?v=EGKmNQL9CcM
Unity ECS (Entity Component System) - 1 of 2
https://www.youtube.com/watch?v=OqzUr-Rg6w4
Unity ECS (Entity Component System) - 2 of 2
https://www.youtube.com/watch?v=3r4aFWqXY_8
Unity ECS (Entity Component System) - Object/Chunk/Shared/SystemState Components and Blob Assets
https://www.youtube.com/watch?v=q1_b--k3fQ8
(some more lel from the same guy. he needs more love)
Unity ECS Angry Bots demo - full code walkthrough
https://www.youtube.com/watch?v=KQ_ukvObv-A
the Unity job system
https://www.youtube.com/watch?v=vSxcZVfJn74
@tardy spoke
Noiicee i'll toss them all in there
didn't see Entities 0.14 change log posted so spamming now:
* Added `IsEmpty` property to `DynamicBuffer`.
* Added deduplication for asset bundles generated for subscenes.
* Added new `EntityManager` methods: `AddComponent(EntityQuery, ComponentTypes)`, which adds multiple components to all entities matching a query; and `RemoveComponent(Entity, ComponentTypes)`, which removes multiple components from a single entity. (`AddComponent(Entity, ComponentTypes)` and `RemoveComponent(EntityQuery, ComponentTypes)` already existed. This patch just fills in a few 'missing' methods.)```
* `IJobEntityBatch.ScheduleSingle` is being renamed to `IJobEntityBatch.Schedule` to match our naming guidelines for job scheduling.
* When `DefaultWorldInitialization.Initialize()` adds the default World's system groups to the Unity player loop, it now bases its modifications on the current player loop instead of the default player loop. This prevents the Entities package from accidentally erasing any previous player loop modifications made outside the package.
* `DefaultWorldInitialization.DomainUnloadOrPlayModeChangeShutdown()` now removes all existing `World`s from the Unity player loop before destroying them. If a `World` that was added to the player loop is destroyed manually prior to domain unload, it must also be removed from the player loop manually using `ScriptBehaviourUpdateOrder.RemoveWorldFromPlayerLoop()`.
* Updated package `com.unity.platforms` to version `0.7.0-preview.8`.
```* EntityManager.CreateEntity(), EntityManager.SetArchetype(), and EntityCommandBuffer.CreateEntity() no longer accept the value returned by new EntityArchetype() because it's invalid. Same for EntityCommandBuffer.CreateEntity() and EntityCommandBuffer.ParallelWriter.CreateEntity(). Always use EntityManager.CreateArchetype() instead of new EntityArchetype() to create EntityArchetype values. (Ideally, the EntityArchetype constructor wouldn't be public, but C# doesn't allow that for a struct.)
- Subscene Inspector now uses a table format to allow easier management of multiple subscenes```
* Setting the Scene Asset on a Subscene would sometimes fail to trigger an import/conversion because the default ECS world was missing.
* Fixed crash when using Singleton access methods (GetSingleton, SetSingleton, etc.) with a generic parameter as argument.
* Fixed an issue which caused WebGL not to work, and could produce this error message on IL2CPP-based backends:
NotSupportedException: To marshal a managed method, please add an attribute named 'MonoPInvokeCallback' to the method definition. The method we're attempting to marshal is: Unity.Entities.SystemBase::UnmanagedUpdate
then a few depreciated and removed things mostly related to playerloop
````AddComponent(EntityQuery, ComponentTypes)`, which adds multiple components to all entities matching a query;```
this
i find usefull
and the entity manager is now responsible for creating archetypes huh
also HybridRenderer v2 fix is worth noting though I haven't tried it yet: ```
- Partially fixed editor picking for Hybrid V2. Picking should now work in simple cases.```
what does picking mean?
I interpret that as clicking on an entity in the scene view will select the entity.. though not sure
its what they call selecting an object in the world, like grabbing a block and throwing it around, the object is 'picked', like picked up. i guess they need a default system in place for letting you click on hybrid ECS objects in the Editor UI.
if it is related to scene view picking, it doesn't seem to do anything for me in 2020.1.0f1
lel I can't push lfs objects to the forked wiki
I think 2021 will still see a focus on DOTS, but likely in the Jobs/Burst side, maybe not so much on the ECS/Hybrid side. But, I am looking forward to seeing what they have planned for "future blog posts"
The 80 Unite now videos only containing one video to do with DOTS is a little worrisome haha
I think they realized they over-hyped it in 2019
Unity also knows: They broke tons of shit last year and early this year. Netcode is... where? Unity VR to XR was a total shit show that's just getting resolved. Jobs were OK, but limited. ECS, while solid for tech demos isn't workflow ready yet unless you're really willing to roll up your sleeves. Scriptable Render Pipelines, going from LWRP > URP are just finally starting be usable and pretty much still break things
So, to that end I can understand the messaging that late 2020 and all of 2021 is "We're going to fix all the stuff we broke - we promise, so please stick with us and just ignore that Lumen demo you saw from the name we cannot say"
Yep, from a business point of view I would say they may regret some of the execution for sure
They created a LOT of confusion around OOP vs ECS and a lot of people think that ECS is replacing OOP in a few years, which I don't think was the message Unity ever intended to give, haha.
๐ค I thought it was
They've also been breaking all their systems out into packages which is just going to create a bit of chaos and disarray
lol @coarse turtle that's the problem, I don't know if it is or not. I assume it's not? That would be business suicide I think. People have been using OOP for like 20 years and it's made a lot of fine games. Still suitable for 90% of game ideas.
well as long as they get the message clearer to folks it'll help ๐ ยฏ_(ใ)_/ยฏ
Yeah if even we don't know that's crazy if you think about it. We're the people who WOULD know.
We read the manuals every day hahaha
ECS can be excellent, especially lately since I last tried a year ago. It's the tooling and workflow that's terrible, unless you're doing a pure-code solution
I actually really like it, I do wish the hybrid approach wasn't necessary because I feel although it makes SOME things easier kinda, it would be even easier appropriate ECS tooling existed and you could just keep it in ECS, haha.
Like you feel like you're learning a bunch of stuff that you know (and implementing) is going to become a deprecated practice that you will be redoing later.
I'm still trying to determine, and keep asking myself "where do I cut the line?" in the hybrid workflow. So, that's why I'm working on tooling right now, to make that decision a bit more reflective of a workflow I can use to meet my goals
I'm also working on something that really pushes the boundaries of hybrid, maybe not the best first project ๐
The interaction between the two systems just adds even more layers of magic/complexity
I don't think that Unity DOTS is replacing GameObject/MonoBehaviour in a few years, but I can clearly see GO/MB going into "maintenance mode/LTS mode" in a few years (2024 maybe) as it wouldn't make sense to keep adding the same features to 2 cores at the same time (this is me assuming that DOTS will be production-ready by 2024, but who knows ยฏ_(ใ)_/ยฏ)
@tardy spoke I need hybrid for this system. It's an ability system, and abilities without graphics are... well, kind of lame
I also have needs in the future like mixing in FinalIK rigged and procedural animated characters. Dynamic complex movement systems. VR integration....
tbh - I actually don't mind the hybrid workflow b/c it's pretty easy to convert things and keeps the tooling for some higher level use cases and custom UI Toolkit workflow (for now)
I'm stuck with hybrid, if I want to use ECS
I realized down the road I'll have to modify the VR systems that allow for grabbing GO's to work with entities... so I just erased that line from the game specs. Saved myself a lot of pain, I'm sure. ๐
You can't pick things up or interact with the world now... but at least the game may get finished at some point.
@tardy spoke Right now, I have a custom VR toolkit, and I've already thought about migrating that into ECS and Unity.Physics. But... That's a bit lower priority than my other systems that are super compute heavy
@violet cosmos my thinking is most the "easy" tools for VR interaction are built for GO's. My entire world is entities, so the GO's just drop through the floor, hahah.
My Weapons System is straight up getting converted after the Ability System is converted, because the Weapons System is just begging to be in ECS/Jobs. It's super complex to break down, so I need to learn first
Maybe i should just jump ship from unity entirely hahahaha
lol I got a good 2 years of learning I bet before I would be good enough at this stuff to realistically tackle some of these more difficult problems.
@deft stump but which ship would you go to!?
I'm sticking with Unity. They're putting a lot of resources into making very expensive things easy. Burst comes to mind
I can't go anywhere. I despise true OOP architecture too much so I'm stuck with whatever ECS patterns Unity gives me, haha.
Even if I have plans for making a custom SRP, ditching MonoBehaviour and the editor is just a prefab maker... Unity is still the best IMHO. You can prototype quick, and if that's cool then actually get down into the metal
... nowadays ๐
If unity doesnt perform their promise on the blog post. I will take as many freelance projects as i can and buy unity and replace their ceo lel
Which promise was that?
They really really need to focus on stability over new features. I totally agree with where they're headed, and 100% support it. I'm fine with tooling where it's at, as long as there are bug fixes coming consistently and frequently
Scriptable objects are cool by the way, but I don't really understand what they "are". Like what they actually are, haha.
Are they just some kind of data struct thing or something
@tardy spoke think of them as reusable global variables
@tardy spoke https://www.youtube.com/watch?v=6vmRwLYWNRo - This is THE video on SO's
Get the assets here: https://bitbucket.org/richardfine/scriptableobjectdemo/
This session goes over ScriptableObject class in detail, compares it to the MonoBehaviour class and works through many examples of how it might be applied in a project.
Richard Fine - Unity Technolo...
yeah, I'm just ... confused as to how like in OOP system they've somehow managed to integrate them and all that
Watch that, and if you're not convinced, I'm sorry for ever introducing you
they need to get their messaging refocused. currently they push the current unity as the stable release, when in actuality LTS should be pushed as normal unity
I'm just confused as to what they "are"
But I'll watch that vid. I watched another vid on architecting with them that was really interesting as well.
@violet cosmos yeah i watched this one, https://www.youtube.com/watch?v=raQ3iHhE_Kk
@safe lintel It's the "year naming" system. 2019.4 LTS sounds "old", right? But it was just released. Really, everyone in the professional Unity sphere who are making projects for clients and have things in production are using what you'd think are ancient unity versions, but they're solid and do what needs to be done
Unity knows: Studios and Enterprise usually use a stable version that is a year behind
agreed, the name year thing should be dropped
If you're using a Unity version that is this calendar date, you're in "beta", or working on a project to release the next calendar year date
Yeah, I mean you gotta realize everyone here working with DOTS has read and disregarded countless warnings of Unity and all their devs being like "this shit is wildly unstable" and then we're like "it's unstable!!". They probably hate us.
It's their fault overselling it, imho
so i understand they are overselling it ๐
If I was Unity I would probably legit change the naming conventions to like "Unity Experimental" (2020.2/cutting edge) "Unity Alpha" "Unity Beta" (2019.4 LTS) "Unity Stable" (2018 LTS or whatever)
and the Burst vectorization linter is the first of it's kind I've ever seen
Because then you would get people gravitating towards the stable release
right now they probably have a lot of people on the newer releases that do not need to be
Nobody disagrees. But... I think they oversold it, and their timeline for implementation in late 2018 and all of 2019
its just 2020.1 and .2 @dusky wind this year
I'm assuming because of COVID?
@violet cosmos I think they definitely messed up their estimations because they said I believe ECS would be 1.0 by 2020.1
no because there was a huge outroar of people complaining of stability
I thought I saw plans for a full 1-4 quarter cycle in their 2020 announcements
It's just now getting usable, where you can say "Hey, I have a big complex game I'm starting now and coming out early next year, I can use this!"
but I think their adoption was much lower than they thought, but that's probably because the stuff is so... unfinished haha
Adoption might have been higher if anyone could have figured out WTF to do haha
i am actually about to release DOTS game to mobile, google play store is inspecting it for 5 days now ๐
Congrats!
so idk, it seems possible to make a DOTS game
yeah I actually think if they had better documentation they would've had a way better ECS onboarding
@opaque ledge First one on your account?
yeah
ECS even unfinished is very useful and it can STILL do a lot of stuff
@opaque ledge awesome!
Though realtalk, a lot of the tech that built up to ECS/DOTS has been in the works even before C# jobs came out.
i mean i dont use any animation or physics stuff tho, but other than that it seems possible to make DOTS game even right now
thanks for the info @violet cosmos
A good amount of the low level access APIs have been slowly creeping in since 2016.
@opaque ledge ๐ฅณ congrats
@tardy spoke Yes, I agree ECS is useful. Last year I totally gave up on it, it definitely wasn't ready. Now... I think it's ready-ish for a mid-size project that I'm working on
It's a long term investment strategy for Unity to say the least.
there are still lots of stuff for me to do tho, it will be in alpha phase, but thats just game development, not really ECS/DOTS related
Yeah, my situation is my project is going to take forever to complete, so as long as ECS is fairly functional in 2-3 years I'll be fine, haha.
Its one of those things that i wish unity was open source, or at the least have the community contribute.
You just have some maintenance to plan to keep it up to date. NBD as long as you're aware
@opaque ledge per chance is your game 1 million rotating cubes?
hahaha
I'm really only waiting on animations + cloth physics