#archived-dots

1 messages ยท Page 136 of 1

naive parrot
#

and yes good DOCS

#

digging changelogs , forums and source code for basic stuff is not funny

coarse turtle
#

I'll likely maintain that repo - I don't think I'm jumping on UIElements soon for runtime stuff - but who knows

dawn badge
#

Like I still can't figure out an adequate 2D solution for animation that isn't extremely involved

naive parrot
#

extremely involved or extremely generic like animated 1 BN Sprites!

dawn badge
#

haha that too..

coarse turtle
#

@dawn badge from the 2D sample what I understood how it could potentially work was relinking the texture entity to your 2d entity over time ๐Ÿค”

#

pretty sure they'll have a better workflow down the line lol

dawn badge
#

Yea I am probably going to go with a sprite sheet and just change position after a certain amount of time

#

but learning the inner workings of how to render everything is kind of difficult with the current set of docs

coarse turtle
#

ah yea - I was confused at how the conversion pipeline added the SharedTexture/SharedMaterial to the entity with subscenes

#

I kept getting a null reference so I havent looked at it lately ๐Ÿค”

dawn badge
#

I might just load individual sprites as materials on my main class and swap based on health/animation step

#

unclear..

stone osprey
#

Sooo its able to attach dynamic buffers to entities right ? This can be used for lists.... but what if i want to attach a Map to a entity ? :/

#

Ahhh nevermind... im gonna choose a different approach

#

Btw... can i use Entities.ForEach with IBufferElementData ?

warped trail
#

yes

lusty otter
#

What batch size should I select?

#

Ehh that's a bit broad of a question, but just wondering if there's a "decent for all" approach to it.

untold night
#

if you don't specify, I believe it defaults to 8.

Really dependent on how much you expect to be in there

mint iron
#

finally found the bug in burst thats been crashing my editor. Stackalloc in burst will give Invalid Instruction exception, worked fine before.

zinc plinth
#

how could I go about writting to multiple NativeArrays at once in a IJobParallelFor (already using the index in execute for something else) ?

I thought of using a NativeQueue with the available indexes at first but we can't concurently Dequeue..

amber flicker
#

TIL GameObjectConversionSystem has the method DeclareAssetDependency since 0.9 - big deal if you're working with ScriptableObjects and Livelink.

thorny vault
#

Crazy question. This works:

using Unity.Entities;
using Unity.Mathematics;

[GenerateAuthoringComponent]
public struct HexCell : IComponentData
{
    public float3 HexPosition;
}

This doesn't work:

using Unity.Entities;
using Unity.Mathematics;

[GenerateAuthoringComponent]
public struct HexCell: IComponentData
{
    public float3 HexPosition;
}

The only difference is the space before the semicolon. Does GenerateAuthoringComponent really depend on a space before the semicolon, or is something else going on?

opaque ledge
#

๐Ÿค”

#

What do you mean it 'works' tho, what error does it give if it doesnt 'work'

#

Afaik, GenerateAuthoringComponent creates a script called "XAuthoring" where X is the name of the component so HexCellAuthoring for your case, so it you already have a script called HexCellAuthoring there will be collision.

#

I really doubt 1 space will make it work or not ๐Ÿค”

dawn badge
#

Yea Editor/IDE should auto format

amber flicker
#

the 1 space actually does make a difference - they're not using proper parsing yet

#

there's a forum post about it somewhere

#

(unless they fixed it in a recent version of entities and I'm unaware)

dawn badge
#

I mean if I don't put a space and hit save it adds it in (VSCode)

thorny vault
#

@opaque ledge, sorry I wandered off after asking about the space around the colon earlier. It looks like Timboc answered my question. It manifests in two ways. If you try to drag the script onto a gameobject in the editor, you get a warning that <class name>:Authoring does not exist. If you fix the formatting, attach the component, then break the formatting again, it shows up as a broken component in the inspector view. I think there's supposed to be some code-gen happening at build time, but it doesn't trigger if the colon isn't quite right.

#

It seems crazy on two fronts. First, that they successfully parse a language as complicated as C#, but mess up this one small piece of it. Second, [GenerateAuthoringComponent] is an attibute. I would think anything they do with it would happen at runtime, way after lexing.

opaque ledge
#

That is amazing tbh

#

glad you fixed your problem

dull copper
#

huh

#

wonder if this really was on Burst 1.3.0p10:
Cache of Burst JIT compiled results in the Editor to the disk, so that reloading after an editor restart should be faster

#

I didn't see it mentioned on the changelog

wide fiber
#

EntityManager.GetName() doesn't work in builds (it gives me errors when I try to export the game). Anybody has the same problem?

warped trail
#

it is editor only thing๐Ÿค”

wide fiber
#

@warped trail it stop building, it says I have to solve the errors

warped trail
wide fiber
#

Ah so I can't use it in builds?

#

Ok ty

dull copper
#

@wide fiber you have zero need for entity name on build, it's extra so they don't want to support it there by principle

#

it's purely for visualization anyway

lusty otter
#

It's really weird that my game runs fine on device but would crash in editor play mode.

#

I suspected it had something to do with Burst/Job so I tried moving my code to MB instead.

opaque ledge
#

same thing happens to me, i reported it but no answer so far, been 2 weeks

lusty otter
#

Somehow that still crashes the editor.

#

The code is basically a simple language interpreter, and it goes something like

float Execute(...) {
  switch (func) {
    case Add:
      return Execute(...) + Execute(...);
    // more stuffs
  }
}
#

I attached debugger and stepping into it one by one, and I think around the 5th layer deep it somehow went from Execute to Unity's debugger code, and then somehow went to CanvasScaler code.

#

I'm completely baffled and just going to accept that no editor play mode for this project ๐Ÿ˜ข

wide fiber
#

I have a prefab. If I put it inside the scene (manually, by dragging it inside the hierarchy), it works normally. If I spawn it through the code the Pathfinding script that I have gives me some weird errors.

Are manually put in the scene and instantiated through code entities different?

stiff skiff
#

I have a fun usability question. How do you do a query, or get a collection of components, outside of a system?

#

So far I've done this by having the code in question call into a system, which makes me the data I want, and returns it

#

But since querying for something, even if only once, adds the query to a cache it starts requiring it for its Update cycle.. this might not be the best approach

opaque ledge
#

EntityManager.CreateEntityQuery(typeof(Translation), typeof(Rotation));

naive parrot
#

But since querying for something, even if only once, adds the query to a cache it starts requiring it for its Update cycle.. this might not be the best approach
@stiff skiff what do you mean requiring for its Update?

stiff skiff
#

@opaque ledge how did I miss this... thanks!!

#

@fleet hemlock if I understand correctly, queries made through GetEntityQuery are added to system's list of queries made. Which is checked in ShouldRunSystem

#

Though this is overridable by specifying specific queries to be required, or marking as "always run"

naive parrot
#

i see. good to know

south falcon
#

Do you guys know how to access entity inside IJobChunk?

south falcon
#

I have only found information about how to access entities' componentData inside Execute

#

using GetNativeArray?

#

how to define ArchetypeChunkEntityType?

warped trail
#

like this? ๐Ÿค” cs public struct ChunkJob : IJobChunk { public ArchetypeChunkEntityType EntityType; public void Execute(...) { var entities = chunk.GetNativeArray(EntityType);//NativeArray<Entity> } } protected override void OnUpdate() { var tmp = new ChunkJob { EntityType = GetArchetypeChunkEntityType() }; }

coarse turtle
#

SystemBase.GetArchetypeChunkEntityType() - should be it

opaque ledge
#

anyone knows if WithNone works AND or OR for multiple types?

south falcon
#

@warped trail thx for reply. how can I define which entity is the right one for that specific componentData?

#
        {
            public ArchetypeChunkEntityType EntityType;
            public ArchetypeChunkComponentType<MyDataType> myDataType;

            public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
            {
                var entities = chunk.GetNativeArray(EntityType);//NativeArray<Entity>
                var entitiesDatas = chunk.GetNativeArray(myDataType);

                //How TO Loop?
            }
        }
        protected override void OnUpdate()
        {
            var tmp = new ChunkJob
            {
                EntityType = GetArchetypeChunkEntityType(),
                myDataType = GetArchetypeChunkComponentType<MyDataType>(),
            };
        }```
naive parrot
#

they are all arranged sequentially 1 to 1

#

same index give same components for an entity

warped trail
#
for (var i = 0; i < chunk.Count; i++)
{
  var entity = entities[i];
  var someComponent = someComponents[i] 
}```
naive parrot
#
{
    var entities = chunk.GetNativeArray(EntityType);//NativeArray<Entity>
    var entitiesDatas = chunk.GetNativeArray(myDataType);

    for (int i = 0; i < entities.Length; i++)
    {
        var entity = entity[i];
        var data = entitiesDatas[i];
        //mutate data
        ecb.SetComponent(entity,data); 
    }
    //How TO Loop?
}```
warped trail
#

you don;t have to use ecb๐Ÿค”

naive parrot
#

thats just a random use case

#

nothing to do with iterate

south falcon
#

Does SystemBase.GetArchetypeChunkEntityType() only get a general Entity Type? Which only defines the class of Entity? Is this type ArchetypeChunkEntityType always
fixed๏ผŸ

#

Can I use parallel job for the loop inside IJobChunk?

naive parrot
#

.ScheduleParallel( ) yep

humble falcon
#

Hallo guys. I kinda need some help again from the community regarding dots. I am not getting the idea of the WithAny<T> function within Entities.Foreach. Entities .WithAny<SomeTag>() .WithAny<OtherTag>() .ForEach((Entity entity) => { if (SomeTag) { // do magic } else if (Other Tag) { // do other magic } }).Schedule();

#

Is there a way to ask which component exist?

#

@digital scarab ah ok thanks for the link. I read that you can't access the component though in the lambda function. So I will really have to split it into multiple jobs than. But thanks ๐Ÿ™‚

amber flicker
#

The thing I found not so obvious at first @humble falcon (just in case it helps) is that at least one of the tags specified in WithAny must be present

humble falcon
#

@amber flicker what do you mean that it has to be present? Do you mean that lets say either one of the tag component has to exist? If yes. How can I check within the lambda function if the component exist?

amber flicker
#

Ok so the WithAny helps define the conditions under which the lambda will run. If you want to check within the lambda whether the component is present you need to use HasComponent<SomeTag>(entity) - under the hood this uses ComponentDataFromEntity - it's good to be aware it's a random access but it's still very fast

humble falcon
#

@amber flicker Yeah it sounds like a good solution. I will try it out. Thanks ๐Ÿ™‚

stone osprey
#

Is there a way to run a system every second instead of every frame ?

opaque ledge
#

i do it by, having a system that creates a singleton (lets call OneSecondTag) every second and have my system that needs to run every second require OneSecondTag singleton to run

#

then i have an another system that destroys the tag when it spawns (therefore it only remains for 1 frame)

humble falcon
#

@amber flicker Ah something to add. How do I call HasComponent function within a lambda expression. Because I am getting an error that it is only possible with Run() and WithoutBurst().

stone osprey
#

Thats a cool idea ๐Ÿ™‚ I need to increase a progress bar in my case... for example a progressbar should take 7 seconds to finish... is there a way to calculate how much that bar needs to get increased each step ? In this c ase i wouldnt need to code such a huge infrastructure

amber flicker
#

are you using SystemBase? you shouldn't be using e.g. 'EntityManager.HasComponent' - simply HasComponent inside systembase @humble falcon

stone osprey
#

Another good example are waypoints... when a entity should take exactly 7 seconds to move to the target...

amber flicker
#

or myProgressBarEntity.TweenProgress(100f, 7f); with a future dots tween lib ๐Ÿ˜† #shameless

humble falcon
#

@amber flicker ah ok yes I was using EntityManager.HasComponent. I couldn't find HasComponent within Foreach. Only as you say outside foreach in the OnUpdate(). Maybe I missed something.

amber flicker
#

can you share code via hastebin or similar? You should be using SystemBase not ComponentSystem or JobComponentSystem

stone osprey
#

@digital scarab Thanks ! Thats exactly what i could use ๐Ÿ˜„

scarlet inlet
#

oh no, guys I need your help again. I know I am a leech

#

what is the equivalent of [NativeSetThreadIndexAttribute] for Entities.ForEach?

amber flicker
#

it has a special name.. 1 sec

humble falcon
amber flicker
#

can you put the code outside OnUpdate too?

#

oh is this in a monobehaviour update or something?

humble falcon
#

I can technically put it outside the foreach function. but wouldnt it be slow

#

?

#

no it is in systembase

amber flicker
#

I just meant could you include the code with the SystemBase so we could see that. Which version of entities do you have?

scarlet inlet
#

unless I have literally to call the parameter int nativeThreadIndex

#

did I get it right? Must actually be called in that way? SHocking!

#

where is the mindblow smiley

#

I guess it makes sense once I get used of it ๐Ÿ˜„

humble falcon
amber flicker
#

0.9.1? You really should just be able to delete the EntityManager. from inside the lambda

humble falcon
#

Yes. I want to delete EntityManager within lambda but than there is no HasComponent<T>(entity) only if i write it outside the lambda.

amber flicker
#

you're missing a semi-colon on line 14

#

ok the reason why it says HasComponent doesn't exist is because there are other issues too

humble falcon
#

ah yeah thanks. Btw. Is it because the Tag component doesnt store any value that i cant use it?

amber flicker
#

you can also delete line 53 - comment out the HasComponent lines and get the rest compiling first

humble falcon
#

@amber flicker Yeah the codes in hastebin has lots of errors. I just simplified the code so i didnt copy and paste right away ๐Ÿ™‚ weird. Somehow I am not getting any error anymore after some adjustment you said to me.

#

Before I coudnt call HasComponent within the lambda.

amber flicker
#

Glad you got it working ๐Ÿ‘ - the intellisense error is a bit misleading if there's a problem somewhere else in the code

opaque ledge
#

my intellisense cant 'sense' the components that i get with ForEach query ๐Ÿ˜ฆ

warped trail
#

@opaque ledge they fixed this in 16.6 if you are using visual studio๐Ÿค”

dawn badge
#

Have you imported your Components? I use different namespaces for comp/systems so if I pull the namespaces in, intellisense can infer the type. To be fair I use VSCode so YMMV

#

General question about Components. Say I have 200 enemies, one dies, how to I undraw it, or how do I remove it from my collection?

Graphics.DrawMesh(
    playerMesh,
    translation.Value,
    rotation,
    playerMaterial,
    layer
);

Can't seem to find a method to remove the mesh?

#

I would prefer to just set a property to 0 and undraw the mesh

opaque ledge
#

is 16.6 preview ? i am using normal one latest

warped trail
#

@opaque ledge yes

opaque ledge
#

ah okay thanks

mystic mountain
#

Is it possible to have generics in SystemBase lambda, or do I need to specify IJobForEach's for it?

bold pebble
#

Can I somehow create a prefab with a ConvertToEntity component and at runtime instantiate the entity directly from its archetype without having to create an instance of the prefab each time?

fringe sinew
#

I feel that there might've been a breaking change somewhere in ecs

#

I've been on ecs 0.4 or something a bit ago, just upgraded to the latest release

opaque ledge
#

@bold pebble you can convert at runtime and put the converted entity to a component or shared static or whatever then you can do EntityManager.Instantiate(convertedEntity), this is what i do for my prefabs

fringe sinew
#

Basically, I have some systems that are executed in a particular group (via the attribute) and the group has disabled auto-creation (also via the attribute)

#

What I would do is create the group at one point and poll it via its Update method

#

That got my systems running, cool n good

opaque ledge
#

That being said, Topher said that they are working on making entity prefabs much easier later on

fringe sinew
#

This doesn't seem to work in the latest ecs version though

#

The group creates just fine, but it has no systems in it

#

What's wrong with that? Is it even wrong at all?

#

Because using CreateSystem for all of the systems sounds super fun

bold pebble
#

@opaque ledge How do I convert it at runtime? Just have one instance of the prefab in the scene? And how do I then access the converted entity?

opaque ledge
#

with using GameConversionUtility class or smth, let me find my script as an example

bold pebble
#

Ah, GameObjectConversionUtility

opaque ledge
#

ah nvm you can do it via authoring

#

you use IDeclareReferencedPrefabs interface

#
    [FoldoutGroup("Prefabs")]
    [LabelText("Pirate")]
    [SerializeField]
    private GameObject piratePrefab;
    [FoldoutGroup("Prefabs")]
    [LabelText("Trade")]
    [SerializeField]
    private GameObject tradePrefab;
    [FoldoutGroup("Prefabs")]
    [LabelText("Police")]
    [SerializeField]
    private GameObject policePrefab;

    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        Shared_CampaignPrefabs.TraderPrefab.Data = conversionSystem.GetPrimaryEntity(tradePrefab);
        Shared_CampaignPrefabs.PiratePrefab.Data = conversionSystem.GetPrimaryEntity(piratePrefab);
        Shared_CampaignPrefabs.PolicePrefab.Data = conversionSystem.GetPrimaryEntity(policePrefab);

    }

    public void DeclareReferencedPrefabs(List<GameObject> referencedPrefabs)
    {
        referencedPrefabs.Add(piratePrefab);
        referencedPrefabs.Add(tradePrefab);
        referencedPrefabs.Add(policePrefab);
    }```
#

in here i am just putting into Shared Statics, but you can also put it into a singleton component

#
            blobAssetStore = new BlobAssetStore();
            GameObjectConversionSettings settings = new GameObjectConversionSettings(World.DefaultGameObjectInjectionWorld, GameObjectConversionUtility.ConversionFlags.AssignName, blobAssetStore);

            testTargetEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(testTarget, settings);
#

and this is how you do in runtime, this snippet is from a monobehaviour

#

you have to dispose blobAssetStore in OnDestroy method(or rather whenever application ends)

bold pebble
#

@opaque ledge Thank you very much for the hints!

opaque ledge
#

I feel that there might've been a breaking change somewhere in ecs
I've been on ecs 0.4 or something a bit ago, just upgraded to the latest release
Basically, I have some systems that are executed in a particular group (via the attribute) and the group has disabled auto-creation (also via the attribute)
What I would do is create the group at one point and poll it via its Update method
That got my systems running, cool n good
This doesn't seem to work in the latest ecs version though
The group creates just fine, but it has no systems in it
What's wrong with that? Is it even wrong at all?
Because using CreateSystem for all of the systems sounds super fun

#

This is Kolyasisan's post btw putting it for visibility

fringe sinew
#

The reason why I do the polling manually is because I use my systems for some rendering stuff

#

So I can't just get rid of the DisableAutoCreate attribute

bold pebble
#

@opaque ledge I could successfully implement it with your method. However I had to make sure to remove the ConvertToEntity component from my prefab. Otherwise Unity will crash if I instantiate the entity (2020.1.0b5) ๐Ÿ˜ฎ

opaque ledge
#

authoring or runtime ?

#

nevertheless, glad it worked^^

lusty otter
#

Anyone know how to fix this?

#

Building on macOS for iOS.

opaque ledge
#

does it build for other platforms ?

#

in burst manual its says macOS to IOS is supported, even if it wasnt it would still built, but perhaps you hit a bug

lusty otter
#

Yeah the project builds fine on Windows for Android

opaque ledge
#

Perhaps try to install external toolchain

lusty otter
#

I don't have experience working in macOS at all so I'm not sure if I missed anything.

#

I have done the xcode-select --install already.

opaque ledge
#

ah no idea then

dull copper
storm ravine
#

Frolic here, guys?wlgDeer

tardy locust
#

So I'm using Entities 0.9.1-preview.15 and the following archetype gets created, but nothing is rendered on screen:

EntityArchetype beeType = m_EntityManager.CreateArchetype(
    typeof(BeeComp),
    typeof(RenderMesh),
    typeof(Translation),
    typeof(Rotation),
    typeof(Scale),
    typeof(LocalToWorld));

I have given the Mesh the standard Unity cube and the Material a material I made. Am I missing a component to showcase the render? Or is it something else you think?

m_EntityManager.SetSharedComponentData(entity, new RenderMesh()
{
    castShadows = ShadowCastingMode.Off,
    mesh = BeeMesh,
    material = BeeMaterial
});
naive parrot
#

pretty sure you are missing WorldRendererBounds component there which is required by HybridRenderer

fringe sinew
#

I want to ask my question again

#

Recently I switched from ECS 0.4.0 to the latest version and I feel that there might've been a breaking change

#

I use ECS in my project for some rendering features. Previously I had some systems executed in a custom group, which had the [DisableAutoCreation] attribute on it, which prevented it from being initialized by default

#

Then I would just create the group with GetOrCreateSystem<> and poll it. It worked fine

#

That doesn't seem to be working now.

#

When I create the group in the latest version of ECS the group is empty. It has no systems in it.

#

Is this a normal behavior? If so, how do I deal with it?

#

I don't want to just do AddSystemToUpdateList on all of the systems and go back to it every time I add some more, it's a very awkward thing to do.

amber flicker
#

I guess perhaps not many people do this. Could be worth posting on the forums if this change is considered a bug or intended. As for me, I need to do a similar thing for edit-time non-subscene stuff - I use reflection.

#

Which I guess is probably how the existing attributes work anyway

amber flicker
#

@fringe sinew I understand you might want to avoid reflection at runtime but on the off-chance it's useful or helps get you going again, I use something like this:

DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(World.DefaultGameObjectInjectionWorld, systems);
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(World.DefaultGameObjectInjectionWorld);
``` DefaultWorldInitialization also has a GetAllSystems method but I think [DisableAutoCreation] systems aren't included in that
fringe sinew
#

Reflection is fine, yeah, ECS uses a chuck full of it during initialization. I might use it too, but I just wonder why it broke in the first place

#

It worked just fine on 0.4.0 and newly created groups already had components also created

#

If it's not a bug, why was the behavior changed?

#

That's what I wonder about

amber flicker
#

Not sure you'll find that answer here - slightly more chance on forums with more staff monitoring it

fringe sinew
#

Yeah, already wrote there

tardy locust
#

@naive parrot will try that thanks

#

Though why would you ever have a mesh with a texture without having it render on screen?

#

Seems weird

#

What does that particular component do?

opaque ledge
#

WorldRendererBounds is automatically created for you (there is a system for that), but i do remember an Unity staff saying that you shouldnt create renderable stuff from code, you should instantiate from a prefab

#

(first post)

tardy locust
#

But then it isn't really pure ecs any more is it?

#

And the code I presented above have worked in a previous version of ECS so I was very confused when nothing rendered to screen

#

So...to use ECS programmatically, don't?

#

Just make prefabs?

wide fiber
#

How can I call a non-static function in a Foreach with burst?
HasComponent is a non-static function and I can use it with burst, but if I make a function and I try to call it from the Foreach it gives me errors

#

I need to use the entity manager inside the function, so I want it to not be static

opaque ledge
#

Has/Get/SetComponent are part of SystemBase, and Unity generates a code from your ForEach

#

You cant use Entity Manager inside ForEach (with burst) since its a reference type

wide fiber
#

Ok.. I was trying to make a GetChildrenWithComponent function, why Unity hasn't provided an easy to use function to get the children entities that have a component :(

lusty otter
#

I don't think children entities make sense, that seems straying away from "data oriented"

opaque ledge
#

you can have "DynamicBuffer<Child> children" in your query and check if they have a component or with HasComponent<X>(children[i].Value)

lusty otter
#

Or another potential way is to let children have a parent component.

opaque ledge
#

Well it depends, normally it should be done as Burrito said, but if there is a need of hiearchy and child has a render component that needs to move with parent then you add to Child buffer, this is how its done if you convert a prefab for example

#

DOTS Editor got 0.5.1 update, but its only for "Updated package depenencies"

lusty otter
storm ravine
#

So...to use ECS programmatically, don't?
@tardy locust Only thing changed is RenderBounds component now not adding automatically by HybridRenderer system. You should only add RenderBounds to your archetype and set proper AABB because in other case AABB will be in pivot and frustrum will cull your mesh when pivot out of screen. I explained and showed every thing here https://forum.unity.com/threads/issue-with-rendermesh-component-mesh-not-displayed.835858/#post-5524012 (can read whole thread)

tardy locust
#

okay

storm ravine
#

WorldRendererBounds is automatically created for you (there is a system for that), but i do remember an Unity staff saying that you shouldnt create renderable stuff from code, you should instantiate from a prefab
@opaque ledge RenderBounds enough, Chunk and World render bounds will be added automatically if you have RenderBounds

tardy locust
#

I added RenderBounds now.

#

And it does render at least

wide fiber
#

@opaque ledge that's what I am trying to do but I want to be recursive (to search also in the children of the children...) and I want to put it inside a function. But I can't use burst :(

lusty otter
#

You can use static functions.

opaque ledge
#

then do GetBufferFromEntity<Child> to access the child buffer of every entity

coarse turtle
#

why not just a custom implemented RecurseChildren(BufferFromEntity<Child> children, Entity current) function?

lusty otter
#

You can even flatten the recursion

#

Have a NativeList of entities you want to process, process one from the list, if it has children then add the children to the list, then process next.

coarse turtle
#

that too

wide fiber
#

@lusty otter that's what I am doing.. but I am using NativeQueue instead of NativeList, I hope they are faster

#

@opaque ledge if the entity hasn't got the buffer Child and I call GetBufferFromEntity what happens? How can I check if an entity has a buffer?

dull copper
#

@mint iron did you have issues with this? Editor: "Generate all .csproj files" setting needs to be toggled on every startup for all the csproj files to actually be generated.

#

(fixed on 2020.1.0b7)

#

or was it some other related issue

wide fiber
#

@lusty otter how? How can I call GetBufferFromEntity inside a static function?

tardy locust
#

Some sanity checking here and asking for help. I want to spawn a lot of bees and then move them to a random position on screen to sort of test some technical limits on my hardware.

protected override void OnUpdate()
{
    float deltaTime = Time.DeltaTime;
    NativeArray<Entity> Beentities = m_EntityManager.CreateEntityQuery(typeof(BeeData)).ToEntityArray(Allocator.Temp);
    for (int index = 0; index < Beentities.Length; index++)
    {
        BeeData bee = m_EntityManager.GetComponentData<BeeData>(Beentities[index]);
        Translation translation = m_EntityManager.GetComponentData<Translation>(Beentities[index]);
        Job.WithCode(() =>
        {
            float3 target;
            if (targetPositions.TryGetValue(Beentities[index], out target))
            {
                if (!translation.Value.Equals(target))
                {
                    // move towards targetPositions[Beentities[index]]; ??
                }
            }
            else
            {
                float3 randomLocation = rnd.NextFloat3(new float3(-20, 0, 0), new float3(20, 20, 20));
                targetPositions.TryAdd(Beentities[index], randomLocation);
            }
        }).Schedule();
    }
}

But I can't quite figure out how I'm going to figure out if a bee is at the final location and how I figure out how to move it towards a location, if it's not. With traditional gameobjects I'd use something simple like "MoveTowards" but what would be the Unity ECS equivalent?

opaque ledge
#

GetBufferFromEntity returns BufferFromEntity struct, iirc it has a "Has""Exists" method for checking if that entity has Child buffer

coarse turtle
#

You can check if a buffer exists on the entity by using the Exists functionality @wide fiber

wide fiber
#

EntityManager.Exists(whatShouldIPutHere);

tardy locust
#

Isn't it a Exists<T>() ?

warped trail
#

๐Ÿค” cs var temp = GetBufferFromEntity <T>() Entities.ForEach(()=> { tmp.Exists(entity) })

opaque ledge
#

You can still use MoveTowards function inside ForEach, you just convert the result from Vector3 to float3 and put it into translation.Value

#

also where does targetPositions come exactly ?

tardy locust
#

It's a map

#
public class MoveBeesSystem : SystemBase
{
    private EntityManager m_EntityManager;
    private NativeHashMap<Entity, float3> targetPositions;
    private Random rnd;
opaque ledge
#

ah ok

tardy locust
#

I was thinking it would just be a simple way to keep track of all bees target location right now

#

It wouldn't be the solution long term

opaque ledge
#

you simply lerp between current position to target position

tardy locust
#

But to do that, I'd need a Time

#

And I don't have a time

#

It's not a set time to go from A to B

opaque ledge
#

okay so, BeeData has the speed ?

tardy locust
#

Yes

warped trail
#

in my naive tests GetComponent<T>() was faster than hashing and getting values with NativeHashMap๐Ÿค”

tardy locust
#

Does that scale?

wide fiber
#

Ok thanks

opaque ledge
#

i think its much better if you do this with ForEach instead of Job.WithCode, and put target position as a field into BeeData or independent component

tardy locust
#

float3 newLocation = Vector3.MoveTowards(translation.Value, targetPositions[Beentities[index]], deltaTime * bee.Speed); ?

opaque ledge
#

afaik, Get/Has/SetComponent doesnt work with Job.WithCode

#

Yes something like that

tardy locust
#

Isn't using Jobs faster?

coarse turtle
#

You could do something like that

opaque ledge
#

my player movement is also like that

#

ForEach is also a job

coarse turtle
#

or position += math.normalize(destination - currentPosition) * speedOfBee

tardy locust
#

What is the difference between Job.WithCode() and Entities.ForEach then?

warped trail
#

Job.WithCode is like IJob, Entities.ForEach is like IJobParallelFor

tardy locust
#

Oh I see.

opaque ledge
#

you can think ForEach job is specialized for ECS usage, while Job.WithCode is an IJob

warped trail
#

and Entities.ForEach is just IJobChunk under the hood

tardy locust
#

So like this..?

Entities.ForEach((Entity entity, ref BeeData bee, ref Translation translation) =>
        {

        });```
opaque ledge
#

if you have a system that should run on per entities you should go with ForEach, your bee system is good for that, as all bees needs to move

#

yes

tardy locust
#

Are those three refs automatically injected?

coarse turtle
#

internally it does an IJobChunk

opaque ledge
#

Unity generates a code from your ForEach

tardy locust
#

So it does an EntityQuery then?

storm ravine
#

Yes

coarse turtle
#

effectively yes

tardy locust
#
float deltaTime = Time.DeltaTime;
Entities.ForEach((Entity entity, ref BeeData bee, ref Translation translation) =>
{
    float3 target;
    if (targetPositions.TryGetValue(entity, out target))
    {
        if (!translation.Value.Equals(target))
        {
            float3 newLocation = translation.Value;
            newLocation += math.normalize(targetPositions[entity] - translation.Value) * bee.Speed;
        }
    }
    else
    {
        float3 randomLocation = rnd.NextFloat3(new float3(-20, 0, 0), new float3(20, 20, 20));
        targetPositions.TryAdd(entity, randomLocation);
    }
}).Schedule();
opaque ledge
#

idk, all i know is it works

#

but i guess answer is yes ๐Ÿ˜„

#

you have to assign newLocation to translation.Value again after calculating

#

so translation.Value = newLocation

tardy locust
#

Yes, just wanted to see if I was on the right track

storm ravine
#

When it generates code it create EQ for system, this is why you can use WithStoreEntityQueryInField(ref _q) and use that _q before ForEach or inside OnCreate

tardy locust
#

I have never used that

#

Lol

opaque ledge
#

and you have to put WithReadOnly(yourMapVariable) before you do Schedule()

tardy locust
#

I'm new to ECS

#

But the map value can change

opaque ledge
#

does your system change map values ?

tardy locust
#

If the bee reaches its destination, I want to give it a new random location

coarse turtle
opaque ledge
#

ah okay then, dont

tardy locust
#
protected override void OnCreate()
{
    base.OnCreate();
    m_EntityManager = World.EntityManager;
    NativeArray<Entity> entities = m_EntityManager.CreateEntityQuery(typeof(BeeData)).ToEntityArray(Allocator.Temp);
    targetPositions = new NativeHashMap<Entity, float3>(entities.Length, Allocator.Persistent);
    rnd = new Random();
    rnd.InitState();
    entities.Dispose();
}
#

I set it up like this

opaque ledge
#

but like i said, imo just give every bee a destination component, it makes much more sense that way

tardy locust
#

I'll probably do that later

#

Just wanted something that works now that I can make better later ๐Ÿ™‚

coarse turtle
#

the SystemBase has a function GetEntityQuery(EntityQueryDesc) and a few overrides

tardy locust
#

You know, don't optimise before you got something that works

warped trail
#

m_EntityManager = World.EntityManager; is unnecessary ๐Ÿค”

tardy locust
#

๐Ÿ˜„

#

I've made one ECS project before and I needed the EntityManager everywhere

#

So I just went with that hah

storm ravine
#

the SystemBase has an function GetEntityQuery(EntityQueryDesc) and a few overrides
@coarse turtle Which you can pass to Entities.ForEach yet

tardy locust
storm ravine
#

@tardy locust will your NHM writing safe in context of race conditions?

tardy locust
#

NHM?

storm ravine
#

NativeHashMap

tardy locust
#

I use "TryAdd"

storm ravine
#

It's not what I'm talking about ๐Ÿ™‚

opaque ledge
#

he is only doing it for testing

storm ravine
#

Will be the case in your ForEach when you'll try to write and write\read to the same index from different execution paths?

tardy locust
#

Should not be possible.

#
float deltaTime = Time.DeltaTime;
Entities.ForEach((Entity entity, ref BeeData bee, ref Translation translation) =>
{
    float3 target;
    if (targetPositions.TryGetValue(entity, out target))
    {
        if (!translation.Value.Equals(target))
        {
            // move towards targetPositions[Beentities[index]]; ??
            float3 newLocation = translation.Value;
            newLocation += math.normalize(targetPositions[entity] - translation.Value) * bee.Speed;
            translation.Value = newLocation;
        }
        else
        {
            float3 randomLocation = rnd.NextFloat3(new float3(-20, 0, 0), new float3(20, 20, 20));
            targetPositions[entity] = randomLocation;
        }
    }
    else
    {
        float3 randomLocation = rnd.NextFloat3(new float3(-20, 0, 0), new float3(20, 20, 20));
        targetPositions.TryAdd(entity, randomLocation);
    }
}).Schedule();

The same index is never written/read at the same time

storm ravine
#

if so your passed in to ForEach map can be .WithNativeDisableParallelForRestriction(map)

#

Thus you can read and write if you sure in safety and it wouldn't the case of race condition

#

Oh see your code

#

nope it wouldn't be safe

opaque ledge
#

you should also multiply by delta time so it will be frame independent

storm ravine
#

you can read\write existing values

#

but not adding new

warped trail
#

why don't you just store target inside component?

tardy locust
#

Good point @opaque ledge

#

Jesus my keyboard

#

Any way

opaque ledge
#

๐Ÿ˜„

tardy locust
#

I just wanted to make something that worked right now @warped trail

#

And that was my first idea

storm ravine
#

Well as mentioned above you should definitely go through component for target

#

It will work in your case only if your job will be on thread

tardy locust
#

sigh =_=

opaque ledge
#

๐Ÿ˜„

storm ravine
#

by Run or Schedule, when all your entities will be processed on same thread

opaque ledge
#

you are angering DOTS Gods ๐Ÿ˜ฑ

storm ravine
#

ScheduleParallel will cause race condition in that case

tardy locust
#

It's just frustrating. I got the idea this should be as simple as I presented it.

#

But then it isn't and I have to rewrite shit =_=

storm ravine
#

Well you Idea will work

#

as I said

#

With Schefule\Run

tardy locust
#

No it won't work. It won't make use of the system as intended which is the whole point.

warped trail
#

just store it it inside component๐Ÿค”

storm ravine
#

Because all data will be processed on one (main (Run) or worker (Schedule)) thread sequentially

#

No it won't work. It won't make use of the system as intended which is the whole point.
@tardy locust It will, but it wouldn't be multithreaded

tardy locust
#

So it's exactly what I said?

#

Won't work.

#

Anyway, rewriting...

storm ravine
#

It work ๐Ÿ™‚ But work on one thread ๐Ÿ™‚ If it "won't work" it doesn't work anywhere ๐Ÿ™‚

tardy locust
#

We are talking ECS here

storm ravine
#

And what

#

ECS it's not about multithreading

#

at all

tardy locust
#

If it doesn't use multithreaded functionality like this, then it's as good as not working.

#

Might as well not bother

#

Either way I'm frustrated. So please stop poking the bear as they say .-.

#

I'll be back and cooled off

warped trail
#

you are underestimating burst๐Ÿ˜”

tardy locust
#

The compiler literally told me "DontUseBurst()"

#

So burst clearly don't want any part of this

storm ravine
#

ECS it's about data layout in general which give you performance gains as bonus but not as initial point

tardy locust
#

eizen

storm ravine
#

You can use burst here

tardy locust
#

You hopefully got what I meant and isn't obtuse

#

So please

#

I get it. And thank you for your time, so far.

opaque ledge
#

i think its because you are doing TryAdd

#

but yeah go for target position component

#

thats the proper way

#

as systems shouldnt have data

tardy locust
#

Lots of things is the "proper way". That doesn't mean it's where you start.

storm ravine
#

TryAdd not a problem

opaque ledge
#

As long as you learn i am cool^^ i have been learning ECS for 4-5 months now, and i have to get better everyday

tardy locust
#

That's fine, but people have got to learn how to let go and let me be frustrated so I can come back and not be frustrated.

opaque ledge
#

doesnt TryAdd introduces try/catch/finally block which is not supported by burst ?

storm ravine
#

No

#

It's not Try Catch under hood

#

Under hood you can look at TryAddAtomic

opaque ledge
#

well anyway, gl out there Omni ๐Ÿ˜‰

storm ravine
#

In UsafeHashMap which data is what NHM uses under hood

#

The compiler literally told me "DontUseBurst()"
@tardy locust Share what compiler told you ๐Ÿ™‚

opaque ledge
#

ah, perhaps its because that hash map is class member and he doesnt get it locally, so he is working with class member and not a local catched variable

storm ravine
#

Yep right

#

And note about rnd in your case ๐Ÿ™‚ If you're using Mathematics.Random and your ForEach will be multithreaded - every thread will produce same set of values inside execution path. You should have array of predefined Random struct instances per thread and use them, and don't forget return values back

mint iron
#

Its not too surprising that people have this idea that multi-threading everything will make it better. Its pretty much the marketing Unity has been doing, ECS - cachelines, multi-threading, make milliions of stuff at 60FPS!

opaque ledge
#

isnt it true ?

storm ravine
#

Its not too surprising that people have this idea that multi-threading everything will make it better. Its pretty much the marketing Unity has been doing, ECS - cachelines, multi-threading, make milliions of stuff at 60FPS!
@mint iron Not ECS itself but DOTS ๐Ÿ™‚ General mistake is people think about whole stack as "It's ECS"

coarse turtle
#

not necessarily @opaque ledge

#

it's really context

storm ravine
#

Multithreading and burst can live without ECS completely fine and this is what many people do - not using ECS and just using jobs and burst with existing OOP code.

lusty otter
#

That's what I ended up rewriting my project too.

#

My project is extremely simple so using ECS brings more complication than benefit.

pseudo pollen
#

it can be process to get some migration paths to ECS

amber flicker
#

use of all the cores will always be better than not for performance paging @dull copper ๐Ÿคฃ

#

but agree with sentiment

lusty otter
#

Utilizing multiple core is also energy intensive too, especially on mobile it's a big concern.

mint iron
#

hes not wrong, but only when things are done properly. (outside of the obvious mistake there that the work to be done needs to be more than the overheads.). But i mean you can easily have false sharing and a myriad of other issues and see less performance.

storm ravine
#

Multiple cores not might better performance, you can use multiple thread but with wrong interlock usage it will be much slower than one thread

wide fiber
#

You can use static functions.
@lusty otter I can't, I can't use GetBufferFromEntity inside a static function

storm ravine
#

Utilizing multiple core is also energy intensive too, especially on mobile it's a big concern.
@lusty otter opposite ๐Ÿ™‚ in general it's better because off less CPU working time

#

And Unity promote that in same way

lusty otter
#

Oh really, I was not aware of that at all.

#

TIL.

storm ravine
#

energy consuming in this case less than betefits of CPU idling

#

But as said before - proper implementation that's all that matter

dull copper
#

heh

#

yeah, I've gotten bit sidetracked

storm ravine
#

because with "wrong" multithreading you'll destroy performance

dull copper
#

should get back to that test project

tardy locust
#

Here is the sitch:
https://www.youtube.com/watch?v=7NEXsKuygkw

I have a bug in there where all the bees decide to become a big blob of a box, but I know why that is. Forgot to change something about the randomized location.
Though what is weird is that some of those boxes just starts vibrating violently in place before they go somewhere else. I'm assuming it's because the random generation doesn't produce a value that's different enough to warrant much movement.

dull copper
#

@digital scarab since you have TR, have you noticed that DOTS packages like physics and hybridv2 doesn't really scale well past few cores?

wide fiber
#

I am trying to make the function static and pass the EntityManager as a parameter (I know it won't allow me to use Burst but at least I can call this function without having a reference to the class) but entity manager doesn't have the function GetBufferFromEntity

lusty otter
#

Angelo I haven't tried using GetBufferFromEntity, can you use it in a static function of SystemBase?

dull copper
#

this is essentially what I'm building a test project for, if I have more than few workers, perf declines

#

I have to manually limit the worker count to get the best perf

coarse turtle
#

GetBufferFromEntity is a function from a SystemBase @wide fiber

storm ravine
#

@digital scarab and more threads will produce more bad performance with wrong implementation

#

because of more context switching

dull copper
#

on 23 workers (which I get by default on my 12core), I get like twice worse perf than with 3-4

storm ravine
#

because of more interlocks ๐Ÿ™‚

wide fiber
#

GetBufferFromEntity is a function from a SystemBase @wide fiber
@coarse turtle Yeah I know that, the problem is that I can't check if the entity has the buffer

tardy locust
#

That's 50,000 bees btw

storm ravine
#

But with proper usage - of course multithreading better

wide fiber
#

Because in a system base function I can use GetBufferFromEntity<Child>(true).Exists(entity) to check if entity has the buffer Child

lusty otter
#

The early days of programming when multithreading is so easy to do wrong and so difficult to do right, most people didn't even attempt it, the performance gain was not worth the development cost.

#

It's so much better nowadays it's amazing to witness things change.

storm ravine
#

@tardy locust read above about how you should work with Mathematics.Random

dull copper
#

@digital scarab I'm building a test project for this, will post it on forums too once I've gotten some generic cases there. I currently have a tool that lets you adjust and visualize worker amount and also see profiling samplers for dots so it's really easy to tell the cost per system on different worker amounts

wide fiber
#

@lusty otter if a function is static it can't access to not static values/functions. GetBufferFromEntity isn't static

dull copper
#

it's a simple thing but it's harder to see the effect just by looking profiler

#

I'm actually surprised that dots physics performs like best on 0-1 worker count

coarse turtle
#

Why not pass it to the static function @wide fiber ?

dull copper
#

rendering seems to peak around 3-4 workers on my test scene

tardy locust
#

Not sure which message you are referring to @storm ravine

dull copper
#

anything else and perf declines

storm ravine
#

@tardy locust and second thing I guess you not clamping newLocation += math.normalize(targetPositions[entity] - translation.Value) * bee.Speed * deltaTime;? And it's floating point numbers

tardy locust
#

Yes

storm ravine
#

You should compare with some epsilon value

#

This is why bees glitching on a place

dull copper
#

I'm really waiting for the perf improvements on "more typical" game scenarios... in other words... not only for brute force massive scale sims

tardy locust
#

That's what ECS is for anyway. Bigscale sim

dull copper
#

it shouldn't be

tardy locust
#

There is that pong video from Unity where the author is even like "We are doing pong in ECS. This is pretty overkill though."

wide fiber
#

@coarse turtle that's what I've done.. (but I can't use burst, EntityManager is a reference, so I can't pass it to the function using burst)

dull copper
#

but how unity has showcased ECS has made people think you should only do large scale sims with it

storm ravine
#

No ๐Ÿ™‚ ECS not about Bigscale sim, please don't think so.

coarse turtle
#

Oh you should be using EntityManager inside a job @wide fiber

lusty otter
#

Why do you need EntityManager inside a job

tardy locust
#

ECS allows you to do more processing seeing as memory layout is better.

#

This naturally leads to want to do more

#

aka big simulations

dull copper
#

nah

tardy locust
#

It does, though

#

I'm not saying it's the only usecase

dull copper
#

well, I'll just disagree on that ๐Ÿ˜„

mint iron
#

you were saying its what its for

storm ravine
#

It's side benefit of ECS yes

tardy locust
#

People really like to be pedantic in here I've noticed ๐Ÿ™ƒ

dull copper
#

yeah, it does suit that really well

#

but having things in more optimal way for cpu does benefit smaller scale things too

storm ravine
#

Because if people think so they will spread this across other ๐Ÿ™‚

tardy locust
#

Sure it does

#

It's already out there

#

The generalizations always flow better than the specifics

storm ravine
#

And every one will think about ECS only like its all for bigsim

tardy locust
#

I don't know. Ask someone to make pong using GOs and using Entities. I guarantee you they'll likely hate their lives a bit after trying to do something so simple in
ECS compared to GOs

dull copper
#

fyi update from Joachim on scheduling overhead ```When you have small entity/chunk counts, the overhead of scheduling can be higher than just executing the code with .Run(). Do note, that we are doing a lot of work in order to make that not be so...

Specifically we are:

  • Adding support for completely bursted struct based systems. So a system itself can be burst compiled.
  • Doing a bunch of optimizations in IJobChunk & JobScheduler to reduce overhead.

Essentially you can say right now what DOTS is truly amazing at is scale on the axis of large entity counts.
But what we are focused on optimising now is speed on the axis of number of systems with small amounts of entities.```

#

(quote from Timboc's message earlier)

tardy locust
#

Timboc be lurking

amber flicker
#

Enough cooks already ๐Ÿ™‚

tardy locust
#

Still hi Tim

amber flicker
#

hi hi

mint iron
#

the bursted system is interesting, there is a significant cost to just calling all the base class stuff, branches and before/after update, query checks etc. if that all becomes bursted it will help a lot with system scalability.

storm ravine
#

ECS exists long before multithreading every thing times ๐Ÿ™‚ I prefer ECS because of how you structure and architect your code, I used ECS before DOTS things with mono behaviour land ๐Ÿ™‚

tardy locust
#

I know that ECS was here long before

#

As far as I remember some game companies tried to do it in the mid-ninties already

storm ravine
#

Yes

#

Like blizzard

tardy locust
#

But we are talking about ECS in Unity here

#

Not ECS at large

storm ravine
#

We're talking about DOTS here ๐Ÿ™‚

tardy locust
#

ECS falls under that....again it feels like you are being obtuse... _.

#

._.

storm ravine
#

And context of ECS here the same

dull copper
#

projects that will use DOTS for large scale sims will eventually be a niche

#

probably more will do it than now because its simply possible now

#

but even Joachim acknowledges on that post that they need to make this scale better to smaller things too

tardy locust
#

Yeah would be nice

dull copper
#

most games will not be huge mass simulated things

tardy locust
#

What I think is the longterm goal is to have everything under the hood just be ECS by default and then the user can do whatever

#

Kind of like the next type of GameObject

dull copper
#

something like that yes

tardy locust
#

I see no reason to teach everyone how to do ECS this way. It's something programmers care about for sure but designers and average Joe certainly doesn't

dull copper
#

avg Joe ๐Ÿ˜„

#

don't say that to Joachim

storm ravine
#

Somewhere one Joachim crying ๐Ÿ˜„

tardy locust
#

Joachim is super Joe

mint iron
#

its ultimately a way to get rid of the massive code debt in Unity, re-write the engine and have people be excited about it in the process.

pseudo pollen
#

Dots Joe not like GI Joe

warped trail
#

for avg Joe they will introduce object oriented technology stack stack

tardy locust
#

@mint iron Right

#

stack stack

#

I want a stack of stacks pls

#

Scratch that, I want a StackStack of Stacks

dull copper
#

can't have that, sorry

#

not in dots physics anyway

#

๐Ÿค”

tardy locust
#

hm

#

That's no fun

dull copper
#

or just do the hack with physics joints to keep them in place.. ..can imagine how well that would scale ๐Ÿค”

tardy locust
#

And then you get a stack that flies off into space, colliding with itself perpetuatlly

#

Probably one of the most fun quirks of game engines imo

dull copper
#

the issue really is the lack of cache so things keep drifting all the time

warped trail
#

if you want stacking there is Havok๐Ÿ˜

mint iron
#

btw, i like your bee box, you should keep that as a feature

dull copper
#

but it's not stateless and will never be crossplatform deterministic

#

(havok that is)

tardy locust
#

Who needs determinism?

#

Give in to chance!

dull copper
#

only like every networking programmer out there ๐Ÿ˜„

storm ravine
#

Every network game

tardy locust
#

It was a joke..

storm ravine
#

We're dont understand jokes, we're linear as memory wlgF

dull copper
#

still wondering if the burst crossplatform determinism has been pushed to backlog

#

or if they actually did it but it didn't really work as planned and now they just keep silent about it

tardy locust
#

Question; I have a system that I want to be able to configure via an inspector, just like I do with GOs. Is this something I can do?
I want to set up random spawn parameters.

storm ravine
#

No

dull copper
#

crossplatform determism was supposed to arrive like 2 years ago already

storm ravine
#

Conversion Workflow

#

This is your way

tardy locust
#

So I have to hardcode that in every time?

storm ravine
#

Conversion Workflow

tardy locust
#

I have these two in my BeeSpawner script which is a MonoBehaviour:

[Header("Debug")]
public float3 LowerLeftCorner;
public float3 UpperRightCorner;

But in my BeeMoveSystem I have no way of bringing those over.
You say conversion workflow. I don't know what that is.

storm ravine
#

You have your GO MonoBehaviour

#

this at load converts and in conversion you process things and store it inside blobs, singleton entities, static field (meh) etc.

warped trail
#

@dull copper it's not something we're working on right now. It's definitely a feature we want to do (maybe later this year), but it's a significant piece of work and (so far) not as high priority as the other things we're working on. We do listen to feedback though so it's useful to hear that it's something you're interested in.

wide fiber
#

How can I get a component from an entity as a reference? I want to modify it and automatically apply the changes

GetComponent gives me a copy

dull copper
#

simplest thing is to just make IComponentData and set GenerateAuthoringComponent for it, slap that then on your GO with convert to entity script

#

or whatever those were named

#

@warped trail yeah, that's kinda been the thing with it as long as I've been asking about it ๐Ÿ˜…

#

I do believe they've done some work on it already though

storm ravine
#

For example we're using Addressables load SO and GO from them async and convert data to entity prefabs with blobs and singleton entities which hold some shared data

warped trail
#

@wide fiber you can use SetComponent() which uses ComponentDataFromEntity

storm ravine
#

And just use that data inside systems by querying it with Require(Singleton)ForUpdate

tardy locust
#

So I make that setup @dull copper , then what? How do I retrieve that and use it?

storm ravine
#

Query that

#

You definitely should start from docs and samples repo. They have described authoring samples

wide fiber
#

@warped trail There is no way other than this? In the Entities.Foreach when I get a component as a reference it works in this way?

warped trail
#

basic workflow is you get something with ComponentDataFromEntity[entity] change it and assign it back to ComponentDataFromEntity[entity] = modifiedcomponent

storm ravine
#

In samples repo you'll see how they convert things like spawners etc

dull copper
#

@tardy locust you may want to go through that Unity's pong tutorial

#

pretty sure it explains things like these

#

samples repo is also good if you are fine with just small examples

#

it's not really highlighting all the possiblities tho

#

I do hope they make more practical samples some day

tardy locust
#

The mega city and FPS samples were practically not of any use to me

#

Way too big

#

Could not get the understanding of even a fraction of it

storm ravine
#

Well thus sample repo will help you alot

#

Where they have small dedicated samples

coarse turtle
#

sample repo, tiny racer are probably much easier to digest

#

tiny spaceship too if you want to dive into their 2d content

wide fiber
#

The entty debugger has a lot of problems, when I am playing the game and I select an entity to inspect, the entity disappears randomly..

#

I can't inspect entities when I am playing.. (without breaking things)

mint iron
#

i couldn't even open megacity, let alone run it, you need a really good machine ๐Ÿ™‚

tardy locust
#

I did this

coarse turtle
#

I had trouble downloading it ๐Ÿ˜…

tardy locust
#

Gives me errors when trying to query

#
// Private variables
private EntityManager m_EntityManager;
private float3 LowerLeftCorner;
private float3 UpperRightCorner;

public void Awake()
{
    m_EntityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
    Entity boundaryEntity = m_EntityManager.CreateEntityQuery(typeof(BeeBoundariesData)).ToEntityArray(Allocator.TempJob)[0];
    BeeBoundariesData boundaries = m_EntityManager.GetComponentData<BeeBoundariesData>(boundaryEntity);
    LowerLeftCorner = boundaries.LowerLeftCorner;
    UpperRightCorner = boundaries.UpperRightCorner;
}
mint iron
#

just do what 0lento suggested, make a component, slap the authoring component attribute on it, add it to a monobehavior.... profit

tardy locust
#

I fucking did though ๐Ÿ™ƒ

mint iron
#

ahh yep, guess i should actually read properly lol

coarse turtle
#

i wonder if the default world is fully constructed

#

Ik ConvertToEntity is called in Awake

tardy locust
#

Okay moved it to Start

#

now I just have a memory leak

#

But that's at least just because of the query I guess

mint iron
#

any time you use Allocator.Something and that something is not .Temp you'll need to dispose it manually.

tardy locust
#

Yeah I get that. It's just so much more code to do something so simple

#

I'll do that now I guess

amber flicker
#

can likely just change it to Temp for now I think (editor restart to hide leak warnings might be necessary though)

mint iron
#

it would be nicer in a system if thats possible

tardy locust
#

I had to make it TempJob at the time

#

Otherwise it wouldn't let me

#

I need this on spawn and in my system @mint iron ๐Ÿ™ƒ

mint iron
#

yeah does a job under the hood ๐Ÿ˜ฆ

#
    public class MySystem : SystemBase
    {
        private BeeBoundariesData _boundaries;

        protected override void OnCreate()
        {
            _boundaries = GetSingleton<BeeBoundariesData>();
        }

        protected override void OnUpdate()
        {
            var boundaries = _boundaries;

            Entities.ForEach((Whatever data) =>
            {
                // do something with boundaries
            });
        }
    }
#

super clean!

tardy locust
#

Every time I've tried to make a field out of anything

#

And put it in ForEach

#

It tells me "You can't do that"

#

So I have no chance of ever thinking the above solution should work

coarse turtle
#

i think for start you can probably just write the Entities.ForEach() statements with an explicit WithoutBurst()

tardy locust
#

But I want to use burst ._.

#

What's the point then?

coarse turtle
#

Get used to structure I'd say

mint iron
#

u cant access the field directly it needs to be local var

#

i wish they would change that cause it bloats the code so much

tardy locust
#

See I knew that shit wouldn't work

#

Moving it to OnUpdate

#

Now I get "The Entity does not exist" ๐Ÿ™ƒ

mint iron
#

can you post your code

tardy locust
#

Which part

mint iron
#

all of it ๐Ÿ™‚

tardy locust
#

This is where I spawn my stuff in a MonoBehaviour

// Private variables
private EntityManager m_EntityManager;
private float3 LowerLeftCorner;
private float3 UpperRightCorner;

public void Awake()
{
    m_EntityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
}

// Start is called before the first frame update
void Start()
{
    NativeArray<Entity> boundaryArray = new NativeArray<Entity>(1, Allocator.Temp);
    BeeBoundariesData boundaries = m_EntityManager.GetComponentData<BeeBoundariesData>(boundaryArray[0]);
    LowerLeftCorner = boundaries.LowerLeftCorner;
    UpperRightCorner = boundaries.UpperRightCorner;
    boundaryArray.Dispose();

This is where I try to initialise my stuff in the system:

protected override void OnUpdate()
{
    float deltaTime = Time.DeltaTime;
    Random rnd = new Random();
    rnd.InitState(++randomSeed);
    BeeBoundariesData _boundaries = GetSingleton<BeeBoundariesData>();
    Entities.ForEach((Entity entity, ref BeeData bee, ref Translation translation) =>
    {
        if (Vector3.SqrMagnitude(bee.Destination - translation.Value) < 0.001)
        {
            float3 randomLocation = rnd.NextFloat3(_boundaries.LowerLeftCorner, _boundaries.UpperRightCorner);
            bee.Destination = randomLocation;
        }
        else
        {
            float3 newLocation = translation.Value;
            newLocation += math.normalize(bee.Destination - translation.Value) * bee.Speed * deltaTime;
            translation.Value = newLocation;
        }
    }).Schedule();
}
coarse turtle
#
NativeArray<Entity> boundaryArray = new NativeArray<Entity>(1, Allocator.Temp);
    BeeBoundariesData boundaries = m_EntityManager.GetComponentData<BeeBoundariesData>(boundaryArray[0]);

Wondering how this is supposed to work, I dont think the entity allocated in the boundaryArray is a registered entity to the World

bitter socket
#

Where should I direct my Animation Questions with the new DOTS implementation? I would assume art, but the new animation package is only something that programmers can make sense of. so do I ask here, or still in Animation?

tardy locust
#

I do what I've seen everywhere else.
Do a query, get the entity, find the data you want.

storm ravine
coarse turtle
#

Yes, but I dont think that entity is a valid entity in Start. I'm pretty sure that entity is initialized with the default constructor. If you tried m_EntityManager.SetName(boundaryArray[0], "Some Name"), do you see the entity's name in the EntityDebugger?

tardy locust
#

I don't know how Unity expects me to do what I'm doing right now

#

I want to have an inspector-like setup so that I can both set the values I want, while passing them to my system, where I can iterate fast (that's the whole point of Unity's inspector anyway), to do this I've been told to make a Data Authoring setup. Okay. I've made a script that holds the two values I want to use at generation and in my system. It is now an entity.

How am I supposed to retrieve it and use it in both cases? Because nothing works right now.

coarse turtle
#

Well Unity samples have entities created through ConvertToEntity or via subscenes.

tardy locust
#

I'm already using ConvertToEntity

#

On my game object

#

In the scene

#

So it can be converted

mint iron
#

have you checked that it shows up in EntityDebugger?

storm ravine
#

NativeArray<Entity> boundaryArray = new NativeArray<Entity>(1, Allocator.Temp);
BeeBoundariesData boundaries = m_EntityManager.GetComponentData<BeeBoundariesData>(boundaryArray[0]);

tardy locust
storm ravine
#

this two rows above wrong. If you want get entity outside of system you should create query

#

and get entity array from query

#

Where should I direct my Animation Questions with the new DOTS implementation? I would assume art, but the new animation package is only something that programmers can make sense of. so do I ask here, or still in Animation?
@bitter socket depends ๐Ÿ™‚

warped trail
#

if you have only one BeeBoundaries you can just call๐Ÿค” var tempBoundaries = GetSinglton<BeeBoundaries>()

tardy locust
#
void Start()
{
    NativeArray<Entity> boundaryArray = m_EntityManager.CreateEntityQuery(typeof(BeeBoundariesData)).ToEntityArray(Allocator.TempJob);
    BeeBoundariesData boundaries = m_EntityManager.GetComponentData<BeeBoundariesData>(boundaryArray[0]);
    LowerLeftCorner = boundaries.LowerLeftCorner;
    UpperRightCorner = boundaries.UpperRightCorner;
    boundaryArray.Dispose();

This works. That's a lot of code for something that's a single line in the GO setup.

#

But it works, I guess.

coarse turtle
#

I'm also curious about set up

#

wondering if the script with the boundaryArray[0] lives on the same gameObject that gets converted

warped trail
#

i think he is overcomplicating stuff himself๐Ÿ˜…

tardy locust
#

I'm trying to follow what's being said here

#

I have a MonoBehaviour that inits all the bees and a system that makes the bees move

storm ravine
#

if you have only one BeeBoundaries you can just call๐Ÿค” var tempBoundaries = GetSinglton<BeeBoundaries>()
@warped trail inside system, not inside MonoBehaviours

tardy locust
#

It shouldn't be super complicated to have a single structure of data that both of those can share.

#

And it appears that it was

#

I don't see how you can conclude that this is me over complicating things

storm ravine
#

You need that Monobehaviour with Awake\Start?

warped trail
#

i think you should consider using subscene๐Ÿค”

tardy locust
#

I don't know what subscene is in this context.

warped trail
#

with subscene you can change component values via editor

storm ravine
#

Subscenes not solve that. Authoring already solve that

warped trail
#

in playmode

storm ravine
#

I mean there is no need to use subscenes

#

You need that Monobehaviour with Awake\Start?
@tardy locust

tardy locust
#

I'm setting up things in it, yes

storm ravine
#

Well if you need that in your MB this is how it works with entity query etc.

#

For systems it will be just 1 line var tempBoundaries = GetSinglton<BeeBoundaries>()

warped trail
#

maybe he is using mb so he can change values at runtime?๐Ÿค”

tardy locust
#

Painful delivery but there it is

#

Look at 'em go

#

I don't think I'll need 50,000 bees but it's good to see what that looks like

storm ravine
#

Good start ๐Ÿ™‚ We using 50k+ for armies ๐Ÿ™‚

mint iron
#

very cool, how are you using character animation, is it all MB/Animator still or using animation package?

storm ravine
#

very cool, how are you using character animation, is it all MB/Animator still or using animation package?
@mint iron No

tardy locust
#

inferiority complex intensifies

storm ravine
#

I wrote custom animation logic with couple of converters and shaders

#

Most part of our game is custom

low tangle
#

oh hey eizenhorn

storm ravine
#

own physics, animation, navigation

low tangle
#

was literally just checking the forums and your thread

tardy locust
#

I'd like to say thanks for the help from here so far. I get frustrated when shit that's supposed to be simple doesn't work as I thought it would and in fact requires more complexity than I'd have thought reasonable.

It makes me feel like I truly am a fucking dumbass.

#

And then it adds to the frustration

vagrant surge
#

thats so cool

storm ravine
#

was literally just checking the forums and your thread
@low tangle yeah, after release will be second big thread, again with implementation tech details, how we evolved with DOTS, because we use it from the beginning of DOTS ๐Ÿ˜„ How we use Addressables with DOTS, and about our custom solutions, from Fog of war to navigation

low tangle
#

looking forward to it then

#

wish I could've gone as full custom as your game

#

multi player + modding prevents it though ๐Ÿ˜ข

storm ravine
#

BTW if it's not in yours wish list ๐Ÿ˜„

tardy locust
#

๐Ÿ˜›

storm ravine
#

Where I post from time to time showcase of things implemented through DOTS, and my talks from conferences

tardy locust
#

Well

#

I hope you of all people then, can understand my frustrations today

storm ravine
#

Well, only hard thing for me from the beginning was switch mind form many years of OOP to DOD. All other things has nothing special ๐Ÿ™‚ What you see now it's much more developer friendly than it was at the beginning ๐Ÿ™‚

tardy locust
#

I don't doubt that this was the case

#

re: DOTS being easier now than earlier

storm ravine
#

In Future it will be more convenient, because it's still in preview ๐Ÿ™‚

#

People just should be a bit more patient ๐Ÿ™‚

stiff skiff
#

How come NativeArray can be used in Burst, while it holds a reference type in the editor?

tardy locust
#

But as someone like me, who is just getting into this now I can tell you that it feels about as inaccessible to work with as it did 7 months ago when I made an actual project work and even before that when I tried to just learn how it was supposed to work at all

dull copper
#

ecs is way easier now but the tooling still sucks ๐Ÿ˜„

storm ravine
#

Every thing will be easier for newcomes in DOTS

dull copper
#

I like how they got rid of the boilerplate on the code side

coarse turtle
#

Hey @storm ravine I also heard you were adopting UIElements too for you game how was the workflow with integrating it with dots ๐Ÿ‘€

storm ravine
#

ecs is way easier now but the tooling still sucks ๐Ÿ˜„
@dull copper yeah true, switching from DOD to OOP - never ๐Ÿ˜„

amber flicker
#

I'd say all of us have been frustrated at times with DOTS - it's new, it's changing, it breaks. Though a lot of us here probably think that actually, although it's very different, it's not necessarily more complicated. Potentially the opposite. So frustration, absolutely, criticisms of the technology - you have to get more specific. Just my opinion.

dull copper
#

I do feel it does complicate some interactions way more

tardy locust
#

A friend of mine put it nicely once, I think; "Unity is trying to make ECS accessible to everyone. Therein lies the frustration with its development."

dull copper
#

but I do like the separation between data and systems

tardy locust
#

And as I've shown earlier

#

Making an inspector setup with ECS and GOs as it is right now, takes 5 times as many lines of code for every component you want to work this way

dull copper
#

it's still like 5x less than it was half a year ago ๐Ÿค”

amber flicker
#

Accessible to developers rather than everyone right? I know I've improved massively as a developer since this push.

tardy locust
#

I'm not saying it's a bad direction

#

I think it's good

#

And likely very needed

dull copper
#

I don't really know if preview and heavily wip tech needs to be accessible for all though

vagrant surge
#

its a shame they nuked the ECS visual script

tardy locust
#

I get frustrated because something that was so painfully simple with GOs has been made very tedious to do with ECS

dull copper
#

they nuked it?

storm ravine
#

Hey @storm ravine I also heard you were adopting UIElements too for you game how was the workflow with integrating it with dots ๐Ÿ‘€
@coarse turtle Yeah we using UIElements in couple of places, but it's just test mode now, because for runtime it even not released as preview yet, we using unity temporary implementation of drawers from unity

vagrant surge
#

ive allways thought that ECS maps fairly well to visual script due to the fact that most of the systems you make are "small"

tardy locust
#

And I'm guessing that as time goes on this becomes less and less the problem.

vagrant surge
#

@dull copper yes, it no longer does ecs queries and does systems

dull copper
#

Yes it's for DOTS only. That being said, we want to keep DOTS editing very similar to current GO editing. So even though you work in the editor with a familiar GO workflow, all is being converted to DOTS at runtime.

#

that does sound like ECS thing still

vagrant surge
#

nah its 100% rip

storm ravine
#

Making an inspector setup with ECS and GOs as it is right now, takes 5 times as many lines of code for every component you want to work this way
@tardy locust well it's you want to use it inside MonoBehaviour ๐Ÿ™‚ In pure DOTS pipeline GO needed only for authoring

dull copper
#

we still talk about the same thing?

vagrant surge
#

yes

tardy locust
#

This is probably unrelated, but thought I'd mention it:
Two days ago I tried to download 2019.3.11f1 and the DOTS Editor

#

It broke the project immediately and made it unable to build

#

Had to remove the DOTS editor

#

Then it worked again

storm ravine
#

Can't say any thing about 2019.3 sorry. We always on latest Beta

coarse turtle
#

@tardy locust might've been a dependency mismatch

storm ravine
#

2020.1b7 now

coarse turtle
#

Had that issue too not too long ago

dull copper
#

hmmm, dots editor should be updated to be compatible with current entities now

storm ravine
#

Yeah dependencies it's more Package Manager problem than DOTS, they will improve that definitely

coarse turtle
#

yea - I thought it was updated too (havent tested it yet tho)

tardy locust
#

@amber flicker I want to make it clear here that, I don't think this is a bad thing that Unity is doing. I just wish it didn't have to come with this much frustration doing the most simple things. It's a growth pain, right now, but will turn off a lot of people from even getting into it when you do get further which to me is sad.

dull copper
#

I don't use DOTS subscenes now so DOTS editor package does nothing for me

#

so haven't really used it lately

coarse turtle
#

I'd say this transition seems similar to how ppl felt about opengl -> vulkan ๐Ÿค”

dull copper
#

I sure hope the upcoming entity visualizing tools will not work only on dots subscene

#

I mean, I'm afraid they do, but you never know

storm ravine
#

@amber flicker I want to make it clear here that, I don't think this is a bad thing that Unity is doing. I just wish it didn't have to come with this much frustration doing the most simple things. It's a growth pain, right now, but will turn off a lot of people from even getting into it when you do get further which to me is sad.
@tardy locust Just small note - it's in preview, yeah it can be frustrated, bet in other hands we can affect development in early state, and not when all done in way that Unity decided and released and full rewriting just not the case ๐Ÿ™‚

dull copper
#

but vulkan is still a bit of a disaster? ๐Ÿค”

storm ravine
#

This is why you always can send your feedback on forum

#

Unity alway read them

tardy locust
#

@storm ravine I know it's in preview, but considering how hard Unity is pushing this in their blog posts, it feels far from the case that it should still be considered preview.

storm ravine
#

Yep how marketing pushing it - a bit misleading for newcomers

amber flicker
#

@tardy locust that's cool, it's a sentiment I relate to - it's just going to take time and over time you'll see us rant and get frustrated too. That said, "I'm frustrated, here are my pain points, I can see the promise and I'm looking forward to the future" is different to "This is overly complicated".

dull copper
#

you can also take it out here on Topher ๐Ÿ˜„

#

I dunno how well that works

coarse turtle
#

idk - I havent used opengl lately, I kind of got used to the verbose explicit stuff in regards to vulkan lol @dull copper

tardy locust
#

public int myVar;
is very much simpler than;

Make a query.
Get the entity.
Get the data.
Dispose the resulting array from the query.

#

Right?

#

That's really the crux of what I was frustrated over earlier.

amber flicker
#

Some things are more complicated. Overall, likely more simple. Give it some time (to get used to it).

dull copper
#

technically using public variables was never preferred on gameobjects either

#

it's the easy way, sure

vagrant surge
#
We tried something similar. Didn't work during user research/feedback from studios. In my experience, and according to the data we have, our target user is not comfortable with queries - "I will break something as I don't know what I'm targetting", "But I just want to operate on that object", etc. were common.

As said previously: we have plans to cater to these workflows, but later. We're trying to ship a good solution first for specific references (let's call that "scripting" - which happens to be in the name of the tool), then we'll have a second look at system authoring, which will probably include some take on visual queries, which ideally would be reusable across multiple tools.
tardy locust
#

It's for inspector use.

vagrant surge
#

goddamit

#

(looking at the new stuff on the visual scripting thread)

tardy locust
#

No need to get pendatic over that too now.

#

Also have to consider how most people use Unity

warped trail
#

DOTS does not mean ECS๐Ÿ˜…

tardy locust
#

-_-

#

Whatever

dull copper
#

@vagrant surge I have to agree with that quote

tardy locust
#

I think my point has come across at this point and that I reached an understanding of Tim's side too.

vagrant surge
#

@dull copper well, of course if you ask people who dont know anything about ecs, they just ask for a blueprint clone

dull copper
#

I mean I've tried some of the earlier DOTS VS preview and I can't imagine any noncoder being able to understand that easily

vagrant surge
#

but we all know the sheer level of busted blueprint really is

#

@dull copper well, without any docs...

dull copper
#

also this doesn't mean they won't redo that part later on

#

but they need to have something that artists and designers can just use out of the box

stiff skiff
#

Even coders with docs will be tricky, those restrictions applied through Burst are sometimes hard to get used to / work around

dull copper
#

the part that I was most bummed of was them getting rid of the nice C# generation

#

at least, if I understood it right

vagrant surge
#

lets see, but they are, again, pivoting 180 degrees

#

it doesnt give a good image whatsoever

dull copper
#

it's pretty typical at Unity

tardy locust
#

I started using Unity since 5.x and I've been under the impression that the editor itself always tries to be "designer first", not "programmer first". Whereas programmers can go do their thing and provider designers with what they need in an easy-to-use interface. The DOTS VS has to be that level of intuitive

dull copper
#

you saw the visual scripting that had a leaked package but wasn't for DOTS?

vagrant surge
#

yes, but tools already exist for that

dull copper
#

they literally did it all

vagrant surge
#

bolt, etc

dull copper
#

and then dropped it before release, redid it for DOTS

vagrant surge
#

so, like tiny, this is the 2nd time they do a full pivot?

#

man, what a clusterfuck

amber flicker
#

Imo now is a fantastic time for making tools and I'm really grateful I'm able to access this in preview... people Like Eizenhorn are blazing the way forward with games but yea, it's very early to be immediately productive at the same rate as MB stuff.

dull copper
#

tiny has gone through quite many stages

#

first they had the typescript libaries and scripting

#

then they did the c# version

#

then dots mode with different editor scene format

#

and now on conversion workflow

#

I doubt this is the last version either

#

every step mentioned meant you had to redo your project

vagrant surge
#

C# came with the dots editor

#

and thyen they went with conversion

dull copper
#

you sure?

#

I thought it arrived little before

#

but I don't have that great memory

storm ravine
#

editor was before C# Tiny iirc

vagrant surge
#

yeah javascript one had editor

#

then it changed to C#, still with editor, but BIG drop in functionality

#

and then they went to 3d dropping the editor and the 2d functionality they had

storm ravine
#

Yep C# editor was different in comparsion with TS version, until they decided to pause that and use conversion

dull copper
#

tbh I've never really had much interest on tiny other than thinking it being fancy concept

tardy locust
#

Not sure what it is

dull copper
#

the ecs editor was only thing I was interested at on it

#

and even that was total all or nothing approach

vagrant surge
#

i had a lot of hopes for tiny

#

as a "from scratch" unity rewrite, focused aorund the ecs and dots stuff

#

a clean cut removing all legacy stuff is a pretty great opportunity

#

could start by building a fully-feature DOTSbased 2d toolset

storm ravine
#

Well Tiny will be cool at some time definitely ๐Ÿ™‚ Now it's too early, they now like DOTS was at the beginning )))

vagrant surge
#

that would allow very small and performant webgames

#

issue with tiny is that i get the feeling they have no idea what to do with it

lusty otter
#

I really dislike the hybrid approach they are taking with ECS, with all the converting stuffs.

vagrant surge
#

they have very little focus, and scratch a lot of work multiple times

mint iron
#

our target user is not comfortable with queries is anyone clear on what their target personas are? i've been looking but its never explained.

vagrant surge
#

@mint iron blueprint fans

tardy locust
#

People who can't program

dull copper
#

I'd guess artists and designers

vagrant surge
#

yup

fallow mason
#

The kind of person who would primarily use VS I guess

dull copper
#

I mean that's the typical user for visual scripting

storm ravine
#

our target user is not comfortable with queries is anyone clear on what their target personas are? i've been looking but its never explained.
@mint iron 3d Artists ๐Ÿ˜„

fallow mason
#

Kind of makes sense

mint iron
#

okay well thats already lots of different interpretations, all of which have different expectations. Its something they need to be really really clear on, or its going to end badly.

tardy locust
#

3D artists knows node editors

vagrant surge
#

the thing is that houdini node editors and the likes are much more similar to the concepts in ecs than OOP graphs

#

for example in houdini, every node is a "data transformation", input->output

dull copper
#

I don't think avg 3D artists can wrap their head around to use Houdini ๐Ÿ˜„

tardy locust
#

It's not a coincidence that Epic took a page out of the 3D programs books when they made their visual scripting

dull copper
#

it's more of a tool for more technically minded people

storm ravine
#

Yeah node editors, but not ECS way of things ๐Ÿ™‚

vagrant surge
#

@tardy locust blueprint graphs are an oop model directly based on how unrealscript worked

#

esentially visual unrealscript

tardy locust
#

I know

vagrant surge
#

its not like the node graphs on art programs

storm ravine
#

I mean in easy way. Definitely everyon can learn that, just matter of time

vagrant surge
#

the material graph is much more like that

tardy locust
#

But the design philosophy behind the blueprint node system (which came from KISMET in UE3 or even before..?) was based on the node based workflow of 3D programs

dull copper
#

its not like the node graphs on art programs
@vagrant surge still people keep saying even unreals materials being "blueprints"

storm ravine
#

rizu's (I remember your old name ๐Ÿ˜„ ) Houdini sample better ๐Ÿ™‚

dull copper
#

I know, silly right?

#

heh, rizu is actually my old irc nick, I would have changed the forum nick earlier if Unity forums actually allowed to put 0 at the start of the nickname

mint iron
#

ahh IRC, does anybody still use that?

dull copper
#

I still occasionally check few channels there

low tangle
#

I swear everyone forgot that KISMET is where bp came from

storm ravine
#

Yeah here in Russia some people still using that ๐Ÿ™‚

tardy locust
#

@low tangle Right?

dull copper
#

we have this tiny gamedev channel on my old uni + there are some people at #igda.fi I've chatted for a long time

low tangle
#

if you peak though bp its still littered with kinsmet refs

vagrant surge
#

not exactly. Kismet mental model was pretty separated from bps

coarse turtle
#

i dont even know what kismet is ๐Ÿ˜…

dull copper
#

irc is practically dead tho

tardy locust
#

No June is correct here @vagrant surge

vagrant surge
#

there is obviously a shared root, but they are too different

low tangle
#

its a evolution

vagrant surge
#

(im fully aware blueprint was even called kismet2 at the start)

low tangle
#

earlier versions were very very similar

tardy locust
#

It's a new iteration of kismet, sure. But the workflow of that came from 3D programs.

vagrant surge
#

yes, but kismet was kinda its own "thing", with manually made custom nodes

#

blueprint on the other hand is more of a direct translation of unrealscript to nodes

tardy locust
#

The node based design philosophy was still lifted from 3D programs...it is entirely irrelevant what it became

vagrant surge
#

in fact, kismet was its own system, blueprint compiles to unrealscript VM

low tangle
#

still one of the best vs / node graphs I've ever used

dull copper
#

blueprint source code talks about kismet all over it

#

BP's are great for what they are IMO

low tangle
#

export of that image

vagrant surge
#

blueprint is basically the gold standard of visualscript

dull copper
#

yeah, wish they did better on the codegen though

tardy locust
#

I feel like you keep stopping at the topic at the start of this:
Blueprints came from Kismet.
Kismet came from 3D modelling programs.

dull copper
#

like had c++ nativization as first class citizen there

tardy locust
#

The whole node based system is lifted straight out of those programs

vagrant surge
#

the thing is that nativization is done on top of the bytecode

#

not on top of the graph

tardy locust
#

And with UE4 Epic even prided themselves on making a Material editor that was 1:1 with 3D programs for that very reason

low tangle
#

well no shit you cant just 'run' a graph 1:1

vagrant surge
#

unity visual script first C# versions were looking at the node graph, and outputting code

#

blueprint compiles into unrealscript

tardy locust
#

Blueprint compiles to C++ now

vagrant surge
#

and then the cpp converter takes that unrealscript IL, and turns to cpp stack machine

#

that step is what causes the autogenerator to be this... weird

#

with the huge state machine

low tangle
vagrant surge
#

and btw, there are ways of improving it

#

by a lot

#

if you used gotos

low tangle
#

there always is

dull copper
#

well, even Unity's IL2CPP and Burst first build to IL and then convert it further

vagrant surge
#

no, but i mean a huge boost @low tangle

tardy locust
#

That wasn't the topic though

vagrant surge
#

instead of looping on that switch statement, go with gotos

#

and in fact, computed-gotos

low tangle
#

il2cpp output is a monster for almost no gain

tardy locust
#

The actual topic here is where blueprint came from and this has gone so far off the rails due to goalpost moving that it's a rather pointless discussion ๐Ÿ™ƒ

dull copper
#

not sure if there's even topic here that's really ontopic here ๐Ÿ˜„

#

atm anyway

vagrant surge
#

yeah its offtopic af

#

burst compiles from C# directly, no?

#

or does it compile from .net il?

low tangle
#

clr il

dull copper
#

pretty sure it goes through IL

vagrant surge
#

so burst is C# subset -> LLVM-> machine code

tardy locust
#

Why is it that Entities use .NET 2.0 and not 4.0?

vagrant surge
#

or C# -> IL -> LLVM -> machinecode

low tangle
#

burst is clr il -> llvm

vagrant surge
#

so basically same as IL2CPP but bit better

low tangle
#

smaller subset

vagrant surge
#

yeah

low tangle
#

all the new codegen stuff is done before to generate more clr il

vagrant surge
#

i see

#

i always thought burst actually compiled C# itself directly

#

not like IL2PP + lots of restrctions to generate better code

storm ravine
#

Why is it that Entities use .NET 2.0 and not 4.0?
@tardy locust It use .NET Standard 2.0

tardy locust
#

Sure...why not 4.0

dull copper
storm ravine
#

There is not exist Standard 4.0

dull copper
storm ravine
#

.NET Framework 4.0 is different

vagrant surge
#

i see

low tangle
#

.net assembly = CLR IL
common language runtime

storm ravine
#

.NET Framework 4 is part of NET Standard 2

low tangle
#

you can view it using the jobs debugger

tardy locust
#

Yes, it's different...but also allows for a lot of different things that 2.0 didn' no?
So why does entities require 2.0

dull copper
#

yeah, it's bit weird to call that .net assembly tbh

#

but it's meant to be simplified slide

low tangle
#

burst inspector*

storm ravine
#

Yes, it's different...but also allows for a lot of different things that 2.0 didn' no?
So why does entities require 2.0
@tardy locust https://docs.microsoft.com/ru-ru/dotnet/standard/net-standard

#

Again Net framework 4 is part of Net standard 2

low tangle
tardy locust
#

Then why the distinction at all?

low tangle
#

inspector just puts .NET IL

#

all the same thing

tardy locust
#

Like you look in the Unity Player and it has 2.0 and 4

#

Why is the distinction there if 4 is part of 2?

low tangle
#

its a sub set

#

standard 2.0 can't use win forms and system .drawing

#

not exactly those two, but those were some in the past

coarse turtle
#

yea some part of the library doesnt exist in other platforms like nix based systems

low tangle
#

its all mono runtime in the end so its mostly converted anyways

tardy locust
#

I thought the whole point of 4.0 was to move on

low tangle
#

it isn't old unity 2.0

tardy locust
#

If not then that naming convention is pretty damn misleading

storm ravine
#

Like you look in the Unity Player and it has 2.0 and 4
@tardy locust You miis my messages

low tangle
#

that was .net framework 2.0 / 3.5

#

this is .net standard 2.0

storm ravine
#

It's Standard and Framework

tardy locust
#

I understand that you are talking about the standard.
But what is the point?

low tangle
#

which is the companion to 4.6+

storm ravine
#

Which point

low tangle
#

basically plugin support

storm ravine
#

Standard it's newest than framework

tardy locust
storm ravine
#

And it's include that

tardy locust
#

Why is 4.x there if it isn't supposed to replace 2.0

tardy locust
#

That is a super misleading naming convention

storm ravine
#

By the same reason why there was framework 3 and 4 at the same time

tardy locust
#

When would I want to use 4.x vs 2.0?

low tangle
#

standard plugin support

#

most standard stuff will work in 4, but not all

coarse turtle
#

if you had an external library that you want to plugin which requires 4.x

#

I remember using a db plugin once which required 4.x

dull copper
#

2.0 also does have smaller codebase, resulting in smaller binaries - altho they did somewhat recently do better stripping code to compensate that

tardy locust
#

But according to the standard, 4 is in the 2.0 standard?

storm ravine
#

Yes

#

But

#

with some small differences

#

As mentioned above

dull copper
#

if you talk about framework alone, you don't even have to think about it in Unity as they completely removed the 3.5 framework already

#

as for the net standard, I've found 2.0 to be just safer pick overall

#

some stuff doesn't seem to be compatible with 4.x atm on Unity

tardy locust
#

4.x is just a misleading name

#

It seems like it would be newer than 2.0

#

Regardless of it saying "standard" or not

storm ravine
#

it's Microsoft problem ๐Ÿ™‚

#

This is why they decided create one net standard containing all things ๐Ÿ™‚

pseudo pollen
#

now that there is .net standard 2.1 and the new dotnet 5 coming this year

mint iron
pseudo pollen
#

well standard was also for mono runtime too

tardy locust
#

By .NET 5

#

Core will be gone

#

I believe

#

Or at least starting to phase it out

pseudo pollen
#

core it cover fully in net 5

tardy locust
#

What I meant was, according to Microsofts own plans there will only be .NET and nothing else

#

Everything will be put in there, so core will be removed