#archived-dots
1 messages ยท Page 173 of 1
how big is big
several MB
hmm
it includes the collider geometry and internal engine state
no idea
i think i'll dig a bit more into that some other time
because it seems physics is gonna be the biggest chunk of my sim loop
and i technically just need 2d physics
i haven't checked it out but if it's similar to unity's box2d physics then it assumes everything is done on one plane
i basically have a bunch of different physics buckets on different planes and rotations, but the buckets themselves are 2d
basically Fez
2d game but 3d world
I do remember it having tags like the 3D physics
Which affords you 32 "buckets"
And a group ID which gives Int32.Max seperate groups
The 3D physics has this too
If two objects have the same positive group ID
They collide
ya i don't think i'll switch to tiny's 2d physics but it sounds relevant for current
If two objects have the same negative group ID
They collide with everything else except each other
And it's an int so you have 2.147b effective groups to work with
that sounds like it could be used to seperate physics planes
Of either type
Yep, but each body can only be assigned one group
Unlike tags which you can layer multiple on a single body
And using groups overrides any tag based collision
So I'd use it sparingly
i'll look into that, thx
Bleh, now the Entity Debugger is just flooding me with errors
relatable
QueryPhysicsJob physJob = new QueryPhysicsJob()
{
World = physWorld,
Position = new float3(0f, 0f, 0f),
Radius = 5f,
hits = hits
};
physJob.Schedule().Complete();
InvalidOperationException: The UNKNOWN_OBJECT_TYPE QueryPhysicsJob.hits has not been assigned or constructed. All containers must be valid when scheduling a job.
?
Seems like I assigned it right there, buddy
no allocator?
Assigning the alloctor made that go away, thanks
InvalidOperationException: The Unity.Collections.NativeArray`1[Unity.Physics.RigidBody] QueryPhysicsJob.World.CollisionWorld.m_Bodies has been deallocated. All containers must be valid when scheduling a job.
That only happens after it crosses into my sphere cast
Yes, I know I'm making a job and throwing it away each frame. This is just testing
It's also telling me that something is not getting disposed
i don't think you can reuse PhysicsWorld like that
try doing world = physSystem.PhysicsWorld
it's a struct so prob gets invalidated after a frame
need to dispose hits too if you're not
Ah, not persistent. That was it, thanks @hollow sorrel
oh my eyes just flat out ignored your hastebin lol
that gets me so many times...bunch of no-dispose errors, didn't change anything that should cause them
restart fixes it every time ๐คทโโ๏ธ - makes sense and all, just obnoxious it can't recover from that failure state haha
PlayabeGraph is a struct
does anyone know if it's possible to call Evaluate on it from a Job?
thats an interesting question
seems to compile
i dont have a real playable to test it with but it seems to work
NullReferenceException: The PlayableGraph is null.
Unity.Entities.InternalCompilerInterface.RunIJob[T] (T& jobData, Unity.Entities.InternalCompilerInterface+JobRunWithoutJobSystemDelegate functionPointer) (at Library/PackageCache/com.unity.entities@0.11.1-preview.4/Unity.Entities/CodeGeneratedJobForEach/LambdaJobDescription.cs:363)
That is super interesting...
I wonder if their animation is played on the main thread or is multithreaded
Anyone know the correct way to add a system at runtime? I'm currently trying:
var simSystem = World.DefaultGameObjectInjectionWorld.GetExistingSystem<SimulationSystemGroup>();
simSystem.AddSystemToUpdateList(rotSystem);
Some examples I've seen use ScriptBehaviourUpdateOrder.UpdatePlayerLoop(world); but that's obsolete and ScriptBehaviourUpdateOrder.AddWorldToPlayerLoop is the replacement. Conceptually I have no idea what's going on here though - I think I don't want to add a world to a player loop? I want to add a system to an existing player loop?
(this is for a [DisableAutoCreation] system that I want to have update in the SimulationSystemGroup)
huh yeah i'm surprised that the code you posted doesn't just...work. you shouldn't have to mess with the player loop if you successfully get your new system inside the simulation system group
yea I'm on struggle street. Messing around with ScriptBehaviourUpdateOrder.AppendSystemToPlayerLoopList but not having any luck or any understanding ๐ฅด
it just works tho https://gist.github.com/Piefayth/0ff4242aff17f151a9e6f0498785bf30
oh.. it could be that I have the wrong script on my gameobject ๐
haha false alarm! Thank you ๐คฆ
AFAIK, you only need to involve PlayerLoop if you're making new systems for a custom World, and you want them to tick over at certain times in the update loop
The cheap/quick way to to test is to call OnUpdate for each World system on a MB Update()
sure you can do that.. I'd rather not
What's your use case here? Like, timing and Worlds you're injecting the system?
same as the other day - I'm making an example scene of how to use my asset with 'pure' ecs
OK, I don't remember, honestly. Is it going into the default world or a new world?
default
This is what the whole example looks like if you're interested https://hastebin.com/xagaqoceba.cs
Instead of using the sorting, you could just use [UpdateBefore] or [UpdateAfter], and I think it auto sorts
ah sorry, yea actually removed that because it's not needed
Yup, but that's basically it for injecting into the default world
(at some time later that startup)
You don't need DisableAutoCreation if you want the system to always be there and waiting. That only serves to delay and take manual control over the injection
the point of that is to not have the example system run in somebodies project if they've imported the samples
That's a fair point, and appreciate you as a developer not doing things with samples that require cleanup, but still letting users use them quickly by adding a Component to some MB
I despise asset cleanup, truly haha
The asset I'm making also doesn't require entities to be installed so I was hoping to package the ecs examples into an included .unitypackage. Unfortunately the asset store guidelines say that's usually unacceptable but I'm hoping they make an exception. Don't know how else to include the examples yet not cause compile time errors (if you don't have the entities package installed).
I'd say... Put the ECS examples on GitHub, in correct PackageManager format, and then instruct the users to use an Add Package from Git URL
nah, this is an asset that less tech savvy people may be interested in
even I wouldn't really want to bother with that tbh
Or finding a .unitypackage and having to manage it, seems about the same level of technical expertise
It's pretty easy to add the git package, but maybe that's just because I know how to do it ๐ค
Not as "clean" though as unitypackage probably
I'm super used to the new workflow, not sure what 2018 and earlier 2019 versions have for Package Manager, another consideration
we'll see.. if both examples (GameObjects & Entities) are packaged into .unitypackage's and you just have to double click to load them, that's definitely my preferred route. If they don't accept that I guess yea, might have to be a git thing, at least for the entities examples.
i was wondering how an asset i'm using is keeping out the example systems, and they actually made authoring components for all their example systems so they can have [DisableAutoCreation] but to enable them you just slap the authoring component in your scene
oh what asset's that out of curiosity?
https://docs.unity3d.com/Manual/cus-layout.html - Maybe put it in Documentation?
asset is DOTSNET
Lol dotsnet
i'm gonna yoink it long term, because i have my own serialization and transport implementation, but it's quite nice to not have to maintain those things while experimenting
so how exactly does adding the authoring component work? does it add the system in awake or..?
it actually enables the system in an ICustomBootstrap. authoring component inherits from an interface, bootstrap looks through the GOs for it, if it finds it, it adds the system specified in the authoring component to the type list
doesn't that mean the bootstrap is running all the time?
do you know how ICustomBoostrap works
not really - I thought it was something like reflection that Unity does to pick it up and then run it? unsure
implementing this might not be worth your trouble, and it will send you down your original line of thinking (i.e. gotta fuck with worlds and the player loop), but essentially it's an interface that unity checks for your usage of at startup. takes a signature like Initialize(string defaultWorldName) and lets you manually create your worlds
then post-creation it does nothing
finally found an example of the updated api for that https://forum.unity.com/threads/failed-to-create-world.792432/#post-5275608
but.. isn't this bootstrap project wide?
derp yeah it would, hrm, i wonder how it picks which impl to use if there are multiple, or if it just executes both
I think it does all, yea
@dusky wind Have you been able to bind colliders to a skeleton rig, and then be able to switch it's mode from being Kinematic to Dynamic and back again smoothly with Unity Physics?
That's cool thanks @manic aurora - I think this way is pretty clean
Any ideas on the optimal workflow for this?
I believe my goal is to:
Instantiate entities based on GO's (which will likely in most cases pre-exist as a GO prefab), but I don't want any automated conversion workflow stuff, I just want to specifically ONLY add the GO reference components like Transform, Animator, etc in a nice clean way.
Right now you can see it has all the ECS physics and stuff applied if you just use convert and inject... I don't need any of that. Really I just need the entities to track location along with their GO counterparts (copy it from their transform) for some Systems to operate correctly, I believe.
Basically, yep
then i would separate the two worlds completely, and simply map entities<>go using Entity struct and GameObject lookup table
if you want to split them completely
My thinking is that I'll just use the GO systems for now and gradually translate back to ECS over time, so splitting them like that may not be conducive to gradually migrating them all back to ECS over time
oh
Not really sure
ye ok makes sense
But it is possible just to do a pure instantiation with none of this boilerplate, right? Except for an LTW or something
i thought u were doing entire game in entities and just using GOs for rendering
i missunderstood
Hmmmm proooobably won't end up that way. Would be cool if I could, hahah
depends on the game bieng built if its feasible or not to build all of it in unity ecs
Well, there's a lot of advantages for myself and my noobishness in being able to fall back on GO simply because there's a lot of documentation for it and a lot of stuff is "built" for it.
For example, I would have to convert an XR framework to work with ECS over game objects... that would probably not be the most fun use of time.
https://forum.unity.com/threads/dots-skill-system-repo-available.894007/#post-5875804
"That is why we are currently working on adding Enabled state to all components. This way you can enable / disable components from any job safely without changing the structure."
Whaa? That would be so excellent
Edit - repo available here https://github.com/WAYNGROUP/MGM-Skill
edit - Changed title to better reflect most of the content of the thread.
Hi,
I...
good summary of their philosophy for fps sample too
In DOTS Shooter we are simply pretending the functionality exists
nice change though
yea, really is about time enabled states dropped.. getting impatient ๐
well the whole avoiding using tags because of structural changes sorta melts away to a degree.. we'll see what it's like in practice
@violet cosmos can you instantiate a entity without the boiler plate? Like if I have a rigid body on my GO it wants to convert it to a physics body through the conversion process... how do I get around that? Need a more "pure" way to convert it than IConvertGameObject or whatever
@tardy spoke that sounds a little odd.. why would you be converting it in the first place?
Can i just say that the absolute mess that skull system repo is... just shows how much i don't believe in unitys ECS model, people have to put in sagnificant work just to get something simple as a skill system built
Then I can probably just make another system that copies all Transforms to Translations... hah.
@amber flicker I just prefer ECS over OOP ๐คทโโ๏ธ
It's how my brain works
@trail burrow yes, trust me I've reviewed that. But... A generalized skill system is a difficult task in DOTS
He's making a "build it up from pieces" system, which is what I'm looking at doing too
@violet cosmos yeah and it's hard because of the structure of unitys ecs/dots, not ECS in general
@tardy spoke you don't need to have any more oop - just leave the GOs out of subscenes?
and i'm just looking at it and going ... wtf are they doing
It'll be interesting over time to see if people come up with eloquent ways to do systems like that or if it will become to standard to use OOP for certain system designs
@trail burrow Yah, I didn't use it for that reason. A lot of it has to do with how they need to cast things for generalized parts
@amber flicker I stopped using subscenes
@tardy spoke without inheritance, complex generics, complex collections, etc.
i don't see it ever being easy to design complex game systems
in their ecs
It's not ๐ฆ
Actually, what I was thinking that having a multi-entity system is easier than one-entity-one-ability
so then follow up question is: what's the point of it? yeah sure performance... but like, you can just burt jobs+burst for that to get it where you just need it
@tardy spoke then I don't really understand ๐ - why are you converting them, however you're converting them. I don't see why that adds any more oop code.
@trail burrow Maybe. That's the challenge I'm looking at now. There's still some fuckery with generalizing an interface though. And, you get into this thing where there's a ton of small Jobs being scheduled, which may ultimately be bad.... even if they are all ganged up into one "mega job"
@amber flicker I'm just trying to use ECS systems on prefab game objects basically
So instead of Translation you are controlling Transform
@violet cosmos yeah, that's what happens when you throw 85% of a language out, calling your 15% subset "HPC#" and think you can create something better than people at microsoft who've been designing shit like this for 30-40 years.
I really need to finish this up so I can see some scheduling penalties
I don't think just because something is old it necessarily means it's good, hah.
Well, I mean all programming concepts are fairly old, but you know what I mean
Yeah you wouldn't need ECBs very often
@tardy spoke I've just been using EntityManager batch operations on the main thread, ecbs for conditional archetype changes ๐
public IPlacementProcess PlacementProcess;
public ITargetProcess TargetProcess;
public IMechanicsProcess MechanicsProcess;
public Schedule()
effectorJob = PlacementProcess.ScheduleInitialPlacement(transform);
JobHandle targetJob = TargetProcess.ScheduleInitialTargets(Targets, transform);
JobHandle mechanicJob = MechanicsProcess.ScheduleMechanicsProcess(Targets, transform);
JobHandle.CombineDependencies(effectorJob, targetJob, mechanicJob);
So, then scheduling dozens/hundreds of those under one big job, then calling that to be Complete() when it's all in schedule
@tardy spoke your systems should be transforming data. At various points that data needs to by synced with any GO representations. As an example, if you don't want to use Unity.Physics (ECS) then I would guess you will have a lot of pain if you're trying to use DOD/non-oop with physx. So I would choose your paradigm based on which objects you're interacting with maybe.
the inter-job overhead is too big for that to be a workable system @violet cosmos
@trail burrow That's my concern, now that I see the scheduling overhead for small non-homogeneous tasks is kind of jank
scheduling hundreds of jobs u will take 1/2 frame time just waiting on the scheduling overhead
There's no way for me to group these up either, each "Process" is a different lego piece to be snapped in to change the behaviour
we designed our own task system which runs inside of the job system to get rid of the overhead ...
@violet cosmos even optimized, taking work and splitting it out takes work.. the more threads, the more work
yeah the job system is pretty fuckin jank when you throw a lot of jobs at it
@low tangle oh yes it is
its like they built it for a small number of jobs and hoped it scaled well when everything became jobs
Yah, I've got this far before realizing Jobs has the same limitations as ECS... It's designed for homogeneous data/processes
@violet cosmos yeah, their archetype system... i mean yeah its fast for homogenous processing
but like thats.... not what games do
at least not game logic
What are you talking about? My favourite game is "1 million rotating cubes". Used to play that all the time when I was a kid.
i benchmarked archetype vs sparse set ecs models, and until you hit like 10k-20k entities sparse set wins and is much faster for add/remove/update/etc. all of it.
if the entire engine was ready for full homogenous processing of everything, which is totally doable, it would be great
and i dont see how they went down this route
But, I have realized there's benefit to breaking each "Process" down into an Entity. That will add homogeneous-ness back into it for ECS
but its taking a million years to finish even just physics and basic rendering
good question for mike
So I'd have:
struct Effector : IComponentData {
public Entity PlacementProcess;
public Entity TargetProcess;
public Entity MechanicsProcess;
}
@amber flicker is it really that different to modify the Translation component of an entity or the Transform component of a GO? Of course you lose all ECS performance benefits, but that's not a concern of mine, haha
I'm at the point now where I'm building a core replacement and only using unity gameobjects for rendering and skeletal animation
@low tangle we do the same
Then it makes pooling easier too
ready to eat the damn transform copy cost
@low tangle its not that bad tbh
assuming u dont have a lot of entities
or only do it on the ones on screen, etc.
if its not too much to give away, how did you plan out the bridge between the core and the unity world?
@low tangle we built custom physics (2d&3d), custom prototype (prefab) system, custom navmesh, etc.
everything bespoke
so unity is just rendering frontend
that's it
how do you handle unity's scenes colliders and what not
we bake into our own scene format
I'm thinking about post processing the assetbundles - yep
we have a custom scene format which bakes the unity scene so it can be loaded by our 'simulator'
I've got UGC to manage thats in bundles
@tardy spoke from what you've talked about before I think ultimately performance is a concern of yours? ๐ - but regardless... imo DOD isn't great if you're dealing with AoS and it's really tough to make managed code and existing libraries fit SoA
I was thinking about maybe trying to parse UnityFS / asset bundles
saw one reverse engineering of them on github
@low tangle the entire game can run outside of unity... i authored one game in unity and then ran it inside of Unigine 2.2 (other engine) when they added .net core support ๐
it was just a quick test, but yeah
thats awesome, I was thinking about doing the same but with a custom engine in a year or two
depending on engines at the time
if the core is already a isolated general ecs system you could port easily
@amber flicker having something I can work on is a bigger concern, haha. I haven't even been able to start building the world yet and that project will take years by itself. I can optimize it later by gradually moving the Systems back to DOTS when the functionality is available.
Maybe.
Haha.
we get most of the benefit when we host simulations on the server, as hosting a .net core process which can schedule things on its own worker thread system to run many worlds inside of one process beats the living crap out of hosting unity headless
i think we got something like 10x the scalability
you might want to cost analyze ECS vrs GO workflow, I've been using unity's since it came out, and while worth it I've also not really been able to finish the game fully because of its lack of finish @tardy spoke
All I'm saying is that by trying to DOD with traditional Unity stuff then I guess definitely try out entitas or whatever - something with decent tooling to work that way
i'd not use unity ECS workflow for anything i want to finish within the next 2 years
I don't want people to walk away from it as it is a fun framework and if you've only done OOP you should try it
but I dont think you can finish anything other than simple games on it, and dots is attracting people wanting to do complex games ironically
tyeah, it's a bit of a joke atm
and they are demoing awesome stuff
making ppl belive it's ready
when all the demos are just huge hacks
that BARELY work
held together with ducttape
Yeah, that's the issue, as soon as I was trying to get animations to work in a stream loaded subscene I just gave up. Is it possible? Maybe, for a better programmer than me - but in my project simply adding a skeletal mesh hierarchy to a subscene breaks it, an that's when I was like ... there's going to be more problems like this and eventually I'm going to hit something I won't be able to solve.
that and the nature of how it is right now, is that you build exactly for the thing you want to achieve, so the demos, are just demos
skeletal meshes are what broke me as well
all of my IK and animations are done with unity animators
It is weird how different ECS would be if they didn't do megacity for a demo and instead did something non-static lol
you just can't convert them
It's all optimized to build only mega city.
@tardy spoke you shouldn't even need to think about this tbh, unity say like "we are your engine team" ... well im sorry then my engine team fkn sucks lol
cos the engine doesnt fkn work
I wont say they suck, but I wonder where there priorities are sometimes
Its great for simple stuff and logic, but I wouldn't use it for anything beyond that
I like the ECS paradigm and I want to use it to code the game, but I don't actually want to be interacting with DOTS until it's way more polished. There's just toooooo many oddities that you can't do anything about.
Dropping a skeletal mesh into a subscene BREAKS it. How do I fix that? Lol, there's nothing I can do
So I can have a game with no characters
I highly suggest cutting your losses then and just structuring your MO's with a ecs like system.
Managers and flat data structs
That's what my plan was
Yah, that's the conclusion I'm coming to. ECS/Jobs are for independent things
Jobs and burst should still be used though
you can schedule from anywhere on the main unity thread
I'm trying to see if I can still use ECS to do it because over time I'm sure it'll get polished up and useful, but I also looked at Svelto.ECS which is promising, but I'd rather learn something "internal" to Unity than a third party
oh and all of the Native* structures are fantastic
yeah we use jobs as just worker threads for our own task system
@low tangle how many have they built now of the Native* ones?
Array, List... ?
Map?
Set!
array, list, map, theres a custom set someone made, oh and the maps can be single value or multiple value per key
and unsafe variants of each that skip all checks
https://github.com/fholm/unsafecollections here's every collection you'd need ๐
all in unsafe versions
I wish I could use those xD
theres also a fixed size list that can be embed into structs (mainly for ecs) but if your pointer copying structs they are nice
Array, List, Stack, Queue, Bit Set, Ring Buffer, Min Heap, Max Heap, Hash Map, Hash Set, Ordered Map, Ordered Set
@stiff skiff its MIT ๐
yep
You know, now that I'm thinking about it... I wonder if I could skip the JobHandle generation part of my code... And just break the whole thing down into one big parallel job to schedule, and keep all of the processes "job safe"
I know, but its a little tricky on my end xD
it's really tough to make managed code and existing libraries fit SoA
@amber flicker yeah, plan is to "not mess" with complex systems that I didn't build and use as is, IE will just use the regular implementation of XR framework, etc.
@stiff skiff yeah i know the feeling
@stiff skiff if you guys need them just ping me and we can fix something under a diff license
easy done
you have to make a decision at some point, are you here to make a game with the tools you got / the ones that work or are you here to play around and learn new tools
Exactly
@low tangle Yup, after a few weeks of DOTS fuckery, I want to get back into making something
I forget how the advice exactly goes, but its something like, each project when starting has a fixed technical debt budget, based on your and your teams talent, plus all other resources. using the newest tech costs you some 'techinal tokens'
the more you spend the less and less likely you will ever finish
using the tech you already know doesn't cost you anything
Well, tech debt with gaming is actually I would argue not a primary concern as most games have very limited lifespans of only a few years
For a SAAS company I feel it's far more important
Right
Sometimes - it's also just better to version lock your dependencies and wrap up development to focus on other things your game needs (marketing, integration w/ platforms etc)
So in terms of just "difficulty of development"? haha
custom engine - infinite cost
custom programing language - are you even trying to release anything?
new language to do the project in - lots of cost
new framework - some cost
new architecture style - some cost
you should try to innovate, but dont spend more than your budget can allow, otherwise you will be developing the game for 5+ years and you basically have to be a mega success (win the lottery) to make profit on that long of a development cycle
I think innovation should be saved for "experiments" and not "projects".
I've done major rewrites of my game 5 times since the project started and switched to ecs about two years ago
its always gotten better, but never any closer to the actual desired gameplay and quality I've set out to make
its been anywhere from fully monobehaviour, to full outside of unity oop to full unity ecs and now is a hybrid of ecs - mb
when I wrote it full oop/mb this most recent time, GC and memory pressure murdered the framerate I've had with ecs so bad I just deleted the entire branch
I'm at the point where I can keep hacking together my hybrid ecs solution with monobehaviours, or I've got to find some otherway to do it (core prototype)
Something I find interesting though is often it's not the speed of the code, but the speed of the idea. Switching from my own subscene streamer to World Streamer (which uses GOs) world streamer is actually more performant, because his implementation of the streaming is better... I would need to write some pretty good systems to beat it in performance for my game
a long time ago I tried going back to mb, im just not a good enough programmer to be able to keep the modules separate and it becomes spaghetti code too quickly with old oo mb approach
yeah the performance and clean structure of ecs systems allow for good rigor and isolation
yeah I'm basically trash at OOP/MB now
its honestly the main reason im sticking with it, not for performance but just modular nature of being forced to work a certain way
@safe lintel yeah that's my concern as well. That's why I'm trying to integrate ECS with MB / GO, haha
At least I can keep some of the game systems "clean" and decoupled
thats where I'm at right now with my codebase. for my game, I dont use any of the built in conversion system, it just doens't fit the needs of my game at all
everything is ecs first, which then command and drive gameobjects
yeah, that's what I'm trying to do right now
How do you instantiate your entities?
or get the "commands" to the GO's?
directly within the system spawning them
ok so you're spawning a light weight entity and attaching it to a specific GO in code?
if they touch gameobjects, those systems then end up having to be normal Runs and without burst
yeah
I've got a function for recursing and parsing a gameobject tree, with configs about whats attached, and a simple conversion interface, that allows you to add in regular components as needed
its not ideal, but it works for now
Yeah, I'll probably end up doing something similar
I just started so I'm just figuring solutions for that now
thats so you can still utilize unity prefabs
conversion utility just produces a nativearray of entitys, so you can massage any of the components inside afterwards
root is always element 0
So you avoid the use of convert and inject entirely, right?
yeah, its built on the assumption that you dont care about the gameobject afterwards
Right
even the convert and inject mode doesn't work right
So your physics system then is in regular PhysX?
using physics scenes, auto simulate and sync transforms off yes
but I'm really thinking about pulling in a custom physics engine at this point
@tardy spoke for reference, its not ideal and you should modify this to fit your game.
forgot two buffers
public struct ParentEntity : IComponentData
{
public Entity Value;
}
[InternalBufferCapacity(10)]
public struct ChildEntity : IBufferElementData
{
public static implicit operator Entity(ChildEntity e) { return e.Value; }
public static implicit operator ChildEntity(Entity e) { return new ChildEntity { Value = e }; }
public Entity Value;
}
@low tangle awesome! Thanks I'll try it out ๐
How expensive is the call like:
ChildrenComponent parentChildren = EntityManager.GetComponentData(parentEntityComponent.Parent, ChildrenComponent);
EntityManager.GetComponentData(parentChildren.ChildOne, SomeCachedDataComponent);
Lets say, I'm going to be calling that very often in the ForEach loop in Systems
you use the interface the same as unity's just without being able to convert other gameobjects there. its a limit of that system
profile it with 1000 calls a frame @violet cosmos
only way you can build up your rule of thumb for how expensive something is, is to profile it
@low tangle it's cool with all of it except this one thing haha
oh thats a gameobject cleanup system
I'll comment it out for now
its a system state component, that destroys the gameobject if the entity is destroyed
Nice ๐
struct LinkedEntitySystemState : ISystemStateSharedComponentData, IEquatable<LinkedEntitySystemState>
{
public GameObject gameobject;
public bool Equals(LinkedEntitySystemState other)
{
return other.gameobject.Equals(gameobject);
}
public override int GetHashCode()
{
return gameobject.GetHashCode();
}
}
[UpdateInGroup(typeof(PresentationSystemGroup))]
class LinkedEntityDestroyedSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithoutBurst()
.WithStructuralChanges()
.WithNone<Transform, RectTransform>()
.ForEach((Entity ent, LinkedEntitySystemState link) =>
{
EntityManager.RemoveComponent<LinkedEntitySystemState>(ent);
if (link.gameobject != null)
GameObject.Destroy(link.gameobject);
}).Run();
}
}
(Transform) [LinkedEntityState] - do nothing
[LinkedEntityState] !(Transform) - destroy linked gameobject if it still exists
when unity ecs destroys entities all managed components are removed first
I honestly cant remember if this system still works or not
haha. Alright I'm trying it now - am I supposed to have ConvertAndInject on or anything ?
nope
Strange, threw it on a sphere, doesn't show up in the entity debugger. No errors, though. Probably something I'm just doing wrong haha
Ah, thanks. I just had it my head it was a direct replacement for IConvertGameObject for some reason, haha
you could easily write this one sec
class ConvertToEntity : MonoBehaviour
{
public bool IncludeUnityTransforms;
private void Awake()
{
NativeList<Entity> entities = new NativeList<Entity>(Allocator.TempJob);
GameObjectToEntityUtility.ConvertGameObject(World.DefaultGameObjectInjectionWorld.EntityManager, gameObject, entities, IncludeUnityTransforms);
entities.Dispose();
}
}
I've got multiple ecs worlds so I have to be explicit where I convert things
@low tangle this is awesome! That's exactly what I was looking to build, this is so cool, hahah
happy it helps
I might see if I can mod it to detect authoring components and attach them to the entity it creates
yep should be doable
Well... if anyone wants to add their 2 cents ๐ https://forum.unity.com/threads/dots-sentiment.956936/
@amber flicker reading now!
@low tangle I think what you've invented should actually be a supported workflow in DOTS lol
Like "I want to play with it, but I want to use all of the tech I'm used to"
I mean the idea in general
Hi ppl ๐ im new in unity, and i discouvered somedays ago that unity will change to data oriented design, i was reading about design patterns (the book of gangs of four), so this pattern i think that are not useful with dots?
yeah hybrid workflow where you can still use monobehaviours you might got
@covert pelican understanding design patterns in general is always good ๐
a great ๐ thank you @tardy spoke
@amber flicker I'm gonna attempt to add my story, but I really hate posting on the forums lol.
thank you though, hope something good comes from this
thanks @low tangle - kinda weak sauce if it's only my opinion ๐
I replied
I just want to make sure that they are taking this seriously.. if they release a 'roadmap' like we've seen before..
@covert pelican Lots of resources here to help get started with DOTS ECS stuff!
Their marketing team should have their salaries docked for the DOTS expectations/understanding fiasco, straight up. A lot of what was advertised was vapourware, essentially. Marketing stuff that doesn't really exist is BEYOND agile. It's also arguably super unethical.
And there's nothing wrong with experimental software, but it should be marketed as experimental, which they SOMETIMES did, but other times kinda didn't.
@amber flicker good post
@tardy spoke I think that's a bit harsh. I think the engine team got really hyped because they made something really cool. Like a significant step forward for Unity. I think most of the issues stem from the (understandable?) mistake that was thinking Megacity proved out the technology and that with a couple of years polish they could start getting a great experience in the editor.
thanks @trail burrow
Well, they also said two years ago, that it was two years from most things being done with dots in the backend
now they say its going to be another two
i have so little trust left
which is frustrating because I took a gamble on that. dots team has a lot of talent in it, and I figured their two year plan was at least somewhat achievable
@amber flicker yeah, but they missed the mark by an absolutely massive degree. I can understand estimates being way off, but I have a hard time believing anyone internally working on this stuff thought these timelines were reasonable.
ah, think that was a good post too, and I haven't been here a lot (my ecs adventures are almost over for the time being), but I think those were the common points people mentioned here too
Lol yeah, we're all in this boat now having similar issues based on what was advertised
You showed me working projects, I assumed they were possible, right?
@low tangle i think 4 yrs from now is reasonable, if they dont backtrack and abandon it ... that is
And luckily for me my project isn't tied to any sort of need for profitability, but for some people they would be, and to me that's what makes it unethical.
If I had been in their position I would have been even more optimistic and reckless ๐คฃ - so I have a lot of empathy for it happening. It's what's happening now that I take more issue with.
I wouldn't be surprised if they abandon it because the amount of users using is likely very small, but I would argue that's probably because of the marketing fiasco.
back then I distinctly remember a form post saying, dont use this unless you dont plan on releasing for two years
I wish all of you good luck and that unity maybe focuses some more on getting every aspect into ecs and maybe make docs or examples that might be more accessible.
Think if I was to go the ecs route now, it would probably still a mix of doing stuff like animation, particles and rendering with the old approach, and maybe jobs/ecs for some logic stuff or heavy lifting
Lol, I don't plan on releasing for 2 years or more, but I still need to at least be able to BUILD the game in the meantime
yeah I've settled onto that hybrid approach, and its ass @minor sluice
oh..
it works, like you can do it and finish it
@minor sluice yeah that's exactly what I'm doing now. Using ECS to control GO's so that everything exists that I need to build
My issue with DOTS is over-reach and results in bunch of half baked things that have consistent blockers I would have rather had a bunch of tightly working things, but under a limited scope that don't have blockers.
Then, a road map of "These are the new things we're going to add" and can trust they'll also be a collection of tightly working things
I think you can't really use the performance benefits that much then? I never used it, does that work with SharedComponentData and you can't properly use those within jobs?
but there is so much mixing within those hybrid objects that you waste a ton of time just getting the lifetimes correct
and event systems are still slow as hell to write
which you really need them when dealing with MBs
@minor sluice I've largely given up on the performance benefits of DOTS, because I can either have a super fast game that doesn't exist, or a game that actually exists and I can scale it back till it runs, hahah.
yeah you pretty much loose all performance when touching any MBs, sometimes you can defer the mb touching to after the work is done, but that sync point and main thread foreach run negates a lot of the gain
I mean, you can make pacman and snake on dots for sure
Hmm, you could run multiple forEach loops on a few systems to separate out the logic before touching MB, but I dunno if there's much gain there.
in my current small game I pretty much have the enemies completely in ecs,
and the player is just a monobehaviour who syncs its position to an ecs collider. but it's a really small game.
I'd certainly try to go with ecs for a bullet hell though, (which this game was kind of a test for)
ah okay alex. Seems annoying, but I think that's the better choice!
I mean, in most real world projects you have some "big" systems that you get the most bang per buck for optimizing. For example, my AI systems is really where I would need to spend optimization time, and I'm sure even w/out DOTS I could get them to be performant
yeah thats what I've got all over, its a lot of extra mental weight to lug around managing them @minor sluice
@minor sluice yeah I ran into issues with subscenes and animations I just couldn't circumvent. Literally completely stuck. Adding a mesh with bones to a subscene broke the entire subscene ๐คทโโ๏ธ
but having the physics in ecs helps, I dont have that option due to UGC asset bundles
So I literally have no choice anyway and I'm worried more things like that will pop up
I can't ask users to convert to entities because asset bundles don't even have that option at all, let alone trying to get your users to use a experimental package thats been removed from the public repo list
there is one thing, outside of what was mentioned in the forum post above that I am kinda concerned about.
jobs + ecs is really great for performance, but if they wanted to push to make the performance by default the regular approach and lay the way-to-go concepts out in the future to be data oriented.. if they are still thinking about it..
it just seems like so such an accessibility reduction, which is the opposite of what unity tries to aim at in other areas it seems
I wish this workflow was supported by ECS... the "I want to talk straight to GO's" model. Would've been fantastic for people transitioning over that don't need to rotate a million cubes.
To me it's odd to throw out 15 years of tooling when you don't really have to... most games realistically don't need all the optimizations of ECS to be playable.
during work I dream about building a new engine built around a ecs framework first, instead of shoehorning it in... one day...
Svelto.ECS gets more and more appealing.
really wish unity would just spin off their own second engine and build it right
unity 2 : dots
Is Project Tiny even still a thing?
yea that's kinda what tiny is
haven't worked with bones or animation in that way in ecs yet, so I don't really have an acess to it.
you have used the gpu animation system from ante right?
there seems to be another project with animation stuff which is - i think it is just called dots-sample, but it might be the fps demo they put out with the networking.
oh yeah, what happened to tiny?
then you wouldn't have to tell 13 year olds that they shouldn't use it
The weird thing is how even people here, who develop DOTS aren't even sure of the state of DOTS lol
Like if anyone should know it would be us
tiny isn't even close to my feature set of a VR sandbox game with high quality graphics, physics, multiplayer and async UGC loading though
unless thats changed
idk what happened to tiny, the latest version uses like entities 0.5.0 I think last time I checked?
June,
just curious, how do you handle user generated content? because I think this might be something I#d like to try in the future too.
with the addressables system or the old assetbundles? and do you let users upload on a certain platform and make those files accessible to others, or is that however the users want to share it?
so they make their bundle and just send it to others how they want to?
Tiny probably had even less users than the rest of DOTS so it probably got put on the backburner
old assetbundles, custom manifest files
I was honestly hoping it would roll out w/ an update so I could peek at the workflow
addressables are just a bolt on vfs inside of the bundles
you can write an equivalent in a few hours
yeah, I think especially the people who are very active here should have an idea about the state of development, sadly that doesn't seem to really be transparent either ๐
ah okay june. what do you mean with the last one? you mean coming up with a system to read files from a certain disk location and load them?
well, addressables main 'feature' is that you can assign a path to a resource
so 'my/main/texture' is what you resource.load
I remember a post somewhere (I think it was on the forums) where they stated that latest alpha stuff would be going to a focus group (so select users/companies) - and it would roll out in later months - which is probably why there haven't been many visible updates
but that just first queries any resource loader stuff, fetching the bundles from servers or from a path, unzipping into a cache in appdata
which btw isn't secure
@coarse turtle wasn't that the visual scripting stuff?
is there an editor utility functionality that works like Resource.Load just for any path you want?
so like loading any specific asset file from any location without it having to be in an Resources Folder?
then loading that asset bundle and pulling the file from it, using a string->unityobject mapping within it
@coarse turtle wasn't that the visual scripting stuff?
@amber flicker Hmm I can't remember it was a few months ago
yes, because you have to manually assign every single object to the bundle
which is also bad workflow
imagine clicking every single asset you want to export for users to use and saying heres the virtual name for that
you can now manually make an asset bundle with that path
its awful for devs, even with a script to do it for you
hmmhh, I haven't really worked with addressables yet, but I planned to look into it,
sounds like this is probably still not a replacement for the old asset bundles though, apparently? even if it sounds like it in some descriptions
yeah, for modding its not ideal
for dev based content replacements its alright
like dlc
although, don't take my word for it, evaluate it yourself if it would work
and always make sure you don't just do surface level testing, try to do a complex prototype with it, real use case first
some stuff on the surface seems like it will work perfect, until you dig in and realize it doesn't support that, or would be a ton of work to do it in the way you need
ah, certainly. Thanks for the insight. user based content/modding would be the thing I'd look for too ^^
the sophisticated use case stuff that might not work or is supported, there is probably no other way that to dive deep enough into the project and see the use case for yourself first
Anybody know why my renderMesh's material is not updating anymore after an upgrade to hybrid renderer v2?
if I ever had access to unity source, the asset database and bundles system is what I'd replace to better support UGC
i wish you could compile a project to have a non baked down asset structure, like the old quake games. just untouched assets in folders where users could modify them as they see fit
yep, thats exactly it
unreal and unity both don't let you do this
no clue for unigine and cryengine but I'd assume they use the same
but, I think for models and textures at least, it won't be that hard to manually do? just that it requires a bit of additional effort or not?
there was an obj loader plugin I've seen and tried, fbx might be trickier
I mean, we have model creation and texture creation at runtime, so yes you can build a custom system
but its never about if you can do it manually, its about working against the engine
which that workflow does, a lot
memory hungry, awful performance
just think of early KSP, that was all obj loading from loose files in the game folder
install two mods and suddenly your waiting 10min at the loading screen, as unity shits itself with gc allocs
ah okay, I haven't been that into it to had those use cases for real, but long loading times and excessive memory usage sure sounds annoying
for non animated models maybe not such a big deal but for animated stuff ive only seen one 3rd party asset for rigged model loading at runtime
yeah thats because the fbx node format is pure ass, as is most model formats
parsing out skeleton data from them is not fun, let alone then doing the animations
what was that asset if you don't mind sharing thelebaron?
I think it is probably tricky with skinned meshes, but maybe if you have either the same bone hierarchy/naming conventions or at least adhere to the unity skeleton, maybe it works?
depending on the type of animation data, it might be just a bunch of quaternions or it might be a bvh tree with delta floats, or it might be a full k:v map of values to bones
like there should probably a preset model or information on how people have to set up a character with bone names and hierarchy so it could work?
model formats are retarded
yeah i imagine its not a simple task and honestly i dont think id like to base any significant work off of a somewhat unknown 3rd party asset no matter how well intentioned. it just kinda walls off a significant part of user modding that saddens me
oh yeah, that and unity's humanoid retargeting is hard to work with at runtime
are there also some issues with licensing if people want to make their fbx parser?
or is the problem that there are so many versions of fbx already?
well, fbx parsing is only a small part of the whole
just supporting skeleton mesh loading is not fun but doable, using an aforementioned parser, but then you have to take that skeleton and animate it. Humanoid retargeting? not easy (maybe not even possible iirc) so custom skeleton retargeting? or do you expect the user to use the same skeleton so your animations can apply to the same tree. that means your not using the humanoid animtion system, and suddenly every animation you can buy on the store doesn't work. unless you convert them
also good luck layering animations, onto that, like if the user added some small part that needs a small animation
btw good post @amber flicker imo they really need a dedicated pm or two for coordinating dots communication to the general public, like how well willgoldstone does for general unity stuff
i truly value every post joachim makes, its great to see someone so high in the company kinda talking about mundane or technical stuff with dots, but I wish all of their devs were that communicative, wouldnt need the pm people if that was the case
I also live for joachims posts like a fanboi
same with the havok guys, those guys are also awesome with the communication
oh yeah, I like how active joachim seems to be in forums etc. too,
he even replied to one post I had in the past, that felt pretty good.
layering animations sounds like a pain. probably won't try the skinned mesh modding part. but what is interesting, Sessions a recent unreal game has mod creators where they use completely different models for the humanoid animations,
but that was probably more a work of the modders than anything on the core game itself
yeah 100%
I don't think every dev there (or even some) should be expected to be active on the forums. That's quite a burden for an employee I think. I'd rather they did bountys for employees willing to write up a proper blog post and then pay for them to be edited/add images
unreals humanoid retargeting is even more manual, and per model basis @minor sluice
if your custom models are made to the same skeleton it does work though, which is how most unreal games were built for - common skeleton
oh not saying i expect them to be active, just saying I wish they were of their own accord ๐
have any of you wanting to do the humanoid stuff actually tried the dots animation / dots timeline packages? they basically have a whole bunch of stuff in there for additive evaluation of keyframes etc
I've used it once yeah, but its not even close at all for handling vr full body IK and animation blending
its got a simple two bone solver in it for arm or foot ik
heard that the animation retargeting is harder in unreal for example.
someone was explaining how to use it in this thread, was just reading it
https://forum.unity.com/threads/current-best-way-to-handle-animations-in-ecs.903824/
its another audio/animation graph
I looked for the timeline dots package but couldn't find it on 2019.4,
I guess that is a 2020.1 thing?
but invisible at the time, since whatever UI they built for it doesnt have it
i fire up the animation samples every now and then and then after like an hr or two i bounce off of it because I cant figure it out ๐
@minor sluice you have to add it manually - not sure if it's 2020 only
oh damnit, I forgot to mention multiple ecs world support in the post @amber flicker
edit button is your frieeend
its abysmal still, and unity builds everything in mind with there only being one world that things go into
on it
I think it's important the post isn't a damning of every missing feature though. It's about their communication (imo).
oh, is it a public github repo then? I think I didn't find it but I should check again,
you recommended me to check it for the animation curve into blob asset stuff right?
@minor sluice yea that's right - can't rember the git off the top of my head.. smth like com.unity.dots.timeline
what sucks for you about worlds @low tangle ?
thx, I'll check again
com.unity.timeline.dots
@dusky wind kinda yes... but there's not much in the way of ui.. also buy my asset when it's released instead ๐คฃ (half joke)
I swear the package manager fiasco is the stupidest likely product manager driven idea I've seen in years
@amber flicker do you allow your asset to be redistributed in open source games?
- manually ticking my other worlds
- loosing all GUI support for viewing systems running within (and their timing data)
- construction of their systems and the way you inialize their systems feels and looks really jank within a ICustomBootstrap, and its not exactly setup in a way where you can keep the default world, but you can.
- transferring entities between worlds is cumbersome since its either manual or all entities within a world (proxy world helps)
@dusky wind sadly not :(. Also I don't think I'll ever do character animation - it's meant more for tweening & ui and that type of thing but I do hope it helps bridge some of the frustration that exists atm wrt UI & seamless workflow across gameobjects, subscenes, entities, editor and code.
now I have the the qualified package name in front of me and I still can't find it 
there is com.unity.timeline but not com.unity.timeline.dots
and can't find anything like the second on the unity technologies github either
where are you 'looking' for it @minor sluice ? you have to hit the plus on the package manager and like leave it alone for a few minutes - it'll error if it can't find it
yeah I need full blown character animation, and I can't use any paid assets
yeah you can't do that in ecs, pretty much at all, unless you do the entire skeleton animation yourself
at least 3 months from an animation package that works I'd bet
I was regularly looking for it in the package manager in the search bar with the filter "all packages"
and for adding with +, I'd either need the package, a tar or a link to a git repository or not?
oh wow, didn't think this would work, let me try
thought it would have to be something like an https url to a certain website
nah just that should work
for some reason adding it this way vs manually editing the manifest file takes a looong time for me
I think it's because it's adding all the dependencies and doing iterations of compiling.. I think it's what would normally happen but with little ui feedback
thanks a lot! seems like it worked,
I wonder how anyone can find that out without help. either you have the right url or you put in the full package name in the manifest with the right version. For some reason I couldn't find something useful on it on google either (might have had to look further)
ha yea.. already wrote my piece about that on the relevant forum post
great, I hope this can help others too who are in this position,
although without you I also would have never found out that timeline.dots was already a thing ^^
er well I think I need to credit @safe lintel for finding that?
Can I use [BurstCompile] on pretty much any compatible struct that isn't a Job? ie: a struct that doesn't use references
@violet cosmos it's fine to use any value types in burst stuff afaik.. if that's what you're asking
Well, I'm structuring up some code... They're a bunch of structs that have data and some methods
I want to call a bunch of them in a loop, and would like if the methods were Burst, but not have to cram them into Jobs
I think it will just work if you call them from a bursted job?
[BurstCompile]
public struct MyStruct {
float Something;
public float MathsPls() { //work }
}
Like, does this just magically work?
from the previous messages, seems like thelebaron provided the right package name? so thanks too ๐
I think I didn't have issues with methods that were inside structs like those and are called from within jobs
and I also think that structure can make sense if you either just get a value that relies on a combination of other values in the struct or transforms the values in the struct somehow, without touching any outside structs or classes
@violet cosmos You'd have to test. I would expect it to depend on where it's being called from - I don't know if [BurstCompile] does particularly anything in that case but I would expect it to happen automatically even without that attribute if you called MathPls from a function that was burst enabled. I could be wrong.
How do I check it's running Burst?
The Timeline view in the profiler should say - you can also test the timings by turning burst globally on/off
seems like a lot of the times this is done with static methods in separate classes though.. perhaps?
I get that it would be a violation of the ecs concepts but I never understood why you couldn't have a method in a (component data) struct like that and call it because it seems more like a convention than anything
I haven't really found a case for methods in structs yet but I'm sure there are some. I make heavy use of static methods that are self-contained (i.e. you pass everything they need into them) - these are an important part of working with dots and I don't think they're an anti-pattern.
If you have a problem with methods within structs, you're going to have a big issue with DOTS in general haha
I don't have a problem with it. I just prefer to keep only data in structs where possible and transformations in systems (which can call static util methods)
in my old attempt of an animation curve (2 years ago) that was used in a job, for example I had the evaluate method as a method in the struct itself.
I haven't tested if it was really calculated on threads but
just dug out the code
public class BulletAnimScaleSystem : JobComponentSystem
{
[ComputeJobOptimization]
private struct BulletScaleJob : IJobProcessComponentData<BulletBDStruct, ScalingChangeAnim>
{
public void Execute(ref BulletBDStruct bullet, ref ScalingChangeAnim scaleAnim)
{
bullet.scaleMultiplier = scaleAnim.curve.Evaluate(bullet.lifeTime * bullet.timeSpeed) * bullet.timeScale;
if (bullet.destructionFlag != 0)
{
scaleAnim.Dispose();
}
}
}
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
var job = new BulletScaleJob();
return job.Schedule(this, 30, inputDeps);
}
}
lol, I'm not really sure how to do this since the "type" that will be returned is IComponentData. Trying to basically replicate what GenerateAuthoringComponent does.
I think I saw something like this in a library, let me see
foreach (IComponentData Idata in componentDatas)
EntityManager.SetComponentData(e, (dynamic)Idata);
maybe it works for AddComponentData too?
Awesome! I'll try it out ๐
I think the GenerateAuthoringComponent creates a internal struct during codegen
maybe it's trickier here, since you need an instance, but with new c#, I think you can just use default to get the default value of the type?
you will need to see how they did this, by pulling up the GenerateAuthoring source code in the package
Hmmm it's not complaining about it
ah cool
Yeah I was thinking I'd have to look at the source
oh, you already have the component instance here ^^
and I still will ๐
Looks like they're "special" or something. Digging into the generate authoring code to find out whats uuuup.
did the dynamic approach work?
Didn't seem to
I think you'd have to do new (dynamic)component , wouldn't you?
but it says thats an experimental feature or something hahah
not sure how dynamic would work in the context of creating a new instance, I'd probably try to work with the default keyword,
but you already have the component instances you need in the ICDcomponents array? so I hope there is no need for new [componentType]
Lol, apparently it's a big jorb
https://forum.unity.com/threads/dots-sentiment.956936/
@amber flicker @low tangle spent over an hour typing a wall of text in response 
fantastic post, just read it
thanks for making a nice well formatted one, ||I didn't have the energy.|| really helps the legitimacy of the post
Niceeee
@dusky wind well-written
heh tribal knowledge transferal, great description of the state of documentation and examples with dots
I'm used to this kind of stuff since my team at work lacks any form of good documentation internally
but having this on a public set of packages is new to me.
Said wording came from that.
kinda assume docs will be the slowest thing to materialize out of all of this. getting good docs for the renderpipelines and stuff has taken ages and imo still not there yet
Frankly, it's a joke they cant pull this together in 3 years
how long has quantum taken?
about 3 years
is quantum your core? or game?
Having worked in a company the size of Unity, actually no bigger.
@low tangle quantum is the deterministic framework i've built, which turned into a product called Photon Quantum
oh no shit? I just was looking at that product the other day
Yeah, im the inventor/lead architect/whatever u wanna call it
very nice!
Now the team is much larger than just me ofc
Though realistically, I've worked 4 years on something as simple as getting street names put into Google Maps.
wish it fit my usecase, looked really well designed
vr sandbox, user generated content, scripting, gameplay framework for users
3 years for an entire game engine is impact-wise larger than what I've done.
ah, we have been doing a lot of VR work lately
but dont think any of it is public yet
yeah, pretty used to that lol
but the user generated content bit is hard
everyones been doing stuff in vr but no ones putting anything out there yet
yeah its a real pain in the ass
we just fixed the 3d physics engines final issues with stacking and all kinds of crap ppl want to do in vr
next game is going a much different route, sandbox games kill studios
ahh stacking, still kind of a weird case in unity physics ๐
yeah i gotta benchmark their engine vs ours some day
i think they will still win because floats vs fixed point
if you have good stable stacking yours might be a win just for that feature alone
first is without fixes, 2nd is with
very nice
all deterministic, full predict-rollback
would love to see a box tumbling down a hill, then rewinding it back up
not very hard ๐
yeah but it looks so impressive
but dont have anything to record on this machine
no i mnean im on a osx laptop without even the code on it atm
using wives macbook air
oh gotcha
you can do infinite snapshots and go back to any point in time if you want, etc.
can do all kind of fun game mechanics
well, u will run out of memory at some point but
yeah ofc
@low tangle damn i thought you would be the last person to go hybrid, i remember you making such a strong case for ecs
you're one of the few reasons i became convinced a full unity ecs game could work hahah
i agree with what you said though, everything has been taking way too long and progress has been babysteps
i don't think it has become any easier to make a game in ecs compared to 12 months ago and that's a damn shame
I mean, I haven't quit, still am finishing with hybrid
but its rough, and I really hope unity start picking up steam again
it feels like they really slowed down
Not sure who GliderGuy is but their post just now is another interesting take
a pure ecs engine and game is 100% doable, but we're missing the tools we need, and were not any closer in a year of waiting @hollow sorrel
yeah i agree
definitely agree
I'm rolling back to my single threaded, every which way I turn trying to implement what I need in DOTS, there's some sort of blocker
its frustrating because, you know its good, and it will be good once its done
sometimes i wonder if they're making progress internally and are just holding off on releasing for a big marketed release but signs point to doubt
I mean, debug.log support came this summer
i feel like the last big update we had is like 0.3 or whenever they added ecb's/blobassets/subscenes
no idea what their gdc plans were but when it was cancelled i was hoping we;d get whatever presentation thing they had planned direct to online video, but then we got a shorter roadmap without any mention of dots, no new big demos etc
and blobassets feel very half baked tbh
subscenes are also kinda but at least they are usable if you use them exactly how they were meant
yeah but if your use case doesn't fit, then you cant use them at all
i agree, that the last year or so of development hasnt really had any big workflow/quality of life improvements compared to the initial release of conversion, and when unity physics was released(imo enabled a lot of stuff), i was hoping for a faster cadence on the other packages too
when physics was put out, they had the demo with ragdolls, so I took that as a sign that animation experimentally was on its way, which took another unite before anything showed up
not animation, I mean skeletal skinning
dots editor package is like handy, but for the most part the entity debugger has had all the same info and even more, finding out that editing dots data inside that debugger was literally one line of code that was disabled seems so cheesy
yeah that demo they had with the waterwheel and ragdolls...
yep thats the one
me too ๐ฉ
I'd been fine with putting together animations systems, writing the IK myself. but nothing, and now the new renderer is hdrp/urp only, and here I am sitting on built in
Systembase is a lot better than what came before
oh god yeah
dots editor package is entirely useless to me because of what june said before
* loosing all GUI support for viewing systems running within (and their timing data)
and worst part is not supporting custom ticked worlds for systems view is apparently by design and that really hurts my soul
I actually like the hiearchy information
I was like oh shit yes, new UI!
since I am constantly changing parents for some entities
but that's about the only use I have for it
meh id be just as happy with JobComponentSystem and the old IJobForEach if it meant time was devoted to other things(i know thats not how it works though)
oh yeah I agree
those jobs were not hard to write since I had, and still have a macro for it
newjobfor - tab - types - tab
The new ForEach does make it easier when working in groups though
Lots of overhead for IJobForEach though
I collapsed down to 50% of code length for a lot of things
I like how the new one grouped every single action you might want, plus the auto variable ref'ing for read only
i'm still using ijobchunk regularly because i'm iterating a different world from another world (prob not best solution for the job but works for now)
and entities.foreach doesn't let you do that
should prob make a macro haven't thought of that
highly worth
my old ones from a few months ago are still in here
https://discordapp.com/channels/489222168727519232/497874303463850004/705536768333840474
could modify em for you
On the other hand, my entities.foreachs now have some gotos, when that was simpler than breaking out functions
I'm very ashamed
dont be ashamed, if it was the right tool for the job then thats it
What would be the correct way to get an array of components? The interface seems to not want to show up
should send those to the dots team
maybe the reason progress is slow is because they're writing boilerplate all day and having someone else spend another day approving the commit
maybe the 10k file for foreach lambda's was written by hand
it all makes sense now ๐
In a system's ForEach, Is there ways to call something like Physics.SphereCast() with some special markup?
Old physics, Physx
in OnUpdate outside of any schedule's you can just directly use Physics
thats main unity thread there, so its alright
within .Run() and .WithoutBurst() foreach's you can as well
Hmm. That's OK to be on the main thread
yeah, its okay, and its also the only option for old physics
no choice on that
main thread is faster than you expect anyways
my game runs faster on mainthread only lol
I have like four half baked versions of this ability system, each blocked off at some blocker or another
thats it
set to 1 right?
technically its still 1 worker
thats what you tested with though right?
i dont know if zero works as just mainthread but im pretty sure thats what I was using
yeah, granted my performance will always be bottlenecked by skinnedmeshrenderer characters so its a bit hard to really scale up a meaningful test
yeah same boat
oh intresting, if you dont set it, it stays
have to restart unity or assign it back to max
Can someone help me with this code? All I want to do is lerp an entities color.
https://pastebin.com/GbEnMbme
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
When I hit play, I get a red cube and a blue cube, but they don't change color at all
The strange thing is that if I go back to Hybrid Renderer V1 it works fine
Are you using an SRP?
There's something in V2, like Material Property Overrides. Check into that
Hmm
Still not sure why that doesn't show up in inspector ๐ค
hcorion: Why not do that it via a simple shadergraph?
@proven minnow the example was not something I'm actually building, it was just a small test-case so that I could prove that what I was trying to do didn't work, and get help easier
Rest assured, if I was actually just alternating between blue/red I would just use a shader
Apparently you need one of these bad boys. Now it works.
Anyways, thanks @violet cosmos it was URPMaterialPropertyBaseColor that I wanted to manipulate
namespace Unity.Burst
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method)]
public class BurstCompileAttribute : Attribute
Interesting. So Burst can be used on classes and methods, not just structs
I'm fairly close, but I can't figure out the way to do a dynamic typing like this with Components. I think they will also have to have a "RegisterGenericComponentType" as well.
But apparently it's not recognized, outside of Jobs ๐
A list of components?
why?
I believe you can make a nativelist of components through the EM
An experiment
lol
I'm going around IConvertGameObjects and I need the functionality of "authoring components" still
@tardy spoke use the overload where you pass in type as param instead of <>
@hollow sorrel sure, does that give me some kind of alternative way to do the typing?
what do you mean
@hollow sorrel I'm missing how this makes it any different, haha
I figured out I can't do it, I just haven't figured out what I can do yet ๐ค
does entityManager.AddComponent(entity, icd.GetType()); not work
I have a feeling it will want generic types registered for all this
if you want authoring component like functionality, your gonna need to codegen the struct like unity does
@hollow sorrel good call, it doesn't error out so i'll give it a shot, haha
personally I dont, I just create a monobehaviour and the component for it in the same file
also you can .AddComponentObject(ent, this) with the interface I included
which will add the monobehaviour as a component, its just slower
Woah, it actually did work lol
@low tangle yeah I'm just hacking some stuff in there and I'll probably give it a re-write so I understand it better and to tweak a few things. It's awesome though. ๐
alright, no worries
Hey everyone,
Iโm returning to ECS after a long hiatus and want some advice on an interaction system. Use case is: a bunch of entities have interaction components on them which defines a distance radius, an interaction duration and a interaction string ID.
If player is within radius of the entity:
- Display a prompt with the appropriate string id
If the player is pressing the interaction button, count up to the duration. If the button is released before the duration cancel the interaction, if not count it as successful.
I think itโll be easy to have a system which checks if the player is in range and calls a UI function(showInteractionPrompt())
So my troubles lie in the UI aspects. Whatโs the best way to hide the UI when the player moves out of range?
How should I handle the hold?
Wondering if this is actually multiple systems and not just one :)
I guess it might be easiest to have a playerIsInRange and playerIsInterscting bool on the Interaction Component? This would mean I have a system for:
- Checking if the player is in range by comparing the radius and transform to player location (and if so checking if theyโre interacting) and updating the component accordingly with a currentHoldTime
- UI system that checks if the player is in range or interacting and then displays or hides the appropriate prompt
Any thoughts on this are appreciated
@low tangle you're right though, what I have there seems like it works for "tags" but to actually put the component data in I think structs is probably the best way
I found one method that was pretty hilarious though, at the bottom there. Hack city.
I need to forget DOTS exists, but it's kind of like just after breaking up with a person... You can't stop thinking about them and they automatically come into your thoughts out of force of habit
they basically boil down to having a file like this (due to monobehaviours requiring a their cs file name to match the class name)
linked just being a helper monobehaviour template
@tardy spoke i finished with huge solution that allows me to create assets with serialized IComponentData/IBufferElementData/etc and then generate adding components script. That way i don't do it manually and still can add components at runtime)
I need to forget DOTS exists, but it's kind of like just after breaking up with a person... You can't stop thinking about them and they automatically come into your thoughts out of force of habit
@violet cosmos I know that feel. XD
so you can just have the struct as a value in the inspector for that monobhaviour
ILinkedEntity is a obsolete older interface I haven't finished refactoring out
@low tangle yeah that seems like a pretty cool solution
abstract class Linked<T> : MonoBehaviour, IConvertToComponentData
where T : struct, IComponentData
{
public T Value;
public void AddComponentData(Entity entity, EntityManager manager)
{
manager.AddComponentData(entity, Value);
}
}
struct PlayerCamera : IComponentData { }
class PlayerCameraLinked : Linked<PlayerCamera> { }
@frosty siren sounds interesting, I'm basically just trying to use ECS to reference GO components directly and writing some tooling for that, haha. Basically using ECS with GO's instead of entities.
easy to declare a new component and a authoring mono for it in the same file
If player is within radius of the entity:
- Display a prompt with the appropriate string id
I think for something like this - you can produce a message (it can be an entity or an element in some kind of 'event' buffer)
You can have a system which reads this message/event and toggle the user interface.
So my troubles lie in the UI aspects. Whatโs the best way to hide the UI when the player moves out of range?
To hide the UI - you can probably cache the entity you want to do the distance check with.
// In your UI injected as entity I'm assuming
distance(player, targetEntity) > some_distance -> new event to turn off the event (can be another entity message or an element in an event queue) that signals you turn off the UI
In the end it might be a series of multiple systems from the top of my head (which is similar to what you mentioned)
- UITogglerSystem (will read that event queue or message entity and enable/disable the UI)
- SomeInteractionSystem
@rare umbra
name wise though I've switched to Authoring for things instead of Linked, as it makes more sense
Thanks @coarse turtle
np ๐
If player is within radius of the entity: - Display a prompt with the appropriate string idI think for something like this - you can produce a message (it can be an entity or an element in some kind of 'event' buffer)
You can have a system which reads this message/event and toggle the user interface.
@coarse turtle
Canโt I just use the interaction component for the UI to figure out what to display? Sending a message is fine except the data already lives within this component, although I guess some iteration and calculation needs to be done every frame
Might be an easy place to start but your way seems perhaps more optimized?
Yeah I don't see why not in using an InteractionComponent with bool fields. I assumed there's like 1 player you want to check with, so you can have a system which performs the distance check and the interaction check and continuously update those bool field.
For you guys who have worked with Unity Physics package, are there any major gotchas? As in, things I would expect to work, but just don't?
I think by going the event route by design you can add more systems which do specific tasks based on the events. (I think something like damage an event messaging system would be a good idea - where you want to spawn maybe like a particle effect, play some audio, and apply some physics to the player, or lock their controls temporarily).
So it might scale better based on the needs of whatever you wanna design. @rare umbra
@violet cosmos i think you already noticed but one thing of note is colliders are immutable shared data (blobassets). in physx you could just morph your colliders every frame by changing dimensions, here you'd need to allocate, destroy and reallocate a blobasset every frame if you wanted to morph or change a collider
Yeah, which is good and bad...
For static entities, where there's a few, I can save a lot of memory with complex colliders
With something like... Resizing the capsule around a VR player as they move and crouch, it's a bit expensive
i think that'd be fine, you'd just have a seperate collider for standing and crouch
but for games that have constantly changing hitboxes like fighting games (i imagine @dusky wind is gonna/has run into this too) it sucks
Well, the person changes height all the time, depending on the game. You want to match that, ideally frame by frame
ah yea that's true
But, really.... I just wish Unity had a way to cast into PhysX in Jobs. That's like, the reason to experiment with Unity Physics, but it's all or nothing
I'm not sure how to do it though
Basically, you allocate a new collider
delete the old one
and use BlobAssetChange to update it
but I can't seem to find how to use it
it's a bit concerning that all of the colliders are immutable blobassets
yea for my game as well
haven't benchmarked recreating blobassets yet tho
updating physx colliders wasn't free either, so if it's still cheaper than that then whatever
still sucks api wise tho
I'm pretty sure it is
PhysX definitely was heavier than just malloc/freeing two blobs
Alternatively if you know your sizes ahead of time (i.e. frame data in fighting games) you can preallocate them and just update the BlobAssetReference.
Which I might try to do.
@low tangle apparently there's also a toolbar > Jobs > Use Job Threads which should make everything main thread i think, for ez testing
i would imagine setting the jobsutility workerthread thing to 1 would still have a seperate thread for jobs? not sure tho
anyway my game is barely doing anything yet but it more than halves my sim loop from ~0.75ms to 0.3ms in editor (but even in release build i was getting 0.5-0.6ms before)
which is very sad
time to just make a singlethreaded game i guess
That's what I'm regressing on.... and optimizing it for single threads
Sure would love to Jobify it but, blockers
from what i'm seeing you're better off staying single threaded ๐
for small scale at least
not sure where the tipping point is
I think if you have large sets of homogeneous data, DOTS (Jobs and ECS) start to work
Or... If you have a very expensive isolated calculation, Jobs works fine spin that up
... and, yah. That's it
I'm rewriting my ability system, both to isolate it... But also because I learned how it could be done as a mega-job, if those blockers are ever lifted, so I want it easier to convert over to test
But, it's going to be single threaded
Instead of MonoBehaviour though, I'm writing it as discreet classes that have references. I'll loop over those, and keep the Update loop out of it's business
And right now, I can't use anything Jobs (for core gameplay systems) unless I convert my whole fucking game and all internal packages to Unity Physics, because someone forgot to write any useful way to query the PhysX system
Not update, just query. Raycasts and Overlap and those bread and butter things that make games work
Where I'll probably use Jobs in the future, is for the Proc gen and possibly a custom lighting solution. Because those are expensive tasks that I can queue up
toolbar > Jobs > Use Job Threads
@hollow sorrel danke
just got back from a break, great timing
that definitely does force mainthread but not sure what the equivalent for doing that in a build is
is that from 2020?
eh use job threads has always been there afaik?
am I blind, because I dont see it
must be
hehe, the first time I opened up 2020.2... I added a cube as a child of another cube, and the child cube got all skewed in a non-affine way
I was just like, wtf is this trash?! hard uninstall
I'm on 2020.1, about as close to the edge as I want to get with Unity.... Mostly because there's some new things I want to use to send data to the GPU later
2020.2 has been great for me so far ๐คทโโ๏ธ
just checked source
[MenuItem(kUseJobThreads, false)]
static void SwitchUseJobThreads()
{
if (JobsUtility.JobWorkerCount > 0)
{
savedJobWorkerCount = JobsUtility.JobWorkerCount;
try
{
JobsUtility.JobWorkerCount = 0;
}
catch (System.ArgumentOutOfRangeException e) when (e.ParamName == "JobWorkerCount")
{
UnityEngine.Debug.LogWarning("Disabling Job Threads requires Unity Version 2020.1.a15 or newer");
}
}
else
{
JobsUtility.JobWorkerCount = savedJobWorkerCount;
if (savedJobWorkerCount == 0)
{
JobsUtility.ResetJobWorkerCount();
}
}
}
thought jobworkercount minimum is 1, but just checked and seems docs also say 2019 = minimum 1, 2020 = minimum 0
lol figures
yeah I was able to set it to 1, but it still was running the one thread as expected
I need a mentor for Hybrid ECS/ Job System if anyone can help me. I can compensate for the time ;-;
what is it you want help with
Well I need 1000 agents go towards the nearest marble and destroy it. Having a lot of agents call the coroutine to calculate the distance between itself and all the marbles (which are also 1k), is pretty heavy
so I am hoping to do all the calculation via ECS to fix that
The dots system is not beginner user friendly and there is not much information about it but I would like to learn from someone who does understand it
Do you have ECS in use now?
Everytime I tried to write one up, I keep reverting it back because I hit a roadblock. I just have the normal MonoBehaviour script
That's why I need someone to mentor me :(
@low girder https://github.com/DOTS-Discord/Unity-DOTS-Discord/wiki some articles and stuff to get started. I'm terrible at DOTS/ECS, but it's not so bad once you get the basics.
A good idea would also be to look into just optimizing your code with jobs and possibly burst, and avoiding switching much over to the actual DOTS stack unless it's really necessary for the performance.
Will a different type of optimization not work, like calculating solutions less frequently, etc?
@tardy spoke thank you so much for the articles. I will have a look at them.
Hmm not yet. I have a coroutine that has a foreach calculating the distance between the actor and the marbles to find the closest target. Will having it yield return new WaitforSeconds delay make an impact?
I'm open to any kind of optimisation, I'm just very amateur with my programming skills atm
@low girder is this a part of your main project (if you have one)? or are you just experimenting?
asking coz, with unity ecs, you will need to rewrite your entire code base. (mono + ecs, is a lot of headaches and sleepless nights)
whereas, it might be beneficial for you, imo, to just use the job system and the burst compiler.
I assume that actually simply using a yield that returns a wait actually possibly could give you the performance you need, haha. Other solutions might be an iterative approach that calculates the solution for specific marbles per frame, but that's probably more work. If the yield per results does the trick, that's great!
Not to say learning DOTS/ECS isn't interesting and worth the while. It's not quite "finished" yet, and difficult to develop complete projects with since not all the pieces are quite there, but it's still pretty cool to mess around with.
@deft stump it's for a test project :( the code I have is super simple so I dont rewriting. Isnt it possible to just have it as Hybrid ECS?
I am open to other dots system, it's all the same to me since I have zero experience in either of them
Yeah, it's theoretically possible. Sometimes ECS/DOTS and Monobehaviours and game objects don't play together as nicely as expected though.
For example, they use a different physics system... hahah...
Maybe checkout the Job system first.
mgiht save you a lot of headaches.
here's a vid explaining and implementing one
https://www.youtube.com/watch?v=vSxcZVfJn74
Oh I see. Alright then I should focus on other solutions since this is for a test after all. Thanks Alex
Thank you mfragger
https://www.youtube.com/watch?v=KwwHvH3GZsQ <-- take a look at that to get an idea what you're in for since that's doing at least soooomething along the lines you're looking for.
Awesome! well i've looked and followed many. All It achieved was frying my brain. If those don't work then I will have a look again about optimising the code
Is there a reference sample of how one should go about having simulation world (fixed timestep) separated from presentation world?
https://www.youtube.com/watch?v=KwwHvH3GZsQ <-- take a look at that to get an idea what you're in for since that's doing at least soooomething along the lines you're looking for.
@tardy spoke Why do I need a billion lines for OnTriggerEnter
I'm thinking of using unity ECS for agent based modeling
This text really confused me. It says "you should use the equality operator, not relational operators". Then in the example it uses a relational operator. Can someone clarify it please?
https://www.tutorialspoint.com/csharp/csharp_relational_operators.htm
that looks confusing,
so for me it read like "use == and != instead of <, <=, > and >=" but then they use just that
I'd say it depends on the use case for what you need
second sentence says "singed integer overflow is a defined behaviour in c#". I just googled it and found this: https://stackoverflow.com/questions/26225119/is-c-net-signed-integer-overflow-behavior-defined. which means if I add one to 2147483647, it gives me -2147483648 back. Therefore, the sentence is invalid and the example below is valid
yes, that's what overflow means, not sure how frequent this case is with version number increases, but it looks like they consider it happening in real use cases since they mention it like that
have a question too
What is the preferred way to do frequent entity composition changes in a query,
I'd like to:
- avoid to copy large amounts of struct data by using refs instead of value copies,
- the behaviour mostly makes structural changes, so it might be better to directly use an EntityManager instead of a command buffer
but I can't have an entity foreach query with an entity as param when I also add new entities within the query (even if I call Run() so it is synchronously executed)
so..
could the preferred way be to make an entity query, get the array of the entities and the componentDatas and then iterate through the indexes, with getting the elements with ref returns from the array?
hold on a second. If b is more recent, it will give me -2147483648 back. so if we back to the example, it makes no sense.
It works out with how numbers are actually represented in binary
For an 8 bit number, 127 is represented normally, and -127 is basically written as 128
I do not think ">" operator would check if the first sign is zero or one for negative or positive
There are more details, but the gist is similar
I think this is why they're recommending subtracting
the issue is that this is a fringe case,
so there can be times where it wraps back to -2147483648 and then this is the case but it should be rather rare,
but let's examine the example,
(VersionB - VersionA) > 0
means version b is more recent
if b wrapped and has -2147483648 and the other has like 2007483648, this is wrong yeah
since the difference would probably be positive, even though versionB as an int is negative
0111 1111 is 127 in binary, 1000 0000 in one's complement notation is -127 even though literally speaking its actually the decimal equivalent of 128
@minor sluice i would probably try to use EntityManager.SetArchetype if possible and set the component data on them if required in burst. If memory serves you may also be able to AddComponent/RemoveComponent individually with a query. But generally this is a big problem, if you use an ECB it will create an archetype for every intermediary step and copy the data around when you add/remove components which is pretty damn bad. In the future when they get the enable/disable componnt in, then you might be able to just disable instead of remove which would be way faster.
@solid flume does not the first bit from the left side, represent the sign of the number? -128 should be 1111 1111
In one notation, yes
Sign magnitude does that
But in one's complement, the negative of a number is it's binary inverse
127 is 0111 1111 and -127 is 1000 0000
The first bit tells the sign
The last 7 tell the magnitude
alright so -126 is 1000 0001
Yep
One's complement does have its issues though, and as far as I know two's complement is used more often
-x is ~x +1
Essence stays the same
I only know a certain archetype component set, I will still have to manually add/remove some components
(also just found out that ref returns won't work with native arrays, so that approach kinda falls through)
I just thought that.. since command buffers just schedule operations to be executed synchronously the same way like you'd do it with EntityManagers anyways, if there wasn't a better way t directly use the entityManager
Entities
.ForEach((Entity entity, ref EnemySpawnSource spawnSource) =>
{
// since we're iterating over entities, can't add additional entities like this, would need to use a command buffer, but is this the best approach?
Entity enemy = entityManager.CreateEntity();
}).Run();
maybe I should correct, it is not only adding components to existing entities, it is also creating new ones (and only adding components to them),
might switch to an archetype approach later as it is more performant, but at the moment I'm just curious about how to best approach this
some elements in spawnSource componentData are changed in the operation too
maybe there is a possibility to predetermine all the components I need and choose an existing archetype based of it later, for sure.
why do not you want to use command buffers?
there are already ecbSystem updates like preinit.
Alright I have got a snippet:
oh, have only seen the endSimulationECB so far.
I am wondering what's the best practice here?
using the right archetype initially certainly to avoid having to move the entities back and forth between different chunks - but then also how to set up the entity composition commands in the best way?
I think I just go with the command buffer for now, thought it would be possible to just use the entityManager, but that's maybe more of an issue than I thought since creating entities within a query like this can invalidate the query and unity doesn't allowit
a isn't greater than b, but what does a-b evaluate to?
Even if you think about it in terms of overflow, it'll be 1
@sick agate thats how integer overflow works on signed integers
@minor sluice usage of entityManager directly from your code should be avoided. It creates a sync point which means all of your jobs that ongoing must be completed before entitymanager do its job. using command buffers for this structural changes is the best way they say, since there are already predefined sync points for different ecbsystems
If it was in fixed width font you'd be able to see that the bits in the upper debug log is 1 less than the lower one
Since the very first bit is 0
but isn't it exactly the same with the command buffers? just that the sync points are created at later times and batched?
I also intend to run this query on the main thread synchronously
so I thought that those sync points aren't really an issue
@sick agate okey?
this is how signed integer overflow works
not sure what to tell u
dude I do not want to repeat myself just check my upper messages if you want to get involved rather than being a smart
I think the question is how to find a reliable way to determine whether the version number of one is really "higher" then the other. since overflow can expected that might be really tricky
hmmhh, that's a good idea
You could just use a byte array
what happens to -20 for example when casted to uint?
More work than unsigned but theoretically it goes as high as you want it to
what happens to -20 for example when casted to uint?
@minor sluice maxvalue-20
iirc
oh, sweet, that would be very convenient
Also, is Entities package not available in 2020.1?
alright it makes sense now, I thought the example for the sentence that talking about comparing version numbers
they changed the visibility settings of adding packages in 2020.1 afaik
read up on how twos-complement works if you want to know why signed numbers act this way
thast's what the representation is called
2s complement or twos complement
^
for signed binary numbers
I'm talking a lot but I legit just learnt 2s complement 24 hours ago
College courses just started
also if it looks "weird" that the lowest number is 1000 it's not... you're still "counting" towards larger numbers by adding 1001 etc.
for common number formats in c#, isn't this just the one bit at the start of the number which determines the sign?
@minor sluice there's three number formats in C#
int, float I assume and?
they changed the visibility settings of adding packages in 2020.1 afaik
@minor sluice I have preview packages enabled
But entities doesn;t show up
twos-complement (for all integer numbers), IEEE-754 for floats, IEEE 754-1985 for doubles
oh okay
tho double is just an extension of IEEE-754, but technically it is its own format
You can still add them by editing your project manifest, or by typing in the package name under Add package from git URL in the Package Manager.
well, that is annoying
Why though
seems like this is what was with the timeline.dots package I wanted to use too, just that I wasn't using 2020.1 but 2019.4 still
@solid flume because they thought ot themselves: how can we make this even more convoluted
obviously.
The supposed reason is because people aren't thinking twice about installing potentially non-QA'ed preview packages
then they should push less non-QA'ed packages, not making it more convoluted to install them
I partially agree
Also apparently there's no visual feedback for using the git URL until unity actually freezes and you realise it's fetching the package for you
There definitely should be better distinctions for the quality of a release
so now they either magically have to find the forum post or ask here if they want to use a package in a new project with 2020.1 that they already used before. Sounds like a good solution 
