#archived-dots

1 messages ยท Page 286 of 1

gentle gyro
#

Are you using script?

late mural
#

?

gentle gyro
#

Visual Studio for instance...

late mural
#

oh

#

im using visual studio mainly yas

#

2022 specifically

#

i just did not read the error close enough it appears, whoops, welp atleast i can attempt some stuff now and see what i can get working

#

yay... now i have to deal with installing c++ compilers and windows 10 sdks on my d drive....

gentle gyro
#

Lol

late mural
#

i remember back when i tried to install omnisharp back when i used visual studio code, it was a nightmare lol

#

it kept trying to install on my f drive (note i dont have an f drive, hence why this was a bad thing)

#

i spent weeks, and i never got it working, that is when i switched to visual studio instead lol

#

i hope c++ compilers wont have similer issues to omnisharp

late mural
#

lol

gentle gyro
late mural
#

oh and of course they are trying to promote windows 11 meaning the windows 10 sdk is hidden who knows where

#

ok apparrently from research unless i literally want to rewrite the code myself, i cannot install it on anywhere but the c drive, how fun, guess i gotta move a bunch of stuff that says it only works on c drive into my d drive somehow, because companies are lazy and cant seemingly be bothered to give users the choice of which drive to install on, and most are not portable either meaning if you do drag them somewhere else they wont run anymore, how fun

#

and they wont even let you choose which one is your c driver or your d drive, when i first built my computer it auto chose the 1 with 200 gb to be the c drive instead of the 1 with 1 tb of space and wouldnt let me change it, yay, im so sick of the whole c drive is the default drive that anything installs on nonsense, ahh, sorry for ranting....

rotund token
#

it'll default to whatever is in port 0 but you can definitely choose your drive when installing windows

late mural
rotund token
#

think you'll find you have less fun with unity

late mural
rotund token
#

all i see is complaints on the forums from users using the linux editor

late mural
#

ye, i plan to dual boot, so that way i can switch between both and play to the strengths of both, a bit like what i do with ides

rotund token
#

do you have a rider license?

late mural
#

no i do not

rotund token
#

because entities only supports visual studios and rider

late mural
#

i have visual studio luckilly

#

visual studio is a c drive hog though, so i have it modified to be sort of portable, even if it isnt offically supported by visual studio

rotund token
#

not on ubuntu you don't ๐Ÿ˜…

#

hence i was asking about rider as it's the only supported ide

late mural
rotund token
#

last i heard (a year ago) it really doesn't work well

late mural
#

annoying

#

is there any plan to add other ides to the list of support anytime soon, or are they only gonna start work on that closer to 1.0?

rotund token
#

not unity's fault

#

they're the ide's that support source generators

late mural
#

oh, welp that is annoying

rustic rain
#

I guess

#

you can solve it by using code without codegen?

rotund token
#

^

#

considering how little code gen exists in my project, i could probably get away with this

rustic rain
#

IJobEntityBatch and etc

late mural
#

i dont even know what codegen is lol

rotund token
#

entities.foreach, job.withcode, IJobEntity

#

don't use those and you'll be fine

rustic rain
#

I do like the idea of having no codegen

#

but at the same time

late mural
#

i see another easier solution

rustic rain
#

project will be 3 times bigger

#

kek

rotund token
#

but be 3x faster

#

๐Ÿ™‚

rustic rain
#

how so?

#

faster where? In IDE?

rotund token
#

because you can't really write extremely fast code with entities.foreach

#

because you can't properly utilize changefilters

late mural
rustic rain
#

ahem

#

changefilters? I need to look it up

rotund token
#

o_O

rustic rain
#

is that it?

late mural
#

just curious why does unity need to rely on an external program (the ide) to have something for it to work, cant it self contain it, or is it more complicated than that?

rotund token
#

but WithChangeFilter on Entities.ForEach is a (mini) sync point

#

you can only avoid this using IJobEntityBatch and checking it yourself

rotund token
rustic rain
#

When you use the WithChangeFilter() function in an Entities.ForEach construction, ECS compares the Chunk.ChangeVersion for that specific component to System.LastSystemVersion, and it only processes chunks whose component arrays have been accessed as writeable after the system last started running.

#

I don't really see anything about sync point

rotund token
#

just trust me

#

or waste your time testing it

rustic rain
#

so I guess

late mural
rustic rain
#

what you suggest

#

is check chunk's version?

rotund token
#
            {
                if (!batchInChunk.DidChange(this.EffectHandle, this.SystemVersion))
                {
                    return;
                }
rustic rain
#

any example code?

#

yeah

#

oooh

#

I remember that code

#

in Transform system

#

interesting

rotund token
#

the best optimization you can make to your code

#

is to simply not have to run it

rustic rain
#

kek

#

yeah, in OOP world

#

I remember certain parts

#

where there were

#

lots of early return checks

#

just to ensure code needs to run

#

in this regard it's a bit better, cause you check for chunk

#

instead of every object

rotund token
#

this is 10,000,000 entities

#

processing my entire condition, event, action, timer jobs

#

in 0.6ms

rustic rain
#

welp

rotund token
#

if i turned off filtering it'd be in the double digit ms

rustic rain
#

I see your point

late mural
rotund token
#

im hopeful they fix the sync point in 1.0 since i know they're making some changes to filters and how it returns chunks

#

but in general, you should consider query filters to be mini sync points

#
  • by mini sync point I mean dependencies in the chain that the system requires need to be waited on. compared to an archetype change which may require everything to sync
late mural
#

with the whole code gen situation, does unity actually use the ide, or does it simply look for files that the ide has?

rotund token
#

it doesn't use the ide

#

you need the ide to use your code

late mural
#

why though?

rotund token
#

source generators are a feature of c#/dotnet

#

you need an idea that supports them

#

otherwise you will likely lag like hell

#

easier if i just quote unity from the manual

IDE support

Entities 0.51 uses the Microsoft Source Generator feature for its code generation. Because of this, you should use an IDE that's compatible with source generators. Previous IDE versions might experience slow-downs or mark valid code as errors. The following IDEs are compatible with source generators:

Visual Studio 2022+
Rider 2021.3.3+
late mural
#

but why does the ide need to support them, what role does the ide play?

rotund token
#

because that's your coding

late mural
# rotund token why does your ide need to support c#?

the ide doesnt need to support c sharp, sure it makes it easier to know when you make mistakes, but for my first 2 years of learning unity mine was not set up properly so i had no idea what i was doing half the time lol

#

plus even non ides like notepad still allow you to code in c sharp

rotund token
#

only for psychopaths ๐Ÿ’ฉ

late mural
#

so ye, i dont get it at all why the ide needs to support anything, to me it just doesnt make sense, whatever the ide is doing, why cant unity just include it?

#

and do it itself?

rotund token
#

what your saying makes no sense

late mural
#

?

rustic rain
late mural
#

i just dont understand why unity needs to use the ide, cause the ide is using something clearly, so cant unity use what the ide uses?

rotund token
#

it doesn't need to use an ide

#

you need to use the ide

rustic rain
#

but you use IDE for it's features, not because it's fancier

late mural
rotund token
#

because that's how you write code

late mural
rotund token
#

p;2234T342GRDEFGOIJFGOPIUH 1632PO89HTIHOP45TTGIUOHPGS

rustic rain
#

once again - nothing stops you from using notepad for coding, sir

late mural
#

it isnt like the ide uses unity,

late mural
rotund token
#

you'

late mural
rustic rain
late mural
rotund token
#

go try and program c# in IntelliJ

late mural
rotund token
#

a java ide

rustic rain
#

this is Unity integration

#

notepad doesn't have

late mural
#

yes but it doesnt use unity, does it?

#

if so, why does it use unity?

rotund token
#

unity doesn't use anything

late mural
rotund token
#

you can run unity without an ide installed on your computer

late mural
rustic rain
rustic rain
#

you'll never know if smth is serializable without compiling, running and restarting

#

and here goes IDE

#

literally showing it

#

as you write code

rotund token
#

you keep saying the same thing

yes, but why does unity need to use the ide?
but unity doesn't use an ide

late mural
rotund token
#

it's not

rustic rain
#

it's not

#

kek

rotund token
#

msbuild is required

#

it's toolchain

late mural
#

and why cant ms build be installed without the ide?

rotund token
#

it's a toolchain that's included in visual studios but you can install it separate

#

you can build for windows on osx and linux

late mural
#

this conversation could have been 10 minutes shorter if you had said that at the beginning

rustic rain
#

๐Ÿ™ƒ

rotund token
#

this wasn't the conversation

late mural
rotund token
#

the conversation was just that source generators are only supported in rider and visual studios atm

#

nothing to do with compiling

late mural
#

?

#

what are source generators, why are they important?

rotund token
#

that's what unity uses to code gen entities.foreach etc

rustic rain
#

Entities.ForEach loop is source gen

#

by itself, it's not valid code

#

that will run

late mural
#

once again, we come back to unity using an ide!! The track is circular!

rotund token
#

rider/visual studios is not required for unity to use source generators

rotund token
#

it's required for you to code in the same project that source generators have been used

#

so that your ide doesn't produce 13245i134251234 errros

#

because it can't understand that source generators have been used

late mural
#

and why are those errors bad?

rotund token
#

because if all you get is errors from your ide

#

you may as well code in notepad

#

because it's now useless

late mural
#

why?

#

?

rustic rain
#

oh god

late mural
#

im used to coding with errors, that is what i did a few months ago

gentle gyro
#

It obscures the real errors...

late mural
#

you can just disable the error message usually

rotund token
#

i can't tell if you're trolling

#

i have to leave

late mural
rotund token
#

i'm going to the shops, i can't handle anymore

late mural
#

oh ok...

gentle gyro
#

A little dramatic...

late mural
gentle gyro
late mural
rustic rain
#

because if Unity generates code and your code editor doesn't support it

#

it will never know code is generated

#

or interpret it wrong

late mural
#

?

#

the code that is generated is not shown though?

#

so why should the ide care?

rustic rain
#

it is shown

late mural
rustic rain
#

when you open it

late mural
#

ive never seen it

rustic rain
#

that's why you add

#

partial tag

late mural
late mural
#

you have to explain stuff as simply as possible, i am extremely stupid and bad at tech and coding

rustic rain
#

nah, I'll just leave it as it is, kek

late mural
#

but i wanna learn, please

#

all i wanna do is learn, so im less dumb, if everyone is gonna give up on lvl 0 me, how am i supposed to ever gain knowledge?

rustic rain
#

if you wanna learn you can google that question

late mural
#

im very bad at googling

#

i tried, but i failed

rustic rain
rustic rain
late mural
rustic rain
#

๐Ÿ•ฏ๏ธ

late mural
#

i just dont get it

gentle gyro
#

Googling really is a vital skill at all levels of programming

late mural
#

exactly, and i am unable to gain it

gentle gyro
#

Some times it dosn't work

#

when it doesn't then it is nice when you can find someone to help

#

But

late mural
#

but it never works for me, cause i dont know how to google, it is so different from the way i think that i just dont get it, i try, but i always fail

gentle gyro
#

Keep practicing Googling each time and you will pick it up a little more each time

late mural
#

i do keep practicing, and using courses, they dont help, i havent gained any skills at googling, not even a little

gentle gyro
#

From time to time when you are trying to Google something show others how you Google and what you are trying to find and get live feedback to see how others Google specifically what you are trying to Google

late mural
#

is there a discord channel specifically for idiots like me that dont know how to google or something?

gentle gyro
#

Ask on channels or sites relevant to what you are trying to Google, not on Googling itself...

#

StackOverflow for instance...

rotund token
#

i'm back with ingredients for dinner. sorry @late mural you kind of broke me a little when you said you just hide your errors. i didn't mean to be so dramatic but i just couldn't stop laughing, i had to step away.

#

but don't be so hard on yourself mate, everyone has to learn from nothing

gentle gyro
#

Maybe not StackOverflow... They're not nice to people trying to learn...

late mural
late mural
late mural
gentle gyro
late mural
#

which way is the right direction, as it feels like im not going any direction, rather a stick in the mud

gentle gyro
late mural
gentle gyro
#

I spent 5 days trying to figure out how to set up In-app Purchase with Google and Unity. I felt like I was getting Absolutely No Were. I finally just had a Major Breakthrough right before I started talking to you the first time. It was like I finally found the exit in a dark room. VERY Rewarding! I am very stoked to go forward now that I know where I am ๐Ÿ™‚

late mural
gentle gyro
gentle gyro
#

Well, I guess I'll get back to my project and see if I can capitalize on my new understanding...

gentle gyro
#

Thanks! You TOO!

late mural
#

lol

late mural
#

hmm i managed to build with il2cpp finally, although entites appear to not be there, is there some special build setting that enables entities?

gentle gyro
late mural
gentle gyro
#

Well, the context of the nothing is really what I want to see...

gentle gyro
#

Entities = GameObject?

late mural
gentle gyro
#

Ah, dots...I've been eager to get into it but haven't had the time. Really looking forward to it. Unfortunately that means I won't likely be of much help...

late mural
#

wondering in the build asset is there some setting that you enable entities for il2cpp perhaps?

gentle gyro
#

No clue

late mural
#

unfortunate

gentle gyro
#

Google this: unity entites not showing with il2cpp

late mural
gentle gyro
#

So more precisely: they are not being spawned?

late mural
#

they are not

gentle gyro
#

Any errors or warnings?

late mural
#

you cant see errors and warnings in builds right?

gentle gyro
#

What about during build?

late mural
#

none, apart from 1 warning about some random default unity tree having an outdated shader

#

i didnt have the tree in my scene though, just kinda chilling somewhere in the file system, so i dont think it is the problem

late mural
#

lol

gentle gyro
#

Are you suppressing any errors or warnings?

late mural
#

i hope not

#

wait no, i am

#

i have integrity checks disabled due to this dropping me from 60fp to 10 fps

gentle gyro
#

Errors and warnings are your best friends!

late mural
#

yes, and im getting none

#

oh apart from urp being angry it cant find the urp read me

gentle gyro
#

Can you run it without IL2CPP?

late mural
#

yes, mono works well!

#

im just interested in trying out both and comparing performance and stuff

gentle gyro
#

Are you building in Release or debug?

late mural
gentle gyro
#

Yes, I think you should get Log files...

late mural
#

oh ok ill try

#

this may take a while cause my computer is old

gentle gyro
#

Ok

rotund token
#

is your il2cpp not building or not running?

#

because there's a known bug in 0.51 with building il2cpp

#

make sure you select faster builds

late mural
late mural
rotund token
late mural
#

why does loading build setttings always take so long lol

late mural
late mural
#

it crashed after only a couple seconds!

#

any ideas?

rotund token
#

that's the editor log

#

not player log

late mural
#

yes cause it crashed when trying to build

rotund token
#

oh editor crashed?

late mural
#

yup

rotund token
#
  ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 0000024DEF4319D9)```
#

seems to be your issue

late mural
#

oh unlucky, which module do i need, or should i just go through a checklist of some type?

rotund token
#

* Assertion: should not be reached at C:\build\output\Unity-Technologies\mono\mono\metadata\class-accessors.c:86

#

some funky stuff going on here

late mural
#

what exactly does that mean

late mural
#

my computer is old and a tad weird

rotund token
#

it's weird because it seems to be crashing in mono

#

not il2cpp

late mural
#

oh, that is odd

rotund token
#

i don't think it's even started the il2cpp build

late mural
#

oh

rotund token
#

and there are 2 separate stacks here

#

very weird

#

C:/Users/Calvin/AppData/Local/Temp/Unity/Editor/Crashes

#

what's in this folder

late mural
#

i shall check brb

#

2 crashes

#

1 from ages ago

#

when i learned the hard way not to use tif files

rotund token
#

can you close unity, open it

#

start an il2cpp build straight away

#

send log

late mural
#

sure, ill do that, it will take about 2 mins to start up because my computer is old, sorry lol

#

ok it has loaded

#

and ive pressed build

#

now we wait for the crash

#

it has not crashed yet, perhaps it was a 1 off thing?

#

welp it finished building, ill check to see if entities exist now

#

yes entities are working, yay!!!!!

#

hmm and weird side note, the graphics are a lot better on il2cpp than mono

late mural
late mural
#

wrong channel?

small heath
#

i use Dots 0.51 for project, i can't make component play animation, who can help me?

muted star
#

Hello everyone, I can't get [GenerateAuthoringComponent] to work with IBufferElementData.
Please let me know if you have any ideas how it could be fixed.
I get this error

#
using Unity.Entities;
using Unity.Jobs;

namespace ECS.Simulational.BufferElements
{
    [GenerateAuthoringComponent]
    [InternalBufferCapacity(32)]
    public struct JobHandleBufferElementData : IBufferElementData
    {
        public JobHandle Value;
    }
}```
mystic mountain
muted star
viral sonnet
#

how would I best find out that a DB has changed its pointer address when being moved outside the chunk. (internal capacity has exceeded)

#

well seems like a bad idea to cache pointers to DB elements :/

rotund token
#

i would say it is

viral sonnet
#

even with buffercap 0 I wouldn't be able to handle the resizes well

#

so caching of any sort is pretty much out the window

#

i'm looking for a way to add/remove elements and not hold any reference or id. one safe way is to use removeswapback

rotund token
#

so i have a similar issue

#

adding elements to target on effect creation and removing elements on effect destruction

#

effect destroying definitely my biggest bottleneck at the moment - i have to do the actual removal single threaded and i'm not sure there's an alternative (well technically I can do it multi threaded I just think the cost of setting this up out weighs the benefits)

#

for adding though I just use ecb.AppendToBuffer

#

the only ecb usage in my entire library

viral sonnet
#

i'm pretty much on the same problem ๐Ÿ™‚

#

I can do it with no problems with some form of id but I rather not want to do that

rotund token
#

it's not that much of a problem for me because i expect my effect life cycle to be long enough not to be a huge issue (seconds to minutes to infinite)

#

but yeah if i needed high frequency changes be more problematic

viral sonnet
#

my effects will not be high frequency. smallest I'd think is something around a second

rotund token
#

if you do find a great pattern do share ๐Ÿ˜„

viral sonnet
#

yep, I'll contemplate some more ๐Ÿ˜„

#

oh, something i wanted to ask because you have much nicer test cases than me. have you tried instead of the memcmp zero to just have a bool = false on Execute that you set to true when changes occur.

rotund token
#

breaks the simd

#

the memcmp has been much faster than i expected

viral sonnet
#

ah, auto vectorizer doesn't like it probably. otherwise it shouldn't break it, i mean, there's no condition really

rotund token
#

but yeah, not sure how doing a float comparison per element is going to be faster than a memcmp on the whole lot at once

viral sonnet
#

oh, on second thought. you'd need a xondition to get the branch that something changed, right??

#

you could simd the branch but yeah, not worth it

#

the memcmp is really nice to stay branchless

rotund token
#

it's just very fast

late mural
#

hmm something i am wondering, for codegen, couldnt you just manually write whatever code it generates, and avoid the code gen, or is it more complex than that?

late mural
rotund token
#

people like enzi and myself mostly write our jobs in IJobEntityBatch and avoid code gen

#

all codegen is doing is converting your code into IJobEntityBatch

late mural
rotund token
#

it's an interface for a job

#

it's the fundamental job for entities

late mural
#

ok cool, once ive eaten some breakfast im gonna mess around with it then!

viral sonnet
#

it's actually not that hard to get into it and I think it's much nicer ๐Ÿ™‚

late mural
#

ooh im excited to learn it then, thanks so much for the info everyone!

viral sonnet
#

i really want to make this work, to cache direct pointers to DB elements. on changes I'd need to compare the old vs new pointer of the DB and update pointers - every other solution I can think of is quite the pain

#

from the old base pointer and outdated pointer to the element I could calculate the index and reapply with the new pointer

#

on reallocs, the indices will stay the same

#

removing will still be weird. best case is RemoveSwapBack and update the swapped back effect

#

and that would require a variable to know which main effect to update with the swapped back pointer. i just don't want to add a pointer to the main effect just for that case :/

coarse turtle
#

dang, I forget - but do ISystemStateComponentData work with the conversion workflow? i.e - does the component get added to the entity?

viral sonnet
#

afaik they are excluded

coarse turtle
#

kk, ah well, not a big problem to work around I guess

viral sonnet
#

I don't remember who it was, I think it was Manarz that was perplexed that instantiating a prefab didn't copy the StateComps

#

even though the prefab had these comps

rotund token
#

yeah it makes sense not to instantiate system state components

#

however it is a pain 10% of the time where it would be very useful

dense crypt
#

Why does my Camera not get converted in a subscene? ๐Ÿค”

#

I was expecting it to be available as a managed component. However after adding the script define it is, although I'm not exactly sure what they mean by "the scene main camera can't be a hybrid entity". Since that compile flag seem to exist and work?

rotund token
#

as you pointed out in your link just add HYBRID_ENTITIES_CAMERA_CONVERSION

#

and it'll be converted as a companion object

#

the issue is camera.main is required for some built in things

dense crypt
#

Oh right, so specifically the MAIN tagged camera can't be converted, but other cameras can?

rotund token
#

personally i convert my main camera

#

without issue though

dense crypt
#

Yeah that's what I just tested and it seems to work flawlessly, makes me even more confused as to why that remark is there then ๐Ÿ˜…

viral sonnet
#

i'm saying outdated stuff. sorry. since when is this a thing?

rotund token
#

HYBRID_ENTITIES_CAMERA_CONVERSION been there for years

#

it was originally on by default until they identified issue and hid it behind a precompiler

viral sonnet
#

learn something new every day ๐Ÿ˜„

lusty otter
#
[...] is not declared [ReadOnly] in a IJobParallelFor job. The container does not support parallel writing. Please use a more suitable container type.

Can I disable this completely? I don't want to litter [NativeDisableParallelForRestriction] all over my fields.

solemn hollow
dense barn
#

Can I store the result of diferent jobs in a single native array?

jovial mantle
#

Hi guys. I made a game in the old good monobehavior/gameobject way. I want to outsource some of it to DOTS, namely the projectiles and the projectile hits. The player (and enemies) are gameobjects (cubes) with a rigidbody, collider, and player/enemy logic attached to it, and parented to this is the skinned mesh character with animator
IS it possible to get the projectiles, collisions (projectile hits) managed by DOTS and the rest by the old gameobject/monobehavior world?
Thanks a lot !!!

late mural
jovial mantle
#

how do you manage the collision? as far as I understand:

  1. My player (cube) with a collider, transform, rigidbody and player logic(mono, I'd like to keep it this way) -> converto to ENTITY
    2)it shoots prefabs converted to entities at enemies that have a similar setup as the player.
late mural
#

you just enable the render component on the entity or the gameobject, and disable the other, depending on which render thing you prefer more

#

trying to sync rotations is a tad harder, although possible with a bit of quaternion knowledge

#

also pro tip to help optimize transformation syncing every frame of the moving entities/gameobjects, make sure both the gamobject and the entity are not static and have a rigidbody, depending on which you are syncing to the other, have 1 being a kinematic rigidbody (controlled by animation, or in this case the transformations every frame)

jovial mantle
#

transform / rigodbody of the player (cube, collider) is moved with simple transform.Translate operations, the animations are not root motion, respond to whatever key is pressed etc.
when receiving shooting it would be converted to an entity to process the hits and then back to gameobject ?

late mural
#

I have to go eat dinner now, so if you have more questions i shall have to respond to them later, but i wish you luck!

jovial mantle
#

aha makes sense coolcat, thank you very much for your tips. bon apetit!

solemn hollow
karmic basin
#

+1 for Manarz answer
PhysX and entities physics are two separated simulations you gonna get yourself headaches :p

muted star
#

Hi everyone, is appending multiple worlds to player loop not supported yet in the new 0.51 System editor window?

The first time I launch into the editor play mode after compiling it works fine but from the second time and onward I get this error.

solemn hollow
#

are you destroying the world?

muted star
# solemn hollow are you destroying the world?

Yes when exiting play mode the worlds are destroyed

private static World CreateWorldSafely(string _worldName)
    {
        World world = new World(_worldName);
        // Dispose of world on quit
        Application.quitting += () =>
        {
            if (world.IsCreated)
            {
                world.Dispose();
            }
        };

        return world;
    }```
solemn hollow
#

So its probably just that the Editor Window cant find this world anymore that you are trying to display in edit mode

muted star
#

Ah yes that makes sense, I just have to re-open the systems window and everything is fine ๐Ÿ™‚

#

Is there a way to get a world by name? This way I could change my code so I won't have this inconvenience anymore.

jovial mantle
muted star
solemn hollow
solemn hollow
# jovial mantle so game objects and process the projectile instantiation / hit/ disposal with Jo...

hmm sry i havent looked into using Monobehaviours and jobs too much yet. Im going full ECS for quite a while now so i dont really have resources.
But for Instantiation and Disposal you are going to need an Object Pool (AFAIK Unity has their own implementation of one now).
I dont know how you want to handle hits. if its with Raycasts then you should check out : https://docs.unity3d.com/ScriptReference/RaycastCommand.html

jovial mantle
#

the way I have it now is :
1)the projectiles are particles (shuriken) that calls on collision
2)I have them pooled
3)The player shoots this projectiles from the pool, which upon collision they come back to it
My idea is to use DOTS / Jobs / Burst in order to get rid of the pooling system and go nuts with the amounts of projectiles

solemn hollow
#

you could only get rid of pooling if you used Entities (and even then pooling entities might be a more performant way than recreating them depending on setup logic). but if you used entities youd need to calculate all collisions yourself since EntityPhyscis != MonoBehaviourPhysics.

#

if you need THAT many bullets then maybe you actually have to make the change to ECS but i think you need to do it with more than just the bullets then ๐Ÿ˜ฆ

jovial mantle
late mural
#

is there any default method for raycasting? Or is it still something that has to be manually made?

rustic rain
#

there are examples in sample probject, it's in pinned messages

late mural
safe lintel
#

@jovial mantle btw there is a physx batch raycast api, and it might be better suited to what you want to do than considering ecs

#

I actually started off this same path back in 2019, "yeah let me jobify my projectiles" and ended up redoing everything in ecs. I probably could have released by now if I wasnt chasing dumb shiny tech things

solemn hollow
safe lintel
#

@solemn hollow oh yeah it is, sorry just having my coffee now ๐Ÿ˜…

solemn hollow
#

no worries. i might have missed some other api. better to ask ๐Ÿ™‚

safe lintel
#

what could have saved me from going down the full ecs route was back then I used the raycastcommand with a gameobject pool, but RaycastCommand in combination with Graphics.DrawMeshInstancedIndirect makes for a good alternative for performant projectiles and you only touch gameobjects when they collide with something

muted star
#

I'm currently trying to sync my simulation and presentation worlds.
The step I'm currently stuck at is spawning the corresponding clone entities in the presentational world.

            // Querying simulation world entities. They have been transferred from the simulation world to this presentational world.
            Entities
                .WithAll<IsMirroredToPresentationalWorldTag>()
                .ForEach((Entity _simulationWorldEntity) =>
                {
                    var prefabInstance = EntityManager.Instantiate(prefab); // Creating presentational entity

                    var val = new NotSoUuidSDC {Value = random.NextInt(), SimulationEntity = _simulationWorldEntity}; 

                    // Adding component to presenatational entity with simulation entity field
                    EntityManager.AddSharedComponentData(prefabInstance, val); 

                }).WithStructuralChanges().Run();
#

The field SimulationEntity is shown as invalid in the DOTS Hierarchy.

I also get the exception 'The entity does not exist.' in this system:

if (!mirroredEntitiesQuery.IsEmpty)
            {
                // Querying presentational entities created by the previous system
                Entities
                    .WithNone<IsMirroredToPresentationalWorldTag>()
                    .ForEach((Entity _presentationalEntity, NotSoUuidSDC _notSoUuid) =>
                    {
                        var simulationEntity = _notSoUuid.SimulationEntity;
 
                        // Trying to copy the transform component from the simulation entity stored in the notSoUuid to the presentation entity
                        EntityManager.SetComponentData(
                            _presentationalEntity,
                            GetComponent<Unity.Transforms.Translation>(simulationEntity) // Exception - 'The entity does not exist'
                        );
                    }).WithoutBurst().Run();
            }
#

Can the Entity somehow change when moved between worlds or will they always retain the same ID?

solemn hollow
#

@muted star my understanding was when you move entities to another world they get remapped.

muted star
#

I'll have a go and read this, maybe I'll understand then

rustic rain
#

how are you even copying entities

#

from one world to another

muted star
#

I'm moving them

rustic rain
#

how?

muted star
#

Moving from presentational world to simulation world

query = presentationalWorld.EntityManager
.CreateEntityQuery(new EntityQueryDesc
{All = new[] {ComponentType.ReadOnly<IsMirroredToPresentationalWorldTag>()}}
);

EntityManager.MoveEntitiesFrom(presentationalWorld.EntityManager, query);

#

and the other way around of course

rustic rain
#

why?

#

wasn't the point of your double world is to avoid sync point?

muted star
#

Yes

#

Simulation world sync point is independent of presentation world

rustic rain
#

well, your moving entities is sync point

muted star
#

yes but it doesn't happen so often ๐Ÿ™‚

rustic rain
#

they all have to update in one frame

#

so your worlds will be updated one after another (I assume)

muted star
#

yes but the jobs are independent

rustic rain
#

every frame, in sync

muted star
#

jobs in simulation world will continue running if jobs in presentation world are forced to complete

rustic rain
rustic rain
muted star
#

yes I do when there are structural changes

rustic rain
#

your jobs in simulation will have to finish

#

before execution will get to next world

#

and only once first world is fully finished (all jobs)

#

it will start doing second world

#

basically, at some point in all worlds, there's call of CompleteAllJobs

#

which blocks main thread and causes all scheduled jobs to finish

muted star
#

Lets assume I have structural changes in the presentation world. All jobs in presentation world are forced to complete. This takes a bit of time and the simulation world basically has to wait for the presentation world. The jobs of the simulation world however are not forced to complete.

I can no longer find the docs on worlds and sync points but isn't this how it works?

rustic rain
#

System updates are done only on main thread

muted star
rustic rain
#

unless you somehow heavily modify world execution, it'll be forced to finish anyway

#

it's designed to finish execution completely

#

before execution is passed back to player

solemn hollow
solemn hollow
muted star
#

but I could be wrong of course

solemn hollow
rustic rain
#

there's some system in vanilla Unity

#

that calls CompleteAllJob

#

which makes it impossible

solemn hollow
#

man would that be awesome to run worlds on diffrent "mainthreads" and schedule jobs from there lol

rustic rain
#

but main thread is only one

#

and I have a feeling

#

world really needs "the real" one

solemn hollow
#

thats why i put the "" there. if you know the data of those worlds cannot effect eachother you can use diffrent threads to sync execution per world

muted star
rustic rain
#

yeah

muted star
#

"A world owns both an EntityManager and a set of Systems."

rustic rain
#

it'll block main thread until all jobs are finished in world

muted star
#

yes in one world

#

not all worlds (?)

rustic rain
#

so whatever you are trying to do with 2 worlds, is just not possible

muted star
#

okay :p

rustic rain
muted star
#

yes thats fine

#

as long as jobs of second world arent touched

rustic rain
#

they are forced to finished

#

before world execution is over

#

and only then second world will run

solemn hollow
#

but the point is he doesnt want to run the second world in some frames

rustic rain
#

that's not fine

#

that totally defeats the purpose

rustic rain
#

presentation will still have to run every frame in order to draw stuff

solemn hollow
#

yes that would be the approach id go for

muted star
#

in case of structural sync point?

rustic rain
#

first world is finished, only then second starts

muted star
#

all within one frame yes, but jobs can run over multiple frames

rustic rain
#

no?

#

are they?

muted star
#

of course

rustic rain
#

ahem

#

I really doubt it

#

Do you have any reference where you found out about that?

solemn hollow
#

sure jobs can run over multiple frames. the problem is syncpoints force them to finish too often

muted star
#

TempJob can run up to 4 frames. Presistent can run forever theoretically

rustic rain
#

ah

#

now I get it

#

but still, world will ensure it's finished though

#

before second world can update

solemn hollow
#

only if you couple the dependency to a syncpoint

rustic rain
#

at very least Unity will throw some errors at you for that, I think xD

muted star
#

As far as I experienced Unity wont throw errors if you schedule too many jobs. It will just queue them.

rustic rain
#

I mean

#

if you schedule job

#

and then on next frame you schedule it again

#

but first scheduled is not even finished

muted star
#

at some point youll run out of memory. But jobs are run in parallel and if there is currently no available thread they are queued until there is an available thread.

solemn hollow
#

but anyways why do you need a second world for all of that. as issue suggested use systemgroups with diffrent updaterates. for example fixedupdate for all simulation stuff and the usual updategroup for presentation stuff

muted star
rustic rain
#

they will have to force finished at the end of frame anyawy

solemn hollow
#

it wont but does it matter? you output presentation frames as fast as possible either way

#

aside from that just dont do so many structural changes

muted star
# rustic rain why is that even a problem?

I explained this before. I will run long-running jobs in the simulation world. They shouldn't be force-completed. Otherwise there would be terrible lag whenever this happens.

muted star
rustic rain
muted star
solemn hollow
rustic rain
muted star
solemn hollow
muted star
muted star
solemn hollow
#

so before that syncpoint nothing will move to representation world. again you need to complete all heavy work before move and then render. exactly the situation you dont want

rustic rain
#

why simply designing a simultion that just meant to update every frame (or tick) is not an option?

solemn hollow
#

id see it working with copy maybe cause you can copy incomplete data and not wait for jobs maybe but moving seems wrong

muted star
rustic rain
#

whatever you are trying to achieve is extremely hacky

muted star
muted star
solemn hollow
#

what type of simulation are you going for that you cannot run your jobs in 1 frame?

muted star
rustic rain
#

ahem

#

is your game supposed to run on super low fps?

muted star
#

of course not xD
Presentation world will barely be affected by all this stuff

#

because presentation runs at high framerate while simulation runs at a refresh rate (or so it appears)

rustic rain
#

yeah, but since you update data for your presentation only at certain sync points

#

that would mean

#

that all frames you render ibnetween

#

are same

#

or at least, entities in them will be same

muted star
#

simulation world is not actually running at slower refresh rate
but the important logic runs at slow refresh rate if that makes sense

muted star
solemn hollow
#

oh man do i have a better solution for you lol

#

just dont update all of the chunks every frame. split it up. balance the load

rustic rain
#

yeah, just design your game around updating normally

solemn hollow
#

in 1 frame do the pathfinding for group 1,2,3,4 and in next you do it for 5,6,7,8. etc

rustic rain
#

instead of literally wasting a lot of main thread time to just move/copy entities from 1 world to another

solemn hollow
#

i do that with my AI. i can run thouthands of agents with really complex logic just because i loadbalance them

#

even without loadbalancing i can still run hundrends each frame though. atm gamedesign wouldnt even need loadbalacing

#

its also really simple to implement

muted star
rustic rain
#

besides

muted star
rustic rain
#

I doubt your simulation will work fine along with all other systems that need to be updated fully in one frame

#

since whatever long running job is using, will be locked for it

#

and other jobs will have to wait

solemn hollow
#

thats all

muted star
muted star
solemn hollow
#

the only "hacky" part is the GetNativeArray call inside the job to bump the change version

#

i think it does what you need and gives you a smoother less spiky framerate. and for sure is way more performant than copying worlds around

muted star
solemn hollow
#

nice! good to know it works.

#

not a fan of the solution still ๐Ÿ˜„

rustic rain
solemn hollow
#

they are new every simulation world update right?

lusty otter
solemn hollow
#

no idea if you can. however even if i could i wouldnt. this warning is there to make raceconditions practically impossible as long as you dont disable it. good to know where you might run into those when debugging

#

needing this all over your code smells wrong to me

lusty otter
#

I'm fully aware of the dangers of blowing my foot away by disabling it.

#

My situation is, I have a large struct with many fields and some of them are native containers; instead of passing all those fields one by one I simply pass this one large struct to all the jobs.

#

Problem is in some jobs some fields of this large struct are readonly, in some jobs they are not, in some jobs I want to disable parallel for restriction, etc.

#

There's no way to individually configure each field for each job, the only solution seemingly is to just duplicate all fields to every single job struct and that's incredibly error prone and not DRY.

solemn hollow
#

but this struct is not per entity right?

lusty otter
#

Oh I'm not working in the context of ECS, just plain old job system and Burst.

solemn hollow
#

ah alright. you could maybe do some factory that returns a struct setup as you need it. other than that idk

lusty otter
#

Yeah, and it's not like if I litter [NativeDisableParallelForRestriction] on all my fields solves it, because that's no different from just turning off safety altogether.

#

The fundamental problem is just that inner fields of a same struct may have different restrictions in different jobs, and there's no way to configure it from outside.

#

This also applies to things like properties (but fortunately you can do [field: NativeDisableParallelForRestriction] for example) and nullable types (which has no workaround it seems)

viral sonnet
#

ECB speed is so pathetic. stress testing with 250k instantiation of buffs and ECB takes aroud 300ms. that's over 1ms for 1k. crazy how long it takes. but then again, no burst, no MT. what am I expecting

#

to bring it into perspective. like 95% of this is adding a buffer and some elements to it. and this part is pretty broken because the buffer array of the ecb is only temporary and has to be copied. i have to think of something different

pliant pike
#

yeah, that's why its not usually advised to use ECB to instantiate(unless you really need to organise the structural changes)

rotund token
#

We have noticed this, and also noticed the impact on iteration time, so for 1.0 we've developed an alternative to EFE that requires several times less work from the sourcegenerators (which are both what slows down VS and also one of the many sources of bad iteration time in the unity editor). It unfortunately does require y'all (and also us) to convert manually, though. :/

#

That's going to be fun for some people

#

So they probably are going to the foreach query syntax in 1.0 for more than just ISystem

gentle harness
#

How can I use [ReadOnly] ComponentDataFromEntity within an Entities.ForEach job?

#

Getting one by doing var FactionFromEntity = GetComponentDataFromEntity<Faction>(); inside OnUpdate() works fine, but it can not be marked as read only

#

I considered ```cs
public partial class MoveToCombineTarget : SystemBase
{
[ReadOnly] ComponentDataFromEntity<Faction> FactionFromEntity;
protected override void OnUpdate()
{
FactionFromEntity = GetComponentDataFromEntity<Faction>(true);
Entities.ForEach(...Job...).Schedule();
}
}

But doing this causes ``FactionFromEntity`` to be a reference type, which can then not be used in a job
#

So is it possible to use a ReadOnly ComponentDataFromEntity without using a job struct?

viral sonnet
pliant pike
#

whats this Visual Studio thing ๐Ÿ˜•

viral sonnet
#

when iteration time is improved, very welcome change

#

it slows down dramatically on code-gened code

#

or when having projects loaded like Unity.Collections

pliant pike
#

oh so I guess that's why it was slowing down

#

I thought it was a bug with VS 2019 that's why I finally updated

viral sonnet
#

vs 2022 is even worse

pliant pike
#

dammit leahA

viral sonnet
#

their new auto completion has a really hard time with it

#

but slowness is just one of the problems of vs2022. i had to deal with annoying bugs too

pliant pike
#

this is really starting to tempt me to try Rider

viral sonnet
#

lol

#

i bought an annual license ๐Ÿ˜€

pliant pike
#

except I can't really afford it

viral sonnet
#

how can you afford vs2022?

pliant pike
#

the community version

viral sonnet
#

ah i see. yeah, sadly rider has no community version. just a trial :/

#

maybe a student license or smth

tidal gulch
#

if you have a student email, you can get 1 year of jetbrains products for free (Includes Rider and Resharper)

safe lintel
#

also it does fallback to the version you bought so it doesnt have to be an ongoing cost if you happen to purchase it

#

shame its not like zbrush where the one purchase and all the updates for free. my 3.0 license just keeps on getting upgraded ๐Ÿฅฐ wonder how long that will last though

viral sonnet
rotund token
viral sonnet
#

oh, that's cool!

#

finally a good sub model. i hate it when the sub runs out and you lose total access

#

looking at you unity!

rotund token
#

to be fair unity subscription really gives you nothing these days

#

it's just a legal requirement ^_^'

viral sonnet
#

pretty much. i don't know why I'm even paying anymore. i don't release a game anyway ^^ dark skin is also free now

#

with the changes to Entities.ForEach, I'm once again happy that I don't have to go through any changes. job structs 4tw

#

and I have to say, what a superfluous endeavour by Unity. I don't even want to know how much time went into this. If I were them, I'd just force everyone to use job structs. haha

rustic rain
viral sonnet
#

how are you managing pre-defined archetypes that have a lot of variations? i have a mix of components that can be instantiated based on settings and with just 4 the number of archetypes i have to manage kind of explodes

#

now if I'd ever add a 5th I don't know how to handle this

#

my preferred way would be to just instantiate a prefab. maybe some kind of mask and the prefabs get computed procedural?

rustic rain
#

You simply need component type array which can be made through infinite options kek

muted star
muted star
#

and FPS are high

solemn hollow
#

so now your simulation runs as slow as pathfinding :S

muted star
solemn hollow
#

i sure hope your pathfinding doesnt block all cores for 20 ms xD

muted star
wanton apex
#

Hello !

I have some performance issue with my prototype of ECS Particle System when trying to add physics to my particle.
The simulation performance are good, but anytime I instantiate a particle with physics simulation, the Build Physics System update and kill the performance. Do you know if there is a workaround to avoid this performance drop due to building the physics world ?

rustic rain
#

Can't really remember how to disable them

wanton apex
#

Thanks ! I will search for it !

#

Maybe this ?

rotund token
#

turn that off

#

turn off jobs debugger

#

turn off safety as well if you just want to test max performance

wanton apex
#

Thank you ! I try this. performance are really better with Integrity Checks disable

rotund token
#

yeah it like halves performance

wanton apex
#

Is it normal that a system which spawn 5000 entities per frame took more than 150ms to execute ? Sorry for all this questions, I'm not familiar with ECS and don't realy know what are the performances to expect

karmic basin
#

Are you going the ECS way for fun/learning or are you looking for performance ? For the latter I would use the VFX Graph for an insane amount of particles

wanton apex
#

I'm trying to learn ECS. (I made a small project with it two years ago, but I forget almost everything I knew). And a particle simulation with physics interraction looks a good use case and stress test for ECS, while VFX Graph doesn't support physics (only Depth Map collision which is very limited)

bleak junco
#

hi, is there a way to turn off PhysicsCollider in ecs?

rustic rain
#

remove shared component

wanton apex
rustic rain
#

otherwise it would be just a blind guess, kek

rotund token
#

if it's via ecb then yeah that's what i'd expect

#

best bet would be via batch operations in EM and you could probably get that down to 20-40ms

wanton apex
#

It's from main thread :

var nativeArray = new NativeArray<Entity>(entityCount, Allocator.Temp);
EntityManager.Instantiate(emitter.particlePrefab, nativeArray);

But the AddComponents are not batched because I need some random initialization on it :

for (int i = 0; i < nativeArray.Length; i++)
{

    var entity = nativeArray[i];


    EntityManager.SetComponentData(entity, new Translation()
    {
        Value = UnityEngine.Random.insideUnitSphere * 100.0f
    });
    EntityManager.AddComponentData<ParticleMovementComponent>(entity, new ParticleMovementComponent()
    {
        maxSpeed = 10.0f,
        currentSpeed = 0.0f
    });
...
rustic rain
#

that would be way faster

#

make sure your components already added in instantiation

#

so no archetype changes

#

and then just make a job that you will instantly run

#

you can use Unity.math's Random struct for random

rotund token
#

yeah you definitely need to burst compile that setting component data

wanton apex
rustic rain
#

first you ensure they already exist, even if values are default

#

your prefab must have them

#

then

#

you can make IJobEntity job

#

or IJobEntityBatch

wanton apex
#

Yep, the profiler said that the AddComponentData is the costly operation

rustic rain
#

and do your random init inside bursted code

#

that will also take advantage of CPU cache

wanton apex
rustic rain
#

well

#

it's only about simply having them

rotund token
#

your code above has no condition?

rustic rain
#

not about having values on them

#

but if that's also the case

#

you can add components batched

#

and then set values through job

wanton apex
rotund token
#

you're adding ParticleMovementComponent to every entity you just created - why is it not already added on the prefab

wanton apex
#

Okay, i'm going to rewrite this spawn system with batch and burst in mind, thank you very much for the advice !

#

For this one that's the case yes, but as exemple physics components are based on a condition

rustic rain
#

can't you just have several prefabs for different options?

#

at very least you can make them automatically through code

#

that would speedup runtime instantiation

wanton apex
#

As exemple :

if (emitter.usePhysics)
{
    PhysicsHelper.SetupPhysicsBody(EntityManager, entity, blob,
    UnityEngine.Random.insideUnitSphere * 10.0f, new float3(0, 0, 0), 1);
}
#

Thanks, I will try to work with archetype to optimize it !

bleak junco
wooden dagger
#

can i use Physics2D.OverlapXXX in jobs?

rustic rain
#

nothing managed

#

is allowed in bursted code

rustic rain
#

without this component entity is excluded from physics

#

no need to remove collider or body component

wanton apex
rustic rain
#

no

#

it will simply be paused

#

until you add that component back

wanton apex
#

Okay, thanks !

bleak junco
rustic rain
#

yeah

bleak junco
#

ok, I think it's suitable for now, thanks

wanton apex
# rustic rain you can make IJobEntity job

Sorry for tagging you again, i'm rewriting my system, but I'm not sure what is the best way to achieve this fast instantiation.
I have rewrite my AuthoringSystem to add all the required component in the conversion stage, so no AddComponents are needed after instantiation.
Now i'm not sure about the call to instantiate it. Should I call from a main thread system EntityManager.Instantiate(entity, nativeArray) without dealing with burst and ECB, or should I call this method from an ECS with a Burst job ? While the ECB is executed in the main thread at the end, I'm not sure about the use of it in this case

rotund token
#

if you need to instantiate a large amount of entities then yes just use the EM.Instantiate

rustic rain
#

and then run your job that sets up components

wanton apex
#

Okay, thank you very much !

#

Is there a performance reason to use IJobEntity / IJobEntityBatch instead of a ForEach or is it just for code organisation / reuse ?

rotund token
#

foreach/IJobEntity code gens into ijobentitybatch

#

you can do specific optimizations with IJobEntityBatch though that aren't always possible otherwise

wanton apex
#

Thank for the answer !

eager pawn
#

How would I initialize my component data to a value? I'm thinking of making a config entity and a system for it that only runs once in the beginning, then somehow make system 2 access that data. Is that correct?

rustic rain
#

for Unity's meant workflow at least

eager pawn
rustic rain
#

nah, that only works for prefabs

#

or subscenes

olive kite
#

Since updating to v.51, assembly reloading takes almost a minute, despite the profiler saying that the actual compilation is 4 seconds. Any tricks to help speed this up a bit? previously it was about 15 seconds total, so I'm feeling the difference quite a bit now.

viral sonnet
#

i can solve it, i just wanted to know if i'm the only one dealing with such a problem

rustic rain
#

I don't really see how it's an ECS problem though

viral sonnet
#

i could do it the naive way and use a bunch of conditions and AddComponent to the ECB but that's painfully slow

rustic rain
#

what are you even doing?
I thought you just instantiate entities with specific archetype

viral sonnet
#

i instantiate effects and those can have a multitude of combinations of components, pre-set via archetypes. triggers, duration, stacks, the list goes on,

#

previously this was low enough to not be concerning but now I moved data out from the main comp which could be optional

rustic rain
#

not instantiation?

#

ooor?

viral sonnet
#

instantiating. anyway, i found a good solution for the problem. i now calculate the needed comps in convert stage and save the archetype in my effectData blob. that also got rid of some conditions on the instantiate. pretty nice and I don't have to code something complicated which I really wanted to avoid

elfin spire
#

Onwards I go, new project and currently testing from 2019 to 2021 -- which version of unity do you use with your DOTS project (entities or jobs+burst mono)?

rustic rain
#

2021 is the only way, until they port ecs to 2022, kek

woeful comet
#

@rotund token I remember that you were talking about making a DOTS serialization library a couple of months ago. Did you ever release that?

neat kayak
#

i'm getting the error Temp\GeneratedCode\Assembly-CSharp\MeshApplySystem__System_1236479004.g.cs(93,96): error CS8377: The type 'CustomMeshData' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'InternalCompilerInterface.UnsafeGetRefToNativeArrayPtrElement<T>(IntPtr, int)'
i've seen a lot of errors where the generic type or method in question is NativeList<T> but haven't been able to find helpful resources for this. i'm using entities v0.51.0-p.32 and jobs v0.51.0-p.32

#

here's the CustomMeshData struct

using System.Collections;
using System.Collections.Generic;

using UnityEngine;
using Unity.Mathematics;
using Unity.Entities;

public struct CustomMeshData : IComponentData
{
    public List<float3> vertices;
    public List<int3> triangles;
}
viral sonnet
viral sonnet
woeful comet
viral sonnet
#

that said. mesh data is better off in another data type. ecs is not well suited for that.

neat kayak
#

anything I should use instead?

#

the reason I'm using this at all is because I'm going to be updating meshes at runtime

viral sonnet
#

totally depends. is it some knd of voxel data?

neat kayak
#

not voxels, the meshes can take whatever shape. think "parts"

#

they get grouped into larger assemblies, which is why I'm using ecs for this

viral sonnet
#

hm, for prototyping I'd stick to DynamicBuffers then.

neat kayak
#

alright, good to know

rotund token
#

My concern is I haven't used it enough in production conditions to confirm it as a long term viable solution

#

I don't really like releasing things I haven't confirmed as production ready

viral sonnet
woeful comet
#

I'm sure there are plenty of volunteers here ๐Ÿ˜‰

rustic rain
#

hmmm, is it possible to Remove components based on Write group?

#

basically Remove all components of write group X?

pliant pike
#

I don't suppose anyone knows a good way of finding out if an entity exists for only one frame?

#

like I think it does but I can't be entirely sure and I don't have the skill to pause it at exactly the right moment

rotund token
#

Rider pause points is useful for this

#

Instead of breaking when it hits certain code you can pause unity

#

That said with journaling and being able to inspect an Entity during a break point less use these days

pliant pike
#

well that sounds handy

#

i really should probably look into rider

#

just don't want to pay for it till I'm a proper dev if ever

#

I'm not sure journalling would work in this case, I guess I could try ๐Ÿค”

rotund token
#

You just know where the entity is created and destroyed

#

Just break point on that or put in a log

pliant pike
#

yeah I know where its created and destroyed but the issue is in another system

#

it might be destroyed before it reaches the other system

rustic rain
#

hmm, potentially, if I for some reason would want to make multiplayer in my singleplayer game
What kind of static fields will be ok to use?

#

Obviously, smth that can only exist on player's machine would not be ok, like input, or time delta

#

but what kind of data will be ok?

pliant pike
#

I have a basic stupid question do subscenes not working with [GenerateAuthoringComponent]

#

neh mind they do just me being stupid again

pliant pike
#

lesson for anyone else dont put enabled = false; at the end of a system that has a requiresingletonforupdate otherwise you might end up wasting an hour trying to figure out why the system isn't running leahHMM

rustic rain
#

from what I see, it's made for debugging purposes

pliant pike
#

yeah but if I just want a system to run once only ๐Ÿคท

rustic rain
#

use OnStartRunning?

pliant pike
#

but I had problems before with that running more than once

rustic rain
#

well, it will run again if at some point

#

your singleton cease to exist

#

and then appears again

pliant pike
#

that's kind of the issue I was only using enabled = false in this case for debugging

coarse turtle
#

hmm not sure if im doing anything wrong with the scriptable build configuration assets, but does Headless Mode work for anyone? I keep getting builds with GUIs

rotund token
#

are you using -batchmode?

coarse turtle
#

I can pass in -batchmode as a build instruction?

#

thought that was for the editor ๐Ÿค”

rotund token
#

you can just pass -batchmode to any built application at runtime

coarse turtle
#

o

rotund token
#

-batchmode Run the application in โ€œheadlessโ€ mode. In this mode, the application doesnโ€™t display anything or accept user input. This is useful for running servers for networked applications.

coarse turtle
#

o neat

#

im surprised that I have to do that now since I have an archive of old builds where i didn't have to explicitly launch the application with -batchmode

drowsy pagoda
#

I setup my code to take some scriptable object data and load it into a static class (cached array) which later the ECS conversion system reads from to author components respectively. This works in editor both play mode and live conversion no problem. But in player it does not. I think itโ€™s because the convert code in player is assembled much sooner than it is in editor. Where can I inject my build cache code so that everything will be ready for ECS conversion to read from?

viral sonnet
#

how would i save an EntityArchetype in a blob?

#

unity complains it's a pointer :/

drowsy pagoda
#

There are a few things I'd like to check during runtime and I have some debug logs in the Convert methods. I noticed that Debug.Log does not actually post logs in builds written in conversion phase. Is there a way to enable that?

rotund token
#

what are you trying to save?

viral sonnet
#

I'm back peddling. I basically have spell data in a blob and definitions for effects too. my archetype previously was very basic so the approach wasn't that bad. I have now saved the archetypes in a hashmap but I'm actually rewriting it to just have prefab entities for the effects that I want to instantiate. much cleaner.

rotund token
#

oh was going to suggest you check out netcode

#

it stores all ghosts components in a blob assets

#

it has huge meta data about ghosts stored in blobs

viral sonnet
#

oh cool, will check it out. maybe I can learn a thing or two

rotund token
#

it's basically ghostauthoringconversion.cs

#

1 mega authoring script

viral sonnet
#

what I currently have works, but I have to set data from the blob like duration and I could skip that with a proper prefab

#

or stuff like spellId. I rather skip this ๐Ÿ™‚

#

do you know why we need a parameter for conversionSystem.CreateAdditionalEntity. I just put this into it because I have no clue what it actually wants

viral sonnet
#

i've asked this previously, seems like the only way to create an additional entity in conversion stage is through conversionSystem.CreateAdditionalEntity but that has baggage i don't need like parent, LTW, etc... why does a simple dstManager.CreateEntity isn't working?

solemn hollow
viral sonnet
#

I can only make this work with conversionSystem.CreateAdditionalEntity(this)

#

and I've looked at the wrong entity before. the mentioned comps are not on the new entity, so this part is all fine

#

well funny, must have been the entity cache or smth. now it's all working ๐Ÿ˜„

#

i couldn't instantiate my prefab and the converted entities were gone in play mode

rotund token
viral sonnet
#

I'm still not getting why dstmanager.createentity isn't doing anything.

rotund token
#

it doesn't setup the subscene data that's required like SceneSection

#

so it's not attached to any section so can't get loaded

muted star
muted star
rustic rain
#

it'll throw exception and stop updating

muted star
#

Is the old debugging window also broken? I saw that it still 'works' in a video from TurboMakesGames but can't find where to open it.

solemn hollow
#

the old window works fine. should be where the profiler is

muted star
muted star
muted star
#

How can I stop entities from colliding and doing the weirdest things?
I need physics shape and physics body for raycast detection but I don't want this chaos to ensue.

rustic rain
#

hm

rotund token
#

just remove the body so it's a static object

#

(not sure what's up with your layers though)

muted star
lone harbor
#

Hello! Noobie question. I'm trying to change color of all RenderMesh. The material is getting changed but changes do not apply on entities. Please helpppp

rustic rain
#

I would assume it's just shared comp index in list

lone harbor
rustic rain
#

are you certain your shader uses that color field?

lone harbor
rustic rain
#

pretty sure you need to write special property through method

#

.SetColor or smth like that

#

but I don't remember what is property name

lone harbor
#

It updates the color slightly only on a first frame. As I said before, I can see in inspector that material's color is changing but entities are not getting updated

safe oyster
#

So, i decided to try ECS for the first time so I imported all the packages bit I got all this compile errors
im using unity 2022.1.8f1 and my Entities and Hybrid Renderer are on version 0.51.0-preview.32

karmic basin
#

It's now embedded in entities

#

Also unity 2022 not officially supported

#

From manual:

You must use Unity Editor versions 2020.3.30+ or 2021.3.4+ with entities 0.51.

safe oyster
#

oh i see

karmic basin
#

Any conflict you find will be yours to solve

safe oyster
#

i thought it includes 2022

#

thanks man

karmic basin
#

you're welcome

#

(maybe 2022 is okay, I'm just not aware if that's the case)

lone harbor
safe lintel
#

@lone harbor there are material property overrides for instanced properties(color etc). the hybrid renderer urp samples should have an example to go from, you dont need to/shouldnt touch the shared component rendermesh(unless you wanted to do that for all the materials sharing that chunk)

lone harbor
safe lintel
#

it should affect it that way, not really sure why

rustic rain
#

allthough...

#

it's definetely supposed to change even without applying shared component

#

since you change same material object

muted star
#

I'm currently trying to replace the Unity.Transforms systems with the deterministic UnityS.Transforms systems.

However the systems are nowhere to be found in the entity debugger. Only the custom system group seems to have been added.
Do systems have to be added in a specific order? What could be the issue here?

var world = CreateWorldSafely(_worldName);

        // Add Systems to World
        var slimmedUnitySystems = new List<Type>();
        for (var i = 0; i < _unitySystems.Count; i++)
        {
            if (_softFloatTransformSystems != null && IsUnityTransformSystem(_unitySystems[i]))
            {
                // Filter out unity transform systems in favor of soft float transform systems
                continue;
            }

            slimmedUnitySystems.Add(_unitySystems[i]);
        }

        var allSystems = new List<Type>();
        allSystems.AddRange(slimmedUnitySystems);

        if (_softFloatTransformSystems != null)
        {
            for (var i = 0; i < _softFloatTransformSystems.Count; i++)
            {
                Debug.Log("SOFTFLOAT " + _softFloatTransformSystems[i]);
            }

            // Add soft float transform systems
            allSystems.AddRange(_softFloatTransformSystems);
        }

        // Add my own Systems
        allSystems.AddRange(_customSystems);

        DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(world, allSystems);

        return world;```
misty wedge
#

Any tips on what to do if a job runs fine without burst, but fails when turning burst on? It throws a System.NullReferenceException: Object reference not set to an instance of an object with very little additional information, since it was compiled with burst...

misty wedge
#

What happens if source generation fails? My code still seems to run

misty wedge
#

If have no idea what is going on. All of my non-burst code works fine, but if I change it to burst it fails with cryptic errors. Arrays are suddenly out of range even though nothing in the code or setup changed

#

It's almost as if it was using old code somehow. Swapping from synchronous compilation to asynchronous also changes the error between runs, very strange

rustic rain
#

Have you tried restarting Unity? Or reimporting project

misty wedge
#

I already tried restarting unity and deleting the generated files in the temp folder

#

I'll try reimporting, but I doubt it will help. I'm guessing it's something wrong with burst, I don't know

karmic basin
misty wedge
#

Maybe that's the issue then? Although I don't understand why the non-bursted code would work in that case

solemn hollow
#

rewrite the job to avoid codegen if you think thats the problem

misty wedge
#

It has no code gen

#

It's all IJobEntityBatch

rustic rain
#

any example?

misty wedge
#

Of the failing job?

rustic rain
#

yeah

#

how it looks, how you call it

misty wedge
#

This is the calling code: var tileHandle = tilePathfindingJob.ScheduleParallel(_tilePathfindingQuery, 1, Dependency);, so nothing really special there

#

I'll post the job but it's pretty big

#

Like I said, it works fine without burst, but when enabling burst I get weird errors

misty wedge
rustic rain
#

so what are errors?

misty wedge
#

It fails before it even executes

rustic rain
#

kek

misty wedge
#

Well, that's all there is ๐Ÿคท

#

The actual exception is a NullReferenceException

#

Reimport seems to have fixed it thonk

#

That really annoys me since I know next time something like this happens I'll be poking around in the dark for a few hours.

#

Maybe I should just reimport each day ok_handbutflipped

rotund token
#

What version of burst

misty wedge
#

1.8.0

gentle harness
#

How do I build my project? Clicking build on my BuildConfiguration asset spits out "Build failed. There are no scenes to build"
I have no idea how to select a scene to build, and I can't click through the add components list

#

After clicking Add Component

#

After clicking Unity.Build.Classic

rustic rain
#

add component menu is broken for build assets, kek

#

you can either try creating required asset in 2020 version

#

meaning asset with all required components

#

or you can try adding them blindly, kek

gentle harness
#

I have tried lol

#

I can't use 2020 as I'm using runtime ui toolkit

rustic rain
#

no, you just need to create asset

#

then you can drop it into your 2021 project

gentle harness
#

What are the required components? I can search for it and then click Global to add it

rustic rain
#

uugh

#

scene list?

#

Classic Build Profile

#

General Settings

gentle harness
#

Got that

rustic rain
#

that's about that

gentle harness
#

When I click build

rustic rain
#

pretty self explanatory

gentle harness
#

Is it referring to subscenes?

rustic rain
#

no, it means scenes

#

all of them

#

you build none, kek

gentle harness
rustic rain
#

but you build through asset