#archived-dots

1 messages Β· Page 100 of 1

dull copper
#

right now if you make c# file with Unity editor, it'll give you monobehaviour template

#

with DOTS you'd want options to create component and system templates for new files

vagrant surge
#

yup

#

this new tiny stuff seems failry legit

#

i think ill try to use it

dull copper
#

again, not that many lines of code but it adds up when you do this for every file again

#

I was kinda bummed they didn't use Unity Physics on the Tiny Racing yet

vagrant surge
#

i kinda like the tiny racing demo, its pretty well written

#

very good example of the simplicity of ecs

dull copper
#

well, same thing would have been way simpler on monobehaviours still

#

but it's nice to have "minigame" examples

#

as it gives more ideas on how one can structure these things when getting into DOTS

#

that being said, I haven't checked that source code that closely, usually Unity examples tend to do silly things πŸ˜„

vagrant surge
#

yeah but the monobehavior ones cant be copypastad liberally beetween projects XD

#

stuff like the 2 simple smoke systems can be copypasta-d as is

#

over the time ive been dealing with ecs, ive found its "copypasta" potential to be huge

#

there are systems ive been copypastaing from projct to project to project

dull copper
#

btw, that tinyracing demo didn't work properly for me in the editor

vagrant surge
#

havent ran it on editor yet, just browsed its code

dull copper
#

like, it kinda did run but it didn't load all textures and it didn't clear instanced stuff like smoke puffs etc

vagrant surge
#

i think with what it does you can create a tower defense fairly well

#

it has some nice spline follow logic that would work

amber flicker
#

@dull copper just fyi in case you were thinking this is the kind of thing they'd add

dull copper
#

ah yes, so it exists already

#

IMO they should move that entry closer to creating new c# script on that menu

gusty comet
#

wow, it feels like it is almost 30 years ago

#

I could just replace ecs with oo and most of the conversations would still be the same πŸ˜„

trail burrow
#

@gusty comet the current ECS craze reminds me about the MVC craze of 2004-2006 in the web world

#

its just.... eh

mint iron
#

@trail burrow yeah seriously, i worked on web application UX a little after that, MVC4 i think it was. But from Unity's point of view it makes perfect sense; if you want to re-write your engine its a great promise to get everybody excited about (and pay for/be happy about dealing with your code-debt)

trail burrow
#

@mint iron It just feels a little bit like the kool-aid drinking club at times

#

πŸ˜„

dull copper
#

as for the Tiny Racing getting bee.exe flagged as malicious, here's a staff reply about that:

Also, we have updated the sampels projects, so just pull the latest changes and try to build again. ```
stuck saffron
#

Just to make sure I am not being dumb, because Hybrid Renderer uses game objects, you still get the performance pitfall of creating/destroying gameobjects frequently, right? Or does have some type of pooling sytem

worldly pulsar
#

it only uses Camera/Lights etc in the form of gameobjects

#

the actual rendered objects are entities

#

creating/destroying them is really cheap

stuck saffron
#

Ah okay
The term "hybrid renderer" is used because the renderer uses GameObjects, such as the camera and lights, to render ECS entities.

#

That line just confused me then

#

Thanks for the clarification

vagrant surge
#

lol the sheer broken of the tiny racer demo

#

when running from editor

#

the smoke entities never get deleted

tawdry tree
#

It's early access!

dull copper
#

@vagrant surge yeah, that's what I meant earlier by smoke puffs not clearing at all and things not loading

hollow sorrel
#

anyone know what hybrid renderer uses to actually render? i hear it doesn't use graphics.drawmeshinstanced (but v1 used to), but not sure what other api it uses then

#

not getting any wiser from skimming through the package

#

ty πŸ‘

dire frigate
#

is there a way to get ahold of the entitymanager from mono? I got a input struct with x and z float values that I want to set to get the player to move, although seems like the values are never set

coarse turtle
#

World.DefaultGameObjectInjectionWorld.EntityManager? I believe that's what it might be called since World.Active is deprecated

dire frigate
#

Awesome thank you

mystic mountain
#

Is it possible to have two ICustomBootstraps (without inheritance), and choose one to be the one that should run?

remote coyote
#

So I want to store a fixed array in my buffer elements rather than this: tier0level, tier1level, tier2level... Surely this is possible with unsafe arrays right? I was sure I had seen a snippet for this somewhere, but fail to find it now. Any pointers?

stiff skiff
#

Keep the tier0Level, etc, and get the pointer of tier0Level to do indexing?

#

Or is it fine to have the element have a pointer to another buffer?

winter veldt
#

@vagrant surge wheres the tiny project now? do i need a specific version of unity? i'm on.. 2020.1 i think..

#

i didn't see it in the project manager

zenith wyvern
#

Could anyone explain what I'm doing wrong here? I'm trying to run two parallelfor jobs that modify the dynamic buffers from two separate entities, but for some reason the job system is saying I need to call Complete() on the first job when the second one tries to run:

#
        protected override void OnCreate()
        {
            for (int i = 0; i < 2; ++i)
            {
                var e = EntityManager.CreateEntity(typeof(BufferTag));
                EntityManager.SetName(e, $"Buffer {i}");
            }

            fillBufferJobs = new NativeList<JobHandle>(Allocator.Persistent);
            
            uninitializedBufferQuery = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[] { typeof(BufferTag) },
                None = new ComponentType[] { typeof(IntBuffer) }
            });
        }
        
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var bufferEntities = uninitializedBufferQuery.ToEntityArray(Allocator.TempJob);

            for (int i = 0; i < bufferEntities.Length; ++i)
            {
                var buffer = EntityManager.AddBuffer<IntBuffer>(bufferEntities[i]);
                buffer.ResizeUninitialized(bufferSize);
            }

            fillBufferJobs.Clear();
            for (int i = 0; i < bufferEntities.Length; ++i)
            {
                // InvalidOperationException: The previously scheduled job ArraysTest:FillArraysJob writes to the NativeArray FillArraysJob.buffer. You must call JobHandle.Complete() on the job ArraysTest:FillArraysJob, before you can write to the NativeArray safely.
                var fillJob = new FillArraysJob
                {
                    buffer = EntityManager.GetBuffer<IntBuffer>(bufferEntities[i]).Reinterpret<int>().AsNativeArray()
                }.Schedule(bufferSize, 5, inputDeps);
                fillBufferJobs.Add(fillJob);
            }

            inputDeps = JobHandle.CombineDependencies(fillBufferJobs);

            bufferEntities.Dispose(inputDeps);

            return inputDeps;
        }
remote coyote
#

@stiff skiff thanks but after some thinking I think I'll just break it up so that I have category tier and level per element, and just 3x the elements. Will be so few per entity anyway

safe lintel
worldly pulsar
#

@remote coyote the syntax is fixed int stuff[3] in an unsafe struct

coarse turtle
#

Ah URP is coming next for GPU based animations πŸ™‚

#

I wonder what additional apis would exist to get it working on a custom render pipeline

remote coyote
#

so happy to see them go for gpu skinning

sour sorrel
#

Heya! I am fairly new to DOTS in general, can anyone help me on how to dispose of NativeHashMap after passing it to a Job in JobComponentSystem? [DeallocateOnJobCompletion] doesn't work with it and passing a NativeArray is either too slow or doesn't work with burstcompile because of iteration limitations. Thanks

tawdry tree
#

Are you sure it doesn't work with [DeallocateOnJobCompletion]? As in, did you try, and what errors, if any, do you get?

sour sorrel
#

Specifically I was getting errors about leaking arrays, which didn't happen with NativeArray, a quick google search confirmed that it indeed didn't work with NativeHashMap or NativeList

#

This is the thread that confirmed it

#

Although I will still need to pass hashmaps to jobs in the future, currently I am trying to solve passing of LocalToWorld from parent to child, so I can use world coordinates in the child entity, if anyone has an efficient way of handling this I would be glad to know

sour sorrel
#

The container is NativeHashMap

safe lintel
#

assuming you didnt allocate it with tempjob?

worldly pulsar
#

var deps = jobWithTheHashMap.Schedule(inputDeps);
hashmap.Dispose(deps); // This schedules a job whose only purpose is to deallocate the memory

winter veldt
#

handy

sour sorrel
#

Bingo! Will test it now, thanks a lot!

remote coyote
#

and thanks Rett, that worked just the way I wanted it to.

#

(re. the fixed array)

safe lintel
#

just a note building a player with the new anim samples seems a bit broken, getting strange results with anything animated in the player

deft niche
#

What is that used for ? @dull copper

dull copper
#

visual scripting with dots?

#

I dunno if you still need something else to run that

#

haven't tried the new package

#

only some earlier prototypes

deft niche
#

It seems to have errors on 2019.3.0f1..

#

Getting super confused between that and this package .. πŸ€”

dull copper
#

the drops on the forums are what Unity officially gives us for testing, should work on engine versions we got now, alho it's still in experimental stage

#

they are eventually moving to package distribution and while we get some packages now for these, it doesn't mean they are fully featured or that we even can run them πŸ™‚

#

but that's half the fun on experimenting with these early on

deft niche
#

I do agree with that! πŸ™‚

magic frigate
#

I'm impressed with how readable the codegen is but it seems kinda rough for someone who doesn't understand DOTS to use as of now

#

It has great potential though

slow epoch
#

"Tracing by frame and by steps" wow that's gonna be like super useful

night cargo
#

0.4.0 just dropped, anyone knows where to find the release notes?

safe lintel
#
## [0.4.0] - 2019-12-16

**This version requires Unity 2019.3.0f1+**

### New Features
* Two new methods added to the public API:
  * `void EntityCommandBuffer.AddComponent<T>(EntityQuery entityQuery)`
  * `void EntityCommandBuffer.RemoveComponent<T>(EntityQuery entityQuery)`
* BlobArray, BlobString & BlobPtr are not allowed to be copied by value since they carry offset pointers that aree relative to the location of the memory. This could easily result in programming mistakes. The compiler now prevents incorrect usage by enforcing any type attributed with [MayOnlyLiveInBlobStorage] to never be copied by value.

### Changes
* Deprecates `TypeManager.CreateTypeIndexForComponent` and it's other component type variants. Types can be dynamically added (in Editor builds) by instead passing the new unregistered types to `TypeManager.AddNewComponentTypes` instead.

* `RequireForUpdate(EntityQuery)` and `RequireSingletonForUpdate` on a system with `[AlwaysUpdate]` will now throw an exception instead of being ignored.
* ChangeVersionUtility.IncrementGlobalSystemVersion & ChangeVersionUtility.InitialGlobalSystemVersion is now internal. They were accidentally public previously.
* Entity inspector now shows entity names and allows to rename the selected entity
* Improved entity debugger UI 
* Create WorldRenderBounds for prefabs and disabled entities with renderers during conversion, this make instantiation of those entities significantly faster.
* Reduced stack depth of System.Update / OnUpdate method (So it looks better in debugger)
* Assert when using EntityQuery from another world
* Using an EntityQuery created in one world on another world was resulting in memory corruption. We now detect it in the EntityManager API and throw an argument exception
* Structural changes now go through a bursted codepath and are significantly faster
* DynamicBuffer.Capacity is now settable
#
### Fixes

* Remove unnecessary & incorrect warning in DeclareReferencedPrefab when the referenced game object is a scene object
* GameObjects with ConvertAndInject won't get detached from a non-converted parent (fixes regression) 
* Fixed a crash that could occur when destroying an entity with an empty LinkedEntityGroup.
* Updated performance package dependency to 1.3.2 which fixes an obsoletion warning
* The `EntityCommandBuffer` can be replayed repeatedly.
* Fixed exception in entity binary scene serialization when referencing a null UnityEngine.Object from a shared component
* Moving scripts between assemblies now triggers asset bundle rebuilds where necessary for live link
* Fixed LiveLink on Android

channel is quiet today so i figure the changelog spam is fine

coarse turtle
#

Ah very cool lol

#

Really liking the blob ptr enforcement

deft niche
#

Wow..finally the convertandinject is fixed..

worldly pulsar
#

Does that mean we can finally inject uGUI elements as entities? Or is there still another blocker?

mint iron
#
* Structural changes now go through a bursted codepath and are significantly faster``` weeeeee
remote coyote
#

ah, the slightly stricter blob ref usage is nice

coarse turtle
#

@worldly pulsar you can

#

Did it last night to start converting UGUI into its entities format version 😊

flat talon
safe lintel
#

wait a second! i see ComponentDataProxy useage! in Movable.cs lol

dire frigate
#

wait they're using rigidbodies for movement?

trail burrow
#

Is it possible for burst to access static data in ANY way?

mint iron
#

yes, with SharedStatic or readonly managed arrays

trail burrow
#

is there any perf penalty related to it?

mint iron
#

i think its fine if you set it up properly, it can just hit the pointer directly, ill dig up an example just a sec

hollow sorrel
#

unity sure has a good way of naming repos

#

"just look at the samples" now refers to like 5 things

dull copper
#

so it was that package

#

as another thing: anyone got that dots sample running?

#

testlevel loads eventually for me but it's not rendering right

magic frigate
dull copper
#

ah, the whitebox levels do run in the editor

#

(and render properly

#

the level they showcased at Unite runs ~45fps in the editor with lots of 20fps dips

#

(on Ryzen 3900x + RTX 2070s)

magic frigate
#

Did you try the editor settings from the readme?

dull copper
#

turning leak detection off in the editor removes the framedrops and it then runs solid 50-52fps in the ediotr

#

there were settings there? πŸ˜„

#

I'm horrible at reading instructions

#

Also, it is worth turning off Leak detection

#

yeah, this was a big one

#

The most impactful is to disable editor attaching (the ability to attach a debugger to the editor). You can do that in Editor > Preferences > External Tools.

#

this carries over to other projects, right?

#

or are the editor preferences still per project?

magic frigate
#

No clue

dull copper
#

disabling editor attaching wasn't most impactful for me tho

#

it goes from 52 fps to 56fps

amber flicker
#

That... still sounds pretty heavy? What's going on in the sample project?

dull copper
#

yeah I dunno

#

it suddenly ran at 45 only again

#

restarted the editor, didn't change anything and it runs 90fps now

gentle osprey
#

Anyone here that knows about this issue? Just downloaded the new entities package and keep getting these errors:
Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Scenes.Editor\LiveLink\LiveLinkBuildPipeline.cs(257,61): error CS0117: 'ContentBuildInterface' does not contain a definition for 'GetPlayerObjectIdentifiersInSerializedFile'
Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Scenes.Editor\LiveLink\LiveLinkBuildPipeline.cs(323,37): error CS1579: foreach statement cannot operate on variables of type '?' because '?' does not contain a public instance definition for 'GetEnumerator'

hollow sorrel
#

@gentle osprey if you have any other packages such as Collections in the package manager, don't forget to update them too
packages that were manually added in package manager don't automatically get updated even if they are a dependency

gentle osprey
#

I see, thanks @hollow sorrel I'll give that a try :)

vagrant surge
#

currently loading

#

lets see how broken it is

#

couse racer was really broken

#

atrocious performance

#

50 ms/frame

hollow sorrel
#

ooof

vagrant surge
#

lets try the stuff they say on the git

#

10/10

#

project is now bricked LMAO

magic frigate
#

The question here is: Will Unity support this sample and improve/maintain it or are we just kind of getting it as is like other samples?

#

I remember them mentioning the added fps netcode pieces are going to become parts of the netcode package later?

vagrant surge
#

as usual

#

no

#

they abandon all the samples and demos pretty quickly

magic frigate
#

I'm still not entirely aware as to why we need to have burst compile every time we hit play

#

Surely this can get saved for later... somehow?

remote coyote
#

I'm so hyped right now

magic frigate
#

Getting 55 fps on my i7 7700k... Time to check the graph

remote coyote
#

Performance isn't great in editor (even with all the safety checks turned off for burst/jobs), but still great to finally get access to the code.

magic frigate
#

Someone set up a server so we can test it out

vagrant surge
#

performance improved after removing some of the checks and stuff

#

still 5 ms on client-only

#

on the game code btw, not renderer

#

thats.... very sad

#

ServerFixedUpdate goes at almost 3 ms

#

which is a massive rolflmao given there is literally only 1 character

magic frigate
#

Does it handle many characters at once well?

vagrant surge
#

havent tried

#

20 thin-bots

#

80 ms

magic frigate
#

woof

vagrant surge
#

the thin bots are headless full clients tho

#

but still

#

local client takes 12 ms

#

server tick takes 8 ms

#

code is also significantly harder to follow than the Tiny demo

#

i understand its beta and stuff, but being slower than UE4 ShooterGame is actually some true award

#

its really not easy to be slower than that

#

lets see how it improves over time

magic frigate
#

I'll never forget Ark: Survival Evolved for literally just building directly off of Shootergame.exe. That was funny when I noticed the process name

vagrant surge
#

pubg is shootergame

#

so is Conan

#

and a lot of games

magic frigate
#

If it works, it works I guess

vagrant surge
#

main difference is that those devs actually give a shit

#

ark devs dont

#

which is why they didnt even bother changing project name

magic frigate
#

I'm assuming those mentioned at least changed the project name lol* ah

vagrant surge
#

those projects rename shootergame

#

so they rename all ShooterX, to WhateverX. like ShooterCharacter to WhateverCharacter

#

and then heavily modify it

#

honestly, stuff like pubg being on top of shootergame makes sense

#

it is a shooter

#

conan or ark really doesnt

#

but some teams have even "abstracted" and modularized shootergame

#

so they start a new project with only part of shootergame

#

they dont grab the weapon or chatacter stuff, but they do grab the online and menus and loading screen stuff

#

shootergame is designed to have savegames, achievements, friend lists, in all platforms. It also passes release QA on ALL consoles

magic frigate
#

I was honestly hoping I could shamelessly build off of this DOTS sample for my own stuff but now I'm not so sure

vagrant surge
#

seems a bit too complicated for that

#

at least from quick browsing

magic frigate
#

Their character movement controller does not handle edges that well so far

dull copper
#

@magic frigate as for burst recompile, they said some months ago that they will cache that stuff but I don't think it's in yet

#

also as to what comes to DOTS sample perf, it's not great and Unity clearly knows this as they mentioned that on the readme even

remote coyote
#

A bit weird they'd release their biggest DOTS project, performance by default, and it doesn't have performance by default. But oh well πŸ™‚

magic frigate
#

Lots of stuff missing burst compilation I guess

#

Going to try out built game perf

#

Has anyone got a built game working? Looks like level_00 doesn't exist for creating a game and "connect" doesn't do anything on the main menu

hollow sorrel
#

getting same results as 0lento, ~17ms (no safety checks) with editor attaching, ~12ms without editor attaching

#

still not great but damn

#

never realized editor attaching could be so heavy

safe lintel
#

this sample seems extra unorganized, like prefabs and scripts everywhere, hard to get my bearings with whats what

hollow sorrel
#

maybe they did it on purpose to simulate average indie dev's project structure πŸ‘€

#

only thing missing is a bunch of asset store assets in the root folder

safe lintel
#

and I thought I had a few heavy entities in my project

magic frigate
#

Getting stuck on Calculate Custom Dependency Data here

vagrant surge
#

@safe lintel well its a Player

#

and a lot of those are tags

magic frigate
#

You don't need the windows Il2cpp module for this, do you?

safe lintel
#

@vagrant surge doesnt that show the chunk utilization as a max of 4 per chunk?

vagrant surge
#

ok thats heavy

#

if the max really is 4

#

that means the thing is like 16 / 4 kb ?

#

so somewhere around 3 kbs, giving some space to metadata

#

thats heavy for an entity

#

but im 100% sure that unreal engine Character is MUCH heavier

#

AActor alone is 1.5 kb

magic frigate
#

Yeah, even being really flippant with components it's pretty hard to be worse than crazy OOP god classes

safe lintel
#

yeah id assume a aaa game might have way more which is why i brought it up, what happenes when you exceed the chunk(i know you could split up your entities but still)?

vagrant surge
#

you cant

#

errors out

#

btw, its not 16 kb, its a bit less, as those 16kb contain a bit of metadata

#

not much tho

magic frigate
#

versioning stuff?

vagrant surge
#

yup

#

versioning stuff, plus things like pointer to its archetype, and the amount of entities its holding

magic frigate
#

Ah, my mistake with the build was going through the default ctrl+b

#

The buildsettings folder has the new build stuff

safe lintel
magic frigate
#

In non-livelink everything appears to be behaving correctly

#

currently have a server and a client exe joined

#

Getting 100 fps at 1440p with everything except Vsync on. Running a 2070 and an i7 7700k

#

Firing while leaving sprinting seems to have a "buildup" of a couple of shots that come out faster than intended

#

Non DOTS related but I'm impressed with their TAA. No ghosting that I can see

dull copper
#

that sample levels are super easy on ghosting

#

UE4's TAA can handle that kind of geometry just fine as well

#

but throw in some more difficult things and that breaks super bad

#

like any TAA, put noisy textures and big contrast between materials

#

and it'll ghost super bad

viral sonnet
#

uff that dots network sample structure

#

similar to fpssample which was ... yeah

magic frigate
#

Ideally a lot of this will be moved into a package (I hope)

viral sonnet
#

the entity debugger doesn't even catch most relevant systems because they are manually updated.

#

i guess so too that they will be made into packages but it seems really disjointed right now

#

i didn't find any serversimulation groups which were used in the previous netcode sample

left spindle
#

Is there a way to stop systems from running? I'm updating my entities packages and prior to this it seemed that most systems would run as needed, but now all the systems are running when I hit play.

worldly pulsar
#

If you don't do any RequireForUpdate() the system should update only when at least one of the EntityQuery it created matches anything. If you didn't create any queries in that system it should always run.
That is unless they've changed/broken something in 0.4

#

if you want to turn a system off, there is the Enabled property

left spindle
#

I'm updating from an older version I think. I'm going through the "DOTS Training". Let's see, just creating any EntityQuery would fix this, you think?

#

I'm so glad you know what I'm talking about, since I'm stumbling over my words.

worldly pulsar
#

In general systems should only operate on entities, so if no queries match it means there is nothing to do

left spindle
#

Ah, some of these jobs are using "RequireComponentTag" instead of queries, would that be it?

worldly pulsar
#

scheduling an IJobForEach implicitly creates a query

#

same for Entities.ForEach

left spindle
#

This one in particular is IJobForEachWithEntity

worldly pulsar
#

yup, the Schedule method takes a system to create a query

#

All the smart component iterating jobs create queries under the hood

left spindle
#

Then...why are these running? Hmm.

worldly pulsar
#

Because there are entities matching the query?

left spindle
#

I guess that has to be true, so the question becomes: why are there entities matching the query?

#

In the entities debugger the system is being run, but it says "no entity queries in system"

#

Wouldn't that mean that it shouldn't be running?

worldly pulsar
#

If you didn't create any queries in that system it should always run

left spindle
#

I thought that scheduling the job implicitly creates the query.

#

I feel dumb, I'm sorry!

worldly pulsar
#

(No way to tell what's going wrong without the code, but I don't have time for debugging right now, sorry πŸ™‚ )

left spindle
#

Okay, I'll keep trying, thank you.

left spindle
#

Huh. So just MAKING an EntityQuery, not even using it, fixes the problem, it seems.

#

That doesn't make much sense to me, but...okay.

remote coyote
#

Thanks for sharing @magic frigate, good to hear performance improves that much with export. I'll be using TPS Sample as a reference and not as a base though, just the organisation of the project alone is a bit meh. But lots of good code here to learn from.

remote coyote
#

Besides, so much is bound to change and improve on the DOTS Sample the next few months that it would probably be a pain to build on top of it regardless πŸ™‚

#

Btw @magic frigate, did you test with thin clients to see how it scales?

winter veldt
#

@left spindle you can also use Enable = false to stop a system from running, i just put it in create if i'm debugging or something

winter veldt
#

how to i setComponentData for a BlobAssetReference<T> field?

#

is it considered a shared component?

#

nevermind! its early.

solemn ice
#

Any idea how/if I can check if a NativeHashMap has been disposed? IsCreated returns true even after it has been disposed.

trail burrow
#

Anyone check out the dots sample?

ionic holly
#

In Unity DOTS Physics/Havok are you able to manually step/simulate the world like you can with PhysX using Physics.Simulate? I can't find any documentation online that explains how.

left spindle
#

I didn't know you could do that, @winter veldt thanks!

magic frigate
#

@remote coyote no thin client tests yet. Can I use the built game client for that?

hollow sorrel
#

@ionic holly there's an example in the UnityPhysicsSamples project that uses manual stepping for projecting into the future
it's in Demos/6. Use Cases/ImmediateMode

#

steps a clone instead of the original physicsworld but maybe gives a starting point

remote coyote
#

I think so Megafunk, probably a console option to spawn them?

#

Interesting what Ante wrote on the forum. I had noticed they used Run over Schedule a lot... turns out they intentionally want the server to run on a single core for multi-instance per server machine / server cost.

safe lintel
#

interesting, but how does that factor into all the scheduling and stuff?

timber ginkgo
#

Are there any advantages or disadvantages to using controllers vs managers in the DOTS framework?

#

in other words, does the manager style lend itself to dots code structure?

worldly pulsar
#

What are "controllers" and "managers" in this context?

timber ginkgo
#

I mean a very basic distinction: controllers are monobehaviors that attatch to individual objects in order to run functions directly on their own object, whereas a manager approach would collect all objects of a certain kind and run the logic on them from the manager script

#

possibly i have a very primitive conception of the difference, but i have an even mroe primitive understanding of dots so far

#

although i plan to implement it soon, so im wondering about how i should style my code going forward

worldly pulsar
#

I guess the ECS systems are what you call managers

#

DOTS doesn't really use MonoBehaviours

timber ginkgo
#

that's kind of what i intuitively thought about it too... i don't use managers much or at all (not yet anyway) so it's all a bit confusing

#

im used to using mono's everywhere

worldly pulsar
#

there is no direct equivalent to MonoBehaviour in ecs

timber ginkgo
#

so how would collision triggers be handled? (for instance)

worldly pulsar
timber ginkgo
#

ill take another look at the examples, thanks!

magic frigate
#

Still no debug.log in burst, right?

hollow jolt
#

just added entities and havok to a 2020 project and im getting those 2 errors :

Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Scenes.Editor\LiveLink\LiveLinkBuildPipeline.cs(257,61): error CS0117: 'ContentBuildInterface' does not contain a definition for 'GetPlayerObjectIdentifiersInSerializedFile'

Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Scenes.Editor\LiveLink\LiveLinkBuildPipeline.cs(323,37): error CS1579: foreach statement cannot operate on variables of type '?' because '?' does not contain a public instance definition for 'GetEnumerator'

remote coyote
#

Looks like you have some versions mixed up. Not sure havok is updated to 0.4.0 entities yet.

magic frigate
#

Seems like the guys at Havok get entities packages the same time we do lol

dull copper
#

havok has been quite broken all the time tho

#

even if you get it running, it might not work at all in the actual build

#

last time I checked, HDRP rendered one pixel color full screen when havok package was only installed (not even used)

trail burrow
#

@dull copper :(

hollow jolt
#

thanks, will be waiting for next version

trail burrow
#

does burst support fixed layout now?

stable fog
#

Have yall been playing with the FPS sample?

trail burrow
#

@stable fog you mean FPS Sample or DOTS Sample?

stable fog
#

DOTS Sample

#

its an FPS right?

trail burrow
#

both tps and fps i think

stable fog
#

I'm curious how good it is

trail burrow
#

Okey I have only dont data processing in ECS/DOTS, since like... forever

#

I know the way you render changed at some point

#
  1. what packages do i need
  2. what components do i need
#

to render something

#

right its the hybrid renderer

#

rendermeshcomponent or w/e it was called is gone right?

#

figured it out

stable fog
#

lol topher, I was speaking in terms of design, readability, modability, etc.

trail burrow
#

@stable fog honestly... it's like 2/10 =/

#

the code is a mess, it's hardly readable or easy to understand

stable fog
#

😦

vagrant surge
#

@trail burrow its still a total disaster

trail burrow
#

@vagrant surge the dots sample? yes

vagrant surge
#

both dots sample (tps) and tiny sample are kinda broken in editor

trail burrow
#

disregard if it doesnt work/etc

vagrant surge
#

tiny being extremelly broken, dots sample being somehow spectacularly slow

trail burrow
#

have you checked the code?

vagrant surge
#

yes

trail burrow
#

it's... eh

vagrant surge
#

noped out of there real fast

trail burrow
#

i don't have words

#

lol

vagrant surge
#

Tiny racer code is the opposite

#

its a folder of systems, one system per file, everything super simple

trail burrow
#

this is their 'prime' sample on how to use dots? like the pinacle of dots made by the people that made dots?

#

this is what they put out?

#

...

#

it's like..

vagrant surge
#

looks like they reused a lot of the code of the FPS sample

#

what it looks to me

#

is prototype code

trail burrow
#

if you guys cant do better, how the fuck do you expect the users to do better

vagrant surge
#

it looks similar to when im working on prototype stuff

#

and just doing stuff semi-randomly

#

without much regard

trail burrow
#

@digital scarab You can't argue that the code in the dots sample is good dude

vagrant surge
#

nothing wrong with prototype-y code, but if its a sample people are supposed to use as base....

trail burrow
#

It's a mish-mash of copy pasted stuff from the fps sample

#

Full of comments about broken stuff, hacks, workarounds, etc.

#

Then it shouldn't be put out as a 'dots sample'

#

This is more like 'dots testbed we use internally'

#

which... fine, sure

#

Well, naming something 'dots sample' implies that it's a sample ... to see how things should be done (in dots) ?

stable fog
#

is the aim here to demonstrate that Unity has a functional solution thats kinda still shit to work with but hunting for feedback?

#

Not trying to shame, honestly getting perspective

trail burrow
#

Look, don't get me wrong

#

the whole DOTS stack is cool

#

Idk, i suppose people (me included) just expected more, than a code dump of some internal test repo

stable fog
#

its been exceedingly difficult to get into DOTS workflow

trail burrow
#

Because it was explained as a 'DOTS Sample' ? Nobody said 'DOTS Code dump of our internal test repo'

stable fog
#

the best documentation is outside of Unity Technologies

trail burrow
#

Those two things convey vastly different expectations

#

it's not stable btw

#

πŸ˜›

stable fog
#

No Project survives its first collision with a user

trail burrow
#

I'm not blaming you personally...

#

Yes the name is wrong, because it conveys something different than what this is.

#

Sure, that's great. I think people (me included) are fed up with the state of the engine over the past two years, there's too many bugs, too hard of a push on the marketing side in relation to DOTS while it's not ready for use, etc.

#

People in there sum up what i mean in longer posts than discord is suitable for

#

@digital scarab So over the previous 2 years, it hasn't been a supported part of the product? (i.e. classic system)

#

I get it's not your decision, you're a programmer. But literally anyone that have been in the tech industry for more than a year could tell that replacing: core engine loop, physics, rendering, input, networking, etc. all at once... isnt a good idea lol

#

Right now it's a mish-mash of preview packages where you have to balance the specific versions of each package on a razors edge to get something usable and somewhat crash free

#

if you want to use the new stuff

#

or you can use 'classic', and be left with bugs unfixed for 2+ years

#

Also how the last two unites were basically DOTS DOTS DOTS, and then people try to use it, and its not ready, just leaves a sour taste.

#

Yes we all know... preview/not done/etc.

#

But that's not what's being sold on stage at Unites

#

Again, not your fault.

#

It's just getting a bit... sigh... unity fucking up and releasing unstable shit again (that's the general 'feeling' i get, talking to a lot of our customers)

#

Because of old bugs unfixed and new stuff unstable, everything is buggy and unstable...

#

Yeah, hopefully πŸ™‚

#

A lot of people still prefer that way of building, because they don't need the perf that ECS gives. And can use Jobs/Burst for small subsections that need the perf.

stable fog
#

I do love where ECS/DOTS is going, and it looks particularly great

#

but I've been waiting for it to be "done" for quite some time

#

I personally don't mind waiting, but this is a hobby for me

vagrant surge
#

i use unreal

#

just keeping an eye on this cool stuff

stable fog
#

hiss

#

HEy Topher, maybe you can answer a question for me

#

no one else has been able to so far

trail burrow
#

@digital scarab Yeah maybe.. idk, I am just not convinced that this DOD-focused ECS that unity has is actually proven to work for large complex games with a lot of intricate game logic, etc.

stable fog
#

I'm working with people on jobifying the navigation baking system for Risk of Rain 2, (Disclaimer: Ghor/Hopoo know what we are doing and are even trying to get some code to us in a way that doesn't put them in a legally difficult situation)

#

The Jobified system is faster, but I want to try to burst compile it

#

While we can hook in most code through Harmony and load plenty of custom code for mods, It isn't clear to me if it would be possible with Burst

#

it seems like Burst requires I build a player and include extra libraries

trail burrow
#

Correct you can not load burst code from outside atm

stable fog
#

:*(

trail burrow
#

It needs to be built into the player

#

(for now at least)

stable fog
#

I guess I'll just have to convince them to add the custom code to the game from their side :p

trail burrow
#

I'm building a deterministic 2d physics engine for ecs over christmas , little side project

stable fog
#

you used to be on afternet didn't you

trail burrow
#

no

#

I used to hang on #unity3d on freenode tho

#

like a decade ago

stable fog
#

oh right

#

yeah, hi, ltns :p

trail burrow
#

@digital scarab I basically only do deterministic stuff now a days, just no other way to sync as much stuff as we push into our own ECS either over the network

#

Want to try to build an RTS inside of ECS basically, figured i'd start with the physics engine and flow field navigation over holidays

vagrant surge
#

ive done more prototypes using my own self-built unity style ECS than unity own ECS XD

#

ill now check it out as Tiny lets me do some basic pure stuff

#

@digital scarab not if you split the entities accordingly

#

for an RTS i would have the "visual" unit as a separated entitity

trail burrow
#

@digital scarab one of the drawbacks of archetype ECSes, i'm partial to sparse set ECS myself... but maybe that's cos its what we use πŸ˜›

vagrant surge
#

@trail burrow entt style?

trail burrow
#

@vagrant surge yes

#

@digital scarab also i'd probably not do all the state chnages as components, but probably flags on components, etc.

#

not put each state in one component

vagrant surge
#

how? as a enum-component type thing?

#

for my own C++ ecs i was thinking a compressed enum like that, with option to allocate maybe 3 bits per entity

trail burrow
#

i mean again, i literally built our own ecs (sparse set style) and our own job system, so i'm as knee deep as unity is on this dod/threading thing

vagrant surge
#

and then its holding a bitfield

trail burrow
#

so don't get me wrong

#

I am hopeful for the future... just the current state of Unity is... EXHAUSTING

stable fog
#

so there was something I found a little confusing about ecs

#

for something like character AI, the idea is to add a component for a behavior and then a system initiates that behavor, so you'd add a "Seek target" component, then the system runs and when it finds a target it removes the component and adds an "attack target" component?

trail burrow
#

i'd say, no.

#

so there is one thing people seem to get wrong

stable fog
#

and so really you're adding/remove components constantly?

trail burrow
#

about 'ecs' atm

#

is that they try to put EVERYTHING into a component somehow

stable fog
#

Okay cool, I thought that was the intent and It really rubbed me the wrong way

trail burrow
#

there is nothing wrong with having a structure for your AI graph in another format

vagrant surge
#

in unity model, adding/removing components is relatively expensive + fragmentation. But on the other side then matching on those is crazy efficient

trail burrow
#

and then have a component which links your entity with a specific AI graph

vagrant surge
#

oh yeah that for sure

trail burrow
#

i see on forums

vagrant surge
#

the unity ecs sucks at "random" access

#

it really does

trail burrow
#

people trying to build

#

like

vagrant surge
#

and its unsolvable

trail burrow
#

quad trees

#

out of components

#

and entities

#

like wtf

stable fog
#

blame Code Monkey for that

trail burrow
#

people seem to think everything has to be made into an entity<>component

vagrant surge
#

yeah thats a big mistake

stable fog
#

One of the examples he uses is to break up the world space by applying a position component which puts the Entities into a grid set

vagrant surge
#

i think thats something that the data-oriented book explains very well

stable fog
#

so you can query Grid(1,1) to get all entities in it and check for them

vagrant surge
#

not everything goes into tables, and not all tables are the same. You select the one best for your approach

trail burrow
#

@vagrant surge god i have such mixed feelings about that book lol

stable fog
#

which saves on queries

vagrant surge
#

@trail burrow how so? i really like it

stable fog
#

but then people take it to the nth

vagrant surge
#

even if its a bit too extreme, but thats the fun part

trail burrow
#

i have read it... and the guy is just so heavy handed in his OOP bashing, etc.

#

yes if OOP = gameobject/monob type architecture

#

then yes OOP = bad-ish generally

#

but that's... well

vagrant surge
#

@stable fog thats not a good idea

#

causes too much fragmentation

#

you might want to do that for stuff like zones

#

or BIG tiles

#

in those case, sure

stable fog
#

hey, talk to the Code Monkey guy, not me :p

vagrant surge
#

but the "query by vector" is better done in good ol multi-hashmap

stable fog
#

All I want to do is use Jobs for a parametric modeling system I've made

vagrant surge
#

btw, what is the implementation of the DOTS hashmaps?

#

i havent looked into it

stable fog
#

the fact that I wont be able to use burst for my first actual implementation makes me a bit sad

vagrant surge
#

are they the pointery kind, or the flat kind

trail burrow
#

@vagrant surge ehm idk if there's a 'pattern'

#

it's their own multi threaded concurrent hashmap

#

its good because it's concurrent, it's slow as shit if you want to use it single threaded

#

or well i havent checked that in a few months to maybe it changed

vagrant surge
#

yeah, but that multithreaded one, how is it implemented?

stable fog
#

@digital scarab is there any goal to make that situation I'm dealing with possible?

trail burrow
#

@vagrant surge i dont remember details

#

have not looked at

#

it... in 5-6 months

vagrant surge
#

@stable fog they were talking about some DOTS based mesh api for 2020

#

that got just released

#

you looked into that?

stable fog
#

sorry not talking about my parametric stuff

#

talking about adding in some burst compilable code into an already built game

#

Its probably exceedingly unlikely

#

and really, its kinda irrelevant

trail burrow
#

@digital scarab Hey... is there a way to have a concurrent list ? I know there didnt used to be (had to do it by hand with an oversize array + interlocks)

#

Has anything been added recently that can fulfil that job? basically concurrent list

vagrant surge
#

@trail burrow im not him, but i implemented my own for my ecs experiments by abusing the way chunks are executed

trail burrow
#

yeah i know the trick you can do with IJobChunk

#

and the start indices, etc.

#

but it doesnt help me in this case

#

i have a N:M relationship here

vagrant surge
#

my problem was to copy data from ECS into a flat array, 1 unit per entity. I then allocated an array with the sizes from the chunks, and atomically added +N where n is entities inside chunk when copying...

trail burrow
#

N entities need to output M things each, into separate collections

vagrant surge
#

uhm... siht

#

what about doing multiple jobs

#

and each has its own array

#

so you create 4 jobs (for 4 cores), and each one has one array

trail burrow
#

N entities, they each create 1-M things, which all go into 1-M collections

vagrant surge
#

then you merge them

#

then you have 4 copies of the collections, and then merge

trail burrow
#

yes, thats an option but the work i need to do to create these 1-M things is reasonably heavy

#

so redoing it on each job

#

isn't a good solution

vagrant surge
#

so merging them is not a good option

#

what about keeping them as separated?

trail burrow
#

i'll just use interlocked

vagrant surge
#

4 data structures

trail burrow
#

burst supports that right?

vagrant surge
#

i dunno

trail burrow
#

just need Interlocked.Increment atomic

vagrant surge
#

yeah but thats slow

#

in fact, some guy with a 32 core threadripper ran my big ecs simulation

trail burrow
#

i have a 32 core TR πŸ˜›

vagrant surge
#

and the system that did the copy-into-array that interlocked once per chunk

#

so adding +200 or so at a time to the array

#

and it bottlenecked hard

trail burrow
#

interlocking becomes expensive when you have 32 cores competing for the same location yes lol

vagrant surge
#

32 cores and was slower than running on 8

trail burrow
#

i've ran into the same issue in several places in our own stuff

vagrant surge
#

memory sharing is a bitch

trail burrow
#

now luckily, most of the gamers still use 4 core CPUs, so can still get away with interlock :p

#

and dont have to get too clever

vagrant surge
#

i was thinking of doing that whole multi-array thing on my simulation

#

its for boids. I create a list with morton-ids of each entity, and then use binary search there for acceleration

trail burrow
#

i tested that for another thing, on my 4 core / 8 thread 6700k the interlock wins, on my thread ripper the multi-array-copy-join-together wins

vagrant surge
#

atomics in the threadripper probably are crzy slow

#

given the separated dies

#

btw, is your threadripper the old one, or new one

trail burrow
#

2-series

#

sadly

#

:p

vagrant surge
#

so old one

#

even worse then

trail burrow
#

yes

vagrant surge
#

this guy tested on one of the new ones

trail burrow
#

ah

vagrant surge
#

even in those the interlocked was slow

#

tho im not so sure how much was the interlocking, vs the cores all copying memory to the same locations

trail burrow
#

Β―_(ツ)_/Β―

#

i kind of just left it where it was because interlocks is fast enough for all target devices

#

wait isn't native stream supposed to do this

#

oh right... i dont have access to the whole buffer at once then

#

sigh

#

hmm how do i get the current worker thread count

#

from the job system

#

i know you can now a days

#

@digital scarab but you can change the thread count

#

somehow

#

means you should be able to read it?

#

i mean i'll just use int ThreadCount { get { return System.Environment.ProcessorCount; } } for now

#

oh

#

πŸ™‚ ah, sorry!

#

my mind already moved on πŸ˜„

#

@digital scarab perfect, thanks

trail burrow
#

@digital scarab If you are around...

#

Why am i getting really high values

#

for the thread index ?

#

      [NativeSetThreadIndex]
      int ThreadIndex;
#

i'll get like 66, 64, 65, etc.

#

which is higher than my thread count (32)

#

so this how it always worked apparently

#

well this fucks me

ionic holly
#

Currently Unity Physics doesn't support motors on hinge joints like PhysX. Anyone know if this might be supported in the future, or how I might be able to achieve the same result?

safe lintel
#

what do you mean motors on hinge joints?

ionic holly
#

Are you familiar how motors worked in PhysX?

safe lintel
#

nope

ionic holly
#

On a hinge joint you could enable a motor, give it a force and a target velocity, and the physics engine would perform the calculations needed to keep the joint at that velocity with the given force

#

So setting the targetVelocity to 0 would lock it in position with resistance

safe lintel
#

ah interesting

ionic holly
#

Right now i have a hinge joint connecting a parent object to a child, but when the parent object has motion, the child object moves because it starts to be pulled behind it

#

I basically need my child object to stay in the same orientation regardless of how the parent object is moving

#

A fixed joint will do that, but i need the child object to be moveable via code when I want it to

#

This all has to be done with proper physics so that collisions behave as expected

safe lintel
#

i would say pester them on the dots physics forum, get your voice heard πŸ™‚

ionic holly
#

I will try, but I'd also like to know if the behavior I'm after is achievable in a different way

dull copper
magic frigate
#

But is it as efficient as the original Pong game? πŸ˜›

#

Just kidding, I hope they show it running collision/movement on 40000 pong balls

stable fog
#

the original pong game was hard wired wasn't it

viral sonnet
#

good lord i have the weirdest error. in build mode the collider of one of my enemy disappears but not on every build. it's a coin flip if it works. shit's crazy -.-

#

that's with default physics collider. anyone else had that kind of instability?

viral sonnet
#

turns out my rigidbody is pushing some enemies through the floor in a build. this is so weird it's not happening in the editor

dire frigate
#

Does compiling burst to Linux require you to be on linux? Swear it was fine just before, switch to 2019.2.15f and suddenly it's saying clang is missing from /usr/home/clang

#

Can compile to windows just not linux

dull copper
#

@dire frigate not currently, no

#

upcoming Burst 1.3 will have cross-platform compilation for some platforms (including Linux)

dire frigate
#

Worked just fine before, ticked all the right boxes with 2019 Visual Studio and were able to compile to linux πŸ€·β€β™€οΈ Doing so now resolves to an error saying:

BuildFailedException: Burst compiler (1.1.2) failed running

stdout:
Burst requires gcc/clang toolchains to be correctly installed in order to build a standalone player for Linux with X64_SSE4
Unable to find /usr/bin/clang or /usr/bin/gcc, is the gcc/clang toolchain installed?
stderr:
dull copper
#

I very much doubt it worked like that with burst

#

without burst, yes

dire frigate
#

Was able to compile my headless server and just upload it to linux via ftp

dull copper
#

yes, but did you actually have burst compilation enabled then?

#

you can do crossplatform builds for mono

dire frigate
#

On assets yes, I don't use it myself currently in the project

dull copper
#

but not for burst or il2cpp

amber flicker
#

Question about generics. If I want to have e.g. CDFE<T> bob where T : IComponentData, let's say I make a concrete class where T is Unity.Transforms.Translation. I can't access bob[entity].Value as IComponentData doesn't specify Value. Am I right in thinking this is just a no-go? Obviously wouldn't want to have to add an additional custom component that wraps each one and wouldn't want to use reflection at runtime.

untold night
#

there's a way to register closed generic types... let me look it up real quick

#

systems with closed generics have to be manually setup, they won't be auto-registered. You can circumvent this by subclassing them with a concrete type:

public class MySystem : MyGenericSystem<Translation> { ... }

worldly pulsar
#

@amber flicker In the concrete class you should be able to access bob[entity].Value if T is known to be Translation

#

in the generic class you obviously can't because you don't know what T is

amber flicker
#

Thanks both. I guess I’ll continue to rely heavily on code generation πŸ‘

trail burrow
#

I unsafe stream usable for many readers/writers at once?

#

Or one reader/writer ?

#

A deterministic data streaming supporting parallel reading and parallel writing. Allows you to write different types or arrays into a single stream.

#

This doesnt specify if its a single producer/consumer, or multi producers/consumers

trail burrow
#

This is in BUILD, With all safety off.

#

And it just will not utilize all workers

#

And the scheduling seems way off

trail burrow
#

crickets

magic frigate
#

Naive guess: it only scheduled 4 jobs?

#

Oh, but there is still one on that gap

trail burrow
#

@magic frigate no

serene thistle
#

ugh. Really struggling to pick up dots. Not even sure if what I'm trying to do is possible.

I'm streaming topography and map data into my scene. I make some GET requests to get the data, parse it, then manually build meshes based on some rules for the buildings and roads. For the topography, I'm creating terrains in code, calculating and setting their heighmaps on the fly. All of this is happening in chunks. IE player goes to a new area, the requests/parsing/building are made only for the chunks that are missing.

Now currently, since everything is on the main thread, every time data needs to be downloaded or parsed, the game freezes. I'd like to offload as much of the chunk logic to other threads as possible. No ECS is being used at the moment for any of this.

Anyone have any insights into what if anything I would gain by trying to use DOTS for some of this? And in general, how would you structure things? Maybe I should just use native c# jobs?

#

I've been reading docs and looking at various resources/examples/etc but shits just too confusing still.

For example, I don't think I need to convert my player to use ECS in any way. But I do need to get the information on the players position, so I know what chunks to load. Not entirely sure how to do that. If I make a component that contains the players position data, how would I update the data as the player moves around?

For loading in the terrain, I have a regular c# class to make a HTTP request for the data (would love for it to be threaded), then a service class to convert it to a heightmap (again would love if this was threaded), then finally a monobehaviour that instantiates an empty game object, adds a terrain component, sets the heighmap. How would that workflow look like with ECS? What are the individual components/systems that I would split it into? Really struggling to wrap my head around it.

worldly pulsar
#

Have you measured which parts are actually taking the time? I'm willing to bet that figuring out which chunks to show and sending the http request are a non issue and can easly stay on the main thread.
Conversion to heightmap definately (and probably pretty easly) can be jobified, depending on the source data format. That is assuming you can't just send heightmap data ready-to-use from the server.

#

Can't really give much more advice without knowing the actual data/timings you are working with

viral sonnet
#

@serene thistle Have you tried downloading in a coroutine and yielding?

serene thistle
#

The http request takes a few seconds to complete. Downloads can be anywhere between 5 and 20mb, and so will take longer on slower connections.

Server is not mine, so I have to do all conversions on my end. Besides the download, this is what takes the most time. There are a lot more conversions for buildings/roads, but I want to start with the terrain heightmap, for simplicity.

Each terrain chunk takes about 0.2 of a second. Building/Road information takes about 0.5 of a second. I tend to have to load in 2 chunks at a time with my current draw distance, but I'd like to increase that and load in something like 10 at a time. So the 1 or 2 second stutter is noticeable right now, it will be worse if I try to do what I really want.

Coroutines still happen on the main thread. Yielding might make it less noticeable for the user, but it slows down all my calculations, as its just interrupting things, instead of doing them concurrently.

worldly pulsar
#

Wait, you are blocking the main thread while waiting for the http request to complete?

#

You definately want the downloads to be async, jobs are not really a good answer here

serene thistle
#

Would jobs not have it executing on a separate thread?

#

Thing is, I cache the data. And the download is often larger than any particular chunk. So for most chunks, they grab it from the cache. Only when they can't find it, is when a download triggers.

worldly pulsar
#

downloading stuff has very little cpu overhead, it's mostly waiting for the network that makes it slow

serene thistle
#

So how would that work? Try to get data, trigger an async download and then check every once in a while if the data is there? I'd have to track what's already in the process of being downloaded :/

void ravine
#

You can do multthreaded downloads without the job systhem but i do not see areasone against (am not profissiond egnoth in jobs)

worldly pulsar
#

and with the restrictions on jobified code, making a job that runs an http request is really hard

serene thistle
#

I see. OK so work on async downloading. Gotcha.

#

But that was always a secondary concern. The data crunching from the raw download to the format I need is what I really wanted to jobify anyway

worldly pulsar
#

if your download is something like xml DOTS won't help you much right now

#

I've assumed you control the data you send

#

but parsing json/xml is also really annoying right now

serene thistle
#

Terrain is a binary file, buildings/roads are xml.

hollow sorrel
#

he could prob jobify the parsing

#

are you using openstreetmap

serene thistle
#

Yes

#

And NASA's SRTM

worldly pulsar
#

is there a way to jobify xml parsing without writing your own parser now?

hollow sorrel
#

i did basically same thing as you a couple years ago minus heightmaps and used a seperate thread (regular C#) for parsing, jobs didn't exist back then tho

#

and mesh creation used a lot of unity api's so i used coroutines for that, but i think they made a lot of that thread safe now too

serene thistle
#

Is xml parsing annoying because string isn't a bittable type?

worldly pulsar
#

Oh yea, offloading the whole thing to another C# thread and only doing the heightmap assign totally makes sense

hollow sorrel
#

for the http part there's multiple ways but using UnityWebRequest + coroutines is imo easiest

worldly pulsar
#

@serene thistle that's one reason, another is that any off the shelf xml parser you'll find is not compatible with the job system

#

what's why I said DOTS won't help you much

hollow sorrel
#

ah yea true

serene thistle
#

Im just using the c# library to read it. I wrote the actual parsing myself.

worldly pulsar
#

umm where do you draw the line between "read it" and parsing? πŸ™‚

#

because to jobify it you'd have to operate on raw strings (as NativeArray<byte>)

#

and that's not fun

serene thistle
#

Ah shit. Yeah

worldly pulsar
#

So in your case I'd use WebRequest to start async download, when that's done grab a thread from the ThreadPool to parse it, prepare the heightmap etc, and when that's done on the main thread assign the heightmap to the terrain. I don't see much benefit in pushing dots in there

hollow sorrel
#

i agree with the above

#

btw is there any reason why RenderMesh could be not chunking properly? it's creating a seperate chunk for each entity even though .GetHashCode() is exactly identical

serene thistle
#

Thanks guys, I'll give it a go and let you know the results πŸ‘Œ

worldly pulsar
#

No clue, I just accepted that shared components don't do what I want them to and avoid like fire :P
I really hope at some point they'll provide a different component/mechanism for rendering

hollow sorrel
#

hmm it seems to happen when i add my built mesh
but the mesh is the same ref for every instance, i only make it once

#

and yea i agree

#

at least for low-count/unique entities that only show up once in your game

#

i think games tend to have a lot of those

#

but they still take up an entire 16kb chunk

worldly pulsar
#

when starting the game I have 271 entities in 98 chunks, and the vast majority of those are 1 entity per chunk

hollow sorrel
#

sounds about right

worldly pulsar
#

Lol, I have a chunk with 33 entities that only have transforms (husks of GameObjects I use as reference points and just read their position at conversion time), never queried

#

and then a bunch of texts in the same chunk because i store the text meshes somewhere else

#

I mean it's 1.5 MB of mostly wasted space, so it's in the who-cares range

#

and if you scale up to 10k entities you probably have a lot of duplicate meshes

hollow sorrel
#

yea true

chilly bobcat
#

Is there a way that I could schedule a generic job, basically IJobParallelFor myJob = new MyJob() {...};

#

and then do myJob.Schedule(...);

#

Schedule<T>() requires a non-nullable type T, so I would assume no?

#

Actually I think I figured it out, I used IJobParallelForExtensions.Schedule<MyJob>(myJob, ...)

trail burrow
#

@chilly bobcat it needs to know the static type of the job

#

To be able to copy the memory needed to native side

worldly pulsar
#

@chilly bobcat If you know the type of MyJob why are you boxing it into an IJobParallelFor?

chilly bobcat
#

because I want to be able to create a density grid in many ways

#

one would be a ProceduralTerrainDensityJob

#

other maybe HeightmapDensityJob

#

they create the same thing with different outcomes, but in different ways

#

idk if that makes sense

worldly pulsar
#

but you said IJobParallelForExtensions.Schedule<MyJob>(myJob, ...) works for you, and you specify MyJob there

chilly bobcat
#

yes that was just an example

#

this is a quick hack, but I'll just create a few if statements with different Job types

trail burrow
#

The job system must know the concrete and fully qualified type of the job when its being scheduled

surreal grail
#

Heyo! So I have this performance problem when I write to a NativeArray of a struct (in a loop so it writes all 8420 of the elements) , and this costs about 100ΞΌ seconds to do, and this is the most expensive part of the operation it seems like, is there a way to avoid this? I don't actually need the whole whole struct changed, just 1-2 values of it changed, should I not use structs and just use separate arrays for separate values? or is there a way to change just one variable of a struct while it being stored in an array? so is there like a way to get the memory index of it and write there?

dusty scarab
#

Hey I'm trying to build the megacity demo for android but as soon as I switch platforms I get a bunch of errors and warnings essentially stating that nothing will render

trail burrow
#

@surreal grail depends on how big the struct is ofc, its just a memcpy essentially

#

@surreal grail and yes you an do that, you can get the pointer to the internal elements and work over that instead

surreal grail
#

@trail burrow okay, thank you! :)

dire frigate
#

Did unity specify anything about all their current physics components if they're gonna be using their own physics solution or are they gonna be relying on physx still?

#

Wondering of the non dots component are ever gonna become multithreaded

#

Or utilized in a multithreaded environment

trail burrow
#

@dire frigate physx already is multi-threaded

serene thistle
#

So I am manually constructing a bunch of meshes and instantiating game objects with those meshes. And unity doesn't like it when I do like 20k for 4-5 update loops in a row. Like it freezes for a few seconds. I'd like it to be smoother. Am I understanding correctly that DOTS can solve this problem for me?

dire frigate
#

More so want to interact with the character controller via dots πŸ˜„

#

Was hoping that they would just change the underlying system to theirs so that there's a dots character controller

#

Whereas creating your own kinematic one is quite some work to do

zenith wyvern
#

There is a dots character controller, they use it in the Dots Sample

dire frigate
#

Could you link it? Would love to dive into it

zenith wyvern
dire frigate
#

Thank you Sark πŸ˜„

#

Oh that's quite nice, not nearly as bloated as the other examples awesome

surreal grail
#

@serene thistle I believe yes, burst compiler in itself is huge for performance, I tested it a bit, the performance gain can be 2x up to the 100x-s or even thousands, depends on the situation. Btw if you don't want to use DOTS for everything, you can store GameObjects in Lists and enable them when they are needed (basically an ObjectPool)

trail burrow
#

@surreal grail that just isn't true, enabling/disabling burst is not going to increase performance 100x or 1000x fold

#

at best burst will give you linear scaling with how wide your SIMD registers are

serene thistle
#

@surreal grail my issue is that all the game objects are unique and created on the fly. Pooling won't really help

trail burrow
#

@serene thistle DOTS is very bad at dealing with high amounts of unique objects atm (in terms of meshes or components on them etc)

serene thistle
#

well shit

#

literally none of my objects meshes repeat lmao

zenith wyvern
#

The best you could do is combine the meshes. If that's not possible your best bet is to spread the spawning over time I think

serene thistle
#

Combining is possible to an extent. Will try that. Thanks!

trail burrow
#

@serene thistle if you are doing unique meshes, DOTS will atm allocate 16kb per entity per unique mesh

zenith wyvern
#

You can work with nativearrays in jobs so you can do all your work in another thread. Try to do whatever you can off the main thread until you need to call Mesh.SetWhatever

trail burrow
#

so for ur case it'd be 16kb x 20k

#

when i say its not good for drawing a lot of unique meshes

#

i mean... REALLY not good

#

lol

serene thistle
#

All the other code is already off the main thread. It's literally the instantiations.

zenith wyvern
#

Then yeah I don't think dots is any help at all really. Like FHolm said the hybrid renderer is shit for any kind of instanced data atm

serene thistle
#

0 for 2 on "can DOTS solve this problem I have?" for me πŸ˜„ Thanks guys

zenith wyvern
#

Mesh combining should make a huge difference though if you're stuck with gameobjects

serene thistle
#

gonna have to actually be smart

trail burrow
#

@zenith wyvern the rendering situation and shared component shit

#

really was not though thru properly

zenith wyvern
#

It sounds like they're working on it at least

surreal grail
#

@serene thistle what are you actually trying to do btw? why do you need so many unique meshes?

serene thistle
#

Loading in real world buildings from map data 😁 Think shitty google earth in your unity scene

#

You'd think buildings are just boxes. Turns out, very few of them are actually boxes.

trail burrow
#

lol πŸ˜„

#

nice out of context quote πŸ˜„

#

sounds like something from the hitchhikers guide to the galaxy

serene thistle
#

πŸ˜„ I try

trail burrow
#

A+ quote

surreal grail
#

@serene thistle hmm and what if you used some kind of LOD system where far away buildings are just part of a heightmap? or is that not an option in your situation?

serene thistle
#

Does not even come up. I'm loading the data in chunks, each chunk is 256m^2. That area usually contains anywhere between 0 and ~2000 buildings. Each wall for a building is constructed separately, a building will have a minimum of 4. As the player moves around, I may need to load in 4-8 chunks at a time. Hence several tens of thousands of instantiations.

#

As per your suggestion, the first easy thing I can try is combining the building to be a single mesh. That will cut down the number significantly

#

after that, we'll see πŸ˜„

trail burrow
#

@serene thistle it might be cheaper to build a large mesh on a background thread which you update as things come in/out, that can be done using jobs/burst

#

i.e. focus on the mesh data, not the objectgs

serene thistle
#

But I want each building to be separate 😦 My grand plan has procedurally generated interiors!

prisma anchor
#

Is it possible to check if an entity has a component while executing a job?

coarse turtle
#

use componentdatafromentity

#

there's a function Exists() which should allow you to check if said entity has componentdata if its outside the bounds of your query

prisma anchor
#

Ah, that's what I thought thanks @coarse turtle

surreal grail
#

@serene thistle you can still generate interiors separately procedurally if everything else is combined

serene thistle
#

How will I identify individual buildings if everything is a single thing?

surreal grail
#

can't you use Objects or Structs to store them?

#

or like how do you know if a thing is a building?

serene thistle
#

collission triggers probably... which don't give a shit about the mesh. Ok gotcha πŸ˜„

#

groan now I'll have to implement mesh chunking too, cause of the vertex limit. Damn you and your ideas

surreal grail
#

I was just about to say to be careful with the mesh vertex limit πŸ˜„

#

should be pretty simple to implement tho πŸ™‚

trail burrow
#

@serene thistle unity supports large vertex indices from 2019.1 i think

#

32bit indices that is

#

eh... vertex buffers sorry

#

i cant type, its late

serene thistle
#

that should be enough. If I don't increase the size of my chunks πŸ˜„ Thanks @trail burrow !

trail burrow
#

i think you need to enable it somewhere

#

in a toggle somewhere

serene thistle
#

yeah I'll google it

trail burrow
#

i forgot, but it should be there

amber flicker
#

@prisma anchor if it's in the hot path and you use an IJobChunk you can also do a check on the chunk level rather than per entity (using chunk.Has(someComponentType)) but what Psuong said is usually best & easiest

prisma anchor
#

@amber flicker , thanks for the info

prisma anchor
#

Has anyone upgraded to 0.4.0-preview 10? I'm trying to update the soon to be obsolete code, and having issues with the BlobAssetStore. If pass null to GameObjectConversionSettings.FromWorld it returns ArgumentException, if I pass new BlobAssetStore I receive A Native Collection has not been disposed, resulting in a memory leak

vagrant surge
#

@trail burrow i honestly do not get the shared component for meshes

trail burrow
#

it just seems horrible

vagrant surge
#

im writing my own engine, and that kind of thing just seems incredibly stupid to me

#

like... in a normal scene, a huge amount of the meshes wont be repeated 100 times

#

which is what it would take to fill a chunk

trail burrow
#

yeah i dont get it

vagrant surge
#

now, if you had both? that would make more sense. If you have a mesh only a couple times, then instead of shared component, its a normal component

#

and keep the shared stuff for modular meshes or instanced meshes repeated a ton oftimes

#

its definitely extremelly biased towards Megacity

#

where there are a few meshes repeated a million times

worldly pulsar
#

With the hybrid renderer what is the least-painful way to change material properties at runtime without changing the serialized material?
I want to do the equivalent of renderMesh.material.SetFloat(propId, 12); but without it writing the change to disk. Like what .material vs .sharedMaterial did in MeshRenderer.

hollow sorrel
#

prob copy the material and set the copy

worldly pulsar
#

Yeah, I hoped to avoid writing the bookkeeping (tracking which material is a copy and which isn't), there doesn't seem to be an obvious way to check that

hollow sorrel
#

yea fair
you prob shouldn't write to the material itself tho
the other way is using materialpropertyblocks

compact hound
#

Library\PackageCache\com.unity.entities@0.4.0-preview.10\Unity.Entities\Types\TypeManager.cs(431,13): error: Cannot find the field TypeInfos required for supporting TypeManager intrinsics in burst

Something changed?

hollow sorrel
#

which i think hybrid renderer now has limited support for finally

worldly pulsar
#

oh, right, I forgot about that

hollow sorrel
#

@compact hound that usually pops up if you're missing other package updates

#

oh and i think entities 0.4 is missing a dependency on Collections

#

so might need to add that manually

compact hound
#

oh

#

i have collections up to date

hollow sorrel
#

do you have properties 0.10.3

compact hound
#

i dont see such package

worldly pulsar
#

are you on at 2019.3.0f1 or higher?

compact hound
#

2019.3.0f3

worldly pulsar
#

Updated all the packages, deleted Library, restarted Unity?

#

@hollow sorrel Another thing I forgot is that the MaterialPropertyAttribute is HDRP only -.-
Whatever, I'll just Graphics.DrawMesh this thing

hollow sorrel
#

whaaat is it really?

worldly pulsar
#

yeah, 3rd post on the forum

hollow sorrel
#

oh damn

worldly pulsar
#

I also feel like they're missing a case or two here -.-

namespace Unity.Rendering
{
    public enum MaterialPropertyFormat
    {
        Float = 0,
        Float4 = 1,
        Float4x4 = 2
    }
}```
hollow sorrel
#

that sucks

#

i feel like materialproperties are one of the things pretty much any game that uses custom shaders are gonna need

#

hell even without custom shaders you still wanna change color sometimes so even then

#

weird it's still not implemented yet

#

i went back to classic gameobject + meshrenderer after i couldn't get my RenderMesh to chunk yesterday (even tho GetHashCode() returned same value)

worldly pulsar
#

One of the main reason I use ecs is I'm tired of pooling gameobjects

hollow sorrel
#

yea same but the alternatives are writing own renderer or using someone elses (lots of examples ppl made right now) but with the risk that it won't be updated at some point

#

or hybrid renderer which will prob keep being updated but seems to lack a lot of features right now

worldly pulsar
#

I'm lucky on that part, the cases that cause me trouble are one-offs (that material will be on one object), so I can just Graphics.DrawMesh

compact hound
#

@worldly pulsar delete library and restart didn't help

hollow sorrel
#

@compact hound do all things under 'dependencies' when you select Entities have a checkmark

worldly pulsar
#

Anything differs from what you see in PackageManager?
(ignore the packages prefixed JPL)

compact hound
#

I dont see burst 1.2 update

#

its only for 2020?

worldly pulsar
#

I'm on 2019.3.0f1

compact hound
#

mhm i had to remove burst to see its update

radiant sentinel
#

hi, there is some problems on new entities package and burst compiler, i can not create entity and its not support by burst compiler.

compact hound
#

@worldly pulsar i had to manualy set packages versions in manifest because package manager didnt see them

worldly pulsar
#

Yeah, Package Manager is not very good at package managering

radiant sentinel
#

what is this error: Cannot find the field TypeInfos required for supporting TypeManager intrinsics in burst

#

default world not works by burst

worldly pulsar
#

read the last ~20 messages

radiant sentinel
#

im on lastest 2020, your solve is burst 1.2?

#

@compact hound how you fixed typeinfos

compact hound
#

@radiant sentinel make sure you have all packages up to date. Especialy burst. Probably you need to manualy set theirs version in /Packages/manifest.json file

radiant sentinel
#

@compact hound to 1.2? i can see 1.12 at my Pmanager. when i update to 1.2, new errors appear

compact hound
radiant sentinel
compact hound
#

its something in your code

radiant sentinel
#

@compact hound same errors when i turning off burst compiler

compact hound
#

Mby burst is missing some dependencies?

radiant sentinel
#

maths? no, its ok and lastest version@compact hound

#

i have presentation. i should fix it or degrade to oldest 😫

compact hound
#

sorry cant help you :<

compact hound
worldly pulsar
#

Anyone else seeing a ton of editor crashes with Domain Reloading disabled since 0.4?

gusty comet
#

Tried out the GettingStarted Cube sample from https://docs.unity3d.com/Packages/com.unity.netcode@0.0/manual/getting-started.html
Works pretty well, except the client side prediction.
Afaik the process is like this:

  1. Client sends inputs to the server with a prediction of the tick (called predictiontick) the server will have when receiving the inputs.
  2. The client will perform (simulates) the inputs right away.
  3. Inputs also receive at server -> Server performs (simulates) the inputs also
  4. server sends snapshot of results (i.e. translation) to the client
#

I am not sure what exactly happens at step 5.
I often hear the results are rolled back and eventually are corrected? What does that really mean?
Rolled back = take the snapshot from the server?
Corrected = client will apply all inputs again from rollback state?

#

When i set the recv/send delay to over 100ms then the cube has also a very jittery movement. I think the prediction here is not correct.
Anyone also has made these observerations?

worldly pulsar
#

Have a look at the Overwatch GDC talk, especially the second half where they talk about networking. The idea here is the same.

gusty comet
#

Already watched that great talk! But i still dont understand how the rollback + correction exactly works 😦

worldly pulsar
#

I don't have the code in front of me right now, sry πŸ™‚

gusty comet
#

No problem, did anyone have the same behaviour as mentioned above:
"When i set the recv/send delay to over 100ms then the cube has also a very jittery movement or jumps back and forth."

viral sonnet
#

@gusty comet there are 2 simulations running, imagine one as server, far behind and the client. the server runs every input and simulation once onTick. the client on the other hand is further in the future than the server. when a new snapshot in step 5 is received, the client is already, let's us say 15 ticks (whatever ticks, dependent on ping) ahead so the client resets back to the old snapshot from the past and resimulates all further 15 inputs known to the client. this in tandem keeps the magic alive that you're playing a game that just moves forward in time when it's in truth going back and forth multiple times per frame.

#

that is for predicted entities, interpolated are really just that, interpolated with no real logic other than defined states from the server. usually, position, rotation, animation state,etc...

#

personally i'm not sure why anyone would use interpolated entities when you can predict them. maybe someone else can answer that

#

the asteroids sample is the best sample to study

gusty comet
#

Thanks for the nice explanation.
How does unity know which systems to run to resimulate the last (15) inputs?

#

Or does it just run all systems in the ghostpredictionsystemgroup?

viral sonnet
#

exactly

#

is creates a server system and client system

#

the framework behind it is pretty cool i think. huge improvement over the last one where it was more complicated to write them. you had to make 2 different systems before which essentially do the same with some boilerplate code around it and now it's just one, that is called a mixed system in the asteroids sample

#

in the asteroids sample there are just 2 mixed systems. one for player movment and one for bullets. asteroids are interpolated i think

gusty comet
#

everything which is controlled by the server is handled with interpolation i think (because no info how to predict available on client)

viral sonnet
#

right, i'm not sure if there are any bandwidth improvements when predicted instead of interpolated. in the case of the asteroids, they could be easily simulated on the client as it's just a velocity but maybe predicting should be kept to a minimum because it means a lot of computation.

#

and simulating 1k asteroids 15 times per tick makes no sense

#

guess i answered my own question what's the benefit of interpolation ^^

gusty comet
#

i am still struggling that my cube is moving back and forth when i apply higher send/recv delays > 200ms (should move slowly in one direction). Without prediction (only interpolation or no server interaction) the cube moves slowly in the correct direction.

When i log the PredictionTick of client (green) and server (purple) it seems that the server tick is way higher than the client tick.
The opposite should be the case, shouldn't it?

#

@viral sonnet did you also have these issues?

#

I also log the deltaTimes which both run at 16ms in the ghostpredictiongroup

viral sonnet
#

hm, one problem is that logging to debug destroys timings. for accurate results you have to log to memory and write them to disk later.

#

the prediction system should run multiple times from latest snapshotTick to current prediction tick

gusty comet
#

why does it run mutiple times? (i also see this in the logs, so you are correct) But why is it the case?

#

Shouldn't it be sufficent to run it once for each tick from snapshottick to curren t prediction
So for example
Client: Tick 10
Client: Received Snapshot from Tick 5
--> Run prediction system from tick 5,6,7,8,9,10 again?

viral sonnet
#

like that

gusty comet
#

k i will investigate when the predictionsystem is called/and how often

viral sonnet
#

the call is in the netcode package GhostPredictionSystemGroup.cs line 107

#

for (uint i = oldestAppliedTick + 1; i != targetTick+1; ++i)

gusty comet
#

thanks was searching for this peace of code πŸ‘

viral sonnet
#

np, this is the only place where you know how many ticks it's predicting per frame. the prediction systems itself don't really know about it as even the time is manipulated before the prediction systems are updated

gusty comet
#

ok i understand. Do you know if there is a max count of iterations which can be simulated? because when i have a delay off 500ms, this means 32 ticks of 16ms

viral sonnet
#

depends, i don't think there's a safety for it and it can break when prediction takes too long, at least i had it in the previous version. never tested it in the new one. there's a term for this behaviour in network games but i don't remember. some kind of death spiral ^^

trail burrow
#

@viral sonnet @gusty comet at some point it will death spiral, but since you usually just predict your character and a few more things, that's usually several seconds.

radiant sentinel
#

ok c# parallelFor is faster than job and slower than burstJob. is it true?

#

but why?

civic glen
#

are you doing everything under one job? you should post your code.

#

there's not really a way to answer that without seeing what you're doing. The amount of thread overhead could be a huge contributing factor, Parallel.ForEach pools and will use as few threads as it assumes possible, which might be more efficient than the current job implementation.

radiant sentinel
civic glen
#

have you checked the amount of threads its creating for all 3?

#

and you didn't show Len, so I don't know how many times these are planned to be ran.

radiant sentinel
#

Len is 1M

#

SampleCountsLimit is 1000

#

i should present job is faster but i have negative results. what can i do to show them faster?😫

radiant sentinel
#

@civic glen What about ECS? is it help jobs to run faster?

coarse turtle
#
InvalidOperationException: Burst failed to compile the given delegate: Void InstantiateEntitiesExecute(Unity.Entities.EntityComponentStore*, Unity.Entities.Entity*, Unity.Entities.Entity*, Int32)

Hmm anyone have this issue where if you tried to convert entities - you would get a burst error about trying to compile the delegate? - this should be entities - 0.4.0 preview 10

#

Hmm - actually...it might be my own conversion system πŸ€”

silver dragon
#

Anyone got this with 2019.3 and entities 0.4.0:

Something went wrong while Post Processing the assembly (Assembly-CSharp-Editor-firstpass.dll) : 
 Failed to resolve System.Collections.Generic.Stack`1 

Any idea how to solve this one?

scarlet inlet
silver dragon
#

You have to make the jobhandles public and use them in the dependent systems.
For such systems i usually add a property FinalJobHandle which contains all the jobhandles from the system. Other systems can use this one as dependency.

scarlet inlet
#

yeah I noticed the FinalJobHandle pattern

#

tbh I don't like it, it should be something that the group should be aware of, not the single JobComponentSystem inside

#

with this poor design, I am forced to promote one JobSystem to the FinalHandle holder and get it from inside other system to update it

#

easy to forget

worldly pulsar
#

You can put the handle on the whole group if you want

scarlet inlet
#

true, still I have to do a GetSystem from inside each system used in the group right?

#

I mean the systems in the group shouldn't be aware of the group where they belong to

worldly pulsar
#

umm, they have to be aware of it, putting the [UpdateInGroup] attribute on a system is the only way to get it in there

scarlet inlet
#

I don't even use it, as I don't use the default world and I create the system manually

worldly pulsar
#

oh

scarlet inlet
#

such a design will force me to tie the system to that group

#

which is fine, but it's dirty

#

I mean I am sure 100% of the time is fine, but still not conceptually right

#

Anyway I am getting this error:

#

InvalidOperationException: The previously scheduled job ExportPhysicsWorld:ExportDynamicBodiesJob writes to the NativeArray ExportDynamicBodiesJob.Data.PositionType. You are trying to schedule a new job CopyPhysicStatesFromUECSToSveltoSyncEngine:Test, which reads from the same NativeArray (via Test.Iterator). To guarantee safety, you must include ExportPhysicsWorld:ExportDynamicBodiesJob as a dependency of the newly scheduled job.

#

so I did this in my CopyPhysicStatesFromUECSToSveltoSyncEngine:Test:

#
        {
            _group = GetEntityQuery(typeof(Translation), typeof(Rotation), typeof(PhysicsVelocity), typeof(SveltoEGID),
                                     typeof(SveltoGroupID));
            _world = World.GetExistingSystem<ExportPhysicsWorld>();
        }
#
              _group.SetFilter(new SveltoGroupID(_groupID));
              inputDeps = test.Run(_group, JobHandle.CombineDependencies(inputDeps, _world.FinalJobHandle));```
#

but the error doesn't go away

#

a better design would be that the the group gets the handle from the previous one, like it happens between jobcomponentsystems inside a single group

#

(or at least I guess this what happens as the inputdeps must come from somewhere)

worldly pulsar
#

the inputdeps are not from the previous system

#

(unless you define the new SIMPLE_DEPENDENCIES or whatever that symbol was called)

scarlet inlet
#

do you mind to explain how they are generated? m_JobDependencyForReadingSystems is hard to read

worldly pulsar
#

the dependency system figures out the dependencies based on the components you read/write

scarlet inlet
#

ah right, that's the automatic part I guess

#

so once jobs that do not use IJobForEach are introduced in the system, the automatism is gone

worldly pulsar
#

on the error you're getting I've got nothing, sorry :/

#

jobs that don't use IJobForEach can't read components

scarlet inlet
#

yes what I meant is that once they are used I am forced to start using solutions like FinalJobhandle

#

(although the error above is about components)

worldly pulsar
#

see what happens if you do _world.FinalJobHandle.Complete() before running your job

scarlet inlet
#

OK

worldly pulsar
#

(I know very little about Unity.Physics but I don't think you'll get many responses here over the next few days πŸ˜› )

scarlet inlet
#

haha this is my last day of work anyway πŸ™‚

#

but I am sure on the boxing day I will do something

#

yes with Complete the error is gone

worldly pulsar
#

I actually didn't know Run() takes a JobHandle

#

you'd expect it Complete()s it

scarlet inlet
#

well I don't know what to expect anymore

#

tbh I am more stressed out by the fact that the simple code this jobsystem is running doesn't work. However if I run exactly the same code inside a ComponentSystem it works

#

(I am using Run() to debug it in fact)

#

I hoped fixing the errors from the JobDebugger that I didn't notice would fix it

#

but it's still not working

#

it must be a timing issue

#

but I can't understand how since it's all on the mainthread

worldly pulsar
#

tbh this looks like a bug in the Run() method :P
I literally never used Run() with the second arg specified

scarlet inlet
#

I removed it and it's the same

#

The ComponentSystem version works as it should, The JobComponentSystem version doesn't

#

with or without the second parameter (I now put the job complete too)

#

I mean there shouldn't be any difference, both should be exactly the same thing

#

and when I say exactly the same thing, I mean also executed at the same moment

#

with the same order

#

but one works the other doesn't

gusty comet
#

I'm setting the LocalToWorld of an entity to move it around. I want to use the new Unity Physics package. Adding a Physics Shape & Body is now preventing me from manipulating an entity by setting the LocalToWorld - how do I work around that?

worldly pulsar
#

@scarlet inlet can you show the version with FinalHandle used?

scarlet inlet
#

@gusty comet you can move things only changing velocity

#

otherwise you need to use kinematic bodies

gusty comet
#

even setting the body to kinematic doesn't let me change its position

scarlet inlet
#
        {
            if (entitiesDB.TryQueryNativeMappedEntities<RigidBodyEntityStruct>(_groupID, out var simulationMapper) &&
                simulationMapper.Length > 0)
            {
              var test = new Test(simulationMapper, _groupID);
              _group.SetFilter(new SveltoGroupID(_groupID));
              _world.FinalJobHandle.Complete();
              inputDeps.Complete();
              inputDeps = test.Run(_group);
              
              var dispose = new DisposeJob(simulationMapper);
              dispose.Run();
            }

            return inputDeps;
        }```
worldly pulsar
#

write to Translation/Rotation to move anything that has physics body

#

not to LocalToWorld

#

@scarlet inlet and that version doesn't work either?

scarlet inlet
#

nope

gusty comet
#

@worldly pulsar thanks

scarlet inlet
#

the funny thing is that if I put a Rider not suspending breakpoint , the one that logs, then works

#

it is obivously a timing issue

#

but I have no clue why

worldly pulsar
#

ok, I've got nothing, you'd have to look at how that conflicting job is scheduled in Unity.Physics (maybe it's not included in FinalHandle for some reason?)

#

that's even weirder, because the safety system should not care about timing