#archived-dots

1 messages ยท Page 99 of 1

worldly pulsar
#

And yeah, the worker threads are doing nothing

trail burrow
#

the job usage in the netcode

#

seems... subpar

#

to say the least

hollow sorrel
#

same here, seems to be all main thread

#

btw i like how hierarchy view in profiler lets you select threads now

#

in .3

amber flicker
#

is there some stress test? I remember vaguely reading somewhere that they added one

trail burrow
amber flicker
#

I use middle mouse click to pan around in case that's useful @trail burrow

trail burrow
amber flicker
worldly pulsar
#

It's been broken for a while now ๐Ÿ˜›

trail burrow
#

@amber flicker that's not great

#

tbh

amber flicker
#

works for me

trail burrow
#

2ms for replicating 30 asteroids

#

is not... scalable

#

lol

tiny ore
#

For 30 2d asteroids?

amber flicker
#

oh thought you meant middle mouse click haha

trail burrow
#

@tiny ore yes

#

@amber flicker but thanks for the middle mouse, didnt know that

#

finally i can see what the other 28 threads are doing

#

๐Ÿ˜„

amber flicker
#

well I assume there's a base cost to having all these systems running... would like to see how much it changes when you had thousands of asteroids

tiny ore
#

Yep

#

Maybe fholms TR will run at the same 15fps with 1k of them... Sorry...:)

hollow sorrel
#

scrollbar is apparently gonna be fixed in f2

worldly pulsar
#

I see 0.95ms for the Server world and 0.7ms for Client

hollow sorrel
#

but yea check hierarchy view

#

when you press timeline dropdown

tiny ore
#

That's better Rett

amber flicker
#

let's see what changing asteroids from 200 to 20000 looks like ๐Ÿ˜„

tiny ore
#

Curious...

worldly pulsar
#

~half of that seems to not be netcode related (at least in server world). Physics, Transform, Spawners etc

trail burrow
#

i mean for me it still takes like 30ms

#

for 2000

#

but thats not saying much

tiny ore
#

Sรณ any game at 30hz will have excellent performance

trail burrow
#

can someone that has decent perf in this

#

see how it runs with 20000 or something?

worldly pulsar
#

building 20k right now ๐Ÿ˜›

amber flicker
trail burrow
#

@amber flicker the same takes like 4x as long for me tho so

amber flicker
#

what do you get for single core mhz?

trail burrow
#

~4.5ghz

amber flicker
#

haha just thought I'd check.. my old i5 is 3.9

trail burrow
#

i have 3 x i7s, and 4 x i5s here also

#

but i am not gonna move to test it on them

amber flicker
#

Ok.. slightly odd.. I have a tonnnne of other crap open on my machine but it looks like it is being somewhat distributed across cores? Would be interested if anyone else with a cleaner setup could check

worldly pulsar
#

looks like most of the increase is in physics

amber flicker
#

wow that looks much more as expected

trail burrow
#

they dont use physics ?

amber flicker
#

maybe it is an f1 thing

#

actually.. no, I see something similar if I pick a better fraame

hollow sorrel
#

huh

worldly pulsar
#

nvm the physics comment I saw "0.01ms" for ExportPhysicsWorld and read as 1ms -.-

hollow sorrel
#

are you guys doing something different? am testing with just raising numAsteroids and i'm getting way different timings

#

~5ms for 20k

#

~9ms for 200k

trail burrow
#

still 30% CPU

#

@hollow sorrel think they are profiling builds... i cant

amber flicker
#

i'm going 2mil ๐Ÿ™‚ - @hollow sorrel yea I'm doing the same - but as builds, not in-editor

hollow sorrel
#

i'm still profiling in editor

trail burrow
#

editor crashed at 200k

#

๐Ÿ˜ฆ

amber flicker
#

oh actually i mistyped so it looks like I'm building 200k first.. probably sensible

trail burrow
hollow sorrel
#

how many clients do you guys have in Multiplayer > PlayMode Tools from top bar

trail burrow
#

1

hollow sorrel
#

raising amount of clients seem to make it spike a lot

#

oh

tiny ore
#

Well

#

I don't expect a 20k asteroids thing to be meaningful as well....

amber flicker
tiny ore
#

More important would be 1k with 100 clients

trail burrow
#

got it running now

amber flicker
#

oof

tiny ore
#

Because for netcode we need to measure how the serialization and packing are performing

worldly pulsar
#

Build ran for like 3s with 2M entities, then crashed ๐Ÿ˜›

amber flicker
#

haha

tiny ore
#

Over several connectiins

#

It is something where dots can really work well

#

I'm hopeful....:)

#

But cautious, lol

trail burrow
#

randomly when its running with 200k

#

where it literally just stalls t he whole computer

#

every core peaks at 100%

worldly pulsar
#

so how do you build server/client separately?

trail burrow
#

use the unityclient/unityserver defines

hollow sorrel
#

yea mine breaks with 2 mil too but am getting an error message at least

worldly pulsar
#

Ah, no use for quick profiling probably anyway because I'd have to write the "connect to localhost" code first

trail burrow
#

no it will do that auotmatically

#

check GameMain.cs

#

well i'm done with this for now

hollow sorrel
#

dinner time eh

amber flicker
#

yea - might be worth filing on forums that your cpu performs much worse.. or file a bug report or something

#

generally with burst stuff has it been good?

trail burrow
#

๐Ÿ˜ฆ

hollow sorrel
#

oh

#

that would explain why it's slow if it was doing that before too

trail burrow
#

no it wasnt doing that before

hollow sorrel
#

oic

trail burrow
#

to server

#

th server is doing this

#

with just 200 asteroids

#

๐Ÿ˜ฆ im giving up

amber flicker
#

ยฏ_(ใƒ„)_/ยฏ

trail burrow
#

lets just agree that the netcode isnt ready lol ๐Ÿ˜„

amber flicker
#

yup.. nice trip.. back to reality

trail burrow
#

5 clients

#

200 asteroids

#

its using A LOT of cpu

#

damn

hollow sorrel
#

something in editor is fucking you up

trail burrow
#

@hollow sorrel yes noticed that too, that was an editor spike

#

not the game itself

worldly pulsar
#

Grr, is there a way to specify a define outside of PlayerSettings (and without writing a full build script)? Because if you define UNITY_SERVER for the whole project then some code in UNITY_EDITOR complains about missing symbols, and doesn't let you even start the build

trail burrow
#

@worldly pulsar client will run anyway

#

even with that error

worldly pulsar
#

I'm trying to build the server, and the defines are not setup properly

trail burrow
#

oh yeah

#

no i could not get server to build properly

#

ยฏ_(ใƒ„)_/ยฏ

worldly pulsar
#

No way to add defines via the new BuildSetting thing either. Ok, that's my patience threshold crossed ๐Ÿ™‚

trail burrow
#

haha ditto

#

now im actually done

slate breach
#

Does anyone know how to delay a custom bootstrap world creation until a specific scene is loaded?

worldly pulsar
#

Pretty sure you can't, and the idea is you shouldn't have to

slate breach
#

I want to wait until my loading scene is finished before the world initializes

worldly pulsar
#

What's in your custom bootstrap that can't happen before the loading scene is done?

#

I mean, all my systems run in the main menu, they just do nothing because there are no entities that match their queries

slate breach
#

It's trying to access assets that aren't loaded yet in the OnCreate methods of systems.

#

I was using #define UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP and not running DefaultWorldInitialization.Initialize("Default World", false); until the other scene is loaded. But that doesn't seem to work anymore.

worldly pulsar
#

I always looked at custom bootstrap as a way to get your systems/system group structure the way you want + exclude systems that are not supposed to run. I never touched assets in it.

slate breach
#

I just don't want systems to start running until my assets are loaded.

worldly pulsar
#

I don't know your specific situation but the first thing that comes to mind is to have an AssetsReference component spawned when the assets are loaded, and have all the systems that need those assets query/RequireForUpdate that

#

(I just have an AssetsReference with some materials in it in a subscene, so they are available as soon as the subscene is loaded, but never really needed to have systems wait for specific assets to load)

craggy orbit
#

anyone else getting poor performance with Hybrid Renderer 0.3 (versus 0.2)?

worldly pulsar
#

Do you have Burst enabled?

craggy orbit
#

now i do ๐Ÿคฆโ€โ™‚๏ธ thanks, that fixed it ๐Ÿ˜…

#

forgot to turn it back on after fixing some bugs

rare umbra
#

Can I use components to create a dictionary? E.g without ECS if I wanted to build a database of strings Iโ€™d just use an array with a key. In ECS is it advisable, or bad practice to create an entity for each entry with a component that has a key and value? Feels a bit overkill tbh

#

My instinct is saying that thereโ€™s a better way

worldly pulsar
#

Why would you want to build a Dictionary with components to begin with?

rare umbra
#

I would assume the data would be more nicely allocated in memory?

worldly pulsar
#

Define "more nicely"

rare umbra
#

Stored in a way that gives faster reads than a standard dictionary

gusty comet
#

@rare umbra afaik components can not hold strings right now

#

Unless I am misunderstanding your intention

rare umbra
#

Yeah strings was just an example

worldly pulsar
#

Do you plan to iterate over all your strings often? Because there is no way to store things in memory that gives faster reads in general

gusty comet
#

also dictonaries are costly to iterate through. Thats why the whole ECS stuff are arrays of arrays

#

iirc dictonaries are basically hashtables of some kind under the hood

rare umbra
#

Hrmm I think my use case doesnโ€™t hold up too well. Let me think of a clearer way to describe what Iโ€™m thinking about

vagrant surge
#

@rare umbra never (with caveats) use entities for "data storage"

#

use entities when you want to have systems that execute stuff on top of the entities

rare umbra
#

in this context storage is like their values not changing very often?

vagrant surge
#

if you want to store strings, use a dictionary, or some sort of array

worldly pulsar
#

To put it differently: the component storage is a data structure optimized for fast queries based on tuples of component types (aka archetypes), and for fast iteration over components matching those queries. If this is what you need, use components.

vagrant surge
#

important the fact with the archetypes and components. If you just iterate some data, there are arrays for that

#

obligatory dodbook plug too

rare umbra
#

thanks

stable fog
#

So I'm working on a mod for Risk of Rain 2 that is improving its navigation baking system so that we can bake the navigation during runtime (its a custom navigation system)
We are doing this with jobs and have it basically working, but its still not as fast as we want

#

I was looking at using burst, but after doing some reading, I'm not sure that its actually possible

#

It seems you'd have to run a standalone build to get a special DLL that needs to be loaded in order for burst to compile?

#

am I possibly misunderstanding this?

#

would it for some reason not be possible to add burst compilation to a game which doesn't already have burst, or possibly even more importantly, if the game ends up using burst, would that make it impossible?

deft niche
#

@stable fog not totally sure what you mean exactly with that question. You would possibly need to do a client update with the burst compiler enabled to actually make use of it.

stable fog
#

I cant rebuild the game, since its hopoos and. Ot mine, so if it requires the game to be rebuilt I guess I'm boned

deft niche
#

aah I see what you mean.

#

yeah I don't think it will be possible with the current implementation at least.

stable fog
#

Just to be clear they know what we are doing and have been kinda helpin

#

I'll ask the question on the forum in Hope's that a unity dev answers

#

wait a second, what is a Standalone player?

worldly pulsar
#

normal windows/linux/mac player

stable fog
#

so any game typically published for those OS's are a standalone player

worldly pulsar
#

yup

safe lintel
#

New physics package 0.2.5-preview.1

winter veldt
#

is there a system you can run just once?

safe lintel
#

couldnt you just disable it after it does its mainthread logic?

winter veldt
#

yes. i just saw that ๐Ÿ˜›

safe lintel
#

@trail burrow i just built a largely empty player(no netcode, it is a scene with a box as a ground plane, and spawns other physics boxes when you click..) and it takes up 60% of my i7 on idle. in fact when you spawn tons of boxes, the entire sim will grind to a halt but not exceed 60% either. profiler says the entire cpu side is only taking 1ms too

trail burrow
#

@safe lintel I really don't know :(

#

So much broken I've given up

safe lintel
#

yeah just saying that im really surprised too. i guess its probably not a netcode thing?

#

after removing the physics package, making it just an empty scene with a capsule entity, deleting all test scripts its now taking 50% cpu and 50% gpu in a build lol

trail burrow
#

@safe lintel well the problem i have is different tho, i have massive frame times also

#

like 100ms

#

but i gave up so

dull copper
#
## [Unity Physics 0.2.5-preview.1] - 2019-12-05

### Fixes

* Fixed a bug that could cause compound colliders to not update with Live Link when moving around a mesh collider in the compound's hierarchy.
* Fixed a performance regression that occurred in certain situations when using Live Link```
#

so, basically small hotfix for those two things

chilly bobcat
#

Hey guys, is there an interface or something that I can assign NativeArray<T> AND T[] to?

#

SomeInterfaceOrClass<T> myCollection = new NativeArray<T>...

#

and

#

SomeInterfaceOrClass<T> myCollection = new T[length]

#

I looked at IList and ICollection, but they seem to be resizable with Add() and I don't want that

#

I want them to be fixed-size

hollow sorrel
#

IEnumerable?

#

@chilly bobcat

chilly bobcat
#

I tried but it doesn't seem to be indexable

gusty comet
#

indeed, IEnumerable is not indexable

#

the question is whether native arrays guarantee order (not sure about that?)

#

if they do, you could implement your own LINQ-esque AtIndex method (which of course would be quite unperformant)

chilly bobcat
#

I'm already trying something else, so I don't think I need it anymore

#

Also there is ElementAt

#

Which would do the same thing

gusty comet
#

true

#

or you could create a method that does a type check whether it's a nativearray or a C# array and cast?

#

different question: What conditions are necessary for a ComponentSystem to run OnUpdate? I marked a ComponentSystem class with the AlwaysUpdateSystemAttribute and funnily enough ShouldRunSystem returns true for that system. Yet, OnUpdate is not running...

mint iron
#

It wouldn't run if Enabled == false or the world doesn't exist

gusty comet
#

yup, makes sense, also checked that that's the case

gusty comet
#

uh, okay, turns out that a system cannot have the AlwaysUpdateSystemAttribute and DisableAutoCreationAttribute work together. The latter somehow disables the former.

#

This was submitted as an issue already but it's been marked as by design ๐Ÿคจ

amber flicker
#

DisableAutoCreation removes it from the player loop update (you take manual control of updating it)... alwaysupdate tells the player loop to update the system even if it doesn't have automatically discernible matching entities to operate on

gusty comet
#

ah, thanks for that insight!

#

I think that's an odd design choice then. I don't see why disabling auto creation would necessarily lead to having to manually update? What if I want some systems only in a specific world and not in the default world? Doesn't really seem sensible that I'd have to manually update the systems in such cases, or am I missing something here?

#

plus it's not reflected in the name of the attribute. That it's not mentioned at all in the documentation is not surprising but also doesn't really help. Not lashing out at you or anything, I'm just a bit confused about that design choice.

coarse turtle
#

disable auto creation would mean you would create it yourself manually - so if its not in lets say the SimulationSystemGroup's update list - then you would update it yourself manually

I think by design its to allow ppl who want really fine tuned controls of their system for whatever gameplay needs

#

You can certainly add your manually created system to the system group that's being updated tho ๐Ÿ™‚

amber flicker
#

I agree it might not be all that intuitive (esp used to MonoBehaviour Update). Atm dealing with multiple worlds is still a bit tricky - not least because of lack of docs.

amber flicker
#

psa EditorApplication.QueuePlayerLoopUpdate(); is a thing for anyone who wants to do edit-time systems

slate breach
#

Does anyone know if there any Entity serialization examples floating around anywhere? Just looking for how to implement saving and loading with the ECS.

zenith wyvern
worldly pulsar
#

Heh, trying to plug into the IL rewriting pipeline, but something tells me they really don't want me to do that

#

("something" being [InternalsVisibleTo("OnlyOurStuff")] all over the place)

slate breach
#

Thanks

sharp nacelle
#

hm... I asked the question a few days ago already, but it got buried in a discussion pretty quickly. As I still couldn't figure out how it works (and as @digital scarab above mentions it): How exactly do you transfer specific entities between worlds? I only seem to find ways to either move or copy all entities o a world to another, but I'm interested in using one world to store prefab entities and then instantiate them to a different world. Is something like this not possible? Or do I just not find the proper samples or docs?

digital scarab
#

An overload of EntityManager.MoveEntitiesFrom takes a Query

gusty comet
#

Re: serialization - are there yet any strategies for change-resistant serialization? because binary isn't exactly known to be great at that

sharp nacelle
#

@digital scarab hm okay... so if I want to simply transfer a single entity or a group of entities I already have an array of I still need to pass it through a query somehow? I am confused by this as it looks like I can only "generally" move entities, but not specific ones I have the references of.

#

hm yeah that makes sense if you do it constantly.

#

but I will most likely only instantiate entities on level load and not much more later.

#

if archetypes could handle different default values this wouldn't be a problem ๐Ÿ˜„

#

exactly. I am working on a very moddable game and I define my entities in a lua script. I have a handler that keeps them in a hashmap as prefabs in a specific world. so the entities are really only there as a description on how they should look at runtime.

#

okay clarification. I am defining my entity "prefabs" in lua scripts, not instantiating them in lua

#

I started out with archetypes until I found the need to declare different default values for components of different archetypes and that made everything a whole lot more complicated

worldly pulsar
#

I guess you can attach a tag to the entities you want copied to make them match a query

sharp nacelle
#

hm but that sounds like multiple times performance heavy work: once the instantiation, then adding the tag (new chunk), then moving them to the actual world, then removing the tag (new chunk again). or am I wrong in this? if adding and removing the tag doesn't update the chunks I think this might work.

zenith wyvern
#

They treat tags (empty components) in a special way - they don't affect which chunk an entity is in

#

They are extremely efficient for this kind of thing

sharp nacelle
#

aha! that's good news already ๐Ÿ™‚

amber flicker
#

hmm I don't think that's right @zenith wyvern ?

worldly pulsar
#

@zenith wyvern I'm pretty sure that's not true

zenith wyvern
#

I thought I saw a unity person say that at some point

worldly pulsar
#

There is a fast path when you add/remove a tag for an entire chunk

zenith wyvern
#

Is it not?

amber flicker
#

nah, you add a tag - it changes the archetype, therefore it moves chunk

zenith wyvern
#

Oh, bummer

worldly pulsar
#

Then again, @sharp nacelle don't worry about the overhead from moving entities between chunks, unless you are moving like 10k entities at once

zenith wyvern
#

You at least know it will be quick to remove the tag at the end since you can do it in batch by passing the tag query to RemoveComponent

amber flicker
#

correct.. understanding batch operations and just how low cost they are is important

#

once you have tagged your 'prefabs' that you want to move into the new world (I still don't really understand what's going on here), things should be very quick

sharp nacelle
#

yeah I'm currently thinking of how I could batch this in the best way. I guess I will make my life easier by already providing a method to instantiate a large number of entities of one or multiple prefabs at once so I can tag & copy them all at once.

#

so at best I only need to do this once or twice when a level loads

amber flicker
#

are you not recreating the Prefab component and Instantiate that takes a NativeArray?

sharp nacelle
#

wait... prefab component?

amber flicker
#

uhuh... add it to a created entity and it isn't processed by any systems

sharp nacelle
#

๐Ÿ˜ฎ

amber flicker
#

and you can instantiate copies of them via entity manager

sharp nacelle
#

oh man. that makes my life so much easier ๐Ÿ˜„

amber flicker
#

haha ... sweet

sharp nacelle
#

I made one myself before and was annoyed by needing to exclude the component manually in each of my systems

worldly pulsar
#

Todays points for looking at the big picture go to Timboc ๐Ÿ™‚

sharp nacelle
#

that's why I got the idea of the separate world

#

I made one myself before and was annoyed by needing to exclude the component manually in each of my systems

#

I made one myself before and was annoyed by needing to exclude the component manually in each of my systems

#

that's why I got the idea of the separate world

#

thank you Timboc! I will definitely try it with the prefab component. this sounds a whole lot more simple than what I'm currently doing ๐Ÿ™‚

amber flicker
#

no worries - good luck! may also be worth avoiding the extra world unless there's a good reason for it

sharp nacelle
#

it just sounded so nice and clean

#

so entitymanager.instantiate will automatically remove the prefab component?

amber flicker
#

yup

sharp nacelle
#

very convenient. seems to work so far, but I need to restructure my code a lot before it works completely ๐Ÿ™‚ thanks again for the help!

left spindle
#

Hmm, I have a nativearray but I need to write to it non-sequentially, is there a way to do this in parallel?

#

I'm writing to the "location" based on where the entities are, which means I don't know where they'll be writing to. I'm puzzled. For reference, I'm trying to port the "Ant Pheromones" project from the DOTS Training

#

I tried to use ScheduleSingle but I'm ALSO using IJobChunk which doesn't like that with an EntityQuery.

safe lintel
#

use [NativeDisableParallelForRestriction] myNativeArray to allow parallel writing

left spindle
#

@safe lintel Awesome, thank you!

surreal grail
#

anyone knows a way to do something like: Mesh.SetVertices(NativeList<float3>); instead of using a List of Vector3
?

gentle osprey
#

Would it be possible to do: NativeList.AsArray()?

#

If you have access to the new mesh api (2019.3), then you can pass native array's to Mesh.SetVertices, and lists can be converted to native arrays using AsArray().

trail burrow
#

It's a good book, but a bit heavy handed in terms of how much it like to "shit" on OOP, etc. Raw execution performance was never OOPs strong suit. The performance benefits of DOD can't be ignored and that DOD makes absolute sense for internals of a game engine is fairly 'obvious' imho.

surreal grail
#

@gentle osprey yeah, that seems to work, thanks, but I might need to look into it a bit more, I don't know if calling this creates garbage, and I need this to be called very often

zenith wyvern
#

It doesn't create garbage, a nativelist is a nativearray under the hood

surreal grail
#

oh, then that's fantastic, thanks! and one last thing: does ToArray() create garbage? since the indexes of my mesh are stored in a nativelist of int aswell, but it does not let me use AsArray

zenith wyvern
#

ToArray creates an actual copy so yes it will allocate. You should be able to pass a native array to mesh.SetIndices

surreal grail
#

Thank you so much! I was trying to use SetTriangles, that does not allow nativearrays or lists

worldly pulsar
#

There is no equivalent to Entities.WithAll<Thing>().ToEntityQuery() in the new codegened version, right?

dull copper
#

@trail burrow I actually struggle to read that persons posts or blog posts

#

it usually takes forever to get to the point and all the info is mixed in book long paragaphs

trail burrow
#

you mean DOD book?

#

or the other guy?

dull copper
#

the guy posting about it

trail burrow
#

ah ye

#

i agree on that

dull copper
#

I have nothing against the book ๐Ÿ˜„

trail burrow
#

I.. was going to post this reply on the forums

#
It's a good book, but a bit heavy handed in terms of how much it like to "shit" on OOP, etc. Raw execution performance was never OOPs strong suit. The performance benefits of DOD can't be ignored and that DOD makes absolute sense for internals of a game engine is fairly 'obvious' imho.

However specifically regarding the Unity ECS: Applying DOD on such a scale that it's intended to to be used for everything from core engine to fine grained game logic (in the end... dots is not ready... i know). I'm just not so sure, from an architectural perspective, how organisation of a lot of fine grained game logic with tiny variations in behaviour is going to pan out - for all its drawbacks, this is something OOP excels at.
#

but didnt wanna get into a shouting match

#

with the forum zealots

dull copper
#

๐Ÿ˜„

#

yeah, I know what you mean

#

there's been many times I've written long responses and then... just never sent it

trail burrow
#

yup

worldly pulsar
#

I'm just not so sure, from an architectural perspective, how organisation of a lot of fine grained game logic with tiny variations in behaviour is going to pan out
This is why I don't like the fact all the Unite talks/demos etc. are all about performance. Do this to get performance, don't do that because performance. We know dod is fast. Show me how it is good to write gameplay code in it.

#

Also why the project I'm tinkering with to learn ecs is a card game. Minimal performance requirements, just try to arrive at a convenient pattern to express gameplay logic in.

magic frigate
#

That was one of Sweeney's main beefs with the idea of going to an ECS model as well. How does complicated gameplay code translate here to actual productivity gains? Ideally we can make gameplay logic in a more abstract oop way and DOTSify anything heavy. I think that was how Overwatch handled it.

#

They will probably show off more ease of use stuff once visual scripting is more mature

worldly pulsar
#

I really hope visual scripting doesn't become the go-to way to do gameplay code

#

So does my mouse-induced RSI

magic frigate
#

For me the best thing about visual scripting right now is seeing how they handle things in the (actually human readable) C# files they generate

#

Has a long way to go before it feels as nice as a certain other engine's node based stuff

#

I'm happy with their decision to make the visual scripting ECS only as there are already apparently good solutions for regular OOP node-based scripting

worldly pulsar
#

I really don't see them doing a visual scripting environment that beats Visual Studio at code editing. Like, I want to do "Find all references of this field", show me all the visual scripts that touch it.

#

Unreal Blueprints don't have anything like that either, right? (been a while since I looked at it)

magic frigate
#

Depends on what you mean by field? I believe there is something like that for variables in a BP

worldly pulsar
#

My Player has an int2 GridPosition field. Show me all the places it is read/written to

hollow sorrel
#

@trail burrow personally i like ecs architecture more than oop for game code but you should post it especially because of the forum zealots
imo i've prob learnt the most from the criticising posts on the forums because it shows weak points but also gets devs to justify their reasons and explain why they think their way is good
also i get what you mean sometimes the forums just read like a unity advertisement

magic frigate
#

@worldly pulsar Confirmed it does have a feature that searches for nodes that get/set the variable

worldly pulsar
#

That's across all blueprints in the project? Wow, maybe I need to look at certain other engine again sometime.

winter veldt
#

hey guys. more tests more fun

#

for the purposes of a 2d tilemap (so quads) what is the best approach for maps that would change tiles every so often?

#

i seem to get better performance creating largeer "chunks" of quads in one mesh, setting the uv's per tile... but that makes something like mesh sharing not work... if i create indivudal quad meshes, sharing would work, but it seems to have way less performance

worldly pulsar
#

If you are covering the whole screen with ~9 meshes I wouldn't worry about sharing them

#

How big is your tilemap? Can you just create it once and modify every time a tile changes, or do you need to build it on the fly as the player moves around?

#

And how often do the tiles change?

worldly pulsar
#

InvalidProgramException: Invalid IL code in JPL.TextRender.TextRenderingSystem:OnUpdate (Unity.Jobs.JobHandle): IL_007a: call 0x0600003c
Ok, that's a new one

dull copper
#

if you have to do any kind of math, visual scripting will suck at it

#

things that take few seconds to type, take minutes to wire and are tedius to change and you also make mistakes easier that way

worldly pulsar
#

You could just have a node where you name your argument "ports", and just type in the math

winter veldt
#

tilemap would be small chunks, not sure of size, but probably like you say, ~9 on screen. they wouldn't change frequently, but say a colony or builder game where walls are built, rocks or trees get dug/cut, etc.

worldly pulsar
#

still more tedious than just typing it in in code imho, but that's my take on visual scripting in general

safe lintel
#

is discord search not working?

magic frigate
#

It was broken for me earlier as well...

worldly pulsar
#

Discord had a major outage yesterday

solar spire
#

discord's currently having an ouchie wowchie with it's magnifying glassy

safe lintel
#

alright thanks, to the unity forums

worldly pulsar
#

@winter veldt as long as you only maintain the meshes for the ones on screen I wouldn't expect any performance impact, even on mobile.

winter veldt
#

ok, so i thought shared resource stuff was like a "build once, stamp it all over" thing... but not so much huh.

dull copper
#

@worldly pulsar yes, I've used that node... once

#

it doesn't really solve much and is still super tedious to use

#

I don't really hate ue4's blueprints, they are great for many things... I just hate any form of math equations on it

#

they are great for testing out new engine features and doing quick prototypes as you don't have to open docs to just assemble the thing you want (most things are obvious there)

#

btw, I knew someone would bring that math node up

#

it's great on paper

worldly pulsar
#

Visual scripting in general is great on paper imho

dull copper
#

well it makes some things way faster to do on unreal

worldly pulsar
#

(and tbh I just google searched if UE had this kind of math node, never used it)

dull copper
#

but on unreal, anything that lets you bypass their c++ api can speed things up... their c++ api is just poorly documented and you spend ages trying to figure out simple things because of that

#

their blueprints you just wire and it works

#

there are other reasons why I nowadays go almost full c++ on ue4 projects but it's not really relevant to this topic now

#

I'm actually genuinely curious if Unity manages to make their DOTS visual scripting logical to nonprogrammers

#

because the early versions we've seen didn't seem easy at all

#

my main interest on DOTS visual scripting is if it helps reducing the boilerplate code

#

but recent Entities changes did that to some extent already on code side

#

(but there's still work left on that front)

#

after programming for decades, I really don't hate anything more than writing boilerplate again and again

#

it's just work that shouldn't need to be done

safe lintel
#

there was an old slide preview image of what they intended for it to look like which did look pretty nice

dull copper
#

any task you have to repeat like a robot is unnecessary

safe lintel
#

i consider myself a visual person but i dont even care to touch it until it gets that ux overhaul ๐Ÿ™‚

worldly pulsar
#

This is why I'm ok with them throwing codegen at the problem with the new ForEach. The amount of boilerplate we had with declaring the job structs was crazy, and IL postprocessing - while still evil - cuts that more than any generic magic could.

#

So given the choice between magical codegen rewriting my C# or visual scripting I still wouldn't choose visual scripting

safe lintel
#

i know its early, but i kinda prefer how the job structs more straightforward and feel more organized, the new foreach with all any structuring to me seems a little messy?

mint iron
#

the post processing makes me nervous, at least heavy generics are strongly-typed and instructive to read; i can inspect it all and easily see what's going on. Magic that produces god knows what out the other end is worrying and I hope its kept to a minimum as the 'easy version'. One of the things i love about the jobs is the idea that its extremely explicit; everything going in to it is declared and obvious.

worldly pulsar
#

If they could get a good api with generics alone I'm sure they would.

winter veldt
#

is there a way to store a fixed sized array or some sort in a component? specifically say, an array of float3 for verts?

worldly pulsar
#

@winter veldt you can store a fixed array of int/byte/float (all the built-ins) like this:

unsafe struct T {
    public fixed int arr[4];
}
#

no float3 tho

winter veldt
#

ah, thanks!

mint iron
#

@winter veldt if you want to wrap that nicely for T, check out \Unity.Collections\ResizableArray.cs for inspiration

autumn sleet
#

Well that's not it, you are ending up wasting memory for small data types @mint iron

trail burrow
#

@worldly pulsar You can easily store a float3 in that tho, since the size of float3 is known

wooden falcon
#

How do I go about sharing a normal struct value between 2 jobs?

#
...
var handleA = jobA.Schedule();

var jobB = new JobB();
jobB.someFloat = jobA.aFloatResult;
...
jobB.Schedule(handleA);```
zenith wyvern
#

You put your value inside a nativearray and pass it between jobs

wooden falcon
#

There isn't some neater container for just this?

zenith wyvern
#

Not right now, as far as I know

wooden falcon
#

Alright

trail burrow
#

@wooden falcon can just allocate memory for it

trail burrow
#
// allocate
var value = (MyStruct*) UnsafeUtility.Malloc(sizeof(MyStruct), 8);

// clear it
*value = default; 

put the value pointer on a job somewhere

wooden falcon
#

So I would need to wrap it in a unsafe block right?

#

Also is Burst fine with pointers?

amber flicker
#

@wooden falcon burst is fine with pointers, I think you would need to wrap it in unsafe and mark your project as using unsafe too. Hence if needed I tend to also use a NativeArray

wooden falcon
#

Yeah I'll use arrays instead

#

Given that the most annoying thing with them is making sure they are deallocated after the correct job, which I'm guessing any solution would end up needing

amber flicker
#

yup. I think Unity has said that in the future they'd like to make this nicer (esp between lambdas) - though probably a lot of people prefer the explicit nature of the current way anyway.

wooden falcon
#

Yeah, explicit is nice.. I just need to work up my muscle to remember to dispose of them and so I don't have to look up the API every time I need to do it

amber flicker
#

True - the compile time errors and runtime warnings help a lot - some could be better but generally I don't think they get the credit they deserve for fairly immediately highlighting where you've gone wrong or forgotten something.

remote coyote
#

so, using GetComponentDataFromEntity in a IJobParallelFor job is not allowed (container does not support parallel writing)? So we can't use it to write to in a Entities.ForEach.Schedule?

#

I'm encountering this in a unit test, so not usre whether this is an actual restriction or if its me who haven't set up the stage yet for the test to run properly

#

I do get an Invalid Operation Exception though, so my guess is its not supported in parallel job, only IJob

#

hm, the Asteroid Netcode sample use it with a IJobForEachWithEntity and writes to it

digital scarab
#

You can use it for reading, but not parallel writing, at least not where safety is guaranteed by Unity. You can disable the restriction [DisableParallelForRestriction] in cases where you know for sure each different parallel run guarantees to not write to the same data.

remote coyote
#

Hm, I actually just read from it

#
var commandTargetsFromEntity = GetComponentDataFromEntity<CommandTargetComponent>(isReadOnly:true);
#
var unlockTalentRequestHandle = Entities.ForEach((Entity requestEntity, int entityInQueryIndex, ref TalentUnlockRequest request) =>
                {
                    ecbUnlockTalentRequest.DestroyEntity(entityInQueryIndex, requestEntity);
                    
                    if (commandTargetsFromEntity.Exists(request.Connection) == false ||
                        commandTargetsFromEntity[request.Connection].targetEntity == Entity.Null)
                    {
                        return;
                    }

                    var target = commandTargetsFromEntity[request.Connection].targetEntity;
                    ecbUnlockTalentRequest.AddComponent(entityInQueryIndex, target, new UnlockTalent
                    {
                        TalentId = request.TalentId
                    });
                })
                .WithName("TalentUnlock_Request")
                .Schedule(inputDeps);
#

So, most likely, some of my setup in the test must be off

amber flicker
#

hmm weird.. if you get that error it likely means it doesn't think it is readonly so that (true) might not be all you need - does it help if you add [ReadOnly] before var commandTargetsFromEntity...?

remote coyote
#

its a local variable I extract in OnUpdate, so I can't add an attribute (I use the Entities.ForEach.Schedule approach)

#

I'll try changing it to a job and see whether that fixes the problem

elder wharf
#

After the .WithName() function, add .WithReadOnly(commandTargetsFromEntity)

remote coyote
#

oh

#

I'll give that a try

amber flicker
#

nice, that'll be it

remote coyote
#

hah, the more you know

#

ty @elder wharf

elder wharf
#

np ๐Ÿ‘

remote coyote
#

man, learning ECS/DOTS with Unit testing helps so much

#

specially in Rider where you get the ECS unit tests right there in Rider

#

don't need to switch over to the Unity Editor at all while coding away

worldly pulsar
#

You can easily store a float3 in that tho, since the size of float3 is known
@trail burrow What I meant is you can't have a fixed float3 arr[3]

trail burrow
#

@worldly pulsar no but you can have fixed byte arr[12 * 3] and cast to float3*

gusty comet
#

so I downloaded the new netcode packages and entities etc and followed along the "Getting Started" section on the Netcode manual

#

But when pressing the "Update Component List" Unity closes.
not even a crash, it just closes. anyone know anything bout that?

dull copper
slate breach
#

Has anyone encountered this error when trying to Deserialize a world? We are reading a UnityEngine.Object however no ObjectTable was provided to the PropertiesBinaryReader.

stiff skiff
#

Whats the current recommended method for "events" or other types of communication with entities?

worldly pulsar
#

If I have different meshes to be drawn with the same material there is nothing better than Graphics.DrawMesh() right?

mint iron
#

@stiff skiff che3ck out tertle's event system https://forum.unity.com/threads/event-system.779711/#post-5242199 as its probably the most tested and well thought out solution available. In the recent version he's switched to NativeStream rather than the dictionary and NativeQueue approach previous. I think there's still a great deal of room for improvement but as far as out of the box solutions go he's done a lot of work for you.

dull copper
#

not fully dots I suppose but it's jobs/burst supported

#
Numbers on 250x250 water mesh, with 10 wave source objects, on 2018 MacBookPro (Core i9 2.9GHz):

* Regular API: 66ms,
* Jobs+Burst: 3.9ms.
vagrant surge
#

nice

worldly pulsar
#

codegen, the gift that keeps on giving

 Member 'UnityEngine.TextCore.Glyph' is declared in another module and needs to be imported 
#

(works fine in editor but refuses to build)

arctic vector
#

Hi, I've been trying to minimize the GCAllocation as much as possible in my project and I've come across the fact that the only thing that allocates GC memory is the Unity camera renderer and the rendering systems in general. Has anyone been able to somehow deal with this issue (besides obviously writing your own rendering system)

onyx mist
#

i made a persistent hashmap yet i still get the native container has not been disposed error when i exit playmode

#

anyway to get rid of it?

coarse turtle
#

You should dispose the persistent native hash map before your application quits

#

so if it lives in a system you can likely put it in OnDestroy() call

#

if its outside, of a system - you should find a way to dispose it before you effectively quit

onyx mist
#

would onapplicationexit work?

#

iirc that only works in builds tho right?

coarse turtle
#

should work in the editor too

onyx mist
#

ah ok great! thank you :)

gusty comet
#

Hello,
I want to iterate through thousands of GOs at each update. Can I do that with Job but without ECS ? Should I have to populate a native array at each frame or can a Monobehaviour create and store a native array and then pass-it to a job at each update ?

dull copper
#

@gusty comet you can access gameobjects only from main thread, so job system can't poll data out of them

#

there are things like gameobject transforms which you can jobify

#

and physx queries like raycasts etc

#

but those are special cases

gusty comet
#

Ths

#

Thx

dull copper
#

IJobParallelForTransform for transforms, RaycastCommand for raycasts (and there are few others for other queries)

storm sand
#

I want to try some procedural mesh generation and was wondering if there's anything in DOTS that would make it more performant. My previous experiments with the Mesh class showed that it wasn't particularly fast. I know that for many things I could just use vertex shaders, but still I'd love to do some operations on an array of mesh vertices without the need to dive deep in C# parallelism

coarse turtle
stable fog
#

these improvements are good but you can generate meshes with over 100k vertices in a few ms

#

really, all you need to do is ignore the mesh class until you actually need to write to it

#

its the transfer of data that is the slow part

#

write to it once

#

and I don't mean to imply that you should aim to use DOTS

#

just make sure you're approaching the problem right

tawdry tree
#

A lot of procgen can also be parallelized by way of "start a thread, ignore it until it's done, then listen to what it has to say".
This doesn't need to use threads directly either, it's fairly simple to do with the C# Task API.
The approach doesn't get full benefits of parallelism, but it walks a wide circle around many potential dangers while leaving the main thread doing main thread stuff.
Initial generation of various sorts can't really benefit from that, though.

#

The points above are good, too - you can work on pure math and arrays for a long time before you need to touch Mesh

amber flicker
#

So, let's say when you have a cube in a sub scene, it is automatically converted into the ecs representation which lives in the Editor World. Any idea how I could get hold of that entity? It seems like IConvertGameObjectToEntity's Convert isn't called for the Editor World? (Yet obviously, there's a conversion happening)

storm sand
#

@digital scarab Thanks, that is exactly was I was looking for. though it seems like it's a work in progress. Do you know if there are any example projects with this improved mesh API?

slate breach
#

So I realized my my deserialization error only happens when I have any entities with a RenderMesh. Does anyone know what I have to do when serializing/deserializing entities with those? Currently just doing SerializeUtility.DeserializeWorld(entityManager.BeginExclusiveEntityTransaction(), reader);

#

Which works until I add something using a RenderMesh.

#

Am I suppose to use SerializeUtilityHybrid?

tawdry tree
#

Is RenderMesh not ISerializable?

#

If it were, I assume the relevant methods would be called, so if it is (easy to check with some intellisense and casting, or source), something in there is probably broken. Otherwise, I assume it just doesn't know how to serialize it, and that you need to make a custom thingy for that.

slate breach
#

Yeah I think I figured it out, I have to pass an empty object array into the SerializeWorld method and serialize that separately. Then deserialize that myself and pass it into the DeserializeWorld method.

slate breach
#

Haven't actually figured out how to serialize those objects yet, but it should work when that's done.

winter veldt
#

why are you serializing the rendered entities? seems like something you would want to rebuild when you deserialize?

tawdry tree
#

Probably, but it depends on how its done. Presumably you'd want to save either just some reference (named or the like) to a model, or a seedfor procgen

#

At least not save multiple copies of the same mesh

slate breach
#

Well when I try to deserialize them I have errors because they have references to managed objects which I don't have anymore.

winter veldt
#

yeah that's what i'd assume, i mean RenderMesh is literally holding the mesh and material and such, which is probably why it errors out when trying to serialize/deserialize.

slate breach
#

SerializeUtility.SerializeWorld(EntityManager, writer, out ObjectRefs); When I do this the ObjectRefs is a list of meshes and materials.

#

Do I have to remove all render meshes from my entities and have a component with a string says which ones to load when they're reinstantiated?

winter veldt
#

i'd assume its not to just save the world to file or something, what are you serializing it for?

slate breach
#

I'm just trying to have a save and load system

#

I want to save every entity as it is, and then reload them.

winter veldt
#

yeah, i don't think you're meant to be saving render data, that is the RenderMesh stuff. it should be built at load

#

or rebuilt as it were

slate breach
#

Do I have to strip all of the to-be-serialized entities of their RenderMesh before serializing?

winter veldt
#

that's probably the best bet yeah. i keep anything that's being rendered in it's own entity, not tied to the actual data.

#

so like, a characters entity would be separate from a characters renderer entity.. just with a link to it if need be

#

but you can probably just remove a rendermesh and readd it

slate breach
#

I'm converting a lot of game object prefabs into entities, I don't think I can store a reference to those prefabs in a component that will be serialized.

#

I mean maybe I can store an addressables string in a component.

#

Just seems like I have to redo everything I've done just to serialize.

safe lintel
#

sounds like a nightmare to try to handle tbh

slate breach
#

How do I exclude a component from serialization? If it doesn't have a [Serializeable] attribute is it not serialized?

#

Maybe I'll try render entities and not put them into the world that will be serialized.

stable fog
#

I just want to correct something I said above

#

"and I don't mean to imply that you shouldn't*** aim to use DOTS"

winter veldt
#

that would make more sense. to me, game data and render data is better left separate, for that exact reason. You don't want to save render data, only reason i can think of is extra space it would take... but i'd assume there are bigger reasons (not even sure you could say.. save a material object to file and recall it for one)

#

i haven't played with multiple worlds or serializing data in ECS really, so i can't help much beyond that

slate breach
#

Having a data entity and a separate render entity seems weird. The RenderMesh is a separate component operated on by separate systems I feel like I shouldn't have to have a weird linking between two entities for that. Doesn't feel very ECS like.

winter veldt
#

definitely seems like it should warn you that shouldn't be serialized. you should be able to just turn it off

#

thats why i feel like you could just remove it and re-add it. but thats part of the issue, you are building the render data already, if you were to save it and load it back in, it'd be an entirely different location, but just a copy of the data... and render data is generally the largest data. essentially all the media (textures, sounds, etc) shouldn'

#

t be serialized to a save file

slate breach
#

I think I'll have a component that has instructions for setting up a rendermesh. Either based on a prefab or data that's procedurally generated. And then remove the rendermesh before serializing. And use the setup component when deserializing to readd it.

winter veldt
#

i mean that's what a prefab is meant to be. the prefab of a section of wall is set, then you instantiate several wall section prefabs, changing each of their locations, and you create a wall. you're meant to be saving just their locations, not the wall section prefab.

slate breach
#

I'm just glad they have blittable strings now so I can use adressables

winter veldt
#

haha yes. that was a fun realization

hollow sorrel
#

i haven't looked into ecs serialization yet but instead of serializing the entire world and excluding components, isn't there a way to only include components you want to serialize? in oop games i've worked on the save data is a really small portion of the game's total data

#

i'm guessing tagging the entities before you move them to the save world is a way but then you'd still end up with the entire entity

#

and splitting up simulation entity and render entity makes sense but to add a 3rd savedata entity is weird

prisma anchor
#

Hi, is there a way in Physics to set the "timeScale" to zero?

coarse turtle
#

I guess you could probably write a system to prune out componentdata's when you want to serialize the world after transferring it ๐Ÿค” @hollow sorrel

#

also @prisma anchor haven't messed with physics package, but possibly - you could turn off the systemgroups handling the logic to "pause" the physics ๐Ÿค”

hollow sorrel
#

yea i guess something like removing any component that doesn't match a filter
feel like that doesn't scale very well but perf doesn't matter as much if it's saving/loading since it's ok if it takes a few seconds
but still wish you could do like a [SaveMe] attribute or something and filter only those to copy to the save world

#

what i used to do with oop is let a component add itself to a list that gets iterated during save, and calls a serialize() method on each component to serialize itself

prisma anchor
#

hmmm @coarse turtle sounds like an idea

onyx mist
#

is there a way to make a list that can hold all native collection types? i basically want one class to have a giant list of all persistent natives so i can dispose of all of them with a single onapplicationexit method

#

if its not possible are there any alternatives to do what i want to do?

hollow sorrel
#

i might be mistaken but if you close your built game the OS should reclaim all its memory regardless if you release it or not

#

dunno about editor tho

hollow sorrel
#

is there a difference to having a seperate render world vs one world with render entities? with systemgroups you can still put all your rendersystems on a seperate tickrate to render at refresh rate and fewer simulation ticks
on forums unity devs seem to recommend having a render world but i can't find why

@vagrant surge sorry for pinging but you tend to have insightful answers on these things feel free to ignore this if you're busy

winter veldt
#

could it be for ease of serializing a world for saving?

#

i haven't done any multi-world stuff yet, but someone was having an issue because they were trying to serialize rendered entities

slow epoch
#

Could it be to iterate less entities?

winter veldt
#

is dynamicbuffer broken in 0.3p4? trying some example code and the GetEnumerator() is throwing a "Not Implemented" exception

hollow sorrel
#

@slow epoch long as you keep your render entities seperate from simulation entities i don't think that would be an issue

slow epoch
#

Are chunks global or part of a World?

worldly pulsar
#

part of a world

#

btw, where did you see Unity devs recommending a separate render world?

vagrant surge
#

@hollow sorrel it really really depends

#

the thing is that worlds have "forced" sync points

#

due to add/remove components

#

this means that there is a strict limit to how much parallelism you can have on 1 world

#

and then Amhdals law kicks in to ruin your day

#

with multiple worlds, their execution can be done parallel, so while 1 world is locked at a sync point, the threads arent idling

#

i actually implemented both approaches in my own experiments. The issue with multiple-world is that syncing data beetween that world and render-world is a forced bottleneck. It can be alright tho. Depends on how many dynamic objects you have around

worldly pulsar
#

their execution can be done parallel
In theory, yes, but with the restriction that all the systems run on the main thread you'd have to do some kind of interleaving of systems from different worlds to make that work

vagrant surge
#

this is from a tech demo i have, of 100k "spaceship" boids, an even bigger version of this http://victor.madtriangles.com/code experiment/2018/06/11/post-ecs-battle-huge.html

#

the red and orange boxes are "worker threads doing work"

#

the blue is the main timeline

#

see all those sync points? Clear separations beetween those very parallel systems

#

there is literally nothing you can do for those if you use 1 world

#

if you use 2-3 worlds, and execute them at once, then the work of the different world systems will overlap and "fill" the gaps

#

but i dont know if that works in unity. Is it possible to run the update loop of multiple worlds in parallel?

worldly pulsar
#

As I just said, systems are restricted to the main thread

vagrant surge
#

in that case, multiple worlds arent needed

#

you might want to separate "visual" and "logic" entities

#

so that entities that go through the render loop are "more optimal"

worldly pulsar
#

and even if you try to run them from your own thread, the JobSystem will yell at you, because its scheduler is not thread safe

vagrant surge
#

oh

#

then separated worlds dont really have that many gains. Unless you want to do it anyway for architecture or special needs? like networking where you have client and server worlds

worldly pulsar
#

From what I understand creating worlds is lightweight enough for cases like move a bunch of entities to a world and then serialize that (which is just fwrite() of all the chunks)

vagrant surge
#

yes, it is

#

changing the world of a "chunk" is barely a few pointer swaps around

#

you just remove it from the internal lists of world A, and add it to the internal lists of world B

hollow sorrel
#

oh huh

#

so basically in theory it'd make sense but since unity's systems run on main thread, it doesn't?

vagrant surge
#

im not sure how exactly the internals of unity work, but if you were to do that on the unity-style ECS ive written on C++... it would be about 3 pointer swaps total

worldly pulsar
#

Unity runs with the assumption that systems do very little work, they just schedule jobs

hollow sorrel
#

also @worldly pulsar i can look up the posts if you want but it's basically just the threads of ppl asking "what are the use cases for worlds" and there's always a unity dev (e.g. joachim) mentioning presentation worlds

vagrant surge
#

uhm if they run on main thread but just schedule, then its probably possible to overlap the jobs of multiple worlds

#

doing that whole overlap thing i commented about

worldly pulsar
#

I guess it would make sense for a kind of double-buffering scheme (copy your entities to a world after each sim step, then the presentation can grab 2 of those worlds and interpolate between for presentation)

#

maybe

vagrant surge
#

you can also do that without 2 world

#

by just having 2 entities in 1 world

worldly pulsar
#

@vagrant surge that's what I said about the systems having to be interleaved, you'd have to run world1 untill its first sync point, then world2 untill its sync point

vagrant surge
#

pfff, that fucks with the interleaving quite a lot, unless you make sure you absolutely never block on each of the 2 world simulations

#

for my multithreading, i use Taskflow (c++). in that one you build a job graph ahead of time, and then execute the entire thing

slow epoch
#

How does ECS right now handle references between worlds?

hollow sorrel
#

ecs systems always finish their jobs before the next frame right? like running jobs are waited on at start of next update call? or at the start of updating the world?
so if you update your systems every 16ms, they'd have 16ms to finish their jobs
but if your renderer updates at say 7ms, does this mean everything in your world needs to finish in 7ms, or is that handled seperately if you update the systemgroups at different intervals?
if that's the case then that'd be a strong case for multiple worlds

vagrant surge
#

i have literally zero clue about that

worldly pulsar
#

I think that was the idea with Unity ECS (systems build the job graph), but then you get restrictions on structural changes being main thread only and the idea breaks

vagrant surge
#

@worldly pulsar or if you have to read/write from normal unity land

#

where hard syncs are needed

#

overlapping the systems like this is pretty hard

worldly pulsar
#

@hollow sorrel yes if nothing else Complete()d the handle you returned from JobComponentSystem.Update() then the same system will complete it on the next frame

#

if you didn't include the job handle in what you returned then you have to complete it manually (there are some additional smarts for IJobForEach and friends)

hollow sorrel
#

so system decides? e.g. if you update your system at 1 fps it'd have 1 second to complete its jobs?

worldly pulsar
#

the handle you returned will almost certainly be completed somewhere else if you scheduled any IJobForEach

#

I definately wouldn't depend on the "complete next frame" behaviour. If you want to complete the job manually (and don't introduce data races) then store the handle and call Complete() on it

hollow sorrel
#

ah so if you wanted it to take 1 second, instead of returning the jobhandle in onupdate you'd store it somewhere else (e.g. the system)

worldly pulsar
#

Yup, just make sure you don't touch any data used outside of that job. The safety system should tell you if there are problems.

hollow sorrel
#

makes sense

#

so from the discussion above i gather the answer to seperate render world is "it depends"

worldly pulsar
#

Outside of the double-buffering idea I mentioned (which I spent ~15 seconds thinking about so I'm sure it's rock solid), I don't see a good reason for a separate rendering world in Unity ECS

zenith wyvern
#

The context I've always seen it mentioned from unity people is when you're doing networking and want to easily be able to send your data over with wire without having to worry about rendering stuff

worldly pulsar
#

Yeah, that's a great use case, but not really "separate rendering". More like "separate client/server worlds"

#

Another would be if you need 2 physics worlds you don't want to interact with each other

near bronze
#

Has anyone been playing around with the noise from Mathematics? I've noticed the simplex has this weird artifact when you approach a position with x = y = z

mint iron
#

i thought the systems complete all outstanding jobs after every update loop; in other words by the time the system runs again it somewhere calls complete on any dependency it had returned from update. Although i cant remember offhand where it happens.

worldly pulsar
#

Anything that touches components is completed every time there is a structural change (see BeforeStructuralChange in EntityManager)

#

and the JobHandle you return from Update is stored and Completed the next time the system runs

#

but other than that I've never seen anything that would complete all the running jobs

gusty comet
#

Anything new on the dots frontlines?

dull copper
#

yes

#

(depending on how new)

gusty comet
#

I would say the last two weeks or so

#

Been a bit busy and had little to no chance to keep up to date with things

vivid loom
#

Request for pinned or otherwise "required reading" on dots. Other than the unity blog post and some pong tutorials I'm not finding a bunch about how to start working with it.

dull copper
#

@vivid loom have you actually looked at the pinned message on this channel? ๐Ÿ™‚

#

that's basically it, official manual and samples

#

rest are hopelessy outdated

vivid loom
#

Oof, I'm on mobile so maybe I can't see the pinned message. I'll have a look on desktop when I get home. Thank you for the input!

#

Ok, I found it. On mobile pinned messages are in the top right ... Drop-down.

worldly pulsar
#

lol, Windows Defender is blocking that dots.runtime package

safe lintel
#

how i do all my change logs
`## [0.1.0-preview.4] - 2019-12-11

  • Updates`
coarse turtle
#

Better than writing a changelog with the first line as "This may break." haha

mild ledge
#

Hey guys I'm trying to build the NetCube example into a server and a client executables but I have no idea what I'm doing. Has anyone done this ?

dull copper
#

there's new netcode and transport packages now as well

mild ledge
#

I managed to to it. The server part from the example was in #If UNITY_EDITOR, so that's why the server build did not work. I now got a server build that runs on the local network for now. It also builds to android and connects, so that's nice

silver dragon
#

Seems they are working hard to get everything out before xmas, so we have busy holidays ๐ŸŽ„

dull copper
#

well, 2019.3 will not be out ๐Ÿ˜„

#

we aim to have polished everything out to enter the official full release status in January 2020. from latest blog post

zenith wyvern
#

Make sense, it seems like they're really been scrambling to get everything ready

dull copper
#

that was unexpected but when you look at the issue list, it's no wonder they had to push it back to next year

fair condor
#

Does anyone know if there exist any utilities for converting a Collider type component to a Physics Shape component?

coarse turtle
#

Like a physx Collider component?

fair condor
#

Colliders like "BoxCollider" and "MeshCollider" etc..

coarse turtle
#

Ah - yea I dont think there's a way to automatically convert that

#

You could create some sort of mapping on the conversion system side which adds the appropriate Physics Shape component

fair condor
#

Ah dang. But thanks!

The problem is that we want to define the colission filters, which we can only do on Physic Shapes components, as far as I'm aware.

#

Could ofc add a conversion system that did it, with a component to specify it, but would rather just convert it.

zenith wyvern
#

Why do you want the box collider if you're using physics shape?

fair condor
#

I don't want the box colliders -_-

#

They do get converted just fine tho, but just can't set the colission filters

#

But we have a ton of objects that needs to be converted so probably going to write a converter

amber flicker
#

you could maybe try something like [UpdateInGroup(typeof(GameObjectAfterConversionGroup))] public class SetFilterSystem : GameObjectConversionSystem which runs after the initial conversion and sets the filters correctly?

fair condor
#

@amber flicker Nice, good option. But don't always know what the filters should be, they need to be specified by the designer in some cases.

amber flicker
#

hmm then a custom component seems the way to go? Or possibly both solutions - add a component for when you want to specify

fair condor
#

@amber flicker I'm too stubborn hehe. Converting all Colliders to Physics Shapes, it didn't take that much writing. If anyone searches and wants the script just ping me.

amber flicker
#

I think I didn't properly understand what you were trying to achieve but glad you sorted it ๐Ÿ˜„

fair condor
#

Haha ๐Ÿ˜„ thanks for the suggestions tho!

I wanted BoxCollider compoenents to get removed, and add in a Physic Shape Authering component, with its settings set to match the box collider.

#

And vice verca for Sphere and MeshColliders etc..

lament orbit
#

Anyone know if DOTS 1.0 coming with 2019.3 in Jan or is that coming later ? Thx

gusty comet
#

One thing I am curious about is how the whole convert to entity thing works if you inect a gameobject. For example I was trying do something super basica aka a RTS style camera and wanted to do it in pure ECS but I have no clue how the heck I would identify the injected gameobject. According to the inspector it only has the default components of an entity so I dont know how to even start.

#

And in the entity debugger I cant see what systems act on a specific coponent or have acted on it previously

#

so I have no way to find out and I dont seem to find any documentaiton on the matter as well

unborn totem
#

i'm still waiting for that DOTS beginner project to come out this year

#

last I used DOTS, the HybridRenderer completely broke because I had 4096 gameobjects with Materials that were using Material Property Blocks

#

so hopefully that's fixed

gusty comet
#

It just to me feels too much is still obfuscated or at least badly communicated to make it practical to use

unborn totem
#

well it's not being done developed

#

there's been very little in the way of how to use it properly, and maybe because it's not done yet

gusty comet
#

Well the funny thins is they claimed a state less then what we have now was used to do megacity

#

so either they where crawling slow or that was an outright misinformation

zenith wyvern
#

I mean you can download megacity for yourself to see how they did it using what we have available now

gusty comet
#

You cant do something on that scale without having an established workflow as I see it

unborn totem
#

yep, you can do that, though it may not be easy to tell

zenith wyvern
#

Literally the entire project and all source is publicly available

gusty comet
#

Yeah I am not saying you can't do it, I am saying they do not communicate how anywhere

#

Sark the source does not tell you or let you deduce the workflow

zenith wyvern
#

I agree the documentation is horrible right now, but it's not fair to say that they misinformed us about what it's capable of

unborn totem
#

i agree

#

they've never recommended anyone make a production game with it yet

amber flicker
#

I also think that what docs are there are quite good.. just want to see more of it

dull copper
gusty comet
#

The idea is to test it for production viability no?

dull copper
#

so no, it's not coming yet

zenith wyvern
#

Yes, everything available right now outside of base dots is in beta or alpha

gusty comet
#

Also I think you all might overestimate how much can be done till its production release date. The fundamentals wont change much till then. So best we can hope is better documentation.

#

I mean I would not still tinker with it if I would not care.

#

because I really want to use it as it progresses, but fear they are half baking this

#

And the fact that they fragmented the tutorial space with their approach does not help the matter

#

As I said last week I think the whole thing was made public a year too early

amber flicker
#

i'm personally v glad they made it available when they did

hollow sorrel
#

i think current docs are already pretty good at explaining the core principles, it doesn't make sense to document entire conversion workflow right now because they're still figuring that out
a couple weeks ago they made big changes to subscenes adding versioning and whatnot and not too long ago they added being able to add regular classes as components for example

dull copper
#

I think only issue here is how they present things at Unite & GDC

#

it sets false expectations to people

gusty comet
#

yeah that was one major issue @dull copper

dull copper
#

but having actual users using it as early as possible is great IMHO

gusty comet
#

Because right now pure ECS is simply not possible as I gather

dull copper
#

this way they can correct the course in more agile ways

hollow sorrel
#

i don't think making things public too early is ever a bad thing unless you're talking about public perception

dull copper
#

they are making this for us

#

so why wouldn't we test it as early as possible

gusty comet
#

They even distinguished between the hybrid and pure approach in their early talks

dull copper
#

if you remember how SRPs were initially

#

almost nobody could use them at first

zenith wyvern
#

The idea of pure is gone. Forget about it

gusty comet
#

then backpedalled to "hybrid is a 5 year thing"

dull copper
#

and now they are finally maturing

zenith wyvern
#

They have been open that it was a mistake

gusty comet
#

sark if that is the case its dead on arrival for anything but major studios

unborn totem
#

i didn't realize pure was a mistake

zenith wyvern
#

I don't see why. They are trying to leverage all the work they've done with prefabs and gameobjects for edit time, then use entities at runtime for performance

gusty comet
#

It wasnt, it is just that production reality caught up to their overpromises

hollow sorrel
#

no pure is still recommended i think sark is talking about the conversion workflow which still uses gameobjects

zenith wyvern
#

It seems pretty reasonable to me. Right now the conversion workflow is horribly undocumented but it's coming slowly

hollow sorrel
#

but at runtime you'd still have a pure ecs game

gusty comet
#

because you loose the major benefits sark. If you have to reach in and out constantly the overhead eats up your gains

#

and then some

#

its not just the workflow that suffers there

#

authoring part completly aside if you have whole aspects that are non ECS that has to interact with the ECS part its non threadable or jobable for the most part

#

which eats any gains you might have had

zenith wyvern
#

If you're ignoring authoring then yeah I'm pretty sure their goal is to have everything at runtime be pure entities

gusty comet
#

the thing is you have a lot of current staff without any entity representation and that will not be done till it releases

#

they miss even some very fundamental parts on that let alone the more obscure things

hollow sorrel
#

yes the woes of basically making a new engine

zenith wyvern
#

Yeah, lots of stuff is still in the middle. Rendering in particular is really bad right now, the hybrid renderer is extremely limited

gusty comet
#

not just rendering. Stuff like lighting, input handling and much much more

hollow sorrel
#

lighting and input handling wouldn't be ecs anyway

gusty comet
#

heck even data transformation of anything that is not a base type

hollow sorrel
#

lighting is handled by srp and input handling is a seperate thing

#

which you can already use in ecs

#

and in data oriented design you basically throw away the concept of inheritance

#

forget it exists

gusty comet
#

scorr you can handle it but again you reach out doing so, loosing any ECS benefit. You have a reperesentation of it that does not gain the benefit

#

aka you morph what you have into an ECS pattern, but its not representing

hollow sorrel
#

that is not true

#

input handling for example is a thing that stands outside of ecs

gusty comet
#

yes, and it should not.

hollow sorrel
#

i don't even know how you'd make an ecs based input handler

gusty comet
#

ECS and monobehaviours are fundamental opposites and should at not point intersect

hollow sorrel
#

input handling isn't done with monobehaviours either afaik

#

the idea is you create a component with your input (e.g. motioninput that holds your axes) and populate it from your input handler which can be done from inside a system

zenith wyvern
#

I don't see what you would gain from trying to force input handling into ECS. You get your input in a reasonable way then inject it into your systems as needed

gusty comet
#

sark you would gain that you stay within one paradigm, and retain all benefits that ECS provides

hollow sorrel
#

and the srp's (for lighting) don't use monobehaviours either and can be used with ecs already

gusty comet
#

I am just baffled that something like a simple extension for monogame did a better job in a proper implementation of it.

#

Monogame extended has a full blown ECS implementation that works top to bottom

#

I did a prototype in it within a few hours compared to fighting against the mishmash

amber flicker
#

so use that?

hollow sorrel
#

nice just port that then if you still want to use unity

gusty comet
#

I think you miss the point. Yes I could just use that. My point is that I think that Unity could do far better then they did.

amber flicker
#

Perhaps it would help if you could give more explicit examples of what you're disappointed with Yuuki? I don't think anyone here feels like it's perfect but... Unity's approach to me seems fairly intuitive and they've explained why they've made certain decisions and most of the source is available to view too

hollow sorrel
#

yea sorry i didn't mean to sound dismissive

unborn totem
#

I won't be happy until something as basic (in my view) as the Rendering works as fully features as current Rendering does

#

the fact I had any difference in my materials meant the hybrid renderer couldn't group my entities into chunks properly, and I ended up having 1 entity per chunk

gusty comet
#

I am dissapointed primarily that they force an OOP system and an ECS system to interact which as I said reduces or outright negates the benefits. ECS is a wholly different pattern that does not mix and match well with OOP design principles.

unborn totem
#

they haven't been shy about trying to coax people away from OOP principles, but have been making a lot of concessions

amber flicker
#

So... you think they should.. replace everything at once? Or make monobehaviours incompatible with ECS or..?

hollow sorrel
#

@unborn totem while i do think there should be a seperate solution for "one-off" rendermeshes so they don't get allocated their own 16kb chunk, your instanced meshes shouldn't really be different at material level
if you want to change material properties you should be using materialpropertyblocks (which was only added support for a few weeks ago so i understand frustration there)

gusty comet
#

I would have prefered that they would have kept ECS segregated yes and develop it as they went along and at one point far down the lane they discontinue the old system yeah.

unborn totem
#

@hollow sorrel last time I checked, HybridRenderer did not support material property blocks

#

but if it was recently supported, awesome

#

i haven't touched ECS in months

amber flicker
#

just... don't look at it until 2022 is my recommendation... meanwhile some of us are getting good mileage out of it already and are happy to be involved in the early stages to help guide it

gusty comet
#

I would not be here and not tinkering with it if I dont believe in it. As much as I rant I like the system

unborn totem
#

damn, looks like it's only working in HDRP

#

shame, but I guess they are trying to make fancy looking demos first

gusty comet
#

I come from roguelikes where ECS pattern is nothing new so I might have had a bit too high expectations

hollow sorrel
#

@gusty comet the main focus is that you do not have to interact with OOP systems from ECS (unless you are talking about things like input handling which is different)
and the only reason you do right now is because not all systems are ready yet or you want to use old stuff

gusty comet
#

It would help immensly if they just improve the entity debugger, to show an entitys archetype and all its components especially for game objects that are converted and injected

amber flicker
#

do you have the dots editor package installed?

gusty comet
#

until you just mentioned it I was not even aware this existed I have to admit

amber flicker
#

that's definitely a problem at the moment - knowing things exist... but yea, check it out - it might help a little

unborn totem
#

it does help

#

i think that was how I realized every chunk contained 1 entity when I was trying out the HybridRenderer months ago

amber flicker
#

@unborn totem you may be referring to the entity debugger.. there's an additional package that shows previews of conversion of gameobjects just in case you weren't aware

gusty comet
#

It seems that only works if you use an authoring system to convert it?

amber flicker
#

ah so what it does require is being in a subscene I think

#

because it's then automatically being converted to that subscene's world

#

(and also the editor world)

gusty comet
#

Even in a subscene it gives me nothing

#

Oh wait it took a moment to load

safe lintel
#

you do need to use authoring for the dots inspector to work

gusty comet
#

That is indeed helpful since now I at least have an idea what I am actually looking at after conversion, much appreciated.

amber flicker
#

afaik you only need to use authoring in the sense that a monobehaviour will get removed unless it implements either IConvertGameObjectToEntity or the auto generate attribute - i.e. however you convert it, it should be displayed

gusty comet
#

Do we have any documentation on the built in components unity uses as to what they mean?

amber flicker
#

like the SceneTag and others? not afaik... I'd love some

gusty comet
#

I was just looking at the camera and saw some things where it seems to have some sort of odd referential data

safe lintel
#

i assume thats to differentiate entities to particular scenes for loading whole scenes in/out

amber flicker
#

yes... there's stuff to do with blobassets, scenes and sections within scenes

#

but, for example, it's hard to know what you should do if you want to create an additional entity beyond the one being converted

gusty comet
#

that is what I am trying to discern right now

#

As I have been on record saying, I love to poke at working stuff to see how it works

#

and I was hoping that I might could learn something by doing so

safe lintel
#

@amber flicker conversionSystem.CreateAdditionalEntity(gameObject);

amber flicker
#

that's one way yes

lament orbit
#

@dull copper thanks

dull copper
#

about that entity preview thing

#

for me it broke again after I added netcode package

#

without it, it worked just fine

#

but I haven't tried with todays netcode update

amber flicker
#

btw it seems as though entities created with CreateAdditionalEntity don't actually save with the scene unless you manually add the SceneSection tag with the same values as on the main entity. That sounds wrong but it's what I observe. Have you seen anything similar @safe lintel ?

safe lintel
#

by save you mean once you close the scene and let it load in? either way, it gets auto added for me, and i create a number of them(but I do get a strange issue where attempting to add these entities to a linkedentitygroup doesnt appear to be working...)

amber flicker
#

yea, as in saving the scene and closing .. when I hit play the entity won't exist unless I add that component manually

#

I wonder if it's because I have to create it within the AfterConversion group

safe lintel
#

i havent got any special conversionsystems going for my current subscene entities so possibly

vagrant surge
#

Unity Tiny was supposed to be the whole "ECS top to bottom" thing

#

starting with 2d

#

and then eventually integrate more features into it as more DOTS stuff is created

#

yet its basically been cancelled. They did 2d full ECS with javascript

#

then they scrapped the entire js stuff to do 2d with C#

#

removing like 80% of the features

#

and then they scrapped all the 2d stuff

#

and now it will be conversion workflow with simple 3d

#

the timeline of Tiny is extremelly dissapointing

unborn totem
#

huh

#

first news I've heard about Tiny in awhile

knotty radish
#

Hey everyone, I was wondering how the update order works with multiple worlds.
Let's say we have World1 and World2 (created in that order in the bootstrap) with the same systems. Are all systems from W1 updated first then all the systems from W2 ? Or is it working with the SystemGroups ? I feel like it's something like flatening all systems existing in your project sorted with their groups (updateingroup, after, before) and then if a system exist in world1 and world2, it will be updated based on the world creation order.

worldly pulsar
#

Updating system groups I belive is currently a tree traversal, each group has a List<ComponentSystemBase> it calls Update() on

#

been a while since I looked at that part of code tho

#

and each world has its own instance of each system

knotty radish
#

Yeah they do have their own instance, but that doesn't explain in which order (or how) worlds are updated

tawdry tree
#

I would assume, and treat, worlds as arbitrary order unless you specifically handle it

#

Internally systems use normal rules, as long as you've set them up corectly (no auto-setup in non-default worlds)

knotty radish
#

There is no way to custom update worlds at the moment

worldly pulsar
#

World has a public Update() method that just updates the 3 built-in groups, that doesn't fit your needs?

manic nebula
#

I know this is a bit of a dumb question but what exactly is the difference between Burst and IL2CPP?

worldly pulsar
#

Il2cpp is a compiler that turns any IL into C++ (that is then compiled by a cpp compiler)

vagrant surge
#

@manic nebula IL2CPP is fully normal C#. Burst is a highly restricted C# subset that uses those restrictions to be much faster

worldly pulsar
#

Burst turns a rather strict subset of IL directly into a highly optimised machine code

manic nebula
#

i see

#

and when should I enable Burst?

vagrant surge
#

whenever you can

manic nebula
#

and its only for jobs right?

worldly pulsar
#

There is a way to compile a delegate into a function pointer, but you'd have to search on how to exactly do that

#

the usual way is to burst-compile jobs, yes

manic nebula
#

ok got it

worldly pulsar
#

in the new JobComponentSystem you can do
Job.WithCode(()=>{/*code here will be turned into a job and burst-compiled*/}).Schedule(deps);

manic nebula
#

since i am comfortable with a very OOP system im sticking mostly with the traditional coding way but there were a few things that i think could get big performance gains from multithreading so i was just looking into using the c# job system at a fairly basic level

knotty radish
#

Yeah I was just looking at this method. I don't have a specific need, it's just curiosity.
It seems like this method is never called ? It's weird but this is used for updating the worlds then it answers my question about order

worldly pulsar
#

Yeah, the in-world order is just a tree traversal through all the groups. No clue how/in what order exactly the worlds are updated.

dire frigate
#

is there any word on Physx components becoming jobs compatible? ๐Ÿ˜…

#

(Rigidbody, Character Controller)

knotty radish
#

And actually that method would be quite useless if I trust the doc:
"There is currently no way to manually update every system in a given World; instead, you can control which systems are created in which World, and which of the existing system groups they should be added to. Thus, a custom WorldB could instantiate SystemX and SystemY, adding SystemX to the default Worldโ€™s SimulationSystemGroup, and adding SystemY to the default Worldโ€™s PresentationSystemGroup. These systems can order themselves relative to their group siblings as usual, and will be updated along with the corresponding group."

hollow sorrel
#

@dire frigate nah they're basically ditching physx for havok (and their own free implementation, but trying to sell you havok)

dire frigate
#

Oh... Well hopefully they bring out some more guides on howto interact and write your own character controller. Seen some of the examples on their git but it just looks overwhelming

hollow sorrel
#

yea i'm interested in that too

#

for kinematic i mean

dire frigate
#

yeah

hollow sorrel
#

typical way is doing collidercasts to check collisions which i think is also what their kinematic charactercontroller in samples does

but apparently kinematic bodies also generate collision events in new physics so i'm wondering if that can somehow be used for detecting collisions without having to do your own casts
only problem is i dunno how to get the collision data (e.g. how far penetration is) from the collision event

#

or if it's even worth doing

near bronze
#

Guys, when I'm doing mesh.SetVertices with a NativeArray, and then later I'm calling Dispose(), am I disposing the part of the memory that was holding all of the vertices - meaning I'm disposing the vertices I've just set? Or is it actually creating a copy and then setting that copy?

worldly pulsar
#

no, SetVertices copies the data

near bronze
#

Okay, I thought I was losing it lol, thanks

worldly pulsar
#

oh, yea, that was a facepalm moment when I've seen that

#

ehh, seems like the IL Postprocessing can crash your build even if you never use the Entities.ForEach :/

solemn ice
#

Let's say I have an Entity in an custom editor script, is there a way to display the entity inspector data like when I select an entity in the entity debugger? Either by displaying it as is, or by having a button I could click to select the entity in the entity debugger?

vagrant surge
#

hey its easy as hell to follow

#

super simple code, mayority of it just ForEachs

#

most systems sub 100 lines

amber flicker
#

nice... as an aside.. I created a .buildpipeline... how do you actually.. use it? ๐Ÿ˜…

#

i.e. build using it

worldly pulsar
#

create the BuildSettings asset

#

its inspector has a button at the top

#

you can attach the pipeline in the ClassicBuildProfile section

amber flicker
#

oooooh thank you.. I created a BuildPipeline asset.. now that I've created a classic build settings asset instead/as well, I can see there's a build button

hollow sorrel
#

oo project tiny update

#

nice that it's now just regular unity with different packages instead of a seperate editor build

dull copper
worldly pulsar
#

And Windows Defender keeps insisting that bee.exe is malware... 95% chance it's false positive, 4.9% my machine is infected, 0.1% Joachim started phase 2 of his world dominance plan.

dull copper
#

yeah, I get that too now

worldly pulsar
#

Ok, so that 4.9% is now gone.

hollow sorrel
#

what's bee.exe

worldly pulsar
#

the new build system

hollow sorrel
#

This program has potentially unwanted behavior.
sounds like normal unity

dull copper
#

I posted about that on the forum thread

safe lintel
#

What is bee.exe? My antivirus is reporting it as suspicious.
Bee is our new build tool. It sometimes incorrectly gets flagged as suspicious. We will be signing it in a future release. The bee.exe shipped with 0.1.0-preview.4 of the DOTS runtime has a SHA-1 value of bac55f9250ffe1874e04a289f7ec21a004e6437a.

worldly pulsar
#

(cpp build system to be more specific, Tiny comes with full sources)

dull copper
#

ah

#

why wouldn't they sign that if they know it's causing issues

safe lintel
#

i wonder if using tiny you could embed a game within a regular unity game

deft niche
#

Skyrim in all unity games.. lets do it!!

hollow sorrel
#

hhaaa

#

unity tiny game embedded in unity game sounds glorious

#

not sure if it's practical since at that point you could just make the tiny game in regular unity

#

but glorious nonetheless

safe lintel
#

playable ads has me recoiling so hard, but something like how they put wolfenstein in wolfenstein would be fantastic

gusty comet
#

is there a way to use unity.physics distance queries with non-uniform scale? distance queries only take rigid transforms as a parameter, which discard scale information

#

applying uniform scale to the new colliders isn't a problem, of course, but I'm failing to see how I could use non-uniform scales

dull copper
#

hmmmm, that tiny racing didn't use Unity Physics at all, there's no physics queries for collisions etc, it's all manually checked

worldly pulsar
hollow sorrel
#
While Unity.Physics should work, due to the lack of fixed-time updates, there are significant issues on platforms that cannot reach a high enough frame rate.  Full robust support will be coming in a future release, at which point TinyRacing will be switched over to use Unity.Physics.

from docs

#

also lol @ material per number

gusty comet
#

sorry for hijacking the conversation about project tiny, that was a random question I interjected that wasn't related to the project tiny sample at all ๐Ÿ˜…

safe lintel
#

i would assume there isnt a way, seems like unity physics only uses a bare subset of what the transform system covers(to my own disappointment)

hollow sorrel
#

seems like a common use case tho
maybe a workaround could be making your own system that modifies collider size based on scale changes

#

dunno if that's feasible

dull copper
#

I'm still amazed they haven't fixed the Unity Physics update loop

#

like if you use netcode package, they apparently have a workaround there

hollow sorrel
#

yea it's nuts, been what a year?

dull copper
#

and interpolation too

#

but these things should rather be on the physics package IMO

#

Unity actually wanted Unity Physics to be released at this point

#

Q3 actually

#

but it wasn't realistic at all even when they set that target

gusty comet
#

yeah, I'd assume having scale work would be quite common... then again, non-uniform scaling seems to be a tricky issue to tackle, I've seen a couple of other bugs and known issues related to that in other projects.

worldly pulsar
#

I would be really surprised if Entities went 1.0 in 2020.1 too

gusty comet
#

writing a workaround that modifies size is currently what I'm aiming for, which would work well enough for boxes and meshes, but I don't see how it'd work for capsules and spheres

safe lintel
#

for 1.0, the core ecs, jobs and burst seems to work well and they can say conversion and the state of just about everything else isnt really part of the core

gusty comet
#

yup, if the versioning is anything to go by, 0.2.5-preview doesn't sound terribly close to release

#

(for physics)

worldly pulsar
#

With the addition of codegen there are so many bugs to be fixed now

safe lintel
#

tbh im a little more surprised that hdrp is coming out of preview than i would be if they said tomorrow ecs 1.0 is out

worldly pulsar
#

I had the codegen thing fail in at least 4 different ways since they released it, one of which I still don't have a workaround for

#

Then again depends on that they mean by "out of preview". Can just release with a huge list of known issues

dusty scarab
#

Anybody has any explanations to as of why Megacity slows down my laptop so much that it's not workable? Apart from my lap specs being mediocre

#

19.1.14f version

safe lintel
#

profile it ๐Ÿ™‚

#

would assume its just too much for your laptops graphics card though

dusty scarab
#

I'll try that, thanks!
Tho 4GB isn't enough to atleast run?

safe lintel
#

what are your laptops specs? 4gb is not much though, i wouldnt be comfortable developing on that

dusty scarab
#

i5 7th Gen, ram 8gb and graphics 4gb and adrenalin.

Also, I don't exactly know what's profiling.. Is it like a button somewhere? UnityChanThink

safe lintel
#

oh i thought you meant 4gb ram not video ram, I misread that ๐Ÿคฆโ€โ™‚๏ธ

#

window>analysis > profiler

zenith wyvern
#

That post about Tiny says 2D in January, I wonder if were getting a proper instanced renderer at last

dusty scarab
#

@safe lintel one last thing, so after opening the profiler and trying to record, it just keeps loading forever. Am I doing something wrong or its just taking time

safe lintel
#

not really sure, it wouldnt take long to open

dull copper
#

btw

#

if you look at that TinyRacing project, it's still using old DOTS Editor package which doesn't do entity previewing

#

it works once you update it manually with PM

gusty comet
#

ooookay, small update on the scale: scaling actually works. RigidTransform apparently implicitly takes scale into account if you feed it a Matrix4x4 with scale encoded. However, it seems that distance queries for box colliders don't work with any kind of scaling at all. Spheres and capsules work fine, (even with non-uniform scaling, apparently) but boxes are having difficulties even if only the other body has a scale other than ( 1, 1, 1)...

thin tiger
#

Hi all. Quick question. If I'm doing ECS with Jobs system, what's the replacement for EntityManager.exists() to check if something has been removed? That works at just using ComponentSystem, but of course doest work for jobs

zenith wyvern
#

You can use ComponentDataFromEntity.Exists inside jobs

coarse turtle
#

Looks like this is made in dots ๐Ÿ™‚

thin tiger
#

@zenith wyvern will try, thanks

mystic mountain
#

Now that they changed subscene, how would one go about loading a map into one of the worlds and not all?

winter veldt
#

well that was an interesting bug

#

had a system that was just creating a number of components, just setting ints on em... and if i changed my code somehow, saved, and hit play.. the first result would be expected (components with an int value set from 0 to 32). if i hit play again (and every time after) the components would be there, but the int would be 0 to -32.

#

putting a debug log in the job, after the first run, the job wasn't even running the job... it just magically created the components at negative ints

#

restarted unity, and it's fine now

vagrant surge
#

@coarse turtle not only it is dots, its a great example of the simplicity dots brings now

#

now that generate-authoring-component and foreach exists

#

tho it has 1 flaw

#

look at the components folder

#

it has a fuck ton of files, one per component

#

and most components are a struct whose definition is less than 5 lines

#

unity needs to support generate-authoring-component on multiple per file ASAP

#

navigating 30 files is absurd

magic frigate
#

Would be nice to set a target file

worldly pulsar
#

The main reason I was waiting for [GenerateAuthoring] is I thought I could get rid of a folder full of XProxy.cs, all with a single line:
class XProxy : AuthoringFor<X>{}

#

The main problem not even being having a ton of files, or navigating them, but that adding a file means the .csproj is regenerated (2-3s wait in Unity), has to be reloaded in VS (another 2-3s), and on top of that usually breaks the "generate all .csproj" option so now you don't have all the package projects visible in VS

#

all that for something that should be just typing 3 lines in text editor

vagrant surge
#

in all of my projects i have multiple components per file

#

allways

#

so in this case, you could have something like SmokeComponents, and it holds SmokeUpdate + SmokeSpawner comp

#

and then you have SplineComponents and it holds those.. etc

#

or hell, just 1 big TinyCarsComponents with all of them

worldly pulsar
#

Pretty much what I do (CardComponents.cs, MapComponents.cs, EffectComponents.cs and so on...). And I really hoped I wouldn't have to keep another Authoring file for each and every struct defined in them

#

Apparently an editor limitation, so wouldn't expect it to change until at least 2020.1, probably later

vagrant surge
#

if they are already autogenerating the authoring component

#

why not put the generated code in another file

#

so you have your Stuffs.cs with 10 components, and it will create all the boilerplate in a temporal folder or something

inland root
#

@vagrant surge having multiple components in one file certainly sounds more data oriented. it keeps everything sequential in storage vs one file per component meaning possibly hundreds or thousands of tiny files bottlenecked by random IOPs and/or filesystem overhead.

vagrant surge
#

lol that makes no sense. Thats only for compile time

magic frigate
#

Makes me wonder how many components a serious project could potentially have

vagrant surge
#

in unity ecs, where its recomended you have tons of components....

#

easilly 100+

#

pushing 1000 on really complex projects

gusty comet
#

I dont think one can blanket state that. It depends on how generalizeable your game is

worldly pulsar
#

I have a NativeHashMap<int, int> with static data, generated in an editor script. I want to be able to associate entities (created through authoring) with that hashmap (i. e. at runtime, having an entity I want to get access to that hashmap)
The only way I can think of is:

  1. Serialize it to a ScriptableObject as a list of (key, value) pairs
  2. Attach that scriptable in the authoring
  3. Have a conversion system that takes those pairs and puts them in a blob asset, attach the BlobReference in a SourceDataComponent to the entity
  4. At runtime have a system that looks for SourceDataComponent, rebuilds the hashmap and attaches a HashmapIdx to the entity so I can do GetExistingSystem<HashmapCache>().GetHashmap(idx)

Please tell me there is a simpler way

dull copper
#

wonder how Unity is going to mix their dots visual scripting with regular code dots

#

I mean we all know it'll generate c# code

#

but like, could you just author for example components with the visual scripting and code the systems in visual studio still?

#

if you can have some GUI for quickly doing and navigating the components, it doesn't matter if you have ton of them each in separate files

worldly pulsar
#

I'm having trouble imagining a GUI that would be better/quicker than a text file

#

(and iirc they did say they are working on lifting the one [GenerateAuthoring] per file restriction)

dull copper
#

well, if you think about the component struct, it's just few variables there

#

it could be treated as simple asset where you setup/visualize these

#

since you do these a lot on DOTS, it would make sense to make it less tedious

#

even if it's just little extra work, it's still extra

worldly pulsar
#

What I mean is I can't really imagine a GUI that would be simpler than typing

[GenerateAuthoring] 
struct GridPosition : IComponentData { public int2 Value; }
``` in an already existing file.

Visualisation (esp. at runtime) would be great, but I think it's a separate problem
dull copper
#

for once, sure it's no biggie, but since you do this for everything, you still end up writing twice the amount you'd really need to make the thing vs what's absolutely needed if some tool understands this workflow

#

it's not a major issue

#

but I can see there being better ways to handle it

coarse turtle
#

a button to scan the assembly and generate the missing authoring components? ๐Ÿค”

dull copper
#

I could see some built-in tooling to treat ECS components as some separate data files which you could author with few button clicks

#

it's essentially what DOTS visual scripting needs to do anyway

#

but they'll probably embed the components somehow to the same file anyway

coarse turtle
#

I actually havent used the GenerateAuthoring workflow yet

worldly pulsar
#

(and btw. referencing generated code from normal code is one of the major things I hated about Entitas. Rename a field in a component, run the codegen, 100 compiler errors)

coarse turtle
#

Hoping I can try it this weekend

#

ah I didn't know Entitas did that

worldly pulsar
#

wait, it wasn't fields, it was component names mostly. like if you had MyComponent, they generated all kinds of helpers like entity.hasMyComponent, entity.AddMyComponent() etc

#

When I think about it, the [GenerateAuthoring] has a similar problem, but with serialization instead of code references.

#

heh, I only now realized you can change values in your authoring component in playmode and it updates the entity in realtime

mint iron
#

god, yeah i hated the code-gen in Entitas; i think it was the primary gripe looking around the internet.

vagrant surge
#

@dull copper they did that authoring thing on tiny

#

you could create new components with a few clicks in ediotr

dull copper
#

yeah, that's kinda thing I'd expect there to be eventually

#

could quickly make a custom editor tool to do this as well

#

it's like one day job :p

#

also DOTS will inevitably force Unity to add more variants to new scripts