#archived-dots
1 messages ยท Page 286 of 1
?
Visual Studio for instance...
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....
Lol
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
Ouch
lol
Ok, I'll leave it to you for now. Going to run to the store. Let me know what happens!
ok enjoy!
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....
it'll default to whatever is in port 0 but you can definitely choose your drive when installing windows
welp clearly they hide the options, as i didnt see them lol, although i suppose it wont matter soon as ill be installing linux a couple weeks, yay
think you'll find you have less fun with unity
yup, ill choose ubuntu so atleast i am allowed to have support, unlike other distros
all i see is complaints on the forums from users using the linux editor
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
do you have a rider license?
no i do not
because entities only supports visual studios and rider
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
not on ubuntu you don't ๐
hence i was asking about rider as it's the only supported ide
wine breaks visual studio im guessing?
last i heard (a year ago) it really doesn't work well
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?
oh, welp that is annoying
^
considering how little code gen exists in my project, i could probably get away with this
IJobEntityBatch and etc
i dont even know what codegen is lol
i see another easier solution
because you can't really write extremely fast code with entities.foreach
because you can't properly utilize changefilters
use whatever on ubuntu, then for building go to windows
o_O
is that it?
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?
yes
but WithChangeFilter on Entities.ForEach is a (mini) sync point
you can only avoid this using IJobEntityBatch and checking it yourself
source generators is part of dotnet/c#
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
so I guess
i dont really know what that means im afraid lol
{
if (!batchInChunk.DidChange(this.EffectHandle, this.SystemVersion))
{
return;
}
any example code?
yeah
oooh
I remember that code
in Transform system
interesting
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
this is 10,000,000 entities
processing my entire condition, event, action, timer jobs
in 0.6ms
welp
if i turned off filtering it'd be in the double digit ms
I see your point
woah that is a lot of entities, the most ive ever gotten up to is 30 thousand before my computer drops to 1fps
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
with the whole code gen situation, does unity actually use the ide, or does it simply look for files that the ide has?
why though?
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+
but why does the ide need to support them, what role does the ide play?
oh ok
why does your ide need to support c#?
because that's your coding
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
only for psychopaths ๐ฉ
determination drives you into dark work flows
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?
what your saying makes no sense
?
nothing stops you from coding in notepad, kek
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?
but you use IDE for it's features, not because it's fancier
why?
because that's how you write code
yes, but why does unity need to use the ide?
p;2234T342GRDEFGOIJFGOPIUH 1632PO89HTIHOP45TTGIUOHPGS
once again - nothing stops you from using notepad for coding, sir
it isnt like the ide uses unity,
how is this related?
it doesn't need to use an ide
you need to use an ide
you'
why, usually i dont need to do anything, it does it for me
go try to code smth simple in notepad and report with results xD
i used to do that when i was about 8-10, never again will i do that, it is ok sure, but now that i know ides exist, it is nicer
go try and program c# in IntelliJ
what is intellij?
a java ide
you use IDE for this
this is Unity integration
notepad doesn't have
unity doesn't use anything
same
you can run unity without an ide installed on your computer
how is that related to anything?
to expose those poggie woggie features to you?
you'll never know if smth is serializable without compiling, running and restarting
and here goes IDE
literally showing it
as you write code
you keep saying the same thing
yes, but why does unity need to use the ide?
but unity doesn't use an ide
if it doesnt use an ide, then why is visual studio needed for building????
it's not
and why cant ms build be installed without the ide?
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
this conversation could have been 10 minutes shorter if you had said that at the beginning
๐
this wasn't the conversation
then what was?
the conversation was just that source generators are only supported in rider and visual studios atm
nothing to do with compiling
that's what unity uses to code gen entities.foreach etc
once again, we come back to unity using an ide!! The track is circular!
NOOOOOOOOOOOO
STOP
He didn't see the lead up
rider/visual studios is not required for unity to use source generators
ok
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
and why are those errors bad?
because if all you get is errors from your ide
you may as well code in notepad
because it's now useless
oh god
im used to coding with errors, that is what i did a few months ago
It obscures the real errors...
you can just disable the error message usually
no, im an idiot, that is what
i'm going to the shops, i can't handle anymore
A little dramatic...
no it does not in visual studio code atleast (although that ide has other issues)
True you probably can disable it
exactly, the loop repeats once more!! so why does source generator ide support matter then?
because if Unity generates code and your code editor doesn't support it
it will never know code is generated
or interpret it wrong
it is shown
when?
when you open it
ive never seen it
dont open it then?
?
you have to explain stuff as simply as possible, i am extremely stupid and bad at tech and coding
nah, I'll just leave it as it is, kek
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?
if you wanna learn you can google that question
then you might want to reconsider doing programming
im terrible at literally everything, atleast when im programming i can pretend that the reason people cant understand what im doing is cause it is tech stuff and not cause i dont know what im doing either
๐ฏ๏ธ
i have literally spent over 40 dollars on courses teaching me how to google lol....
i just dont get it
Googling really is a vital skill at all levels of programming
exactly, and i am unable to gain it
Some times it dosn't work
when it doesn't then it is nice when you can find someone to help
But
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
Keep practicing Googling each time and you will pick it up a little more each time
i do keep practicing, and using courses, they dont help, i havent gained any skills at googling, not even a little
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
where?
is there a discord channel specifically for idiots like me that dont know how to google or something?
Ask on channels or sites relevant to what you are trying to Google, not on Googling itself...
StackOverflow for instance...
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
Maybe not StackOverflow... They're not nice to people trying to learn...
it is ok lol, it is kinda dumb to hide errors, but my computer is not ok and hiding the errors is the best solution lol
ye, i learned that quickly lol
eh, but i learn so much slower than anyone else lol
Doesn't matter how fast you learn as long as you go in the right direction... ๐
which way is the right direction, as it feels like im not going any direction, rather a stick in the mud
Trying and trying new things is the right direction...There is always a solution, sometimes it is just hard to find...
lol, i always try and try new things, but i never find solutions to stuff, atleast if i do find solutions they always have major flaws
Yet...
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 ๐
nice lol, ill keep trying, i always do, just even when i do find the exit to dark rooms, it always feels the same, no reward, only more dark rooms
It's definitely can be like that with computers...but as you learn more there starts to be a lot less dark rooms...
lol
Well, I guess I'll get back to my project and see if I can capitalize on my new understanding...
i wish you luck!
Thanks! You TOO!
lol
hmm i managed to build with il2cpp finally, although entites appear to not be there, is there some special build setting that enables entities?
What do you mean. Can you share a screen-shot?
sure, i dont see how a screenshot of nothing really helps, but i shall oblige you nonetheless
Well, the context of the nothing is really what I want to see...
Entities = GameObject?
no that aint how dots work, you see entities are quite different from game objects, they do not inhabit the same world
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...
lol
wondering in the build asset is there some setting that you enable entities for il2cpp perhaps?
No clue
unfortunate
Google this: unity entites not showing with il2cpp
the entities dont exist entirely btw, i know this due to my game object and entity sync system
So more precisely: they are not being spawned?
they are not
Any errors or warnings?
you cant see errors and warnings in builds right?
What about during build?
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
Lol
Chillin ๐
lol
Are you suppressing any errors or warnings?
i hope not
wait no, i am
i have integrity checks disabled due to this dropping me from 60fp to 10 fps
Errors and warnings are your best friends!
Can you run it without IL2CPP?
yes, mono works well!
im just interested in trying out both and comparing performance and stuff
Are you building in Release or debug?
release cause it was the default option, should i try debug?
Yes, I think you should get Log files...
Ok
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
oh i didnt know that, where can that be found
it has finished building now
that's just build settings
thanks, ill report back if im too stupid to find it!
why does loading build setttings always take so long lol
ok ive got the settings set to faster builds, now after about 14 minutes ill report back!
woah that was faster then expected
it crashed after only a couple seconds!
here are the crash reports incase these help
any ideas?
yes cause it crashed when trying to build
oh editor crashed?
yup
ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 0000024DEF4319D9)```
seems to be your issue
oh unlucky, which module do i need, or should i just go through a checklist of some type?
* Assertion: should not be reached at C:\build\output\Unity-Technologies\mono\mono\metadata\class-accessors.c:86
some funky stuff going on here
what exactly does that mean
likely
my computer is old and a tad weird
oh, that is odd
i don't think it's even started the il2cpp build
oh
and there are 2 separate stacks here
very weird
C:/Users/Calvin/AppData/Local/Temp/Unity/Editor/Crashes
what's in this folder
i shall check brb
2 crashes
1 from ages ago
when i learned the hard way not to use tif files
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
although clearly not perfect, im still getting the weird white lines across the screen if i move the camera too much
wrong channel?
i use Dots 0.51 for project, i can't make component play animation, who can help me?
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;
}
}```
Not sure if it's valid to have JobHandles in a ElementData. But you can check the generated code and see what is up if you look into the error.
Yes I just checked, apparently it's not valid to have JobHandles in a ElementData. Thank you!
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 :/
i would say it is
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
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
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
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
my effects will not be high frequency. smallest I'd think is something around a second
if you do find a great pattern do share ๐
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.
ah, auto vectorizer doesn't like it probably. otherwise it shouldn't break it, i mean, there's no condition really
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
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
it's just very fast
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?
typically yes
cool, thanks for the info!
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
oh i havent heard of IJobEntityBatch before, is that a method, or is it a seperate class?
ok cool, once ive eaten some breakfast im gonna mess around with it then!
it's actually not that hard to get into it and I think it's much nicer ๐
ooh im excited to learn it then, thanks so much for the info everyone!
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 :/
dang, I forget - but do ISystemStateComponentData work with the conversion workflow? i.e - does the component get added to the entity?
afaik they are excluded
kk, ah well, not a big problem to work around I guess
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
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
Why does my Camera not get converted in a subscene? ๐ค
Here's why after some digging: https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@0.51/manual/hybrid-entities.html
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?
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
Oh right, so specifically the MAIN tagged camera can't be converted, but other cameras can?
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 ๐
i'm saying outdated stuff. sorry. since when is this a thing?
HYBRID_ENTITIES_CAMERA_CONVERSION been there for years
it was originally on by default until they identified issue and hid it behind a precompiler
learn something new every day ๐
[...] 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.
yep it was me. i guess my only real problem with it is that its not documented anywhere (havent checked the new doc for it yet. maybe it is now).
Can I store the result of diferent jobs in a single native array?
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 !!!
i would consider it likely possible, i personally am making a fluid puzzle game that is half dots, and half not!
how do you manage the collision? as far as I understand:
- 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.
i manage collision a tad stupidly, for everything that needs to both collide with entities and game objects, i simply create 2 versions of, one entity version, and a gameobject version, if this object needs to move, then i have a script that syncs their positions, albeit it does take quite a while to get good optimization with having to move an object every frame, but it is possible
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)
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 ?
im not much knowledgeable on animation, but yes it is possible to transfer that kinda data stuff between gameobjects and entities, although cause entity components cant contain methods, you will have to get used to using system bases as a middle ground to grab and give data
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!
aha makes sense coolcat, thank you very much for your tips. bon apetit!
i would advise to use Jobs and Burst and stay with GameObjects. ECS comes with its own overhead and mixing physic engines sounds like a bad idea. syncing between entities and gameobjects is also rather slow. so i think you are far better off with only jobifiing your bullets
+1 for Manarz answer
PhysX and entities physics are two separated simulations you gonna get yourself headaches :p
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.
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;
}```
So its probably just that the Editor Window cant find this world anymore that you are trying to display in edit mode
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.
so game objects and process the projectile instantiation / hit/ disposal with Jobs and Burst? much asking but do you know by chance any resource to see this? thanks a lot Manarz!
I think I can loop over all worlds somehow and do it that way. Thank you @solemn hollow
yes thats the only way i know of
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
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
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 ๐ฆ
I was scared you were gonna say this ๐
is there any default method for raycasting? Or is it still something that has to be manually made?
there are examples in sample probject, it's in pinned messages
thank you so much!
@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
Isnt that what i linked? is there something else ?
@solemn hollow oh yeah it is, sorry just having my coffee now ๐
no worries. i might have missed some other api. better to ask ๐
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
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?
@muted star my understanding was when you move entities to another world they get remapped.
Do you mean that their IDs change? I just tried logging the entities and the IDs seem to stay the same.
In the inspector however the entities are shown as invalid so they must have changed somehow ๐ค
I'll have a go and read this, maybe I'll understand then
I'm moving them
how?
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
well, your moving entities is sync point
yes but it doesn't happen so often ๐
that's not really true
they all have to update in one frame
so your worlds will be updated one after another (I assume)
yes but the jobs are independent
every frame, in sync
jobs in simulation world will continue running if jobs in presentation world are forced to complete
but you don't need 2 worlds, to do achieve that
nnnope, that's not how it works
yes I do when there are structural changes
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
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?
but during execution of 1 world, second world is either haven't even started execution or is already forced to finish
System updates are done only on main thread
yes I know but in my example the simulation world jobs stay untouched and continue running
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
they atleast have to be remapped in cases where the entity index already exists in the destination world. so its generally not safe to rely on entityIndex to identify an entity across worlds.
Can you show a profiler screenshot where we can see the 2 worlds executing in parallel? im also a bit skeptical.
The worlds aren't executing in parallel. It was just my understanding that structural change sync points don't cause a different world's jobs to be force-completed.
but I could be wrong of course
yes but i mean that would mean we could see a job from world 1 run parallel to a job from world 2. i dont say that isnt possible. im just not sure how that worldswitching is handled
there's some system in vanilla Unity
that calls CompleteAllJob
which makes it impossible
man would that be awesome to run worlds on diffrent "mainthreads" and schedule jobs from there lol
but main thread is only one
and I have a feeling
world really needs "the real" one
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
Do you mean EntitiyManager.CompleteAllJobs()?
yeah
"A world owns both an EntityManager and a set of Systems."
it'll block main thread until all jobs are finished in world
so whatever you are trying to do with 2 worlds, is just not possible
okay :p
but second world will only start execution after 1st world is finished
they are forced to finished
before world execution is over
and only then second world will run
but the point is he doesnt want to run the second world in some frames
in that case he can just put his simulation into some variable rate group and update it however he wants
presentation will still have to run every frame in order to draw stuff
yes that would be the approach id go for
whay do you mean by that?
in case of structural sync point?
all within one frame yes, but jobs can run over multiple frames
of course
sure jobs can run over multiple frames. the problem is syncpoints force them to finish too often
TempJob can run up to 4 frames. Presistent can run forever theoretically
ah
now I get it
but still, world will ensure it's finished though
before second world can update
only if you couple the dependency to a syncpoint
and if you don't you'll get a mess, where job might get scheduled before first is even finished
at very least Unity will throw some errors at you for that, I think xD
As far as I experienced Unity wont throw errors if you schedule too many jobs. It will just queue them.
I mean
if you schedule job
and then on next frame you schedule it again
but first scheduled is not even finished
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.
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
I don't think that that will prevent structural changes from force-completing the jobs scheduled in the different update group.
why is that even a problem?
they will have to force finished at the end of frame anyawy
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
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.
jobs can run over multiple frames and aren't forced to complete unless you explicitly do so (or if there are structural changes)
so instead you'll have a terrible lag whenever you try to copy your data for presentation, since you'll need to ensure simulation jobs are all finished
I'm no longer copying but moving
isnt there a way to run jobs across sync points? system dependencies are synced. cant you circumvent that by handling dependencies yourself somehow?
it's irrelevant, point is that you can't read data that is being written
Yes I already have a solution for that problem
im pretty sure before you can move entities all jobs concering them have to be completed. so again a syncpoint which will cause the lag
That would be a good solution. ๐
Yes there is a syncpoint in the simulation world, but only after all jobs in the simulation world have completed (I coded it this way)
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
why simply designing a simultion that just meant to update every frame (or tick) is not an option?
id see it working with copy maybe cause you can copy incomplete data and not wait for jobs maybe but moving seems wrong
Yes nothing will move to the presentation world. But the presentation world will do interpolation and pretend that it is being updated.
whatever you are trying to achieve is extremely hacky
Copying would be more convenient but has bad performance
Nah so far it's pretty lit ^^
what type of simulation are you going for that you cannot run your jobs in 1 frame?
Pathfinding. Local avoidance and more. (deterministic) All the complicated stuff you need for an RTS
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)
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
simulation world is not actually running at slower refresh rate
but the important logic runs at slow refresh rate if that makes sense
No as I said presentation will happily interpolate and make everything seem fluid
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
yeah, just design your game around updating normally
in 1 frame do the pathfinding for group 1,2,3,4 and in next you do it for 5,6,7,8. etc
instead of literally wasting a lot of main thread time to just move/copy entities from 1 world to another
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
Maybe I won't move anything at all later. I could switch to a command pattern later with the principle staying the same. I'm just trying it out right now.
besides
Does your game have deterministic lockstep networking? That's what I'm going for and I think your solution would make it a lot more complicated.
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
no it doesnt. but i do think you can find a way to deterministically balance work across frames.
thats all
Yea it's definetly an option I'll have to consider. Maybe it's not so bad ๐
Nice solution!
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
I just tested my theory and it seems to work as I imagined.
I'm constantly doing structural changes in the presentation world and continually scheduling long running jobs in the simulation world.
In the profiler you can see that the simulation world jobs have already been running for over 20ms and haven't been force-completed by the structural changes in the presentation world.
are they actually long running and not just new every update?
they are new every simulation world update right?
Repost, would appreciate if anyone knows.
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
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.
but this struct is not per entity right?
Oh I'm not working in the context of ECS, just plain old job system and Burst.
ah alright. you could maybe do some factory that returns a struct setup as you need it. other than that idk
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)
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
yeah, that's why its not usually advised to use ECB to instantiate(unless you really need to organise the structural changes)
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
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?
called it ๐ what a change, lol, all because VS is a steaming pile of ...
whats this Visual Studio thing ๐
when iteration time is improved, very welcome change
it slows down dramatically on code-gened code
or when having projects loaded like Unity.Collections
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
vs 2022 is even worse
dammit 
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
this is really starting to tempt me to try Rider
except I can't really afford it
how can you afford vs2022?
the community version
ah i see. yeah, sadly rider has no community version. just a trial :/
maybe a student license or smth
if you have a student email, you can get 1 year of jetbrains products for free (Includes Rider and Resharper)
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
for rider? when does this happen? can you buy a month and then use this version forever? ๐
12 months of uninterrupted subscription payments qualify you for receiving a perpetual fallback license.
All yearly subscriptions include a perpetual fallback license.
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!
to be fair unity subscription really gives you nothing these days
it's just a legal requirement ^_^'
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
It must be local and you need to add "withreadonly" method
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?
Why managing components is a problem?
You simply need component type array which can be made through infinite options kek
Yes in my test I schedule a new job every frame.
It says that the jobs have been running for over 20ms
and FPS are high
so now your simulation runs as slow as pathfinding :S
Its just a test :p
i sure hope your pathfinding doesnt block all cores for 20 ms xD
main thread is always clear and that would still be ~50 updates per second ^^
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 ?
Physics have a lot of checks in editor
Can't really remember how to disable them
turn that off
turn off jobs debugger
turn off safety as well if you just want to test max performance
Thank you ! I try this. performance are really better with Integrity Checks disable
yeah it like halves performance
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
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
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)
hi, is there a way to turn off PhysicsCollider in ecs?
you simply exclude entity from physics world
remove shared component
If you want to keep the simulation, you could change de CollisionFilter of the Collider too, look at th "Modifying Collider" exemple in the documentation : https://docs.unity3d.com/Packages/com.unity.physics@0.51/manual/core_components.html
well, you can take a look in profiler to figure out why it took so much
otherwise it would be just a blind guess, kek
how are you spawning them?
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
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
});
...
you can burst that as a job though
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
yeah you definitely need to burst compile that setting component data
I'm not sure to understand how to setup components in batch. Should I have a second system that initialize value with burst after the entities are generated with the right archetype?
first you ensure they already exist, even if values are default
your prefab must have them
then
you can make IJobEntity job
or IJobEntityBatch
Yep, the profiler said that the AddComponentData is the costly operation
and do your random init inside bursted code
that will also take advantage of CPU cache
I don't want it bacause I want the particle to be configurable, so having them prebuilt in the prefab is not an option (i think ?)
your code above has no condition?
not about having values on them
but if that's also the case
you can add components batched
and then set values through job
What do you mean by condition ?
you're adding ParticleMovementComponent to every entity you just created - why is it not already added on the prefab
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
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
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 !
yeah, it's one of the workarounds I was thinking about, was wondering if it's possible to disable collider without removing data from the entity
can i use Physics2D.OverlapXXX in jobs?
yeah, just remove shared component of physics world
without this component entity is excluded from physics
no need to remove collider or body component
Does the physics continue to simulate it i this case? Gravity as example ? I understand that demminik want to keep the velocity and gravity apply to the entity with the collider disable on it.
Okay, thanks !
are you talking about this one?
yeah
ok, I think it's suitable for now, thanks
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
you instantiate thorugh EM
if you need to instantiate a large amount of entities then yes just use the EM.Instantiate
and then run your job that sets up components
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 ?
foreach/IJobEntity code gens into ijobentitybatch
you can do specific optimizations with IJobEntityBatch though that aren't always possible otherwise
Thank for the answer !
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?
you use authoring components for that
for Unity's meant workflow at least
does this work if i want to set it to something that's returned by a function?
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.
it's a quadratic problem. at some point I don't want to write the combinations by hand
i can solve it, i just wanted to know if i'm the only one dealing with such a problem
I don't really see how it's an ECS problem though
i could do it the naive way and use a bunch of conditions and AddComponent to the ECB but that's painfully slow
what are you even doing?
I thought you just instantiate entities with specific archetype
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
so your concern is about how to handle processing of it?
not instantiation?
ooor?
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
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)?
2021 is the only way, until they port ecs to 2022, kek
@rotund token I remember that you were talking about making a DOTS serialization library a couple of months ago. Did you ever release that?
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;
}
he'll be on in a few hours. to answer the question, no he didn't
you can't have a managed list in an IComp. use DynamicBuffer instead or UnsafeLists (although that's really advanced)
Sad times ๐ฆ
sadge
that said. mesh data is better off in another data type. ecs is not well suited for that.
anything I should use instead?
the reason I'm using this at all is because I'm going to be updating meshes at runtime
totally depends. is it some knd of voxel data?
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
hm, for prototyping I'd stick to DynamicBuffers then.
alright, good to know
I haven't released it. I wrote a bunch of samples then procrastinated on documentation and distracted myself with effects
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
find some testers ๐
I'm sure there are plenty of volunteers here ๐
hmmm, is it possible to Remove components based on Write group?
basically Remove all components of write group X?
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
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
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 ๐ค
You just know where the entity is created and destroyed
Just break point on that or put in a log
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
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?
I have a basic stupid question do subscenes not working with [GenerateAuthoringComponent]
neh mind they do just me being stupid again
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 
why use that field at all?
from what I see, it's made for debugging purposes
yeah but if I just want a system to run once only ๐คท
use OnStartRunning?
but I had problems before with that running more than once
well, it will run again if at some point
your singleton cease to exist
and then appears again
that's kind of the issue I was only using enabled = false in this case for debugging
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
are you using -batchmode?
I can pass in -batchmode as a build instruction?
thought that was for the editor ๐ค
you can just pass -batchmode to any built application at runtime
o
-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.
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
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?
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?
this is a bit confusing to me
what are you trying to save?
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.
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
oh cool, will check it out. maybe I can learn a thing or two
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
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?
its for the mapping system. it just tells the additional entity from which gameobject conversion it came. so that for example the conversion can be retriggered in liveconversion.
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
because it's called conversion not creation ๐
I'm still not getting why dstmanager.createentity isn't doing anything.
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
In my editor, re-opening the systems window doesn't solve the issue anymore ๐ค
Bumping my question again. Has anyone experienced this problem before and found a good solution?
Debugger windows are pretty bugged ngl
Even simply removing systems will result in window getting broken
it'll throw exception and stop updating
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.
are you doing stuff with the editor world too? if you delete that somehow the error would always pop up i guess
the old window works fine. should be where the profiler is
Oh thank god that this one works ๐
Not touching the editor world ๐คทโโ๏ธ
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.
disable collision between them?
hm
why is it dynamic if it's just used for raycasting?
just remove the body so it's a static object
(not sure what's up with your layers though)
I tried that before and it didn't work but I'll give it another try soon
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
you are getting shared component from 1
I would assume it's just shared comp index in list
Yes, I have only one unique RenderMesh and using index 1 because 0 is default
are you certain your shader uses that color field?
I use URP Unlit shader
pretty sure you need to write special property through method
.SetColor or smth like that
but I don't remember what is property name
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
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
Uninstall the com.unity.dots.editor package
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.
oh i see
Any conflict you find will be yours to solve
I figured it out. The problem is that setting color doesn't affect hash of the shared component. That's why Entities API doesn't do anything
@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)
Understood, but why material color change doesn't affect entities at all? Is that because Unity create BlobAsset from material internally?
it should affect it that way, not really sure why
have you tried changing it the way, so hash is changed?
allthough...
it's definetely supposed to change even without applying shared component
since you change same material object
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;```
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...
This is the stack trace: https://hastebin.com/qedenowuko.hs
What happens if source generation fails? My code still seems to run
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
Have you tried restarting Unity? Or reimporting project
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
I expect it would run with previous/outdated code
Maybe that's the issue then? Although I don't understand why the non-bursted code would work in that case
rewrite the job to avoid codegen if you think thats the problem
any example?
Of the failing job?
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
Mainly this one
so what are errors?
that doesn't seem like complete stack trace
kek
Well, that's all there is ๐คท
The actual exception is a NullReferenceException
Reimport seems to have fixed it 
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 
What version of burst
1.8.0
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
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
What are the required components? I can search for it and then click Global to add it
Got that
that's about that
pretty self explanatory
Is it referring to subscenes?
Hmm
but you build through asset