#archived-dots

1 messages Β· Page 68 of 1

light sage
#

that workdsoutside jobs

#

but only if you have a reference to the entity in question is the hole

#

so if I run this

GetComponentDataFromEntity<OverlordData>( true );```
#

will it find the entity I need? it's not throwing errors let me test

safe lintel
#

well im assuming in your case you need to know the entity to use GetComponentDataFromEntity

untold night
#

it has the dictionary square brackets for access[entitygoeshere]

it also has an Exists(Entity e) function to check if it's there

light sage
#

so the dictionary is [index, version], so we set or get those, and what would the sytax for getting the reference through the dictiorary be?

#

I thought it retruned smth lol

untold night
#

Ah that function will return a ComponentDataFromEntity<T> structure. The bool flag is only needed for readonly.

#

the ComponentDataFromEntity<T> structure works like a dictionary, where the entity is the key and the T component is the value.

Exists(Entity e) just checks if the version for the entity is still valid

safe lintel
#

oh its (Job)ComponentSystem.GetComponentDataFromEntity
so in my case
ComponentDataFromEntity<Projectile> ProjectileData = this.GetComponentDataFromEntity<Projectile>();

untold night
#

OH YEAH. Sorry, I'm at work and all my ECS projects are at home

safe lintel
#

i shouldve searched the github samples first 😬

untold night
#

otherwise i'd just drop a sample in there

safe lintel
#

yeah thanks @untold night & @light sage , was wondering why you were getting the manager as I thought it was something to be gotten from a componentgroup

light sage
#

@safe lintel ah, ok, just checked back in after messing with GetType(), thanks for the syntax

light sage
#

Yep, so I see some light. I need to make my bootstrapper a JobComponentSystem and not a the Monobehavior, and that opens up a lot more options

light sage
#
        public EntityManager manager;
        public int x;
        public ComponentGroupArray<ShipData> entities;
        //insert job and onupdatehere
        var positionJob = new Simulate_Position()
            {
                x = GetEntities<ShipData>( )[0].hasMonopropellant
             };```
      this makes me happy
mint iron
#

hmmm, just found something pretty interesting, you can use foreach in a burst job if you use a ref struct enumerator

light sage
#

I'm used to just grabbing the length of the array or such in question and using a for because I can just use the local for value for indexing purposes. But I did realize upon reading, I'm reallu lacking in for loops, and kindof just making small systems and using them as my loops instead. It would be better to have larger systems as to not have to go through the components as often I assume, unless, those components are needed elsewhere also, but breaking components down into just a few fields instead of my 6+ field components would make large systems more feasable. Is that accurate, larger systems being favourable?

mint iron
#

that's a really good question, personally i'm not convinced splitting data up into such small pieces pays off if you have to spend a lot of time moving and massaging them, id love to read some benchmarks/comparisons anyone has done.

light sage
#

true, but I have some components that have a certain property that needs significantly more access than others, so for cases like that I think it's good because it frees any other properties that may have otherwise been clumped in that component to be used worry free by other systems, whole think is literally backwards though, sifting for you need instead of building it, ECS is wierd haha. It's like the two different kind of 3D printers, ECS is the wierd one the starts at the top

#

and I guess system size/component size is extremely dependant on exactly how my individual system-network is structured

#

very variable on a case by case basis

#

If the systems and components are too large it becomes exponentially more difficult to expand and grow your brainchild also. Smaller systems and components allow for scalibility without ripping apart big pieces of your earlier work. Something I'm coming to realize....scalibility is the only reason I wanted efficiency to begin with, but ECS seems hard to scale unless you have a good idea of what you're going for and good pseudocode from the outset

#

My last thought (sry if spam). Use smallest components possible to reduce the need to restructure all the time, and combine them towards the end of the project when the whole thing takes a solid form and dependencies, etc. are obvious and static

dull copper
light sage
#

that's awesome news! I knew something new had to happen soon.

#

the whole EntityManager Add/Remove/Swap Component = key to seperating and merginging systems as needed epiphany I had^

#

Conceptually I'm there now, but in practice I might as well be working with the large hadron collider and window screens (the criss-crossed wire, kinda window screen, that was ambiguous)

urban rivet
#

wut it mean

#

all I want is to vaguely blame unity and suddenly somehow my game is really fast, AAA and automatically networked. Anything else is unacceptable x 1000

untold night
#

they still haven't made the mmo button yet, have they?

urban rivet
#

I think blame is an evolution over having a magic button, you know?

#

thinking ahead here

untold night
#

although I suppose today it'd be a Battle Royale button

urban rivet
#

basically mapping left trigger to blame and right trigger to whine, one can get unity into a state where at least something will coincidentially happen in the trek toward our own battle royales

untold night
#

Apex Complaining

urban rivet
#

I'd love it if Unity announced it made all decisions looking at arowx threads

#

it's april next month, make it count

#

+few days

light sage
#

I'd buy unity premium if it came with "UNITY ECS for Dummies"

untold night
#

that book I recommended yesterday? It basically IS Unity ECS for Dummies (except in C++ and it speaks about the problems in general)

#

at least, it's as close as were going to get without more project samples

light sage
#

maybe there's a pdf

untold night
#

that are mature and not going to break 2 months later

light sage
#

a better understanding of c# in general would help me a lot too in all honesty

#

been a long time since java. (Something won't work and I think it should, I admit to sometimes just sticking => and where/set/from/etcetera for about a minute with very little logical basis. My favorites are "this" and "base", lol

#

In js and python with their implicit conversion I was literally in the habit of writing chains of nested code like 20 layers deep....

gusty comet
#

I'm generating tile positions inside a burst job, how can I sync those added positions to a sync system?
Remove burst and spawn dummy tile entities through a barrier? Injection is gonna be deprecated so I'm meh about that. If I do that, what to do with processed tiles? I need to process only freshly added tiles so do I destroy processed ones? Or add a processed tag component?
Or am I supposed to add new positions to a temp queue and send that queue to a syncing job with that barrier method?
Or maybe there's something else?

light sage
#

I would switch to quads instead of sprites with ecs, but I know that's not the answer you're looking for

gusty comet
#

@light sage Uniity tilemap is already working great for me. Only 5 batches for a giant level.

#

I just need to set the tiles from the generated positions continuosly cause the generation never stops.

light sage
#

that's how my game works it was tilemap at first

#

but I could do a million quads with ECS

gusty comet
#

Yes, just let me write a whole ECS physics system and tile rendering just for this small usecase.

light sage
#

I mean yea, I was just starting, if you're already far into dev, then hybrid si the only option

#

but everything is going to be bottlenecked by the monobehavior, since your tiles are 1 unit I'm assuming, make a separate x and y component

#

and create and entity for each tile with both components

#

so you have two systems in parallel, one for each axis

#

a database an option? if not it will be tough getting that data back to the mono

gusty comet
#

I don't really need the tile entities besides getting them to spawn as real tiles into the tilemap.

#

Well, I also need to draw positonal gizmos for debug information.

light sage
#

yea, I need to do toggle features for debugging too

gusty comet
#

A database? That's an odd suggestion.

light sage
#

a tilemap is a grid, sql based DBs are grids, it just makes sense, but I'm looking into bitmapping

#

maybe four bits per unit, with base 4 that's a lot of options

gusty comet
#

Nah, have no need for that.

light sage
#

but we have very different needs for tile systems

gusty comet
#

Well, I guess using System.Task is an attractive option for me since my generation algo can't be parallel ford anyway.

light sage
#

but you sound like your doing standard sprite sheet, tile system kinda deal? like old school or more like "don't starve" or smth?

gusty comet
#

Well I just have an infinitely generated upwards world of interconnected platforms with some bonuses. That is, infinite when I make the generation async. I just have 1 base tile for platforms and that's it.

light sage
#

I gotcha, yea, I was ecstatic when I hit "infinity". I can fully understanding wanting tiles, trying to think

#

store references to their transforms and just use an extra invisible layer?

gusty comet
#

Tiles don't have transforms. They aren't even gameobjects.

light sage
#

that's right, I forget how strange tilemap was

gusty comet
#

The approach of spawning enitities with a position for the sync comoonent system to process will work. It's just that I read about people suggesting sharing a container between systems on a forum but no code.

light sage
#

as long as the container has a unique component type

#

and entity manager can add/remove/swap components

gusty comet
#

I didn't mean DynamicBuffer attached to an entity, I meant a NativeQueue etc allocated from a system.

light sage
#

with injection out, and no native arrays in components and no instanced data in jobs

#

gotta temp alloc them I guess, I never figured out best way to get them from one job to anther and back to a native array, am still working on that, no documentation sigh

gusty comet
#

If you put the same array to both jobs it'll all be the same array no?

light sage
#

just use one job, ijobprocesscomponentdata runs in parallel, so just split it's functionality maybe

#

you can process componentdata with entity maybe, and have it in isharedcomponentdata

gusty comet
#

I was referring to your previous message. I don't want to crash by calling Unity Api from a job πŸ˜„

light sage
#

yea, it's annoying but you can't grab objects instantiated outside unless you bring them in through the filters, maybe pointers, but I'm not familiar with intptr use in c#

#

would it be too much overhead to just delete the old tiles?

#

ik it's bad practice, but tiles are cheap, right?

#

look at the hashmap stuff maybe, I haven't learned it fully yet, but it's a good option I think

#

reading from arrays is linear, ECS shines with Icomponent use, even en masse from my experience thus far

#

I know batching can read arrays dynamically, but

gusty comet
#

@light sage read my original message, deleting processed tile entities is exactly what I suggested πŸ˜„

light sage
#

ah ok then, I assumed you wanted to save and reuse them, I'm a hoarder sry

#

if your doing 1 tile = 1 unit, you can use int[] honestly, it's not much difference performance wise

#

unless it's like ridiculous amounts and speed

gusty comet
#

No, I don't care about them at all besides creating a real tile there. I already store them in a Hashmap for collision querying in generation.

light sage
#

you can get all entities from an entity manager

gusty comet
#

I know how to do what I suggested, I just wanted a betyer option.

light sage
#

but thae job is world differed though huh

#

keep us updated?

#

I need the info just as badly

#

lol

gusty comet
#

Heh. I'll keep trying tomorrow.

light sage
#

cool, I think IComponents for the axes, but nice bouncing thoughts banter :p

queen belfry
#

Hey guys! Question -- is there currently a solution for collisions / hitboxes that works nicely with ECS?

safe lintel
#

@queen belfry well the fps sample just got updated with some basic stuff that could be a good solution

queen belfry
#

Perfect! Thanks. I'll take a look.

safe lintel
#

"HitCollision no longer uses Unity collision system for queries against moving colliders. For lag compensation server needs to do queries using different historical data and moving Unity physics colliders multiple times per frame is very inefficient. Now queries are handled using custom collision primitives and burst jobs. The structure of the collider and history data is still WIP." https://forum.unity.com/threads/fps-sample-0-3-0-now-available.636883/

manic aurora
#

and moving Unity physics colliders multiple times per frame is very inefficient.

I do wonder if the eventual ECS-supported physics will not require the equivalent of "SyncTransforms" before every physics run. It's kind of nightmarish to reverse history like that while using Unity collision. Explicitly, you can't evaluate multiple histories in parallel...

light sage
#

I'm stupid...

#

zi thought the types for the jobs were exclusive,

#

whereas they're actually inclusive....

#

sigh knew something wasn't right

#

well....now at least I can develop 1000x as fast, feel stupid, but Iit's just a bunch of functions

#

must have gotten confused at the start when the first video I watched was talking about subtractive components

untold night
#

oh dear. yeah I can see how that might be confusing if you hadn't been looking at the concepts before

dull copper
flat talon
#

Finally they are doing the cleanup! πŸ˜ƒ its been a confusing mess lately with lots of out-of-date samples and new people learning from them and using Inject

light sage
#

(I think the reason I assumed the parameters were exclusive ratehr than inclusive was because of the position component. When I use "ShipPosition" and "Position" as parameters, only the ship's position is altered, so I saw it as the "ShipPosition" ComponentData field excluding any enity without that Component) ok, duh, they are exclusive, but to the entity, and not the job....
So being that they deprecated all the APIs I didn't use, and the fact that this is basically python now mean's all my frustration is finally lifted

light sage
gusty comet
#

Tilemap collider regeneration takes a long time even if I sync only 2 blocks per frame 😩 Guess I can't use it for continuous generation during gameplay huh.

#

What was that about ECS tilemap again? πŸ˜„

#

And I'll have to write a jobified physics system as well..

light sage
#

yea, that's a lot of ms

gusty comet
#

And then there'll be AI, heck.

light sage
#

I'm brand new to this, isn't rendering time of 16ms/frame the goal

gusty comet
#

Yes. Tilemap collider regen drops the frames more and more as more tiles are added.

light sage
#

ah

#

I just added scroll wheel functionality and added an occlusion type job that changes the grid size based on width/height, now I have to sync it up to different aspect ratios

gusty comet
#

Why can't you just change the orthographic size of the camera to zoom out?

light sage
#

that's what I do, but I don't want to be rendering quads that are outside of the viewport

#

I have a mirror, I'm either going to finish this and use it, or just alter the ships z-axis for zooming and leave the asteroid things alone

#

and I'm using perspective camera (for when I finally add the mouse drag and skybox rotating stuff, I'm going to need perspective lines when I add polyhedrons for the stars or w/e)

gusty comet
#

@light sage so do you just DrawMeshInstancedIndirect your tiles?

light sage
#

they're quads, not tiles, I swapped a while back

gusty comet
#

Cirles, pegs, you have things on a grid, yes?

light sage
#

It's an imaginary grid, not tilemap grid

gusty comet
#

I'm not talking about the tilemap package anymore.

light sage
#

I just create an entity for each one and give it RenderMesh as a Component

#

RenderMesh takes a property for Material and Mesh

gusty comet
#

So that'd work for a crapton of tiles?

light sage
#

yea, when I had it 2d, I created 1,000,000 quads, each 1x1 unit

gusty comet
#

Does it do culling?

light sage
#

it had to lol

#

crashed when I went to scene view but otherwise stable

gusty comet
#

Cool.

light sage
#

@gusty comet only things I don't like ECS for is something like

cam.fieldOfView += Input.mouseScrollDelta.y;```
#

and OnGUI(), everything else, ECS all the way

gusty comet
#

Should be simple to do in a ForEach from ComponentSystem πŸ€”

.. OnUpdate()
{
    ForEach((Entity entity, Camera camera) => { // We did it! });
}```
light sage
#

yea, that's a good idea, I like the new unity.Position a lot though, since it can be in IComponentData

gusty comet
#

I like how hands off non job component system is.

#

@light sage have you compared perfomance with IL2CPP vs Mono? Or it doesn't matter when most of code is Burst compiled?

light sage
#

It's hard to tell, I dropped an fps meter on but since I have so little overhead thusfar I was at stable 60fps with both. My stresstests have mostly been limited to editor, but I would say il2CPP would perform better for most games if I had to guess. You need a link.xml file to compile it though, at least I did, otherwise it can strip textures

gusty comet
#

Huh. I'll keep this in mind if I try il2cpp.

light sage
#

mono build is fine though, il2cpp is a headache, like you can't make a mac build unless you're using a mac, I guess because of the different c++ headers and source

light sage
#

@gusty comet Even on my crap[py PC in the Editor with OBS and 40 chrome tabs Open it can handle tons and tons of them without a hitch, but the collision testing that you're doing, I can see where that could be a huge problem. Any way to limit the scope of where you're testing for collisions?

gusty comet
#

@light sage I'm not testing a lot of collisions. It's just that when Unity tilemap is updated, its composite collider is fully regenerated from a bunch of disjointed blocks into whole polygon shapes.

#

Which takes more and more time the more tiles you have.

light sage
#

you are using Unity.Mathematics.mathnoise right?

#

math.noise*

#

if you're trying to do random stuff and not using the new math packet noise methods (there are like 50 noise methods) you're going to have waaaaaay mroe overhead and waay less entropy

#
                                a1 = noise.snoise( a2 );
                                a2 = noise.snoise( a1 );```

that generates sooo much noise it's ridic
#

just use a float 3 to set it up, then you can grab or x,y from either of those floats

urban rivet
#

random is not deterministic so with ECS you're better off performance wise going with one of the mathematics noise

light sage
#

are they grabbing fluctuations off the hardware hippocoder?

#

where do they get their entropy

urban rivet
#

just classic procedural perlin is enough for a lot of noise

#

or random.

light sage
#

gotcha

#

their just so lightweight that it's like I don't even have them in the code

#

zero ms difference with or w/o ~

dull copper
#

@urban rivet random is usually pretty deterministic if you provide the seed tho

#

and even more so once burst compilation gets determinism implemented

#

which btw, brings up another question, is Unity planning to give us Burst support outside jobs soon?

#

because I can't imagine people would run all their math code only in jobs

#

and right now you need jobs for Burst and Burst is needed for the determinism thing

#

would expect Unity to at least implement Burst support for ForEach as it would seem likely candidate for SIMD / vectorization

light sage
#

I don't see a reason not to use jobs when for anything other than GUI, camera, maybe some input, is there a good reason to not use them when you're able too?

dull copper
#

@light sage not every bit of code need to run in jobs

#

Have only health for player? Why jobify it

light sage
#

yea, I'm trying to work out how to integrate my gameclock, network stuff, gui stuff, etc. with the mono without bad asynch

dull copper
#

There are lots of small things you'd do basic math for that dont need jobs

light sage
#

I like the compartmentalizaton of the Components, and the jobs can talk with each other, and most of them share moving parts so it's best to keep most of my stuff in ijobs right now

#

also I'm using the new math library and burst with most of my current work

#

but I'll have "scenes" for the menu, and launcher and stations etc

#

and just drop dump those scenes and grab them when needed scenes since the garbage collector sucks

#

I need a good way to get back to universal (0,0,0) also

#

wanted to just simulate movement using the background to begin with, read it was bad, but now all I can think is rotate like 1 degree every for steps to circle 0,0,0 but that's a a big wrench in my plan if I have to do that

#

need ideas badly!

light sage
#

One posibility I'm thinking is using an additional cameral and buffering everything at a certain point, this is going to be a tough one

untold night
#

on the GC front, 2019.1 is introducing a new collector option that runs it over multiple frame.

Doesn't get rid of allocations but it does smooth the spikes

if you're using LWRP, they got rid of camera stacking and are replacing it with some kind of callback / interface replacement. I think they're still nailing that down and they will have examples sometime after GDC

light sage
#

nice, I want to look into that for sure. For a first project I'm giving myself 6 months for an alpha and calling it at that point, hopefully there's enough info for me to come to a decision on that

#

adn I have LWRP, I haven't applied it to the build yet though. Need to make a few mirrors for that and asset addresser testing

#

Unity.Transforms.PositionProxy() is something I probably need to go ahead and integrate

light sage
#

since ECS iterates through entities seperately I think the triggering an job that grabs everything with a Position attribute, and using an appropriate deltaTime, (probably a library to grab system diagnostics somewhere else to work with it) and just do a slow rotate based on velocity, and if not a slow rotate (because it's 3d, and I don't neep players tetering on the "borderline" at slow speeds rotating over and over iwhich could happen) , then a buffer and transform system to activate as worst case scenario.

urban rivet
#

I think it's better to just have the right system, so you have all these entities with component data, but the filters will process some with deltatime some without, sepending on what systems you are using... ECS tends to go bad when you fight it

#

ideally the best pattern is when ECS doesn't require external memory fetches during

#

or get that data prepared beforehand

gusty comet
#

Hi guys, the documentation say that we should split the game between, for example, a rendering world and a simulation world. One of the reason is probably to optimize chunk size, but what do you do when the simulation trigger a change in the rendering? Entity reference isn't a good option because serialize/deserialize or even moving entities is gonna patch them without the other word noticing (especially if you just serialized them). Should I try to filter my entities in the rendering world in a system just for that with a filter that allow the simulation world to refer to it easily?

urban rivet
#

What is the nature of the rendering change, first?

#

filter is your first port of call, as it's the simplest native option, followed by exotics... it's a good idea to share your problem on the ECS forum as staff and even the CTO of unity may respond to you there. Here, not so likely.

#

Discord is for the easier quickfire things

#

Unity wants examples that cause you problems in ECS so they can fix it for you

gusty comet
#

Copy that, I guess I'll see with them directly then πŸ˜‰

#

For this use case, well it's a procedurally generated game (each mesh is unique) so the player can come and modify meshes. Or some events could come to modify them.

#

But I think that an EntityMultiWorldSystem with a simple ID and some array to make the links is a good option here ^^

#

It's not like every entity will be multiworld obviously

manic aurora
#

id actually like to know more about that, too. i assume the premise is to run a relatively low simulation tickrate, and at the end of each simulation tick, move any entity that needs interpolated into the rendering world and update its position to the interpolated one each rendered frame until you need to do another one. copy the entities back to the simulation and set their position to the last simulated position.

it is pretty quick to move entities between worlds in my experience

gusty comet
#

@manic aurora That would depend of your use case but moving entities still mean memmove with some overhead and patching entities. My design split worlds into set of archetype that aren't too big. Because it's more cache friendly, because the streaming logic is going to be different (especially true if we speak about the rendering and anything else), and anyway grouping systems into separated world is a bit more organized than having archetypes with 20 components or whatever ^^ Obviously communication between world must remain event driven, otherwise worlds shouldn't have been separated in the first place.

manic aurora
#

yeah fwiw in practice i DON'T move my entities between worlds, my simulation is pretty lightweight

gusty comet
#

And I'll still need "pool" worlds to load and unload entities ^^

blazing pagoda
#

Huh ... Is a Nullable<T> never blittable ?

#

Its just a struct with a bool and my value, why not ?

untold night
#

right now, bools don't count as blittable

blazing pagoda
#

Okay

#

Why not, do you know ?

dull copper
tawdry tree
#

They're working on fixing it, but there are fixes out there, search for 'blittable bool' on the forums of 'unity ecs blittable bool' in general and you should probably find something.
As for why, some technical reasons. You could always just make a wrapper for a byte, though.

dull copper
#

you can also use old bool1 from older ECS version on newer ECS versions (but those blittable bools on the forum are probably better pick atm)

blazing pagoda
#

Unity.Mathemathics.bool2 seems to internally use actual bools with [MarshalAs(UnmanagedType.U1)] annotated in the latest version of Unity.Entities

#

I wonder if that'd work too .. ?

#

(Nope, it doesn't)

merry oasis
#

generics are managed types, so they are not blittable

#

(which is really quite annoying)

light sage
#

Was considereing when I used to play EVE and remembered that it doesn't really allow free flight (you can bookmark between warps), but it forces orbits. KSP on the other hand locks the ship at origin and moves the world. That's the dichotomy between the multiplayer and single player approaches. I think orbital mechanics can solve my floating point issue. Any chance that ECS will allow double point precision for it's Position component? (yea iirc, EVE is just linear trajectories, and orbital maneuvars, with no gravity, and ony the most insignificant amount of collision testing)

tawdry tree
#

It struck me a couple days ago, but if you have a sim/render split, you could sim with doubles and render with a floating origin.
I mean, you could even without the split, but with the split would be more ideal?

dull copper
#

@tawdry tree this is what star citizen does

gusty comet
#

@tawdry tree I made a floating origin system with ECS which resets the player position every 500m. Now I can fly thousends of kilometers without camera jitter.

tawdry tree
#

Nice. Considered putting that system on a Git or something? Sounds like it might be useful to the community, both as an example of ECS and of floating origin.

gusty comet
#

yes, when it is ready I can post it somewhere.

dull copper
#

rebasing the world isn't super complex itself, having everything else on the game engine to play nice with it is the real trouble

#

if game can use pure ECS, it's a whole lot easier though

gusty comet
near gulch
#

writing code in ECS is much more intuitive than OOP

tawdry tree
#

Sorta? It's a mindset kinda thing. If you're used to OOP and haven't done ECS, then you're gonna need to learn. From knowing neither...
I think OOP is easier to learn and get to the point where you 'understand' it (this is an object; a thing. it does stuff, has stuff, and is stuff).
On the other hand, after the initial learning bump, I think intuition about ECS should be closer to good/best practice without specifically learning about it.

manic aurora
#

does scheduling an IJobProcessComponentDataWithEntity using ScheduleGroup while having .SetFilterChanged set on the group actually work? i can't get it to, but the equivalent code using chunk iteration and chunk.DidChange() works fine...

manic aurora
#

hrm. ok. if i modify ComponentGroup.cs to expose SetFilterChangedRequiredVersion and call it manually with the LastSystemVersion it works fine, but that's a pretty undesirable solution! seems like SFCRV doesn't get called on its own.

dry relic
#

I'm just too use to OOP, I'd love learning ECS but with some things I don't seem a good design with ECS

#

For example my Messaging system, I can do in OOP a message with its data and when receiving it through network apply its behaviour

#

But in ECS I don't see a clear way through that

tawdry tree
#

In my understanding, you 1: Shouldn't need a messaging system if design well enough and 2: you can just spawn a message entity which the other system uses. If you need it to be consumed by multiple systems, then, uh, make a separate system that runs after everything else and then destroys it?

dry relic
#

I'm using Unet so I use the MessageSystem

#

Instead of Command and RPCs

#

But hummm yes, a message entity, I'm still learning the base of ECS

#

I've started programming with Assembly 8 years ago, OOP 6 years with Java so changing to ECS is breaking a lot xD

dry relic
#

And one last question, is Unity ECS production ready? Because it's still in preview packages and unity always say that never use preview packages in production

tawdry tree
#

WTF, starting coding in assembly? What kinda spartan fucking training did you go through?

dry relic
#

College xD

#

First course we start in Assembly then C

tawdry tree
lime dome
#

not that unusual. my first programming was in z80 assembly when i was 13

full stirrup
#

awful

tawdry tree
#

Which was how long ago?

lime dome
#

early 80s ;p

full stirrup
#

Back in the 1920s πŸ‘Œ

tawdry tree
#

From the sound of it, Xuzon started with assembly 8 years ago

#

That's 2010's

lime dome
#

assembly is still a valid language

full stirrup
#

Yeah

#

post room computer styled systems still exist

tawdry tree
#

Yes, but why in the world would you subject yourself (or others) to that?

dry relic
#

Yes 2010

#

XD

tawdry tree
#

By now it's extremely niche

lime dome
#

granted there's so many high level languages now, i don't really use it anymore except to tweak things i don't have source for ;p

full stirrup
#

^

lime dome
#

but you have to start somewhere

dry relic
#

In Telecommunications Engineering here we start from bottom then go top

full stirrup
#

Also use it in some hex dumps

and in other sides for profiling code

dry relic
#

Assembly -> C -> Java / C++

tawdry tree
#

C and C++ is already what I would consider low-level, if you go below that you're basically (in my view) working with machine code, or might as well.
I went Java->C and C#-> C++ in school (1st year, 2nd year 1st semester, 2nd year 2nd semester) and have later picked up Python and JS (and TS)

dry relic
#

I've started with C# on summer of my first course around 2011 with unity and I can say it's my favorite language xD

lime dome
#

Two roads diverged in a wood and I - I took the one less traveled by, and that has made all the difference. - Robert Frost

tawdry tree
#

Isn't that the poem which is supposedly ironic? There's some contention, at least.

lime dome
#

yes ^.^

#

i was curious if someone would know that

#

The poem isn’t a salute to can-do individualism; it’s a commentary on the self-deception we practice when constructing the story of our own lives.

#

but i think art like poems can be interpreted by the reader how they want. that's part of what makes art, art.

full stirrup
#

C++ is my favourite

lime dome
#

same, it compare everything to it

#

i consider it the gold standard of languages heh

tawdry tree
#

I dislike C++. Not enough to top out over Javascript(f*** Javascript), but header files and the amount of (forced) management, ugh. I suspect it would either fade or get worse (Javascript(f*** Javascript) hate contender?) if I worked with it more than the half a year I've barely touched it so far.

dry relic
#

C++ is cool for how much performance you can get

#

But some things are horrible

#

All the things you need to take care of (copy constructor, cycle composition etc..)

#

It's a pain in the ass

tawdry tree
#

Thing is, you can get that performance in other languages too (as they make a point of in the ECS talks - in one benchmark they even get better results with C#). I much prefer being able to avoid that hassle and the option of squeezing out more performance at the cost of bringing hassle back.

dry relic
#

I really should learn ECS for our RTS game

soft nova
#

Hmmm.... anyone had any idea why an Entity created on a Mono wouldn't be drawing with batch renderer, but if the same code (literally copy paste) is located on a ComponentSystem it will be rendered correctly?

light sage
#

@gusty comet I was asking about this last night, I'm glad you're working on tackling that issue, since I didn't want to refactor my whole 10,000 plus lines into an origin-centric model. I'm very satisfied with ECS, and just threw some sloppy code to make efficient later inside today so that it felt more like a game, and I'm just Using the basic "OnGUI()" stuff in my one mono. Two questions fro today. What lines of thought should I consider on making the GUI more efficient (right now I just have one system called GuiRelaySystem that does a pass over relevaant components and dumps the data to the mono to deal with. I saw EntityGuid or similar, but haven't picked it apart yet. After a lot of thought I've decided to go with a sigle player model since ECS is modular to the point of a future fork being quite simple, but my main question is whar is the best option for a DB, both for persistent data such as item profiles, locale layouts, save state, etc etc. I can't move on with any production at this point until I come to a decision on that. I had problems with SQLite before, but they may have been user end issues. so JSON or SQLite or is there a better solution? Sorry for the flood, thanks in advance!

#

@soft nova all of my entities (100,000) are created in my mono, and they are all processed in at most 13-14 batches of hundred each, is GPU instancing checked?

soft nova
#

Yes it's checked, it is even calling the batching rendering on the RenderBatch function, but they are not batched.

light sage
#

IJobProcessComponentData?

soft nova
#

??

light sage
#

was just wondering what type of job you are using are a struct template. 99% of my entities are as as basic as it gets, so idk, I'm sure you looks at this criteria already, but may be helpful https://docs.unity3d.com/Manual/DrawCallBatching.html? But I don't think it's the mono, as mine are born there, and I don't create additional worlds, only the default and automatically created differed

soft nova
#

I never said anything about a job. The RenderMeshSystem batches them if I create them on a ComponentSystem, but if I create them on a Mono the system does use the batching method for drawing, but they are not batched.

light sage
#

this is a one time or only periodic load? Yea, the mono should batch on load regardless idk as with most specific questions, it's difficult to deduce without source to pile over, I've had to create toggle features and use process of elimation while scouring forums a lot with ecs

#

Database solution though, that's something I have to decide (need insight) mch thx, don't want to go with the wrong choice there, and I'll look at my stack Rotary, see if I can gleen anything

soft nova
#

Alright, for now I'll have to create the entity on the mono, but let the ComponentSystem attach the renderer since that's the only way to make them be batched. I'll check on other version and project, perhaps something is broken on mine

light sage
#

@soft nova All I can really pull from the stacktrace is that a lot of JIT compilation is happening at the draw. I'm adding the position, rendermesh and one other component first, then I'm setting the data for each of those with the rendermesh data being the only static data. And this is all simply within a function called by awake() in nested for loops

#

@soft nova Also, I don't know your version, but this is labled RenderMeshV2 in the debugger, it's the latest repo I thinks

soft nova
#

RenderMeshV2 is 2019.1+ only. It has a preprocessor directive for that

dull copper
#

v2?

soft nova
#

Yes

dull copper
#

ooo, new ECS stuff on staging

#

com.unity.entities@0.0.12-preview.26
com.unity.rendering.hybrid@0.0.1-preview6

#

here's the whole new latest set:

{
  "registry": "https://staging-packages.unity.com",
  "dependencies": {
    "com.unity.burst": "0.2.4-preview.50",
    "com.unity.collections": "0.0.9-preview.13",
    "com.unity.entities": "0.0.12-preview.26",
    "com.unity.jobs": "0.0.7-preview.7",
    "com.unity.mathematics": "1.0.0-preview.1",
    "com.unity.rendering.hybrid": "0.0.1-preview.6",
    "com.unity.test-framework.performance": "1.0.4-preview",```
light sage
#

the last is new, no??

dull copper
#

on 2019.2.0a6 I still get this: Library\PackageCache\com.unity.entities@0.0.12-preview.26\Unity.Scenes.Editor\SubSceneTransformHierarchyHook.cs(31,16): error CS0246: The type or namespace name 'SceneHierarchyHooks' could not be found (are you missing a using directive or an assembly reference?) so it's likely still missing some API change from Unity side

light sage
#

and what could they possibly add to the mathematics library xD

dull copper
#

test framework was requirement for previous entities packages, I dunno if they still need it

#

and for math lib, that's kinda silly statement considering that math lib is still in preview and they keep constantly adjusting it for Burst + users needs

#

it's way simplified lib in comparison to the old unity math lib

light sage
#

does you error point to an assembly directive?

#

I'm still on 2019.1.* I was hesitant to switch before hearing reports

#

I'm more algebreically inclined, I wrote thi for velocity, but though the math lib should have something better

 math.sqrt(math.mul( rVel.rel_velocityX , rVel.rel_velocityX ) + math.mul( rVel.rel_velocityY , rVel.rel_velocityY ));```
#

I lost my focus somewhere amidst the quaterion section

#

Couldn't use ^ in a job, nor found a squaring function in the lib

solar spire
#

you mean math.pow()?

light sage
#

oof, thx (I get sidetracked in there parsing the shuffl and select stuff, the matrice stuff, and end up just overlooking I guess, I think also I was focused on finding a pythagoreom function specifically)

thick carbon
#

There's also math.length(), so you can pretty much save all of that

light sage
#

hmm, I'll look at it's params, thx Life

dull copper
#

hmmm, made local diffs for the new entities packages, Entities 0.0.12-preview.25 is where it's at, .26 only got one line fix for one test

#

this new entities package got some weird stuff, like mathematics lib extension for Hybrid Renderer

#

why on earth did they put this on Entities package instead of hybrid renderer

#

I'm guessing it's here because they did math extensions for regular Entities package too here

#

but still odd

light sage
#

bacthing determination exclusive to entities?

#

the dot() function is what I needed to understand, this helps a lot with getting the math lib

dull copper
#

Apparently there's a new parent system on Unity.Transforms now

solar spire
#

I really wish we got patch notes

dull copper
#

and yeah, they put Unity.Transforms.Hybrid here too

#

so I guess it's this is why that math lib extension is there

#

as they haven't split Unity.Transforms into two

light sage
#

we need a persisten data store inherit functionality

#

ugh, since I can't make progress on any other major hurdle I guess it's high time to implement the zed axis (gonna need a mirror or two or this is will be a mess)

dull copper
#

hmmmm, this is really weird

#

they just bumped up Rendering.Hybrid package number but did ZERO changes

#

(that's from my local git diff with this package)

#

@solar spire yeah, it does suck that the changelog thing goes to separate samples repo

#

still need to wait for Unity to approve these before they update that :/

#

ok so, they moved the AABB classes from Hybrid Renderer and put those back now to Entities package πŸ˜„

light sage
#

So you couldn't roatet skyboxes before ECS, but I'm thinking just add a rotation component to my skybox should work fine?

dull copper
#

these things now live in that Unity.Transforms.Hybrid

#

I'm guessing Unity will eventually split the transforms thing into separate package too

#

there's now FrozenStaticRendererSystem and FreezeStaticLODObjects system on Hybrid

#

they also made Hybrid min requirement to be 2019.1 which isn't surprising

solar spire
#

I would enjoy reading blogs about changes they make and why - it's been good hearing about the reasoning behind depreciation and I wish we got that sort of thing more regularly

#

I would lap up descriptive patch notes πŸ˜›

light sage
#

Or a comprehensive API

dull copper
#

they'd have less to talk about on upcoming events if they did that :p

light sage
#

we are ahead of the game at least

dull copper
#

API is always rapidly evolving on big new things like this

#

they already kinda have documentation for current setup on the samples github repo

#

but wouldn't expect tutorial like things before the first stable version is out

light sage
#

I've developed a system of random places and can generally find what I need now

#

I just never got to view the examples on the github, only the boids was there when I started dev (and the cubes)

dull copper
#

you'd want to check at least the changelog

#

as it gives instructions on project upgrades when moving from package version to another

light sage
#

Yea, componentdataproxy threw me for a second

dull copper
#

hmmm, github messes up that page history stats for me πŸ˜„

light sage
#

thx

dull copper
#

I'm guessing that's the first commit it appeared in?

#

I never paid attention to this before

light sage
#

weird, yea, looks like the cache isn't updating

dull copper
#

hmmm

#

it's not even first

#

so it's just messed up

light sage
#

no idea, so I'll just blame the dom in general

lusty topaz
#

Looks like 17 minutes ago, they push more samples.

dull copper
#

nice

#
New Features

- Added ComponentGroup versions of AddChunkComponentData, RemoveChunkComponentData and AddSharedComponentData. Also optimized the ComponentGroup versions of AddComponent and RemoveComponent. These can now be used to add and remove components to all the chunks/entities in an ComponentGroup. For components that don't change the layout of chunks (Tag, Shared and Chunk components) these functions will take an optimized path that migrates the chunks to new archetypes without copying the component data.
- Added new transform-related components as part of redesign (in progress)
   - CompositeRotation
       - PreRotation
       - PreRotationEulerXYZ…ZYX
       - RotationEulerXYZ…ZYX
       - RotationPivot
       - RotationPivotTranslation
   - CompositeScale
       - Scale (now for uniform scale)
       - ScalePivot
       - ScalePivotTranslation```
#
Changes

- 2018.3 support has been dropped. Please ensure you are on 2019.1+ if you want to keep getting new updates
- BarrierSystem renamed to EntityCommandBufferSystem
- Subtractive renamed to Exclude
        [RequireSubtractiveComponent] renamed to [ExcludeComponent]
- ComponentType.Create renamed to ComponentType.ReadWrite
- Transform-related component names changes
        Position->Translation
        Scale->NonUniformScale
- Attach, Attached components removed. (No transform hierarchy)
- ComponentDataArray, BufferArray, SharedComponentDataArray, and EntityArray have been deprecated. Please use ForEach, IJobProcessComponentData, IJobChunk, and ComponentGroup APIs to access component data.
- [Inject] has been deprecated. See the Injection documentation for more information.
#
- Component system update ordering is now hierarchical. A forthcoming document will cover this feature in detail. Key changes:
        Added ComponentSystemGroup class, representing a group of systems (and system groups) to update in a fixed order.
        The following ComponentSystemGroups are added to the Unity player loop by default:
            InitializationSystemGroup (in the Initialization phase)
            SimulationSystemGroup (in the FixedUpdate phase)
            PresentationSystemGroup (in the Update phase)
        Each of the default system groups contains a pair of BarrierSystems which run at the beginning and end of that group (e.g. EndSimulationBarrier).
            EndFrameBarrier has been removed; use the End barrier in the appropriate system group instead.
        Use [UpdateInGroup] to specify which ComponentSystemGroup a system should be added to during default world initialization.
            If omitted, systems are added to the SimulationSystemGroup by default (and will thus update during the FixedUpdate phase).
            Built-in ECS systems have been pre-assigned to the appropriate groups.
        Use [UpdateBefore] and [UpdateAfter] to specify relative ordering of systems within their common ComponentSystemGroup.
            Ordering relative to systems in different system groups is implicit from the group hierarchy; explicitly specifying this ordering triggers a warning and will be ignored.
        Added ICustomBootstrap interface to allow applications to partially/fully override the default world initialization process, support multiple Worlds, etc.
- MoveEntitiesFrom no longer remaps Entity references.```
solar spire
#

[RequireSubtractiveComponent] renamed to [ExcludeComponent]

#

makes so much more sense

dull copper
#

I just looked through Rendering.Hybrid changes and they actually removed [Inject] from it on preview.5 πŸ˜ƒ

#
Fixes

- Fixed bug causing incorrect read dependency error on Unity.Entities.Entity
- ComponentSystem.GetComponentGroup(...) will no longer treat two queries with the same component types and access modes, but in a different order as different groups.```
soft nova
#

What was the real use for attach? Seems like they removed that too

dull copper
#

hmmmm, those ECS samples run on project that's marked to be 2019.1.0b4

#

but newer 2019.2.0a6 doesn't have the required API yet, I would have suspected 2019.1 to require at least upcoming b5 at least as well

solar spire
#

renames BarrierSystem and then uses BarrierSystem throughout the rest of the change log

dull copper
#

hmmm, I don't get the errors on 2019.1.0b4

#

I guess current 2019.2 alpha's API is more outdated then, despite the 2019.2.0a6 being newer release than 2019.1.0b4

#

oh

#

this is new

#

that's monobehavior script you can attach to your gameobject

solar spire
#

you do good and fast work

dull copper
#

this basically lets you setup the thing in GO but immediately convert to entity, meaning you can still use the old editor but not have to rely on GameObjectEntity that exists on both sides (traditional unity scene and ECS world)

#

what's nice about this is that it also converts the child gameobjects and automatically sets the parent relations on entities

#

this is great as I've been wondering how I should do exactly this myself

#

(how to convert gameobject hierarchy to entities so I don't have to do manual setup for it)

#

this is actually now covered on first HelloECS example scene, they have two cubes as gameobjects, other is child of another and they only attach rotation component to the parent + that conversion script

#

when this runs, it converts both cubes and their mesh renderers to entities counterparts, destroys the now obsolete gameobjects and the new entities still hold the same transform hierarchy (child still rotates automatically despite there's no rotation script on it directly, it just follows the parents rotation)

#

anyway, new HelloECS samples looked good and simple, I like that they redid these

#

the old samples were really hard to figure out (especially what belongs to what when you start out)

#

ConvertToEntity is great for getting started in a simple scene and see the conversion workflow doing it's thing, but it doesn't help with improving load times. SubScenes do. Essentially when saving the scene, we also write out a cached entity binary representation. SubScenes is what allowed the megacity to scale, since we only ever load the game object representation for editing a specific part of the world:

dull copper
#

oh, you need to hit "Rebuild Entity Cache" button to get the subscenes running on 2019.1.0b4

#

it does work after that

untold night
#

Of course I finally get my input buffering working last night and now new changes to upgrade to!

knotty radish
#

What kind of things your input buffering is relying on ? This update is mainly deprecating Injection, adding a few things for subscenes and hybrid conversion and minor changes to transform system

soft nova
#

Found my issue, in case that anyone is wondering. I was assigning the RenderMesh data as following: EntityManager.SetSharedComponentData(entity, new RenderMesh{ ... }); which worked fine before since I wasn't using multiple objects with the same RenderMesh. Now I'm just using a cached RenderMesh for all the entities that share the same properties and batching is fully working.

solar ridge
#

Im sad that "- Attach, Attached components removed. (No transform hierarchy)" happened

#

Im hoping we get a replacement for it at least around GDC time

dull copper
#

what you mean?

#

you need something other than the transform parent system they have there now?

solar ridge
#

Did they introduce a new system recently?

dull copper
#

well, HelloECS samples demonstrate how parent rotates the child entity

solar ridge
#

Ah ok then that is new

dull copper
#

I dunno what you are after tho

#

but Parent thing is new I think

solar ridge
#

As long as it applies the transforms down the chain then it serves my purpose

#

IE: rotate the root, it rotates all children

dull copper
#

yes, that's what it does

solar ridge
#

I am now no longer sad

dull copper
#

should be obvious how it works after that

solar ridge
#

Ah they added a few more

#

They only had 3 when they initially changed to the HelloCube

dull copper
#

yeah

solar ridge
#

This is good to see

dull copper
#

I guess these samples don't talk about the parent thing but the ConvertToEntity sets these automatically when converting from gameobject hierarchy to entities

solar ridge
#

Their samples have improved DRAMATICALLY for how they present them

#

This makes me happy πŸ˜„

dull copper
#

yeah, I really dig the direction

#

the first ECS samples were a huge mess, I didn't even know where to start deciphering what belonged to what

knotty radish
#

I always use their Tests way more than their samples

#

Like for example the "new" transform system can be understood very easily by looking at Unity.Transform.Tests

#

For updating your current project you just have to replace Attach with Parent (we already had that component but it was redundant)

solar ridge
#

The only problem with that is that the tests are rather vast πŸ™ƒ

#

Too large of scope

#

Useful if you are exploring but not necessarily for all cases

tawdry tree
#

Well written tests are great documentation, though if they have high coverage there will be a lot to go through...

soft nova
#

So with this Parent component you don't need to create a new entity, jsut set that to the child entity then?

tawdry tree
#

Sounds like it works exactly like parenting a traditional GO

safe lintel
#

Am I understanding this correctly? the new entity update doesnt update the Translation Component(previously Position) if you are using the copyFromGameObject and only the LocalToWorld by design?

#

im supposed to use the 4x4matrix in LocalToWorld for my positional queries?

knotty radish
#

You could also use Translation but IMO LocalToWorld could be used for any use-case

untold night
#

Notes for the folks at home:

  • If you used the old Scale Component, it's now a uniform scale. If you need all 3 components separately, use NonUniformScale instead.
  • If you want to add a System to the new groups for custom bootstrapping, it's pretty simple. You'll still need to AddOrCreate them or use AddManager(YOUR CONSTRUCTOR HERE) before you add them to the group, the group add function won't do this for you.
#

Also yes, the parent component "just works", you don't need the song and dance of Attach or Attached anymore

knotty radish
#

@safe lintel but yes technically Translation isn't updated. If you know which components will change your position you know that only Translation will affect your position. If you don't want to handle the hassle of doing that, just use LocalToWorld or LocalToParent

#

But be careful, you may get a value that's not what you expect because of this:

#

// LocalToWorld = Translation * Rotation * NonUniformScale // (or) LocalToWorld = Translation * CompositeRotation * NonUniformScale // (or) LocalToWorld = Translation * Rotation * Scale // (or) LocalToWorld = Translation * CompositeRotation * Scale // (or) LocalToWorld = Translation * Rotation * CompositeScale // (or) LocalToWorld = Translation * CompositeRotation * CompositeScale

untold night
#

another note:

If you update the package(s) for ECS and Hybrid Renderer and clean up everything, but stuff still isn't rendering, try cleaning out your package cache / Library folder and regenerating it.

#

I had a bit where everything was running, but I had nothing actually rendering

safe lintel
#

thanks @knotty radish

coarse turtle
#

LOL I saw this on the forums, this was a very misleading title πŸ˜‰ (Edit of my old message to remove the user)

safe lintel
#

ugh had a system that was working just fine before this update and now its like only half working

manic aurora
#

hah i just finished upgrading a project from 2018.3 / preview 23 to 2019.1 / preview 26, total nightmare. i use a 3rd party dll that has the same name and namespace as one that unity.collections relies on, and that caused hella problems. i still have to delete the one from my package cache every time i open unity, because the one i'm importing is newer (by necessity)

safe lintel
#

@manic aurora yeah its a nightmare. fixed the showstopping issues but now its like why isnt the behaviour the same? id rather have unplayable errors 😦

manic aurora
#

yeah i agree you have it worse, hope you get it figured out

in other news i just commented out my entire project via picket fence debugging trying to find where a traceless leaked allocation was, but they were just being spammed in an empty project. restart of unity fixed it, but yikes...

dull copper
#

bool in componentdata when? πŸ€”

mint iron
#

hey umm, do you need to maintain unity's naming of key variables when building your own native containers. I'm wondering if the compiler only doing optimizations etc when it finds these specific field names

        internal unsafe void* m_Buffer;
        internal int m_Length;
        internal int m_MinIndex;
        internal int m_MaxIndex;
gusty comet
#

How do I conceptually connect components on different entities? Let's say I have a PositionPublisher with and id and a PositionReceiver that has a publisher's id and a position field for receiving the position. How do I iterate these related entities and update positions on receivers with positions of their publishers?

safe lintel
#

iterate through all entities to find the matching one?

#

thats how ive been doing it anyway

manic aurora
#

i assume you have 1 publisher -> many receivers? you can just maintain a map of publisherId -> publisherEntity and use that to look up the publisher from the receiver.

if a position receiver always references the same publisher, you could create a SharedComponent<SharedPublisher> containing the publisher id, then attach that component to the appropriate publisher and its receivers. you can then iterate all receivers per publisher more quickly, because you can filter receiver chunks by the shared component data index of the publisher.

light sage
#

Old hdd died, so on laptop waiting for my on downloads on my new SSD, but I grabbed the new 2019 Beta to try on this laptop. Does Translation correlate directty to the old Position, and also does ComponentType.ReadWrite() work the same as C*.Create() did? I can't get the version of VS on this laptop to connect to the editor executable atm

soft nova
#

Based on the changelog yes, ComponentType.Create was renamed to ComponentType.ReadWrite, which makes more sense than Create

light sage
#

It does, but I can't get my entities to render with the newest previews. I'm trying to do it the way I did before

//in declarations
public Entity MyEntity;
public Material m_material;
public Mesh m_mesh

//in Awake()
MyEntity = EntityManager.CreateEntity(
ComponentType.ReadWrite<RenderMesh>(),
ComponentType.ReadWrite<Translation>() );

EntityManager.SetComponentData(MyEntity, new Translation {
Value = new float3( 1 ,2 ,3 ) ) } ;
EntityManager.SetSharedComponentData(MyEntity, new RenderMesh {
mesh = m_mesh, material = m_material) };```
soft nova
light sage
#

ah, will try that thanks

light sage
#

@soft nova Thanks btw, you were spot on, glad it was a quick fix and I can understand the thinking behind the syntactical and requisite changes, they do give us more control over our systems at a fundamental level

soft nova
#

Np, yeah I agree with you there. I wasn't affected by the error since I am already manually adding local to world.

urban rivet
#

Any update on ECS audio btw?

#

I'm specifically interested in graph stuff for a physics based sound system so if any staff want a test dummy, please poke hippo on unity dots external or here

light sage
#

@soft nova I've been meaning to add it if for a while, but have just been coding around the issue. It's good that they're pushing me in the right direction

safe lintel
#

man got a weird bug in the latest entities package where using entity.Equals(otherEntity) doesnt appear to work in a job, dont suppose anyone else experiencing this? reporting it regardless

#

wish the bug reporter uploaded faster

knotty radish
#

Are you sure the id and the version are matching ?

soft nova
#

@light sage yeah, I even noticed that with the Parent you need to add LocalToParent too otherwise it throws an error. I prefer to add all the needed components on creation honestly so I agree that is good they are pushing us into doing it

light sage
#

Yea, I actually dropped down to just a camera instead of camera + other Game Object, but I did add another camera, to deal with the rotating skybox, but it will also come in handy for a reset to origin later. By doing that I'm trying to get as much stuff set up as efficiently as possible on initial load. I haven't even had time to look into the new parenting, too busy finally making use of the former "RequireSubtractiveComponent", since my brain doesn't run away from it's confusing name anymore

#

but by adding/removing components from large entity groups, it can work with the systems I already have to sharply reduce the number on entities they're processing. That and I have to find a good way to do the system groupings

light sage
#

I'm still unsure of the best way approach simulation world/graphical world dichotomy. In my mind the graphical world would always need to be a monobehavior, and the simulation worlds would need to be separate based on timescale dependencies.

worn stag
#

The Animation package brings a new animation system to Unity, entirely in C# and with performance in mind. It aligns with our DOTS coding style.

# Installing Animation

To install this package, follow the instructions in the [Package Manager documentation](https://docs.unity3d.com/Packages/com.unity.package-manager-ui@latest/index.html). 

# Using Animation

`TODO`

# Technical details

## Requirements

This version of Animation is compatible with the following versions of the Unity Editor:

* 2019.1 and later (recommended)

urban rivet
#

dots animation huh? interesting

worn stag
#

yeah, didn't try it tho

#

seems like its based on the same UNode stuff which audio will be

knotty radish
#

UNode sounds a lot like a visual scripting tool's name

dull copper
#

it's still typescript, yet pretty sure Unity mentioned next release will be c#

#

must be some compatibility thing

#

also get this with the new package πŸ˜„ error CS1029: #error: '"Unity 2019.2 or later is not supported by Tiny Mode yet"

#

it's not often when you see that newer version isn't supported yet in the error message

worn stag
safe lintel
#

@knotty radish well its more that it doesnt match at all yet the comparison should mean it does

worn stag
safe lintel
knotty radish
#

Hum wtf

#

You could try to step into the Equals function while debugging

#

Just to see if it's going somewhere else

untold night
#

I wonder if UNode's just going to wind up being the overarching VS solution, and the aniation package is basically Playables 2, ECS boogaloo

ALSO GIVE IT TO ME NOW

solar spire
#

@worn stag it means the file is storing GUIDs to refer to the Assembly Definitions, they can also do it via name I think

knotty radish
#

It looks like it's doing the Skinning inside jobs which is actually nice

untold night
#

well, we've cracked the code for the GDC presentation.

An unbelievably large volume of Ethans, Unity-Chans, and Robot Kyle's rave dancing on the rooftops of megacity. Probably

worn stag
#

and all of that raytraced

untold night
#

with VR spatial audio

safe lintel
#

oops i think i was confusing my indicies

#

well that's embarrassing

knotty radish
#

haha

solar ridge
#

Just waiting for "RTX ON" for mobile soarynDerp

dull copper
worn stag
#

great

dull copper
#

that animation package is targeting older Entities package

#

so if you pick newest unode, it'll force you to newest entities

#

and then you have to update animation packages ECS usage to preview.26 conventions

#

(those failing tests on unode itself can just be removed)

worn stag
#

so what version of unode we need? 0.1.0?

dull copper
#

no idea

worn stag
#

i will try it i guess

dull copper
#

I'd try 0.3.0 first

#

then 0.2.0 etc

worn stag
#

ok

dull copper
#

and entities preview.24

#

I'm trying to get this running on latest here but it does require file changes

#

I have no idea where these are coming from

#

Next release will also have blob assets which is made for sharable immutable resource data. In that case, you could convert a ScriptableObject into a BlobAsset and then share it from multiple instances in the same scene.

BlobAssets are made for zero cost deserialization for large amounts of data. AnimationClip, CollisionMesh, CurveData is a good example of what we think belongs into a BlobAsset. ```
source: <https://forum.unity.com/threads/new-subscene-converttoentity-workflows.638785/#post-4292482>
#

that blob asset plan sounds nice

#

hate the name but like the plan πŸ˜„

gloomy wasp
#

Is there any source that explains how they made the loading part of the megacity demo?

dull copper
#

yes

#

but at this point, I'd rather wait for GDC and see if they release the demo like they've hinted they try to do

#

a lot has changed since Unite LA

#

look around 5 minute time mark if you don't care of the generic stuff in the beginning

#

the actual explanation starts there

gloomy wasp
#

I'm super interested on that, I understand that ECS will be supper helpfull for the parts of the level that you instantiate later (like enemies, or watever), like in the voids example. Instead of having a lot of starts and awakes in different scripts that really sucked.

But what I want to know is how to apply the same principle to the actual level layout (meshes, terrain etc).
Thanks I will take a look at that!

dull copper
#

since we now got subscene loading for ECS, we could work around the loading issue with it as well, not quite sure how Unity is going to present the megacity now with current systems in place

#

11 days till GDC keynote, and few days more for ECS talks probably so it's not a long wait

gloomy wasp
#

this is just what I wanted, big thanks

#

the level formats and stuff

dull copper
#

hmmm, looking at that Joachim's forum post

#

BlobAssets are made for zero cost deserialization for large amounts of data. AnimationClip, CollisionMesh, CurveData is a good example of what we think belongs into a BlobAsset.

#

CollisionMesh?

#

wonder if that's a slip from upcoming ECS physics thing as there's no such thing in Unity atm

#

we have MeshCollider and it's Mesh ref but that's different naming altogether

flat talon
#

They have publicly mentioned before they are working on an ECS-based physics solver

solar spire
#

Also CurveData isn't explicitly a thing so it could just be a kind of shorthand to describe the content

flat talon
#

I wonder if you can use the blob for strings?

dull copper
#

well, DOTS compatible physics solver at least

#

they've talked about HPC# Physics but it doesn't mean it's ECS based

flat talon
#

true

dull copper
#

would be surprised if it weren't though as it would sound like a thing that could really benefit from it

amber flicker
#

HasComponent doesn't seem to work in IConvertGameObjectToEntity's Convert method... that makes sense but is a bit of a pain in my use case. I'd like to avoid adding an intermediate spawn component & system (or similar) as I have data on the monobehaviour I'd like to reference when the game object is converted. Any thoughts? I can only think of adding a spawn component which references the game object which isn't ideal as I don't want to get in the way of destroying the game object.

safe lintel
#

@dull copper what is UNode?

urban rivet
#

it's an insult

safe lintel
#

so whats the correct usage, like "hippocoder is a unode" or "hippocoder unodes himself to sleep every night"

#

or "hippocoder, more like unodecoder!"

wanton girder
#

anybody know why a new shader I added shows as "miscellaneous files"?

#

wait a minute... are shaders actually C# files?

safe lintel
#

no they are their own language, where did you put it?

wanton girder
#

under scripts/shaders in my project assets

#

actually it turns out it IS part of my project, it just says that because it is not C# I think. Which leads me to a conundrum. I want to have 2 textures on this shader and dynamically change one at runtime

#

but if it isn't C# I am pretty sure I can't put this logic in the shader itself

safe lintel
#

well I would think you would want to change the material properties of the shader which you can do via c# as long as your shader supports it

#

the #archived-shaders subchannelroomthingamabob is right below this one, someone more versed in shader magic could most likely help you better πŸ˜ƒ

wanton girder
#

wow why didn't I see that

gusty comet
#

Gotta love playing whack-a-mole after upgrades. Wanted to check out the new entities and now I have to clean Library and reimport every package repeatedly until compiler errors go away.

#

Okay kids, don't install Shader Graph manually, bad for your HDRP health.

knotty radish
#

The more I think about it, the more I feel like I need to wait after GDC and at least after the next release to update my ECS project which at the same time is a good thing they actively work on it but also very hard to test the new features to give feedbacks :(
https://forum.unity.com/threads/why-is-simulation-the-default-system-group.639058/#post-4289911

dull copper
#

@safe lintel UNode package description would say it is: General purpose graph processing framework.

knotty radish
#

That description could mean anything, it could be a Toaster or GPS algorithm

#

My guess is that it will be something we may actually not use because manually handling your usecases / codebase will be more efficient

dull copper
#

they used to have package named "com.unity.unode.visualscripting" before but I don't think it is on bintray anymore

#

that had description of Unity's visual scripting tool adapted as a framework for use by the Compositor

knotty radish
#

There is also UCore and UCoding

dull copper
#

ucoding?

#

I know there's com.unity.coding

#

as I installed it yesterday

knotty radish
#

Let me check, I may have misread that one

#

Yep it's just Coding

untold night
#

I wonder if that works for both rider and VS

lime dome
#

i don't want balls of lint all over my code. messy πŸ˜›

solar spire
#

my favourite repo is called "camelcase"

#

I wonder if they enjoyed or hated typing it in lower case

#

Or whether it's just a conversion that happens server side

urban rivet
#

it's about evil and spite

#

the twisted thrills one gets when punished with crunch

manic aurora
#

how's everyone handling physics in their ecs projects? using regular unity physics not a good fit for me due to the SyncTransforms requirement. i'm loosely planning to write some simple AABB-only physics, but I wonder if anyone's successfully integrated a third party 3D physics library that they like? or just sticking with something trivial and waiting for official ecs physics impl?

dull copper
#

@manic aurora you saw the bullet ECS thing on the forums?

untold night
#

I'm chilling on physics until at least a basic collision system is there

dull copper
#

it wasn't full integration, just a way to wrap bullet manually to ECS

manic aurora
#

oh i did NOT see this

#

just pulled it up

dull copper
#

I'm personally hoping Unity does give some DOTS physics thing soon, even if it's only for collisions (I know FPS Sample has simplified collision thing for dynamic objects now)

#

@manic aurora can you link the thread?

manic aurora
dull copper
#

oh, that's not it

#

that's the regular integration

manic aurora
#

oh there's an ecs specific one?

dull copper
#

yes

#

I'm rizu on the thread btw

#

(my old nickname + Unity forums don't allow usernames that start with number)

#

that sample is hardly ideal, you could optimize it a lot if you want

#

but still cool to get some samples

manic aurora
#

yeah i was paging through the example like "hmmmmmm" lol

dull copper
#

you probably also know PhilSA's ECSPhysics one?

#

that would require a major rewrite and it's more like a shell atm

manic aurora
#

yeah it doesn't support box colliders yet which is like my only requirement in the short term lol

#

plus he's been off it for a while iirc

dull copper
#

yeah, wouldn't really count on that evolving anytime soon πŸ˜„

safe lintel
#

im also doing same as recursive, just waiting for something official/using hybrid and biding my time

dull copper
#

yeah, I'm on hold for ECS physics too, just using hybrid right now for that

#

if GDC doesn't show anything that's going to help on that in short term, need to go on plan B

#

which would be a lot like that Bullet ECS thing in principle

manic aurora
#

yeah digging in a little it does seem relatively practical to integrate bullet, but it (at a glance, i have no actual idea) seems like you can only access bullet on the main thread, so when i have to do a lot of time-rewinding i can't update all the physics positions simultaneously...where as i assume with unity-integrated ecs physics i totally could

#

like if i just wrote some simple aabb physics, i could parallelize distinct time-rewinds per player

dull copper
#

the transform updates will not be the major cost here before Bullet itself chokes

#

I'd also do some perf tests on typical gameplay scenario before thinking that as showstopper

#

usually gameplay physics aren't all that demanding but that would of course depend on the gameplay itself

manic aurora
#

well id need a bullet world per-player or have to do each distinct rewind state one at a time, right? if i'm trying to parallelize a unique simulation update per player

dull copper
#

also, you really really need to rewind the physics?

#

I know people try to do it for server authorization but it's kinda thing most indies try and struggle to do when AAA games just use client side checks for most online game physics

#

also usually the indie games MP is dead on arrival or not super popular so all the effort in doing it so that nobody can cheat in any case is usually wasted effort

#

there are just so many issues to solve on MP physics in general, and if you need all clients to play nice on collisions that are verified on server... that's a huge undertaking

manic aurora
#

well i am not building a game, really, i am just building a netcode for sport, so i'm trying to make it fancy

#

just a little experimental hobby project y'know

dull copper
#

ah, well, if it's just for kicks and learning, I guess everything goes πŸ˜„

#

I doubt one could make a generic code for this either

#

like, netcode that works for all types of sports games

manic aurora
#

oh no, for sure, i am specifically making fps-style netcode

#

then gonna try mmo, see what i can do re: horizontal scalability

dull copper
#

oh, right

#

not that kinds of sports πŸ˜„

#

you've seen the FPS Samples collision detection code?

#

they added custom collisions for dynamic objects on last update

#

HitCollision no longer uses Unity collision system for queries against moving colliders. For lag compensation server needs to do queries using different historical data and moving Unity physics colliders multiple times per frame is very inefficient. Now queries are handled using custom collision primitives and burst jobs. The structure of the collider and history data is still WIP.

manic aurora
#

yeah i knew about that but haven't dug in yet, i AM hoping i can borrow some of that work, i was already intending to use the ecs unity.mathematics extensions

#

but i already know my interpolation for networked objects is better than theirs, so maybe i should just roll something together \s πŸ˜‰

lilac ermine
#

good lord, this guy is a machine

#

i really wouldn't be able to use half of this stuff without sifting through his (and some other key community member's ;)) blog posts and code

soft nova
#

Hmmm testing 2019 now and my job (which works fine on p24) is now throwing the error Iterator must be marked [ReadOnly] on p26 anyone knows what that means?? It points to job.Schedule(this, inputDeps);

#

The job is a IJobProcessComponentData if that matters

#

Even a simple system throws the error

#
[ExecuteAlways]
public class TestSystem : JobComponentSystem
{
    public struct Job : IJobProcessComponentData<TestComponent1, TestComponent2>
    {
        public void Execute(ref TestComponent1 test1, ref TestComponent2 test2)
        {
        }
    }

    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        Job job = new Job
        {
        };

        var handle = job.Schedule(this, inputDeps);

        return handle;
    }
}
manic aurora
#

this is probably not it, but i had a generic job doing that that worked when i declared it outside the system lol

soft nova
#

Well it was worth a try, but it didn't work.

#

Downgraded to p24 and it works...

dull copper
#

Job job = new Job()

#

instead of Job job = new Job

#

?

#

@soft nova

solar spire
#

literally a standard C# thing you can remove if you're using an object initialiser

dull copper
#

I wouldn't know that πŸ˜„

#

that was only thing different on the sample

solar spire
#

Just letting you know πŸ˜›

soft nova
#

Yeah, perhaps the installation of the beta is wrong or something. I tried in a new project with the same results

dull copper
#

try the samples?

#

also, what's the full error message?

#

you have manually set jobs package?

soft nova
#

No I used package manager

dull copper
#

no I mean, have you installed jobs from PM?

#

p24 uses older version

soft nova
#

Yeah, I used PM to install it

dull copper
#

in that case make sure you got jobs 0.0.7-preview.7 and collections 0.0.9-preview.13 there

soft nova
#

At least now i have the full error

#

Hmmmm to big to post here

dull copper
#

@soft nova did you try the new samples?

#

hello ecs 02 has almost same setup as your snippet and it works

soft nova
#

Yes that one works, but it doesn't matter what new system I make it will keep throwing the same error. The only way to make it work is to use any of the already available ComponentData. Changing it to this doesn't throw any error and executes normally, why?

public struct Job : IJobProcessComponentData<Rotation, RotationSpeed>
{
    public void Execute(ref Rotation test1, ref RotationSpeed test2)
    {
    }
}
solar spire
#

new blog post

dull copper
#

also new Entities and Hybrid packages πŸ˜ƒ

#

now Entities is at 0.0.12-preview.27 and Hybrid is at 0.0.1-preview.7

#

(not updated yet on that image)

#

I wouldn't even list these all separately on PM normally, you can just get Hybrid (or Hybrid and Entities if you want to see the dependency lists) and dependencies take care of the rest

#

gotta love these comments on the new entities package diff cs // Invoked by Unity magically for FrameSelect command.

#

they also got some place holder for Tiny "TODO" ? πŸ˜„ cs [TinyFixme] // Should this work for Tiny? public class BlobTests : ECSTestsFixture

#

in general, they've updated a lot of the conversion setup here, main new thing is the blob support

#

also ComponentQueryBuilder

#

this is also new file Unity.Entities/Injection/DefaultTinyWorldInitialization.cs

#

as for the hybrid package, it got now some HLOD change and small tweaks

dull copper
#

new release notes are up https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/ReleaseNotes.md


- To use, try the Entities property of ComponentSystem, which returns a ComponentQueryBuilder that has a set of With methods on it to construct a query.

- ForEach now lives on this and the parameters of the lambda will be combined with the builder to form the final cached ComponentQueryGroup.

- You can also call ToComponentGroup from the builder if you just want to use this new way of constructing one.

- The default cache size of 10 for ComponentQueryBuilder-created queries can be tuned with InitComponentQueryCache.```
#

well, that happens πŸ˜ƒ

flat talon
dull copper
#

heh

#

I'm guessing it's still incomplete or something

#

you'd think they would have put move info about it otherwise

lyric cradle
#

Can someone explain to me the difference and benefit to ECS? I've seen several videos about it and I'm still confused as to what exactly it does

toxic walrus
dull copper
#

not sure if there's really any up-to-date comparison thing, you can find some partly outdated ones if you look around

safe lintel
#

is there a replacement for GetBufferArray<T>()?

#

besides doing chunk iteration for it

soft nova
#

Well 5argon found the issue and explained it here: https://forum.unity.com/threads/solved-strange-error-iterator-must-be-marked-readonly-since-0-23p.640951/#post-4296163 Now the only other problem I'm getting is that my custom render renders on scene view, but not on game view if I use the Parent component

dull copper
#

I actually thought that too but then thought you didn't really have empty component on your end in reality

soft nova
#

Yeah, on my actual system I don't plan to have one, but since I'm not done with that component it didn't have anything yet. I found that while the game window don't render my custom render (which is just a copy of RenderMeshV1) it works fine on the scene and on a build.... I have no idea why the game window just won't show it. Even more odd, when I made a build the game window showed the rendered objects and then disappear when I pressed play

soft nova
light sage
#

Is it possible to bring the cameras position property out of the monobehavior at all? I'm at a point where I'm considering forking my project to a system where the camera is always at the origin, or having to rethink/recode a lot of the infrastructure of what I have now, But if I could find a dencent way to deal with camera position inside the various systems, I would be able to save a lot what would have of wasted time. If not, I can't see a way around -a) moving the camera to 0,0,0 full time or -b) depending on an extra delta time function or two, and having extra components/systems, to deal with it and to also for a buffer preventing the camera from holding up any other systems that might have mutual dependencies somewhere along the line

#

It's really just resulted in a strange hybrid system for me that's hard to work with. Camera position is dependent on player entity, everything is dependent on player entities position also, I x/y axis is actual position while z-axis is always zero with a value representing where it would be similar to the 0,0,0 based system

manic aurora
#

anyone know how to manually initialize and update RenderMeshSystemV2 + transform system? with v1 i just tossed all the named systems in a file, updated them in the order they seemed to expect, and it worked. with v2, this isn't getting me anywhere. there are also several systems internal to the rendering namespace that it looks like i might need...

bonus points if i can get rid of everything that has to do with hybrid/proxies/GOs

manic aurora
#

ah i sorta got it... initializing worlds with DefaultWorldInitilization.Initialize gets you all the built in stuff set up correctly, then you can remove what you don't want and scope certain systems to certain worlds by using an ICustomBootstrap. seems like ScriptBehaviourUpdateManager doesn't support multiple worlds anymore, which is confusing to me, modifying it to support them works fine...

manic aurora
#

okay, awkward triple post, but i got it working right and hate when people don't post answers to stuff. this post helped: https://forum.unity.com/threads/why-is-simulation-the-default-system-group.639058/#post-4294693

if you have multiple worlds, you straight up are (currently) expected to manage their updates in a monobehaviour. you use the default world init with a custom bootstrap like i describe above, get the world references in your game loop monobehaviour. THEN you can get a reference to the presentation and simulation groups with World.GetOrCreateManager<SimulationSystemGroup> - updating those manually will execute render and transform systems in the correct order per world.

safe lintel
#

id interject to make it less awkward but i have zero experience with initialising worlds

dull copper
#

1.0.0-preview.1 for the Burst

#

- Fix regression when resolving the type of generic used in a field
- Fix linker for XboxOne, UWP
- Fix performance codegen when using large structs
- Fix codegen when a recursive function is involved with platform dependent ABI transformations
amber flicker
#

Any tips as to how to have a system associated with a non-default World? Thanks!

manic aurora
#

got more context for us? you can make a totally empty (i.e. no ecs default systems) world with new World, add your system to it manually with world.GetOrCreateManager<T>, then update the system as you see fit with system.Update.

amber flicker
#

Hmm thanks @manic aurora it’s that last step I’m unsure about - especially how that works in conjunction with ComponentSystemGroups

manic aurora
#

rest of that thread might be a good read, too. seems like if you have multiple worlds right now, you are expected to either manually inject them into the player loop (insane, imo) or bootstrap them with a monobehaviour* that calls Update on systems during its own update/fixedupdate as needed.

hopefully they will give us the ability to add multiple worlds to scriptbehaviourupdate order back soon, that made this easier. they are doing a lot of player loop tinkering in the upcoming releases afaik

amber flicker
#

awesome, super helpful - will digest this (and maybe just live with everything existing in default world for now) - many thanks @manic aurora

manic aurora
wooden canopy
#

@manic aurora really nice article

toxic walrus
#

the first article i've seen that describes a use case for icustombootsrap

manic aurora
#

oh good! i'm super glad you guys got some mileage out of it

full stirrup
#

Was interesting snippet of custom player loop, I’d be more involved but doing a and b will turn into i and j by the time I get something good made aha

soft nova
#

Did EntityManager.GetComponentOrderVersion changed somehow? It seems to be working fine on 2018.3, but not on 2019.1.

soft nova
#

Hmmmm nvm my issue is not there

mint iron
#

god dammit all these conflicting dependencies on package manager are driving me insane

queen belfry
#

Anyone know if there's an ETA on a non-hybrid physics system? Trying to figure out whether it's worth rolling my own simple one or just waiting a bit.

tawdry tree
#

If a simple one is sufficient, it's probably worth it to make your own. I wouldn't hold my breath for an official pure ECS physics package just yet. That said, try Googling a bit, it's not new ground, so there might be something available out there.

toxic walrus
#

isnt there an open source one?

tawdry tree
#

Probably is, never checked. Might be a bit outdated with how often the ECS system changes, but should be less effort to fix than(and make a pull request) than to make one from scratch?

dull copper
#

wonder if they are still going to put this out there, regardless the DOTS version coming up later

worn stag
#

yeah they also have "com.unity.unode.visualscripting"

#

saw it in compositor dependencies

dull copper
#

I can't build the scripts with this, but still fancy to get a peek

#

mostly curious if they plan to release the nonECS thing after all

#

I was expecting this to go back to drawing board tbh

dull copper
lime dome
#

neat

urban rivet
#

I need this before my hands fail due to excessive master commits

dull copper
#

that audio system is on staging atm

#

(I linked dev version before, but it's on staging too)

dull copper
safe lintel
#

is it weird that they are putting the megacity audio in as a package but its not intended to be the official audio solution?

solar spire
#

there are a lot of random unreleased packages

#

hell there's packages called "a", "b", "c"

#

it might be weird if they released them, but they're just on staging, which is meaningless

safe lintel
#

ah, thought it was destined for release

dull copper
#

that megacity audio package doesn't work at all on 2019.2 alphas atm btw

#

latest 2019.1 beta doesn't throw errors with it

#

seems like they 2019.2 got the changes later in this case

#

(required using Unity.Experimental.Audio doesn't exist on 2019.2)

mystic mountain
#

Hey, anyone know if there is any way to manually tell when OnUpdate should be called for all systems?

knotty radish
#

Nice update of entities

#

Which can now handle bool and char

#

So we could handle ECS strings \o/

flat talon
#

yeah I was actually wondering about strings πŸ˜ƒ

#

would you do that as NativeArray<char> ? πŸ˜ƒ

knotty radish
#

Actually

#

It seems like they also changed NativeString

flat talon
#

yeah I came across that type recently, but haven't looked into using it

knotty radish
#

It wasn't working before

#

struct EcsStringData : IComponentData { public NativeString64 value; }

flat talon
#

oohhh

knotty radish
#

Taken from WordsTests.cs

flat talon
#

there are multiple versions, presumably just different sizes

safe lintel
#

ugh must resist using staging packages!

knotty radish
#

Exact

flat talon
#

data seems to be efficient, but naming is confusing πŸ˜ƒ NativeString64 is 30 characters long and using an unsigned buffer:
private unsafe fixed uint buffer[15];

#

Yeah ok the naming convention is how much memory the type takes up. 15 uints *4 bytes, plus one int (4 bytes) that is storing the length = 64

manic aurora
#

o man i saw that before you edited it and i was just doing the math in my head like, "hm, am i an idiot?"

flat talon
#

nah took me a minute or two to get it πŸ˜ƒ I checked the other types (512 and 4096) and it adds up

#

512 = 254 char
4096 = 2046 chars

#

This reminds me a lot of the early days of MS SQL Server before we got the varchar variable type πŸ˜ƒ

lime dome
#

welcome to Unicode

knotty radish
#

They will change the names though

gusty comet
#

How does entity id recycling work? I need to know so I can implement it in some non ecs related code.

#

They have an Index and a Version, but how do they connect them? Just storing an array of version for all ids would be 16 megabytes πŸ€”

tawdry tree
#

The index will eventually be reused, but never with the same version. The version will increase whenever the entity changes. I do not, however, know exactly what it means for the entity to change. Adding/removing components should be one way

gusty comet
#

@tawdry tree I meant how do they find the next free id when the next id would be max int + 1. Do they just foreach over all ids to find a dead one then?

flat talon
#

One strategy is to keep an array of "free ids"

gusty comet
#

So it's fine if I keep 2,147,483,648 x 2 sized list?

tawdry tree
#

That's gigs of memory...

flat talon
#

you would only keep those that are free "inbetween" and a max one

#

but yeah not ideal πŸ˜ƒ

gusty comet
#

Oh right, I forgot 1 division by 1024.

flat talon
tawdry tree
#

I assume they have an optimized way to find free ids.
In fact, I would assume that they would ALWAYS look for the lowest free id when creating a new entity, though with some optimistic optimizations

dull copper
#

oh nice, new things πŸ˜ƒ

#
New Features

Added BlobAssetReference and support for building and serializing blob assets.
  - Blob assets are built using BlobAllocator and BlobAssetReference fields in components are automatically serialized and deserialized.
  - BlobPtr and BlobArray are used to represent pointers and arrays inside blobs and are allocated using BlobAllocator.Allocate.
  - BlobAssetReference are currently not supported inside DynamicBuffer components.
  - bool and char can now be used in ComponentData and in native collections.
  - GetBufferFromEntity and GetComponentDataFromEntity only available on JobComponentSystem

Upgrade guide

- Unity 2019.1b5 or later is now required.```
#
Changes

- If a system in a ComponentSystemGroup throws an exception, the group will now log the exception as an error and continue updating the next system in the group. Previously, the entire group update would abort.
- Moved most documentation to the Entities, Collections extensions, and Job extensions packages.

Fixes

- Fix underconstrained systems in the TransformSystemGroup, which could cause child transforms to lag behind their parents for one frame.```
untold night
#

excellent

knotty radish
#

[StandaloneFixme] // Should this work for Tiny?

#

Nice things indeed haha

dull copper
#

kinda bummer that they didn't put any example on the samples about blobs

#

no further docs either, only those mentions on the release notes

foggy chasm
#

nice

untold night
#

holy crap that's great

dull copper
#

wondering mainly if it's because of the ECS subscene loading or if it's been there for longer period already

#

I don't often use that specific menu

#

(for other than creating empty gameobjects

knotty radish
#

The notion of Subscenes is only existing in the Entities package so maybe about 2-3 versions

flat talon
#

Thats been a thing for a few releases already

dull copper
#

yeah, I'm aware of that

#

just wondering if it came along that update but I guess then it did

#

my comment is first there after Joachim πŸ˜ƒ

#

should probably put same avatar there as the nicks are different :p

flat talon
#

yeah I actually cant remember where I saw this context menu demoed, thought the info was in that thread hence why I linked it

knotty radish
#

Hey @dull copper, isn't BlobificationTests.cs enough informations about blobs ?

dull copper
#

ah, I didn't check the package contents yet

#

Tests kinda reveal things often on these, so I guess that's a good starting point

#

I haven't made a diff for the changes yet either (have a local entities and hybrid git repos for that)

knotty radish
#

There is the basic usage for Blobs, not yet any conversions for Texture2D or any fancy things you may want to have but it will come soon enough

urban rivet
#

OK guys, gimmie a TLDR of what I've missed with ECS!

dull copper
#

release notes listed one screen up πŸ˜ƒ

#

TL;DR: blobs

flat talon
#

and strings πŸ˜ƒ

dull copper
#

new hybrid package mainly does changes like this ```cs

  •    ForEach((LODGroup lodGroup) =>
    
  •    Entities.ForEach((LODGroup lodGroup) =>```
    
knotty radish
#
  • Working NativeStrings and our dear bool
dull copper
#

oh

#

string and bools!

flat talon
#

yupyup

dull copper
#

yeah, that's long overdue

#

also funnily enough, it's not on release notes

knotty radish
#

It is (not actually, thought you were talking about bool and char)

flat talon
#

char and bool, not nativestrings

dull copper
#

you mean on the package release notes?

#

and not the samples one?

#

ah, thought if I missed it somehow

knotty radish
dull copper
#

yeah, it doesn't

#

but they've moved some of the docs there already

flat talon
#

also they mentioned the documentation was moved, but the links dont work

dull copper
#

wonder if this means they'll finally throw this in github

#

would be so much nicer to track changes if they did

knotty radish
#

I don't think they will

knotty radish
#

Just like any other package which is not on github so either the package start on github or it will never be there

dull copper
#

I dunno about that

#

also wonder what's their motive for not putting it on git

#

as anyone here could do it anyway

#

the license isn't stopping for doing that

knotty radish
#

Support

dull copper
#

it's under unity companion license, you only need to ship the license with it

#

(with the source distribution that is)

knotty radish
#

If it's available people start playing with it and then if there is something not working, they will immediately complain about that issue while the Unity team may already know

#

That and the suspense, GDC is near and we are all waiting for sweet updates

dull copper
#

considering how much Unity hypes ECS, github presence has very little to do with how many people adopt it πŸ˜„

#

actually if it were only on github, it would limit the people who tried it

#

but since it's on package manager, everyone can just drop it in

flat talon
#

perhaps they just want to stabilize it before releasing it fully?

knotty radish
#

I would use the github as a git package repo

#

Would still be a drop it in

dull copper
#

I use SRPs from git myself too

#

but most users wouldn't do such setup

knotty radish
#

I agree that a small button to remove the lock in the manifest file from the Editor would be cool

dull copper
#

now their ASCII art doesn't fit into the window and it breaks the presentation πŸ˜ƒ

untold night
#

needs ScrollASCIILayoutSystem to see the entire ascii art graph

foggy chasm
#

I use Quads and Line Renderers for most of my architecture diagrams

lime dome
foggy chasm
#

doesn't support TMP -> unusable 😠

lime dome
#

it doesn't use any GUI at all hehe. it fakes the whole thing

untold night
#

but can it run doom?

lime dome
#

if you can make Doom run in unity, yes πŸ˜›

#

someone is working on that lol

urban rivet
#

the pink demon in original doom, was such a surprise to me once, that I actually gibbered and dribbled while backpedalling desparately

#

to anyone these days it would never be a big deal

lime dome
#

yeah i would play late at night with all the lights out

#

was so scary haha

dull copper
#

looked at BlobificationTests, not much wiser on the actual usage

dull copper
safe lintel
#

ah nice, didnt realise that new entities package was also out of staging

dull copper
#

hmmmm, the "Convert To Entity" thing doesn't set the old gameobject name in for the converted entities automatically like the gameobject scene conversion tool did

#

wonder why, it was pretty handy to not have just numbers for entities + it's still editor only thing

mystic mountain
#

Anyone know if there is a way to run the ComponentSystems "manually", basically so I can do it X times in the Update loop. Like ~ World.RunSystems(); or something.

slow epoch
#

Check PlayerLoop

mystic mountain
#

I've seen that, have not yet come to the conclusion if it can solve the problem. But I guess the idea is to make a new UpdateMethod which adds the ECS stuff, and control the amount of times it is run by loopConditionFunction. But my current problem to understand it is that I have no idea how and when that condition is checked, can I cause two of these functions to trigger after eachother - or will some fixedUpdate come in between?

slow epoch
#

I think there's an attribute to force your system to be called before/after other system

#

But right now i can't find it

mystic mountain
#

Yeah, but I'm not talking about one system, but the whole simulation tick.

slow epoch
#

And in the player loop you can modify it to be called in the order you want

#

You can even force fixedupdate to be called as a normal update

mystic mountain
#

Hmm, doesn't seem to work the way I want. From what I can see, and that someone else had a problem with, the "loopConditionFunction" needs to be copied from one of the existing PlayerLoopSystems. There is very little to go on with this one.

#

FixedUpdate would be cool to use if it wasn't for the fact that it isn't prioritized by be matched by the framerate :/

flat talon
#

I seem to remember you having to override the default bootstrap if you want to control your own loop? haven't tried it myself

mystic mountain
#

From what I remember finding is that the bootstrap uses ScriptBehaviourUpdateOrder.UpdatePlayerLoop(World) to activate the updates into the Loop. But might've overlooked something that might help.

toxic walrus
#

you can look into DefaultWorldInitialization how ICustomBootstrap is being called

mystic mountain
visual dock
#

You can always update them manually as often as you like, eg World.GetExistingManager<SimulationSystemGroup>().Update(), or you can implement a custom SystemGroup which updates all contained systems multiple times

ember ruin
#

Hey,

so I have some understanding problems for ECS, I wanna do the following:

World
-> Chunk[,,]
-> Voxel[,,]

But I wanna generate chunks inside the world, and voxels inside the chunk. In what function do i possibly do the generation of chunks / voxels? Onupdate wouldnt be the right way right?

tawdry tree
#

I would probably go for a system which keeps track of player position and which chunks are spawned and need to spawn or despawn, then mark them somehow, probably via fields (needUpdate, shouldDestroy). Might despawn directly, actually.
Then a second system would look for chunks which needs update (or destroy) and does the generation in a job which is not bound to the frame, ie not awaited.
You need to keep track of the state but shouldn't be hard. An enum would do it? Since they boil down to an int anyway it should be blittable

#

and of course, actually doing the generation is it's own whole topic, but not really ECS related. I don't think voxels should be their own entity, though, unless really big (so few are used), or on movable grids or something, as a 10x10x10 chunk already has 1k voxels.

knotty radish
#

No release notes yeah

#

smashing F5

dull copper
#

those only appear once it moves to regular registry πŸ˜ƒ

knotty radish
#

I was talking about the release notes of the sample repo

dull copper
#

yeah, I know

#

I meant they don't update that until the new entities package is on regular registry

knotty radish
#

Oh ok

#

I think it's a small update with a few fixes

dull copper
#

checking the change now

#

seems mostly cleanup pass

#

hybrid renderer moved Update LodRequirementsJob into IJobCunk from IJobParallelFor

#

that's about it

knotty radish
#

Nothing much here either

dull copper
#

yeah, that was short πŸ˜„

#

packages now on regular registry as well

knotty radish
#

Any good update on the doc ?

#

Like about Blobs or other things

dull copper
#

as there were zero changes on the docs on the samples and the packages

#

kinda sucks that there's no way to diff the official docs

#

or I guess one could crawl the site after each pass but πŸ˜„

#

but I didn't really spend much time reading the previous version

knotty radish
#

Yeah I guess, amyway GDC is this monday so we will have enough new things soon

safe lintel
#

need to shine a 5argon sign in the sky for a good diff writeup πŸ˜ƒ

manic aurora
#

if i have some shared component (with an index available via either chunk.GetSharedComponentIndex or entityManager.GetAllUniqueSharedComponentData(..., out indices)) and destroy all entities that use it, is that index eventually recycled?

edit: yeah they're reused

soft nova
#

Have you guys played around with the new sub scene? I started doing some tests on my end and I'm super impressed about how wonderful it makes the workflow and how extremely fast loads heavy data

urban rivet
#

are you using hybrid for project?

fathom carbon
#

Hey, was not sure if I missed something to turn collisions on and was wondering if someone could please tell me

soft nova
#

@urban rivet Me?

solar spire
#

@fathom carbon turn off Is Trigger

fathom carbon
#

on what one?

solar spire
#

Box collider

fathom carbon
#

thank you!! will try that out

solar spire
#

Both of them should not be triggers I imagine

fathom carbon
#

It worked!! But there is a problem with the gravity now. They all float up

solar spire
#

It could be your player controller or it could be that they immediately collide with the floor and then get pushed into the air

#

as you have unticked Use Gravity

fathom carbon
#

yeah, I may just put a floor in to stop that.

#

Do you happen to know how I can adapt this code to use for the player to follow the curser

solar spire
fathom carbon
#

okay thank you!

flat talon
#

FYI - Burst doesnt correctly recompile edits in editor since preview50. This has been driving me nuts all day and question my sanity and programmer skills.

ember ruin
#

Hey, how can I access a System from the outside?

I have a GameObject "TerrainGenerator" that creates multiple Chunks (which create multiple voxels inside of them), now if the players removes one voxel how can I notify the chunk system / world system that it needs to update the chunk? (voxels are combined to a single mesh, so the chunk needs to re-generate that chunk)

tawdry tree
#

Have a NeedsUpdate component with a boolean value, set it to true to mark as needing update. Chunk update system will iterate over all Chunk/NeedsUpdate entities and essentially start with if (NeedsUpdate.Value = false) continue;

ember ruin
#

yeah i know of that one, but how can I access that bool from the outside? Like Im in the player Update function and somehow need to get the access to the chunk

tawdry tree
#

'How do I find a specific entity, by some ID I have set' is a question I am still looking for the answer to, if that's what you're asking (in a slightly different way; get chunk for position [...])

dull copper
#

@flat talon so workaround is to disable burst while working on codebase in editor?

#

Or is the old version still compatible with current entities?

flat talon
#

workaround is to use preview 50, and yeah Im able to use preview 50 with the latest version of the rest of the DOTS stack

lapis yoke
#

Is there an equivalent of Vector3.SqrMagnitude in Unity.Mathematics for float3?

#

(Ah, it's lengthsq, right?)

toxic walrus
#

yep

manic aurora
#

haha finding things in unity.mathematics will be the death of me, i manually implemented quaternion -> float3x3 before i found it

lapis yoke
#

Yeah, I had tried to find it with autocomplete with, sq, mag, etc. I had to open the fine and search for sq, to find that they now call it lengthsq... I'm really looking forward to the time where this is all consistent and documented πŸ˜„

#

Another question; With Burst, do I have to mark all methods as [BurstCompile], or is it enough to mark the "first" one, that calls all the other methods?

thick carbon
#

I mean if you just type in "math" intellisense should show you all methods, definitely faster to scroll through those than doing it yourself πŸ˜‰

lapis yoke
#

I just type math. and then press tab. But it's a small window that pops up, and scrolling through all methods in math will take a while. It's easier to narrow it down by typing what I thing it's called.

thick carbon
#

sure, still better than doing it yourself

flat talon
#

New Burst 1.0-preview 5 just released that fixes the compilation issue I mentioned above πŸ˜ƒ

ember ruin
slow wasp
#

With Burst 1.0-preview 5 I still get different behavior in the editor than I do in a build, so I just leave burst off in the editor for now

urban rivet
#

preview 5 was to fix a showstopper bug I think. Can you explain the difference in behaviour please?

slow wasp
#

Just weird problems like collisions being inaccurate so things falling through the floor and sometimes different animations playing

dull copper
#

burst's preview.6 is out now

dull copper
#

kinda lost my motivation do any ECS code today, so now holding off doing extra work in case of keynote reveals something that could change my future workflows anyway πŸ˜„

#

that being said "three year plan" thing sounded VERY much like their future DOTS-plan

#

so, not really expecting anything but MegaCity to get released around GDC now

dull copper
#

will see where nvidia goes with that

#

I hope they'll ship with the sources too

#

as it would mean we could use physx outside of the gameobject scene fairly easily then (meaning one could use it with unity's ecs directly then)