private byte GetDaysPerCurrentMonth()
{
return Month switch
{
Months.January => 31,
Months.February => 28,
Months.March => 31,
Months.April => 30,
Months.May => 31,
Months.June => 30,
Months.July => 31,
Months.August => 31,
Months.September => 30,
Months.October => 31,
Months.November => 30,
Months.December => 31,
_ => 30
};
}
public enum Months : byte
{
January,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
}```
#archived-dots
1 messages ยท Page 218 of 1
Month = (Months) ( ((int) Month + MonthsToAdd) % 12 ) )
smthg like a modulo
don't know how it's called in english :p
yeah smthg like that
Yea, i think you're right. Hrm.
the switch look simple now ๐
In the end I think I would still use an int timestamp for game logic and operations. Convert to human readable only for display purposes.
- some Unit tests for edge-cases like leap years and public holidays and such as Timboc reminds us
Hrm, I'm thinking about situations where I need to do comparisons like is the current year == to this year or if I need to add months to the time, not just days. If I were to use the struct I have now instead of a time stamp, adding months would be an absolute nightmare. Years not so much.
For example, current date is march and I want to add 4 months. Separated is just add 4 to the byte that is months. Timestamp, I need to calculate the number of days for those 4 months which may be different if I started in August instead.
If it's not going to match the real world day/time why not just do 12 months x 30 days?
True, throw actual dates out the window.
10 months of 10 days with 10 hours each consisting of 10 minutes, haveing 10 seconds each
better yet - this is a computer program right?
2 months of 2 days each etc..
Really depends on requirements obviously. If it's a space game you can pretend months were standardised ๐
lmao base 10 calendars
Nah, it's a banking simulator. Sounds fun right.
So you're going for the struct way ?
Nah, im going time stamp. Int.MaxValue / 365 is large enough for my purposes.
Major undocumented HybridRenderer setting: DISABLE_HYBRID_TRANSPARENCY_BATCH_PARTITIONING to get significantly better performance
Basically, dont use transparent shaders.
If this in any way improves the performance of base HybridRenderer, I might dust off a old netcode test project.
I was JUST talking about a personal finance game I am working on!
more like a finances simulator, I don't want to tie to someone's real accts or anything, way too complicated, but teach some habits, education on finance and financial literacy
anybody have any tips for floating point precision problems? I have a situation where essentially a floating point number that I store from 2 frames ago isn't exactly the same as the same number copied twice over two frames, and it ends up adding an accumulating, end eventually exploding, error
can I just force a truncation by explicitly declaring these a certain size float?
I guess this isn't really a dots question. :/
yeah, nevermind, ill figure it out.
if you're just copying the float, there shouldn't be any precision errors. They should only when doing two different calculations.
how do I use RenderMeshUtility ?
every time I dare to use the AddComponents method, I just get several InvalidOperationExceptions
some issue with a BlobAssetReference being null, and adding/removing components during physics step
@gilded glacier see if using it outside of fixed step works. physics wont want physics components added or removed between the start and end of any physics sim, though I havent tried adding or removing non physics components during this, could cause chunk changes which could interfere with the simulation though.
funny thing is I don't use physics yet
I only have a system that procedurally generates mesh, which I need to render
I just disabled auto creation of the system and manually update it in a monobehaviour, but the errors are still thrown
don't know whether I bypass the physics sim this way
Hey guys, I have a gameobject with Monobehaviour script attached to it, but also Convert To Entity with injection, so I have both an entity and a gameobject of the same prefab.
Now, I run a coroutine on the monobehavior
private IEnumetaor SomeRoutine()
{
print("waiting for one second");
yield return new WaitForSeconds(1);
print("waited");
}
however, the waited print never gets called, and for some reason the coroutine just goes into void after the yield return
removing the Convert to Entity script atttached does solve this, but can anyone explain why?
did you actually add the monobehaviour during conversion?
ie
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem){
dstManager.AddComponentObject(entity, this);// or GetComponent<MyOtherMonobehaviour>();
}
@crude sierra
pretty sure Convert and inject game Object does that for you
ah you're right, so where are you calling the coroutine?
just in the Start method
moreover, something to notice is that I call the regular Instantiate() on this prefab
but if I drag it manually into the scene, it works
yarp. basically the problem is that B != B + A + A - A * 2
Yeah that'll do it :)
Basically A* 2 != A + A
hrrm. can I, like, add the same number with a forloop?
I don't want to invest the time into rounding, I just want to see if this design (for the larger problem im working on) worksssss
lol, im in that spot where I had a quick idea I wanted to try out "for 30 minutes then I'll get back to work for my real job"
and its so. close.
@crude sierra where are you expecting this to print? when the gameobject is already in a scene or when you are calling instantiate on it?
ienumerator works for me in both situations but not sure if ive setup the same as you have
nope still -3.63797881E-12 difference ๐ oh my god this is killing me
sorry, I'm interrupting.
so I found the problem, not sure how it's related tho.. I have a coversionsystem in place as well, removing it fixed the issue.. that's all it does
public class DisabledComponentConversionSystem : GameObjectConversionSystem
{
protected override void OnUpdate()
{
Entities.ForEach((HybridEntitySync syncComp) =>
{
AddHybridComponent(syncComp);
});
}
}
public class HybridEntitySync : MonoBehaviour
{
public void DestroyHybrid()
{
print("destroying gameobject" + gameObject.name);
Destroy(gameObject);
}
}
(obviously the DestroyHybrid func does not get called)
anyone anything about what might be the cause of my problem ?
the documentation doesn't tell me how to solve it (it's also a bit outdated)
Thanks to you guys, I got my large game standalone working! Just one more q for now. How do I get the 0th child(first) of an Entity?
Ideally, there are no children. DOTS lives and dies upon a hill called denormalization
You want to organize everything into nice linear data structures with no inheritance or hierarchy. Just to maximize the tiny 64 byte wide CPU cache.
ok
But children are a part of the DOTS
How do I access the first child of an ENTITY, this is legacy stuff.
For stuff moving forward, I obviously will use proper methodology.
But without legacy stuff, it will not run.
DOTS debugger. Check the entity structure and find the exact name of the dynamic buffer that contains children.
The child does not show up in the DOTS debugger.
That means the child does not exist or was not connected to the entity on creation / conversion.
Thank you.
This is not a DOTS question, but spawned from a DOTS paradigm shift. I'm trying to find the position of my child object from the parent since I cannot access the child. Assuming I have parent.transform.forward and parent.transform.position and know the offset of initial x,y,z offset of the child, how do I calculate the child's position as my parent object rotates? I tried: pos2 = new Vector3(pos2.x + .4f * tra2.x, pos2.y + .5f * tra2.y, pos2.z + .9f * tra2.z);
where pos2 is parents position, tra2 is the parents transform, and the numbers are the initial offset of the child (.4,.5,.9);
GameObject Unity handled this simply by getting child(x).transform.position
Can't you read the child in the LinkedEntityGroup component ? It should be a buffer of children if I'm not drunk. it's automatically done by unity when you cenvert a gameobject hierarchy
Going to bed, I hope you find your answer
It is weird, when I add some gameobjects as children in the scene , the convert says: ConvertToEntity []by ancestor, and they show as children, but other gameobjects as children in the scene say ConvertToEntity [] (ConvertAndInjectMode in parents)
Ok, so only ConvertAndDestroy GameObjects can have children.
ConvertAndInject cannot have children.
Well that is good to know, but weird, right?
Thanks Mr.K ๐
I'll check it
Mr.K : Nope, says buffer of 0, just as I see in the Entity debugger inspector of it having no children
Is there a way to get children using ConvertAndInjectMode Over ConvertAndDestroy(which works)?
I found a way to hack it.
I kept the original gameobject around, so I simply set the original gameobject's position/rotation as my Entities, and grabbed the gameobject's child position/rotation as my answer.
Hello Ladies and Gentlepersons. I am wondering if anyone knows any good resources to learn how to make hybrid ECS/DOTS bullets. I would like to keep all my MonoBehaviours, and make the bullet entities hybrid and integrate them taht way if its possible. My game will have upwards of 1000 3D bullets with complex motion and maybe some animations if its feasible on lower end computers aswell as I want it to be the most accessible game not necessarily the prettiest, but also the one with a shit ton of bullets in 3D ofcourse, so currently im object pooling the bullets, but im thinking they will really need to be Entities because otherwise as the game grows it wont work.
Im really quite a noob when it comes to DOTS/ECS so any advice you could give me on this subject would be appreciated.
you mean hybrid mono/dots
you cant collide Entity with Monobehaviour
so entity bullet and nonentity player wont work
u can make monobehaviour collider and update its position to be bulletposition though
or do it in reverse, make fake collider for player and stick its position to player
anyone knows
how to get existing object of FixedStepSimulationSystemGroup and change its Timestep value?
World.GetExistingSystem<FixedStepSimulationSystemGroup>( ).Timestep = 1f / 60;
wow thanks :-]
what does this even mean mate, im sorry I dont understand what you are saying because your not really saying anything , what is bulletposition? are you talking about entities? and what is" fake collider for player" is that an entity? or is ''its position to player'' is that the entity part? Like what are you even saying dude?
Entity bullet will not collide with monobehaviour object
so my enemies and players will need "entity colliders" on top of their monobehaviour to make this feasible
ye
the easiest would be creating colliding gameobject
and snapping its position to entity bullet position
i do this
so you would still have 1000s of gameobjects
why use entities if you are going to attach gameobjects to those entities doesnt that like defeat the purpose of entities?
isnt the whole point of entities to Not have GOs?
then you do in reverse
create entity collider and stick its position to player inside system
yes but you said it doesnt exist?
i meant something else
lol๐คฃ
you editted it
anyway, you can do in both ways and it will work
ok thanks for the help I appreciate it
i am doing the same with planets
planets are entities, player is monobehaviour, so i have one fake collider gameobject.
https://i.imgur.com/j2DuaPT.gif
i need to set world rotation of entity, is that possible? (Rotation component is local) localToWorld component is kinda messy not sure if i can use that
nope ... as the docs say, I use the AddComponent method with the RenderMeshDescription (except the CreateRenderMesh, which appears like a redundant line, and the method doesn't even exist)
I run the code inside non-burst non-job foreach system, and use the current entity to assign a procedurally generated mesh and material to it
You're right it seems they forgot to remove this line
So more like this https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/f9043577ddc0d8667b6b4649a71454741075f4d1/HybridHDRPSamples/Assets/SampleScenes/EntityCreationAPI/TestEntityCreationAPI.cs#L132
but from a foreach lambda with .Run()
Do you get an error ? Wrong rendering result ?
Can't you then just pass the entity to the Instantiate() method to make copies ?
whenever the CreateMeshRender is called, it throws two InvalidOperationExceptions, one is about blob asset reference being null, the other one I don't quite understand, something with physics or what
which is funny, because I don't use physics yet
I don't want to instantiate the entity, I only need one, plus I would first need to make the original prefab entity with all the components, including meshes (if I knew what the current rendered object archetype is, I might try to create it manually)
fair enough
Regarding the error you're sure it's related ? you recreated it as a simple example ?
Anyway I don't have a clue, sorry ๐คทโโ๏ธ
I removed the create method, and it had no problem
except it didn't render, of course
I may do some testing scenario, but I am always hesitant to create a new project for it, because it is a bit pain to set it up for ecs
... that would be my punishment for using an experimental technology lmao
It's our curse, to all of us here
alternative would be to use the standard Graphics API ?
I could just ditch the hybrid renderer and use the unity DrawMesh method instead, but then I would have to solve a problem with it being too slow, and I would then still have to integrate physics to it somehow
this would be too slow for your use-case ? ohmygod
But yeah if it's not only rendering.....
well, the profiler shows some waiting that takes way too long
I don't know what's the theoretical difference between the speed of the graphics api and the hybrid renderer
Super necro reply, but wanted to thank you for your help on this - finally got around to fixing it, and it was related and strange - not casting to fp during a division operation was what was causing the burst compiler to explode on the first try:
fp halfScale = scale / (fp.one * 2);
This fixed it:
fp halfScale = scale / (fp.one * (fp)2);
here is my console output
@karmic basin if you are interested ...
I would post it sooner, but had the issue with layout again, when launching editor
Uhm no clue about that blobassetreference issue, but for the physics one thelebaron might be right. Your system is updated from MB if I remember well, and that may happen (creating entities at runtime) during the physic step
Do you spawn the entities directly, or try to add them to some ECB ?
during* some ecb
On the samples, they do it on MB:Start(), don't know how that would interfere or not with ECS phsyics systems execution
Suggestions / inspiration on designing an order queue for units in an RTS? The player can queue up any arbitrary number of orders for each unit, each of which require different data; e.g.
{
float3 Destination;
}
struct UnitCommand_BuildStructure : IComponentData
{
float3 Position;
uint StructureID;
}
struct UnitCommand_Assist : IComponentData
{
uint UnitID;
}```
The two main approaches I was considering:
- Use a DynamicBuffer<Entity>, and store each UnitCommand as a separate Entity. This has the advantage of allowing multiple units to share the same order Entities, but the disadvantage of reducing cache coherency for each unit's update when they need to query the current order's entity.
- Use a DynamicBuffer<UnitCommandSuperStruct>, which contains enough data fields for every possible permutation of UnitCommands. This has the advantage of better cache coherency, but the disadvantage of ballooning memory usage and code maintenance complexity, especially as more UnitCommands are implemented.
Any other thoughts and ideas? ๐
I see one option to keep the commands as separate entities, instead of putting them in a buffer, and give them other components for the unit/unit group that executes the order, time data of when the execution started (good for replays), and one component for keeping "reference" to the next order
it is not very linear-access, but having a buffer for every unit is kinda overkill
doesn't matter whether I update it in mb, or let the default bootstrap create and run the system for me; the result is the same
I don't use ecb, all the entities processed by the system are created directly in the mb
the system then takes those entities and creates the mesh for them (plus calls the util method to add the mesh to the entities)
the errors still occur even if I put the util method call outside the foreach
update: I think I was actually supposed to use ecb for it, but I was confused that the debug didn't tell me, until I stripped the system to the bare minimum
still, the problem persists in my (quite long) code, and I am unsurprisingly clueless about what goes wrong there
do you still have code that create entities or add components in the MB.Update() ?
I add them only once in the awake method
Fucking unity. HDRP compositor is broken for 2020 LTS. The editor resolution determines build resolution and it doesnt change. I believe thats fixed in 2021.
Welp, time to make my own compositor with pain and suffering
@naive ice I like your Dynamic Buffer of Entity commands, Also lets you debug using the DOTS tools easily
and you could fix the cahce coherency by copying the components to the target entity for the current action
tho from memory there wasnt a easy way to copy components around
if you can get some custom safty check to force only 1 'active' command entity for a target entity, then you could probably turn off some of unitys safty checks and make up some of the performance cost that way
5 hours later, I did it. Thanks unity for giving me the opportunity to advance my knowledge in the rendering pipelines, despite me never asking for it.
every day we stray further from being game designers
what are dots?
that looks complicated
Are ISBs not visible in the job code inspector? Or do they just have hard to find names does anyone know?
.s
Hey, so for about 1 year I've been working on a "new Unity ECS" library replacement that is more friendly to use. It's not ready yet, but getting there. I am trying to figure out what people like / hate about Unity ECS (the DOTS workflow, not monobehaviours). I have lots of opinions of my own, but I'm just one guy and I wonder what my fellow programmers think.
If anyone had time for a short chat, I'd be extremely grateful. It will help me make my library more user-friendly (I hope ๐ )
I would really like to burst compile my entire simulation loop
The overhead systems have for just existing is really annoying
IL weaving is crazy 20-60 seconds compile times
The conversion workflow is currently very decoupled from the way you normally use the editor. To give an example in mono behaviour you would just create a serialize field reference a game object and spawn it. You don't do that stuff in Unity's ecs. You have to tag your prefab with a component, move it into a subscene and query for it in the system you want to use it in
I'm sure there's more especially regarding tooling but I can't think of it right now
@north bay so if i read your post correctly mainly two areas:
- slow iteration time (reloads, long compiles etc.)
- tedious and requires a lot of steps to do some fairly basic things
(?)
- oh and the performance problems i guess, yeah system bookkeeping can be visible, especially with many systems
"I would like to burst compile my entire simulation loop" - you mean there are elements that are unsupported so it's impossible? or you mean that you'd like the code structure to be different?
That sums it up pretty good
do you think that's the reason why ecs doesn't find wider adoption?
i was wondering if the problem is more A) it's hard to understand and kind of alien or B) the implementation just isn't convenient enough / too many pain points
Basically my entire simulation is burst compatible. Because of that I would like my systems that are burst compiled also to be iterated over by bursted code to minimize the system overhead.
oh i see
so the whole scheduling code etc.
how many systems do you have in your project more or less, if i may ask?
I think it's to early to argue about that. The current state of Unity's ecs is very much targeted towards advanced user. I don't think someone who is new to Unity could manage all the pain points and mental overhead that Unity's ecs in it's current state has
Uhh around 800+
right, that makes sense
i worked on a project where there were similar numbers
and definitely system interdependency tracking is not the fastest
you chose to use ECS because of the nature of the project - i.e. seemed like performance will be important issue, or for other reasons?
We started working on a multiplayer project and the Unity FPS sample was (just) released so we took the chance to base our project upon that.
i haven't used ECS in a multiplayer context, but from what i gather it actually should fit pretty well - in terms of a general paradigm
It wasn't really about performance - more of let's find out what we can get out of this new paradigm + a free multiplayer solution on top of that, which doesn't ask you to buy a license for each instance that you host
oh, gotcha
what is general sentiment of other people towards ECS - other developers you work with / talk to. Not specifically Unity ECS implementation, but just the general idea & motivation behind it?
does it feel "weird" or awkward to people, or not really?
I've met some unity developers that hate it and wish unity would instantly let go of it. Others really like it. ECS is really opinionated. Everyone seems to have a hard/fixed opinion about it.
We had a junior programmer who learned 3 years OOP in school he was pretty overwhelmed at first but he grasped the concept rather quickly, 1/2 months until he was able to work fine on his own.
We designed our workflows in a way to make it as easy as possible for our level designers. But it was a lot of work to get to the same user experience level as MonoBehaviour.
yeah, totally agree with those points
i guess maybe it forces hard opinions due to the fact that the integration with the existing workflow is quite lacking and therefore people feel forced to either commit fully or dismiss it completely
So basically the experience / interface for designers is also a major area for improvement right?
so that one doesn't have to put in hours and hours of work just to get to the point where mono behaviours are by default
That sounds extremely challenging
Definitely, I feel like a lot of people also just do not want to leave their comport zone. There are people that think we should stick with the current GameObject model. We can't, we need to have a future proof technology. We cannot just stick to a single game play thread forever. Our software should start making use of what our hardware engineers managed to archive in the last 15 years.
of course, there are quite a few elements to it
This - combined with a lot of (well earned) hesitancy when it comes to adopting new Unity tech
however i think i have a pretty good understanding of the scope by now, so it's not a pipedream at this point ๐
How's does yours compare with e.g. Svelto & Entitas?
If you are looking for inspiration, I've only heard good things about Flecs and the developer is very open about it.
@amber flicker my major gripe against svelto at least from the examples that i've worked through is that it seems very verbose to write in
i'm looking at entitas right now, so i'll have better opinions in the future
but i'm not sure it has good burst support
as for my solution - i try to make it very extendable without sacrificing performance
but of course i think it'll maybe refrain from singing my own praise until i have a public version to show and get feedback on
easy for me to say how wonderful it is when nobody can give me feedback ๐
what i write makes very heavy use of IL code generation and transformation
to achieve things that aren't really possible in traditional C#
I decided to get feedback from various people to get a sense of what my priority list should be
here's some random code snippet from an API that i'm implementing for it:
app.CreateClass(out var shapeClass) // declare a new vectorized class
.CreateField<Vector2>(out var shapePos) // create fields
.CreateField<float>(out var shapeRot)
.CreateField<string>(out var shapeLabel);
โฆ (out var renderer) // code injecting renderer omitted for brevity
app.OnTick(UnityUpdateGroup.OnUpdate) // each OnUpdate tick
.Run() // run on the main thread
.ForEach(shapeClass) // iterate through all instances of shapeClass
// and execute the following closure
.Do(() => renderer.access.DrawLabel(shapePos.curr.v, shapeLabel.curr.v));
Takes a few lines to define a new archetype (here called class) and just a couple of lines to have a system run through instances and do something with them. Ideally i want there to be as little clutter as possible. We'll see
I'm sure there will be a couple of people out there who this appeals to - wish you the best of luck in finding them!
well the point is i try to make it appeal to as many people as possible
nothing is set in stone
so if it turns out people hate my API i could think of a different one that people like better, kind of why i ask all the questions
from what i've heard Unity ECS is now incompatible with the newer versions of Unity and not sure it'll come out of preview. So i gather there also will need to be some replacement that will take off, if we go the ECS pattern route at all
Well I can only speak for myself but it wouldn't matter to me if your api was 100x nicer than Unity's. ECS is a huge gamble with the whole of Unity behind it (and a dedicated team of ~50). No way would I opt in to a substantive library that was designed to replace a lot of the syntax but maintained by just a few people. That said, I do think there's space for better editor tooling, specific libraries that utilise DOTS and better solutions for code-gen. Though with the latter, I guess you'd have to wait and see what they'd do with the new rosyln stuff.
It's a pause - stay off 2021 while doing dots stuff. They plan to become compatible again by 2022 hopefully.
sure, the trust etc. is a business problem, which is a different category
i'll get a major financing behind this effort so it's not like it's gonna be just me
there are precedents, for instance all artists i ever worked with preferred amplify to unity built solution
was there announcement about it becoming compatible again in 2022?
you've seen the forum post right? They hope by the end of the year I think
maybe i read their intentions differently
i'll reread it
yeah, i think it's quite difficult to say what they mean
they certainly went out of their way to not commit to anything
and there are a number of unity projects dependant on ecs that stopped being developed altogether
i'd personally be very hesitant about relying on them to return with ECS compatibility in 2022 but we will see
for example correct me if i'm wrong, but i think the dots visual scripting is not being worked on anymore
I believe it's in active dev but progress feels v slow across the board
which i think is a great idea btw
interesting. Which year were these statements. Do you think they still feel the same as of today ?
dang, I see ^^
two artists at a company where i work were discussing how shader graph is garbage, idk
i honestly don't have an opinion
to me it seems fine, but they were doing some pretty advanced things
I'm looking into the vfx graph, it's some nut to crack, I chose to invest the time because I hope/trust for the unified UI tools in the future
Back to your original question , I'm not the most knowledgeable on ecs here, but I approve the missing tools argument. I'm sure even Unity would agree on that one
would you expand on the missing tools point a bit?
I mean how everything is just for now tinkered from MB's
workflow
The boilerplate code doesn't bother me for now, more the editor
@amber flicker btw, really appreciate your comments, especially about the trust vs a crowd of people working on ECS at Unity. This is very helpful as for sure many people think this way so i have to address that
ANd as Timboc said I'd prefer going the official ecs way rather than a third- party lib, but there's a lot to do on the tooling side
yeah +1
well actually one thing i want to make sure is that what i do can interface with Unity ECS as well, just perhaps you don't get all the benefits when you do that
but i think very often people have existing code bases either in Unity ECS or even in MonoBehaviour and it doesn't make sense to ask them to throw away everything
there needs to be a way to work with this legacy code without too much pain
guys it's been extremely helpful and informative
i might come back few more times to get more people to poke holes in my reasoning ๐
For context - I'm making a tween & animation dots library & editor tools. 2 1/2 years in and I feel like it's a complete waste of time but I guess I'm going to see it through ๐คฃ
There is something super satisfying about calling e.g. Tween<Translation>(entities).TranslationX(5f, 2f, TweenOperator.Add) or even with a bunch of gameobjects:
Tween(ref allGOs).LocalPositionY(-10f, 1f, TweenOperator.Add); and have all the burst and job magic kick in and send things flying in a somewhat maximally parallel way. That's what keeps me going ๐
. Maybe one day someone will appreciate it.
100k cubes, 300k tweens > 60fps.. how do I even show this stuff ๐
yeah, i think there's an enormous potential in really leveraging hardware
i mean we'll wait like 5 years and there'll be 128 cores on a CPU and 256 threads and then what? still just go single threaded?
Are those cubes moving or static?
static in the picture but moving in real life ๐คฃ
Physics? If so, I'm assuming this is not hybrid renderer because HR dies with a tenth of that many meshes.
Gosh no physics, just tweening. It is hybrid renderer though.
Huh. Must be that my computer is shit. Looks great.
Well small meshes all using the same material, srp lit shader, single light makes it all pretty lightweight.
To think this was nearly a year ago and working with subscenes hasn't got any easier ๐ญ #archived-dots message
there's also this post from Joachim Ante, https://forum.unity.com/threads/state-of-ecs-dots.1044877/ so I guess maybe they decided to just redo lots of stuff and decided to do that without having to maintain it for people. I would guess that the APIs are going to change substantially.
I would imagine it's related to ISystemBase and burstable everything. Making everything compatible with Burst requires a massive redesign of my project. With something as big as a game engine, that will probably require throwing everything out the window. However, I wish they would give us some information. Anything at all telling us how many people are working on this and progress reports. I know Burst itself is under heavy development, just check the 2021.2 Alpha changelogs to see the intrinsics being supported. But DOTS as a whole, no clue. There could be 50 people working on it, or 5 (which is what it really seems like). By comparison, Tiny has 3 people working on it.
The best course of action is for every one of us to drop our current jobs and game dev projects, apply for a job at Unity, transfer into the DOTS team, help them crank out features, quit once your desired feature are out, then resume your previous career and project
EZ
it kinda feels like teams generally dont care what other teams are doing so might get sucked into a black hole fighting to get something substantial out ๐ฅฒ
Did you guys see this? https://www.eventbrite.com/e/unleash-the-power-of-unity-dots-tickets-141139382693?aff=ebdsoporgprofile
cool for those who may be new to dots, but seems like it only covers the officially ready stuff(jobs,burst,collections)
Yea will watch it anyways, mostly because Brian Will is also speaking. He has some interesting youtube videos about OOP
yeah I really like his videos & presentation style. helped me understand blobs a bit better
Brian Will, that name sounds familiar. Not the guy in charge of the DOTS visualizer / debugger or the guy who had to drop the bomb of 2020 LTS. Did he announce anything recently?
He posted the Entities 0.17 changelog announcement
Ah, that's where the name comes from.
Yeah it will be like the ecs samples: multiple ways of migrating from MB to ECS but on top of their 3d game kit project
he has some nice videos before he joined unity https://www.youtube.com/watch?v=q1_b--k3fQ8
Covers some of the more advanced features of Unity's ECS: Object Components, Chunk Components, Shared Components, SystemState Components, and Blob Assets.
I have a weird problem with a subscene:
-
when it's not loaded, and then loaded from disk, many of my components seem to be serialized with default values (e.g. Translation at 0/0/0)
-
when it's open for editing or has been converted at runtime before from open for editing state, everything converts with the expected values.
I used to have a conversion system but now it's literally all authoring components on the gameobjects. What's going on?
The last step is the "expected" behaviour, the still occurring offset is from my floating origin system. As you can see, loading the subscene from disk moves everything to the origin.
This nondeterminism for subscene conversion vs. in-scene conversion is really turning me away from them. I am very appreciative of any pointers ๐
So no custom conversions?
any IConverts.... ?
Does selecting the subscene and clicking reimport help/fix it?
A whole bunch of IConverts.
Reimport doesnt help.
Just no GameObjectConversionSystems (which I used to have, but no longer need because I got rid of a circular dependency). I initially thought THAT was the problem, but it isnt.
this is for a floating origin system?
The conversion log for the scene also looks normal (but I am gonna diff it)
honestly the vid dosnt really help tell me whats wrong :/
so your subscene in editor has values set, eg translation at 10 , 10 ,10
but when loaded its 0, 0, 0?
That moon in the foreground? That's a converted entity.
It should be at exactly that position (actually a slight shift like at the end of the vid) when I start the game.
But when the scene isn't loaded, all the moons etc. are at the origin (right inside the big planet gameobject in the distance)
is there a button to clear sub scene caches yet?
if there is try that, otherwise clear your librarys folder
So both their Transform.position AND their FloatingPosition.position (double3) seem corrupted, but maybe it's just FloatingPosition and the floating origin system picks them up and moves them to 0/0/0.
I did those things a lot.
do you have https://docs.unity3d.com/Packages/com.unity.entities@0.17/manual/conversion.html#the-converterversion-attribute on your IConverts?
I do not have a ConversionSystem.
using Jovian.ECS.Components.Space;
using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;
namespace Jovian.ECS.Authoring
{
[ExecuteInEditMode]
public class FloatingPositionAuthoring : MonoBehaviour, IConvertGameObjectToEntity
{
public double3 position;
private void Update()
{
var p = transform.position;
//FIXME: This is only correct if in open space.
position = new double3(p.x, p.y, p.z) * Constants.OpenSpaceScale;
}
public void Convert(Entity entity, EntityManager manager, GameObjectConversionSystem conversion_system)
{
var fp = new FloatingPosition() {position = position};
manager.AddComponentData(entity, fp);
}
}
}
yea you still need to put converter version on those
Wat.
In the case of an authoring component that implements IConvertGameObjectToEntity, the conversion code and the definition of the authoring type are in the same class, so there's no ambiguity about the location of the ConverterVersion attribute.
That says I DON'T need it.
sprry that was not the quote i wanted
it has to be used on either a conversion system or an authoring type that implements IConvertGameObjectToEntity.
๐
first line in the doc
Well.
Doesnt help. ๐
But your quote is correct in context.
Weird.
"The reason for the string identifier is to prevent merge issues, if two people were to bump the version number in two different development branches" wow what a hack haha.
Hooooly cow Unity.
@warm panther ok so is it just that floating position authoing thats weird?
cause looking at that it looks wrong to me
when converting the scene is not always going to be opened, so the Update method wont run
and even if you open every scene manually your not marking the GO as dirty
so setting Position may not stick
can you do that position calc in Convert?
@warm panther ??
The update method is fine, because it writes the values at edit time when I move the object around.
So the data serializes ok.
Yes which isn't saved
Wat ๐ฎ
Unless you're marking the go/mb as dirty
That's why editor scripts use those horrible serialized properties

I had the same issue trying to assign a unique id during conversion
It would never stick right
(me too)
I ended up just always recalculating the id every conversation
Thank you @ocean tundra ...
This was driving me nuts, especially as the scene was "dirty" just not the objects in question.
Darn.
sweet so it works?
Yep.
nice
Amazing this is gonna cut down a LOT on iteration times.
Well about half a second worth but now I can put everything of interest in multiple subscenes.
So the workflow is way smoother.
I have a layer with lots of moons.
still just 1 big one
But I probably also want one with space stations etc.
Or "the 4 inner moons", etc.
Or some particularly complex individual ones with lots of stuff around them.
it might be better to make it region based?
not sure of your game but having 1 subscene per point of interest might make it easier to find things
There is no good way to sort this list meaningfully ๐
wow
Yeah something like that. I dont want 100 subscenes, but probably 5-10.
So Jupiter's 4 major moons, which are the main player factions, each get one.
All the procedural smaller asteroid like moons can have one.
But everything hand-crafted needs to live somewhere I can properly edit it.
yea subscenes and procedural i still havnt figured out
I already wrote a toolbar extension to filter my layers but there's still always all 79 moons at the origin (their "bubble" physical layer representations), and these aren't editable that way.
I have a generator object that procedurally generates this at edit time.
So nothing at runtime.
(maybe some day :D)
yea that what i thought of doing
but the new idea im playing with needs it at runtime
so im thinking the subcene is more of a prefab container
Sometimes unity glitches out and loads the subscene additively.
So it's weird.
And I dont think it gets rebuilt.
Because as a normal scene it doesnt know it's a subscene...
Should be fine.
But just working in that 1 pure scene would really make my life good.
Is there a way to exclude an object in a sub scene from conversion?
(ConversionStop behaviour?)
I want to have more utility objects like the generator and light sources that won't be present in the other scene.
Also I am wondering about lightmaps, but with the positioning now FINALLY working, I can start investigating these things.
so pretty sure lightmaps and subscenes ISNT working
You really helped me squash a longstanding bug.
Cast All the Realtime Shadows!
Light probes? ๐
i think theres some sort of stop convert MB you could try
na dont think those work either
Yeah I was thinking about that.
its due to the hybrid renderer not supporting it yet
Hybrid Renderer is like, half a renderer.
yup
i was excited about deferred rendering in the next URP which apparently works with Hybrid
so many many lights were workiing
but then that 2021 freeze was annonced
I do if I have many point lights, or any number point lights n>0 ๐
๐ your making a space game? many many many lights should be a requirmenet
I am this close to writing my own shaders.
i think each object in URP can only have 4 lights effecting it
and 1 casting shadows
but hybrid renderer broke a light type, maybe point? so cant use those
are you URP or HDRP? i think HD is further along atm
Well actually not. My art style is... a very NPR style with cartoon lighting. But having a space station or a dreadnaught's 70+ gun turrets light up as they fire at you would be nice. https://twitter.com/jupiterbluegame/status/1384198978309279751?s=20
Because anything remotely rim-related is certifiably awesome, I went and added a truly capital-ฮฆ PHAT rim term to my ship shader to make them pop even more when viewed against our nearest star.
#madewithunity #shader #gamedev #indiegame #screenshot https://t.co/1VqZmcEeLI
very nice
But my art style is really bright with soft lights and hatching, so I don't depend on "real" lights for most things. I actually, for playability, don't want full strength shadows.
good art direction then ๐
fiting within the DOTS limits
i think emissive textures/effects work, so you could get the effect of the ship lighting up as it fires without lights
but would need to be some sort of custom shader to toggle the emissive as it fires
Yeah I hope to simulate about ~10k ships, that would be my dream scenario. The complex ones have around 20k vertices including all weapon modules, so my 2080 Super just yawns at me, but actually making all that stuff simulate in parallel with custom layered physics is something. I'll see how high I can get.
and might be extra tricky since turrets and ships are probably seprate?
very very nice
i was messing around with a space rts in my early prototypes
was awesome when 2 huge capital ships started blasting away at eachover,
something like 7k bullets/lasers flying around
what do you mean by "simulate in parallel with custom layered physics"?
Yes the turrets are entities with child entities and that causes some problems, I wrote a tweening animation system for the recoil and muzzle flashes and it looks good, but it's more entities.
I think the worst was my targeting implementation, I need to completely re-think that. (it was entities handing target buffers down to connected/subscribed other entities, etc, and that's a way to move data that's very counter ECS).
I get to optimize a lot by using physics bubbles that have a shared component data, so I don't need to compare or spatially query for proximity, just iterate, iterate, iterate.
yea i hated my targeting code, cant remeber specifcs now but i wanted to redo the entire thing :p
interesting, so youve taken unity physics? and split up the world so ships are seprated into different physics worlds?
I run a customized physics package... I found a fairly simple way to treat physics collision filters as layers; and if I sparsely populate / spatially interleave my static colliders, this basically gives me physics worlds without having to deal with physics setup and teardown and moving entities between worlds.
(actually just realized that I need to change my world data type from byte to int32, it's no longer restricted :D)
very nice
im considering something simlar
but decided to just create/manage many worlds instead
I can decide to go "true" multiple worlds once I prove this works, but I actually don't think I need multiple worlds. Space is super sparse, almost nothing ever collides.
Compared to, say, a destructible environment in a FPS.
yea true
so each physics bubble is actually at 0/0/0, and presence of the observer in a bubble will cause all the entities in these chunks to have their DisableRendering tags removed, and... that's basically it.
very cool
So you can fly into an ongoing battle from millions of km away and you can even see the ships sensor blips fighting from a distance, then you powerslide into the physics bubble and missiles, bullets etc. are all midair. Except, not air. ๐
Maybe I'll have that part working soon, fingers crossed.
The seamless entry already works.
dam so cool
my projects are all so early days cause i keep getting distracted with tech stuff
like networking
Just stomping out corner cases such as not being able to properly populate the bubbles because, you know, somehow when I saved the subscene... (see bug above ;D)
This is why I am super hyped now.
I develop this in my free time so I am suuuuuuper slow.
yea same
Also I am especially obtuse when it comes to preview stuff in Unity.
But I am having a blast.
Same!
and seeing things work is soo cool
I am terrified Unity will cancel it.
That 2021 freeze announcement made my heart skip a beat.
i got the unity boids sample networked at 8k entities the otherday, soooo awesome
Awesome.
yea but pretty sure they wont
I want to use swarmlike stuff for fighter drones and guided missiles; maybe.
yea its pretty cool
I'll look into that at some point, want to get my basic movement gameplay finally sorted.
look at the unity boid sample, will get you close
I had 5 separate "prototypes" for shooting, aiming, moving, and the physics / open space travel, and now I finally got much of the architecture in place to unify them.
but if you have to network it make it write out some if its data into a immediate componet, currently it writes directly to localToWorld
Network is gonna be a biiiig question.
and i just networked the entire matrix cause i wanted to see how a 'unoptmized' case will work
Even though its insane to plan MP for a solo game that's already stretching my abilities.
fast or slow passed?
I am thinking actually lockstep simulations.
Careful @ocean tundra is going to sell you his software
As in, just exchange command streams.
So, thinking about tactical views & grids... and whether any of this makes the sense I want it to.
When the battle unfolds, you probably want to give orders to your line (or flock, or ball) of ships efficiently.
I created a special interpolator for the camera, and a test grid. https://t.co/ZT8a9Dh4oP
So yeah warship / small fleet captains duking it out rather than "1st person fighter jocks strafing death stars"
But speed, both for movement and weapons, is something I want a broad spectrum of, and I am not sure how far I can go.
๐
Technical deeptime into the unique networking architecture of Planetary Annihilation.
Drop the link already.
not yet released ๐
Space games are my favourite ๐
Jon Mavor is one of my all time idols.
was going to build a game on it to see how it works
And actually Supreme Commander and my work on FAF convinced me that lockstep protocol advantages far outweigh prediction and especially server side reconciliation systems.
(lockstep protocol = shared sim, command streams, whatever people call it)
yea i was really on the fence about lockstep vs others
the idea is good, but i dont think im actually smart enough to build it
FAF now has a reduced latency mode and with modern internet it's so playable, if I make my gameplay about the pace of World of Warships, it'll be perfectly playable.
especially since the underlying tech isnt deterministic (DOTS)
You guys are probably way ahead of this already but my friend just put this on github if anyoneโs interested: https://twitter.com/drbentine/status/1390023276265623554?s=21
Incase someone enjoys it - here's a sci-fi space battle in #unity, using the #dots ECS framework. It simulates waves of different ships, with different equipment, weapons, shields.
#madewithunity
GitHub: https://t.co/QCAfKAGgiS
youtube: https://t.co/0HsjCRHB2i https://t.co/qOo62G8ZkE
@amber flicker Wow Thanks!
looks awesome
Cc @last jasper
@amber flicker is it networked?
Maybe I can make lag basically imperceptible... especially if you add randomized weapon warmups etc. (imagine age of sail warship broadsides).... https://www.youtube.com/watch?v=BXxazufM0x8&ab_channel=BezzleBedeviled&t=120
Captain Flynn's crew learns the hard way that it's smarter to stay home and grab free Pi coins: https://bit.ly/3tTEmkb - More free crypto: TimeStope - https://TimeStope.com/honeyko (invite code honeyko). Bee - https://bee.com/en invite code mjschneider (all lower-case). Cloud Earning PHT (invite code 39bv86xw) - These are all mobile apps, but ca...
Donโt think so but I know @last jasper was looking into it
Highly recommend looking at the youtube video, much more fun than the gif
hmm it looks like a really good canidate to test implementing my netcode on
@warm panther yea so the key issue with the curve based networking is it forces a bit more lag between the commands given and actually following them
Yes. Which is why dogfighting wouldn't be fun.
since they need to go to server, server processes and then finally the data starts streaming back
in really good conditions (lan) i got the delay super low
it depends on if you have a server 'tick' for optmization or not
But if when you press fire you hear the guns charging up and then shooting - and that can be made deterministic - the shoot command can already be at the other player's pc, who doesnt need to hear that sound, only needs to see stuff fly out.
2x100 ms is plenty for a roundtrip for the ACK.
I remember when it was considered OKAY to FPS play at 100 ms.
(and that was QuakeWorld...)
forgot I should have posted here ๐ ty
yea so in testing, with server at 60fps in a lan suituation was able to get round trips and curve data super quick, like sub 100ms
when slowing the server down , 30 was still ok, 10 was noticable, but could be covered by animations/sounds/client effects
I could also use a hybrid system that simulates a physics instance on one machine but the rest on all the machines, so if someone is watching (and interacting in realtime), it could be more action based. But I am afraid it will be buggier than Elite Dangerous' piece of shit netcode.
I also don't want to write an MMO, I want to write a game where 2-5 friends can play coop (or a little bit of PvP).
yea same
Nice. What exactly is curve data?
Technical deeptime into the unique networking architecture of Planetary Annihilation.
Mkay, will do that then ๐
basicly its all networked data
Thank you so much again.
Hello, im working on a little tool that help streamline the DOTS transition from monobehaviours
I still working in the documentation, but it would be nice to get some feedback
The point on the documentation is make it so easy that everyone can understand how easy is work with ECS
https://github.com/Extrys/Hybrid-EZS
@pliant edge So mainly this is a inspector to attach hybrid components so we dont have to write a custom IConverts....?
I will have to reserve my judgement until you move onto IComponentData and how that will fit. And what if Referenced Entity Injectors? BlobAssets?
Can someone tell me
- what are differences between World and Scene?
- and why people are making so many worlds?
๐ข
worlds have separate entitymanagers, it's just a way to do a more large scale separation of your entities. for example you'd likely only render entities in one world. perhaps your physics need to work in a special way or you have netcode. you can separate things logically. unity netcode uses client and server worlds in the editor instead of needing to launch a separate process for your server to test the client in dev. it has it's uses but probably best not to make a bunch of worlds unless you have a specific reason to.
a scene is like... a workspace for you to work in. I think with dots it's better to just have one scene and use subscenes but there are differing views on that
when you load a scene you can create many worlds in that scene if you want.. I"m honestly not sure how systems work if they get reloaded if you change scenes cause I've never changed scenes before! XD
Thanks a lot!!
np. this channel is slow but usually someone responds eventually haha
@opal lynx Please don't use reaction gifs
I understand ๐

Lads, how would you go about making a 3D DOTS game?
What if i want the enemies and the bullets to be entities, but my player to be a gameobject, with say a health script
is that possible?
or can the health script be a component?
and have it pure ECS?
Can you make ECS scriptable objects?
systems are where you put code. separate data and logic, so your "objects" are data or
"components", and your scripts are "systems" that run on entities returned by queries
components attach to entities
you can convert scriptable objects into data in DOTs
argh qa closing all my dots reports now that 2021 is unsupported even though these reports have been sitting around way before that announcement was made, they were just waiting for an excuse to close them ๐ฅฒ
smartfox cant do ecs
what networking solution should I use for max 500CCU and max 25k-30k active gameobjects(potentially moving)
All I need is someone to point em in the right direction
as far as I know dotsnet is the only solution which supports ECS?
@gusty comet I'm a bit confused, do you want ECS or GameObjects?
#archived-networking maybe better luck asking here
Well if it's ECS, then either would be fine
I don't think a lot of people in #archived-networking also do #archived-dots
๐คทโโ๏ธ He is asking 500 ccu and 25k GOs
I don't think there's an easy answer to that but some knowledgeable people there
probably gotta roll out the big bucks for photon quantum
Photon quantums player count doesn't scale that high
With that player count you will always want to roll your own solution
does anything that is available off the shelf go that high?
Nothing I know of
you dont even see that in games available now tbh
If I remember correctly exit games new product will have a battle royale sample with up to 300 CCU.
But that might've changed
alright here we go, downgrading fairly extensive dots project to 2020 from 2021.2
I have a question about HDRP and shadergraph option " DOTS instancing". On the documentation they said : "Enable GPU Instancing for use with the Hybrid Renderer." But I don't know what is Hybrid renderer, could you help me ?
@oblique turtle if you arent using dots you dont need to worry about it but basically the hybrid renderer is a package, that renders entities
Yikes, good luck. I did so earlier this month and it fucked my shaders so hard.
thanks just dealing with my shaders now, which is a bit painful but mostly it wasnt as bad as I was expecting
Yea, as I complained earlier, my shaders depended on some key fixes of the HDRP camera compositor that was merged in 2021.2. Downgrading to 2020 really hurt and having to make my own compositor is not fun. It's more efficient than the official compositor since I removed a lot of the features and hardcoded what I wanted but it aint fun.
I do have to say, pulling pixel data from the GPU is like pulling teeth. It doesnt need to be this hard yet it is.
ah forgot 2020 subscenes dont work with the ui package ๐
And 2020 UI builder does not support setting sprites as background. Completely destroyed my workflow.
Anyone have any suggestions for getting microphone data into ECS
blob assets comes later, but all other things you have said are already implemented
Basically also referencing other injectors makes the entity have a Entity buffer of these injectors and the entities are converted so you have not to worry about to some not being converted at the right time
just not documented yet
its mainly a more streamlined workflow to help hybridize monobehaviours and single componets in an easier way, for example, the entity conversion from unity converts the entire object to entity, you may want to convert a single thing, or even use the monobehaviour as it is, in a system to segregate it bit a bit<
also it includes system creation extensions that help you to create your own custom Systems with injected dependencies
Interesting slide from the workshop/talk
According to Brian there have never been more people working on DOTS than there are currently
@deft stump is not gunna be happy about enabled bits being in 'possible work' rather than 'nearly done' ๐
... me too tbh.. would hope most of that list was well under way
Same but Unity is well known for being slow
So it's to be expected
i dont care about enable/disable, give me real features like fully fleshed out animation and sound๐
I want to visualize the dependency chain. Unity plz.
I think they mentioned that they are going to upload the recording not sure tho
without dots they cannot compete with other faster engines
any tidbits you learned that you werent aware of previously?
Not really, but it was refreshing to hear people talk about dots again
definitely feeling starved for official dots talk of any kind, probably should have signed up for it
there is radio silence on dots forum but not on netcode one(timjohansson and cmarastoni)
Yep. And the DOTS editor topic is active as well.
How do I Dispose all worlds and change to a new scene in a single go?
I've tried making a system that runs after meshrenderv2 that does just that, but I get an error, possibly because I am destroying all worlds from a system
I also feel I need to do that at the very last instant of a frame, so all things that needs the world to exist will not throw any errors
WaitForEndOfFrame works fine
everyday my patience grows thin.
๐
Automatic Entities.ForEach().
Manual var job1 = Entities.ForEach(Dependency); var job2 = Entities.ForEach(Dependency); Dependency = JobHandle.CombineDependencies(job1, job2);
I was under the impression that the automatic system was smart enough to separate the two. But I guess not. Hrm.
Can you show me the specific codes?
anyone else keeps getting this error from time to time? https://i.imgur.com/wvrpZwq.png
it didnt happen before i installed dots
i think its burst related tbh
yea I occasionally see that e.g. after a package update - a restart of the editor and it's usually gone though
it happens few times a day
its almost unusable id say
depending on project it will take longer to load
whats going on, I made a new Scene (not a subscene) but now when I go into playmode, it will open the SampleScene and play that! When I look in the Hierarchy my Scene2 is there also! wat the hell?? I never asked for this? I think its bugged, but it happened after I added a convert to entity script to an object in scene2
Anyone know what / where the audioClip component is in tiny
var census = GetComponentDataFromEntity<Census>();
var t1 = Entities
.WithName("DenormalizedDirectCountries")
.ForEach((in Quantity quantity, in Citizenship citizenship) =>
{
var countryCensus = census[citizenship.Country];
countryCensus.Value += quantity;
census[citizenship.Country] = countryCensus;
}).Schedule(Dependency);
var survey = GetComponentDataFromEntity<Survey>();
var t2 = Entities
.WithName("DenormalizedDirectProvinces")
.ForEach((in Quantity quantity, in ResidenceEntity residence) =>
{
var provinceSurvey = survey[residence.Province];
provinceSurvey.Value += quantity;
survey[residence.Province] = provinceSurvey;
}).Schedule(Dependency);
Dependency = JobHandle.CombineDependencies(t1, t2);```
Removing the manual dependencies, the system schedules them in series.
Have you disabled automatic domain reloading in the Editor options, maybe?
I restart Unity several times a day out of habit because I occasionally get unpredictable behavior if it's left open for too long. ๐
Sometimes Burst compiler errors, sometimes taking the GPU driver down, sometimes it just hangs endlessly - never predictable enough that I feel it'd be worthwhile to try to isolate and reproduce it, just enough to be mildly annoying. Comes with the beta territory ๐
Hmm, even if they're in separate Systems, tagged with execute before/after tags?
Without manual dependencies? Separating the two ForEach into two systems still causes it to be in series.
Dumb statement but maybe the system deduced that it doesn't need to parallelize ? ๐คทโโ๏ธ
Maybe it will if you push harder ?
Everything should be parallelized when possible. What else would the job threads be doing otherwise. And how do I push the dependency chain to parallelize as much as possible?
I don't know really. I meant maybe if you scale to more entities
Was a random idea
thought*
There are about 8,000 entities being iterated over in those two jobs.
yeah then scratch everything I said ๐
I've been trying all night and all morning and come to the conclusion that just directly use GetComponentDataFromEntity(true) in a top down hierarchy is most performative.
Maybe you can dig the code and try to understand the multithread assignment policy
That job code above uses only singlethreaded assignment .Schedule()
Runtime per section was about 0.15 to 0.2 ms. Roughly equal for both Entities.ForEach().Schedule()
Series, 0.3 ms to 0.4 ms. Parallel they overlapped for 0.15 ms to 0.2 ms.
Alternative parallel code with .ScheduleParallel() using readonly GetComponentDataFromEntity(true) API resulted in very slightly less runtime.
The jobs being compared are the first two blocks of parallel code: the SumProvinces and SumCountries. Runtime in that image was about 0.1 ms.
I have apparently only managed to reliably access L2 cache. There are instances where it seems L1 cache has been successfully filled and used such as in the following profiler.
But I dont see how I can structure my data so it more often stores in L1 rather than cache miss and go to L2.
Doubled the entity count. Not quite doubled the run time thankfully.
A little over 10,000 entities. Actually the performance isnt that bad.
Entities.ForEach.Schedule(); is just shorthand for Dependency = Entities.ForEach.Schedule(Dependendy);, nothing more
Yea. I was expecting that the dependency scheduling would recognize that the jobs write to different components and read from different sources. Yet it doesnt. I need to manually separate the dependency into two different job handles and then combine them back into Dependency.
This should be easy to answer: How do I instantiate a GameObject into an Entity at runtime on the current version of DOTS? Last thing before I literally launch my MMO engine tonight.
Remember guys if I go big, just ask me for stuffs.
I see tutorials and stuff, but I want to make sure they're not outdated.
Is it as simple as instantiating a prefab with a convert to entity script on it?
Use a subscene. Right click on a game object and select Add Selection to Subscene.
I'm talking in script
I want to instantiate things on the fly
In this example, when the server tells you another player has spawned in the zone.
I have that information, but I need to make the entity show up.
Designate the gameobject as a prefab using a custom component like NewPlayer you made. Then in conversion, add Prefab or Disabled component to that converted entity to prevent it from being used. Search for an entity with both Prefab or Disabled and NewPlayer or whatever you named the component. Use the EntityManager or an ECB to instantiate that entity.
So it is just instantiate
Nothing fancy like the old tutorials had.
Great thank you.
One very last thing before I go live. How do you make an entity not render its mesh? I tried turning the MeshRenderer off in the scene, but the Physics Shape which depends on it got upset and errored out.
I can do this either in scene or in script.
Probably going live with a networking demo in under an hour.
Use Disabled tag to disable the entire entity. If you need only the mesh to be turned off, you'll need to roll your own solution.
Thanks bro.
Please consider googling before asking a question if you need it within a time constraint.
I'm probably just gonna fly it off screen or something for a hasty temp solution.
You know how you get excited just before a release...heh
Compiling to go live. Wow, back into an update rhythm finally. Two next gen techs added since last update. 1 is next gen mmo code no one is using 2 is DOTS/ECS which few are using.
I thought so too but there's nothing on the forums. There's one to disable physics but not rendering.
DisableRendering exists
My MMO engine is live, and here is a write up about it: https://steamcommunity.com/games/658480/announcements/detail/3056232996627859242
Thanks much guys. I could not have gotten over the technical hurdles without you.
I'm not even joking, if I make millions and stuff, and you find me, you can hire the Ateam, I mean ask for some resources.
RL resources ๐
https://forum.unity.com/threads/cant-make-builds-since-updating-to-2021-1-6f1.1106311/
System.Private.CoreLib is referenced by Unity.Entities ('Library/PlayerScriptAssemblies/Unity.Entities.dll'). But the dll is not allowed to be included or could not be found
It's not letting me purchase. Would love to support. Is this an asset you want others to develop or are you building for yourself? Happy to support
Well, who's gonna tell them the bad news?
How does project tiny audio woke
Work
You add a playOne component and it works
But I canโt see the system or how it works
Well, at least shit's getting done on unity side. There's probably just a big problem with the main Entities or HybridRenderer that's preventing a release.
Alright, yet another day of testing and yea, using the stock Entities.ForEach().Schedule() is not good. Manually chain your dependencies if there can be overlapping jobs because Dependency sure wont.
It's incredibly annoying because a lot of processing time is being spent on relatively simple clearing jobs at the end of system that can be done in parallel with another job in the next system. But the basic dependency chains them after each other in series with significant amount of time wasted waiting for the unrelated clear job to finish.
5 jobs in this image. Jobs 2, 3, 4, and 5 have manual dependency handling. Jobs 4 and 5 rely on Job 3 but do not conflict with each other, resulting in merged parallel run times. Same occurs with Jobs 2 and 3 and the System Boundary. Job 1 can be merged with Jobs 2 and 3 but due to the system boundary where only Dependency is being passed between the two systems, this does not occur automatically.
A significant amount of wasted cycle time is occurring due to the system boundary and Dependency not actually being smart in registering Job dependencies.
Bad (automatic Dependency cross system scheduling)
Good (manual cross system scheduling)
Using Dependency = JobHandle.CombineDependencies(Job2, Job3, Job1); where Job1 was obtained from a public property of the previous world (using [UpdateAfter(typeof(PreviousSystem))]), the runtimes of all three jobs are now far more efficient and compact than just relying on Dependency.
TL;DR: Schedule your own job dependencies if you want full parallel runs.
Edit: Unity does not like manual cross system scheduling. I need to turn off the JobsDebugger in order to get that merged cross system scheduling which is unfortunate. Then again, the JobsDebugger is a crutch for proper coding. Maintain your read write access yourself.
Can you share this on the forums ?
The video is up now https://www.youtube.com/watch?v=SoNnyPpE2Ok
You shouldnt
did something happen to the Collections package? i'm getting errors on an old project that used to compile about UnsafeUtilityEx not existing. seems like collections doesnt exist anymore?
mmm, [0.13.0] - 2020-08-26 Removed: UnsafeUtilityEx, lol, that'd do it
ArchetypeChunkComponentType and ArchetypeChunkBufferType don't exist anymore, is there a new version?
ty, was in the changelog for Entities 0.12
ArchetypeChunkComponentType has been renamed to ComponentTypeHandle
ArchetypeChunkComponentTypeDynamic has been renamed to DynamicComponentTypeHandle
ArchetypeChunkBufferType has been renamed to BufferTypeHandle
ArchetypeChunkSharedComponentType has been renamed to SharedComponentTypeHandle
ArchetypeChunkEntityType has been renamed to EntityTypeHandle
ArchetypeChunkComponentObjects has been renamed to ManagedComponentAccessor
Key points from Brian's lecture:
- Collections package will be coming out of preview and into production ready like Burst and Job System next update. "Imminent". Practically done right now.
- He is not allowed to say timelines (keyword allowed) but estimates sometime this year. Reading between the lines, probably fall or winter 2021 is when we'll get some more news. "Soon". Does not recommend converting production games to Entities in current state of package due to long wait time to next update. "Above my pay grade". Update schedule currently halted by C-Suite themselves and will be released when they decide its good.
- DOTS Animation and audio are getting actual APIs to use next update or in a future update. Focus of development currently is on tooling and usability, features largely complete.
- DOTS Netcode is splitting into 2 packages. One Peer to Peer (to be released) and the existing Client Server model. An educational workshop was recently forced upon unity employees teaching them how to use both.
- Very vague on status of Hybrid Renderer. Says performance was improved but I doubt it.
Good shit. Finally some news.
Im actually happy with how hybridrenderer is currently, not sure about other peoples needs but its come along steadily and has a decent forum presence for the issues it does have
Thanks for the writeup, saves me watching it but pretty sure ill watch it regardless ๐
You should. Skip to the last 15 min is where the juicy news is embedded. I might have misinterpreted or missed something in Brian's speech.
For example, the Entities ETA is all my interpretation. He was very dodgy and carefully chose his words. Except for the "sometime this year" leak for a timeline of news.
So basically "We're working on improving DOTS. It will better and more fully featured at some point in the future." Useful.
P2P networking? Awesome ๐
It's a lot more optimistic than the 2020LTS post.
Lets hope they also post this news in a blog soon
Continuing from last night, Tip #2: Minimize calls returns to Dependency resulting in sync points.
The difference today is that I used multiple rotating read-write buffers like in a shader to allow for all 3 jobs of the first system to run concurrently with each other, removing the large Dependency sync gaps in job running. Removing JobsDebugger allows for the buffer rotation job (swapping read and write buffer values) to be merged with the start of the next system. This shaves down the run time by 10% to 20%. Not much but when every last microsecond matters, this is a massive improvement.
Compare from the original photo from last night:
The scale is not the same, the former is zoomed in more to allow for the red bars to be shown without overlapping any of the jobs but the reduction in empty run time where the dependencies must synchronize is clearly evident.
I have nothing to add, but I've been closely following your reports - I'm about to be embarking on a similar quest to squeeze every last drop of parallelism out, so this is incredibly useful. Awesome work. ๐
Thanks. Im trying to completely overhaul my component data layout to remove that second Dependency sync. It's a learning process for me as well so I'm going back and forth between a lot of commented code and the Profiler to see if any changes actually improved performance.
Please share on the forums when you get to the end ๐
There are occasionally a job thread on seemingly every system just sitting idle. Is the maximum number of job threads 9?
Well no, the first system properly filled out all 10 job threads but the others do leave some threads running idle for some reason.
While I was unable to remove the second Dependency sync point, I have massively reduced the third stage job section by removing the random read-write access between entities. By copying data from one entity to the other at the start and mirroring the actions that occurs to that component in two separate job systems, I remove the need to use GetComponent<>() and drastically speed up runtime.
It is going to be a challenge keeping the values identical without any communication between the two entities. Hrm, something to think about.
What is incredibly annoying is that generic components are not allowed in Entities.ForEach(). Would simplify a lot of these redundant read write buffer components.
Good stuff dude, my personal suggestion is that this implementation detail should definitively be documented within your games internal documentation somewhere. this is the kind of stuff you forget the reasoning for 6 months from now when you have to add a small change to say that shader
I'm trying to do NativeHashMapExtensions.GetUniqueKeyArray<float3, float3> (array, allocator) and surprised to see There is no boxing conversion from 'Unity.Mathematics.float3' to 'System.IComparable<Unity.Mathematics.float3>'
What am i doing wrong? suggested way to fix this?
In this case UnsafeMultiHashMap<float3, float3> array;
Did you find the answer?
Not really. I instead switched to NativeHashMap to avoid duplicates in the first place.
I just tried making a NMHM with float3, it worked on my side.
At least keywise.
NMHM works with float3, float3 but float3 doesn't implement ICompare so you can't use NativeHashMapExtensions.GetUniqueKeyArray
Ah, right. Yea, it doesnt work with that.
Hrm, another 4 hours passed and making everything a two buffer read-write system does not work. Even with dependencies all scheduled in parallel, there were more gaps in runtime than the implementation pictured in the previous screenshots. Perhaps not enough room in the cache to accommodate doubling the memory requirement of all these jobs. Interesting. Remember, always keep a backup of the last viable version. Thanks Git.
And before I leave for the night, this is what I'm doing to merge dependencies across systems
jobHandles.Add(Entities
.WithName("SwapProvValues")
.ForEach((ref SurveyRead read, ref SurveyWrite write) =>
{
read.Value = write.Value;
write.Value = 0;
}).Schedule(Dependency));
jobHandles.Add(Entities
.WithName("SwapCountryValues")
.ForEach((ref CensusRead read, ref CensusWrite write) =>
{
read.Value = write.Value;
write.Value = 0;
}).Schedule(Dependency));
jobHandles.Add(Entities
.WithName("DebugResetBudgets")
.ForEach((ref Budget budget) => { budget.Value = 1; }).Schedule(Dependency));
if (JobsUtility.JobDebuggerEnabled)
Dependency = JobHandle.CombineDependencies(jobHandles);
else
ClearJob = JobHandle.CombineDependencies(jobHandles);
jobHandles.Dispose();```
Where jobHandles is a NativeList.
ClearJob is then obtained in the next system and used like this:
if (!JobsUtility.JobDebuggerEnabled)
jobHandles.Add(World.GetExistingSystem<PreviousSystem>().ClearJob);
Dependency = JobHandle.CombineDependencies(jobHandles);```
Also note the .Schedule(). Despite iterating over hundreds and thousands of entities, single threaded .Schedule() is actually faster than .ScheduleParallel() for simple intra-entity jobs like setting a value or swapping component data within an entity. As always, test for yourself but that's generally what I found.
@robust scaffold Watching that video replay about the DOTS workshop that happened this week, Roger Kueng specifically says Schedule() will decide on itself if it's worth it to run on another thread or main one. Figured that might interest you to have some kind of confirmation.
At this timestamp https://youtu.be/SoNnyPpE2Ok?t=2936
Doesn't go into details about the policy though
I think that's slightly misleading. Yes, .Schedule can run on the main thread, but the job scheduler basically just selects whatever thread is currently free. So it almost always use another thread. It will never be more efficient than using .Run when you have very little amount of work to do in the job
It won't automatically decide based on which is more performant from that single job, but rather based on which is more performant in terms of what resources are available.
Ok I would have expect Schedule to only work with worker threads, but basically it also knows about and will consider the main thread, right ?
Yes exactly.
But will almost never choose that, as other things usually use that thread
Think it was from the manual
Am facing an issue, so far ive been using converttoentity and its fine for hundreds of models but im going to have thousands of models on top of that
having them instantiated in editor all the time would just lag me
so i am wondering.. how to deserialize them in some other way?
i mean serialize/save them in edit mode
and then load them in playmode conditionally
i know i can use prefab with ConvertToEntity on it
sounds like you want a subscene
No subscenes
my problem with prefab is that it wont parent
to existing entities
or maybe it could
you should be able to add the parenting components, though I"m not familiar with the details of that
Yeah
i can use this i think.. on prefab
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
to add parent component
However it does not know who is parent
and this script executes either on start or the moment you add script to object
so i guess one way to do it is to have one script with variable that holds parent entity reference
and then add script with convert
but thats 2 scripts mb not very scalable
and it still involves spawning a GO in runtime;f
is there some limit on how many components can an archetype have ?
okay, several days ago, I wrote here about my issue with the hybrid renderer throwing InvalidOperationExceptions with no apparent cause
I just finally fixed this problem - I was caused by PhysicsCollider component being in the entity archetype
I've got about a dozen or so components on a single entity. It's getting fairly large so I'm planning on splitting it soon. The absolute max is 16kb on a single entity because that's how big a single chunk is.
16 kb or 16 kB ?
kB
Why no subscenes?
moving world
how does the ref works on an inline variable ? ( is there any difference without using ref in this example )
ref PhysicsWorld world = ref World.DefaultGameObjectInjectionWorld.GetExistingSystem<BuildPhysicsWorld>().PhysicsWorld;
is Disabled component doing anything? wanted to easily turn off entities render mesh and everything else
dstManager.AddComponentData(entity, new Disabled());
but that component is empty and nothing changed
@gusty comet Components without any variables are considered tags, and they are use for filtering. Such as 'Disabled' that will turn off the Entity from the Entities.ForEach loops in systems (among other thing). So you are doing the right thing by using 'Disabled' to turn of the Entity. If you did not notice any difference, could it be that you where expecting things to stop render? In that case it's probably a child entity not the disabled entity that is till rendering. One GameObject can split into several Entities (for many reasons), so you need to disabled all of them. It's a tricky thing actually... hard to explain completely here.
thats what i assumed and was about to test
yeah its child of disabled entity thats rendering
If it's a Prefab that is getting converted, it has a LinkedEntityGroup that you can query to get it's children. If not, I would recommend trying to hook up to the child entity in a convert function. Sometimes you need to use 'conversionSystem.GetEntities(gameObject)' to find that generated child entity. Again, it's tricky... not too fond of that part of ECS myself
hows LinkedEntityGroup different
from iterating through child buffer
LinkedEntityGroup is all children+their children + theirs... ect
child buffer is just immediate children
ahh designing my world was hard with monos its even harder with dots
I typically don't use the Child DynamicBuffer for anything other than transform related stuff.
๐
thats a bit impossiable
messing up is ok
DOTS is changing so much that something we are all doing now is likely to be considered a 'mistake' in some future version
@gusty comet What do you mean designing your world? Building it? Generating it?
well now im making prefabs that will be loaded for each planet depending on player distance.
each prefab will have 100-500 models
one prefab will be eg small models (load when close) other will be big ones (load always)
that sounds more like subscenes then prefabs
and hybrid renderer has some sort of LOD thing, never used it
i load them via addressables, and add converttoentity when ready
ohh i did that
havent seen anything but LoD is different meshes depending on distance, not what im doing
sooo much custom code to get it working with save/load
Alright. Just two heads up. If your are manipulating your world in complex ways, like procedurally generating stuff. Keep it as GameObject until you're done, and then convert it. If you just spawn stuff at random phuso random positions, make sure to use ECS prefabs, it's much faster
ecs prefab?
yeah
you mean GO prefab with convertToEntity component?
I mean with game save/load
No, your convert it to ECS and then spawn them
I don't know what is the future prof way, but I sure GameObjectConversionUtility.ConvertGameObjectHierarchy();
You get a Entity with a Prefab tag out of it. And if you instantiate that entity via EntityManager, it works just like a Prefab.
can you parent it to other entity with GameObjectConversionUtility ?
also how u know its faster than ConvertToEntity
Trust me, it's faster ๐ If you Instantiate with the overloaded Instantiate that can fill a NativeArray with the results, you can spew thousands of entities a second easily.
Pretty sure single Entity Instantiate through EntityManager or EntityCommandBuffer is faster then normal GameObject Instantiate even without a convert
oh ok i am not sure how to use that yet will have to look for it
I don't know why you need to parent the Prefab? Could that not be built into the prefab to begin with? The resulting instance can be parented to what every you want
One step at a time
no im parenting prefab with models to a moving planet entity
I've read things on the fourms/docs that discourage runtime conversation
exactly. It's slow
Personally I hope they leave it but it looked to me they will remove it in a future update
The Convert?
tho at DOTS release pace that will be 10 years away ๐
yea the ConvertToEntity MB
and simlar things were said about the COnversionHelper thing
ideally they have some sort of new conversion api they will release
The convert will not disappear. Maybe they will update or rebuilt it. But there is so much to gain from having separate representation of runtime and editing. That is actually a brilliant move!
no i mean just the runtime part
what we have now is enough to speed things up a lot tbh
agree they wont remove conversion, but they definitly want us using it in editor instead
games nowadays are locked on maxxed single thread
Oh, you mean like straight to sub-scene?
yea
and with dots we can avoid that
Fair. I've ignored Sub-scene.... They need to straighten that stuff of first ๐
๐ DOTS definitly dosnt fix the single threaded thing, but it makes it way easier
but not gonna lie, making a dots-MONO hybrid (on top of dots being weird) is quite the challenge
Subscenes are actually working really well this update
for me at least
but i do think the whole concept needs a big of loving
like 3 subscenes, all convert a 'spawner' that refereces the same prefab, that prefab is converted and saved 3 times
Yeah... We started making our game pure DOTS 2 years ago... that stuff needed much love then and still need
sweet
DOTS is so damn deep... I discover better ways to structure and optimize my code every month.
yup sooo many cool ways to optmize
im still pretty high level, using Entities.Foreach and basic Jobs
i only use foreach
but its enough for now.. basically im moving and rendering whole world with dots and hybrid renderer
interactables and players are MBs though
but the heavy stuff is done by dots so its fine..
on monobehaviours, it was getting a bit laggy when you were moving many planets all with models on them etc
Going with only Entities.Foreach is really good enough, get you far.
yup, their 'performance by default' goal is working nice with ForEach
but im working on a networking kit, really dont want to add much/any overhead to games just for networking
Just try to get away from object oriented thinking
SSE and Burst for the win! Good night
Night
Better DOTS is 10 years away than released buggy so users rely on it to make a game then find 2 years in they have to restart
I doubt that would make a difference
i dont mind if it takes 10 years, but i do want better communication
Are there any good resources on the internal workings of Subscenes? I am creating levels from SOs and I am thinking about creating the entity side of subscenes via code without having real scenes
Well at least there is more stuff in there than the last time a looked. So I will have another look at it
I've just started getting these two exceptions (stating Unity.Entities.World.SetTime and Unity.Entities.World.PushTime) and I'm not sure where to look to work out what I've done wrong - I've not seen these before in the ~18months+ I've been devving the project with ECS.
Can anyone point me in the right direction where to look?
They seem to pop up when I pause my game - I have a separate TimeSystem as a wrapper and that looks like this: https://gdl.space/iqupedicoz.cs
all my systems that use DeltaTime instead use the singleton GameTimeComponent DeltaTime or ScaledDeltaTime. It's been working fine until recently - I did make some changes to the pause functionality so I suspect it's to do with that but I'm struggling to see quite what!
maybe something to do with GetSingleton the Singleton doesn't exist at that time but its trying to get it?
which one, I think I have them all behind HasSingleton<> checks?
the script should be in that list above there, whichever one of your scripts is in that error list that's where it is
yeah neither of these errors contains any reference to any of my scripts ๐ฆ
like normally they do when you mess something up!
you sure, whats the whole list
yeah I checked them a couple of times, it's all World. stuff and not any of mine at all
I don't know, may be a package error or something
I have been putting off bringing the project back from 2021.2 to 2021.1 since I saw that blog post about DOTS, but I've just got it open in 2021.1.6f1, fingers crossed it was just that (I'm just suspicious that it's more likely my fault anyways!) Thanks for the suggestions @pliant pike
oh yeah, who knows it could be a bug where its not showing your script in the error list
๐ค I never see it again haha
yeah those sorts of bugs are the worst is it me is it them 
that blog post recommends downgrading all the way down to 2020.3 LTS
If you disable burst compilation, enable debugguers, is it more precise with the error ?
I'd have to go back to 2021.2 to test that
The error looks more like it has reference error when iterating chunk data
but who knows how accurate it is ๐คทโโ๏ธ
Oh yeah Calabi is right, it's on a GetSingleton call, missed that xD
So from here it seems
then this
Uhm do you miss the WorldTime component that is autmatically added ? Maybe you created a custom world and its missing ?
But it should be created on the fly anyway...
nope, the error (which I haven't seen since going from 2021.2 to 2021.1) happened during the middle of a game so all was fine up until some point when it wasn't. If it happens again I will definitely be back to troubleshoot this further, but touch wood as I've not seen it again all day and got it several times an hour earlier on, I'm at least hopeful!
haha okay, I have no clue what happened anyway. Happy coding
The issue with going to 2021 is that you can't update Entities past 0.17
So it's either stick with 2020 editor or 0.17 entities
And 0.17 might break in the future anyways :/
I read many websites. I cannot figure out how to change Angular of DOTS to match Rotate of Gameobject aka here: https://hatebin.com/oznhlismhi
you know there's math.right()
i have this code from internet, is that working? is that actually how u use gameobjectconvrsionutility?
Entity prefabEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(prefabs[i].gameObject, conversionSettings);
EntityArchetype entityArcheType = world.EntityManager.CreateArchetype(archetypeComponentTypeArray);
Entity entity = entityManager.Instantiate(prefabEntity);
and can this code be put anywhere
or is there a special place
well that cant be jobified, and I doubt you'd want to use the conversion utils or create archetypes every frame
hey guys, which way would you recommend to pass values of components/systems to the UI? hybrid components?
basicly yes
i have a 'gather' system that caculates the things the UI needs to display
in 1 version i would just push those values into a MB, using Gameobject.Find or something in OnCreate
the next i used a singleton hybrid entity instead
i model my UI as a single 'master' UI Controller
and all the UI exists as children/subcontrollers of that
let's say I want to implement a counter on the screen
so the 'interface' between ecs and MB UI is that master controller
so I have a CounterSystem that handles the logic for decrementing the actual value in a CounterComponent right?
and then, sync that value with a Counter.cs MB on the UI?
my v1 worked like that
v2 was close, still with Counter system that populates a counter UI component, That counter UI component is attached to a hybrid entity (my master UI controller) and i have a general UI Sync system that reads the counter ui component (all ui components) and calls methods on the Master UI controller to update
yeah think I understand now
i would also try to keep the number of ui components as low as i could, perfering to make 1 bigger one instead
also i was considering slowing down the ui updates, since the hybrid call to the MB is a singlethreaded sync point
UI probably only needs like 10 updates a second max
guess it depends on the game a bit
um lets use RTS resources for a example
I would have a count system per resource type (so they can count in paraell)
And to continue the paraellness they would each have a counter component (eg wood)
I then in my UI sync system, that just had code to GetSingleton of each resource counter and call a method on the singleton ui controller
it depends alot on what your counting
yeah, i'll get it working first and see if I need a singleton
for rts selected units i had a dynamic buffer of selected units which contained things like unit type, health, unit entity ect
not sure what the 'best' way is but it worked for me and was mostly simple to understand
i was thinking when i 'lock' the different resources i could just have a single component storeing the totals of each resource, but i think that would cause my counter systems to have to run one after the other
I see. thanks for the advise - i'll try the different approaches and see which works best
๐
my view is just pick something that works
and leave it untill you have issues/need additional performance
yeah, that makes the most sense
Hey all, I think I am missing something obvious, but what do I have to do for my subscene to be loaded automatically when in build ?
Oh hahahaha thanks!
Is there a way to find something about it?
sorry i dont have links to what there is
maybe the conversion page in the docs?
basicly to add the new build packages
then rightclick => create asset => classic build platform or something
Ohhh its a package !
it exists as a scriptable object in your project
and has a build button on it
cant remeber the package name, patform.windows ??
for windows
theres 1 per platform
yea that sounds right
its one of those DOTS secret hidden packages
they are all secret ๐
is there a dots-phyiscs for plane Raycast ?
found it : Unity.Physics.Plane.Projection
I'm trying to troubleshoot a fancy package I found for a procedural editable terrain - atm it's not.. generating the meshes. No errors. Digging into the code, it's a .. IMesherJob? is there a unity configuration thing I'm missing perhaps?
I installed Burst, not sure if there's something else I need.
here's the package if anyone is interested in taking a peek for me ๐
Ohshit the guy's in the discord! @chilly bobcat
Love your package btw, it looks killer.. wish I could get it to work haha
IMesherJob is a wrapper I made for all voxel-meshing jobs (i.e. Marching cubes, dual contouring, surface nets etc.)
inv me ( to your discord ๐ )
Sorry Iโll get back to you all after school today, about 6 hours
I invited you as a friend
How do you disable the rendering of an ENTITY but it still be active in the game? I saw from here, something called: DisableRendering, but couldn't figure how to use: https://forum.unity.com/threads/what-is-a-better-way-to-temporarily-not-render-an-entity-than-disabled.641419/
Does CastRay return sort hits?
public bool CastRay(RaycastInput input, ref NativeList<RaycastHit> allHits)
The overload you posted uses the AllHitsCollector internally which doesn't sort by the hit fraction
You can make your own collector if you need the resulting hits to be sorted
I have a question about https://docs.unity3d.com/Packages/com.unity.entities@0.17/api/Unity.Entities.EntityManager.Instantiate.html
If I pass in an array of the entity prefabs to instantiate, that overload says:
This method overload ignores the LinkedEntityGroup component, since the group of entities that will be cloned is passed explicitly.
Does this function instantiate a prefab with hierarchy correctly or should I somehow add those linked entities to the array explicitly?
It is a tag component. Add it as you would with any component