#archived-dots

1 messages ยท Page 218 of 1

robust scaffold
#
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
}```
#

Question is now, how to wrap the december increment to january?

karmic basin
#

maybe you can clamp

#

wait no

robust scaffold
#

Month = (Months) ( ((int) Month + MonthsToAdd) % 12 ) )

karmic basin
#

smthg like a modulo

#

don't know how it's called in english :p

#

yeah smthg like that

robust scaffold
#

Yea, i think you're right. Hrm.

karmic basin
#

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
robust scaffold
#

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.

amber flicker
#

If it's not going to match the real world day/time why not just do 12 months x 30 days?

robust scaffold
solid rock
#

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..

amber flicker
karmic basin
#

lmao base 10 calendars

robust scaffold
karmic basin
#

So you're going for the struct way ?

robust scaffold
robust scaffold
#

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.

sturdy rune
#

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

tight blade
#

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.

solid rock
gilded glacier
#

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

safe lintel
#

@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.

gilded glacier
#

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

crude sierra
#

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?

safe lintel
#

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

crude sierra
#

pretty sure Convert and inject game Object does that for you

safe lintel
#

ah you're right, so where are you calling the coroutine?

crude sierra
#

just in the Start method

crude sierra
#

but if I drag it manually into the scene, it works

tight blade
solid rock
#

Basically A* 2 != A + A

tight blade
#

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.

safe lintel
#

@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

tight blade
#

nope still -3.63797881E-12 difference ๐Ÿ˜‚ oh my god this is killing me

#

sorry, I'm interrupting.

crude sierra
#
public class HybridEntitySync : MonoBehaviour
{
    public void DestroyHybrid()
    {
        print("destroying gameobject" + gameObject.name);
        Destroy(gameObject);
    }
}
#

(obviously the DestroyHybrid func does not get called)

gilded glacier
#

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)

remote crater
#

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?

robust scaffold
#

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.

remote crater
#

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.

robust scaffold
remote crater
#

The child does not show up in the DOTS debugger.

robust scaffold
remote crater
#

Thank you.

remote crater
#

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

karmic basin
#

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

remote crater
#

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.

gusty comet
#

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

gusty comet
#

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?

north bay
gusty comet
#

wow thanks :-]

gusty comet
#

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

gusty comet
#

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

gusty comet
#

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

gilded glacier
#

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

karmic basin
gilded glacier
#

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)

karmic basin
#

Regarding the error you're sure it's related ? you recreated it as a simple example ?

#

Anyway I don't have a clue, sorry ๐Ÿคทโ€โ™‚๏ธ

gilded glacier
#

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

karmic basin
#

It's our curse, to all of us here

#

alternative would be to use the standard Graphics API ?

gilded glacier
#

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

karmic basin
#

this would be too slow for your use-case ? ohmygod

#

But yeah if it's not only rendering.....

gilded glacier
#

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

naive ice
#

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);

gilded glacier
#

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

karmic basin
#

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

naive ice
#

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? ๐Ÿ˜„
gilded glacier
#

it is not very linear-access, but having a buffer for every unit is kinda overkill

gilded glacier
#

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

gilded glacier
#

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

karmic basin
#

do you still have code that create entities or add components in the MB.Update() ?

gilded glacier
#

I add them only once in the awake method

robust scaffold
#

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

ocean tundra
#

@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

robust scaffold
#

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.

deft stump
#

every day we stray further from being game designers

quasi osprey
#

what are dots?

low hazel
quasi osprey
#

that looks complicated

amber flicker
#

Are ISBs not visible in the job code inspector? Or do they just have hard to find names does anyone know?

signal yarrow
#

.s

opal field
#

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 ๐Ÿ™‚ )

north bay
# opal field Hey, so for about 1 year I've been working on a "new Unity ECS" library replacem...

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

opal field
#

@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?

opal field
#

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

north bay
opal field
#

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?

north bay
opal field
#

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?

north bay
opal field
#

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

north bay
#

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

opal field
#

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?

north bay
#

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.

opal field
#

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

amber flicker
north bay
# opal field i guess maybe it forces hard opinions due to the fact that the integration with ...

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.

opal field
amber flicker
opal field
#

however i think i have a pretty good understanding of the scope by now, so it's not a pipedream at this point ๐Ÿ™‚

amber flicker
north bay
opal field
#

@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

amber flicker
#

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!

opal field
#

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

amber flicker
#

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.

amber flicker
opal field
#

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

opal field
amber flicker
opal field
#

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

amber flicker
#

I believe it's in active dev but progress feels v slow across the board

opal field
#

which i think is a great idea btw

karmic basin
opal field
#

well this year

#

like a month ago

karmic basin
#

dang, I see ^^

opal field
#

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

karmic basin
#

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

opal field
#

would you expand on the missing tools point a bit?

karmic basin
#

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

opal field
#

@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

karmic basin
#

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

opal field
#

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 ๐Ÿ™‚

amber flicker
#

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 ๐Ÿ™ƒ

opal field
#

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?

robust scaffold
amber flicker
robust scaffold
amber flicker
robust scaffold
amber flicker
#

To think this was nearly a year ago and working with subscenes hasn't got any easier ๐Ÿ˜ญ #archived-dots message

opal field
#

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.

robust scaffold
# opal field there's also this post from Joachim Ante, https://forum.unity.com/threads/state-...

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.

gusty comet
#

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

safe lintel
#

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 ๐Ÿฅฒ

north bay
safe lintel
#

cool for those who may be new to dots, but seems like it only covers the officially ready stuff(jobs,burst,collections)

north bay
#

Yea will watch it anyways, mostly because Brian Will is also speaking. He has some interesting youtube videos about OOP

safe lintel
#

yeah I really like his videos & presentation style. helped me understand blobs a bit better

robust scaffold
#

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?

north bay
#

He posted the Entities 0.17 changelog announcement

robust scaffold
karmic basin
#

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

safe lintel
warm panther
#

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 ๐Ÿ™‚

ocean tundra
#

So no custom conversions?

#

any IConverts.... ?

#

Does selecting the subscene and clicking reimport help/fix it?

warm panther
#

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.

ocean tundra
#

this is for a floating origin system?

warm panther
#

The conversion log for the scene also looks normal (but I am gonna diff it)

ocean tundra
#

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?

warm panther
# ocean tundra this is for a floating origin system?

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)

ocean tundra
#

is there a button to clear sub scene caches yet?

#

if there is try that, otherwise clear your librarys folder

warm panther
#

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.

warm panther
warm panther
#

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);
        }
    }
} 
ocean tundra
#

yea you still need to put converter version on those

warm panther
#

Wat.

ocean tundra
#

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.

warm panther
#

That says I DON'T need it.

ocean tundra
#

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

warm panther
#

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.

ocean tundra
#

@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 ??

warm panther
#

Sorry ๐Ÿ˜„

warm panther
#

So the data serializes ok.

ocean tundra
#

Yes which isn't saved

warm panther
#

Wat ๐Ÿ˜ฎ

ocean tundra
#

Unless you're marking the go/mb as dirty

#

That's why editor scripts use those horrible serialized properties

warm panther
ocean tundra
#

I had the same issue trying to assign a unique id during conversion

#

It would never stick right

warm panther
#

(me too)

ocean tundra
#

I ended up just always recalculating the id every conversation

warm panther
#

Thank you @ocean tundra ...

#

This was driving me nuts, especially as the scene was "dirty" just not the objects in question.

#

Darn.

ocean tundra
#

sweet so it works?

warm panther
#

Yep.

ocean tundra
#

nice

warm panther
#

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.

ocean tundra
#

very cool

#

i havnt reached the point of many subscenes yet

warm panther
#

I have a layer with lots of moons.

ocean tundra
#

still just 1 big one

warm panther
#

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.

ocean tundra
#

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

warm panther
#

There is no good way to sort this list meaningfully ๐Ÿ˜„

ocean tundra
#

wow

warm panther
#

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.

ocean tundra
#

yea subscenes and procedural i still havnt figured out

warm panther
#

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)

ocean tundra
#

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

warm panther
#

Can I edit my subscene as a normal scene?

#

That would be so good.

ocean tundra
#

um i think so

#

it exists as a scene in your assets

warm panther
#

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...

ocean tundra
#

maybe it dosnt track it right

#

but a manual reimport might still work

warm panther
#

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.

ocean tundra
#

so pretty sure lightmaps and subscenes ISNT working

warm panther
#

You really helped me squash a longstanding bug.

warm panther
#

Light probes? ๐Ÿ˜„

ocean tundra
#

i think theres some sort of stop convert MB you could try

#

na dont think those work either

warm panther
ocean tundra
#

its due to the hybrid renderer not supporting it yet

warm panther
#

Hybrid Renderer is like, half a renderer.

ocean tundra
#

yup

#

i was excited about deferred rendering in the next URP which apparently works with Hybrid

#

so many many lights were workiing

warm panther
#

I still dont have much of a use for deferred.

#

well.

ocean tundra
#

but then that 2021 freeze was annonced

warm panther
#

I do if I have many point lights, or any number point lights n>0 ๐Ÿ˜›

ocean tundra
#

๐Ÿ˜› your making a space game? many many many lights should be a requirmenet

warm panther
#

I am this close to writing my own shaders.

ocean tundra
#

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

warm panther
# ocean tundra ๐Ÿ˜› your making a space game? many many many lights should be a requirmenet

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

ocean tundra
#

very nice

warm panther
#

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.

ocean tundra
#

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

warm panther
#

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.

ocean tundra
#

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"?

warm panther
#

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.

ocean tundra
#

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?

warm panther
# ocean tundra what do you mean by "simulate in parallel with custom layered physics"?

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)

ocean tundra
#

very nice

#

im considering something simlar

#

but decided to just create/manage many worlds instead

warm panther
#

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.

ocean tundra
#

yea true

warm panther
#

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.

ocean tundra
#

very cool

warm panther
#

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.

ocean tundra
#

dam so cool

#

my projects are all so early days cause i keep getting distracted with tech stuff

#

like networking

warm panther
#

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.

warm panther
ocean tundra
#

yea same

warm panther
#

Also I am especially obtuse when it comes to preview stuff in Unity.

#

But I am having a blast.

ocean tundra
#

yea same

#

i love the whole DOTS thing

warm panther
#

Same!

ocean tundra
#

and seeing things work is soo cool

warm panther
#

I am terrified Unity will cancel it.

#

That 2021 freeze announcement made my heart skip a beat.

ocean tundra
#

i got the unity boids sample networked at 8k entities the otherday, soooo awesome

warm panther
#

Awesome.

ocean tundra
#

yea but pretty sure they wont

warm panther
#

I want to use swarmlike stuff for fighter drones and guided missiles; maybe.

ocean tundra
#

yea its pretty cool

warm panther
#

I'll look into that at some point, want to get my basic movement gameplay finally sorted.

ocean tundra
#

look at the unity boid sample, will get you close

warm panther
#

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.

ocean tundra
#

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

warm panther
#

Network is gonna be a biiiig question.

ocean tundra
#

and i just networked the entire matrix cause i wanted to see how a 'unoptmized' case will work

warm panther
#

Even though its insane to plan MP for a solo game that's already stretching my abilities.

ocean tundra
#

whats the gametype?

#

rts?

warm panther
#

More like World of Warships meets X3.

#

But yes...

#

Definitely a RTS flavor.

ocean tundra
#

fast or slow passed?

warm panther
#

I am thinking actually lockstep simulations.

north bay
#

Careful @ocean tundra is going to sell you his software

warm panther
#

As in, just exchange command streams.

ocean tundra
#

like DOTA style quick or a bit slower

#

haha shhhh @north bay

warm panther
#

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.

ocean tundra
#

that sounds very much like my target games for my networking tech

#

๐Ÿ˜›

warm panther
#

๐Ÿ˜›

ocean tundra
warm panther
#

Drop the link already.

ocean tundra
#

not yet released ๐Ÿ˜›

north bay
#

Space games are my favourite ๐Ÿ™‚

warm panther
#

Jon Mavor is one of my all time idols.

ocean tundra
#

was going to build a game on it to see how it works

warm panther
#

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)

ocean tundra
#

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

warm panther
#

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.

ocean tundra
#

especially since the underlying tech isnt deterministic (DOTS)

amber flicker
#

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

warm panther
#

@amber flicker Wow Thanks!

ocean tundra
#

looks awesome

amber flicker
#

Cc @last jasper

ocean tundra
#

@amber flicker is it networked?

warm panther
#

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...

โ–ถ Play video
amber flicker
#

Donโ€™t think so but I know @last jasper was looking into it

north bay
ocean tundra
#

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

warm panther
#

Yes. Which is why dogfighting wouldn't be fun.

ocean tundra
#

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

warm panther
#

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...)

last jasper
ocean tundra
#

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

warm panther
#

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).

ocean tundra
#

yea same

warm panther
ocean tundra
warm panther
#

Mkay, will do that then ๐Ÿ™‚

ocean tundra
#

basicly its all networked data

warm panther
#

Thank you so much again.

ocean tundra
#

all good

#

was fun to solve

pliant edge
#

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

GitHub

Streamlines the transition from MonoBehaviour to DOTS in an extremely simple, modular and efficient way. - Extrys/Hybrid-EZS

ocean tundra
#

@pliant edge So mainly this is a inspector to attach hybrid components so we dont have to write a custom IConverts....?

robust scaffold
opal lynx
#

Can someone tell me

  1. what are differences between World and Scene?
  2. and why people are making so many worlds?
opal lynx
#

๐Ÿ˜ข

slim nebula
# opal lynx Can someone tell me 1. what are differences between World and Scene? 2. and why ...

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

slim nebula
#

np. this channel is slow but usually someone responds eventually haha

glacial bolt
#

@opal lynx Please don't use reaction gifs

opal lynx
#

I understand ๐Ÿ˜…

slim nebula
gusty comet
#

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?

slim nebula
#

components attach to entities

pliant pike
#

you can convert scriptable objects into data in DOTs

safe lintel
#

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 ๐Ÿฅฒ

gusty comet
#

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?

bright sentinel
#

@gusty comet I'm a bit confused, do you want ECS or GameObjects?

bright sentinel
#

Well if it's ECS, then either would be fine

karmic basin
#

๐Ÿคทโ€โ™‚๏ธ He is asking 500 ccu and 25k GOs

#

I don't think there's an easy answer to that but some knowledgeable people there

safe lintel
#

probably gotta roll out the big bucks for photon quantum

north bay
#

Photon quantums player count doesn't scale that high

#

With that player count you will always want to roll your own solution

safe lintel
#

does anything that is available off the shelf go that high?

north bay
#

Nothing I know of

safe lintel
#

you dont even see that in games available now tbh

north bay
#

If I remember correctly exit games new product will have a battle royale sample with up to 300 CCU.

#

But that might've changed

safe lintel
#

alright here we go, downgrading fairly extensive dots project to 2020 from 2021.2

oblique turtle
#

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 ?

safe lintel
#

@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

robust scaffold
robust scaffold
safe lintel
#

thanks just dealing with my shaders now, which is a bit painful but mostly it wasnt as bad as I was expecting

robust scaffold
#

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.

safe lintel
#

ah forgot 2020 subscenes dont work with the ui package ๐Ÿ˜’

robust scaffold
light mason
#

Anyone have any suggestions for getting microphone data into ECS

pliant edge
#

just not documented yet

pliant edge
#

also it includes system creation extensions that help you to create your own custom Systems with injected dependencies

north bay
#

Interesting slide from the workshop/talk

#

According to Brian there have never been more people working on DOTS than there are currently

amber flicker
#

@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

north bay
#

So it's to be expected

safe lintel
#

i dont care about enable/disable, give me real features like fully fleshed out animation and sound๐Ÿ˜ƒ

robust scaffold
#

I want to visualize the dependency chain. Unity plz.

robust scaffold
north bay
#

I think they mentioned that they are going to upload the recording not sure tho

full epoch
#

without dots they cannot compete with other faster engines

safe lintel
#

any tidbits you learned that you werent aware of previously?

north bay
#

Not really, but it was refreshing to hear people talk about dots again

safe lintel
#

definitely feeling starved for official dots talk of any kind, probably should have signed up for it

full epoch
#

there is radio silence on dots forum but not on netcode one(timjohansson and cmarastoni)

robust scaffold
valid hare
#

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

valid hare
#

WaitForEndOfFrame works fine

karmic basin
# north bay

Damn I put a reminder and still managed to miss it ๐Ÿ˜ญ

deft stump
#

๐Ÿ˜ 

robust scaffold
#

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.

opal lynx
gusty comet
#

it didnt happen before i installed dots

#

i think its burst related tbh

amber flicker
#

yea I occasionally see that e.g. after a package update - a restart of the editor and it's usually gone though

gusty comet
#

it happens few times a day

#

its almost unusable id say

#

depending on project it will take longer to load

gusty comet
#

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

light mason
#

Anyone know what / where the audioClip component is in tiny

robust scaffold
# opal lynx Can you show me the specific codes?
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);```
robust scaffold
naive ice
naive ice
#

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 ๐Ÿ˜‰

naive ice
robust scaffold
karmic basin
#

Dumb statement but maybe the system deduced that it doesn't need to parallelize ? ๐Ÿคทโ€โ™‚๏ธ

#

Maybe it will if you push harder ?

robust scaffold
karmic basin
#

I don't know really. I meant maybe if you scale to more entities

#

Was a random idea

#

thought*

robust scaffold
karmic basin
#

yeah then scratch everything I said ๐Ÿ˜›

robust scaffold
#

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.

karmic basin
#

Maybe you can dig the code and try to understand the multithread assignment policy

robust scaffold
#

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.

rancid geode
robust scaffold
remote crater
#

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.

remote crater
#

Is it as simple as instantiating a prefab with a convert to entity script on it?

robust scaffold
remote crater
#

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.

robust scaffold
# remote crater 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.

remote crater
#

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.

robust scaffold
robust scaffold
remote crater
#

Thanks bro.

robust scaffold
remote crater
#

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.

karmic basin
#

Wait there's a component to disable only rendering, right ?

#

Or did I dream it ?

robust scaffold
safe lintel
#

DisableRendering exists

remote crater
#

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 ๐Ÿ™‚

brazen slate
sturdy rune
robust scaffold
light mason
#

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

robust scaffold
#

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.

robust scaffold
#

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.

karmic basin
#

Can you share this on the forums ?

gusty comet
#

updated my unity to 2021

#

bye dots updates

karmic basin
#

You shouldnt

gusty comet
#

do u guys also have 2 mono cecils

mint iron
#

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?

gusty comet
#

u can try upgrading

#

in package manager

#

show dependencies in settings

mint iron
#

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

robust scaffold
# north bay The video is up now https://www.youtube.com/watch?v=SoNnyPpE2Ok

Key points from Brian's lecture:

  1. Collections package will be coming out of preview and into production ready like Burst and Job System next update. "Imminent". Practically done right now.
  2. 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.
  3. 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.
  4. 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.
  5. Very vague on status of Hybrid Renderer. Says performance was improved but I doubt it.

Good shit. Finally some news.

safe lintel
#

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 ๐Ÿ˜€

robust scaffold
robust scaffold
amber flicker
naive ice
#

P2P networking? Awesome ๐Ÿ˜

robust scaffold
stiff skiff
#

Lets hope they also post this news in a blog soon

robust scaffold
#

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.

naive ice
robust scaffold
karmic basin
#

Please share on the forums when you get to the end ๐Ÿ™‚

robust scaffold
#

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.

robust scaffold
#

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.

low tangle
fair stirrup
#

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;

fair stirrup
robust scaffold
fair stirrup
#

At least keywise.

#

NMHM works with float3, float3 but float3 doesn't implement ICompare so you can't use NativeHashMapExtensions.GetUniqueKeyArray

robust scaffold
robust scaffold
#

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.

karmic basin
#

@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

bright sentinel
#

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.

karmic basin
#

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 ?

bright sentinel
#

Yes exactly.

#

But will almost never choose that, as other things usually use that thread

karmic basin
#

You learned that by looking the code ?

#

Makes sense, thank you

bright sentinel
#

Think it was from the manual

gusty comet
#

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

slim nebula
#

sounds like you want a subscene

gusty comet
#

No subscenes

#

my problem with prefab is that it wont parent

#

to existing entities

#

or maybe it could

slim nebula
#

you should be able to add the parenting components, though I"m not familiar with the details of that

gusty comet
#

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

gilded glacier
#

is there some limit on how many components can an archetype have ?

gilded glacier
#

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

robust scaffold
deft stump
#

kB

bright sentinel
gusty comet
#

moving world

hollow jolt
#

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;
gusty comet
#

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

cunning depot
#

@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.

gusty comet
#

thats what i assumed and was about to test

#

yeah its child of disabled entity thats rendering

cunning depot
#

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

gusty comet
#

from iterating through child buffer

ocean tundra
#

LinkedEntityGroup is all children+their children + theirs... ect

#

child buffer is just immediate children

gusty comet
#

ahh designing my world was hard with monos its even harder with dots

cunning depot
#

I typically don't use the Child DynamicBuffer for anything other than transform related stuff.

gusty comet
#

all i know is that i will have lot of iteration

#

and dont wanna mess up

ocean tundra
#

๐Ÿ˜›

#

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

cunning depot
#

@gusty comet What do you mean designing your world? Building it? Generating it?

gusty comet
#

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)

ocean tundra
#

that sounds more like subscenes then prefabs

#

and hybrid renderer has some sort of LOD thing, never used it

gusty comet
#

i load them via addressables, and add converttoentity when ready

ocean tundra
#

ohh i did that

gusty comet
ocean tundra
#

sooo much custom code to get it working with save/load

gusty comet
#

i dont think so roycon

#

youre just loading a prefab lol

cunning depot
#

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

gusty comet
#

ecs prefab?

cunning depot
#

yeah

gusty comet
#

you mean GO prefab with convertToEntity component?

ocean tundra
#

I mean with game save/load

cunning depot
#

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();

gusty comet
#

so you first load prefab into memory, before instantiating?

#

oh

cunning depot
#

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.

gusty comet
#

can you parent it to other entity with GameObjectConversionUtility ?
also how u know its faster than ConvertToEntity

cunning depot
#

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

gusty comet
#

oh ok i am not sure how to use that yet will have to look for it

cunning depot
#

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

gusty comet
#

no im parenting prefab with models to a moving planet entity

ocean tundra
#

I've read things on the fourms/docs that discourage runtime conversation

cunning depot
#

exactly. It's slow

ocean tundra
#

Personally I hope they leave it but it looked to me they will remove it in a future update

cunning depot
#

The Convert?

ocean tundra
#

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

cunning depot
#

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!

ocean tundra
#

no i mean just the runtime part

gusty comet
ocean tundra
#

agree they wont remove conversion, but they definitly want us using it in editor instead

gusty comet
#

games nowadays are locked on maxxed single thread

cunning depot
#

Oh, you mean like straight to sub-scene?

ocean tundra
#

yea

gusty comet
#

and with dots we can avoid that

cunning depot
#

Fair. I've ignored Sub-scene.... They need to straighten that stuff of first ๐Ÿ˜›

ocean tundra
#

๐Ÿ˜› DOTS definitly dosnt fix the single threaded thing, but it makes it way easier

gusty comet
#

but not gonna lie, making a dots-MONO hybrid (on top of dots being weird) is quite the challenge

ocean tundra
#

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

cunning depot
#

Yeah... We started making our game pure DOTS 2 years ago... that stuff needed much love then and still need

ocean tundra
#

2 years, damn..

#

i only just started with DOTS then

cunning depot
#

DOTS is so damn deep... I discover better ways to structure and optimize my code every month.

ocean tundra
#

yup sooo many cool ways to optmize

#

im still pretty high level, using Entities.Foreach and basic Jobs

gusty comet
#

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

cunning depot
#

Going with only Entities.Foreach is really good enough, get you far.

ocean tundra
#

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

cunning depot
#

Just try to get away from object oriented thinking

#

SSE and Burst for the win! Good night

ocean tundra
#

Night

brazen slate
stiff skiff
#

I doubt that would make a difference

ocean tundra
#

i dont mind if it takes 10 years, but i do want better communication

pulsar jay
#

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

ocean tundra
#

Just the single doc on conversion i think

#

sadly docs are still lacking

pulsar jay
wary anchor
#

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?

#

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!

pliant pike
#

maybe something to do with GetSingleton the Singleton doesn't exist at that time but its trying to get it?

wary anchor
#

which one, I think I have them all behind HasSingleton<> checks?

pliant pike
#

the script should be in that list above there, whichever one of your scripts is in that error list that's where it is

wary anchor
#

yeah neither of these errors contains any reference to any of my scripts ๐Ÿ˜ฆ

#

like normally they do when you mess something up!

pliant pike
#

you sure, whats the whole list

wary anchor
#

yeah I checked them a couple of times, it's all World. stuff and not any of mine at all

pliant pike
#

I don't know, may be a package error or something

wary anchor
#

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

pliant pike
#

oh yeah, who knows it could be a bug where its not showing your script in the error list

wary anchor
#

๐Ÿคž I never see it again haha

pliant pike
#

yeah those sorts of bugs are the worst is it me is it them leahHMM

karmic basin
wary anchor
#

christ

#

Well fwiw I haven't been able to reproduce it yet on 2021.1

karmic basin
#

If you disable burst compilation, enable debugguers, is it more precise with the error ?

wary anchor
#

I'd have to go back to 2021.2 to test that

karmic basin
#

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...

wary anchor
#

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!

karmic basin
#

haha okay, I have no clue what happened anyway. Happy coding

bright sentinel
#

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 :/

remote crater
remote crater
#

figured it out!

pliant pike
#

you know there's math.right()

gusty comet
#

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

safe lintel
#

well that cant be jobified, and I doubt you'd want to use the conversion utils or create archetypes every frame

crude sierra
#

hey guys, which way would you recommend to pass values of components/systems to the UI? hybrid components?

ocean tundra
#

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

crude sierra
#

why singleton?

#

I was thinking to use EntityManager.GetComponentObject

ocean tundra
#

i model my UI as a single 'master' UI Controller

#

and all the UI exists as children/subcontrollers of that

crude sierra
#

let's say I want to implement a counter on the screen

ocean tundra
#

so the 'interface' between ecs and MB UI is that master controller

crude sierra
#

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?

ocean tundra
#

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

crude sierra
#

yeah think I understand now

ocean tundra
#

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

crude sierra
#

so you're managing an internal counter on each component

#

or one for the entire ui

ocean tundra
#

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

crude sierra
#

yeah, i'll get it working first and see if I need a singleton

ocean tundra
#

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

crude sierra
#

I see. thanks for the advise - i'll try the different approaches and see which works best

ocean tundra
#

๐Ÿ˜›

#

my view is just pick something that works

#

and leave it untill you have issues/need additional performance

crude sierra
#

yeah, that makes the most sense

ocean tundra
#

its too easy to get stuck into the DOTS optmization depths

#

cause its awesome

proper silo
#

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 ?

ocean tundra
#

you need to use the new build system

#

its poorly documented ๐Ÿ˜›

proper silo
#

Oh hahahaha thanks!
Is there a way to find something about it?

ocean tundra
#

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

proper silo
#

Ohhh its a package !

ocean tundra
#

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

proper silo
#

Found it !

#

com.unity.platforms.windows

ocean tundra
#

yea that sounds right

proper silo
#

its one of those DOTS secret hidden packages

ocean tundra
#

they are all secret ๐Ÿ˜›

proper silo
#

Hahaha true

#

Made it work thanks to you! Thank you very much @ocean tundra

hollow jolt
#

is there a dots-phyiscs for plane Raycast ?

#

found it : Unity.Physics.Plane.Projection

simple falcon
#

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

chilly bobcat
hollow jolt
#

inv me ( to your discord ๐Ÿ™‚ )

chilly bobcat
#

Sorry Iโ€™ll get back to you all after school today, about 6 hours

#

I invited you as a friend

remote crater
#

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/

half jay
#

Does CastRay return sort hits?

public bool CastRay(RaycastInput input, ref NativeList<RaycastHit> allHits)
north bay
#

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

hardy geyser
karmic basin